From: Arun Persaud Date: Sat, 2 May 2009 18:58:25 +0000 (-0700) Subject: Merge commit 'v4.3.16' X-Git-Tag: v4.4.0.alpha1~7 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=ea750683ac62717dd7346de17b5ae072622ff92a Merge commit 'v4.3.16' merged changes from Alessandro Scotti and H.G. Muller back into the main line. They changed quite a lot, so it's really more a merge of the changes from v2.4.7 to v2.4.8 into their code. This is the initial merge, there is probably a lot of cleanup that will follow. Once this is done, v4.4.0 will be released. --- ea750683ac62717dd7346de17b5ae072622ff92a diff --cc AUTHORS index 6cc928b,6cf36e6..16400d4 --- a/AUTHORS +++ b/AUTHORS @@@ -1,126 -1,138 +1,142 @@@ - Contributions of xboard and WinBoard authors by file - $Id$ - - 0. Files covered - - The first group are included in the xboard distribution. The second - group are included in the WinBoard source distribution but not in the - xboard distribution. All are part of the joint xboard/WinBoard source - base and are covered by the same copyrights and licensing terms. - - FAQ.html - backend.c - backend.h - backendz.h - bitmaps - childio.c - childio.h - cmail.in - cmail.man - comment.in - common.h - config.h.in - configure.in - engine-intf.txt - frontend.h - gamelist.c - ics-parsing.txt - lists.c - lists.h - moves.c - moves.h - parser.h - parser.l - pgntags.c - xboard.c - xboard.h - xboard.man - xboard.texi - xedittags.c - xedittags.h - xgamelist.c - xgamelist.h - zic2xpm.c - zic2xpm.man - zippy.README - zippy.c - zippy.h - - winboard.rtf (compiles to winboard.hlp) - config.h - defaults.h - resource.h - wedittags.c - wedittags.h - wgamelist.c - wgamelist.h - winboard.c - winboard.h - winboard.rc - - bitmaps/* - bitmaps.xchess/* - - 1. Wayne Christopher - - Wrote from scratch (I believe) bitmaps.xchess/*80*.bm. Other bitmaps - in the bitmaps.xchess directory were derived from these by shrinking - and some hand-tuning. By default these bitmaps are no longer used. - Their copyright status is unclear. - - 2. Chris Sears and Dan Sears - - Wrote from scratch parser.l, xboard.c, xboard.h, xboard.man. Parts - (sometimes small) of these files were later moved by Tim Mann to - backend.c, backend.h, childio.c, common.h, frontend.h, and parser.h. - - Chris and Dan's original work is copyrighted by Digital Equipment - Corporation with licensing terms similar to what the X Consortium uses - (see the file COPYRIGHT). All the work listed below is copyrighted by - the Free Software Foundation and covered by the GPL (see the files - COPYRIGHT and COPYING). - - 3. Tim Mann - - Wrote from scratch FAQ.html, backendz.h, childio.h, comment.in, - config.h.in, configure.in, engine-intf.txt, ics-parsing.txt, moves.c, - moves.h, pgntags.c (split from backend.c by Jochen Wiedmann), - xedittags.c, xedittags.h, xgamelist.c, xgamelist.h, zippy.README, - zippy.c, zippy.h, winboard.rtf, config.h, defaults.h, resource.h, - wedittags.c, wedittags.h, wgamelist.c, wgamelist.h, winboard.c, - winboard.h, winboard.rc. - - Major additions and changes to nearly all other files listed in - section 0. - - 4. John Chanak - - Addition to xboard.c, mostly later moved into backend.c. - - 5. Evan Welsh - - Wrote from scratch cmail.in and cmail.man. Additions to backend.c and - xboard.c. - - 6. Elmar Bartel - - Wrote from scratch the Metafont code from which bitmaps/* were - generated. The Metafont code itself is not included in the package. - - 7. Jochen Wiedmann - - Wrote from scratch gamelist.c, lists.c, lists.h. Wrote xboard.texi, - mostly based on xboard.man and cmail.man. Minor additions to backend.c. - - 8. Frank McIngvale - - Wrote from scratch zic2xpm.c and zic2xpm.man. Additions to backend.c, - xboard.c, and xboard.man. - - 9. Hugh Fisher - - Additions to backend.c and xboard.c. - - 10 Arun Persaud - - fix for parser.l + Contributions of xboard and WinBoard authors by file + $Id: AUTHORS,v 1.1 2003/11/02 04:42:06 mann Exp $ + + 0. Files covered + + The first group are included in the xboard distribution. The second + group are included in the WinBoard source distribution but not in the + xboard distribution. All are part of the joint xboard/WinBoard source + base and are covered by the same copyrights and licensing terms. + + FAQ.html + backend.c + backend.h + backendz.h + bitmaps + childio.c + childio.h + cmail.in + cmail.man + comment.in + common.h + config.h.in + configure.in + engine-intf.txt + frontend.h + gamelist.c + ics-parsing.txt + lists.c + lists.h + moves.c + moves.h + parser.h + parser.l + pgntags.c + xboard.c + xboard.h + xboard.man + xboard.texi + xedittags.c + xedittags.h + xgamelist.c + xgamelist.h + zic2xpm.c + zic2xpm.man + zippy.README + zippy.c + zippy.h + + winboard.rtf (compiles to winboard.hlp) + config.h + defaults.h + resource.h + wedittags.c + wedittags.h + wgamelist.c + wgamelist.h + winboard.c + winboard.h + winboard.rc + + bitmaps/* + bitmaps.xchess/* + + 1. Wayne Christopher + + Wrote from scratch (I believe) bitmaps.xchess/*80*.bm. Other bitmaps + in the bitmaps.xchess directory were derived from these by shrinking + and some hand-tuning. By default these bitmaps are no longer used. + Their copyright status is unclear. + + 2. Chris Sears and Dan Sears + + Wrote from scratch parser.l, xboard.c, xboard.h, xboard.man. Parts + (sometimes small) of these files were later moved by Tim Mann to + backend.c, backend.h, childio.c, common.h, frontend.h, and parser.h. + + Chris and Dan's original work is copyrighted by Digital Equipment + Corporation with licensing terms similar to what the X Consortium uses + (see the file COPYRIGHT). All the work listed below is copyrighted by + the Free Software Foundation and covered by the GPL (see the files + COPYRIGHT and COPYING). + + 3. Tim Mann + + Wrote from scratch FAQ.html, backendz.h, childio.h, comment.in, + config.h.in, configure.in, engine-intf.txt, ics-parsing.txt, moves.c, + moves.h, pgntags.c (split from backend.c by Jochen Wiedmann), + xedittags.c, xedittags.h, xgamelist.c, xgamelist.h, zippy.README, + zippy.c, zippy.h, winboard.rtf, config.h, defaults.h, resource.h, + wedittags.c, wedittags.h, wgamelist.c, wgamelist.h, winboard.c, + winboard.h, winboard.rc. + + Major additions and changes to nearly all other files listed in + section 0. + + 4. John Chanak + + Addition to xboard.c, mostly later moved into backend.c. + + 5. Evan Welsh + + Wrote from scratch cmail.in and cmail.man. Additions to backend.c and + xboard.c. + + 6. Elmar Bartel + + Wrote from scratch the Metafont code from which bitmaps/* were + generated. The Metafont code itself is not included in the package. + + 7. Jochen Wiedmann + + Wrote from scratch gamelist.c, lists.c, lists.h. Wrote xboard.texi, + mostly based on xboard.man and cmail.man. Minor additions to backend.c. + + 8. Frank McIngvale + + Wrote from scratch zic2xpm.c and zic2xpm.man. Additions to backend.c, + xboard.c, and xboard.man. + + 9. Hugh Fisher + + Additions to backend.c and xboard.c. + + 10. Allessandro Scotti + + Made many additions to the WinBoard user interface and graphics + capabilities, such as new windows for engine output, board textures + and font-based piece rendering. These changes became collectively known + as Winboard_x. + + 11. H.G. Muller + + Heaviliy modified winboard.c, backend.c, moves.c and parser.l, to + allow board sizes other than 8x8, and many non-orthodox Chess pieces, + so that WinBoard is now capable of playing variants like Shogi and Xiangqi. + Also implemented displaying of the Crazyhouse holdings, and many adjudication + and other backend options. This version of WinBoard, (4.3.xx) containing all -of the WinBoard_x options, became known as WinBoard_F. ++of the WinBoard_x options, became known as WinBoard_F. ++ ++12. Arun Persaud ++ ++fix for parser.l diff --cc ChangeLog index ae14d79,313e8f1..7338258 --- a/ChangeLog +++ b/ChangeLog @@@ -1,4373 -1,3331 +1,4373 @@@ --ChangeLog for XBoard/WinBoard - * 2009-03-17 APersaud: added initial german language support (130 of 301 strings translated). -- - * 2009-02-28 APersaud: fixed bug #22853: changed all .Xdefaults to .Xresources in xboard.texi - - * 2009-02-28 anonymous (tiny change) - added DESTDIR support to Makefile.in; similar patch also provided by Ali Polatel - patch #6182; bug #25672 - - * 2009-02-28 APersaud: fixed missing datarootdir in Makefile.in -> autoconf -> new configure script - - * 2009-02-28 APersaud: fixed an error in the parser. This should fix bug #22812. - - * 06/12/2005: bugfix some more possible buffer overflows. - - * 06/27/2004: added simple icsEngineAnalyze for xboard - - * 06/26/2004: added icsEngineAnalyze for winboard: Analyze observe games - with a chessprogram on a Internet Chess Server (ICS) - - * 02/12/2004: Bugfix ICS interaction console crashed while chess - engine starting and user type in some stuff. We are wait now to finish - the engine boot. - - * 02/11/2004: Winboard: Added color lines for the ics interaction - console if zippy used - - * 02/09/2004: Added mousewheel support for winboard. Play moves - backward and forward with the mousewheel. - - xboard/WinBoard 4.2.7 -- Fri Nov 28 13:36:00 PST 2003 -- Tim Mann - --* 11/26/2003: In WinBoard, setting the -debug flag now logs ICS output --to WinBoard.debug too. (This isn't needed in xboard because ICS --output already goes to stdout, so it's easy to capture along with the --debug output on stderr.) This was issue #280 in the ToDo file. -- --* 11/23/2003: Cleaned up some minor problems in cygwin.mak. Thanks to --Hans Werner Strube for the problem report. -- --* 11/23/2003: Updated the default list of chess servers in --winboard/defaults.h. Deleted two that appear to be dead and added a --new one that is active. -- --* 11/19/2003: Swapped icon_white.bm and icon_black.bm in XBoard. --Hopefully this will get them the right way around by default on more X --window managers. I wish I understood this better. -- --* 11/18/2003: Implemented a simple 32-bit random number generator for --WinBoard, replacing the Windows rand(), which ranges only up to --0x7fff. Formerly on Windows, only zippy.lines sayings that started in --the first 32767 bytes of the file could ever be used. This was issue --#505 from the ToDo file. -- --* 11/16/2003: The xboard man page and info files are now built from a --common set of texinfo source files, and the xboard man page now covers --cmail as well. Formerly, ever since the texinfo file was first --contributed to the project, it was separate from the man page and the --two files had to be updated in parallel, making for a maintenance --nightmare. To make combining the files possible, I took the Perl --script "texi2man" from the GNU Units project and added support for a --larger subset of the texinfo markup language. I then carefully --compared the old man page and old texinfo file to make sure the latest --and clearest words survived into the new combined texinfo file. It --would be great to merge in WinBoard's help file too, but that's a --larger project. It would have to be heavily conditionalized to --deal with differences in features between XBoard and WinBoard. -- --* 11/15/2003: Cleaned up and applied a small patch from Daniel --Mehrmann, to stop overly long PVs in thinking output from causing a --buffer overflow crash in backend.c. -- --* 11/5/2003: When a chess engine sends a "telluser" command (including --the cases where "tellall" or "tellopponent" acts like telluser), the --information now goes into a nonmodel popup that is automatically --dismissed when the user clicks anywhere on the board. This fix is --more significant on WinBoard, where formerly you got a fully modal --dialog that had to be dismissed by clicking on OK before anything else --could happen. The bug was issue #406 in the ToDo file. -- --* 11/1/2003: Removed email addresses from this file to reduce spam --load, as it gets linked to from the Web. -- --* 11/1/2003: Updated READ_ME and winboard/READ_ME.txt. -- --* Modified xboard and winboard makefiles to be able to build the --project in the new combined directory structure. -- --* Applied a small security fix to pxboard, from Martin Maeok. -- --* Fixed a bug in the game list dialog. The change in 4.2.6 to opening --games in text mode (meant to avoid getting extra \r's into comments) --caused a new bug in determining seek offsets when parsing a game file --to form the game list. Also, the change was incomplete; on some code --paths games were still being opened in binary mode. Thanks to Lenik --Terenin for reporting the offset bug. I've now gone back to always --using binary mode when reading game files, and I've fixed the comment --bug by adding code to remove \r's from parsed comments explicitly. I --still use text mode for writing game files so that games written by --WinBoard will have Windows-style line endings. -- --* Fix for minor bug in WinBoard installer. If you chose a non-default --destination directory, the default directory was still used for a --couple of unimportant things, namely setting the App Paths registry --keys (unused by WinBoard) and trying to copy the existing WinBoard.ini --file to WinBoard.old. I inherited this bug from the InstallShield 5 --sample template. Thanks to "l.d." for noticing the incorrect keys. -- --* Patch from Chris Priest: when two engines are being run through rsh, --avoid reusing the same stderr port for both. I'm not sure why this --should be needed, but it's harmless, at least. -- --* Bugfix: The kludge to deal with old engines that give an error --message because they don't know the "st" command was too sloppy; it --could hit on an "st" substring anywhere in an error message. GNU --Chess 4 is the only engine I know of where the kludge was needed, so I --changed the kludge to match a longer, more GNU-specific string. -- --* Changed the WinBoard self-extracting installer to choose a unique --temporary subdirectory name within the Windows temp directory instead --of always putting wb-setup directly in temp. Besides being better --practice, this avoids the need to deltree wb-setup first, which --occasionally alarms someone who thinks that deltree is only used by --trojans to delete all your files. (Yes, I'm serious.) -- --* Fixed a bug where FICS-style "wild/0" strings were not parsed as the --proper wild type. The "/" was not being skipped. -- --* Fixed a WinBoard bug where temporary files created by game --copy/paste were being created in the root directory of the current --drive instead of the TMP directory and were not always deleted on exit. -- --* Fixed a small bug in winboard.c's ErrorDialog() function. Thanks to --"Ron" (no last name given). The bug might have caused a problem when --pressing OK or Cancel in an error dialog when more than one error --dialog was being displayed, but I'm not really sure. -- --* Removed a hack that worked around a bug in very old versions of --Crafty, where it would sometimes reply "illegal move" to a "." --command. The hack kept us from recognizing real illegal move messages --in analyze mode from engines that don't respond to the "." command. --Thanks to Fabien Letouzey for the report. -- --* Fixed a bug in the xboard version of GetDelayedEvent. It would --return the most recently scheduled event even if it had already fired. --This caused at least one visible error: in -ics -xreuse mode, starting --the engine again and seeing another "feature done=1" would re-run the --initialization code in InitBackEnd3, including the code that opens the --connection to ICS. The WinBoard version didn't have this bug. Thanks --to Bob Hyatt for the bug report. -- --* The promotion popup for ICC wild 26 (giveaway) now includes King. --Thanks to Fredrik Josefsson for the bug report. -- --* The first game in a file (or being pasted from the clipboard) can --now start with a bare move -- no PGN tags, no move number "1", etc. --Suggested by Shane Harrelson. One could imagine taking this farther --and accepting something like "e4 e5 1/2-1/2 d4 d5" as two games, but --I haven't done that. -- --* Bug fix: xboard didn't really accept a paste of multiple games, --contrary to what I wrote when adding the feature to WinBoard in --4.2.4. Now it works in both. -- --* Fixed generic start/end of game messages to work on chess.net, where --they put ratings in parens after the player names. -- --* Updated config.sub and config.guess to newer versions from --automake-1.4p5-2. This makes configure work with MacOS X + X11. -- --* Bugfix: when examining a game fragment on FICS where black plays --first, don't show two "(0:00.000)" times on the initial "none" move. -- --* If TestLegality is on and one of the engines makes an illegal move --in TwoMachines mode, it forfeits immediately. Formerly the game would --get stuck at that point and the engine that made the illegal move --would eventually lose on time. -- --xboard/WinBoard 4.2.6 -- Fri Feb 1 22:26:31 PST 2002 --Tim Mann -- --Another small bugfix release. -- --* Put in a small change from Alexander Mai to allow xboard to build in --an OS/2 EMX environment. -- --* Fix WinBoard-only bug where editing a PGN file with comments would --insert more \r characters before the \n after every Load/Save cycle. --For some unknown reason we were reading the files in "rb" mode but --writing them in "a" mode, so we kept the \r characters on reading and --added an extra one on writing. Fix: change the "rb" to "r". Thanks --to Joel (last name not given) for the bug report. -- --* Put the arguments to rsh/remsh in the right order for better --portability. Thanks to Michael Kalisz. -- --* FreezeUI is now implemented in WinBoard; it was previously only --implemented in xboard. This function prevents the user from entering --moves or other commands while we are waiting for an engine to --initialize itself. Implementing it fixes a bug where the user could --start a game (etc.) during feature negotiation. One of the symptoms --of this bug was that we could send "new" one or move moves *after* the --first game started! -- --* Fixed some handle leaks (WinBoard only), including a nasty one that --leaked one handle per command sent to ICS. Thanks to several folks --who helped characterize the bug and tried to look for leaks. -- --* We now install and look for the info file in ${prefix}/share/info --instead of ${prefix}/info. The latter is still the default in --autoconf, but the former is currently used in Red Hat Linux and --probably elsewhere. -- --xboard/WinBoard 4.2.5 -- Sat Dec 15 11:42:51 PST 2001 --Tim Mann -- --* Changed the bundled GNU Chess 5.02 in the WinBoard package to --include a much smaller book and to use much less hash table space by --default (8 MB transposition table, 0.5 MB pawn evaluation table). The --large book included with 4.2.4 made the WinBoard download too big for --some people, and the default hash tables were larger than the --available physical memory on some people's computers. I built the --small book by running Crafty's "small.zip" book line collection --through a Perl script that makes it look enough like real PGN games --that the GNU Chess book builder will accept it. The script and some --minor patches to GNU Chess 5 are available in the WinBoard source --distribution and at http://www.tim-mann.org/gnuchess.html. -- --* Fixed a bug in the code that deals with engines that complain that --"time" and "otim" are illegal moves. This was a new bug in 4.2.4. -- --* Revamped the implementation of ToStart in analysis mode. Formerly --there was some ill-conceived code that would try to get back to the --start of the game by doing a "new" command (and all the followup --commands that requires) while remaining in analysis mode. This is --problematic for engine authors to support, though it works with --Crafty. This code was trying to solve the problem of ToStart being --slow because the engine would try to start an analysis after every --"undo" command all the way back to the start. But ToEnd already had a --much better solution to this problem, and now ToStart does the same --thing: we exit from analysis mode and enter force mode instead, --make/unmake moves to get to the end/start of the game, and then --reenter analysis mode. -- --* Formerly, Zippy could try to start playing a game before the engine --was initialized; that is, during the initial timeout for protover 1 --engines, or before "feature done=1" for protover 2 engines. We now --wait until the engine is initialized before connecting to ICS, which --fixes this in the common case. If you turn off engine reuse for --multiple games (that is, if you give the -xreuse option), there could --still be problems; see item 503 in the ToDo file. Thanks to Dieter --Buerssner for the bug report. -- --* Bugfix: All WinBoard versions since the merge with WinBoard Plus --(but not xboard) have had a bug in changing the PeriodicUpdates, --PonderNextMove, and ShowThinking options from the menu. The bug --mostly just caused changing these options during a game to not take --effect until after the next reset. For TwoMachines games, though, --changing PonderNextMove just before the game would take effect --immediately for the second engine but not until the next game for the --first engine. Thanks to Koundinya Veluri for the bug report. -- --* Bugfix: In 4.2.4, we sometimes got confused when trying to leave and --reenter analyze mode. One symptom was that Analyze File did not work. --Thanks to Igor Syry for the bug report. -- --xboard/WinBoard 4.2.4 -- Sun Dec 9 14:56:30 PST 2001 --Tim Mann -- --* WinBoard now includes GNU Chess 5.02 in place of GNU Chess 5.00. -- --* WinBoard's PasteGameFromClipboard will now handle a paste with --multiple games in it, popping up the game list dialog. xboard --already did this. Suggested by Robert Gerstman. -- --* We now use the "clearboard" command on ICC where appropriate. -- --* Bugfix: don't generate a bogus "variant normal" command to an engine --for the loadable ICC wild types that we internally flag as --VariantLoadable. Also clarified the message that Zippy sends when --declining such wild games -- it can't deal with the possibility of --loading an arbitrary position into the game. Thanks to Dieter --Buerssner for reporting the problem. It would be nice to be able to --actually play these wild types some day; presumably there would have --to be an option to either send "loadgame" with a specified position, --or to deal with an opponent sending it. -- --* If we get a holdings message from ICS when we thought we were --playing normal chess, we now try asking for a move list so that we can --find out from the header what's really happening. Formerly we guessed --bughouse in this case. Response to a comment from Gian-Carlo --Pascutto. -- --* Fixed two longstanding bugs in the clock code. These affected only --play between a user and a local engine, or between two local engines, --not ICS play. (1) The last fractional second used by a player before --moving and virtually pushing his clock was being charged to his --opponent instead of to him. (2) The time and otim commands were being --sent to an engine before the (buggy) fractional second update was --done. The second bug was pretty harmless in itself, but the first one --was serious. Many thanks to Peter Rosendahl for carefully diagnosing --and reporting these bugs! -- --* Changed WinBoard timestamp key. Nothing is changed other than the --key and a recompilation. ICC may phase out the old key soon; if they --do, you'll need to use the timestamp.exe from WinBoard 4.2.4 or later --to connect to chessclub.com. -- --* Fixed an xboard-only bug where most dialogs would not take keyboard --input unless the mouse was actually over the dialog, even if the --dialog window had focus. Thanks to Jason Varsoke for the bug report. -- --* Bugfix; Remember to send time and otim commands to engine before --sending playother. Thanks to Bob Hyatt for the bug report. Also --fixed a bug where time and otim were sometimes sent even with feature --time=0. -- --* Added small patches from Wilkin Ng that are meant to fix a crash in --CopyGameToClipboard and a "can't unlock clipboard memory" error in --PasteTextFromClipboard, under Windows 2000. -- --* Changed cygwin.mak to not use -mno-cygwin. In other words, it now --uses cygwin1.dll instead of the mingw libraries. This works around --bugs in fileno() and stat() that I encountered in mingw. (fileno --seems to always return 0. stat fails because the library routine uses --a different definition of struct stat than the header files provide.) --Thanks to Robert Gerstman for reporting the symptoms these bugs caused --when WinBoard was compiled with Cygwin. -- --* Added -showButtonBar option. This lets you delete the << < P > >> --buttons and thus widen the message widget a bit. -- --* Added code to address a very obscure bug. If an engine dies and --needs to be restarted while in one of the analyze modes, it was not --getting put back into analyze mode. This bug should not really ever --have gotten tickled unless reuse was turned off and the engine sends --game end commands (such as 1-0) when a game ends by rule while in --analyze mode. The next version of the protocol spec will say that --engines should not do that, but version 2 and earlier didn't address --the issue. -- --* We now use the FICS "iset ms 1" feature to get times in ms instead --of seconds. Thanks to DAV for email telling me about this feature. -- --* Changed clock display to show tenths of seconds for 9.9 seconds and --less, instead of 0.9 seconds and less as before. -- --* It has been discovered that Zippy can play simuls on ICC (but not on --FICS). If you arrange for Zippy to send the ICC command "simulize" in --the -zippyGameStart string, it will accept additional games while --playing. Zippy will use the same engine for every game, so whenever --it switches opponents, the engine's state will be reset with the "new" --command. This will of course weaken its play, so don't enable simuls --if you want your engine to have the highest possible rating. Zippy --was never designed to work with simuls; it just works by accident, and --it hasn't been tested much. So please report any bugs you notice, but --don't expect them to be fixed rapidly. Thanks to Paul McGuire for --noticing that this works. -- --* Bugfix: Suppress the direct command to engine popup if there is no --engine. In WinBoard this case used to cause a crash. Thanks to --"Dargon" for the bug report. -- --* Bugfix: formerly we did part of the engine initialization for the --very first game too soon, before feature negotiation. One result of --this is that engines would never get the "ics" command for the first --game. -- --* Lengthened timeout to detect protocol version 1 chess engines to 10 --seconds. This should reduce problems with protocol version 2 engines --that are slow to initialize missing the timeout and not getting a --chance to send their feature commands before the first game starts. -- --* Klaus Friedel says that adding a short sleep to WinBoard after --starting a new chess engine solves a problem that occurs under Windows --2000, in which engines sometimes don't see the initial command(s) from --WinBoard and hang. I don't understand how that can happen, but the --sleep is harmless, so I've put it in. Others have also reported what --may be the same problem, so hopefully this will fix it for them too. -- --* Bugfix: editing the Result field in EditTags will no longer cause a --later crash. Thanks to DAV for a clear bug report that let me --reproduce the problem. -- --* ICC wild 28 is now recognized as shatranj, but it is not supported. --You might be able to play it by turning off Test Legality. -- --* Formerly we would always turn off "feature time" if the engine --printed an error message with the string "time" or "otim" in it; now --we do that only if the message comes before the engine makes its first --move. This change is useful because some engines spew a lot of bogus --error messages about commands they don't fully parse, so something --like "result 0-1 {White lost on time}" could generate such a message. --Engines shouldn't do that, but if they do, mysteriously turning off --"feature time" is not a good way to react. -- --* Fixed an infrequently occurring Zippy bug: formerly, resuming from --adjournment by position (that is, with GetMoveList turned off) or --starting/resuming a wild game (nonstandard starting position) would --try to set up the position without putting the engine into force mode --first. That was probably tolerated by most engines, but if the --position was black-to-play and the engine hadn't set feature --setboard=1, then the fake "a2a3" move (which we use as a kludge to get --black to be on move before sending the edit command) would appear to --be a real move, and the engine might reply to it! This bug could also --be seen when trying to use Zippy to play a simul -- something that --Zippy was never designed to support, but which seems to mostly work --anyway. Thanks to Paul McGuire for sending a WinBoard.debug file that --showed the bug occurring. Some other cases of resuming adjournments --or starting games from nonstandard positions may have been broken too; --I think I've straightened out the problems. -- --* Agreeing to a draw in the human vs. local engine case formerly did --not work if the human offered first; now it does. A human's --unsolicited offer is considered valid until he makes another move. --Thanks to Bruce Moreland for the bug report. -- --* Bugfix: We used to look for just "fr" in Event tags or strings from --ICSes to recognize Fischer Random games. This caused a lot of false --matches. Now we look for "wild/fr" instead, which is what FICS uses. -- --* Bugfix: Clicking on a move in the MoveList window only updated the --displayed position; if a chess engine was active, its state was not --updated. Thanks to Alejandro Dubrovsky for the bug report. -- --* Bugfix: The "resign" command from engine to xboard formerly did not --work in ICS (Zippy) mode. -- --* Bugfix: Formerly we would register a garbage premove if the user --clicked on a piece, then clicked on an edge or outside the board. Now --such an errant click is ignored. -- --* Bugfix: GameEnds would send "exit" to an engine in analyze mode even --if we did not actually want to leave analyze mode. -- --* Bugfix: "feature pause" was being rejected. We don't currently use --it, but that is no reason to reject it. Thanks to Gian-Carlo Pascutto --for the bug report. -- --* Bugfix: when "partner" needed to be sent both to ICS and the engine, --Zippy was erroneously sending the ICS prefix character to the engine --too. Thanks to Gian-Carlo Pascutto for the bug report. -- --* Zippy now declines challenges when the engine is not yet ready to --play again, instead of ignoring them. This is needed so that the --server will let the opponent repeat the challenge. It might be better --to remember such challenges and accept them when the engine is ready, --but that would be a bit more complicated to implement. -- --* Bugfix: Zippy's emotes didn't work on FICS because there, "i" is a --built-in alias for "it", not a real command. So sending "$i foo" gave --an error message instead of doing "it foo". We now leave out the --alias-suppressing prefix for emotes. -- --xboard/WinBoard 4.2.3 -- Mon Feb 19 19:55:05 PST 2001 --Tim Mann -- --* Bugfix: The error message "Variant X not supported by gnuchessx" --formerly could pop up even in -ncp mode. -- --* Fixed an xboard bug in premove highlighting. If you had --HighlightLastMove turned on, premoves got highlighted in --highlightSquareColor (yellow) instead of premoveHighlightColor (red). -- --* Modified premove again. Now we are back to displaying the move --locally immediately after sending it to the server, as in versions --prior to 4.2.1. This is good because it lets you register your next --premove sooner. As a better fix to the problem that the change in --4.2.1 had been trying to address, we now suppress animating the --opponent's move if you have a premove reply pending. However, it's --probably still a good idea for you to turn off AnimateMoves entirely --if you are trying to play extremely fast games. -- --* Removed an erroneous patch that left zombie chess engines around --when both sigterm and reuse were turned off. (Bug was in xboard only, --not winboard.) -- --* Bugfix: loading a game with autostepping did not work for games with --PGN result "*" (unfinished). This bug was introduced in 4.1.0, caused --by some outdated code that was supposed to leave you in EditGame mode --after loading an unfinished game. I fixed this, and also changed it --to leave you in EditGame mode after loading *any* game, but without --changing the tags to say it's an edited game. It's not really clear --whether that is the best thing is to do here -- ideally, perhaps, the --tags should change to say "edited game" if you actually make any --changes, but that is harder to make work. -- --xboard/WinBoard 4.2.2 -- Tue Feb 6 20:00:00 PST 2001 --Tim Mann -- --* Fixed a problem introduced in 4.2.1. In -zippyPlay mode, 4.2.1 --started sending the initString immediately after the old game ended, --but then when the next game started, it would still send "force" and --another initString. Another problem was that the first initString put --the engine out of sync with the displayed board position, though that --might not usually have been noticeable. This is now changed to do a --full Reset at the end of the previous game, and avoid doing a Reset at --the start of a new game if we are still in BeginningOfGame mode. -- --* Fixed some limitations in -zippyPlay mode. The engine was not being --fed the moves or history of games that were displayed but not being --played, so it would get confused if you tried to do something like --examine a game, then enter EditGame mode from somewhere in the middle --of the game. -- --* Made a small change so that cygwin can compile xboard for Windows --(an X server is required to run it). Thanks to Volker Zell. Most --people would probably prefer to run WinBoard on Windows, however; note --that cygwin could already compile WinBoard. -- --* Added some missing documentation to engine-intf.html: It is okay to --send "feature done=0" even before you receive the xboard and protover --commands, if this is needed to give your engine enough time to --initialize. See engine-intf.html for more discussion. -- --* Bugfix: "feature done=0" did not work for the second engine; now it does. -- --xboard/WinBoard 4.2.1 -- Sat Feb 3 19:52:26 PST 2001 --Tim Mann -- --* Bugfix: in Zippy mode with feature san=1, the elapsed time was being --sent to the engine after the SAN move; for example, "e4 (0:01)" was --sent instead of just "e4". -- --* It seems that scroll wheel mice with incompletely installed software --(under Windows 95, at least) can send repeated middle button up events --when the wheel is turned. Moved QuickPaste from middle button up to --middle button down to avoid problems with this. -- --* A premove is now sent *before* the opponent's move that it replies --to is animated. The premove itself is no longer displayed (or --animated) when sent; instead, it is displayed when the chess server --echoes it back as a board update. -- --* Bug fix: in -xreuse mode, xboard was only sending command line --arguments to the engine the first time it was started. (WinBoard --didn't have this bug.) -- --* In -zippyPlay mode, we now initialize the chess engine for a new --game immediately after the old game ends. (In -xreuse mode, this --means starting a new engine process; in the default -reuse mode, it --just means sending "new".) If the engine supports ping, we don't --accept challenges until the "new" has finished. This should help --avoid losing time (re)initializing the engine after the game starts. -- --* We now handle the new FICS field in style 12 that says whether the --clocks are ticking. -- --* whiteFlag and blackFlag are now reset whenever an ICS board image --arrives, giving autoflag a fresh chance to work. -- --* Suppressed "geometry error" debug messages unless -debug flag is given. -- --* Bugfix: avoid core dump on Solaris with -debug flag, caused by --passing NULL to a %s format in GameEnds. -- --* Added -firstProtocolVersion and -secondProtocolVersion. This will --allow use of extremely broken engines that hang or die when given the --"protover 2" command. It should be rarely if ever needed. -- --* Zippy now strips highlights from player names in the Creating --message; previously the ratings would not be extracted from this --message properly if you had set the highlight variable. -- --* Bug fix: Zippy with -zp but not -zt used to be fooled by false --partner tells inside channel tells; e.g.: --Garf(24): Garf (your partner) tells you: sit -- --* Bug fix: when an engine reported its name with the new "feature --myname=" command, we had been putting just that name into the window --title even when in TwoMachines mode. -- --* By default, WinBoard no longer uses the new feature introduced in --4.2.0beta of keeping the ICS menu, ICS server list, and lists of chess --engine command lines in separate files; instead, the lists are back in --the winboard.ini file. This gets rid of some problems where the --separate files could not be opened because the working directory was --not set to WinBoard's installation directory. -- --* WinBoard command lines and ini files now have another optional --syntax for quoting an option value. All characters within { } curly --braces are interpreted literally except for '}' itself. SaveSettings --now uses this syntax for string values that contain a backslash or --newline and do not contain a '}'. This should address the problem --that the separate .ini files had been meant to fix; engine command --line lists can now be written without \-escapes. -- --* Fixed three bugs in relaying moves between engines in TwoMachines --mode: an engine would be sent SAN if the *other* engine had set --feature san=1, a relayed SAN move did not end with a newline, and --feature usermove was not implemented for relayed moves. -- --* Fixed several bugs in exiting: File/Exit would sometimes hang; --timestamp/timeseal would not get killed off; an engine crash would --cause error messages to be printed recursively until stack overflow. -- --* Fixed a bug in the code to detect which ICS is in use and adapt to --it; the chess.net case was broken. -- --* Removed the leading alias-suppression character when sending a move --to ICS, because it seemed to break accuclock on chess.net. -- --* Fixed a bug where a FICS prompt like "10:01_fics%" would be matched --as finger note number 10, causing a problem detecting when the user is --logged in. -- --* Added tellicsnoalias command to protocol. -- --* Changed st command in protocol back to old behavior. -- --* Added done=0 feature to protocol, to lengthen initial timeout. -- --* Added missing -colorSeek command line option to xboard. (Was --present in WinBoard.) -- --* Bug fix: setting feature reuse=0 was not working. -- --xboard/WinBoard 4.2.0beta -- Sat Dec 16 16:34:56 PST 2000 --Tim Mann -- --* Setting -searchTime no longer turns off -clockMode. Note that when ---searchTime is set, some engines may search for the lesser of --searchTime and the amount of time their normal clock management would --dictate, while others will disable their normal clock management and --always search for exactly searchTime. -- --* Fixed WinBoard bug where on Windows 2000 (and maybe Windows 98) the --ICS Interaction window would scroll back to the top whenever it filled --to capacity and WinBoard trimmed some text off the top. -- --* Changed xboard dragging so that the center of the dragged piece is --forced to be over the mouse cursor. (WinBoard dragging already worked --that way.) This should avoid confusing cases when you start a drag --with the mouse near the edge of a square -- formerly most or all of --the piece could be over one square but the mouse cursor over another. --Suggested by DAV. -- --* Added move list window for xboard. Code contributed by Manuel --Hoelss and re-hacked a bit by me. Performance of this window is poor, --because the implementation regenerates the entire window contents --whenever anything changes. It's hard to avoid this when using the --Athena List widget, though we could be a little smarter and notice --when the current move number has changed but the move list has not. --There are also several drawing problems caused by bugs in the Athena --Form and List widgets. The window should not really allow a --horizontal scroll bar, but the bugs are much worse if I turn it off. --In both Xaw and Xaw3d, the List widget tries to resize itself when --XawListChange is called, even if you tell it not to; and what's worse, --if the widget cannot resize itself to be large enough to avoid --clipping any of the list item, it does not change the list! Arrgh. --On top of that, the Xaw Form widget is very buggy in XFree86 4.0.1 --(X11R6.4.3). -- --* The OK button in the WinBoard startup dialog is now simply disabled --if none of the radio buttons is selected, instead of bringing up an --error dialog. Suggested by Ted Milbaugh. -- --* Used ping to address the worst of the race conditions in the --protocol. Now if an engine supports ping, we ping it after sending --the "new" command and after trying to place it in force mode at the --end of a game. When a ping has been sent and the corresponding pong --has not yet come back, we (1) ignore or undo any moves the engine --sends, (2) ignore game end messages (such as "offer draw", etc.) from --the engine, (3) ignore thinking output from the engine, (4) delay --starting the next game if in -matchGames mode, (5) in -zippyPlay mode, --respond to challenges with a polite message to try again soon instead --of accepting them. There are a few more things that should be done --(and item 5 might not be quite what we want), but it's hard to fit --them all into the existing code. -- --* Patched the version of GNU Chess 5.00 included with WinBoard to --support protover, feature, setboard, and ping, and to fix some minor --bugs. See gnu500+.patch. -- --* Changed the GNU Chess 4 kludges for missing "st" and "sd" commands --to be invoked only if the engine gives an error message for "st" or --"sd", and to always use protocol commands instead of engine --command-line options. See "Idioms" in engine-intf.html. -- --* Added new protocol command "protover 2" to tell the engine what --version of the protocol is in use. Version 2 is still compatible with --old engines; see engine-intf.html. -- --* Add new protocol command "feature ..." The engine can send this in --response to the protover command command, to say what extended --protocol features it would like to enable, etc. xboard responds --"accepted F" or "rejected F" for each feature F that is set. See --engine-intf.html. -- --* Added new protocol command "setboard ". This is an alternative --to "edit", used only if the engine says "feature setboard=1". -- --* Added new protocol command "ping ". The engine is supposed to --respond "pong ". This gives us a tool to fix some race --conditions in the protocol, but it is not used to the fullest yet. -- --* Added new protocol command "tellopponent". This will do a "say" if --you're on a chess server in Zippy mode, or pop up an information --dialog otherwise. -- --* Added new protocol command "tellall". This will do a "kibitz" if --you're on a chess server in Zippy mode, or pop up an information --dialog otherwise. -- --* Added new protocol command "tellothers". This will do a "whisper" if --you're on a chess server in Zippy mode, or do nothing otherwise. -- --* Changed the WinBoard /icsNames, /icsMenu, /firstChessProgramNames, --and /secondChessProgramNames options to accept a filename preceded by --"@", meaning to find the value in the file. Changed the defaults to --use this feature, with filenames icsnames.ini, icsmenu.ini, fcp.ini, --and scp.ini. This should make it easier for users to edit the values, --since one less level of quoting is needed, and each value is in its --own file, not mixed into winboard.ini. Those who upgrade from an --older winboard version and already have a winboard.ini file will not --automatically have these values moved to a file; that has to be done --by hand if desired. -- --* We now strip .exe from engine names for "name" command, tags, etc. -- --* Allowed WinBoard input widget to hold more than one line. You can get --a newline into the widget with copy/paste or with Ctrl+Enter. -- --* Fixed an xboard bug where the [P] button would appear in the --opposite highlight state from what it should be after being pressed. -- --* We now use the "/" or "$" alias suppression feature on the chess --servers, to avoid problems if the user inadvertently aliases a --needed command to something else. -- --* Changed the method used to deiconize xboard in AutoRaise and cmail. --This may fix bugs under some window managers where after --deiconization, the board window was mapped but nothing was drawn --inside. -- --* Preliminary, partial support for playing several chess variants --against a local engine or editing variant games. The -variant option --must be given on the command line or WinBoard startup dialog; there is --no menu. The current variant is not displayed (except in the --Tags/EditTags window). Many variants will not work quite right even --if the engine supports them; see item 326 in the ToDo file for --details. -- --* Added a workaround to detect the variant type when examining a --scratch wild game on an ICS. -- --* Fixed two cases where "variant" command should be sent to the engine --when necessary but was not: loading a game from a file and restarting --a dead engine. Thanks to Gian-Carlo Pascutto. -- --* Added missing support for FICS games that start from a bsetup position --with Black moving first. -- --* Fixed a bug in loading a file from the game list window while in --Analysis or AnalyzeFile mode. This now leaves us in AnalyzeFile --mode, analyzing the new file. -- --* Fixed a bug in loading games with a comment before the first move. -- --* Fixed a bug in handling LoadGame (or -lgf) with -td 0. -- --* Added a command line option to select an initial minor mode from the --Mode menu. This should satisfy requests from a couple of users with --special applications. -- --* Fixed a problem where some things in WinBoard's General Options --dialog box were grayed out at the wrong time. -- --* We look for a few messages from the chess engine pipe that are --intended to catch problems starting an engine via rsh, such as "No --such file". Moved code so that these strings won't match until other --protocol messages have been looked for, and documented the messages in --engine-intf.html. -- --* Fixed the WinBoard bug that sometimes made the console input box --white-on-white even when not in password-entry mode. -- --* Small changes to WinBoard to be compilable with the latest Cygwin --net release (as of 10-16-2000). Thanks to Mark Schoenberg. -- --* Recompiled GNU Chess 5.0 for WinBoard with the latest Cygwin net --release (as of 10-16-2000). Also rebuilt the book just to be sure, --since I had one bug report about it. It came out identical and seems --to work fine. -- --* Added messages for some common InstallShield errors instead of just --printing InstallShield's stupid error code numbers. -- --* Added -firstComputerString and -secondComputerString, allowing you --to suppress or change the command that is sent to a chess engine when --its opponent is another computer. -- --* Added "configure --with-Xaw3d" to allow use of Xaw3d widgets instead --of Xaw widgets in xboard. Thanks to Johnny C. Lam of the NetBSD --project. I've left Xaw as the default because Xaw3d is too ugly. -- --* The version of the Xaw Form widget released in XFree86 4.0.1 --(X11R6.4.3) has a bug that causes xboard to display the button bar --on top of the message widget. I've reported the bug and have --installed a kludge workaround into xboard. -- --xboard/WinBoard 4.1.0 -- Sun Sep 17 17:30:14 PDT 2000 --Tim Mann -- --* Merged Winboard Plus 4.0.8 from Mark Williams into xboard -- source pool. Status of Winboard Plus features in xboard: -- -- - White pieces now have borders, but the implementation is -- completely different from WinBoard's; see below. -- -- - Options menu not changed, probably won't be. -- -- - Copy&paste support working, using Mark's changes to backend.c, Ben -- Nye's changes to xboard.c for FEN positions, and some code of my -- own in xboard.c for PGN games. -- -- - Premove hooked up and working. No pre-first-move, though. -- -- - ICS Alarm hooked up and working. -- -- - Auto-flip working. -- -- - PGN Training mode hooked up and working. -- -- - Improved menu item enable/disable working. -- -- - Improved >> button working. -- -- - Auto activate board working. I changed this to be optional; you -- might not always want it, especially in Zippy mode. -- -- - Blindfold working. -- -- - Documentation updated. -- --* Fixed more colorization bugs. Commands like "message foo tells you: --xxx" and "tell 33 tells you: xxx" will no longer generate bogus --colorization. -- --* Added low-tech sound support to xboard, by invoking an external --program on a filename for each sound to be played. -- --* ICC wild 27 is now recognized as VariantAtomic, and it sets the --"ignore check" flag, but is not otherwise supported. -- --* Converted the piece bitmaps from .bm to .xpm for use with xboard's --xpm support. (An .xim version was not created.) Wrote a shell script --using ImageMagick to do the conversion and to bucket fill from --coordinate 0,0 with the background color. Used xpaint by hand to --clean up a few pieces where background color "leaked" into the inside --or didn't flow all the way around the outside, then a sed script to --fix up color names and bitmap names in the xpaint output. If any more --sizes are added later, they should be straightforward to convert with --reference to the existing scripts. With this conversion, not only do --the white pieces now have dark borders, but (unlike with WinBoard) the --light details on the black pieces are opaque. -- --* If the XPM library is found when building xboard, the new xpm pieces --are compiled in as the default. External bitmap (or xpm) pieces can --still be used by giving the -bitmapDirectory (or -xpmDirectory) --option. If the XPM library is not found, the old bitmap pieces are --the default. In this case external bitmap (or xim) pieces can be used --by giving the -bitmapDirectory (or -xpmDirectory) option. There is no --way to compile in xim pieces. -- --Winboard Plus 4.0.8 -- Sat Aug 5 15:51 PDT 2000 --Mark Williams -- --* Bugfix release. -- --* Main menu now visible in Win NT. Thanks to Microsoft for creating a --compiler which auto-mutilates the WinBoard.rc file so that the menu is --displayed under Win 98 but not Win NT. I fixed the problem by hand editing the --.rc file. Sigh. -- --* "Reset game" now works properly when invoked from Analysis mode when two --engines are present. Correction of bug introduced in Winboard Plus. Thanks to --Mogens Larsen for reporting the bug. -- --* Pasting a FEN position with Black to move now works in all modes. --Thanks to Mogens Larsen for reporting the bug. -- --* Added gnuchess.dat to the distribution and a couple of text files that were --missing in 4.0.7. -- --*** Merged in the following changes from Tim Mann: -- --* Bugfix: Highlights would sometimes not be taken down, at least in --xboard. The problem is that SetHighlight works in chess coordinates, --not view coordinates, so if flipView has been toggled since the --highlight was put up, it gets taken down from the wrong square. Fixed --by being careful to call ClearHighlights before toggling flipView, not --after. Ugh. -- --* Bugfix: HighlightLastMove would sometimes highlight square a1 after --a FICS "tomove black" command. -- --* Bugfix: a move list with initial position that has black to play was --not being handled correctly. -- --* Removed "decline abort" and "decline adjourn" commands from Zippy. --The syntax is changing on FICS, and Zippy really doesn't have to --explicitly decline the requests anyway; it's sufficient to not accept --them. -- --* ICC wild 26 is now recognized as VariantSuicide (the FICS name; ICC --calls it "giveaway"). -- --* Bugfix: PGN games with black to move in the initial position weren't --being legality checked correctly. I think this was introduced in --4.0.6 when I fixed a different PGN bug. Thanks to Mark Williams for --spotting the bug and suggesting a fix. -- --* Bugfix: the initial "name(" of a kibitz wasn't being colorized. -- --Winboard Plus 4.0.7 -- Thu May 12 17:57 PDT 2000 --Mark Williams -- --* New white pieces with black borders. -- --* Major overhaul to Options menu. New dialogs for setting General Options, -- Board Options, ICS Options, Sounds, Fonts, Colors. -- --* Clipboard support for PGN game scores and FEN positions. -- --* Optional ICS Premove with user-specified first moves for White and Black. -- --* New sound events: ICS Win, ICS Loss, ICS Draw, ICS Unfinished, ICS Alarm. -- --* New auto-flip option when playing against a chess program. -- --* Added PGN Training mode. -- --* Certain menu options now disabled while program is thinking. -- --* ">>" button now always goes to the end of the game. -- --* In ICS mode, the board is automatically activated at the start of a --new game. -- --4.0.7 -- Sun Mar 5 17:17:49 PST 2000 Tim Mann -- --* Fixed a nasty bug in parsing ICS game histories that was introduced --in 4.0.6. -- --4.0.6 -- Fri Mar 3 16:20:11 PST 2000 Tim Mann -- --* Fixed bugs in Zippy's code for responding to messages sent with the --ICS "message" command. -- --* Fixed bugs where xboard could still create dialogs partially off the --top of the screen. Fixed unwanted interactions between initial sizes --and positions of various unrelated xboard dialogs. Deleted --borderXoffset and borderYoffset resources. -- --* Fixed restoring the xterm name on exit to work in more cases. -- --* Small fix to the WinBoard self-extracting installer: when it starts --up, it now always deletes any old wb-setup directory left over from a --previous installation. Formerly this worked only on Windows 95/98, so --on NT the self-extractor would sometimes stop and ask the user whether --it was OK to overwrite the old wb-setup files. -- --* Modified WinBoard to be compilable with the free Cygwin tools --available from http://sourceware.cygnus.com/cygwin/. Based on work by --Mark Schoenberg. (His mods were enough to get WinBoard through the --compiler, but a few things were broken along the way, so I reworked them.) -- --* Merged changes from Don Fong to make WinBoard compilable with --Borland C++ 4.5. I do not have Borland C++ and am unable to test with --it, but I did make sure the changes don't stop it working with MSVC++ --5.0 and Cygwin. -- --* Forbade entering TwoMachines mode from MachineWhite or MachineBlack --mode when machine is on move. This used to confuse the engine and --cause problems, because when we try to get the engine to stop, it --might make a move first, and it might not do that immediately. -- --* Variant classification now deals with new ICC wild 25, classifying --it as "3check". Also, we are now conservative about new wild numbers --we don't know about, classifying them as "unknown" instead of --"normal". -- --* Replaced bad GNU Chess 5.00 book in WinBoard distribution with a --correct one. 1.e4 now no longer takes GNU Chess 5.00 out of book! --Thanks to Pete Galati. -- --* Made move parser accept and ignore nonstandard ep suffix on PGN moves, --e.g., "exf6ep" or "exf6e.p." -- --* Fixed bugs in parsing PGN files starting with no move number, or --with a move number other than "1." (including "1..."). Thanks to --Michael Soulier and Stefan Zipproth for example PGN files --demonstrating the bugs. -- --* Changed InitComboStringsFromString to not modify the input string; --this caused an exception when WinBoard was compiled with MSVC++ 6. --Thanks to Bert Tuyt for the report. -- --* In WinBoard, dragging a piece off the edge of the board without --releasing the mouse button no longer instantly aborts the move. You --still must release the mouse button inside a square to complete a --move, but you can now drag off the edge and come back inside. -- --* WinBoard bugfix: If you went into EditGame or EditPosition mode --while observing or playing an ICS game, and a new move came in --(snapping you back to ICSClient mode) while you were dragging a piece --around, the drag state would not be reset, causing the piece you were --dragging to remain on the board wherever you dropped it. Thanks to --David Brinegar for the bug report. -- --* WinBoard bugfix: If you moved or resized the board while your --opponent was moving, and you had AnimateMoving on, his move would not --be displayed until after your next move. Thanks to DAV for reporting --the bug repeatedly until I finally understood it. -- --* Added a Zippy "farewell" feature; see zippy.README. -- --* Fixed a bug (xboard only) in processing -zippyReplayTimeout on the --command line. Thanks to Steve Beer for the report and patch. -- --* Send "computer" command to both sides in TwoMachines matches. -- --* Fixed a Y2K bug in Evan's cmail code! Thanks to Brian Mays for the --report and patch. -- --* Bugfix: Initialize variant field of GameInfo struct in gameinfo.c. --This could cause crashes in LoadGame. Thanks to Andrzej Nagorko. -- --* Fixed several pattern matching problems: Finger notes and formula --vars no longer get replied to by zippyTalk or colorized. Channel --tells by players with many titles are now colorized fully, and --zippyTalk handles channel tells by such players correctly. The shout --"--> foo(99): bar" no longer gets colorized as a channel tell. Code --is cleaned up a bit, and autocomment capture now uses the same --criteria as colorization. -- --* xboard fix: Enter key now closes error popups as in WinBoard. --Especially nice for the "Exiting: Connection closed by ICS" popup. -- --4.0.5 -- Tue Dec 7 10:30:40 PST 1999 Tim Mann -- --* Added missing documentation of SIGTERM usage into engine-intf.html. -- --* Bugfix: New -zippyReplayTimeout option was misspelled in WinBoard as ---zippyReplyTimeout. Thanks to Francesco Di Tolla. -- --* xboard -ics now restores the xterm's original title upon exit, at --least if $WINDOWID is set. -- --* Bugfix: -matchGames mode wasn't terminating properly. Final score --popup would come up twice and engines would not be killed off. Thanks --to Frank Quisinsky for the bug report. Bug was introduced in 4.0.4. -- --* Bugfix: "tell 50 foo shouts: bar" no longer gets colored as a shout; --similarly for "...s-shouts:" and "...c-shouts:". Thanks to David Lee --for the bug report. -- --4.0.4 -- Fri Dec 3 17:51:27 PST 1999 Tim Mann -- --* Bug fix: formerly if you invoked SaveGame from EditPosition mode --with black to play, the position was not saved properly. As a quick --fix, SaveGame now takes you out of EditPosition mode before saving. -- --* Changed -matchGames to keep track of the score (won-lost-drawn) and --display it in the banner. The final score is displayed in a modal --popup before the program exits. -- --* Changed "Connection closed by ICS" to display in a model popup --before the program exits. -- --* Added -popupExitMessage option, default on. Setting this to false --suppresses the modal popups that you sometimes get just before --xboard/winboard exits -- both the two new ones listed above and the --existing Fatal Error popup. This is useful when running Zippy --unattended from a shell script (or .bat file) that loops and starts a --new copy after a time delay when there is an error. -- --* In xboard, added missing support for WM_DELETE_WINDOW to all --windows. This makes xboard a better citizen, and is much needed with --the newer X window managers that put an [X] button on every window and --bind it to "kill application" if the applicationd does not support --"delete window". We can't allow xboard to be thoughtlessly killed, --since that leaves the chess engine running in the background. -- --* We now avoid positioning tops of xboard dialog boxes offscreen. -- --* zippy.lines can now use the caret ('^') character as an inter-saying --separator. You no longer need to dig up a text editor that can put NUL --('\000') characters in text files. -- --* Bugfix: In traditional chess clock mode, White now gets time added --to its clock as soon as it makes time control. Previously both White --and Black got their time added only when Black made time control, --which would cause some engines to make their 41st move as White too --quickly, thinking they were low on time. -- --* The zippyAcceptOnly feature no longer sends a decline command or --a tell. Thus you can use it to put Zippy into a manual accept mode. -- --* Bugfix: "tell 50 foo tells you: bar" no longer gets colored as a --personal tell; similarly for "...whispers:" and "...kibitzes:". -- --* WinBoard no longer blanks the message line when you start a new --move, unless there was an error message there from the previous move. -- --* WinBoard now never puts the white piece drop menu on the middle --mouse button. Both colors are always on the right button. Windows --users often don't think to look for a middle button menu, or don't --really have a working middle button despite what Windows says. -- --* Guest login handles on ICC are now parsed again; an ICC wording --change had broken this feature. -- --* Autodetect when the engine does not support the "draw" command and --don't relay the command to it in that case. Needed because sending an --unsupported command to GNU Chess makes it move immediately, so people --could make Zippy move without thinking by continually offering a draw. --Thanks to Frank Walker for the problem report. -- --* Small changes based on code from Robert Jurjevic: The WinBoard --analysis window can be minimized (though not to the taskbar). The --WinBoard ICS Interaction window will autoscroll if you drag the mouse --above or below the window while selecting, and password entry mode --leaves the entry line as the background color instead of using 75% --gray. Seeks are now colorized with a new color of their own. -- --* Added -zippyMaxGames feature. -- --* -zippyNoplayCrafty command line option was missing in xboard; fixed. --Thanks to John Perry. -- --* Fixed bug in detecting when Zippy loses his bughouse partner. --Thanks to Ben Dean-Kawamura. -- --* allobs fix in 4.0.3 didn't work; corrected it. -- --* WinBoard will now update the board immediately if a move is made --while the window is being moved or resized. -- --4.0.3 -- Sun Aug 15 18:44:39 PDT 1999 Tim Mann -- --* Bugfix: moved winboard wizard functions that send a command directly --to the chess engine from Ctrl+Alt+1 and Ctrl+Alt+2 to Alt+1 and Alt+2. --Ctrl+Alt is equivalent to the European AltGr key, so the old assignments --conflicted with typing an @-sign on some keyboards. -- --* Bugfix: prevent "If this message stays up, your chess program does --not support analysis" from appearing if AnalysisMode is selected when --already in Analysis or AnalyzeFile mode. Also, deleting analysis window --in WinBoard now switches you to EditGame mode, to avoid the anomaly of --being in an analysis mode with no analysis window present. -- --* Change all Zippy environment variables to work as command line --options. For now they still work as environment variables too, but --the environment variables are deprecated. -- --* Use unsigned long to hold node counts from engines. -- --* Print error instead of crashing on attempts to use xpm or xim pieces --in monochrome mode. Thanks to Jim Torrance for the bug report. -- --* Tightened pattern recognition for ICS messages sent to Zippy; should --no longer match ICC allobs output. Fixed recognition of when Zippy is --sent a message; small change to FICS output had broken it. -- --* Zippy now exits if the engine dies unexpectedly. -- --* Added Zippy "spoofedby" feature; see zippy.README. -- --* Narrowed the margins on some older WinBoard dialogs to make their --style uniform with the newer ones. -- --* Bugfix: Changing Ponder Next Move from the Options menu did not take --effect until the next game. This bug was in WinBoard only. Thanks to --Stefan Zipproth for the bug report. -- --* Got rid of "Internal error: bad move type" message when the engine --makes a move that we can parse but think is illegal. Now the move is --just passed on (which also may be the wrong thing to do). -- --4.0.2 -- Thu Feb 25 19:55:32 PST 1999 Tim Mann -- --* Added one more built-in sound choice to WinBoard: move.wav from Pete --Galati. -- --* Added new larger piece sizes: big, huge, giant, colossal, titanic. -- --* Modified the xboard font searcher to be able to use scalable fonts. --The new -fontSizeTolerance flag controls how closely a nonscalable --font must match to be used in preference to a scalable font. -- --* Zippy environment variables ZIPPYABORT and ZIPPYADJOURN now control --whether Zippy will accept abort and adjourn requests. -- --* We now determine the variant type being played on ICS, send it as a --command "variant VARTYPE" to the chess engine (if in Zippy mode), and --put it in the PGN tags. See engine-intf.txt for variant names. See --ZIPPYVARIANTS in zippy.README to control what variants Zippy will --accept. Note that this now applies to bughouse, too. -- --* Zippy now won't do -zippyTalk in a channel unless his handle is --mentioned there. -- --* Zippy now ignores bughouse holdings if not actually playing, instead --of stupidly trying to abort the game. Let me know if other strange --things happen when Zippy is observing a game. -- --* Set ICS Interaction title bar to "user@server". User name is --determined by parsing message during the login sequence. Zippy now --uses this method to get its name too, so ZIPPYNAME is eliminated. --Problem: with xboard, the title bar gets set to "xterm" upon exit, --since we didn't know what it was to start with. -- --* Fixed xboard-only bug in -colorChannel1 command line option. Thanks --to Fredrik Sandstrom for the bug report and fix. -- --* Check for overflow of MAX_MOVES. Still not sure this is checked for --everywhere it needs to be. -- --* Added .epd to suffixes recognized by WinBoard as position files. --This is a bit of a kludge, as the .fen reading code was not written --with .epd files in mind, but reading them with it is said to work. -- --* Added ZIPPYGAMESTART feature, suggested by Jason Hoblit. See --zippy.README. -- --* Restored the feature of soaking up the moves from a user-typed "moves", --"oldmoves", or "smoves" ICS command when xboard/WinBoard is idle, but --changed it so that the move list is also echoed to the screen. Some folks --still liked the old feature since it is faster than examine mode, and --printing the moves to the screen should eliminate the confusion it caused --for other people. -- --* Bugfix: in WinBoard, starting a click-click move and then clicking on --a black line would cause the source square to be forgotten without taking --the highlight down. Now the errant click is ignored. -- --* Corrected shortcut key labels for LoadNext/PrevPosition in WinBoard's --File menu. Thanks to Andreas Stabel for the bug report. -- --* Bugfix: if you had a completely full ICS context menu in WinBoard --(90 items), the last one would do nothing if selected. -- --* The "computer" engine command added in 4.0.1 was not working; I had --left out part of the code patch. Oops. -- --4.0.1 -- Fri Feb 12 21:24:15 PST 1999 Tim Mann -- --This is a minor bugfix release. The first item listed below is the --only interesting new feature. -- --* You can now type in moves from the keyboard in WinBoard. Either --select TypeInMove from Step menu, or (if you are not in ICS mode), --just start typing. In ICS mode you can type moves into the ICS --interaction window anyway, so I've retained the feature that typing --switches you there. Not implemented in xboard. -- --* Removed the "noise 1000" command that used to be sent to the chess --engine when entering analysis modes. -- --* Deleted the feature where we soak up the output of a user-typed ICS --"moves" or "oldmoves" command. This ancient feature is not really --useful anymore, now that "examine" exists, and it caused a lot of --complaints. -- --* Increased maximum size of ICS text menu to 90 entries and added --overflow checking. -- --* The command sent to ICS by Zippy at the end of each game can now be --customized with the ZIPPYGAMEEND environment variable. -- --* We treat xboard.info as a pseudo-source since most people don't have --the tools to rebuild it. But "make install" erroneously had a --dependency on it, even though "make all" did not. Fixed. -- --* Miscellaneous minor updates and clarifications to engine-intf.txt. --In particular, documented the st and sd commands (support for command --line options -searchTime and -searchDepth), warts and all. -- --* Added a small code patch from Bob Hyatt to detect when Zippy's ICS --opponent is a computer and send the command "computer" to the engine. --Added this command to engine-intf.txt. Thanks, Bob. -- --* Bugfix: configure was looking for usleep(), but config.h.in didn't --have an entry for it, so HAVE_USLEEP was never defined. Also, in the --non-HAVE_USLEEP case, there was a possible race condition between the --signal handler and the pause() call. Thanks to Ben Dean-Kawamura for --the bug reports. -- --* Bugfix: a "1..." preceding Black's first move (usually present if --there is a comment on White's first move) would cause the parser --to think a new game started there and report "End of game" on the --current game. Thanks to Dell Garner for the bug report. -- --* Changed the abbreviation for -searchDepth from -sd to -depth to fix --a clash with -secondDirectory. -- --* Changed -searchDepth to be orthogonal to the various timing options. --Previously it would search for an unlimited time to the given depth; --now the engine is allowed to choose its search time in the normal way, --but is told to cut off the search early if it reaches the given depth. -- --* Bugfix: SaveSettings in WinBoard was saving both the long form --option highlightSquareColor and its abbreviation (hsc). -- --* Fixed a redisplay bug in DisplayBothClocks that could cause White's --clock to be highlighted in EditPosition mode when Black's should have been. -- --* Fixed Zippy's feature of passing on draw offers from the ICS opponent. --The colorization code was eating the offer before Zippy saw it, so I disabled --colorization of offers while in -zp or -zt mode. (Other types of --colorization are already disabled in Zippy mode for similar reasons.) -- --* Added some more commands to the default ICS context menu in WinBoard, --and put "(name)" on the ones that insert a playername (or game number). -- --* Added missing documentation to WinBoard help file: PonderNextMove, the ---ponder/-xponder argument, and the up/down arrow history feature in the --ICS Interaction window. -- --* Fixed ZIPPYNOPLAYCRAFTY feature to fire only if the opponent is Crafty, --not if some other Crafty is observing the game and kibitzes. -- --* Fixed bugs in generating "partner" commands when Zippy is playing --bughouse. -- --4.0.0 -- Sat Jun 20 16:59:47 PDT 1998 Tim Mann -- --* Fixed WinBoard resizing so that the edges you do not drag remain in --place, even when the final size is different from what you dragged to. --(This doesn't work on NT 3.51 or earlier, if anyone cares.) -- --* Fixed problems with resizing WinBoard on Windows NT: you no longer get --whitespace around the board, a clipped board, or a lot of flashing during --the drag. -- --* Added customization for highlight-square color. -- --* Bugfix: backend.c wrote to stderr in a few obscure places, which doesn't --work in WinBoard. -- --* Added Index Number field back to LoadGame/LoadPosition dialog boxes in --WinBoard. This required some extra code to work with both the --Explorer-style dialog boxes and the old-style NT 3.51 dialog boxes. Ugh. -- --* WinBoard startup dialog now understands -zp mode. The first chess --engine selector is enabled and the value is used. -- --* Bugfix: ResetGame would send "exit" to engine twice if it was in an --analysis mode. -- --* Bugfix: The response "Illegal move: bk" to the "bk" command, indicating --that it is not implemented, would confuse xboard. -- --* Bugfix: Ignore empty hints ("Hint:\n") instead of printing a message --saying that some bogus string (often "Hint:") is illegal. -- --* Bugfix: LoadNextGame/LoadPreviousGame/ReloadSameGame were broken. -- --3.6.12 -- Sat Jun 13 14:57:10 PDT 1998 Tim Mann -- --Beta test release of xboard and WinBoard. -- --* Spruced up xboard man page a bit. -- --* Added Highlight Last Move to xboard too. -- --* The revamped xboard mouse click code had several more bugs than the --previous version, so I revamped it again. All fixed now, I hope. -- --* xboard bugfix: crash in CreatePieceMenu. -- --* Oops. winboard-3_6_11beta.exe installed 3.6.10beta, not the new version. -- --3.6.11 -- Fri Jun 12 20:00:48 PDT 1998 Tim Mann -- --Beta test release of xboard and WinBoard. -- --* Major reorganization to engine-intf.txt. Some new features added, --many existing features clarified and hints for engine programmers added. --Support for new features added to program. -- --* Changed defaults for -scp (etc.) back to being independent of -fcp, as --in 3.6.2. That is, the default is no longer to copy the value from -fcp if ---scp is not specified. This will sometimes make command lines longer but --will remove some confusing situations. -- --* Split -reuseChessPrograms into two options: -reuseFirst and ---reuseSecond. Fixed obscure bugs when reuse is off. -- --* Detect ICC and change some command usage slightly there: only ICC has --set-quietly; only FICS has iset and bsetup clear. With this feature, we --can now safely use bsetup clear when appropriate instead of deleting each --piece one by one. -- --* Added indent to lines that are wrapped by WinBoard ICS Interaction --window. This seems to tickle a Microsoft bug in the RichEdit control: --occasionally the start of the next line after the wrapped line is indented --too. I think the wrapped indent feature is useful enough that it's worth --having in spite of the bug. -- --* WinBoard bugfix: bounding box for the board was computed incorrectly by --mouse code. It would think you moved off the bottom of the board before --you really did, so it was hard to drag pieces along the bottom rank on --smaller board sizes. -- --* Fixed obscure parser.l bug: ambiguity between capture using : instead of --x and email header line. Also removed or simplified a lot of complex --patterns for English (as opposed to PGN) end-of-game indications while I --was in there. -- --* Added PonderNextMove option. -- --* xboard EditPosition piece menus now let you set the side to play by --selecting the "White" or "Black" label at the top of the menu, like --WinBoard. (Both xboard and WinBoard still let you set the side to play by --clicking on the clock.) -- --* Merged documentation of Crafty and GNU Chess thinking output in --engine-intf.txt. Corrected code in backend.c to match documentation; it --used to require the PV to start in column 27 (!). -- --* Fixed bug that caused crashes in "-reuseChessProgram false" mode. -- --* Draw by agreement in Two Machines mode now works as it is supposed to. --Other minor bugs in handling game end messages from machines are also --fixed, and engine-intf.txt is revised in this area. -- --* Revamped xboard code for handling mouse clicks on the board. In --particular, it had a bug if a click-click promotion move was made. -- --* Fixed and reinstated optimization for << in analysis modes: send --initString and re-send the board if needed. Sending repeated undos --is bad because Crafty prints some analysis after every one. -- --* Don't go into a spin loop while pausing between xboard animation frames. --This caused problems, especially when compiling with -O2 on HP-UX. -- --* WinBoard Options/Colors/RevertToDefaults now also turns off Monochrome --if it was on, and similarly for Options/ICSInteractionColors/RevertToDefaults. --This seemed to confuse people before. -- --* Bugfix: ICS Interaction context menu items with neither of the two --optional flags set did not work. -- --* Bugfix: PGN move numbers are optional, but we were insisting on "1" --right after the tags. -- --* Bugfix: only the first game of an -mg match was loading -lpf or -lgf. -- --* Other minor fixes and code cleanup. -- --3.6.10 -- Mon Jun 1 01:32:31 PDT 1998 Tim Mann -- --* Added ZIPPYNOPLAYCRAFTY feature; see zippy.README. -- --* Added timestamps for chess engine interaction to -debug output. -- --* Now allow 10 seconds (was 5) between games in match mode for engines to --respond to "force" command that ended previous game. -- --* When a game is picked from the game list and the names of White and --Black are known, display them in the window banner instead of the filename --and game number. -- --* Changed default for -scp and -sd to be the values of -fcp and -fd. -- --* Added boxes for both engines to WinBoard startup dialog. Changed to --dropdown boxes whose content can be set from winboard.ini, similar to --the box for ICS name. -- --* Accept "offer draw" (or "*offer*draw*") from engine to offer a draw. -- --* Accept "move mmmm" from engine as well as silly "1. ... mmmm" syntax. -- --* Added support for bughouse engines (Zippy mode only). -- --* Move bombproofing for engines sending illegal or out of turn moves. -- --* Always send "xboard\n" to engine as first command. Eliminates need --to run crafty as "crafty xboard". -- --* Rewrote xboard code for input from engines to fix longstanding bugs. --Previously an engine that sent one line in two separate writes with --some time lapse in between (or perhaps that sent several lines in one --write) could make xboard hang. WinBoard did not have this bug. -- --* Fixed minor bugs in dealing with illegal moves. -- --* Added "iset startpos 1" for FICS. -- --* Removed special support to put "GNU Chess" or "Crafty" in the window --banner instead of the engine's base filename. This gives a more level --playing field for other engines. Also fixed bugs in the code that finds the --engine's base filename. -- --* Bugfix: Abort or Resign at the very start of a game in chess engine mode --would fail to send "force" to the engine. -- --* Fixed some minor bugs in new "result" messages, and changed format to --include a trailing PGN comment giving the reason the game ended. -- --* Changed syntax of /font options in WinBoard; old syntax was assuming --that a font name can't contain a digit, which is wrong. Old font names in --WinBoard.ini files are still accepted. -- --* Serious further work on getting WinBoard to read/write files in the --"right" directories and documenting exactly what it does. -- --* Added LoadPreviousPosition, LoadNextPosition, ReloadSamePosition. -- --* Misc. tiny fixes and cleanup. -- --3.6.9 -- Sun May 24 20:53:08 PDT 1998 Tim Mann -- --xboard and WinBoard beta release. -- --* Tightened up illegal move handling. Illegal or meaningless moves from a --file or chess engine should no longer get translated into a1a1 and blindly --applied. Explicit moves to the same square (like a1a1) no longer make the --piece on that square capture itself and vanish. -- --* Added AlwaysOnTop feature to winboard. -- --* Fixed bug in winboard "@" command line indirection operator. -- --* Removed buggy "optimization" code for ToStart in analysis modes. -- --* Fixed typo bug in zippy.c that would often cause winboard to crash --right after starting a game in -zp mode. -- --3.6.8 -- Sat May 23 22:23:19 PDT 1998 Tim Mann -- --xboard and WinBoard beta release. -- --* Added -firstDirectory and -secondDirectory so that chess engines can --be started in a different directory from xboard/WinBoard itself. -- --* Added -matchGames to allow more than one game in -matchMode. The games --are played with colors alternating between the two chess engines. Had to --add a time delay at the end of each game to catch up with game ending --messages from both chess engines -- yuck. -- --* Changed TwoMachines mode to have firstChessProgram play White by --default. Added -firstPlaysBlack to restore old behavior. -- --* Major rework of code in backend.c for dealing with first and second --chess engines. Generalized the code and created a struct type with one --instance for each engine. Several small bugs fixed along the way. -- --* Fixed bugs in Abort in local chess engine mode. -- --* Tightened pattern matching to recognize moves from machine. Should cure --bogus "Illegal move" errors while Crafty is pondering with Show Thinking --on, among other things. -- --* WinBoard keeps focus in board window after popping up a comment due to --Forward/Backward/ToStart/ToEnd commands. -- --* Finally got rid of warnings on compiling moves.c under Windows. -- --* Fixed so WinBoard will compile on machines where WM_MOUSELEAVE is not --defined. -- --* Removed various bits of unused code. -- --* Parse (and ignore) NAGs in PGN files. -- --* Updated engine-intf.txt. -- --* Send "result R" to the chess program at the end of each game, where --R is the PGN result 1-0, 0-1, 1/2-1/2, or *. -- --* Bugfix: suppress animation when loading a game with timeDelay=0. -- --* Bug fix: pondering output from Crafty that contained "..." could be --mistaken for a move, causing bogus error messages and general chaos. -- --* xboard "make clean" bug fix: moved things created by configure to be --removed only by "make distclean". -- --* Fixed a remaining case where move was being animated before being --relayed to opponent. -- --* Backend was reversing time/otim commands to the chess program (new bug), --and was often not sending them on the first move of a game or the first --move after a mode change (old bug). Fixing the latter required a kludge --to work with both GNU Chess and Crafty, because Crafty swaps white and --black clock times when it swaps sides, while GNU Chess does not. The --kludge is that we always make sure the chess engine thinks its opponent is --on move before we set the clock. This will sometimes result in sequences --like "white\ntime xxx\notim yyy\nblack\ngo", or the same with white and --black interchanged. -- --* Removed last trace of old -whiteString and -blackString arguments. -- --* Fixed so that you can type "bd" into the Direct Command dialog when --debugging gnuchess, without having xboard parse the clock display --(starting with "White") as "White wins" and end the game. -- --* Changed moves.c to make a distinction between IllegalMove (where we --could tell what move was intended, but it violates the chess rules) and --MeaninglessMove (where we could not tell). This is a step towards getting --rid of cases where we translate meaningless moves into "a1a1", but some --work is probably needed to track them all down. -- --* Fixed bug in WinBoard monoMode dragging. -- --* Changed WinBoard to new style file dialogs. In the process, disabled --the feature that let you enter the index number of a game or position within --the file in the dialog. This is no loss in LoadGame, as you can pick your --game from the game list dialog that follows, but it does remove some --functionality from LoadPosition. -- --3.6.7 -- Mon May 18 21:25:00 PDT 1998 Tim Mann -- --xboard and WinBoard beta test release. I've been unable to reproduce some --reported drawing bugs, so they may still not be fixed. -- --* Changed PopUpErrors option to PopupMoveErrors, which is more useful, and --changed default to off. Errors other than move errors should always be in --popups; they are often too big for the message area and too important to --put where they can be easily missed. But it seems good to get rid of the --popups for move errors by default. -- --* xboard analysis window no longer forces itself to top whenever there is --new output. Also, now uses built-in Xaw word wrapping instead of trying --to do its own; works better. -- --* Bugfix: Reset did not take Crafty out of analyze mode. -- --* A chess engine no longer has to claim to be Crafty to be able to use --AnalysisMode and AnalyzeFile; it just has to implement the analyze --command as Crafty does. Put in heuristics to generate more informative --error messages if the engine does not support analyze, and checked that --they work at least with GNU Chess. -- --* Added click-click moving, HighlightLastMove, and HighlightDragging to --WinBoard. The highlight features are unlikely to go into xboard unless --the xboard drawing code is cleaned up to do *all* drawing on the board --from DrawPosition, as WinBoard does. This is low priority for me. -- --* Eliminated bogus "Error gathering move list: no header" popup. You --could get this by observing two fast games at once without turning off --GetMoveList. -- --* Disable WinBoard Sounds menu entirely in -ncp mode, since not even --MoveSound is used in that mode. -- --* WinBoard bugfix: Several problems were caused if the user changed --WinBoard's current directory in a Load, Save, or Browse dialog. In --particular, WinBoard.ini would get saved in the wrong directory, and --sound .wav file names would not get saved with a full pathname. I think --all such problems are now fixed. -- --* WinBoard bugfix: iconizing the board after an aborted mouse resize would --(partially) resize it to Tiny. -- --* WinBoard bugfix: board was not being drawn in color on 256-color --displays. This bug was introduced in 3.6.6. -- --3.6.6 -- Tue May 12 17:43:43 PDT 1998 Tim Mann -- --xboard and WinBoard beta release. Note: not all reported bugs are fixed. -- --* Move animation in WinBoard, programmed by Henrik Gram. Great stuff! -- --* Animate backward moves too. -- --* xboard bugfix: -font (and friends) can now specify a font alias (such --as "fixed"), not just a full X Consortium name pattern. Previously this --would give a resource conversion error message. -- --* Some coding style cleanup in xboard.c. -- --* Earlier error check for moving wrong color piece in EditGame mode. -- --* Completed fix to pattern matching; see 3.6.5. -- --* Fixed some software rot bugs in Zippy. -- --* Split AnimateDragging as separate option from AnimateMoves. -- --* Added FlashMoves to options menu and -flash/-xflash to command line --options (xboard only). -- --* Some preliminary work on visible bughouse holding support. Most of the --code is not present in this release because I have not gotten it working --properly yet; my first approach went down a blind alley and I had to --remove most of the partially working code in preparation for a rewrite. -- --3.6.5 -- Fri May 8 14:22:09 PDT 1998 Tim Mann -- --Not generally released. -- --* Pack bughouse holdings display in banner more tightly when board is one --of the smaller sizes (when smallLayout or tinyLayout is true, that is). --An interim measure, but should help. -- --* Completed fix to make move list parsing recognize the end condition and --final comment. -- --* Fixed pattern matching for chatter (tells, etc.) to be more reliable. --This should reduce the incidence of colors starting in the wrong place and --of incorrectly matching things that look like other patterns inside --chatter, such as "shout <12>". (These errors were already rare.) -- --* WinBoard now lets you customize the list of ICS's in the startup dialog. --For now, at least, requires editing WinBoard.ini with a text editor. -- --* Bug fix: WinBoard window sizing and position setting save/restore did --not work right when the taskbar was at the top (or left side) of the --screen and not in autohide mode. -- --* Merged xboard click/click mode and drag mode, and deleted --ClickClickMoving option on menu. Now if you click on a piece, it --highlights and a further click on another square will move it. (A second --click on the same square takes down the highlight.) Or if you press down --on a piece and start to drag, you can drag it to a new square. -- --* When making click/click style moves, if your second click is on a piece --of the same color, instead of saying "Illegal move", we now cancel the first --starting square, replace it with the second, and wait for another click to --finish the move. -- --* Separate -secondInitString. Default: same as -initString. Suggested by --Remi Coulom. -- --* Patch from Frank McIngvale to make animation work with XIMs. Yay! -- --* Changed move animation to happen after move is passed on to ICS or the --chess engine, where applicable. Fixed problems with updating moveList --that this uncovered. -- --* Changed game list to show PGN result token for each game. -- --* The usual minor bug fixes. -- --3.6.4 -- Thu Apr 30 23:14:43 PDT 1998 Tim Mann -- --xboard and WinBoard beta test release. -- --* xboard documentation updated, both man page and info file. An attempt --to generate both from the same source with LinuxDocSGML was abandoned, at --least for now. WinBoard doc updated too. -- --* Merged updates to animation code from Hugh. Fixed a couple of remaining --bugs, mostly to do with handling Pause mode correctly. -- --* Added SaveSettingsOnExit to WinBoard. -- --* WinBoard now saves the last screen position of the Comment, Edit Tags, --Game List, and Analysis windows (in addition to the board and ICS --Interaction windows) in WinBoard.ini. -- --* WinBoard now provides a way to customize the right-button context menu --in the output area of the ICS Interaction window. For now, requires --editing WinBoard.ini with a text editor. -- --* Various minor fixes to ICS message recognition, most affecting only Zippy. -- --* Colorize the notification when someone sends you a message while you are --logged in, not the output of the "messages" command. -- --* Fixed colorization to turn off at the right place more reliably. -- --* Added a new color and WinBoard sound for "requests": abort, adjourn, --draw, pause, and takeback. The same color and sound are used for all of --these. -- --* Added GUI to change sounds in WinBoard. -- --* Suppressed WinBoard error popup when a sound can't be played. They were --popping up when two separate WinBoards tried to play a sound at the same --time (such as during a bughouse match). -- --* Fixed WinBoard crash when a sound file didn't exist. -- --* WinBoard ports of timestamp and timeseal now produce decent error --messages if they fail to connect, and WinBoard captures the messages and --puts them into a popup. Previously WinBoard would exit with no message on --such errors. -- --* WinBoard resizing with mouse improved; now accurately picks the largest --size that fits in the new area. -- --* Added option to turn off error message popups. -- --* Added sizes slim, dinky, and teeny. -- --* Fixed some minor problems with error message wording. -- --3.6.3 -- Mon Feb 23 19:08:57 PST 1998 Tim Mann -- --xboard beta test release only. Man page is updated for the changes, but info --file is not. -- --* Bug fix: LoadGame could not load a PGN game whose first move was --castling (which is possible from setup positions). -- --* Bug fix: we were ignoring illegal move messages from chess engines in --modes where the engine is refereeing but not participating (EditGame, --LoadGame, AnalyzeFile). The problem was in a workaround for a Crafty bug, --where Crafty generates a bogus illegal move message if a "." (used by --the PeriodicUpdates feature) is sent in analysis mode when the current --analysis reveals a forced mate. Installed a different workaround (that --works in most but not all cases) and reported the Crafty bug. Bob Hyatt --replied with a fix, so the Crafty bug should be gone in Crafty 14.12 or so. -- --* WinBoard only: enabled resizing board with the mouse. It snaps to the --nearest (but not too much larger) predefined size. -- --* The xboard default font is now sized according to piece size, just as --clockFont and coordFont have always been. -- --* Added more sizes: bulky, moderate, average, middling, mediocre, petite. -- --* xboard only: Added Animate Moves and Click-Click Moving to Options menu. -- --* xboard only: Added code to animate piece movement, from Hugh Fisher. -- --* New feature: autoflag is implemented in MachineWhite, MachineBlack, and --TwoMachines modes. If it is on and either a chess program or the user --oversteps his time, xboard will automatically call the flag and end the --game. This feature was requested by someone who runs matches between --programs and wants to penalize GNU Chess for its habit of running slightly --over at the end of a time control. I personally think it's pointless. -- --* Fixed a bug in Zippy's pattern matching; he can now reply to ICC --messages again. -- --* Generate prettier notation for illegal moves. If a move is illegal only --because it leaves the player in check, generate notation as if that were --not illegal. For instance, if two knights are a knight's move away from --f3, one on g1 and one on e5 that is pinned, the notation would be Nf3 to --move the g1 knight, Nef3 to move the e5 knight. (Suggested by Philippe --Schnoebelen.) In addition, if a move is illegal because the type of piece --moved cannot go that way, would be jumping over another piece, etc., we --give fully disambiguated coordinate notation; for example, Ng1g3, Ke1xe8, --d2xd8=Q, etc. An alternative would be to still write Ng3 if there is only --one knight on the board, or Ngg3 if the other knight is not on the g file, --but life is too short to code up all this stuff, and perhaps the way I did --it is better as it emphasizes that this move was really made despite being --illegal. I wonder if the new PGN standard revision will speak to notation --of illegal moves? -- --* Fixed gross bug from 3.6.2: if a chess program said "checkmate" and --White was left on move, the PGN outcome was "1-0 {Black mates}" instead --of "0-1 {Black mates}"! The bug occurred only for that specific string. -- --3.6.2 -- Wed Jul 23 16:47:29 PDT 1997 Tim Mann -- --* There was a bug in backing up from the end of a game against a chess --engine, introduced when -reuse mode was added. Fixed. -- --* Recognize "{" as terminating an ICS move list. Previously we needed to --see a prompt (containing %), but occasionally ICC can send more stuff --right after a move list with no prompt in between. -- --* In WinBoard, -mm now implies -cp, so you don't get the startup dialog. -- --* WinBoard startup dialog no longer sets -scp. People used to get --confused because they would give the -fcp and -scp arguments, but omit ---cp. This would bring up the startup dialog, which would set both -fcp --and -scp to the value in the engine name box. Now you can change -scp --only with the command-line argument. That will confuse some people too, --but hopefully fewer. I think overall it's better than putting spaces for --both -fcp and -scp in the dialog, which would puzzle newbies. -- --* Bug fix: Analyze File mode now works in WinBoard. -- --* Bug fix: WinBoard window no longer cuts off part of the bottom row if --the menu bar wraps to a second line. -- --* Accept game end messages of the form "PGN-result {comment}" from the --chess engine, where PGN-result is 0-1, 1-0, or 1/2-1/2. Accept "resign" --or "computer resigns" from the chess engine as a synonym for "0-1 {White --resigns}" or "1-0 {Black resigns}". Accept any message from the chess --engine containing "game is a draw" as a synonym for "1/2-1/2 {Draw}". --Accept "White resigns" or "Black resigns". -- --* Enable "Action / Draw" menu item in chess engine mode. It sends the --command "draw" to the engine. Accept any message from the chess engine --containing "offers a draw" as a draw offer. WARNING: Draw offers from the --user and the engine (or from two engines) are not yet matched up by xboard --in chess engine mode. Two engines could get into a loop offering each --other draws. -- --* Bug fix: Game end messages from the chess engine are always ignored in --Zippy mode. Previously they could sometimes be processed, which was --sometimes making Zippy hang at the start of a new game that followed --quickly after an old one. -- --* Zippy can now respond to titled players in channels. Zippy will avoid --talking to himself in a channel if he knows his own name. -- --* Bug fix: in colorization arguments, the bold setting was being ignored --if the background color was defaulted. (xboard only.) -- --* Extended ParseFEN to accept Crafty 12.2's interpretation of FEN. --If fewer than 8 squares are given in a row, or fewer than 8 rows are --given, the uncovered squares are empty. Also, there can be a / after the --8th row. -- --3.6.1 -- Sat May 17 01:02:33 PDT 1997 Tim Mann -- --* Bug fix: Hitting escape while entering a password on WinBoard no longer --sets the font color back to black (which made further typing visible). -- --* Bug fix: On Windows NT 4.0, WinBoard /ics /icshelper=timestamp would --often hang if you tried to exit with the Exit menu item, the [X] button, --etc. The same fix may also have corrected the problem where running a --chess program with /xreuse would sometimes crash Windows 95 (but not NT) --when the chess program was killed and quickly restarted. -- --* Bug fix: Periodic Updates would not work if turned on after having been --off. Also, the default was needlessly "off" in WinBoard. -- --* Zippy bug fix: Continuing an adjourned game was totally broken. The --wrong moves, or no moves at all, were being fed to the chess program. -- --* WinBoard change: Giving -ics without -icshost now pops up the startup --dialog with "Use an Internet Chess Server" pre-selected, so that you get a --menu of chess servers instead of going directly to ICC. -- --* Bug fix: WinBoard's SaveSettings was saving -icshost, -icsport, and ---icshelper in winboard.ini. This causes a problem if you use a different --icshost later that needs the default values for icsport (5000) and --icshelper ("", meaning none). -- --* Disabled complaints about unexpected "[Ii]llegal move" messages from --the chess program; we still get them at times. -- --* Greatly simplified the code for Move Now and SIGINT (ATTENTION). Fixes --the bug where Move Now did not work with GNU Chess in WinBoard, and --several more obscure bugs as well. Reintroduces a minor bug: GNU Chess might --not think on your time after a Move Now command. Trying to fix this --causes too many other problems. Documented change in engine-intf.txt. -- --* Cleaned up code for obtaining ratings from ICS. It was kludgey and may --have had bugs on systems with no "Creating:" message. It should fail --gracefully there, just not finding the ratings. -- --3.6.0 -- Thu May 8 19:55:58 PDT 1997 Tim Mann -- --* WinBoard now has right-button context menus in the ICS Interaction --window. Some of the items do immediate commands on the player name you --have selected or pointed to. (Suggested by Paolo Casaschi.) Also, the --middle button or shift+right does a immediate Copy and Paste. -- --* Fixed a bug in Zippy's wild rejection. The bug was causing Zippy to --reject all forms of wild. Now it rejects only 1, 9, 16, 17, and 24, as --was intended. These variants have different rules, while the other --variants defined so far only have different starting positions. --(Actually, wild 2, 3, and 4 never allow castling, but may sometimes by --chance have king and rook start on squares where castling appears legal. --This could cause a problem later.) -- --* Zippy now resumes adjourned games by feeding the chess program --the move list instead of the position. Setting -getMoveList to False --restores the old behavior. Feeding in the move list is better because --it enables the chess program to correctly handle en passant legality, --castling legality, draw by repetition, and draw by the 50 move rule. -- --* Added a WinBoard startup dialog for people who run WinBoard.exe without --using the Start menu or reading the help file. Instead of being dumped --directly into GNU Chess mode, you now get a menu of choices. You now have --to give the new WinBoard -cp option to go directly into chess engine mode. --I did not add this feature to xboard. -- --* Handling of "illegal move" from Crafty is now back on. (It was turned --off in 3.4.6; see below.) Crafty 12.0 doesn't seem to send bogus ones --anymore. I did have to suppress sending time and otim in analyze mode to --make this work, but there is no harm in that. -- --* Zippy now sends "gameend" to ICS at the end of each game. You can alias --this to "seek" or whatever you like. -- --* Added Crafty support for Move Now, using the "?" command. We test --whether this command exists by trying it once at the start of the first --game, before it really makes sense. If we don't get a message like --"Illegal move ... ?", we assume it's OK. (We're careful about this --because sending a "?" to GNU Chess on Move Now keeps it from pondering the --next move as it should.) -- --* Added support for a tellusererror command from the chess engine. See --engine-intf.txt. -- --* Attempted to make engine-intf.txt complete. -- --* Minor fixes/cleanup to GameEnds code, to be sure we always interrupt --when needed, and always undo an extra move generated by stopping the chess --program while it is thinking. -- --3.5.7 -- Sat May 03 22:37:44 PDT 1997 Tim Mann -- --Beta release of both xboard and WinBoard. -- --* Updated xboard documentation. I really wish the man page was built from --the info file instead of being separate! It's a pain to update them both. -- --* Updated documentation of the interface between XBoard/WinBoard and chess --programs, and renamed it to engine-intf.txt. -- --* Added support for tellics, telluser, and askuser commands from the chess --engine. See engine-intf.txt. -- --* Various bug fixes. On WinBoard, 256 color displays are finally handled --right; no more color flashing when you switch windows unless the colors --really need to be updated. Also, I think the problem of the console font --failing to change or changing back by itself is finally fixed. -- --3.5.6 -- Tue Apr 29 03:08:00 PDT 1997 -- --Beta release, WinBoard only. ChangeLog was out of date in release, --updated here. -- --* Added ICC timestamp and FICS timeseal to WinBoard distribution. These --are my own ports to Win32, based on and used by permission of the owners --of the proprietary source code (Daniel Sleator for timestamp, Henrik Gram --for timeseal). The owners permit these programs to be distributed only in --binary form (to help prevent cheating), so to avoid running afoul of the --GPL, I have kept them as separate programs, not linked into the WinBoard --address space. Updated Start menu icons to use them. -- --* Miscellaneous smaller changes. -- --3.5.5 -- Fri Apr 25 03:06:00 PDT 1997 -- --Beta release, WinBoard only. ChangeLog was out of date in release; --updated here. -- --* Added simple sound support to WinBoard. -- --* Updated WinBoard documentation. -- --* Internal implementation of the telnet protocol is now more complete. --You can now hop through a VMS host on the way to ICS. For example, do --"xboard -ics -icshost vms.host.edu -icsport 23", then log in. Do not use --the -telnet flag; that says to use an *external* telnet program. To avoid --double echoes, you need to force character mode in VMS telnet after --connecting from VMS to ICS. Do "^]^Mset mode char^M^M". -- --* Display opponent names in the title bar for MachineWhite, MachineBlack, --and TwoMachines modes. -- --* WinBoard now has an installer, built with InstallShield. The installer --works with a binary-only distribution. Sources are still freely --available, but now separately. -- --* Added SaveSettings to WinBoard, which saves current option settings to --winboard.ini. Made sure all options can be saved and loaded, including --fonts and com port settings. -- --* If the game ends while you are dragging a piece, we now don't let you --finish the move. Formerly the move was accepted and your opponent's clock --would start running again. -- --3.5.4 -- Fri Apr 18 01:15:24 PDT 1997 Tim Mann -- --Beta test release of WinBoard and xboard. The documentation remains --out of date. -- --* Many fixes and improvements to new WinBoard user interface code. -- --* In Zippy mode, avoid sending another copy of the same move to the chess --program if ICS sends us another copy of the board image. Hard to believe --it took me until now to diagnose and fix this problem! -- --3.5.3 -- Sat Apr 12 19:49:33 PDT 1997 Tim Mann -- --Beta test release of WinBoard and xboard. -- --* Fixed fatal bug in WinBoard input handling. -- --* Made code to stop chess program for reuse a bit smarter. Removed kludge --of "white" in initString; it didn't work well, and is unneeded --with Crafty 11.21 and later. -- --3.5.2 -- Sat Apr 12 15:40:01 PDT 1997 Tim Mann -- --Beta test release of WinBoard. -- --* Ignore check and permit promotion to King during suicide games; no need --to turn off TestLegality. -- --* Renamed CheckLegality to TestLegality to avoid confusion with the chess --term "check". -- --* Added Rematch to Action menu. -- --* WinBoard now has a custom ICS interaction window with scrollback, a --separate line for input, and colorization. Accelerators that conflict --with normal editing keys were changed (by requiring Alt+) so they can work --in both the console and the main window. -- --* WinBoard error popups are now non-modal and disappear when you make a --new move, as in xboard. -- --* Configure now defaults to --disable-ptys on all systems. If anyone has --an ancient SysV system where pipes don't work with select, they can still --do "configure --enable-ptys" explicitly. I would appreciate getting a bug --report if this happens to anyone, with complete output from configure and --"uname -a". -- --* "make install" now makes the installation directories too. -- --* Fixed a bug that would cause an "Illegal move" message for Black from --GNU Chess to be incorrectly considered bogus. -- --* Handle name changes during an ICS game (FICS bname and wname commands). -- --* You can force both chess programs to be killed at the end of each game --by turning off the reuseChessPrograms option. There are still some --problems with reusing Crafty even in version 11.20. -- --* Now the second chess program stays around by default too, if it ever --gets started. -- --3.5.1 -- Sat Apr 5 16:47:48 PST 1997 Tim Mann -- --Beta test release. -- --* Don't kill off and restart the chess program for each game; keep the --same one running, using the "new" command to start a new game. This --change works around the problem in Windows 95 that makes WinBoard crash it --at times, and is generally desirable to make new games start faster. The --second chess program (for TwoMachines) is still killed at the end of the --game, and unfortunately this can still crash Windows 95. Temporarily --added "white" to the initString to make this work with Crafty 11.20, which --has a minor bug in "new". Older versions of Crafty have worse bugs in --"new"; they should not be used with this version of xboard. -- --* Support for FICS suicide chess: Parse illegal moves (that leave King in --check) in game history. If CheckLegality is off, allow promotion to King --and illegal moves in game files. We still generate e2e4 style notation --for illegal moves. -- --* Handle FICS "has timeseal; checking" message. -- --* Changed the coords from white back to black; this was a bug. -- --* Fixed problems compiling with K&R compilers. -- --* Fixed an old bug in RegisterMove that was crashing cmail on some systems --(notably linux). -- --3.5.0 -- Thu Jan 2 16:59:49 PST 1997 Tim Mann -- --Thanks to Frank McIngvale for much of the work on versions 3.4.4 and above! -- --* Fix Crafty resumed game time bug (frankm) -- --* Word wrap text in Analysis window (frankm) -- --* More debug info for XPM loading (frankm) -- --* Replaced config.sub, config.guess, etc., with up-to-date versions from --autoconf 2.12. Hopefully this will fix problems on Pentium Pro machines. -- --* Removed some Makefile gunk that was causing looping for one person. -- --3.4.7 -- Thu Dec 19 14:22:41 PST 1996 Tim Mann -- --All changes from Frank: -- --* Retrieve ratings from ICC (and FICS, etc., when they add the Creating: --message), save them in the PGN tags, and pass them to Crafty in Zippy mode. -- --* Add settable time delay between characters in ICS login script. -- --* Colorize messages like personal tells. Fix false recognition of channel --tells. -- --* Pass "tells" from Crafty through to ICS (in Zippy mode). -- --* Implement ~/ filename convention from C shell for game and position file --names. -- --* ZIPPYACCEPTONLY feature for testing. -- --3.4, patchlevel 6 -- Sat Nov 23 16:58:50 PST 1996 Tim Mann -- --* Put recognition of "illegal move" messages from Crafty for --illegal castling, etc., inside an #if that is currently turned off, --because of a bug in Crafty that generates bogus "illegal move" messages --after some moves that are actually legal and accepted by Crafty. -- --* Added -checkLegality option; previously this could not be turned off. -- --* Fixed an old bug in finding default board size parameters. -- --* Differentiated among channel tell, kibitz/whisper, and personal tell/say. -- --* Fixed a bug in detecting Xpm in the configure script. -- --3.4, patchlevel 5 -- Mon Nov 18 16:22:53 PST 1996 Tim Mann -- --* Added zic2xpm to the kit; it had been omitted by mistake. -- --* Added some default colors for -colorize -- --3.4, patchlevel 4 -- Sat Nov 16 18:10:17 PST 1996 Tim Mann -- --This is meant to be a beta release in preparation for version 3.5. -- --* Added InfoXBoard and ManXBoard to the Help menu. -- --* Made Frank's ICS input box optional, defaulting to off. -- --* Merged in Frank McIngvale's XbKit. Many new features, including ---clickClick mode, the Analysis modes, piece flashing, ZIICS import, --ICS text colorization, and the ICS input box. Many thanks to Frank for --supplying and documenting this code. -- --3.4, patchlevel 3 -- Mon Nov 11 18:23:14 PST 1996 Tim Mann -- --Small set of changes made while Frank McIngvale was working on XbKit in --parallel. Unreleased in this form. -- --* Updated zippy.README. -- --* Removed useless X event handler and removed strange code for copying --form translation table to board that worked around the bug it caused. --This makes changing bindings in .Xdefaults more straightforward. -- --* Now pressing the Control key steps back one move, and releasing it steps --forward again. -- --* Moved quit from "q" to "Q" for greater safety. -- --* Use "unobserve" instead of "observe" to stop observing; needed on FICS. -- --* Support for interface variable. -- --* Strip titles from people who are talking to us, so (for example) Zippy --won't try things like "tell Darooha(*) hello". Needed on FICS. -- --3.4, patchlevel 2 -- Tue Jul 9 19:06:42 PDT 1996 Tim Mann -- --This patchlevel is not planned to be an announced release. It's in --preparation for integrating Frank McIngvale's XbKit. It mostly contains --minor fixes I've accumulated since 3.4.pl1. -- --* WinBoard /telnet option now fires up an external program, as --with xboard, instead of trying to use a feature of NT 3.1 that does not --exist in later versions of NT or in Windows 95. ChangeLog for 3.4.pl1 --said this had been implemented there, but it really wasn't. -- --* Indicating player to move by the icon color now works under Windows 95. -- --* WinBoard now kills the chess program when you exit using the system menu --or the [X] button. Thanks to Michael Lowe. -- --* Minor changes to Zippy, including: Now understands wild challenges on --FICS; these used to crash it. Removed limit on how fast a game will be --accepted. Use "set formula ..." on the chess server to limit this if you --are using GNU Chess. Now sends correct opponent name to Crafty. -- --* Added some missing default values to documentation. Thanks to Stuart --Cracraft. -- --* Bugfix: Trying to print "No fonts match pattern" error message would --crash. This can happen to Linux users who don't install Helvetica, for --example. -- --* Bugfix: Defaulting feature in -size n,n,n,n,n,n would put us in an --infinite loop. -- --* Added more directories to search for Athena widgets on HPUX. -- --* New cmail (3.12) from Evan Welsh; includes small fix from Kayvan Sylvan. -- --* Recognize "illegal move" messages from Crafty for illegal castling, etc. -- --* Bugfix: "name" command added to zippy.c for Crafty was producing error --message if GNU Chess was in use. -- --* In bughouse mode, suppress holding messages from console window; show --holdings only in banner. -- --* Minor fixes/cleanup to Makefile.in and configure.in. -- --3.4, patchlevel 1 -- Mon Dec 11 13:43:12 PST 1995 Tim Mann -- --* This patchlevel updates WinBoard to match xboard, and includes a few --fixes and minor improvements. "-size tiny" and "-size n,n,n,n,n,n" --are still not implemented for WinBoard. -- --* Installed support for Crafty based on code from Bob Hyatt. --Currently the only documentation for this is in the FAQ, and a few --things don't work with Crafty 8.23. Please do not report these --problems as bugs in either xboard or Crafty. Bob and I know about --them. The worst ones (if not all of them) should be fixed in Crafty --8.24. -- --* Changed the kludge command we send when gnuchess wants to print --something that doesn't end with a newline, from "help" to "bogus". --This works because the error message gnuchess prints ends with a --newline. It also improves compatibility with Crafty, which doesn't --need the kludge, but for which sending "help" causes a problem. -- --* Don't draw grid at all if lineGap is 0; previously we drew the grid --with X "0-width" lines (usually 1 pixel wide) and then overwrote it. -- --* Makefile: Removed xboard.info from "all" target so we won't try to --rebuild it, because this fails on hosts that don't have makeinfo --installed. Other minor fixes to "clean" targets, etc. -- --* Fixes and cleanup to Auto Comment code that handles continuation --lines and highlighting. -- --* Auto Observe now tries to observe the game from the point of view of --the player who was on your gnotify list. Requested by rng. --Limitations: We can't tell which player it was unless you have ICS --highlighting turned on. Also, currently "observe foo" works as --required (observing from foo's point of view) only on ICC, but FICS --will probably implement this soon. -- --* "-size tiny" now makes the default font smaller automatically. This --was implemented by introducing an extra Form widget in the hierarchy --for all xboard windows, named either normalLayout, smallLayout, or --tinyLayout. So you can have resource specifications that apply only --to certain layouts; in particular, XBoard*tinyLayout*font. -- --* Bug fix: EditGame or EditPosition while playing or examining still was --not really being permitted. -- --* WinBoard bug fix: On the EditPosition menu, King did not work. -- --* Added text catalog of WinSock error messages to WinBoard, because --Microsoft still has not put them in the system message catalog. -- --* Removed support for older ICS game-ending messages that do not have --a PGN result token (*, 0-1, 1-0, or 1/2-1/2) after the closing '}'. --The code for older messages was sometimes firing on the newer --messages, due to parsing ambiguity. If the current code sees an old --message, it will understand that the game is over, but will always --display * as a result token instead of trying to guess the result by --interpreting the text message. -- --3.4, patchlevel 0 -- Tue Nov 21 01:02:50 PST 1995 Tim Mann -- --* This patchlevel was released for xboard only. -- --* Updated the info file. It should now be as up-to-date as the man page, --with good English except in the parts that pertain only to AmyBoard. -- --* Added "-size tiny", requested by Bob Hyatt. Also cleaned up bitmap --support and added "-size n,n,n,n,n,n" to allow arbitrary-sized bitmaps, --if the actual bitmaps are supplied by the user. -- --* Updated bughouse support. -- --3.3, patchlevel 4 -- Sat Nov 18 02:27:21 PST 1995 Tim Mann -- --* Unreleased beta that works with preliminary FICS bughouse code. Will --need changes before release to track FICS message changes. -- --* Removed use of .EX macro from man page. It is not supported by some --nroff -man macro packages, notably the one on Slackware Linux. Switched --to boldface for references to xboard and other commands within the man --page, as this seems to be the modern way. -- --* Bug fix: If ICS rejected a move, it was correctly undone on the board, --but the message widget still displayed the bad move. Reported by DAV. -- --* Normally, xboard in ICS mode fetches the move list whenever the board --display switches to a new game. Doing this is now an option --(getMoveList) that can be turned off, which is useful if you are watching --multiple blitz games. Requested by rng. -- --* Move list fetching code is now smarter: it ignores a move list if it is --not for the right game. -- --* Added support for bughouse as implemented on FICS. Holdings are shown --in the window title in place of the strength numbers. A menu on mouse --buttons 2 and 3 (same on both) lets you drop pieces. There is no checking --as to whether you actually hold the piece you are trying to drop; we rely --on ICS to check that. Notation of the form P@f7 is generated and parsed. --The mate detector does not understand that non-contact mate is not really --mate in bughouse, but this does no real harm. It results in a "#" --suffix being displayed on the move notation, but xboard does not assume the --game is over. -- --* Bug fix: Promotion to a knight was not working with ICC! Thanks to --Wendigo for the report. -- --* Bug fix: Special pty code for host types *-*-aix3* and *-*-irix3* --(supplied from configure.in) had a bug that would cause childio.c to --fail to compile, due to a "continue" that was not within a loop. -- --* Bug fix: In pgntags.c, memory was being freed while still in use. One --symptom this caused was that on some machines, cmail would fail with a --message that it could not find the BlackNA tag. The error was in some --submitted code that I included in version 3.2.pl3 without reading --carefully enough. Anders Forberg noticed the symptoms, and Evan Welsh --(who had nothing to do with causing the bug) found the bug and submitted a --fix; thanks to them both. -- --* Removed restriction against using EditGame while playing, observing, --or examining on ICS. You still get a warning popup. -- --3.3, patchlevel 3 -- Sat Sep 16 11:44:05 PDT 1995 Tim Mann -- --* Bug fix: Going directly from MachineWhite to TwoMachines mode would kill --off the second chess program after Black's first move. -- --* Added -timeIncrement feature. Thanks to Joel Rivat. -- --* Deleted code that tries to keep you from observing more than one game, --or observing while playing or examining. There is actually no problem in --doing this, except that every time an update comes in from a different --game than is currently being displayed, xboard fetches the history of the --new game, which may be time-consuming if you are on a slow link. -- --* Fixed configure so as not to crash when neither lex nor flex is found. --lex or flex is needed only if the user wants to rebuild parser.c. Thanks --to Phil Humpherys for reporting the crash. -- --* Bug fix: config.h.in used #define instead of #undef for some macros used --in the pty code in childio.c. This causes the code to fail to compile on --some architectures, because the symbols are supposed to be undefined, not --defined to empty, when they are not set in configure. Bug originated in --3.3.pl0 when config.h was introduced. Thanks to Phil Humpherys for report. -- --* Bug fix: ShowThinking would not show anything when current position had --no move to display in the move window. E.g., if position was created by --LoadPosition or EditPosition. -- --3.3, patchlevel 2 -- Mon Aug 28 11:11:11 PDT 1995 Tim Mann -- --* Zippy code was omitted from xboard-3.3.pl1 by mistake; now included. -- --* For WinBoard, added hint to help file that you may need to turn off --LocalLineEditing while typing dialing commands to your modem. -- --3.3, patchlevel 1 -- Sat Aug 19 15:13:30 PDT 1995 Tim Mann -- --* Zippy distribution is no longer separate from regular xboard distribution. -- --* Deal properly with Show Thinking output from GNU Chess when it is --thinking on its opponent's time. In TwoMachines mode this output is --suppressed to avoid interfering with the output from the machine that is --on move; in other modes it is displayed (including the move that GNU Chess --is predicting the user will make next). GNU Chess produces this output --only if it is built without -DQUIETBACKGROUND defined; this symbol is --defined by default in patchlevels before pl75, but undefined by default in --pl75. -- --* Bug fix: Handling of initial board position in move list for wild games --was broken, so wild games could not be observed and adjourned wild games --could not be continued. Thanks to "Maximum Entropy" for the bug report. -- --* Added feature: algebraic notation now shows "+" indicator for check --and "#" for checkmate, as called for in PGN standard. Thanks to Kevin --Maher for the suggestion. -- --3.3, patchlevel 0 -- Thu Jul 27 22:21:07 PDT 1995 Tim Mann -- --* Changed configuration to use a config.h file instead of passing zillions --of -D options on the cc command line. -- --* Merged a small fix and some updates to the texinfo file from Jochen --Wiedmann. The texinfo file still needs work. -- --3.2, patchlevel 5 -- Tue Jul 18 20:29:39 PDT 1995 Tim Mann -- --* Beta test release of xboard only. -- --* Updated WinBoard code to include new xboard features. -- --* Added texinfo file from Jochen Wiedmann to the release, but not as the --primary documentation. It needs updating, and the English needs work. --I did make a few improvements, mostly to change incorrect uses of @var to --either @samp or @code as appropriate. -- --* Merged in code changes to 3.2.pl4beta from Jochen Wiedmann. -- --* Fixed EditComment; did not pop up window in previous beta. -- --* Added AutoComment feature. -- --* Added GameListDestroy to disable the outdated game list popup in cases --where we load a new game file without building a new popup. -- --* Added yyskipmoves feature to parser.l to speed up building of gamelist. -- --* gamelist.c wouldn't compile with a non-ANSI compiler. Fixed. -- --* Change to yy_text handling in patchlevel 3 still had problems. Can't --use AC_DECL_YYTEXT in configure.in, because that defines YYTEXT_POINTER --according to whether the lexer on the current host makes yytext a pointer. --But most people will be using a parser.c that was generated on another --host and shipped with the package. -- --3.2, patchlevel 4 -- Sun Jun 25 19:13:43 PDT 1995 Tim Mann -- --* Beta test release of xboard only. -- --* Added FIREWALLS section to man page. -- --* Changed -icsport to be a string. Now with the -telnet option, --specifying -icsport "" suppresses the second argument to telnet. -- --* Added EditTags feature. Removed AboutGame from menu, because EditTags --subsumes it. EditTags suggested by Jochen Wiedmann and first implemented by --him in AmyBoard. xboard implementation is my own. -- --* Fixed some missing or incorrect prototypes. -- --3.2, patchlevel 3 -- Sat Jun 3 18:57:38 1995 Tim Mann -- --* Beta test release of xboard only. -- --* New version of cmail from Evan Welsh, to fix compatibility problems with --perl 5.0. -- --* Added game list feature on Load Game, based on code from Jochen --Wiedmann. Integrated it with cmail. -- --* Several bug fixes from Jochen Wiedmann, including one to my yy_text --workaround for the difference in the type of yytext between lex and flex. -- --* Handle clock pause on FICS. -- --* Suppress clocks in untimed FICS games (time control 0 0). -- --* Rebuilt configure script with autoconf 2.3. This fixes a bug in --configuring for X11R6, where -lSM -lICE would not be added when needed. -- --* Fixed inconsistent type declarations on IntSigHandler and --CmailSigHandler. Bug report from Josh Daynard. -- --* backend.c wouldn't compile with a non-ANSI compiler. Fixed. -- --3.2, patchlevel 2 -- Tue Feb 7 14:50:30 1995 Tim Mann -- --* Minor release of both xboard and WinBoard. -- --* Added recognition of some FICS messages. On the other hand FICS is also --changing some of its messages to match what xboard already recognizes. -- --* Temporarily went back to using "promote" command on ICS instead of --"a7a8=Q", because FICS doesn't implement the latter yet. -- --* We now avoid using overlapped I/O on pipes in WinBoard, to make Windows --95 beta 2 happy. This lets WinBoard work with GNU Chess on Windows 95! -- --* Installed patches from Jochen Wiedmann to coordinate with Amiga XBoard. -- --* Installed patch to cmail bug in LoadGame from Evan Welsh. -- --* Bugfix: checkmate and stalemate moves entered with EditGame in ICS mode --were not being handled correctly. Bug was in GameEnds(). -- --* Implemented EchoOn and EchoOff for xboard, using system("stty echo\n"). --Now passwords won't be echoed when you connect directly to ICS. Also, --telnet negotiation characters aren't displayed (when possible). -- --* Implemented more of the telnet protocol. Now connecting to a telnet --server with "-icsport 23" should work even without giving the -telnet --option. The telnet is in "old line-by-line mode". -- --3.2, patchlevel 1 -- Sat Dec 10 13:50:46 1994 Tim Mann -- --* This patchlevel released for WinBoard only. -- --* winboard.c: Fixed ConsoleInputThread(). Needed to change CRLF to LF, --not to CR. This was stopping normal /ics mode from working. Thanks to --Asher Kobin for the bug report. -- --* winboard.c: Fixed Raw(), EchoOn(), EchoOff(). Now they take effect --immediately, not on the next console read after the one in progress. -- --* winboard.c: Attempted to make WinBoard work with gnuchessx running --directly on Windows (not remotely via rsh). It now works on NT, but only --if gnuchess is told not to think on its opponent's time ("easy\n" removed --from initString). The problem seems to be that GenerateConsoleCtrlEvent --is not doing anything. On Windows 95 beta 2, we get error messages on --both reading and writing to gnuchessx; I didn't investigate why. -- --3.2, patchlevel 0 -- Wed Dec 7 13:23:36 1994 Tim Mann -- --* Thanks to all the beta testers who gave me feedback: Josef Nelissen, --Steve Booth, Evan Welsh, Dima Dakhnovsky, Chris Petroff, Peter Jansen, --Derek Terveer, Michel van der List, Richard Lloyd, Shelly Mistry, and Mike --Lee. Sorry if I forgot anyone. Thanks to Virendra Kumar Mehta for --information about DYNIX/ptx. -- --* Don't exit on keyboard EOF unless we get two in a row. -- --* WinBoard only: added -localLineEdit switch to allow turning off local --line editing if you really want to. It is still a bad idea to let the --echoing be done remotely, however; see below. -- --* Fixed some configure problems on HP-UX. [Steve Booth] -- --* Fixed (I hope) configure problem on SunOS 5.3/Solaris 2.3. [Josef Nelissen] -- --* cmail bugfix from Evan Welsh (cmail 3.4). -- --3.1, patchlevel 9 -- Fri Dec 2 23:54:56 1994 Tim Mann -- --* Beta distribution only -- --* Always do local echo/edit of user typing in ICS mode. Doing the echo --downstream may seem nicer in some modes, and it can be hard to turn that --echo off, but the echoed characters can be interleaved with ICS output --and make it impossible to parse correctly. For xboard this involved only --a change to recommendations in the man page, as Raw() isn't implemented. --For WinBoard, removing Raw() made a real difference. Added code in --WinBoard to change /r/n back into /r on keyboard input, as we get the --former when Raw() is not called. -- --* Do not issue ICS "refresh" command after we start to observe a game --unless we get to the next prompt without seeing a board image. Newest --version of ICS doesn't require this refresh, but old versions around still --do. -- --* cmail bugfix and small code cleanup in LoadGame, from Evan Welsh. -- --* Added keyboard accelerators N/P for LoadNextGame/LoadPreviousGame. Evan --Welsh request. -- --* Using "-" on the command line as a filename for loading (saving) games --or positions specifies the standard input (standard output). Alain Picard --suggestion. -- --* On WinBoard only, a command line option without a leading '-' or '/' is --now taken as the value of -lgf. -- --* Changed to not use stdin, stdout, stderr as initializers in backend.c; --needed for GNU libc compatibility. You also must build parser.c with flex --(not lex) if you are using GNU libc, to avoid having the same problem --there. -- --* Changed WinBoard to avoid using "overlapped" input on the console. It --now seems to fully work on Windows 95 beta 2. -- --* Improved comment popups on WinBoard. Now newlines are handled properly, --and the plain Comment popup window doesn't disappear and reappear when we --step to a new move with a new comment. -- --* Fixed bugs in detecting the absence of the time and otim commands. -- --* Added built-in implementation of rcmd protocol to WinBoard. Windows NT --does not implement passing signals through rsh, and Windows 95 does not --have rsh at all. -- --* Added -remoteUser option. -- --3.1, patchlevel 8 -- Mon Nov 28 15:26:07 1994 Tim Mann -- --* Beta distribution only -- --* Rearranged ChangeLog file into reverse chronological order to be closer --to GNU standards. -- --* Integrated new cmail code from Evan Welsh (including cmail RCS rev 3.2). --Includes a bug fix to TruncateGame. -- --* Updated ICS address to be chess.lm.com. -- --* Bug fixes to handling the aftermath of FatalError. Thanks to Chris --Petroff for the bug report. -- --* Test for remsh before rsh, other fixes for HP-UX. Thanks to Richard --Lloyd. I wasn't able to do all the things he suggested, so there may --still be some rough edges in building on HP-UX. See the FAQ file for hints. -- --* Bug fix; added missing check for HAVE_SYS_SYSTEMINFO. Thanks to Josef --Nelissen for testing on Solaris 2.x. -- --* Updated WinBoard to match xboard. (WinBoard still has a few option --dialogs that don't exist in xboard.) -- --* Changed Hint output to a popup. -- --* ShowThinking output and move output no longer overwrite each other. --ShowThinking output won't appear if the displayed position is not current. --ShowThinking output in TwoMachines mode made clearer and documented. -- --* Implemented --enable-ptys and --disable-ptys arguments to configure. -- --* Fixed Book and Hint code to work over a pty with echo enabled and tabs --expanded to spaces. Thanks to Dima Dahknovsky for the bug report. -- --* Moved Attention calls from all over xboard to one place, inside --SendToProgram. -- --* Added bulletproofing to ShowThinkingEvent. -- --* Added code to handle "refresh N" boards that come in from ICS properly, --assuming ICS is changed to mark them with a new relation code (-3). -- --3.1, patchlevel 7 -- Sun Nov 13 22:16:01 PST 1994 -- Tim Mann -- --* Beta distribution only -- --* Changed ShowThinking to just show the current best line in the --DisplayMessage area, instead of dumping everything to stdout. -- --* Installed new cmail (RCS rev 3.1) and cmail.man (RCS rev 1.10), and --changes to cmail code in backend.c, from Evan Welsh. -- --* Miscellaneous minor fixes. -- --3.1, patchlevel 6 -- Fri Nov 4 12:53:53 PST 1994 -- Tim Mann -- --* This patchlevel was not actually released to anyone. -- --* Updated the pty code to be based on GNU Emacs 19.24, and moved it to a --separate file. It was hard to split out just the pty configuration from --all the stuff emacs does with its custom configure script and .h files, --but I did my best. -- --* Converted from imake to GNU autoconf. This was a serious upheaval. -- --* Put in code to help trap "error gathering move list" problem reported by --Michel van der List if it recurs. I couldn't reproduce it. -- --3.1, patchlevel 5 -- Mon Oct 31 21:12:00 PST 1994 -- Tim Mann -- --* Beta distribution only. -- --* We now test for checkmate or stalemate in EditGame mode after every user --move, and in LoadGame mode whenever we hit the end of a game without --seeing a PGN end marker. cmail needs an update to deal with this --correctly; Evan promises one. -- --* Bugfixes in new move generator. Thanks to Mike Lee for reporting one of --the bugs. -- --* Imakefile was omitted from patchlevel 4. -- --3.1, patchlevel 4 -- Mon Sep 19 18:19:46 PDT 1994 -- Tim Mann -- --* Beta distribution only. -- --* The move generator includes a mate tester. Initially this is used only --by cmail, and even that usage needs further work. -- --* Wrote a true move generator and used it to replace all the move --disambiguation and legality checking code in parser.l. The move generator --is capable of dealing correctly with en passant and castling availability, --but the rest of the program still does not keep track of this information. -- --* Bug fix: xboard did not handle "foo has made you an examiner of game 23" --message. Thus you could not use examine features until the next board --came in, showing your new relation to the game. Thanks to POOKIEWOOKIE on ICS --for the bug report. -- --* Added AutoObserve feature. Thanks to Chris Petroff for the idea. -- --* Added Book feature to use new gnuchess "bk" command. Mike McGann request. -- --* Redid code to handle missing "time" command in gnuchess, because latest --gnuchess no longer sends a response to this command. -- --* Eliminated need for -DFLEX. Thanks to Michael Shields (Vladimir?) for --the idea. -- --* Added missing code to implement MoveNow in TwoMachines mode. -- --* Added ShowThinking feature. Thanks to Richard Lloyd for the idea. -- --* Applied patches from Evan Welsh; some fixes and improvements to the --cmail code. -- --* Fixed bug in moving from EndOfGame mode to MachineWhite or MachineBlack, --introduced in previous patchlevel. Also fixed related bug in ending a --game in ICS mode; was entering EndOfGame mode instead of IcsIdle. -- --* Added patch to implement internetChessServerLogonScript flag, from Kevin --O'Connor. Thanks! -- --3.1, patchlevel 3 -- Wed Sep 7 13:22:07 PDT 1994 -- Tim Mann -- --* Beta distribution only. -- --* Merged in new cmail code from Evan Welsh. He added the ability to have --more than one game per message, needed for official IECG matches. I added --the ability to resign or offer/accept/decline a draw in a cmail game. -- --* Bugfix: invalid -tc option caused segmentation fault; DisplayFatalError --was called too early in initialization. Georges Honore reported this bug. -- --* Decided to keep EndOfGame mode as an element of the user interface---it --means that a gnuchess game or loaded game has ended, and the user must --explicitly select EditGame to edit it, rather than just being able to --enter more moves freely. But internally there is no longer an invariant --tying this mode to whether the chess program is running. -- --* Zippy bugfix: Was saving only the final position in the -sgf file when --the game ended by something other than resignation or flag. Also fixed --the longstanding bug that Zippy would think the final board of such a game --was a new game and restart the chess program. -- --* Now does a better job of faking castling availability in FEN. We still --don't really keep track of it, but now at least we don't say that castling --is still available when the king or rook is not on its home square. -- --* Bugfix: Initial board of game history for wild games was going through --too much processing, causing us to forget the game length, which is now --needed by ParseGameHistory. This was causing problems with resuming --adjourned wild games. -- --* Updated ICS host to ics.onenet.net. -- --* Zippy now accepts challenges where the opponent specified his color. -- --* Added ZIPPYPASSWORD2 to let operator give commands directly to gnuchess. -- --* Bitmap directory can include alternative icons now, too. -- --* Handle "Game * (*) has no examiners" message from ICS. -- --* Revamped window title and icon name selection. -- --3.1, patchlevel 2 -- Sun Jun 12 17:16:28 PDT 1994 -- Tim Mann -- --* "Beta" distribution for Zippy users only. -- --* Bugfix: common.h was assuming that X11 type Boolean is char, which is --not always true. This might have caused all sorts of obscure bugs! -- --* Installed new bitmaps from Elmar Bartel as the default. Many thanks! --The old bitmaps can be used by changing the "bitmaps" symbolic link before --compiling xboard, or by using the -bitmapDirectory option at runtime. -- --* Loading a game that ends with the PGN unfinished symbol ("*") now always --leaves you in EditGame mode. -- --* Added documentation of -icscomm to man page. Thanks to Maarten Remkes --for the linux script. -- --* ^C now kills gnuchess as well as xboard. Thanks to Dima Dakhnovsky for --reminding me how to do this. -- --* Bitmap icon color now indicates player to move. Stuart Cracraft --suggestion. -- --* Changed piece bitmap flags to have just one flag, which points to a --directory full of bitmaps, instead of a flag for each bitmap. Also --changed bitmap naming convention. -- --* "Connection closed by ICS" is no longer a FatalError popup. This was --too annoying in the normal case where the user typed "quit". -- --* Changed default font to 14 pixels instead of 10 points. This seems to --make it close to the size I want it to be on more displays. -- --* Major mode (GNU Chess, etc.) appears in title bar. Stuart Cracraft --request. -- --* Bug fix: EditGameEvent, MachineBlackEvent, MachineWhiteEvent, and --TwoMachinesEvent were calling PauseEvent to get out of pause mode, which --now has undesired side effects, such as advancing the display to the --forwardMostMove. It works fine to just set pausing = FALSE instead. -- --* IcsExamining mode now lets you access ICS edit position commands using --the same popup menus as xboard's EditPosition mode. Thanks to DAV on ICS --for inspiring the idea. -- --* Corrected test for gcc on HP in Imakefile; thanks to Richard Lloyd. -- --3.1, patchlevel 1 -- Wed Jun 1 16:25:11 PDT 1994 -- Tim Mann -- --* Added parser.c.lex and parser.c.flex to the distribution. -- --* Added HP gcc options to Imakefile, from Mats Nylen. -- --* EndOfGame mode no longer highlights EditGame mode indicator, because the --modes really do differ. I would like to get rid of EndOfGame mode in the --future, at least as far as users can see. -- --* Larger %a in parser.l, needed for RS/6000 users. -- --* Minor improvements to Mail Move error messages. -- --* When -debug flag is given to xboard, -v is passed to cmail. -- --* Old Save Style uses "1. ..." instead of "1..." when black moves after a --comment; more like xboard 3.0's actual style. -- --* New version of cmail from Evan Welsh. Looks for UCB Mail in a more --portable way and has some minor bug fixes. -- --* Bug fix: Saving a FEN position while in EditPosition mode with black to --play was showing white to play in the saved position. -- --3.1, patchlevel 0 -- Fri May 20 16:36:15 PDT 1994 -- Tim Mann -- --* This is the first general release since 3.0, patchlevel 9. Releases --since then have been limited-distribution or beta releases. -- --* Thanks to my version 3.1 beta testers: Dmitry Dakhnovsky, Ed Hanway, --Richard Lloyd, Mike McGann, Shelly Mistry, Josef Nelissen, Chris Petroff, --Jack Robertson, Michel van der List, Ky Macpherson, Derek Terveer, and --Evan Welsh. Sorry if I've forgotten anyone who gave me feedback. -- --* Updated man page. -- --* Minor cleanup on menu sensitivity code. -- --* Integrated another even better version of cmail from Evan Welsh, --including some code he supplied in xboard itself. -- --* A few more fixes to cmail support. -- --* Automatically update clocks after an ICS "moretime" command. -- --* Handle ICS automatic examine mode (set examine 1) after a game. -- --3.0, patchlevel 14 -- Tue May 17 13:41:44 PDT 1994 -- Tim Mann -- --* Beta test release only. -- --* Don't suppress prompt on first board of game being examined; otherwise --it looks like nothing happened at all (i.e., like you're lagged). -- --* Added StopExamining and StopObserving (Chris Petroff suggestion). -- --* Made Reset do a refresh on ICS. John Chanak's original ICS code for --xboard tried to do this; I finally decided it was a good idea after all. -- --* Fixed bugs in handling updates that come in while you are pausing in --examine mode. This is pretty tricky to do right. -- --* Made un-Pausing immediately pop you to the current position. This is --always necessary in examine mode, since the game may have changed under --you; your remembered moves might no longer be right. So I made it do the --same in all modes. -- --* Took Detach Examine mode back out...used Pause mode for this instead! -- --* Put in a trap for the GNU Chess bug of printing an Illegal Move message --when its own hint move is illegal. -- --* Attempted to fix a Zippy bug; bogus "exited unexpectedly" messages after --it checkmates its opponent. This involved adding an argument to GameEnds --to say who says it ended (ICS, GNU, etc.) and taking different actions in --different cases. Unfortunately, this just restored an older Zippy bug, where --Zippy restarts gnuchess when it gets the board with the final position, --because GameEnds still puts xboard in EndOfGame mode. Sigh. -- --* We now capture elapsed time on last move when getting game history. --(Josef Nelissen bug report) -- --* Rewrote code to redisplay last file title so it really works. -- --* Fixed bug in oldSaveStyle. -- --* Larger %a and %o were needed for lex. -- --3.0, patchlevel 13 -- Mon May 16 16:26:22 PDT 1994 -- Tim Mann -- --* Beta test release only. -- --* FatalError popups stay on the screen now. If the error is really fatal, --all functions are disabled, and the program exits when you press OK. -- --* Redisplay last file title when using Load (Next/Previous/Same) Game. -- --* Zippy understands new match challenge message format on ICS. -- --* Added Revert command. -- --* When examining a game on ICS, < > buttons do ICS backward/forward --commands, unless you set the Detach Examine option. Thanks to Dima --Dakhnovsky for the idea. -- --* Fixed various minor problems in cmail mode. -- --* cmail generates the tags now. New version of cmail from Evan Welsh. -- --* cmail mode won't let you do MailMove unless the currently displayed --position is exactly one move past the end of the game you loaded. -- --* Fixed building of man pages in Imakefile -- --* Updates to INSTALL file -- --3.0, patchlevel 12 -- Sat May 7 21:10:03 PDT 1994 -- Tim Mann -- --* Beta test release only. -- --* Brought man page up to date. -- --* Added Shift+R to resign from keyboard. -- --* Some items on Action menu available in GNU Chess mode now. -- --* Revamped Action menu. -- --* Reordered functions in backend.c as a small step toward reorganizing --this whole mess. -- --* Generate TimeControl PGN tag. -- --* Get type of ICS game (e.g., rated blitz) and save in PGN tags. -- --* Bug fix: Clocks were not redisplayed when entering EditGame mode. -- --* Bug fix: Clocks were not being redisplayed after loading a game file --with -td 0, so they could show the wrong color active. -- --* Bug fix: Chess programs would be killed and match mode would exit --prematurely when loading a PGN game fragment ending with "*". -- --* ICS command "sposition" no longer confuses xboard. -- --* Integrated new version of cmail (with support code in xboard) from Evan --Welsh. -- --* Added TruncateGame, MoveNow, RetractMove, and QuietPlay. -- --* Bug fix: switching between MachineWhite and MachineBlack was not calling --Attention(). Reported by Dino Dini. -- --* More improvements to INSTALL and Imakefile. -- --* Pack moves into 79 character lines in PGN output. We don't generate --check indications, and we always break the line before the result, --so this is not quite PGN export format. -- --* Use FEN tag in PGN. -- --* Improved finding and counting of game starts in save files. -- --* Negative position or game numbers in -lpi/-lgi mean to seek to that byte --offset. Hook for possible future features, not in man page. -- --* Detect and handle absence of either "time" or "otim" commands in --gnuchess. -- --* Don't use "promote" command to ICS anymore. -- --* Handle switching sides and taking back moves on FICS. -- --* Handle flip state flag in style 12 board. -- --* Handle examine mode on ICS. -- --* Improved error popups for various kinds of illegal moves. -- --* Suppress unasked-for hints from gnuchess (which it generates in post --mode). -- --* Load/save position functions use FEN. Old style also supported. -- --* Added detailed error messages if loading a bitmap file fails. -- --* Small board has 2-pixel lines between squares instead of 3-pixel. -- --* Added OldSaveStyle and AboutGame. -- --* Renamed ForceMoves to EditGame. -- --3.0, patchlevel 11 -- Tue Sep 21 15:25:36 PDT 1993 -- Tim Mann -- --* The following changes were present in xboard 3.0, patchlevel 11, but the --first group did not make it into WinBoard 3.0 until later. xboard --3.0.pl11 was a limited-distribution release only, mostly to Zippy users. -- --* Man page minor fixes. -- --* Added a missing file close. -- --* Removed automatic error popdown on Reset, which was destroying some --error messages before they could be read. -- --* Fixed char vs. unsigned char warnings on bitmaps. -- --* Use ICS board style 12. Some improvements to ICS parsing. -- --* Comment window is now labelled with the move the comment is on, and --comments don't pop down when you step to the next move. -- --* Save files now in PGN format. -- --* Support for loading PGN files. PGN tags pop up when a PGN game file --is loaded. -- --* More info in INSTALL and Imakefile about building for Suns (and --other systems). -- --* WinBoard 3.0 patchlevel 11 split off from an early version of xboard --3.0 patchlevel 11, so it does not have all the features of that --patchlevel. The following changes made it into both xboard and --WinBoard: -- --* Made Comment dialog non-modal in WinBoard. -- --* EndOfGame mode is now more transparent. It looks like ForceMoves --mode except that there is no chess program running. -- --* Small bug fixes in clock management. Most noticeably, pausing when --it is gnuchess's move now works as documented (again). -- --* Add minimal support for -icscomm option. Not documented yet because --I haven't sorted out the issues with setting the tty modes on the comm --port device, or with locking it properly. But it's usable by wizards. -- --* Don't restart the chess program upon Backward event from EndOfGame mode. -- --* Suppress extra prompt after ICS sends us a board. -- --3.0, patchlevel 10 -- Sat Sep 11 18:44:03 PDT 1993 -- Tim Mann -- --* Beta test release only. -- --* Zippy now plays chess. zippy.c and zippy.h are still not included --in the standard distribution, but are available on request. -- --* Switched to using style 12 on ICS. -- --* Updated man page, and documented use of XBoard*form.translations to --add more shortcut keys. -- --* Added shortcut keys "d" to claim/offer/accept a draw, and "t" to --call flag. Suggested by venu on ICS. -- --* More explicit instructions in INSTALL file. -- --3.0, patchlevel 9 -- Tue Sep 7 14:02:00 PDT 1993 -- Tim Mann -- --* General release, minor update to 3.0.pl8. -- --* Loosened checking on whether it's okay to start a move, to satisfy --ICS ultra-blitz players. Now we don't check whether it's your turn --until you let go of the piece. -- --* Parser now recognizes "+-+" as meaning the game ended in a draw. -- --* Got rid of S_NONE symbol, which seems to conflict with some symbol --Sun defines. -- --* Tweaked the man page. Clarified that there is currently no way for --two people running copies of xboard to play each other without going --through the Internet Chess Server. -- --* Fixed a bug in color name conversion. Asking for two different --colors whose names were the same in the first four characters would --get you two copies of the first one. Thanks to Volker Zink for the --bug report. -- --* Improved confusing Usage() message. -- --* Added a bunch of Sun information to the Imakefile and INSTALL file. --Thanks to Ed Hanway, Arik Klingensmith, and others who responded. -- --* Test for defined(WIN32) instead of !defined(unix). -- --* Avoid using (void *) type with non-ANSI C compilers. Thanks to --James Altucher for the bug report. -- --3.0, patchlevel 8 -- Thu Sep 2 12:23:01 PDT 1993 -- Tim Mann -- --* Note: Patchlevel 8 was the first non-beta release of xboard 3.0 -- --* Added cmail to distribution. Contributed (and still maintained) by --Evan Welsh. -- --* Bug fix: -queen option wasn't initializing menu check. Reported by --Pat Surry. -- --3.0, patchlevel 7 -- Thu Aug 26 13:23:24 PDT 1993 -- Tim Mann -- --* Sent WinBoard 3.0.pl7 to Torre on ICS -- --* Added parser.h to hold the interface to parser.l -- --* Upgraded COPYING file and copyright notices to GNU GPL version 2. -- --3.0, patchlevel 6 -- Tue Aug 24 15:16:13 PDT 1993 -- Tim Mann -- --* We no longer display intermediate positions or intermediate comments --while loading a game file with -timeDelay 0 or loading an opening to --start up a -matchMode game. -- --* Loading an empty game from an xboard save file now gives a status --message "No moves in game" instead of an error popup saying "Game not --found in file." -- --* Added comment.awk to distribution. -- --3.0, patchlevel 5 -- Tue Aug 17 16:45:54 PDT 1993 -- Tim Mann -- --* Bug fix: xboard would crash if it couldn't get all its colors; now --it switches to monoMode instead. Also, xboard was trying to convert --color resources even when using a b/w display. Reported by Larry --Rogers. -- --* Bug fix: Declared fields of TimeMark as signed so that we get signed --instead of unsigned arithmetic. SubtractTimeMarks was breaking on --Alpha AXP (which has 64-bit longs) with old declarations. Reported by --Michel van der List. -- --* Bug fixes: Keyboard accelerators now work after EditComment window is --popped down. Iconize keyboard accelerator now works even if xboard --was started with -iconic flag and later deiconized. -- --* Bug fix: The routine that tests whether a move is illegal because it --would leave you in check was not handling e.p. captures properly. --Reported by Patrick Surry. -- --* Bug (?) fix: Was adding time to clocks at time control even when --loading a game file. Actually it's not entirely clear how time --controls should be dealt with when some moves are loaded from a file --or clicked in with ForceMoves. For now ForceMoves mode does add the --time (because it can be used to change moves during a live game), but --LoadGame mode does not. -- --* Updated usage message. -- --* Previous attempted fix to matchMode had broken TwoMachines mode and --generally needed more work. Also simplified command line interface to --matchMode. -- --3.0, patchlevel 4 -- Thu Aug 5 14:17:18 PDT 1993 -- Tim Mann -- --* Thanks again to the beta testers listed for 3.0 patchlevel 3, and also --Desnogues, Steve Cariglia, Niklas Engsner, Mark Silver, and Roger Rowe. -- --* Reorganized man page, splitting OPTIONS into subsections. -- --* matchMode was very broken; fixed. -- --* Changed convention for turning off command line options from --opt --to -xopt, to be less inconsistent with GNU standards. Also changed --the long command line options to take True/False arguments like --resources; seems to make more sense this way. -- --* Added AlwaysQueen option -- suppresses promotion dialog and always --promotes to a queen if you move a pawn to the last rank. Has no --effect on gnuchess (or your ICS opponents!) -- they can still --underpromote. -- --* Subtracted an extra fudge term when determining how wide message and --title widgets should be. This fixes a problem some beta testers had. --Wish I knew why it's needed. -- --* Bugfix in parser; symptom was that you couldn't do LoadGame after --observing a game on ICS. -- --* Bugfix in Forward; didn't work after game ended while Pause was turned on. -- --* Removed bogus execute bits on .h files. -- --* Use REMOTE_SHELL and TELNET_PROGRAM definitions. -- --* MachineWhite and MachineBlack now work from TwoMachines mode. -- --* Popping down an error message with the [ok] button was not turning off --the errorUp flag, so the next move would cause xboard to try to pop it --down again, resulting in a wild memory reference and sometimes a crash. -- --3.0, patchlevel 3 -- Tue Aug 3 17:40:27 1993 -- Tim Mann -- --* Thanks to my beta testers: Patrick Surry, Takuya Kojima, Robert J. Luoma, --Chris L. Petroff, Richard K. Lloyd, Michel van der List, Craig Metz, --Antoon Frehe, Simon Clift, Shelly, Eric Peterson, Christopher Mitchell, --Martin Koch, Ed Hanway, Steve Booth, Udo, Ken Hobday, and Joseph Duhamel. -- --* Improved error messages for trying to move the wrong color pieces or --to move when it's not your turn. -- --* Special code for monoMode on 1-bit displays now understands displays --where 1=white and 0=black. -- --* Declare getenv() if not included; avoids a compiler warning. -- --* Documented borderXoffset and borderYoffset. -- --* Added -titleInWindow option for use with X window managers that --don't let us set the title in the window banner. -- --* Fixed error message printing in WinBoard; system error messages no --longer appear as numeric codes. -- --* The error message popup is now non-modal; you don't have to press the --[ok] button before you can do something else. In addition, the popup is --positioned so that it doesn't cover up the board (too much), and making a --move or otherwise clicking on the board pops it down. (Not implemented in --WinBoard.) -- --* You can now call your opponent's flag in ICS mode by clicking on his --clock. -- --* Fixed minor bugs in -flipView option and documented exactly how xboard --decides which way to flip the view. -- --3.0, patchlevel 2 -- Fri Jul 30 22:20:23 PDT 1993 -- Tim Mann -- --* Added Autosave to Options menu. Would be better to have Save --Options dialog as in WinBoard, but this was quick to do and gives the --most-needed functionality. -- --* Changed "Reload Game" on menu to "Reload Same Game". -- --3.0, patchlevel 1 -- Thu Jul 8 21:22:59 PDT 1993 -- Tim Mann -- --* Sent a copy of patchlevel 1 to Patrick Surry to beta-test. -- --* Added -cmail option that sets appData.cmailMode. Currently a no-op. --In the future this may set special modes for use by the cmail script --for playing chess by email. -- --* Added LoadNextGame, LoadPreviousGame, and ReloadGame to File menu. --ReloadGame suggested by Patrick Surry. -- --* Added -flipView command-line option. Suggested by Patrick Surry. -- --* Fixed bugs in parser.l: (1) Pattern for "# xboard game file ..." --needed to match to end of line. (2) Start of a new file was not matching --the ^ start-of-line character. The fix for this is a kludge. -- --* Made game counting code in LoadGame more robust, and made LoadGame --able to detect the end of a saved partial game (by noticing the start --of the next game) in game files created by XBoard itself. We don't --try to find the start of the next game that way in other kinds of game --files, because the only way I can think of to do that is to look for --another move #1, and that technique gets too many false hits. -- --* Fixed recently introduced bug in LoadGame when game starts with a --position diagram. -- --3.0, patchlevel 0 -- Fri Jun 25 14:17:17 PDT 1993 -- Tim Mann -- --* Changes in this patchlevel were too numerous to list. Larger ones are --listed below. -- --* Added a popup dialog to enter and edit comments. Inspired by some --code from Patrick Surry. Changed the normal read-only comment popup --to the same style. -- --* Added ICS init script feature from Karl Schwamb. -- --* Added some ESIX fixes and OMIT_SOCKETS ifdef option, from Kayvan Sylvan. -- --* Revamped code to allow use of flex instead of lex on parser.l. --Using flex requires adding -DFLEX to defines in Imakefile. -- --* Source code is split into front end (xboard.c), which knows about X --and Unix, and back end (backend.c), which knows about chess, gnuchess, --and the ICS. There is also a front end for Windows NT. -- --* Boolean command line options now use "-foo" to turn on and "--foo" --to turn off instead of "-foo true" and "-foo false". [Later -xfoo; --see above.] -- --* Added menu commands to control autoflag, bell, and coords options. -- --* User interface has a new look: (1) Menu bar instead of array of --buttons. A few very commonly used features have small buttons in --addition to being on the menus. (2) Large font for clock. (3) Pop-up --dialogs for errors. -- - 2.1, patchlevel 11 -- Sat Jun 5 00:01:01 PDT 1993 -- mann@src.dec.com - - * Added code to deal with "wild" games on ICS. This includes allowing - castling with the king on d1 or d8, which is allowed in wild(1) games - if the king started there. Notation is o-o to castle "short"---to - whichever side the king is closer to---and o-o-o to castle "long." - Right now wild castling is always allowed by xboard; we rely on ICS or - gnuchess to reject it when we aren't really in wild mode. - - * memcpy call had arguments in wrong order. - - * Removed April Fool code - - 2.1, patchlevel 10 -- Mon Feb 15 10:19:31 PST 1993 -- mann@src.dec.com - - * Avoid trying to select on a pipe when using System V. Needed to - copy some code from InitChessProgram() up into establish(). - - * Bug fix in disambiguating pawn moves like "ed". - - * Fix to error handling in ReceiveFromProgram. - - * Bug fix: entering EditPosition mode with black to play highlighted - White's clock instead of Black's. - - * Added telnetProgram resource in case "telnet" is not the name of the - telnet program. - - 2.1, patchlevel 9 -- Fri Jan 22 19:08:27 PST 1993 -- mann@src.dec.com - - * Entering Force Moves mode clears "flag has fallen" messages from display. - - * ICS host name can now be in numeric format; for example 128.2.232.4. - - * Bug fix: LegalityTest was failing to test whether a pawn move was - illegal because the move would discover a check. - - * Handle ICS message "mann asserts a win over manntest, who disconnected." - - * Bug fix: A recent change to PromotionCallBack had broken - underpromotion to a knight. - - * Bug fix: In EditPosition mode, dragging a piece onto a square border - would make it vanish. xboard wasn't distinguishing this case from - dragging the piece off the board. Thanks to Matthew Kidd. - - * Removed "static" declaration from yywrap for compatibility with IRIX - version of lex. Thanks to stiller@blaze.cs.jhu.edu. - - * Added substitutes for bzero, bcopy, and gethostname for Solaris - SVR4. Thanks to Michael Grant. - - * Bug fixes to queen move disambiguation. Bugs showed up only when - promotion resulted in more than one queen on the board. - - 2.1, patchlevel 8 -- Fri Dec 11 17:54:18 PST 1992 -- mann@src.dec.com - - * parser bug fix: It now really works to leave off the piece a pawn is - promoting to and let it default to queen. - - * When starting to observe or play an ICS game, don't draw board in - initial position and then immediately redraw it in the current - position. - - * Handle ICS messages when an "abuser" forfeits a game by - disconnecting and when a game is aborted ("removed") by an - administrator. - - * Bug fix: A user move when in LoadGame+Pause mode was resuming the - game load instead of putting us in force mode. - - * It seems that crashes inside sscanf when xboard is compiled with gcc - (as on IBM PS/2 AIX, mentioned below, and also on VAX Ultrix 3.1) are - caused by an incompatibility between gcc and the sscanf implementation - on these platforms. A workaround is to specify -fwritable-strings to - gcc (see the gcc documentation). Added info on how to do this to the - Imakefile. Thanks to Tom McConnell for this information. - - * Clocks are allowed to go negative. This is mostly for ICS - compatibility, but it affects gnuchess mode too. Also, we give the - time bonus when a player hits the time control boundary even if his - flag is already down. This choice is a bit debatable, but it makes - things look better when you are in TwoMachines mode and gnuchess's - time management screws up causing it to exceed its time limit. - - * Implemented move legality checking code. Moves made with the mouse - or parsed from a file are checked for legality before being made. - This is mostly in preparation for future extensions, such as - human-human play. For now it makes -noChessProgram mode more useful. - - * If the user takes back moves, we restore the clocks to the earlier - settings. - - * We now handle the output of the ICS oldmoves command, including - parsing the game end condition. - - * Added autoCallFlag mode. - - * Fixed glitches in the medium size outline king and rook bitmaps, and - touched up the medium size solid king and outline queen. - - * bug fix: DisplayMove would not display backwardMostMove - 1. - - * Added CallFlag button and removed AcceptMatch. CallFlag is more - important with new ICS, and accepting the current match offer is easy - with the new ICS command "accept" (can be abbreviated "ac"). - - * LoadGame and LoadPosition display tail of file name (plus index - number, if any) as title. - - * MachineWhite, MachineBlack, and TwoMachines now work properly from - LoadGame and LoadGame+Pause mode. - - * Use o-o and o-o-o to castle on ICS, not 00 and 000. - - * Stripped out code for old ICS messages; new ICS is now installed. - - * Bug fix: don't offer autosave when paused during LoadGame. - - 2.1, patchlevel 7 - Fri Dec 11 17:40:56 PST 1992 - mann@src.dec.com - - * Track change to "Illegal move" message in new ICS. - - 2.1, patchlevel 6 -- Tue Dec 8 10:48:44 PST 1992 -- mann@src.dec.com - - * Kludged around bug in keeping comment popup where you put it by - adding borderXoffset and borderYoffset resources that give the width - of the borders added by the window manager. Yucch. - - * Changed searchDepth kludge back to using "help" instead of "bd"; the - latter didn't work because the output contains a line starting with - "White", so we think gnuchess is telling us that White won. Oops. - - * Removed some code that uses an X11R5 feature, XrmGetDatabase. - Without this, the auto font sizing code is harder to make work, so to - keep my sanity I had to change it to affect only the fonts that appear - in the main window and the comment popup, not the other popups. Maybe - this is better anyway. - - * AcceptMatch button now works after a counterchallenge, too. - - * Added code for more variants of messages about games being adjourned - or aborted. These messages need to be unified in new version of ICS. - - * Added workaround for minor bug in ICS; game number on first board - can be wrong. - - * Removed code to say "refresh n" instead of "refresh"; was broken and - wasn't needed anyway. - - * Added missing casts for compilers that distinguish enums from ints - and missing cast in connect call. - - * Added code to recognize "both sides are out of time" draw message - proposed for next version of ICS. - - * Thanks to Danny Sleator and Joe Peterson for bug reports. - - 2.1, patchlevel 5 -- Sun Dec 6 19:52:40 PST 1992 -- mann@src.dec.com - - * Removed gcc and CDEBUGFLAGS from Imakefile. - - * Corrected setting of mode to ForceMoves when game file ends or - contains an AmbiguousMove or BadMove. Previous bug was harmless. - - * Added AcceptMatch button and mention of 50-move rule for Draw button - to man page. - - 2.1, patchlevel 4 -- Sun Dec 6 02:55:42 PST 1992 -- mann@src.dec.com - - * Now handles revised messages from new version of ICS. New ICS is - not released yet, so this code might change further. Next patchlevel - will remove support for old ICS; both are there now. - - * Initial processing for a new game being watched or played now - happens when we see the first board image. Removes the need to parse - some messages and unifies some code. - - 2.1, patchlevel 3 -- Tue Dec 1 19:40:40 PST 1992 -- mann@src.dec.com - - * Handles ICS messages "Draw : neither player has mating - material" and "Draw : White has no material, Black has no time." - - * Added AcceptMatch button for ICS mode. - - * Fixed bug in previous fix to yylexstr(). - - * Fixed bugs in code for loading old position files that don't start - with "#" and for handling case where user asked for nth position in - file but there aren't that many. - - * Handles ICS message "* has restored your old game" - - * ResetProc always clears title line now. - - * Don't issue just "refresh" when watching a game; use game number. - Upcoming new version of ICS may need this. - - * Added code to try to prevent user from watching and/or playing more - than one game at a time. There is a race condition inherent here; if - we get more than one board from the game before our command to stop - watching it takes effect, we'll think the user started it again. Not - clear how to fix this. - - * Redid ParseBoard8 to use sscanf. Code is a good deal cleaner now. - Also, we now parse out the game number too, though we don't make much - use of it yet. - - * (Tried to put in a feature that recognizes the current game in a - game file must have ended when we see the start of a new one, but had - to disable it because we have too many false hits with the current - parser, especially in gnuchess listing files.) - - * Moves read from game files or received from ICS are now translated - into canonical algebraic form just like all other moves. Minor nit: - If you use Reset while playing or observing a game in ICS mode, the - game history (including the current board position) is lost, so the - next move of the current game can't be translated. - - * Default fonts now vary with board size, and are chosen by pixel size - instead of point size (since piece bitmaps have a fixed pixel size). - - * Bug fix: An extra Forward was required to skip over time indications - in game files. - - 2.1 patchlevel 2 -- Fri Nov 27 23:30:00 PST 1992 -- mann@src.dec.com - - * If you move the comment popup, the next time it pops up it will come - back where you put it. - - * Fixed yylexstr() so calls to it can be interspersed with calls to - yylex(). - - * Fixed bugs in Forward/Backward while in LoadGame mode. - - * Changed Save{Game,Position} functions to append instead of - overwriting if file exists. Changed Load{Game,Position} functions to - deal with multiple games/positions per file. - - * Changed load{Game,Position}File resources to trigger automatic load - on program startup. Changed save{Game,Position}File resources to - trigger automatic save after every completed game and on program exit. - - * Added autoSaveGames mode. - - * Fixed bug with PromoPiece in call to MakeAlg from MakeMove. - - * Many changes to get rid of picky compiler warnings and generally - clean up the code. - - 2.1 patchlevel 1 -- Fri Nov 27 02:45:00 PST 1992 -- mann@src.dec.com - - * A last minute change before patchlevel 0 went out broke - ParseGameHistory(). Immediately fixed in patchlevel 1. - - Version 2.1, patchlevel 0 -- Fri Nov 27 02:00:00 PST 1992 -- mann@src.dec.com - - * Uses "time" command of gnuchess 4.0 and following to keep clocks in - sync. Still works with older versions without this command; we test - whether the command is present the first time each chess program is - started. - - * File name dialog pops up under the mouse cursor, so that it's got the - keyboard focus if the window manager is using pointer focus. - - * Attempts to move the wrong color piece or an empty square are filtered - out in xboard instead of being passed on to GNU Chess or the ICS. - - * The reason a game ended is now remembered even if you move backward - and forward after it ends. It is forgotten only if you make a move - (which is as it should be---this is now a different game, which hasn't - ended yet). The message saying why the game ended no longer wipes out - the last move. - - * Pause, Backward, Forward, ForceMoves, and EditPosition now work from - TwoMachines mode. - - * Forward and Backward now change only the board display unless you - are in ForceMoves mode. Pause mode keeps new moves that are received - from being displayed on your screen until you unpause (or use - Forward). - - * Added option to ring the bell after opponents' moves. - - * Saved games that start from other than the standard initial position - now begin with a postion diagram as in saved position files. The - loader is modified to understand such save files. - - * Improved error checking when trying to read from gnuchess. - - * Parser understands things that look like time indications, e.g., (0:12), - instead of popping them up as comments. - - * Send "quit" to gnuchess before trying to kill it. I needed this - locally because sending a SIGTERM to rsh was not killing the remote - program on some internal field test systems we have. - - * Merged in code from John Chanak to make xboard a front end to the - Internet Chess Server, and added several improvements of my own. - (These include parsing end of game messages, loading the current state - and previous history of a game that's joined in progress via "watch" - or "load", automatic switch from board style 1 to 8 when needed, - removing irrelevant buttons and adding some new ones, adding the - useTelnet and gateway resources, and miscellaneous code cleanup, bug - fixes, and documentation.) Many thanks to John for writing and - contributing the initial version of this code. - - Fri Oct 30 20:16:40 PST 1992 (patchlevel 25) mann@src.dec.com - - * gnuchess now castles by sending us "o-o" or "o-o-o" (starting with a - preliminary version of 4.0.pl60 that I have). Added code to handle - this. The old format ("e1g1", etc.) still works too. - - * Added code to format moves in normal abbreviated algebraic notation - (for example, e4, exd4, f8Q, Nf6, 0-0) instead of coordinate algebraic - (for example, e2e4, e3d4, f7f8q, g1f6, e1g1). Moves entered with the - mouse or received from gnuchess are translated into this canonical - format for display on the message line or in saved game files. Moves - read from game files are not translated, however; they are shown and - saved just as they appear in the file. - - Mon Sep 14 13:19:01 PDT 1992 (patchlevel 24) mann@src.dec.com - - * It's not really correct to write an ep capture of a pawn on e5 as - fxe5; this should be written as fxe6 because e6 is where the capturing - pawn ends up. Nevertheless, the parser now interprets fxe5 as the ep - capture f5xe6 unless there is a pawn on f4, in which case it - interprets fxe5 as f4xe5. By design, the parser does not flag fxe5 as - ambiguous if there are pawns on both f4 and f5; instead it prefers the - more legitimate f4xe5 interpretation. - - * A move like fxe6 or fe6 is now interpreted as an e.p. capture of the - pawn on e5 if there is one there and e6 is empty. - - * A move like fxe5 can no longer be interpreted as an e.p. capture if - there isn't a pawn on e5 to be captured. Previously this could happen - erroneously if there were pawns on both f4 and f5, and the f4 pawn was - capturing a piece on e5. - - * The parser no longer munges the move it is parsing; in the past, for - instance, it would remove the "x" from a move like dxc5 before echoing - it to the screen. - - * The parser now detects when a move is ambiguous and returns an - error, instead of arbitrarily choosing one possibility as it used to. - - Mon Aug 10 18:40:47 PDT 1992 (patchlevel 23) mann@src.dec.com - - * Added code so parser can handle fully qualified algebraic, e.g., - Ng1-f3, N/g1-f3, Ng1f3, or even Pe2-e4. The "P" and "/" work only for - fully qualified moves, not generally. - - * Fixed parser bugs in handling moves with rank or file disambiguator, - e.g. N1f3 or Ngf3. - - Mon Jul 6 17:55:32 PDT 1992 (patchlevel 22) mann@src.dec.com - - * AIXV3 patch from Tom McConnell; thanks! - - * After hitting the Backward button we see the last move made instead of - the word "Pausing" displayed. - - * Fixed a couple of problems compiling on IRIX; thanks to Michel Arsenault - and Alan Walsh for bug reports and help with fixes. - - * Added optional display of algebraic notation coordinates along left and - bottom edges of board. This was inspired by some code from Jean-Christophe - Engel; thanks! - - * Swapped EditPosition and Pause buttons to reduce danger of losing the - game in progress by hitting EditPosition when you wanted Backward. Thanks - to Ove Lundberg for complaining (though it bugged me too). - - * Despite one complaint, I kept the feature of changing both clocks when black - makes time control, rather than changing each individually when the player - involved makes it. This is to avoid having it look like White is way ahead on - time while Black is thinking about the last move of the time control period - (i.e., when White has made time control but Black hasn't yet). - - * Corrected clocks to work as in real tournaments. Time is *added* when you - reach time control; previously the clocks were simply set to the length of the - new time period. Also, when a player's flag falls, he still does not receive a - new time allotment at the next time control, but his opponent does still - receive more time if *his* flag has not fallen; previously, time controls were - ignored for both players if either flag fell. I forget who reported this bug. - - * Added a small ESIX patch from Kayvan Sylvan. - - Mon Jun 22 13:24:38 PDT 1992 (patchlevel 21) - - * Added some SVR4 support code from Ronald Cole. It's Greek to me. - - * Note: Stephen Meatheringham reports a bug causing xboard to crash with an - error from the X server when run on a Sun Sparcstation IPX with Solaris 1.0.1 - and OpenWindows 3.0. This bug has not been tracked down yet. - - * Fixed a problem with ATTENTION code. On some operating systems, you have to - be even more cautious about when you send a SIGINT to gnuchess, because the - signal handler gets deinstalled each time it is used, and gnuchess does not - reinstall it immediately. In particular, if you send a SIGINT and make an - illegal move or ask for a hint, gnuchess does not reinstall the handler until - *after* you make your next move, so you had better not send a SIGINT before - it. I put a workaround for this case into xboard; I hope there are no more. - - * The ATTENTION code is needed when compiling for the ESIX operating system, - because ESIX has a bug in the FIONREAD ioctl, so the code in gnuchess that - lets you interrupt its thinking on your time just by typing in your move does - not work. Perhaps gnuchess will have a workaround for this eventually. - - * Fixed yet another bug in using XtGetValues; code to inhibit shell resizing - was leaving a null pointer as the place to store the current sizes. - - * Man page fixes: corrected -sl to -sd, updated LIMITATIONS. - - * Added include of conditional on HAS_GETTIMEOFDAY. I hope this - works for all systems; on mine, and are the same file, - but with an #ifndef that makes it harmless to include both. - - * Thanks for reports from Mike Pearlman, Stephen Meatheringham, Kayvan Sylvan, - d87-mal@nada.kth.se, Urban Koistinen, and Ronald Cole. - - Mon Jun 8 11:39:18 PDT 1992 (patchlevel 20) - - * Documented default value of initString and explained what it means. This - paragraph also serves to inform the user that xboard by default will tell - gnuchess to think on his time, something one user apparently didn't understand. - - * Redid -searchDepth (formerly -searchLevel) and -searchTime code. They both - work correctly with gnuchess 3.1 now. The -searchDepth option also works - correctly with gnuchess 4.0. The -searchTime option does not work with - gnuchess 4.0.pl50 or earlier because those gnuchess versions do not have a - working searchTime feature. Instead of having xboard do a half-baked emulation - of this feature by using a 1-move time control, I will be submitting a patch to - the gnuchess folks to restore the feature as in 3.1. - - * Improved clock code. It now keeps accurate track of fractional seconds of - clock running time, if your system has gettimeofday(); if not, it is generous - about them---if a clock has been going for n.m seconds when it is stopped, only - n seconds are charged. Previously, xboard would charge one second immediately - when a clock was started, so if n.m had elapsed when it was stopped, n+1 would - be charged. This should stop xboard from thinking gnuchess has let its flag - fall on the last move of a time control, as it often did before. I also - improved the comments and condensed the code a little. I hope there are no - systems that have X11 and don't have gettimeofday(), but if there are, I'd like - to know what to replace it with. - - * "Flag dropped" messages now show up on the top line, beside the clocks, so - that they don't obscure more interesting messages on the second line. - - * Fixed confusion of NULL and '\000'. - - * Include time.h to get ctime() declaration. - - * Fix to "parser bug" messages in parser.l. - - * Changed code to work with old-fashioned tolower() macro that requires its - argument to be an uppercase letter. - - * Minor fix to some usage error messages; was reversing program name and - erroneous argument value. - - * Thanks to Mitch Wright, Ranier Orth, and Henrik Schmiediche for bug reports. - - Fri Jun 5 13:06:08 PDT 1992 (patchlevel 19) - - * Note: xboard does not seem to work when compiled with gcc 1.40 on a - PS/2 running AIX. It crashes at the sscanf in line 768 of xboard.c. - You can work around the problem by specifying the -timeControl option - on the command line instead of defaulting it. This does not seem to - be a bug in xboard itself; it runs okay on PS/2 AIX when compiled with - MetaWare High C. [But see 2.1.pl8 above.] - - * Removed bogus files from distribution. - - * Changed variable name that conflicted with SVR4 ttyname function. - - * Thanks to Christoph Strozyk for another bug report, and to several - of the folks mentioned under patchlevel 18 for testing it. - - Wed Jun 3 17:50:37 PDT 1992 (patchlevel 18) mann@src.dec.com - - * Added an include of sys/fcntl.h to pick up the definition of O_RDWR for - System V users. - - * Fixed a bug in CatchPipeSignal; was testing the wrong variable to determine - which chess program got the signal. - - * Removed the declaration of strrchr, which was causing problems for some - people, and added an include of or instead. - - * Fixed a bunch of type errors uncovered by compilers that check more carefully - than the one I was using. I just patched many of them with casts---typically - cases where a function didn't take the same number and type of arguments as the - X header file prototype said it should---because I didn't see any other way to - fix them. The versions of the X header files that I have don't actually have - full prototypes for these function types; they declare only the return type and - just give the argument types as comments. - - * InitChessProgram returns immediately if chess program died while we were - waiting for it to say "Chess". I think this fixes a bug that could make xboard - crash or go into an infinite loop printing "Warning: Select failed; error code - 9" if gnuchess crashed there. - - * Removed code that tries to put the file descriptor used to read messages from - gnuchess into nonblocking mode. I don't see how this kludge could ever have - fixed the problem it was intended to (see below), and it seemed to be causing - a race condition when we were waiting for the initial message from gnuchess - after it started up. - - * Thanks to Richard K. Lloyd, Konstantinos Konstantinides, Mark - Seiden, Erik Schoenfelder, Andreas Stolcke, Rainer Orth, Henry Thomas, - and Kris Van Hees for bug reports and help with fixes. - - Sun May 31 08:00:00 PDT 1992 (patchlevel 17) Bart Massey bart@cs.uoregon.edu - - * 'xboard' suffered from a couple of serious bugs. An initial - size needed to be given to the message label to avoid a race - condition (!) so I gave it some text (otherwise occasionally - xboard would fail because the message widget was 0 width under - MIT X11R4). The sizes needed to be Dimension, not int, because - they were written in by Xt -- on my big-endian box Dimension - is short, causing chaos. Also, I hacked a declaration in for - strrchr() to shut the compiler up -- this is arguably a kludge, - but I couldn't think of anything better; maybe you can. - - Fri May 22 13:40:50 PDT 1992 (patchlevel 16) - - * First real (non-beta) release of version 2.0. - - * Added GNU copyleft notices covering version 2.0 enhancements. - - Thu May 21 12:30:09 PDT 1992 (patchlevel 15) - - * Removed -g from Imakefile. - - * Added casts in parser.l to prevent warning messages from some C compilers. - - * Bugfix: code to exit if chess program couldn't be started had bug in error - message printing. - - Tue May 19 11:58:06 PDT 1992 (patchlevel 14) - - * Fixes one small bug: If LoadGame does not find a game in the file, it resets - xboard to BeginningOfGame mode (as if the Reset button was pressed), instead of - leaving it in LoadGame mode. - - Mon Apr 13 18:32:27 PDT 1992 (patchlevel 13) - - * Improved error handling when gnuchessx crashes. Now displays a message and - enters EndOfGame state without exiting. This should help with diagnosing - gnuchessx problems, since the position and move history are not lost. - - * Debugged man page. - - Version 2.0 -- Thu Apr 2 16:04:54 PST 1992 (patchlevel 12) - - * Added small 40x40 pixel pieces; board size now specified as small, medium, or - large. - - * Improved man page. - - * Saved position files now say "white to play" if it's white's move. - - * SavePosition while in EditPosition mode now gets side to play right. - - * Made "Pawn" the default on edit position menus. - - * Removed "To play" from edit position menus, since it's redundant. Left - support code in so it can be restored if someone wants it. - - * Tightened parser's definition of a move number to help further with skipping - over stuff before the first move. - - * Put back feature of skipping over stuff in game files before a start of game - marker. This helps when loading electronic mail messages that have things - like "00" in the header (looks like castling), or that talk about moves in - running text before the actual game score. Tradeoff is that we can't load - games that don't either have move numbers or say "gnuchess game" just before - the moves. - - * Changed version number to 2.0 because others have used "1.3" for patched - versions of 1.2. Display version number and patchlevel at startup. - - Thu Apr 2 15:30:22 PST 1992 (patchlevel 11) - - * Bugfix: Match started with TwoMachines button now handles the case where - user loaded/edited a position *and* forced some moves. - - * added error message feedback to many cases where the user's button press is - rejected because it isn't allowed in the current mode. - - * added -noChessProgram option to allow use as a passive chessboard without - gnuchess, replacing old buggy scheme that tried to do this automatically when - gnuchess was not found on the search path. - - * parser accepts "=" in front of promotion piece - - * parser accepts ":" notation for captures - - * Removed SwitchSides button to make room for EditPosition. Left code in - place, ifdef'ed out. - - * Added EditPosition mode. - - * Reformatted xboard.c to eliminate long lines. - - * Promotion popup now appears near rank to which pawn is moving. - - * UI improvement: Button representing current program mode is kept highlighted. - - * Bug fix: Hint button is now disabled when machine is on move. - - Sat Mar 21 14:57:37 PST 1992 (patchlevel 10) - - * TwoMachines now works from MachineWhite or MachineBlack mode. - - * ForceMoves and Backward/Forward now work at the end of a game started by - the TwoMachines button. - - * Sends o-o or o-o-o to gnuchess instead of O-O or O-O-O. - - * Bug fix: SwitchSides button is now disabled when machine is on move. - - * Added -searchLevel option and corrected handling of -searchTime to reflect - the way gnuchess really handles command line options instead of what the - documentation used to say. Allowed optional ":seconds" on times. - - Tue Mar 17 21:00:35 PST 1992 (patchlevel 9) - - * Removed non-working code that tried to recover when a remote chess program - could not be started; now exits with a message instead. - - * Now waits for chess program to print its first message (normally "Chess") - before sending it any commands. - - * Matches between two machines can now start from a black-to-play position or - black-to-play opening. - - * Bug fix: The program would sometimes lose track of the board position after - the end of the game, drawing a board full of white pawns next time it got an X - redraw request. Now fixed. - - * Cleaned up handling of illegal moves in game files. Now we just stop reading - and go into ForceMoves mode. - - * Saved games against gnuchess indicate who won (restored and debugged 1.2 - feature). - - * Setting -searchTime turns off -clockMode. - - * My trick for setting up a black-to-play position broke in the transition from - gnuchess 3.1+ to 4.0. Installed a different trick that works with both. - - * Bug fix: Was clobbering memory by mallocing one byte too few for the file - name in SetupPositionFromFileProc. This usually resulted in a crash on the - second attempt to load a position from a file. - - Mon Mar 16 16:49:00 PST 1992 (patchlevel 8) - - * Game and position files are saved in CHESSDIR as well as loaded from there. - We actually chdir there, so gnuchess listing files also wind up there. - - * Underpromotion moves from gnuchess really work now. - - Sat Mar 14 14:55:24 PST 1992 (patchlevel 7) - - * Cleaned up lots of bugs and kruft in parser.l. It's a wonder the old version - worked at all. Improved rejection of random text interspersed with the moves. - - * Relabeled buttons to reduce confusion (Play From File --> Load Game; - Setup From File --> Load Position). - - * Bug fix: Doesn't exit at the end of a game that was started by pressing - the Two Machines button. - - * Bug fix: Doesn't get confused if you hit Machine Black (White) while - the machine is already playing black (white) and is on move. - - * Prints "White to play" or "Black to play" after loading a position file. - - * Bug fix: No longer hangs if no start-of-game is found in a game file. - - * More permissive about game file format. The first line is not assumed - to be a header comment unless it starts with "#". We don't insist on - seeing a "1." before the first move. - - * Added pop-up dialog to allow underpromotion. Moving a pawn to the last rank - pops up a dialog to let you select what piece to promote to. Also added code - to handle underpromotion moves from gnuchess or from a game file correctly. - - * Added code to send SIGINT to gnuchess before trying to move, if gnuchess - might be busy thinking on our time. The code is ifdef'ed out because it's - not necessary; only beta-test versions of gnuchess 4.0 at patchlevel 19 or - below require it. - - Mon Feb 24 20:10:22 PST 1992 - - * Merged fixes received from Stuart Cracraft and Mike McGann, to iconic mode - and to ShutdownChessPrograms. (They both sent the same fixes.) I did not - install the change that removed "easy" from the initialization string, so - xboard will still try to run gnuchessx in "hard" mode (thinking on opponent's - time) by sending this command. - - Version 1.3 -- Thu Dec 19 18:19:00 PST 1991 mann@src.dec.com (Tim Mann) - - * I've fixed a slew of bugs in this version of xboard: - - * You can now back up from the end of a game, even if gnuchess was playing - against you. Since gnuchess exits upon mate or draw (when it's not in force - mode), this feature works by starting up a new copy of gnuchess and feeding it - the saved starting position and moves. Drawback: the new gnuchess starts with - clocks at the beginning of a fresh time control. - - * Note: the "force" command to gnuchess is a toggle. I fixed a couple of - places in xboard where "force" was being issued when gnuchess was already in - force mode, which resulted in chaos. I don't know if they were in 1.2 or if I - added them myself in the course of putting in new features. - - * ForceMoves button is now legal in PlayFromFile mode. It closes the game file - and lets you force moves (or go Backward) from whatever position you've - reached. - - * The parser now recognizes "white resigns" and "black resigns" (in any - combination of upper and lower case, with or without the closing "s"). These - used to be misinterpreted as meaning "white wins" or "black wins" respectively! - Added "1 - 0" and "0 - 1" as equivalents for "1-0" and "0-1". - - * I removed the parser feature of considering "!" as a comment delimiter. - "!" is so common as an annotation in game scores that this feature seems like a - very bad idea. - - * Added a wait() after each successful call to kill() to avoid leaving zombie - processes around. - - * Removed the feature of putting an indication of how the game ended into the - internal move list when playing from a file. The only benefit of this was that - it would get written back out if you saved the game at that point. This - feature doesn't seem too useful, since you are unlikely to save a game you've - read in without making any changes, and it caused a lot of problems in the code - and user interface. The end condition is still displayed as a message when - it's first read in from the file. End conditions when playing against gnuchess - are still saved, too. - - * programName is now the last file name component of argv[0], not all of it. - - * xboard.c got three compiler warnings due to arguments that didn't match the - prototypes on X toolkit functions. I got rid of them by adding some casts, and - adding extra unused arguments to the ReceiveFromProgram function. - - * As I received it, the distribution had an extra period glued on the front - of every line that started with a period. This broke the manpage in an - obvious way. It also broke parser.l in a nonobvious way that stopped - PlayFromFile from working. - - * Fixed one or two bugs where the clock was started when it shouldn't have - been. I think one example was if you tried an illegal move in ForceMoves mode. - - * Now starts the machine's clock if you hit MachineWhite when white is on move - or MachineBlack when black is on move. - - * Now updates the to-move indicator (highlight on clock display) when you use - Forward/Backward or ForceMoves. - - * gnuchess 3.1+ has a bug that makes it try to think on its opponent's time - even when in force mode; this causes problems with xboard's SetupFromFile - command because gnuchess's saved hint move is garbage after the new position is - loaded, so gnuchess prints out an error message when it tries to think about - what it would do if the user made this move. Here is a patch for gnuchess - 3.1+: - - *** nondsp.c~ Mon Dec 2 12:37:18 1991 - *-- nondsp.c Thu Dec 19 15:36:06 1991 - *************** - *** 1223,1229 **** - ok = flag.quit = false; - player = opponent; - ft = 0; - ! if (hint > 0 && !flag.easy && Book == NULL) - { - fflush (stdout); - time0 = time ((long *) 0); - *-- 1223,1229 ---- - ok = flag.quit = false; - player = opponent; - ft = 0; - ! if (hint > 0 && !flag.easy && Book == NULL && !flag.force) - { - fflush (stdout); - time0 = time ((long *) 0); - - * SavePosition/SetupFromFile now handle black-to-play positions. If it's - black's move in a saved position, the line "black to play" is printed - immediately after the board display. Upon loading a position, xboard - looks for "black" at the beginning of this line to determine whether it's - black's move. - - * SetupFromFile now leaves you (effectively) in ForceMoves mode. This - eliminates some cases where the program would get into an inconsistent state, - and hopefully is more intuitive for the user, too. - - * PlayFromFile now leaves xboard in ForceMoves mode after playing through all - the moves in the file. You can use Backward/Forward, make moves, get gnuchess - to join the game with MachineWhite or MachineBlack, etc. The game file can end - with either white or black to play. - - * Backward/Forward now seem to work in all cases. Previously using these - buttons during a game against the machine would get xboard out of sync with - gnuchess's idea of what was going on, resulting in chaos. Now using these - buttons puts xboard in ForceMoves mode; you can bring gnuchess back into the - game using the MachineWhite or MachineBlack buttons. - - Thu Jun 27 15:06:25 PDT 1991 - - * Remove comment popups during a reset. - - * Bug in my forward move fix. Didn't work for playgamefile mode. - - Thu Jun 20 15:04:06 PDT 1991 - - * Can't do a backward move when it isn't your turn because gnuchess - gets confused. Similar bug for forward move. Do a bunch of moves, - back up move and go forward. These get filtered out now. - - * Put easy back into the initString. This DISABLES easy mode which by - default is ON. - - * New-line wasn't always being added to forward move strings sent to gnuchess. - - * Parsed comments as [ ..............text follows ] into d7d5 - - * Long game file comments cause core dumps on HP systems. - - * Multiple uses of the get positition file button got confused - on the second click. - - Minor fixes to the 1.2 release - - Version 1.2 -- Tue Jun 11 17:14:12 PDT 1991 - - * For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D., - Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found - a lot of bugs that we put into xboard just to see if they were paying - attention. They were. - - * Changed the protocol that xboard uses to work with the new version of - gnuchessr. - - * There was an off by one error with the clock resetting code. Also, - the clock display highliting was wrong. Thanks to Bill Shauck for - pointing these out. - - * enumerations are not really integers on some C compilers. I added casting. - The new version of gnuchess expects the "go" command for two machine - and machine plays white cases. The whiteString resource is for - compatibility with previous gnuchess versions which get confused by go. - Thanks to Martin D. for catching these. - - * Fixed a bug where the checkmate message wasn't being parsed and xboard - kept playing. Also, the message was added to game file if saved. - Thanks to Scott Hemhill for pointing this out. - - * Fixed a bug where saving a long game, resetting and saving a short game - resulted in appending the end of the long game to the short one. - If a game is just being played out and there is no reason for gnuchessr - to be used, ignore pipe signals. This allows people to use xboard - as a chess board without need for gnuchess. Also, trivially bad moves - such as e2e2 are not passed on to gnuchessr but instead ignored out of - hand. This allows people using xboard as a chessboard with gnuchessr - to pick a piece up, think and put it back down without making a move. - Thanks to Jeff Kenton for pointing these out. - - * Added the CHESSDIR environment variable. Game and position files are - found in this directory. If this variable is not declared, then the - current directory is used. File names starting with / are treated - specially. - - * The bitmap file names were changed so that none exceeded 14 characters. - This is necessary for R5. - - fcntl(from_prog[0], F_SETFL, O_NDELAY); - - The xboard fix was to set non-blocking i/o on the read pipe for gnuchessr - - printz ("Illegal move (no matching move generated)"); - - * fixed a problem with the new version of gnuchessr where xboard wasn't - getting gnuchessr error messages for illegal moves. The problem seems - to be fixed *without* any gnuchess changes but this is likely to be - highly system dependant. There should be a new line on line 246 of nondsp.c - - * -iconic doesn't work at all now. The Iconify() does work. This was - a tradeoff and it is really an Xt bug. - - * Fixed a compiler warning for gcc and an error for the IBM RT compilers. - This is the VOID_PROC macro in xboard.h. Thanks to David Jensen for this. - - * If the DisplayWidth or DisplayHeight is less than 800, use small size mode. - Also the size of the name widget was reduced from 500 pixels to 400 pixels - because in small size mode there was a gap on the right. - Changed the default font from fixed to helvetica_oblique14 to: - **-helvetica-bold-r-normal--14-*-*-*-*-*-*-* - helvetica_oblique14 is a font alias not on all R4 systems. - Curiously enough, the 17 point is not available on 75dpi systems - and the 18 point font is not available on 100dpi systems. - Thanks to Richard K. Lloyd for pointing these out. - - * Minor hacks to work with R5 alpha. Had to add an event handler to the - boardWidget to get translations to work. This may go away with the real R5. - Added WM_PROTOCOLS: QuitProc() for R5 ICCCM compatibility. - - * If the first character of the file is not `1' then the first line - of a game or position file is displayed as the name in a label widget. - - * Added a PopUp dialog for getting file names. - - * Modified the code to use the R4 routines rather than R3 compatibility. - - * Changed the forwards/backwards/readgamefile code to allow a play to step - back and forth in a game. If he steps all the way to the beginning - he has to restart the game. If he gets into a mated position, same problem. - - * Moved the man page from xboard.1 to xboard.man. This makes imake man page - installs work correctly. Thanks to Richard K. Lloyd for pointing this out. - - * Corrected the queening code. XBoard was sending the wrong syntax. - It was sending for example h8(Q) when it should have been sending h8q. - Thanks to Paul Vaughan and Mike McGann for pointing this out. - - * Added a lex parser for algebraic games. It should be easy to use the parser - for other interfaces such as the Microsoft Windows version. - It parses comments of the form [anything] and ! to the end of a line. - - Version 1.1 -- Mon Jan 7 14:46:03 PST 1991 - - * Roger Dubar, Konstantinos Konstantinides, Wolfgang S. Rupprecht, - Paul Scowen, Mvh Smidt and Kayvan Sylvan all helped immensely during - beta-testing. - - * older non-ANSI versions of Sun compilers complain vociferously. - - * the remoteShell resource was added for HP-UX systems - and other systems where the remoteShell isn't rsh. - - * -iconic doesn't work properly. If XBoard is opened iconic then - iconifying it later with a keystroke doesn't work. I think - this is an Xt bug. - - * For systems with smaller screens, XBoard can use smaller pieces, - and a smaller board. -bigSizeMode False uses a smaller set of pieces. - These are scaled versions of the large pieces. They look ok but could - be improved. - - * getlogin() does not work in all cases. - It was replaced by getpwuid(getuid())->pw_name). - - * Warning messages get displayed in the message box. - - * Any button restarts a paused game. - - * Kayvan Sylvan contributed a patch for ESIX. - It seems that select() on pipes is broken on his system. We declined - to incorporate his patch though, because it was a work-around for - something that was broken on one system, and selfishly, that system - was not my own. Nevertheless, it is likely that other System V users - on PC's may need to use this patch and it is is included as the file - ESIX.patch. To use it, type - - patch xboard.c ESIX.patch - - * Fixed a bug where hint didn't work. The local version of gnuchessr - had been hacked. The fix was to clone stderr and stdout for gnuchessr. - - * Fixed a bug where a player could play after a game had been finished. - - * The bitmaps have been pushed into the bitmaps directory. - - * Substantially rewrote and simplified the Two Machine code. - - * Added StrStr() because many systems don't have this ANSI function. - - * Added keyboard equivalents. Added an iconify keystroke, C or c. - - * Works with gcc now. gcc complained about casting float constants - as XtPointers. - - * Detect if the visual doesn't support color. If so, run in monoMode. - An alternative would be to detect grayscale visual and use a collection - of gray user interface colors. - - XBoard.clockMode: False - - * For people who don't like or use chess clocks a clockMode switch - has been added. It is on by default. It can be turned off in the - .Xdefaults file with - - * Added a declaration, xtVersion, which will quickly break on R3 Intrinsics. - - * Hal Peterson contributed a new Imakefile. - - * Rewrote DisplayClocks(). - - * Rewrote TwoMachinesPlay mode. - - * Konstantinos Konstantinides added the -searchTime option. - - * Substantially rewrote and simplified the clock code. If a game was paused - and then resumed, the clocks were out of sync. - - * Fixed a bug in HandleUserMove() where the user could make a move while the - machine was thinking. The fix detects and ignores these moves. onMove - was not being used and was removed. - ++ChangeLog for XBoard/WinBoard ++ ++* 04/15/2009: Updated the winboard.rtf of 4.3.15 with the 4.3.16 ++additions, and a more fitting description of ICS-analysis mode. ++ ++* 04/15/2009: Added internationalization to xengineoutput.c and ++xoptions.c. Fixed missing */ in xboard.c. ++ ++* 04/13/2009: transferred all changes since 4.2.7 to 4.3.pre16, to make ++4.4.pre1, which should lead to a full merger of the 4.2 and 4.3 line ++ ++* 02/28/2009: fixed an error in the parser. This should fix bug #22812. ++ ++* 06/12/2005: bugfix some more possible buffer overflows. ++ ++* 06/27/2004: added simple icsEngineAnalyze for xboard ++ ++* 06/26/2004: added icsEngineAnalyze for winboard: Analyze observe games ++with a chessprogram on a Internet Chess Server (ICS) ++ ++* 02/12/2004: Bugfix ICS interaction console crashed while chess ++engine starting and user type in some stuff. We wait now to finish ++the engine boot. ++ ++* 02/11/2004: Winboard: Added color lines for the ics interaction ++console if zippy used ++ ++* 02/09/2004: Added mousewheel support for winboard. Play moves ++backward and forward with the mousewheel. ++ ++xboard/WinBoard 4.2.7 -- Fri Nov 28 13:36:00 PST 2003 -- Tim Mann ++ ++* 11/26/2003: In WinBoard, setting the -debug flag now logs ICS output ++to WinBoard.debug too. (This isn't needed in xboard because ICS ++output already goes to stdout, so it's easy to capture along with the ++debug output on stderr.) This was issue #280 in the ToDo file. ++ ++* 11/23/2003: Cleaned up some minor problems in cygwin.mak. Thanks to ++Hans Werner Strube for the problem report. ++ ++* 11/23/2003: Updated the default list of chess servers in ++winboard/defaults.h. Deleted two that appear to be dead and added a ++new one that is active. ++ ++* 11/19/2003: Swapped icon_white.bm and icon_black.bm in XBoard. ++Hopefully this will get them the right way around by default on more X ++window managers. I wish I understood this better. ++ ++* 11/18/2003: Implemented a simple 32-bit random number generator for ++WinBoard, replacing the Windows rand(), which ranges only up to ++0x7fff. Formerly on Windows, only zippy.lines sayings that started in ++the first 32767 bytes of the file could ever be used. This was issue ++#505 from the ToDo file. ++ ++* 11/16/2003: The xboard man page and info files are now built from a ++common set of texinfo source files, and the xboard man page now covers ++cmail as well. Formerly, ever since the texinfo file was first ++contributed to the project, it was separate from the man page and the ++two files had to be updated in parallel, making for a maintenance ++nightmare. To make combining the files possible, I took the Perl ++script "texi2man" from the GNU Units project and added support for a ++larger subset of the texinfo markup language. I then carefully ++compared the old man page and old texinfo file to make sure the latest ++and clearest words survived into the new combined texinfo file. It ++would be great to merge in WinBoard's help file too, but that's a ++larger project. It would have to be heavily conditionalized to ++deal with differences in features between XBoard and WinBoard. ++ ++* 11/15/2003: Cleaned up and applied a small patch from Daniel ++Mehrmann, to stop overly long PVs in thinking output from causing a ++buffer overflow crash in backend.c. ++ ++* 11/5/2003: When a chess engine sends a "telluser" command (including ++the cases where "tellall" or "tellopponent" acts like telluser), the ++information now goes into a nonmodel popup that is automatically ++dismissed when the user clicks anywhere on the board. This fix is ++more significant on WinBoard, where formerly you got a fully modal ++dialog that had to be dismissed by clicking on OK before anything else ++could happen. The bug was issue #406 in the ToDo file. ++ ++* 11/1/2003: Removed email addresses from this file to reduce spam ++load, as it gets linked to from the Web. ++ ++* 11/1/2003: Updated READ_ME and winboard/READ_ME.txt. ++ ++* Modified xboard and winboard makefiles to be able to build the ++project in the new combined directory structure. ++ ++* Applied a small security fix to pxboard, from Martin Maeok. ++ ++* Fixed a bug in the game list dialog. The change in 4.2.6 to opening ++games in text mode (meant to avoid getting extra \r's into comments) ++caused a new bug in determining seek offsets when parsing a game file ++to form the game list. Also, the change was incomplete; on some code ++paths games were still being opened in binary mode. Thanks to Lenik ++Terenin for reporting the offset bug. I've now gone back to always ++using binary mode when reading game files, and I've fixed the comment ++bug by adding code to remove \r's from parsed comments explicitly. I ++still use text mode for writing game files so that games written by ++WinBoard will have Windows-style line endings. ++ ++* Fix for minor bug in WinBoard installer. If you chose a non-default ++destination directory, the default directory was still used for a ++couple of unimportant things, namely setting the App Paths registry ++keys (unused by WinBoard) and trying to copy the existing WinBoard.ini ++file to WinBoard.old. I inherited this bug from the InstallShield 5 ++sample template. Thanks to "l.d." for noticing the incorrect keys. ++ ++* Patch from Chris Priest: when two engines are being run through rsh, ++avoid reusing the same stderr port for both. I'm not sure why this ++should be needed, but it's harmless, at least. ++ ++* Bugfix: The kludge to deal with old engines that give an error ++message because they don't know the "st" command was too sloppy; it ++could hit on an "st" substring anywhere in an error message. GNU ++Chess 4 is the only engine I know of where the kludge was needed, so I ++changed the kludge to match a longer, more GNU-specific string. ++ ++* Changed the WinBoard self-extracting installer to choose a unique ++temporary subdirectory name within the Windows temp directory instead ++of always putting wb-setup directly in temp. Besides being better ++practice, this avoids the need to deltree wb-setup first, which ++occasionally alarms someone who thinks that deltree is only used by ++trojans to delete all your files. (Yes, I'm serious.) ++ ++* Fixed a bug where FICS-style "wild/0" strings were not parsed as the ++proper wild type. The "/" was not being skipped. ++ ++* Fixed a WinBoard bug where temporary files created by game ++copy/paste were being created in the root directory of the current ++drive instead of the TMP directory and were not always deleted on exit. ++ ++* Fixed a small bug in winboard.c's ErrorDialog() function. Thanks to ++"Ron" (no last name given). The bug might have caused a problem when ++pressing OK or Cancel in an error dialog when more than one error ++dialog was being displayed, but I'm not really sure. ++ ++* Removed a hack that worked around a bug in very old versions of ++Crafty, where it would sometimes reply "illegal move" to a "." ++command. The hack kept us from recognizing real illegal move messages ++in analyze mode from engines that don't respond to the "." command. ++Thanks to Fabien Letouzey for the report. ++ ++* Fixed a bug in the xboard version of GetDelayedEvent. It would ++return the most recently scheduled event even if it had already fired. ++This caused at least one visible error: in -ics -xreuse mode, starting ++the engine again and seeing another "feature done=1" would re-run the ++initialization code in InitBackEnd3, including the code that opens the ++connection to ICS. The WinBoard version didn't have this bug. Thanks ++to Bob Hyatt for the bug report. ++ ++* The promotion popup for ICC wild 26 (giveaway) now includes King. ++Thanks to Fredrik Josefsson for the bug report. ++ ++* The first game in a file (or being pasted from the clipboard) can ++now start with a bare move -- no PGN tags, no move number "1", etc. ++Suggested by Shane Harrelson. One could imagine taking this farther ++and accepting something like "e4 e5 1/2-1/2 d4 d5" as two games, but ++I haven't done that. ++ ++* Bug fix: xboard didn't really accept a paste of multiple games, ++contrary to what I wrote when adding the feature to WinBoard in ++4.2.4. Now it works in both. ++ ++* Fixed generic start/end of game messages to work on chess.net, where ++they put ratings in parens after the player names. ++ ++* Updated config.sub and config.guess to newer versions from ++automake-1.4p5-2. This makes configure work with MacOS X + X11. ++ ++* Bugfix: when examining a game fragment on FICS where black plays ++first, don't show two "(0:00.000)" times on the initial "none" move. ++ ++* If TestLegality is on and one of the engines makes an illegal move ++in TwoMachines mode, it forfeits immediately. Formerly the game would ++get stuck at that point and the engine that made the illegal move ++would eventually lose on time. ++ ++xboard/WinBoard 4.2.6 -- Fri Feb 1 22:26:31 PST 2002 ++Tim Mann ++ ++Another small bugfix release. ++ ++* Put in a small change from Alexander Mai to allow xboard to build in ++an OS/2 EMX environment. ++ ++* Fix WinBoard-only bug where editing a PGN file with comments would ++insert more \r characters before the \n after every Load/Save cycle. ++For some unknown reason we were reading the files in "rb" mode but ++writing them in "a" mode, so we kept the \r characters on reading and ++added an extra one on writing. Fix: change the "rb" to "r". Thanks ++to Joel (last name not given) for the bug report. ++ ++* Put the arguments to rsh/remsh in the right order for better ++portability. Thanks to Michael Kalisz. ++ ++* FreezeUI is now implemented in WinBoard; it was previously only ++implemented in xboard. This function prevents the user from entering ++moves or other commands while we are waiting for an engine to ++initialize itself. Implementing it fixes a bug where the user could ++start a game (etc.) during feature negotiation. One of the symptoms ++of this bug was that we could send "new" one or move moves *after* the ++first game started! ++ ++* Fixed some handle leaks (WinBoard only), including a nasty one that ++leaked one handle per command sent to ICS. Thanks to several folks ++who helped characterize the bug and tried to look for leaks. ++ ++* We now install and look for the info file in ${prefix}/share/info ++instead of ${prefix}/info. The latter is still the default in ++autoconf, but the former is currently used in Red Hat Linux and ++probably elsewhere. ++ ++xboard/WinBoard 4.2.5 -- Sat Dec 15 11:42:51 PST 2001 ++Tim Mann ++ ++* Changed the bundled GNU Chess 5.02 in the WinBoard package to ++include a much smaller book and to use much less hash table space by ++default (8 MB transposition table, 0.5 MB pawn evaluation table). The ++large book included with 4.2.4 made the WinBoard download too big for ++some people, and the default hash tables were larger than the ++available physical memory on some people's computers. I built the ++small book by running Crafty's "small.zip" book line collection ++through a Perl script that makes it look enough like real PGN games ++that the GNU Chess book builder will accept it. The script and some ++minor patches to GNU Chess 5 are available in the WinBoard source ++distribution and at http://www.tim-mann.org/gnuchess.html. ++ ++* Fixed a bug in the code that deals with engines that complain that ++"time" and "otim" are illegal moves. This was a new bug in 4.2.4. ++ ++* Revamped the implementation of ToStart in analysis mode. Formerly ++there was some ill-conceived code that would try to get back to the ++start of the game by doing a "new" command (and all the followup ++commands that requires) while remaining in analysis mode. This is ++problematic for engine authors to support, though it works with ++Crafty. This code was trying to solve the problem of ToStart being ++slow because the engine would try to start an analysis after every ++"undo" command all the way back to the start. But ToEnd already had a ++much better solution to this problem, and now ToStart does the same ++thing: we exit from analysis mode and enter force mode instead, ++make/unmake moves to get to the end/start of the game, and then ++reenter analysis mode. ++ ++* Formerly, Zippy could try to start playing a game before the engine ++was initialized; that is, during the initial timeout for protover 1 ++engines, or before "feature done=1" for protover 2 engines. We now ++wait until the engine is initialized before connecting to ICS, which ++fixes this in the common case. If you turn off engine reuse for ++multiple games (that is, if you give the -xreuse option), there could ++still be problems; see item 503 in the ToDo file. Thanks to Dieter ++Buerssner for the bug report. ++ ++* Bugfix: All WinBoard versions since the merge with WinBoard Plus ++(but not xboard) have had a bug in changing the PeriodicUpdates, ++PonderNextMove, and ShowThinking options from the menu. The bug ++mostly just caused changing these options during a game to not take ++effect until after the next reset. For TwoMachines games, though, ++changing PonderNextMove just before the game would take effect ++immediately for the second engine but not until the next game for the ++first engine. Thanks to Koundinya Veluri for the bug report. ++ ++* Bugfix: In 4.2.4, we sometimes got confused when trying to leave and ++reenter analyze mode. One symptom was that Analyze File did not work. ++Thanks to Igor Syry for the bug report. ++ ++xboard/WinBoard 4.2.4 -- Sun Dec 9 14:56:30 PST 2001 ++Tim Mann ++ ++* WinBoard now includes GNU Chess 5.02 in place of GNU Chess 5.00. ++ ++* WinBoard's PasteGameFromClipboard will now handle a paste with ++multiple games in it, popping up the game list dialog. xboard ++already did this. Suggested by Robert Gerstman. ++ ++* We now use the "clearboard" command on ICC where appropriate. ++ ++* Bugfix: don't generate a bogus "variant normal" command to an engine ++for the loadable ICC wild types that we internally flag as ++VariantLoadable. Also clarified the message that Zippy sends when ++declining such wild games -- it can't deal with the possibility of ++loading an arbitrary position into the game. Thanks to Dieter ++Buerssner for reporting the problem. It would be nice to be able to ++actually play these wild types some day; presumably there would have ++to be an option to either send "loadgame" with a specified position, ++or to deal with an opponent sending it. ++ ++* If we get a holdings message from ICS when we thought we were ++playing normal chess, we now try asking for a move list so that we can ++find out from the header what's really happening. Formerly we guessed ++bughouse in this case. Response to a comment from Gian-Carlo ++Pascutto. ++ ++* Fixed two longstanding bugs in the clock code. These affected only ++play between a user and a local engine, or between two local engines, ++not ICS play. (1) The last fractional second used by a player before ++moving and virtually pushing his clock was being charged to his ++opponent instead of to him. (2) The time and otim commands were being ++sent to an engine before the (buggy) fractional second update was ++done. The second bug was pretty harmless in itself, but the first one ++was serious. Many thanks to Peter Rosendahl for carefully diagnosing ++and reporting these bugs! ++ ++* Changed WinBoard timestamp key. Nothing is changed other than the ++key and a recompilation. ICC may phase out the old key soon; if they ++do, you'll need to use the timestamp.exe from WinBoard 4.2.4 or later ++to connect to chessclub.com. ++ ++* Fixed an xboard-only bug where most dialogs would not take keyboard ++input unless the mouse was actually over the dialog, even if the ++dialog window had focus. Thanks to Jason Varsoke for the bug report. ++ ++* Bugfix; Remember to send time and otim commands to engine before ++sending playother. Thanks to Bob Hyatt for the bug report. Also ++fixed a bug where time and otim were sometimes sent even with feature ++time=0. ++ ++* Added small patches from Wilkin Ng that are meant to fix a crash in ++CopyGameToClipboard and a "can't unlock clipboard memory" error in ++PasteTextFromClipboard, under Windows 2000. ++ ++* Changed cygwin.mak to not use -mno-cygwin. In other words, it now ++uses cygwin1.dll instead of the mingw libraries. This works around ++bugs in fileno() and stat() that I encountered in mingw. (fileno ++seems to always return 0. stat fails because the library routine uses ++a different definition of struct stat than the header files provide.) ++Thanks to Robert Gerstman for reporting the symptoms these bugs caused ++when WinBoard was compiled with Cygwin. ++ ++* Added -showButtonBar option. This lets you delete the << < P > >> ++buttons and thus widen the message widget a bit. ++ ++* Added code to address a very obscure bug. If an engine dies and ++needs to be restarted while in one of the analyze modes, it was not ++getting put back into analyze mode. This bug should not really ever ++have gotten tickled unless reuse was turned off and the engine sends ++game end commands (such as 1-0) when a game ends by rule while in ++analyze mode. The next version of the protocol spec will say that ++engines should not do that, but version 2 and earlier didn't address ++the issue. ++ ++* We now use the FICS "iset ms 1" feature to get times in ms instead ++of seconds. Thanks to DAV for email telling me about this feature. ++ ++* Changed clock display to show tenths of seconds for 9.9 seconds and ++less, instead of 0.9 seconds and less as before. ++ ++* It has been discovered that Zippy can play simuls on ICC (but not on ++FICS). If you arrange for Zippy to send the ICC command "simulize" in ++the -zippyGameStart string, it will accept additional games while ++playing. Zippy will use the same engine for every game, so whenever ++it switches opponents, the engine's state will be reset with the "new" ++command. This will of course weaken its play, so don't enable simuls ++if you want your engine to have the highest possible rating. Zippy ++was never designed to work with simuls; it just works by accident, and ++it hasn't been tested much. So please report any bugs you notice, but ++don't expect them to be fixed rapidly. Thanks to Paul McGuire for ++noticing that this works. ++ ++* Bugfix: Suppress the direct command to engine popup if there is no ++engine. In WinBoard this case used to cause a crash. Thanks to ++"Dargon" for the bug report. ++ ++* Bugfix: formerly we did part of the engine initialization for the ++very first game too soon, before feature negotiation. One result of ++this is that engines would never get the "ics" command for the first ++game. ++ ++* Lengthened timeout to detect protocol version 1 chess engines to 10 ++seconds. This should reduce problems with protocol version 2 engines ++that are slow to initialize missing the timeout and not getting a ++chance to send their feature commands before the first game starts. ++ ++* Klaus Friedel says that adding a short sleep to WinBoard after ++starting a new chess engine solves a problem that occurs under Windows ++2000, in which engines sometimes don't see the initial command(s) from ++WinBoard and hang. I don't understand how that can happen, but the ++sleep is harmless, so I've put it in. Others have also reported what ++may be the same problem, so hopefully this will fix it for them too. ++ ++* Bugfix: editing the Result field in EditTags will no longer cause a ++later crash. Thanks to DAV for a clear bug report that let me ++reproduce the problem. ++ ++* ICC wild 28 is now recognized as shatranj, but it is not supported. ++You might be able to play it by turning off Test Legality. ++ ++* Formerly we would always turn off "feature time" if the engine ++printed an error message with the string "time" or "otim" in it; now ++we do that only if the message comes before the engine makes its first ++move. This change is useful because some engines spew a lot of bogus ++error messages about commands they don't fully parse, so something ++like "result 0-1 {White lost on time}" could generate such a message. ++Engines shouldn't do that, but if they do, mysteriously turning off ++"feature time" is not a good way to react. ++ ++* Fixed an infrequently occurring Zippy bug: formerly, resuming from ++adjournment by position (that is, with GetMoveList turned off) or ++starting/resuming a wild game (nonstandard starting position) would ++try to set up the position without putting the engine into force mode ++first. That was probably tolerated by most engines, but if the ++position was black-to-play and the engine hadn't set feature ++setboard=1, then the fake "a2a3" move (which we use as a kludge to get ++black to be on move before sending the edit command) would appear to ++be a real move, and the engine might reply to it! This bug could also ++be seen when trying to use Zippy to play a simul -- something that ++Zippy was never designed to support, but which seems to mostly work ++anyway. Thanks to Paul McGuire for sending a WinBoard.debug file that ++showed the bug occurring. Some other cases of resuming adjournments ++or starting games from nonstandard positions may have been broken too; ++I think I've straightened out the problems. ++ ++* Agreeing to a draw in the human vs. local engine case formerly did ++not work if the human offered first; now it does. A human's ++unsolicited offer is considered valid until he makes another move. ++Thanks to Bruce Moreland for the bug report. ++ ++* Bugfix: We used to look for just "fr" in Event tags or strings from ++ICSes to recognize Fischer Random games. This caused a lot of false ++matches. Now we look for "wild/fr" instead, which is what FICS uses. ++ ++* Bugfix: Clicking on a move in the MoveList window only updated the ++displayed position; if a chess engine was active, its state was not ++updated. Thanks to Alejandro Dubrovsky for the bug report. ++ ++* Bugfix: The "resign" command from engine to xboard formerly did not ++work in ICS (Zippy) mode. ++ ++* Bugfix: Formerly we would register a garbage premove if the user ++clicked on a piece, then clicked on an edge or outside the board. Now ++such an errant click is ignored. ++ ++* Bugfix: GameEnds would send "exit" to an engine in analyze mode even ++if we did not actually want to leave analyze mode. ++ ++* Bugfix: "feature pause" was being rejected. We don't currently use ++it, but that is no reason to reject it. Thanks to Gian-Carlo Pascutto ++for the bug report. ++ ++* Bugfix: when "partner" needed to be sent both to ICS and the engine, ++Zippy was erroneously sending the ICS prefix character to the engine ++too. Thanks to Gian-Carlo Pascutto for the bug report. ++ ++* Zippy now declines challenges when the engine is not yet ready to ++play again, instead of ignoring them. This is needed so that the ++server will let the opponent repeat the challenge. It might be better ++to remember such challenges and accept them when the engine is ready, ++but that would be a bit more complicated to implement. ++ ++* Bugfix: Zippy's emotes didn't work on FICS because there, "i" is a ++built-in alias for "it", not a real command. So sending "$i foo" gave ++an error message instead of doing "it foo". We now leave out the ++alias-suppressing prefix for emotes. ++ ++xboard/WinBoard 4.2.3 -- Mon Feb 19 19:55:05 PST 2001 ++Tim Mann ++ ++* Bugfix: The error message "Variant X not supported by gnuchessx" ++formerly could pop up even in -ncp mode. ++ ++* Fixed an xboard bug in premove highlighting. If you had ++HighlightLastMove turned on, premoves got highlighted in ++highlightSquareColor (yellow) instead of premoveHighlightColor (red). ++ ++* Modified premove again. Now we are back to displaying the move ++locally immediately after sending it to the server, as in versions ++prior to 4.2.1. This is good because it lets you register your next ++premove sooner. As a better fix to the problem that the change in ++4.2.1 had been trying to address, we now suppress animating the ++opponent's move if you have a premove reply pending. However, it's ++probably still a good idea for you to turn off AnimateMoves entirely ++if you are trying to play extremely fast games. ++ ++* Removed an erroneous patch that left zombie chess engines around ++when both sigterm and reuse were turned off. (Bug was in xboard only, ++not winboard.) ++ ++* Bugfix: loading a game with autostepping did not work for games with ++PGN result "*" (unfinished). This bug was introduced in 4.1.0, caused ++by some outdated code that was supposed to leave you in EditGame mode ++after loading an unfinished game. I fixed this, and also changed it ++to leave you in EditGame mode after loading *any* game, but without ++changing the tags to say it's an edited game. It's not really clear ++whether that is the best thing is to do here -- ideally, perhaps, the ++tags should change to say "edited game" if you actually make any ++changes, but that is harder to make work. ++ ++xboard/WinBoard 4.2.2 -- Tue Feb 6 20:00:00 PST 2001 ++Tim Mann ++ ++* Fixed a problem introduced in 4.2.1. In -zippyPlay mode, 4.2.1 ++started sending the initString immediately after the old game ended, ++but then when the next game started, it would still send "force" and ++another initString. Another problem was that the first initString put ++the engine out of sync with the displayed board position, though that ++might not usually have been noticeable. This is now changed to do a ++full Reset at the end of the previous game, and avoid doing a Reset at ++the start of a new game if we are still in BeginningOfGame mode. ++ ++* Fixed some limitations in -zippyPlay mode. The engine was not being ++fed the moves or history of games that were displayed but not being ++played, so it would get confused if you tried to do something like ++examine a game, then enter EditGame mode from somewhere in the middle ++of the game. ++ ++* Made a small change so that cygwin can compile xboard for Windows ++(an X server is required to run it). Thanks to Volker Zell. Most ++people would probably prefer to run WinBoard on Windows, however; note ++that cygwin could already compile WinBoard. ++ ++* Added some missing documentation to engine-intf.html: It is okay to ++send "feature done=0" even before you receive the xboard and protover ++commands, if this is needed to give your engine enough time to ++initialize. See engine-intf.html for more discussion. ++ ++* Bugfix: "feature done=0" did not work for the second engine; now it does. ++ ++xboard/WinBoard 4.2.1 -- Sat Feb 3 19:52:26 PST 2001 ++Tim Mann ++ ++* Bugfix: in Zippy mode with feature san=1, the elapsed time was being ++sent to the engine after the SAN move; for example, "e4 (0:01)" was ++sent instead of just "e4". ++ ++* It seems that scroll wheel mice with incompletely installed software ++(under Windows 95, at least) can send repeated middle button up events ++when the wheel is turned. Moved QuickPaste from middle button up to ++middle button down to avoid problems with this. ++ ++* A premove is now sent *before* the opponent's move that it replies ++to is animated. The premove itself is no longer displayed (or ++animated) when sent; instead, it is displayed when the chess server ++echoes it back as a board update. ++ ++* Bug fix: in -xreuse mode, xboard was only sending command line ++arguments to the engine the first time it was started. (WinBoard ++didn't have this bug.) ++ ++* In -zippyPlay mode, we now initialize the chess engine for a new ++game immediately after the old game ends. (In -xreuse mode, this ++means starting a new engine process; in the default -reuse mode, it ++just means sending "new".) If the engine supports ping, we don't ++accept challenges until the "new" has finished. This should help ++avoid losing time (re)initializing the engine after the game starts. ++ ++* We now handle the new FICS field in style 12 that says whether the ++clocks are ticking. ++ ++* whiteFlag and blackFlag are now reset whenever an ICS board image ++arrives, giving autoflag a fresh chance to work. ++ ++* Suppressed "geometry error" debug messages unless -debug flag is given. ++ ++* Bugfix: avoid core dump on Solaris with -debug flag, caused by ++passing NULL to a %s format in GameEnds. ++ ++* Added -firstProtocolVersion and -secondProtocolVersion. This will ++allow use of extremely broken engines that hang or die when given the ++"protover 2" command. It should be rarely if ever needed. ++ ++* Zippy now strips highlights from player names in the Creating ++message; previously the ratings would not be extracted from this ++message properly if you had set the highlight variable. ++ ++* Bug fix: Zippy with -zp but not -zt used to be fooled by false ++partner tells inside channel tells; e.g.: ++Garf(24): Garf (your partner) tells you: sit ++ ++* Bug fix: when an engine reported its name with the new "feature ++myname=" command, we had been putting just that name into the window ++title even when in TwoMachines mode. ++ ++* By default, WinBoard no longer uses the new feature introduced in ++4.2.0beta of keeping the ICS menu, ICS server list, and lists of chess ++engine command lines in separate files; instead, the lists are back in ++the winboard.ini file. This gets rid of some problems where the ++separate files could not be opened because the working directory was ++not set to WinBoard's installation directory. ++ ++* WinBoard command lines and ini files now have another optional ++syntax for quoting an option value. All characters within { } curly ++braces are interpreted literally except for '}' itself. SaveSettings ++now uses this syntax for string values that contain a backslash or ++newline and do not contain a '}'. This should address the problem ++that the separate .ini files had been meant to fix; engine command ++line lists can now be written without \-escapes. ++ ++* Fixed three bugs in relaying moves between engines in TwoMachines ++mode: an engine would be sent SAN if the *other* engine had set ++feature san=1, a relayed SAN move did not end with a newline, and ++feature usermove was not implemented for relayed moves. ++ ++* Fixed several bugs in exiting: File/Exit would sometimes hang; ++timestamp/timeseal would not get killed off; an engine crash would ++cause error messages to be printed recursively until stack overflow. ++ ++* Fixed a bug in the code to detect which ICS is in use and adapt to ++it; the chess.net case was broken. ++ ++* Removed the leading alias-suppression character when sending a move ++to ICS, because it seemed to break accuclock on chess.net. ++ ++* Fixed a bug where a FICS prompt like "10:01_fics%" would be matched ++as finger note number 10, causing a problem detecting when the user is ++logged in. ++ ++* Added tellicsnoalias command to protocol. ++ ++* Changed st command in protocol back to old behavior. ++ ++* Added done=0 feature to protocol, to lengthen initial timeout. ++ ++* Added missing -colorSeek command line option to xboard. (Was ++present in WinBoard.) ++ ++* Bug fix: setting feature reuse=0 was not working. ++ ++xboard/WinBoard 4.2.0beta -- Sat Dec 16 16:34:56 PST 2000 ++Tim Mann ++ ++* Setting -searchTime no longer turns off -clockMode. Note that when ++-searchTime is set, some engines may search for the lesser of ++searchTime and the amount of time their normal clock management would ++dictate, while others will disable their normal clock management and ++always search for exactly searchTime. ++ ++* Fixed WinBoard bug where on Windows 2000 (and maybe Windows 98) the ++ICS Interaction window would scroll back to the top whenever it filled ++to capacity and WinBoard trimmed some text off the top. ++ ++* Changed xboard dragging so that the center of the dragged piece is ++forced to be over the mouse cursor. (WinBoard dragging already worked ++that way.) This should avoid confusing cases when you start a drag ++with the mouse near the edge of a square -- formerly most or all of ++the piece could be over one square but the mouse cursor over another. ++Suggested by DAV. ++ ++* Added move list window for xboard. Code contributed by Manuel ++Hoelss and re-hacked a bit by me. Performance of this window is poor, ++because the implementation regenerates the entire window contents ++whenever anything changes. It's hard to avoid this when using the ++Athena List widget, though we could be a little smarter and notice ++when the current move number has changed but the move list has not. ++There are also several drawing problems caused by bugs in the Athena ++Form and List widgets. The window should not really allow a ++horizontal scroll bar, but the bugs are much worse if I turn it off. ++In both Xaw and Xaw3d, the List widget tries to resize itself when ++XawListChange is called, even if you tell it not to; and what's worse, ++if the widget cannot resize itself to be large enough to avoid ++clipping any of the list item, it does not change the list! Arrgh. ++On top of that, the Xaw Form widget is very buggy in XFree86 4.0.1 ++(X11R6.4.3). ++ ++* The OK button in the WinBoard startup dialog is now simply disabled ++if none of the radio buttons is selected, instead of bringing up an ++error dialog. Suggested by Ted Milbaugh. ++ ++* Used ping to address the worst of the race conditions in the ++protocol. Now if an engine supports ping, we ping it after sending ++the "new" command and after trying to place it in force mode at the ++end of a game. When a ping has been sent and the corresponding pong ++has not yet come back, we (1) ignore or undo any moves the engine ++sends, (2) ignore game end messages (such as "offer draw", etc.) from ++the engine, (3) ignore thinking output from the engine, (4) delay ++starting the next game if in -matchGames mode, (5) in -zippyPlay mode, ++respond to challenges with a polite message to try again soon instead ++of accepting them. There are a few more things that should be done ++(and item 5 might not be quite what we want), but it's hard to fit ++them all into the existing code. ++ ++* Patched the version of GNU Chess 5.00 included with WinBoard to ++support protover, feature, setboard, and ping, and to fix some minor ++bugs. See gnu500+.patch. ++ ++* Changed the GNU Chess 4 kludges for missing "st" and "sd" commands ++to be invoked only if the engine gives an error message for "st" or ++"sd", and to always use protocol commands instead of engine ++command-line options. See "Idioms" in engine-intf.html. ++ ++* Added new protocol command "protover 2" to tell the engine what ++version of the protocol is in use. Version 2 is still compatible with ++old engines; see engine-intf.html. ++ ++* Add new protocol command "feature ..." The engine can send this in ++response to the protover command command, to say what extended ++protocol features it would like to enable, etc. xboard responds ++"accepted F" or "rejected F" for each feature F that is set. See ++engine-intf.html. ++ ++* Added new protocol command "setboard ". This is an alternative ++to "edit", used only if the engine says "feature setboard=1". ++ ++* Added new protocol command "ping ". The engine is supposed to ++respond "pong ". This gives us a tool to fix some race ++conditions in the protocol, but it is not used to the fullest yet. ++ ++* Added new protocol command "tellopponent". This will do a "say" if ++you're on a chess server in Zippy mode, or pop up an information ++dialog otherwise. ++ ++* Added new protocol command "tellall". This will do a "kibitz" if ++you're on a chess server in Zippy mode, or pop up an information ++dialog otherwise. ++ ++* Added new protocol command "tellothers". This will do a "whisper" if ++you're on a chess server in Zippy mode, or do nothing otherwise. ++ ++* Changed the WinBoard /icsNames, /icsMenu, /firstChessProgramNames, ++and /secondChessProgramNames options to accept a filename preceded by ++"@", meaning to find the value in the file. Changed the defaults to ++use this feature, with filenames icsnames.ini, icsmenu.ini, fcp.ini, ++and scp.ini. This should make it easier for users to edit the values, ++since one less level of quoting is needed, and each value is in its ++own file, not mixed into winboard.ini. Those who upgrade from an ++older winboard version and already have a winboard.ini file will not ++automatically have these values moved to a file; that has to be done ++by hand if desired. ++ ++* We now strip .exe from engine names for "name" command, tags, etc. ++ ++* Allowed WinBoard input widget to hold more than one line. You can get ++a newline into the widget with copy/paste or with Ctrl+Enter. ++ ++* Fixed an xboard bug where the [P] button would appear in the ++opposite highlight state from what it should be after being pressed. ++ ++* We now use the "/" or "$" alias suppression feature on the chess ++servers, to avoid problems if the user inadvertently aliases a ++needed command to something else. ++ ++* Changed the method used to deiconize xboard in AutoRaise and cmail. ++This may fix bugs under some window managers where after ++deiconization, the board window was mapped but nothing was drawn ++inside. ++ ++* Preliminary, partial support for playing several chess variants ++against a local engine or editing variant games. The -variant option ++must be given on the command line or WinBoard startup dialog; there is ++no menu. The current variant is not displayed (except in the ++Tags/EditTags window). Many variants will not work quite right even ++if the engine supports them; see item 326 in the ToDo file for ++details. ++ ++* Added a workaround to detect the variant type when examining a ++scratch wild game on an ICS. ++ ++* Fixed two cases where "variant" command should be sent to the engine ++when necessary but was not: loading a game from a file and restarting ++a dead engine. Thanks to Gian-Carlo Pascutto. ++ ++* Added missing support for FICS games that start from a bsetup position ++with Black moving first. ++ ++* Fixed a bug in loading a file from the game list window while in ++Analysis or AnalyzeFile mode. This now leaves us in AnalyzeFile ++mode, analyzing the new file. ++ ++* Fixed a bug in loading games with a comment before the first move. ++ ++* Fixed a bug in handling LoadGame (or -lgf) with -td 0. ++ ++* Added a command line option to select an initial minor mode from the ++Mode menu. This should satisfy requests from a couple of users with ++special applications. ++ ++* Fixed a problem where some things in WinBoard's General Options ++dialog box were grayed out at the wrong time. ++ ++* We look for a few messages from the chess engine pipe that are ++intended to catch problems starting an engine via rsh, such as "No ++such file". Moved code so that these strings won't match until other ++protocol messages have been looked for, and documented the messages in ++engine-intf.html. ++ ++* Fixed the WinBoard bug that sometimes made the console input box ++white-on-white even when not in password-entry mode. ++ ++* Small changes to WinBoard to be compilable with the latest Cygwin ++net release (as of 10-16-2000). Thanks to Mark Schoenberg. ++ ++* Recompiled GNU Chess 5.0 for WinBoard with the latest Cygwin net ++release (as of 10-16-2000). Also rebuilt the book just to be sure, ++since I had one bug report about it. It came out identical and seems ++to work fine. ++ ++* Added messages for some common InstallShield errors instead of just ++printing InstallShield's stupid error code numbers. ++ ++* Added -firstComputerString and -secondComputerString, allowing you ++to suppress or change the command that is sent to a chess engine when ++its opponent is another computer. ++ ++* Added "configure --with-Xaw3d" to allow use of Xaw3d widgets instead ++of Xaw widgets in xboard. Thanks to Johnny C. Lam of the NetBSD ++project. I've left Xaw as the default because Xaw3d is too ugly. ++ ++* The version of the Xaw Form widget released in XFree86 4.0.1 ++(X11R6.4.3) has a bug that causes xboard to display the button bar ++on top of the message widget. I've reported the bug and have ++installed a kludge workaround into xboard. ++ ++xboard/WinBoard 4.1.0 -- Sun Sep 17 17:30:14 PDT 2000 ++Tim Mann ++ ++* Merged Winboard Plus 4.0.8 from Mark Williams into xboard ++ source pool. Status of Winboard Plus features in xboard: ++ ++ - White pieces now have borders, but the implementation is ++ completely different from WinBoard's; see below. ++ ++ - Options menu not changed, probably won't be. ++ ++ - Copy&paste support working, using Mark's changes to backend.c, Ben ++ Nye's changes to xboard.c for FEN positions, and some code of my ++ own in xboard.c for PGN games. ++ ++ - Premove hooked up and working. No pre-first-move, though. ++ ++ - ICS Alarm hooked up and working. ++ ++ - Auto-flip working. ++ ++ - PGN Training mode hooked up and working. ++ ++ - Improved menu item enable/disable working. ++ ++ - Improved >> button working. ++ ++ - Auto activate board working. I changed this to be optional; you ++ might not always want it, especially in Zippy mode. ++ ++ - Blindfold working. ++ ++ - Documentation updated. ++ ++* Fixed more colorization bugs. Commands like "message foo tells you: ++xxx" and "tell 33 tells you: xxx" will no longer generate bogus ++colorization. ++ ++* Added low-tech sound support to xboard, by invoking an external ++program on a filename for each sound to be played. ++ ++* ICC wild 27 is now recognized as VariantAtomic, and it sets the ++"ignore check" flag, but is not otherwise supported. ++ ++* Converted the piece bitmaps from .bm to .xpm for use with xboard's ++xpm support. (An .xim version was not created.) Wrote a shell script ++using ImageMagick to do the conversion and to bucket fill from ++coordinate 0,0 with the background color. Used xpaint by hand to ++clean up a few pieces where background color "leaked" into the inside ++or didn't flow all the way around the outside, then a sed script to ++fix up color names and bitmap names in the xpaint output. If any more ++sizes are added later, they should be straightforward to convert with ++reference to the existing scripts. With this conversion, not only do ++the white pieces now have dark borders, but (unlike with WinBoard) the ++light details on the black pieces are opaque. ++ ++* If the XPM library is found when building xboard, the new xpm pieces ++are compiled in as the default. External bitmap (or xpm) pieces can ++still be used by giving the -bitmapDirectory (or -xpmDirectory) ++option. If the XPM library is not found, the old bitmap pieces are ++the default. In this case external bitmap (or xim) pieces can be used ++by giving the -bitmapDirectory (or -xpmDirectory) option. There is no ++way to compile in xim pieces. ++ ++Winboard Plus 4.0.8 -- Sat Aug 5 15:51 PDT 2000 ++Mark Williams ++ ++* Bugfix release. ++ ++* Main menu now visible in Win NT. Thanks to Microsoft for creating a ++compiler which auto-mutilates the WinBoard.rc file so that the menu is ++displayed under Win 98 but not Win NT. I fixed the problem by hand editing the ++.rc file. Sigh. ++ ++* "Reset game" now works properly when invoked from Analysis mode when two ++engines are present. Correction of bug introduced in Winboard Plus. Thanks to ++Mogens Larsen for reporting the bug. ++ ++* Pasting a FEN position with Black to move now works in all modes. ++Thanks to Mogens Larsen for reporting the bug. ++ ++* Added gnuchess.dat to the distribution and a couple of text files that were ++missing in 4.0.7. ++ ++*** Merged in the following changes from Tim Mann: ++ ++* Bugfix: Highlights would sometimes not be taken down, at least in ++xboard. The problem is that SetHighlight works in chess coordinates, ++not view coordinates, so if flipView has been toggled since the ++highlight was put up, it gets taken down from the wrong square. Fixed ++by being careful to call ClearHighlights before toggling flipView, not ++after. Ugh. ++ ++* Bugfix: HighlightLastMove would sometimes highlight square a1 after ++a FICS "tomove black" command. ++ ++* Bugfix: a move list with initial position that has black to play was ++not being handled correctly. ++ ++* Removed "decline abort" and "decline adjourn" commands from Zippy. ++The syntax is changing on FICS, and Zippy really doesn't have to ++explicitly decline the requests anyway; it's sufficient to not accept ++them. ++ ++* ICC wild 26 is now recognized as VariantSuicide (the FICS name; ICC ++calls it "giveaway"). ++ ++* Bugfix: PGN games with black to move in the initial position weren't ++being legality checked correctly. I think this was introduced in ++4.0.6 when I fixed a different PGN bug. Thanks to Mark Williams for ++spotting the bug and suggesting a fix. ++ ++* Bugfix: the initial "name(" of a kibitz wasn't being colorized. ++ ++Winboard Plus 4.0.7 -- Thu May 12 17:57 PDT 2000 ++Mark Williams ++ ++* New white pieces with black borders. ++ ++* Major overhaul to Options menu. New dialogs for setting General Options, ++ Board Options, ICS Options, Sounds, Fonts, Colors. ++ ++* Clipboard support for PGN game scores and FEN positions. ++ ++* Optional ICS Premove with user-specified first moves for White and Black. ++ ++* New sound events: ICS Win, ICS Loss, ICS Draw, ICS Unfinished, ICS Alarm. ++ ++* New auto-flip option when playing against a chess program. ++ ++* Added PGN Training mode. ++ ++* Certain menu options now disabled while program is thinking. ++ ++* ">>" button now always goes to the end of the game. ++ ++* In ICS mode, the board is automatically activated at the start of a ++new game. ++ ++4.0.7 -- Sun Mar 5 17:17:49 PST 2000 Tim Mann ++ ++* Fixed a nasty bug in parsing ICS game histories that was introduced ++in 4.0.6. ++ ++4.0.6 -- Fri Mar 3 16:20:11 PST 2000 Tim Mann ++ ++* Fixed bugs in Zippy's code for responding to messages sent with the ++ICS "message" command. ++ ++* Fixed bugs where xboard could still create dialogs partially off the ++top of the screen. Fixed unwanted interactions between initial sizes ++and positions of various unrelated xboard dialogs. Deleted ++borderXoffset and borderYoffset resources. ++ ++* Fixed restoring the xterm name on exit to work in more cases. ++ ++* Small fix to the WinBoard self-extracting installer: when it starts ++up, it now always deletes any old wb-setup directory left over from a ++previous installation. Formerly this worked only on Windows 95/98, so ++on NT the self-extractor would sometimes stop and ask the user whether ++it was OK to overwrite the old wb-setup files. ++ ++* Modified WinBoard to be compilable with the free Cygwin tools ++available from http://sourceware.cygnus.com/cygwin/. Based on work by ++Mark Schoenberg. (His mods were enough to get WinBoard through the ++compiler, but a few things were broken along the way, so I reworked them.) ++ ++* Merged changes from Don Fong to make WinBoard compilable with ++Borland C++ 4.5. I do not have Borland C++ and am unable to test with ++it, but I did make sure the changes don't stop it working with MSVC++ ++5.0 and Cygwin. ++ ++* Forbade entering TwoMachines mode from MachineWhite or MachineBlack ++mode when machine is on move. This used to confuse the engine and ++cause problems, because when we try to get the engine to stop, it ++might make a move first, and it might not do that immediately. ++ ++* Variant classification now deals with new ICC wild 25, classifying ++it as "3check". Also, we are now conservative about new wild numbers ++we don't know about, classifying them as "unknown" instead of ++"normal". ++ ++* Replaced bad GNU Chess 5.00 book in WinBoard distribution with a ++correct one. 1.e4 now no longer takes GNU Chess 5.00 out of book! ++Thanks to Pete Galati. ++ ++* Made move parser accept and ignore nonstandard ep suffix on PGN moves, ++e.g., "exf6ep" or "exf6e.p." ++ ++* Fixed bugs in parsing PGN files starting with no move number, or ++with a move number other than "1." (including "1..."). Thanks to ++Michael Soulier and Stefan Zipproth for example PGN files ++demonstrating the bugs. ++ ++* Changed InitComboStringsFromString to not modify the input string; ++this caused an exception when WinBoard was compiled with MSVC++ 6. ++Thanks to Bert Tuyt for the report. ++ ++* In WinBoard, dragging a piece off the edge of the board without ++releasing the mouse button no longer instantly aborts the move. You ++still must release the mouse button inside a square to complete a ++move, but you can now drag off the edge and come back inside. ++ ++* WinBoard bugfix: If you went into EditGame or EditPosition mode ++while observing or playing an ICS game, and a new move came in ++(snapping you back to ICSClient mode) while you were dragging a piece ++around, the drag state would not be reset, causing the piece you were ++dragging to remain on the board wherever you dropped it. Thanks to ++David Brinegar for the bug report. ++ ++* WinBoard bugfix: If you moved or resized the board while your ++opponent was moving, and you had AnimateMoving on, his move would not ++be displayed until after your next move. Thanks to DAV for reporting ++the bug repeatedly until I finally understood it. ++ ++* Added a Zippy "farewell" feature; see zippy.README. ++ ++* Fixed a bug (xboard only) in processing -zippyReplayTimeout on the ++command line. Thanks to Steve Beer for the report and patch. ++ ++* Send "computer" command to both sides in TwoMachines matches. ++ ++* Fixed a Y2K bug in Evan's cmail code! Thanks to Brian Mays for the ++report and patch. ++ ++* Bugfix: Initialize variant field of GameInfo struct in gameinfo.c. ++This could cause crashes in LoadGame. Thanks to Andrzej Nagorko. ++ ++* Fixed several pattern matching problems: Finger notes and formula ++vars no longer get replied to by zippyTalk or colorized. Channel ++tells by players with many titles are now colorized fully, and ++zippyTalk handles channel tells by such players correctly. The shout ++"--> foo(99): bar" no longer gets colorized as a channel tell. Code ++is cleaned up a bit, and autocomment capture now uses the same ++criteria as colorization. ++ ++* xboard fix: Enter key now closes error popups as in WinBoard. ++Especially nice for the "Exiting: Connection closed by ICS" popup. ++ ++4.0.5 -- Tue Dec 7 10:30:40 PST 1999 Tim Mann ++ ++* Added missing documentation of SIGTERM usage into engine-intf.html. ++ ++* Bugfix: New -zippyReplayTimeout option was misspelled in WinBoard as ++-zippyReplyTimeout. Thanks to Francesco Di Tolla. ++ ++* xboard -ics now restores the xterm's original title upon exit, at ++least if $WINDOWID is set. ++ ++* Bugfix: -matchGames mode wasn't terminating properly. Final score ++popup would come up twice and engines would not be killed off. Thanks ++to Frank Quisinsky for the bug report. Bug was introduced in 4.0.4. ++ ++* Bugfix: "tell 50 foo shouts: bar" no longer gets colored as a shout; ++similarly for "...s-shouts:" and "...c-shouts:". Thanks to David Lee ++for the bug report. ++ ++4.0.4 -- Fri Dec 3 17:51:27 PST 1999 Tim Mann ++ ++* Bug fix: formerly if you invoked SaveGame from EditPosition mode ++with black to play, the position was not saved properly. As a quick ++fix, SaveGame now takes you out of EditPosition mode before saving. ++ ++* Changed -matchGames to keep track of the score (won-lost-drawn) and ++display it in the banner. The final score is displayed in a modal ++popup before the program exits. ++ ++* Changed "Connection closed by ICS" to display in a model popup ++before the program exits. ++ ++* Added -popupExitMessage option, default on. Setting this to false ++suppresses the modal popups that you sometimes get just before ++xboard/winboard exits -- both the two new ones listed above and the ++existing Fatal Error popup. This is useful when running Zippy ++unattended from a shell script (or .bat file) that loops and starts a ++new copy after a time delay when there is an error. ++ ++* In xboard, added missing support for WM_DELETE_WINDOW to all ++windows. This makes xboard a better citizen, and is much needed with ++the newer X window managers that put an [X] button on every window and ++bind it to "kill application" if the applicationd does not support ++"delete window". We can't allow xboard to be thoughtlessly killed, ++since that leaves the chess engine running in the background. ++ ++* We now avoid positioning tops of xboard dialog boxes offscreen. ++ ++* zippy.lines can now use the caret ('^') character as an inter-saying ++separator. You no longer need to dig up a text editor that can put NUL ++('\000') characters in text files. ++ ++* Bugfix: In traditional chess clock mode, White now gets time added ++to its clock as soon as it makes time control. Previously both White ++and Black got their time added only when Black made time control, ++which would cause some engines to make their 41st move as White too ++quickly, thinking they were low on time. ++ ++* The zippyAcceptOnly feature no longer sends a decline command or ++a tell. Thus you can use it to put Zippy into a manual accept mode. ++ ++* Bugfix: "tell 50 foo tells you: bar" no longer gets colored as a ++personal tell; similarly for "...whispers:" and "...kibitzes:". ++ ++* WinBoard no longer blanks the message line when you start a new ++move, unless there was an error message there from the previous move. ++ ++* WinBoard now never puts the white piece drop menu on the middle ++mouse button. Both colors are always on the right button. Windows ++users often don't think to look for a middle button menu, or don't ++really have a working middle button despite what Windows says. ++ ++* Guest login handles on ICC are now parsed again; an ICC wording ++change had broken this feature. ++ ++* Autodetect when the engine does not support the "draw" command and ++don't relay the command to it in that case. Needed because sending an ++unsupported command to GNU Chess makes it move immediately, so people ++could make Zippy move without thinking by continually offering a draw. ++Thanks to Frank Walker for the problem report. ++ ++* Small changes based on code from Robert Jurjevic: The WinBoard ++analysis window can be minimized (though not to the taskbar). The ++WinBoard ICS Interaction window will autoscroll if you drag the mouse ++above or below the window while selecting, and password entry mode ++leaves the entry line as the background color instead of using 75% ++gray. Seeks are now colorized with a new color of their own. ++ ++* Added -zippyMaxGames feature. ++ ++* -zippyNoplayCrafty command line option was missing in xboard; fixed. ++Thanks to John Perry. ++ ++* Fixed bug in detecting when Zippy loses his bughouse partner. ++Thanks to Ben Dean-Kawamura. ++ ++* allobs fix in 4.0.3 didn't work; corrected it. ++ ++* WinBoard will now update the board immediately if a move is made ++while the window is being moved or resized. ++ ++4.0.3 -- Sun Aug 15 18:44:39 PDT 1999 Tim Mann ++ ++* Bugfix: moved winboard wizard functions that send a command directly ++to the chess engine from Ctrl+Alt+1 and Ctrl+Alt+2 to Alt+1 and Alt+2. ++Ctrl+Alt is equivalent to the European AltGr key, so the old assignments ++conflicted with typing an @-sign on some keyboards. ++ ++* Bugfix: prevent "If this message stays up, your chess program does ++not support analysis" from appearing if AnalysisMode is selected when ++already in Analysis or AnalyzeFile mode. Also, deleting analysis window ++in WinBoard now switches you to EditGame mode, to avoid the anomaly of ++being in an analysis mode with no analysis window present. ++ ++* Change all Zippy environment variables to work as command line ++options. For now they still work as environment variables too, but ++the environment variables are deprecated. ++ ++* Use unsigned long to hold node counts from engines. ++ ++* Print error instead of crashing on attempts to use xpm or xim pieces ++in monochrome mode. Thanks to Jim Torrance for the bug report. ++ ++* Tightened pattern recognition for ICS messages sent to Zippy; should ++no longer match ICC allobs output. Fixed recognition of when Zippy is ++sent a message; small change to FICS output had broken it. ++ ++* Zippy now exits if the engine dies unexpectedly. ++ ++* Added Zippy "spoofedby" feature; see zippy.README. ++ ++* Narrowed the margins on some older WinBoard dialogs to make their ++style uniform with the newer ones. ++ ++* Bugfix: Changing Ponder Next Move from the Options menu did not take ++effect until the next game. This bug was in WinBoard only. Thanks to ++Stefan Zipproth for the bug report. ++ ++* Got rid of "Internal error: bad move type" message when the engine ++makes a move that we can parse but think is illegal. Now the move is ++just passed on (which also may be the wrong thing to do). ++ ++4.0.2 -- Thu Feb 25 19:55:32 PST 1999 Tim Mann ++ ++* Added one more built-in sound choice to WinBoard: move.wav from Pete ++Galati. ++ ++* Added new larger piece sizes: big, huge, giant, colossal, titanic. ++ ++* Modified the xboard font searcher to be able to use scalable fonts. ++The new -fontSizeTolerance flag controls how closely a nonscalable ++font must match to be used in preference to a scalable font. ++ ++* Zippy environment variables ZIPPYABORT and ZIPPYADJOURN now control ++whether Zippy will accept abort and adjourn requests. ++ ++* We now determine the variant type being played on ICS, send it as a ++command "variant VARTYPE" to the chess engine (if in Zippy mode), and ++put it in the PGN tags. See engine-intf.txt for variant names. See ++ZIPPYVARIANTS in zippy.README to control what variants Zippy will ++accept. Note that this now applies to bughouse, too. ++ ++* Zippy now won't do -zippyTalk in a channel unless his handle is ++mentioned there. ++ ++* Zippy now ignores bughouse holdings if not actually playing, instead ++of stupidly trying to abort the game. Let me know if other strange ++things happen when Zippy is observing a game. ++ ++* Set ICS Interaction title bar to "user@server". User name is ++determined by parsing message during the login sequence. Zippy now ++uses this method to get its name too, so ZIPPYNAME is eliminated. ++Problem: with xboard, the title bar gets set to "xterm" upon exit, ++since we didn't know what it was to start with. ++ ++* Fixed xboard-only bug in -colorChannel1 command line option. Thanks ++to Fredrik Sandstrom for the bug report and fix. ++ ++* Check for overflow of MAX_MOVES. Still not sure this is checked for ++everywhere it needs to be. ++ ++* Added .epd to suffixes recognized by WinBoard as position files. ++This is a bit of a kludge, as the .fen reading code was not written ++with .epd files in mind, but reading them with it is said to work. ++ ++* Added ZIPPYGAMESTART feature, suggested by Jason Hoblit. See ++zippy.README. ++ ++* Restored the feature of soaking up the moves from a user-typed "moves", ++"oldmoves", or "smoves" ICS command when xboard/WinBoard is idle, but ++changed it so that the move list is also echoed to the screen. Some folks ++still liked the old feature since it is faster than examine mode, and ++printing the moves to the screen should eliminate the confusion it caused ++for other people. ++ ++* Bugfix: in WinBoard, starting a click-click move and then clicking on ++a black line would cause the source square to be forgotten without taking ++the highlight down. Now the errant click is ignored. ++ ++* Corrected shortcut key labels for LoadNext/PrevPosition in WinBoard's ++File menu. Thanks to Andreas Stabel for the bug report. ++ ++* Bugfix: if you had a completely full ICS context menu in WinBoard ++(90 items), the last one would do nothing if selected. ++ ++* The "computer" engine command added in 4.0.1 was not working; I had ++left out part of the code patch. Oops. ++ ++4.0.1 -- Fri Feb 12 21:24:15 PST 1999 Tim Mann ++ ++This is a minor bugfix release. The first item listed below is the ++only interesting new feature. ++ ++* You can now type in moves from the keyboard in WinBoard. Either ++select TypeInMove from Step menu, or (if you are not in ICS mode), ++just start typing. In ICS mode you can type moves into the ICS ++interaction window anyway, so I've retained the feature that typing ++switches you there. Not implemented in xboard. ++ ++* Removed the "noise 1000" command that used to be sent to the chess ++engine when entering analysis modes. ++ ++* Deleted the feature where we soak up the output of a user-typed ICS ++"moves" or "oldmoves" command. This ancient feature is not really ++useful anymore, now that "examine" exists, and it caused a lot of ++complaints. ++ ++* Increased maximum size of ICS text menu to 90 entries and added ++overflow checking. ++ ++* The command sent to ICS by Zippy at the end of each game can now be ++customized with the ZIPPYGAMEEND environment variable. ++ ++* We treat xboard.info as a pseudo-source since most people don't have ++the tools to rebuild it. But "make install" erroneously had a ++dependency on it, even though "make all" did not. Fixed. ++ ++* Miscellaneous minor updates and clarifications to engine-intf.txt. ++In particular, documented the st and sd commands (support for command ++line options -searchTime and -searchDepth), warts and all. ++ ++* Added a small code patch from Bob Hyatt to detect when Zippy's ICS ++opponent is a computer and send the command "computer" to the engine. ++Added this command to engine-intf.txt. Thanks, Bob. ++ ++* Bugfix: configure was looking for usleep(), but config.h.in didn't ++have an entry for it, so HAVE_USLEEP was never defined. Also, in the ++non-HAVE_USLEEP case, there was a possible race condition between the ++signal handler and the pause() call. Thanks to Ben Dean-Kawamura for ++the bug reports. ++ ++* Bugfix: a "1..." preceding Black's first move (usually present if ++there is a comment on White's first move) would cause the parser ++to think a new game started there and report "End of game" on the ++current game. Thanks to Dell Garner for the bug report. ++ ++* Changed the abbreviation for -searchDepth from -sd to -depth to fix ++a clash with -secondDirectory. ++ ++* Changed -searchDepth to be orthogonal to the various timing options. ++Previously it would search for an unlimited time to the given depth; ++now the engine is allowed to choose its search time in the normal way, ++but is told to cut off the search early if it reaches the given depth. ++ ++* Bugfix: SaveSettings in WinBoard was saving both the long form ++option highlightSquareColor and its abbreviation (hsc). ++ ++* Fixed a redisplay bug in DisplayBothClocks that could cause White's ++clock to be highlighted in EditPosition mode when Black's should have been. ++ ++* Fixed Zippy's feature of passing on draw offers from the ICS opponent. ++The colorization code was eating the offer before Zippy saw it, so I disabled ++colorization of offers while in -zp or -zt mode. (Other types of ++colorization are already disabled in Zippy mode for similar reasons.) ++ ++* Added some more commands to the default ICS context menu in WinBoard, ++and put "(name)" on the ones that insert a playername (or game number). ++ ++* Added missing documentation to WinBoard help file: PonderNextMove, the ++-ponder/-xponder argument, and the up/down arrow history feature in the ++ICS Interaction window. ++ ++* Fixed ZIPPYNOPLAYCRAFTY feature to fire only if the opponent is Crafty, ++not if some other Crafty is observing the game and kibitzes. ++ ++* Fixed bugs in generating "partner" commands when Zippy is playing ++bughouse. ++ ++4.0.0 -- Sat Jun 20 16:59:47 PDT 1998 Tim Mann ++ ++* Fixed WinBoard resizing so that the edges you do not drag remain in ++place, even when the final size is different from what you dragged to. ++(This doesn't work on NT 3.51 or earlier, if anyone cares.) ++ ++* Fixed problems with resizing WinBoard on Windows NT: you no longer get ++whitespace around the board, a clipped board, or a lot of flashing during ++the drag. ++ ++* Added customization for highlight-square color. ++ ++* Bugfix: backend.c wrote to stderr in a few obscure places, which doesn't ++work in WinBoard. ++ ++* Added Index Number field back to LoadGame/LoadPosition dialog boxes in ++WinBoard. This required some extra code to work with both the ++Explorer-style dialog boxes and the old-style NT 3.51 dialog boxes. Ugh. ++ ++* WinBoard startup dialog now understands -zp mode. The first chess ++engine selector is enabled and the value is used. ++ ++* Bugfix: ResetGame would send "exit" to engine twice if it was in an ++analysis mode. ++ ++* Bugfix: The response "Illegal move: bk" to the "bk" command, indicating ++that it is not implemented, would confuse xboard. ++ ++* Bugfix: Ignore empty hints ("Hint:\n") instead of printing a message ++saying that some bogus string (often "Hint:") is illegal. ++ ++* Bugfix: LoadNextGame/LoadPreviousGame/ReloadSameGame were broken. ++ ++3.6.12 -- Sat Jun 13 14:57:10 PDT 1998 Tim Mann ++ ++Beta test release of xboard and WinBoard. ++ ++* Spruced up xboard man page a bit. ++ ++* Added Highlight Last Move to xboard too. ++ ++* The revamped xboard mouse click code had several more bugs than the ++previous version, so I revamped it again. All fixed now, I hope. ++ ++* xboard bugfix: crash in CreatePieceMenu. ++ ++* Oops. winboard-3_6_11beta.exe installed 3.6.10beta, not the new version. ++ ++3.6.11 -- Fri Jun 12 20:00:48 PDT 1998 Tim Mann ++ ++Beta test release of xboard and WinBoard. ++ ++* Major reorganization to engine-intf.txt. Some new features added, ++many existing features clarified and hints for engine programmers added. ++Support for new features added to program. ++ ++* Changed defaults for -scp (etc.) back to being independent of -fcp, as ++in 3.6.2. That is, the default is no longer to copy the value from -fcp if ++-scp is not specified. This will sometimes make command lines longer but ++will remove some confusing situations. ++ ++* Split -reuseChessPrograms into two options: -reuseFirst and ++-reuseSecond. Fixed obscure bugs when reuse is off. ++ ++* Detect ICC and change some command usage slightly there: only ICC has ++set-quietly; only FICS has iset and bsetup clear. With this feature, we ++can now safely use bsetup clear when appropriate instead of deleting each ++piece one by one. ++ ++* Added indent to lines that are wrapped by WinBoard ICS Interaction ++window. This seems to tickle a Microsoft bug in the RichEdit control: ++occasionally the start of the next line after the wrapped line is indented ++too. I think the wrapped indent feature is useful enough that it's worth ++having in spite of the bug. ++ ++* WinBoard bugfix: bounding box for the board was computed incorrectly by ++mouse code. It would think you moved off the bottom of the board before ++you really did, so it was hard to drag pieces along the bottom rank on ++smaller board sizes. ++ ++* Fixed obscure parser.l bug: ambiguity between capture using : instead of ++x and email header line. Also removed or simplified a lot of complex ++patterns for English (as opposed to PGN) end-of-game indications while I ++was in there. ++ ++* Added PonderNextMove option. ++ ++* xboard EditPosition piece menus now let you set the side to play by ++selecting the "White" or "Black" label at the top of the menu, like ++WinBoard. (Both xboard and WinBoard still let you set the side to play by ++clicking on the clock.) ++ ++* Merged documentation of Crafty and GNU Chess thinking output in ++engine-intf.txt. Corrected code in backend.c to match documentation; it ++used to require the PV to start in column 27 (!). ++ ++* Fixed bug that caused crashes in "-reuseChessProgram false" mode. ++ ++* Draw by agreement in Two Machines mode now works as it is supposed to. ++Other minor bugs in handling game end messages from machines are also ++fixed, and engine-intf.txt is revised in this area. ++ ++* Revamped xboard code for handling mouse clicks on the board. In ++particular, it had a bug if a click-click promotion move was made. ++ ++* Fixed and reinstated optimization for << in analysis modes: send ++initString and re-send the board if needed. Sending repeated undos ++is bad because Crafty prints some analysis after every one. ++ ++* Don't go into a spin loop while pausing between xboard animation frames. ++This caused problems, especially when compiling with -O2 on HP-UX. ++ ++* WinBoard Options/Colors/RevertToDefaults now also turns off Monochrome ++if it was on, and similarly for Options/ICSInteractionColors/RevertToDefaults. ++This seemed to confuse people before. ++ ++* Bugfix: ICS Interaction context menu items with neither of the two ++optional flags set did not work. ++ ++* Bugfix: PGN move numbers are optional, but we were insisting on "1" ++right after the tags. ++ ++* Bugfix: only the first game of an -mg match was loading -lpf or -lgf. ++ ++* Other minor fixes and code cleanup. ++ ++3.6.10 -- Mon Jun 1 01:32:31 PDT 1998 Tim Mann ++ ++* Added ZIPPYNOPLAYCRAFTY feature; see zippy.README. ++ ++* Added timestamps for chess engine interaction to -debug output. ++ ++* Now allow 10 seconds (was 5) between games in match mode for engines to ++respond to "force" command that ended previous game. ++ ++* When a game is picked from the game list and the names of White and ++Black are known, display them in the window banner instead of the filename ++and game number. ++ ++* Changed default for -scp and -sd to be the values of -fcp and -fd. ++ ++* Added boxes for both engines to WinBoard startup dialog. Changed to ++dropdown boxes whose content can be set from winboard.ini, similar to ++the box for ICS name. ++ ++* Accept "offer draw" (or "*offer*draw*") from engine to offer a draw. ++ ++* Accept "move mmmm" from engine as well as silly "1. ... mmmm" syntax. ++ ++* Added support for bughouse engines (Zippy mode only). ++ ++* Move bombproofing for engines sending illegal or out of turn moves. ++ ++* Always send "xboard\n" to engine as first command. Eliminates need ++to run crafty as "crafty xboard". ++ ++* Rewrote xboard code for input from engines to fix longstanding bugs. ++Previously an engine that sent one line in two separate writes with ++some time lapse in between (or perhaps that sent several lines in one ++write) could make xboard hang. WinBoard did not have this bug. ++ ++* Fixed minor bugs in dealing with illegal moves. ++ ++* Added "iset startpos 1" for FICS. ++ ++* Removed special support to put "GNU Chess" or "Crafty" in the window ++banner instead of the engine's base filename. This gives a more level ++playing field for other engines. Also fixed bugs in the code that finds the ++engine's base filename. ++ ++* Bugfix: Abort or Resign at the very start of a game in chess engine mode ++would fail to send "force" to the engine. ++ ++* Fixed some minor bugs in new "result" messages, and changed format to ++include a trailing PGN comment giving the reason the game ended. ++ ++* Changed syntax of /font options in WinBoard; old syntax was assuming ++that a font name can't contain a digit, which is wrong. Old font names in ++WinBoard.ini files are still accepted. ++ ++* Serious further work on getting WinBoard to read/write files in the ++"right" directories and documenting exactly what it does. ++ ++* Added LoadPreviousPosition, LoadNextPosition, ReloadSamePosition. ++ ++* Misc. tiny fixes and cleanup. ++ ++3.6.9 -- Sun May 24 20:53:08 PDT 1998 Tim Mann ++ ++xboard and WinBoard beta release. ++ ++* Tightened up illegal move handling. Illegal or meaningless moves from a ++file or chess engine should no longer get translated into a1a1 and blindly ++applied. Explicit moves to the same square (like a1a1) no longer make the ++piece on that square capture itself and vanish. ++ ++* Added AlwaysOnTop feature to winboard. ++ ++* Fixed bug in winboard "@" command line indirection operator. ++ ++* Removed buggy "optimization" code for ToStart in analysis modes. ++ ++* Fixed typo bug in zippy.c that would often cause winboard to crash ++right after starting a game in -zp mode. ++ ++3.6.8 -- Sat May 23 22:23:19 PDT 1998 Tim Mann ++ ++xboard and WinBoard beta release. ++ ++* Added -firstDirectory and -secondDirectory so that chess engines can ++be started in a different directory from xboard/WinBoard itself. ++ ++* Added -matchGames to allow more than one game in -matchMode. The games ++are played with colors alternating between the two chess engines. Had to ++add a time delay at the end of each game to catch up with game ending ++messages from both chess engines -- yuck. ++ ++* Changed TwoMachines mode to have firstChessProgram play White by ++default. Added -firstPlaysBlack to restore old behavior. ++ ++* Major rework of code in backend.c for dealing with first and second ++chess engines. Generalized the code and created a struct type with one ++instance for each engine. Several small bugs fixed along the way. ++ ++* Fixed bugs in Abort in local chess engine mode. ++ ++* Tightened pattern matching to recognize moves from machine. Should cure ++bogus "Illegal move" errors while Crafty is pondering with Show Thinking ++on, among other things. ++ ++* WinBoard keeps focus in board window after popping up a comment due to ++Forward/Backward/ToStart/ToEnd commands. ++ ++* Finally got rid of warnings on compiling moves.c under Windows. ++ ++* Fixed so WinBoard will compile on machines where WM_MOUSELEAVE is not ++defined. ++ ++* Removed various bits of unused code. ++ ++* Parse (and ignore) NAGs in PGN files. ++ ++* Updated engine-intf.txt. ++ ++* Send "result R" to the chess program at the end of each game, where ++R is the PGN result 1-0, 0-1, 1/2-1/2, or *. ++ ++* Bugfix: suppress animation when loading a game with timeDelay=0. ++ ++* Bug fix: pondering output from Crafty that contained "..." could be ++mistaken for a move, causing bogus error messages and general chaos. ++ ++* xboard "make clean" bug fix: moved things created by configure to be ++removed only by "make distclean". ++ ++* Fixed a remaining case where move was being animated before being ++relayed to opponent. ++ ++* Backend was reversing time/otim commands to the chess program (new bug), ++and was often not sending them on the first move of a game or the first ++move after a mode change (old bug). Fixing the latter required a kludge ++to work with both GNU Chess and Crafty, because Crafty swaps white and ++black clock times when it swaps sides, while GNU Chess does not. The ++kludge is that we always make sure the chess engine thinks its opponent is ++on move before we set the clock. This will sometimes result in sequences ++like "white\ntime xxx\notim yyy\nblack\ngo", or the same with white and ++black interchanged. ++ ++* Removed last trace of old -whiteString and -blackString arguments. ++ ++* Fixed so that you can type "bd" into the Direct Command dialog when ++debugging gnuchess, without having xboard parse the clock display ++(starting with "White") as "White wins" and end the game. ++ ++* Changed moves.c to make a distinction between IllegalMove (where we ++could tell what move was intended, but it violates the chess rules) and ++MeaninglessMove (where we could not tell). This is a step towards getting ++rid of cases where we translate meaningless moves into "a1a1", but some ++work is probably needed to track them all down. ++ ++* Fixed bug in WinBoard monoMode dragging. ++ ++* Changed WinBoard to new style file dialogs. In the process, disabled ++the feature that let you enter the index number of a game or position within ++the file in the dialog. This is no loss in LoadGame, as you can pick your ++game from the game list dialog that follows, but it does remove some ++functionality from LoadPosition. ++ ++3.6.7 -- Mon May 18 21:25:00 PDT 1998 Tim Mann ++ ++xboard and WinBoard beta test release. I've been unable to reproduce some ++reported drawing bugs, so they may still not be fixed. ++ ++* Changed PopUpErrors option to PopupMoveErrors, which is more useful, and ++changed default to off. Errors other than move errors should always be in ++popups; they are often too big for the message area and too important to ++put where they can be easily missed. But it seems good to get rid of the ++popups for move errors by default. ++ ++* xboard analysis window no longer forces itself to top whenever there is ++new output. Also, now uses built-in Xaw word wrapping instead of trying ++to do its own; works better. ++ ++* Bugfix: Reset did not take Crafty out of analyze mode. ++ ++* A chess engine no longer has to claim to be Crafty to be able to use ++AnalysisMode and AnalyzeFile; it just has to implement the analyze ++command as Crafty does. Put in heuristics to generate more informative ++error messages if the engine does not support analyze, and checked that ++they work at least with GNU Chess. ++ ++* Added click-click moving, HighlightLastMove, and HighlightDragging to ++WinBoard. The highlight features are unlikely to go into xboard unless ++the xboard drawing code is cleaned up to do *all* drawing on the board ++from DrawPosition, as WinBoard does. This is low priority for me. ++ ++* Eliminated bogus "Error gathering move list: no header" popup. You ++could get this by observing two fast games at once without turning off ++GetMoveList. ++ ++* Disable WinBoard Sounds menu entirely in -ncp mode, since not even ++MoveSound is used in that mode. ++ ++* WinBoard bugfix: Several problems were caused if the user changed ++WinBoard's current directory in a Load, Save, or Browse dialog. In ++particular, WinBoard.ini would get saved in the wrong directory, and ++sound .wav file names would not get saved with a full pathname. I think ++all such problems are now fixed. ++ ++* WinBoard bugfix: iconizing the board after an aborted mouse resize would ++(partially) resize it to Tiny. ++ ++* WinBoard bugfix: board was not being drawn in color on 256-color ++displays. This bug was introduced in 3.6.6. ++ ++3.6.6 -- Tue May 12 17:43:43 PDT 1998 Tim Mann ++ ++xboard and WinBoard beta release. Note: not all reported bugs are fixed. ++ ++* Move animation in WinBoard, programmed by Henrik Gram. Great stuff! ++ ++* Animate backward moves too. ++ ++* xboard bugfix: -font (and friends) can now specify a font alias (such ++as "fixed"), not just a full X Consortium name pattern. Previously this ++would give a resource conversion error message. ++ ++* Some coding style cleanup in xboard.c. ++ ++* Earlier error check for moving wrong color piece in EditGame mode. ++ ++* Completed fix to pattern matching; see 3.6.5. ++ ++* Fixed some software rot bugs in Zippy. ++ ++* Split AnimateDragging as separate option from AnimateMoves. ++ ++* Added FlashMoves to options menu and -flash/-xflash to command line ++options (xboard only). ++ ++* Some preliminary work on visible bughouse holding support. Most of the ++code is not present in this release because I have not gotten it working ++properly yet; my first approach went down a blind alley and I had to ++remove most of the partially working code in preparation for a rewrite. ++ ++3.6.5 -- Fri May 8 14:22:09 PDT 1998 Tim Mann ++ ++Not generally released. ++ ++* Pack bughouse holdings display in banner more tightly when board is one ++of the smaller sizes (when smallLayout or tinyLayout is true, that is). ++An interim measure, but should help. ++ ++* Completed fix to make move list parsing recognize the end condition and ++final comment. ++ ++* Fixed pattern matching for chatter (tells, etc.) to be more reliable. ++This should reduce the incidence of colors starting in the wrong place and ++of incorrectly matching things that look like other patterns inside ++chatter, such as "shout <12>". (These errors were already rare.) ++ ++* WinBoard now lets you customize the list of ICS's in the startup dialog. ++For now, at least, requires editing WinBoard.ini with a text editor. ++ ++* Bug fix: WinBoard window sizing and position setting save/restore did ++not work right when the taskbar was at the top (or left side) of the ++screen and not in autohide mode. ++ ++* Merged xboard click/click mode and drag mode, and deleted ++ClickClickMoving option on menu. Now if you click on a piece, it ++highlights and a further click on another square will move it. (A second ++click on the same square takes down the highlight.) Or if you press down ++on a piece and start to drag, you can drag it to a new square. ++ ++* When making click/click style moves, if your second click is on a piece ++of the same color, instead of saying "Illegal move", we now cancel the first ++starting square, replace it with the second, and wait for another click to ++finish the move. ++ ++* Separate -secondInitString. Default: same as -initString. Suggested by ++Remi Coulom. ++ ++* Patch from Frank McIngvale to make animation work with XIMs. Yay! ++ ++* Changed move animation to happen after move is passed on to ICS or the ++chess engine, where applicable. Fixed problems with updating moveList ++that this uncovered. ++ ++* Changed game list to show PGN result token for each game. ++ ++* The usual minor bug fixes. ++ ++3.6.4 -- Thu Apr 30 23:14:43 PDT 1998 Tim Mann ++ ++xboard and WinBoard beta test release. ++ ++* xboard documentation updated, both man page and info file. An attempt ++to generate both from the same source with LinuxDocSGML was abandoned, at ++least for now. WinBoard doc updated too. ++ ++* Merged updates to animation code from Hugh. Fixed a couple of remaining ++bugs, mostly to do with handling Pause mode correctly. ++ ++* Added SaveSettingsOnExit to WinBoard. ++ ++* WinBoard now saves the last screen position of the Comment, Edit Tags, ++Game List, and Analysis windows (in addition to the board and ICS ++Interaction windows) in WinBoard.ini. ++ ++* WinBoard now provides a way to customize the right-button context menu ++in the output area of the ICS Interaction window. For now, requires ++editing WinBoard.ini with a text editor. ++ ++* Various minor fixes to ICS message recognition, most affecting only Zippy. ++ ++* Colorize the notification when someone sends you a message while you are ++logged in, not the output of the "messages" command. ++ ++* Fixed colorization to turn off at the right place more reliably. ++ ++* Added a new color and WinBoard sound for "requests": abort, adjourn, ++draw, pause, and takeback. The same color and sound are used for all of ++these. ++ ++* Added GUI to change sounds in WinBoard. ++ ++* Suppressed WinBoard error popup when a sound can't be played. They were ++popping up when two separate WinBoards tried to play a sound at the same ++time (such as during a bughouse match). ++ ++* Fixed WinBoard crash when a sound file didn't exist. ++ ++* WinBoard ports of timestamp and timeseal now produce decent error ++messages if they fail to connect, and WinBoard captures the messages and ++puts them into a popup. Previously WinBoard would exit with no message on ++such errors. ++ ++* WinBoard resizing with mouse improved; now accurately picks the largest ++size that fits in the new area. ++ ++* Added option to turn off error message popups. ++ ++* Added sizes slim, dinky, and teeny. ++ ++* Fixed some minor problems with error message wording. ++ ++3.6.3 -- Mon Feb 23 19:08:57 PST 1998 Tim Mann ++ ++xboard beta test release only. Man page is updated for the changes, but info ++file is not. ++ ++* Bug fix: LoadGame could not load a PGN game whose first move was ++castling (which is possible from setup positions). ++ ++* Bug fix: we were ignoring illegal move messages from chess engines in ++modes where the engine is refereeing but not participating (EditGame, ++LoadGame, AnalyzeFile). The problem was in a workaround for a Crafty bug, ++where Crafty generates a bogus illegal move message if a "." (used by ++the PeriodicUpdates feature) is sent in analysis mode when the current ++analysis reveals a forced mate. Installed a different workaround (that ++works in most but not all cases) and reported the Crafty bug. Bob Hyatt ++replied with a fix, so the Crafty bug should be gone in Crafty 14.12 or so. ++ ++* WinBoard only: enabled resizing board with the mouse. It snaps to the ++nearest (but not too much larger) predefined size. ++ ++* The xboard default font is now sized according to piece size, just as ++clockFont and coordFont have always been. ++ ++* Added more sizes: bulky, moderate, average, middling, mediocre, petite. ++ ++* xboard only: Added Animate Moves and Click-Click Moving to Options menu. ++ ++* xboard only: Added code to animate piece movement, from Hugh Fisher. ++ ++* New feature: autoflag is implemented in MachineWhite, MachineBlack, and ++TwoMachines modes. If it is on and either a chess program or the user ++oversteps his time, xboard will automatically call the flag and end the ++game. This feature was requested by someone who runs matches between ++programs and wants to penalize GNU Chess for its habit of running slightly ++over at the end of a time control. I personally think it's pointless. ++ ++* Fixed a bug in Zippy's pattern matching; he can now reply to ICC ++messages again. ++ ++* Generate prettier notation for illegal moves. If a move is illegal only ++because it leaves the player in check, generate notation as if that were ++not illegal. For instance, if two knights are a knight's move away from ++f3, one on g1 and one on e5 that is pinned, the notation would be Nf3 to ++move the g1 knight, Nef3 to move the e5 knight. (Suggested by Philippe ++Schnoebelen.) In addition, if a move is illegal because the type of piece ++moved cannot go that way, would be jumping over another piece, etc., we ++give fully disambiguated coordinate notation; for example, Ng1g3, Ke1xe8, ++d2xd8=Q, etc. An alternative would be to still write Ng3 if there is only ++one knight on the board, or Ngg3 if the other knight is not on the g file, ++but life is too short to code up all this stuff, and perhaps the way I did ++it is better as it emphasizes that this move was really made despite being ++illegal. I wonder if the new PGN standard revision will speak to notation ++of illegal moves? ++ ++* Fixed gross bug from 3.6.2: if a chess program said "checkmate" and ++White was left on move, the PGN outcome was "1-0 {Black mates}" instead ++of "0-1 {Black mates}"! The bug occurred only for that specific string. ++ ++3.6.2 -- Wed Jul 23 16:47:29 PDT 1997 Tim Mann ++ ++* There was a bug in backing up from the end of a game against a chess ++engine, introduced when -reuse mode was added. Fixed. ++ ++* Recognize "{" as terminating an ICS move list. Previously we needed to ++see a prompt (containing %), but occasionally ICC can send more stuff ++right after a move list with no prompt in between. ++ ++* In WinBoard, -mm now implies -cp, so you don't get the startup dialog. ++ ++* WinBoard startup dialog no longer sets -scp. People used to get ++confused because they would give the -fcp and -scp arguments, but omit ++-cp. This would bring up the startup dialog, which would set both -fcp ++and -scp to the value in the engine name box. Now you can change -scp ++only with the command-line argument. That will confuse some people too, ++but hopefully fewer. I think overall it's better than putting spaces for ++both -fcp and -scp in the dialog, which would puzzle newbies. ++ ++* Bug fix: Analyze File mode now works in WinBoard. ++ ++* Bug fix: WinBoard window no longer cuts off part of the bottom row if ++the menu bar wraps to a second line. ++ ++* Accept game end messages of the form "PGN-result {comment}" from the ++chess engine, where PGN-result is 0-1, 1-0, or 1/2-1/2. Accept "resign" ++or "computer resigns" from the chess engine as a synonym for "0-1 {White ++resigns}" or "1-0 {Black resigns}". Accept any message from the chess ++engine containing "game is a draw" as a synonym for "1/2-1/2 {Draw}". ++Accept "White resigns" or "Black resigns". ++ ++* Enable "Action / Draw" menu item in chess engine mode. It sends the ++command "draw" to the engine. Accept any message from the chess engine ++containing "offers a draw" as a draw offer. WARNING: Draw offers from the ++user and the engine (or from two engines) are not yet matched up by xboard ++in chess engine mode. Two engines could get into a loop offering each ++other draws. ++ ++* Bug fix: Game end messages from the chess engine are always ignored in ++Zippy mode. Previously they could sometimes be processed, which was ++sometimes making Zippy hang at the start of a new game that followed ++quickly after an old one. ++ ++* Zippy can now respond to titled players in channels. Zippy will avoid ++talking to himself in a channel if he knows his own name. ++ ++* Bug fix: in colorization arguments, the bold setting was being ignored ++if the background color was defaulted. (xboard only.) ++ ++* Extended ParseFEN to accept Crafty 12.2's interpretation of FEN. ++If fewer than 8 squares are given in a row, or fewer than 8 rows are ++given, the uncovered squares are empty. Also, there can be a / after the ++8th row. ++ ++3.6.1 -- Sat May 17 01:02:33 PDT 1997 Tim Mann ++ ++* Bug fix: Hitting escape while entering a password on WinBoard no longer ++sets the font color back to black (which made further typing visible). ++ ++* Bug fix: On Windows NT 4.0, WinBoard /ics /icshelper=timestamp would ++often hang if you tried to exit with the Exit menu item, the [X] button, ++etc. The same fix may also have corrected the problem where running a ++chess program with /xreuse would sometimes crash Windows 95 (but not NT) ++when the chess program was killed and quickly restarted. ++ ++* Bug fix: Periodic Updates would not work if turned on after having been ++off. Also, the default was needlessly "off" in WinBoard. ++ ++* Zippy bug fix: Continuing an adjourned game was totally broken. The ++wrong moves, or no moves at all, were being fed to the chess program. ++ ++* WinBoard change: Giving -ics without -icshost now pops up the startup ++dialog with "Use an Internet Chess Server" pre-selected, so that you get a ++menu of chess servers instead of going directly to ICC. ++ ++* Bug fix: WinBoard's SaveSettings was saving -icshost, -icsport, and ++-icshelper in winboard.ini. This causes a problem if you use a different ++icshost later that needs the default values for icsport (5000) and ++icshelper ("", meaning none). ++ ++* Disabled complaints about unexpected "[Ii]llegal move" messages from ++the chess program; we still get them at times. ++ ++* Greatly simplified the code for Move Now and SIGINT (ATTENTION). Fixes ++the bug where Move Now did not work with GNU Chess in WinBoard, and ++several more obscure bugs as well. Reintroduces a minor bug: GNU Chess might ++not think on your time after a Move Now command. Trying to fix this ++causes too many other problems. Documented change in engine-intf.txt. ++ ++* Cleaned up code for obtaining ratings from ICS. It was kludgey and may ++have had bugs on systems with no "Creating:" message. It should fail ++gracefully there, just not finding the ratings. ++ ++3.6.0 -- Thu May 8 19:55:58 PDT 1997 Tim Mann ++ ++* WinBoard now has right-button context menus in the ICS Interaction ++window. Some of the items do immediate commands on the player name you ++have selected or pointed to. (Suggested by Paolo Casaschi.) Also, the ++middle button or shift+right does a immediate Copy and Paste. ++ ++* Fixed a bug in Zippy's wild rejection. The bug was causing Zippy to ++reject all forms of wild. Now it rejects only 1, 9, 16, 17, and 24, as ++was intended. These variants have different rules, while the other ++variants defined so far only have different starting positions. ++(Actually, wild 2, 3, and 4 never allow castling, but may sometimes by ++chance have king and rook start on squares where castling appears legal. ++This could cause a problem later.) ++ ++* Zippy now resumes adjourned games by feeding the chess program ++the move list instead of the position. Setting -getMoveList to False ++restores the old behavior. Feeding in the move list is better because ++it enables the chess program to correctly handle en passant legality, ++castling legality, draw by repetition, and draw by the 50 move rule. ++ ++* Added a WinBoard startup dialog for people who run WinBoard.exe without ++using the Start menu or reading the help file. Instead of being dumped ++directly into GNU Chess mode, you now get a menu of choices. You now have ++to give the new WinBoard -cp option to go directly into chess engine mode. ++I did not add this feature to xboard. ++ ++* Handling of "illegal move" from Crafty is now back on. (It was turned ++off in 3.4.6; see below.) Crafty 12.0 doesn't seem to send bogus ones ++anymore. I did have to suppress sending time and otim in analyze mode to ++make this work, but there is no harm in that. ++ ++* Zippy now sends "gameend" to ICS at the end of each game. You can alias ++this to "seek" or whatever you like. ++ ++* Added Crafty support for Move Now, using the "?" command. We test ++whether this command exists by trying it once at the start of the first ++game, before it really makes sense. If we don't get a message like ++"Illegal move ... ?", we assume it's OK. (We're careful about this ++because sending a "?" to GNU Chess on Move Now keeps it from pondering the ++next move as it should.) ++ ++* Added support for a tellusererror command from the chess engine. See ++engine-intf.txt. ++ ++* Attempted to make engine-intf.txt complete. ++ ++* Minor fixes/cleanup to GameEnds code, to be sure we always interrupt ++when needed, and always undo an extra move generated by stopping the chess ++program while it is thinking. ++ ++3.5.7 -- Sat May 03 22:37:44 PDT 1997 Tim Mann ++ ++Beta release of both xboard and WinBoard. ++ ++* Updated xboard documentation. I really wish the man page was built from ++the info file instead of being separate! It's a pain to update them both. ++ ++* Updated documentation of the interface between XBoard/WinBoard and chess ++programs, and renamed it to engine-intf.txt. ++ ++* Added support for tellics, telluser, and askuser commands from the chess ++engine. See engine-intf.txt. ++ ++* Various bug fixes. On WinBoard, 256 color displays are finally handled ++right; no more color flashing when you switch windows unless the colors ++really need to be updated. Also, I think the problem of the console font ++failing to change or changing back by itself is finally fixed. ++ ++3.5.6 -- Tue Apr 29 03:08:00 PDT 1997 ++ ++Beta release, WinBoard only. ChangeLog was out of date in release, ++updated here. ++ ++* Added ICC timestamp and FICS timeseal to WinBoard distribution. These ++are my own ports to Win32, based on and used by permission of the owners ++of the proprietary source code (Daniel Sleator for timestamp, Henrik Gram ++for timeseal). The owners permit these programs to be distributed only in ++binary form (to help prevent cheating), so to avoid running afoul of the ++GPL, I have kept them as separate programs, not linked into the WinBoard ++address space. Updated Start menu icons to use them. ++ ++* Miscellaneous smaller changes. ++ ++3.5.5 -- Fri Apr 25 03:06:00 PDT 1997 ++ ++Beta release, WinBoard only. ChangeLog was out of date in release; ++updated here. ++ ++* Added simple sound support to WinBoard. ++ ++* Updated WinBoard documentation. ++ ++* Internal implementation of the telnet protocol is now more complete. ++You can now hop through a VMS host on the way to ICS. For example, do ++"xboard -ics -icshost vms.host.edu -icsport 23", then log in. Do not use ++the -telnet flag; that says to use an *external* telnet program. To avoid ++double echoes, you need to force character mode in VMS telnet after ++connecting from VMS to ICS. Do "^]^Mset mode char^M^M". ++ ++* Display opponent names in the title bar for MachineWhite, MachineBlack, ++and TwoMachines modes. ++ ++* WinBoard now has an installer, built with InstallShield. The installer ++works with a binary-only distribution. Sources are still freely ++available, but now separately. ++ ++* Added SaveSettings to WinBoard, which saves current option settings to ++winboard.ini. Made sure all options can be saved and loaded, including ++fonts and com port settings. ++ ++* If the game ends while you are dragging a piece, we now don't let you ++finish the move. Formerly the move was accepted and your opponent's clock ++would start running again. ++ ++3.5.4 -- Fri Apr 18 01:15:24 PDT 1997 Tim Mann ++ ++Beta test release of WinBoard and xboard. The documentation remains ++out of date. ++ ++* Many fixes and improvements to new WinBoard user interface code. ++ ++* In Zippy mode, avoid sending another copy of the same move to the chess ++program if ICS sends us another copy of the board image. Hard to believe ++it took me until now to diagnose and fix this problem! ++ ++3.5.3 -- Sat Apr 12 19:49:33 PDT 1997 Tim Mann ++ ++Beta test release of WinBoard and xboard. ++ ++* Fixed fatal bug in WinBoard input handling. ++ ++* Made code to stop chess program for reuse a bit smarter. Removed kludge ++of "white" in initString; it didn't work well, and is unneeded ++with Crafty 11.21 and later. ++ ++3.5.2 -- Sat Apr 12 15:40:01 PDT 1997 Tim Mann ++ ++Beta test release of WinBoard. ++ ++* Ignore check and permit promotion to King during suicide games; no need ++to turn off TestLegality. ++ ++* Renamed CheckLegality to TestLegality to avoid confusion with the chess ++term "check". ++ ++* Added Rematch to Action menu. ++ ++* WinBoard now has a custom ICS interaction window with scrollback, a ++separate line for input, and colorization. Accelerators that conflict ++with normal editing keys were changed (by requiring Alt+) so they can work ++in both the console and the main window. ++ ++* WinBoard error popups are now non-modal and disappear when you make a ++new move, as in xboard. ++ ++* Configure now defaults to --disable-ptys on all systems. If anyone has ++an ancient SysV system where pipes don't work with select, they can still ++do "configure --enable-ptys" explicitly. I would appreciate getting a bug ++report if this happens to anyone, with complete output from configure and ++"uname -a". ++ ++* "make install" now makes the installation directories too. ++ ++* Fixed a bug that would cause an "Illegal move" message for Black from ++GNU Chess to be incorrectly considered bogus. ++ ++* Handle name changes during an ICS game (FICS bname and wname commands). ++ ++* You can force both chess programs to be killed at the end of each game ++by turning off the reuseChessPrograms option. There are still some ++problems with reusing Crafty even in version 11.20. ++ ++* Now the second chess program stays around by default too, if it ever ++gets started. ++ ++3.5.1 -- Sat Apr 5 16:47:48 PST 1997 Tim Mann ++ ++Beta test release. ++ ++* Don't kill off and restart the chess program for each game; keep the ++same one running, using the "new" command to start a new game. This ++change works around the problem in Windows 95 that makes WinBoard crash it ++at times, and is generally desirable to make new games start faster. The ++second chess program (for TwoMachines) is still killed at the end of the ++game, and unfortunately this can still crash Windows 95. Temporarily ++added "white" to the initString to make this work with Crafty 11.20, which ++has a minor bug in "new". Older versions of Crafty have worse bugs in ++"new"; they should not be used with this version of xboard. ++ ++* Support for FICS suicide chess: Parse illegal moves (that leave King in ++check) in game history. If CheckLegality is off, allow promotion to King ++and illegal moves in game files. We still generate e2e4 style notation ++for illegal moves. ++ ++* Handle FICS "has timeseal; checking" message. ++ ++* Changed the coords from white back to black; this was a bug. ++ ++* Fixed problems compiling with K&R compilers. ++ ++* Fixed an old bug in RegisterMove that was crashing cmail on some systems ++(notably linux). ++ ++3.5.0 -- Thu Jan 2 16:59:49 PST 1997 Tim Mann ++ ++Thanks to Frank McIngvale for much of the work on versions 3.4.4 and above! ++ ++* Fix Crafty resumed game time bug (frankm) ++ ++* Word wrap text in Analysis window (frankm) ++ ++* More debug info for XPM loading (frankm) ++ ++* Replaced config.sub, config.guess, etc., with up-to-date versions from ++autoconf 2.12. Hopefully this will fix problems on Pentium Pro machines. ++ ++* Removed some Makefile gunk that was causing looping for one person. ++ ++3.4.7 -- Thu Dec 19 14:22:41 PST 1996 Tim Mann ++ ++All changes from Frank: ++ ++* Retrieve ratings from ICC (and FICS, etc., when they add the Creating: ++message), save them in the PGN tags, and pass them to Crafty in Zippy mode. ++ ++* Add settable time delay between characters in ICS login script. ++ ++* Colorize messages like personal tells. Fix false recognition of channel ++tells. ++ ++* Pass "tells" from Crafty through to ICS (in Zippy mode). ++ ++* Implement ~/ filename convention from C shell for game and position file ++names. ++ ++* ZIPPYACCEPTONLY feature for testing. ++ ++3.4, patchlevel 6 -- Sat Nov 23 16:58:50 PST 1996 Tim Mann ++ ++* Put recognition of "illegal move" messages from Crafty for ++illegal castling, etc., inside an #if that is currently turned off, ++because of a bug in Crafty that generates bogus "illegal move" messages ++after some moves that are actually legal and accepted by Crafty. ++ ++* Added -checkLegality option; previously this could not be turned off. ++ ++* Fixed an old bug in finding default board size parameters. ++ ++* Differentiated among channel tell, kibitz/whisper, and personal tell/say. ++ ++* Fixed a bug in detecting Xpm in the configure script. ++ ++3.4, patchlevel 5 -- Mon Nov 18 16:22:53 PST 1996 Tim Mann ++ ++* Added zic2xpm to the kit; it had been omitted by mistake. ++ ++* Added some default colors for -colorize ++ ++3.4, patchlevel 4 -- Sat Nov 16 18:10:17 PST 1996 Tim Mann ++ ++This is meant to be a beta release in preparation for version 3.5. ++ ++* Added InfoXBoard and ManXBoard to the Help menu. ++ ++* Made Frank's ICS input box optional, defaulting to off. ++ ++* Merged in Frank McIngvale's XbKit. Many new features, including ++-clickClick mode, the Analysis modes, piece flashing, ZIICS import, ++ICS text colorization, and the ICS input box. Many thanks to Frank for ++supplying and documenting this code. ++ ++3.4, patchlevel 3 -- Mon Nov 11 18:23:14 PST 1996 Tim Mann ++ ++Small set of changes made while Frank McIngvale was working on XbKit in ++parallel. Unreleased in this form. ++ ++* Updated zippy.README. ++ ++* Removed useless X event handler and removed strange code for copying ++form translation table to board that worked around the bug it caused. ++This makes changing bindings in .Xdefaults more straightforward. ++ ++* Now pressing the Control key steps back one move, and releasing it steps ++forward again. ++ ++* Moved quit from "q" to "Q" for greater safety. ++ ++* Use "unobserve" instead of "observe" to stop observing; needed on FICS. ++ ++* Support for interface variable. ++ ++* Strip titles from people who are talking to us, so (for example) Zippy ++won't try things like "tell Darooha(*) hello". Needed on FICS. ++ ++3.4, patchlevel 2 -- Tue Jul 9 19:06:42 PDT 1996 Tim Mann ++ ++This patchlevel is not planned to be an announced release. It's in ++preparation for integrating Frank McIngvale's XbKit. It mostly contains ++minor fixes I've accumulated since 3.4.pl1. ++ ++* WinBoard /telnet option now fires up an external program, as ++with xboard, instead of trying to use a feature of NT 3.1 that does not ++exist in later versions of NT or in Windows 95. ChangeLog for 3.4.pl1 ++said this had been implemented there, but it really wasn't. ++ ++* Indicating player to move by the icon color now works under Windows 95. ++ ++* WinBoard now kills the chess program when you exit using the system menu ++or the [X] button. Thanks to Michael Lowe. ++ ++* Minor changes to Zippy, including: Now understands wild challenges on ++FICS; these used to crash it. Removed limit on how fast a game will be ++accepted. Use "set formula ..." on the chess server to limit this if you ++are using GNU Chess. Now sends correct opponent name to Crafty. ++ ++* Added some missing default values to documentation. Thanks to Stuart ++Cracraft. ++ ++* Bugfix: Trying to print "No fonts match pattern" error message would ++crash. This can happen to Linux users who don't install Helvetica, for ++example. ++ ++* Bugfix: Defaulting feature in -size n,n,n,n,n,n would put us in an ++infinite loop. ++ ++* Added more directories to search for Athena widgets on HPUX. ++ ++* New cmail (3.12) from Evan Welsh; includes small fix from Kayvan Sylvan. ++ ++* Recognize "illegal move" messages from Crafty for illegal castling, etc. ++ ++* Bugfix: "name" command added to zippy.c for Crafty was producing error ++message if GNU Chess was in use. ++ ++* In bughouse mode, suppress holding messages from console window; show ++holdings only in banner. ++ ++* Minor fixes/cleanup to Makefile.in and configure.in. ++ ++3.4, patchlevel 1 -- Mon Dec 11 13:43:12 PST 1995 Tim Mann ++ ++* This patchlevel updates WinBoard to match xboard, and includes a few ++fixes and minor improvements. "-size tiny" and "-size n,n,n,n,n,n" ++are still not implemented for WinBoard. ++ ++* Installed support for Crafty based on code from Bob Hyatt. ++Currently the only documentation for this is in the FAQ, and a few ++things don't work with Crafty 8.23. Please do not report these ++problems as bugs in either xboard or Crafty. Bob and I know about ++them. The worst ones (if not all of them) should be fixed in Crafty ++8.24. ++ ++* Changed the kludge command we send when gnuchess wants to print ++something that doesn't end with a newline, from "help" to "bogus". ++This works because the error message gnuchess prints ends with a ++newline. It also improves compatibility with Crafty, which doesn't ++need the kludge, but for which sending "help" causes a problem. ++ ++* Don't draw grid at all if lineGap is 0; previously we drew the grid ++with X "0-width" lines (usually 1 pixel wide) and then overwrote it. ++ ++* Makefile: Removed xboard.info from "all" target so we won't try to ++rebuild it, because this fails on hosts that don't have makeinfo ++installed. Other minor fixes to "clean" targets, etc. ++ ++* Fixes and cleanup to Auto Comment code that handles continuation ++lines and highlighting. ++ ++* Auto Observe now tries to observe the game from the point of view of ++the player who was on your gnotify list. Requested by rng. ++Limitations: We can't tell which player it was unless you have ICS ++highlighting turned on. Also, currently "observe foo" works as ++required (observing from foo's point of view) only on ICC, but FICS ++will probably implement this soon. ++ ++* "-size tiny" now makes the default font smaller automatically. This ++was implemented by introducing an extra Form widget in the hierarchy ++for all xboard windows, named either normalLayout, smallLayout, or ++tinyLayout. So you can have resource specifications that apply only ++to certain layouts; in particular, XBoard*tinyLayout*font. ++ ++* Bug fix: EditGame or EditPosition while playing or examining still was ++not really being permitted. ++ ++* WinBoard bug fix: On the EditPosition menu, King did not work. ++ ++* Added text catalog of WinSock error messages to WinBoard, because ++Microsoft still has not put them in the system message catalog. ++ ++* Removed support for older ICS game-ending messages that do not have ++a PGN result token (*, 0-1, 1-0, or 1/2-1/2) after the closing '}'. ++The code for older messages was sometimes firing on the newer ++messages, due to parsing ambiguity. If the current code sees an old ++message, it will understand that the game is over, but will always ++display * as a result token instead of trying to guess the result by ++interpreting the text message. ++ ++3.4, patchlevel 0 -- Tue Nov 21 01:02:50 PST 1995 Tim Mann ++ ++* This patchlevel was released for xboard only. ++ ++* Updated the info file. It should now be as up-to-date as the man page, ++with good English except in the parts that pertain only to AmyBoard. ++ ++* Added "-size tiny", requested by Bob Hyatt. Also cleaned up bitmap ++support and added "-size n,n,n,n,n,n" to allow arbitrary-sized bitmaps, ++if the actual bitmaps are supplied by the user. ++ ++* Updated bughouse support. ++ ++3.3, patchlevel 4 -- Sat Nov 18 02:27:21 PST 1995 Tim Mann ++ ++* Unreleased beta that works with preliminary FICS bughouse code. Will ++need changes before release to track FICS message changes. ++ ++* Removed use of .EX macro from man page. It is not supported by some ++nroff -man macro packages, notably the one on Slackware Linux. Switched ++to boldface for references to xboard and other commands within the man ++page, as this seems to be the modern way. ++ ++* Bug fix: If ICS rejected a move, it was correctly undone on the board, ++but the message widget still displayed the bad move. Reported by DAV. ++ ++* Normally, xboard in ICS mode fetches the move list whenever the board ++display switches to a new game. Doing this is now an option ++(getMoveList) that can be turned off, which is useful if you are watching ++multiple blitz games. Requested by rng. ++ ++* Move list fetching code is now smarter: it ignores a move list if it is ++not for the right game. ++ ++* Added support for bughouse as implemented on FICS. Holdings are shown ++in the window title in place of the strength numbers. A menu on mouse ++buttons 2 and 3 (same on both) lets you drop pieces. There is no checking ++as to whether you actually hold the piece you are trying to drop; we rely ++on ICS to check that. Notation of the form P@f7 is generated and parsed. ++The mate detector does not understand that non-contact mate is not really ++mate in bughouse, but this does no real harm. It results in a "#" ++suffix being displayed on the move notation, but xboard does not assume the ++game is over. ++ ++* Bug fix: Promotion to a knight was not working with ICC! Thanks to ++Wendigo for the report. ++ ++* Bug fix: Special pty code for host types *-*-aix3* and *-*-irix3* ++(supplied from configure.in) had a bug that would cause childio.c to ++fail to compile, due to a "continue" that was not within a loop. ++ ++* Bug fix: In pgntags.c, memory was being freed while still in use. One ++symptom this caused was that on some machines, cmail would fail with a ++message that it could not find the BlackNA tag. The error was in some ++submitted code that I included in version 3.2.pl3 without reading ++carefully enough. Anders Forberg noticed the symptoms, and Evan Welsh ++(who had nothing to do with causing the bug) found the bug and submitted a ++fix; thanks to them both. ++ ++* Removed restriction against using EditGame while playing, observing, ++or examining on ICS. You still get a warning popup. ++ ++3.3, patchlevel 3 -- Sat Sep 16 11:44:05 PDT 1995 Tim Mann ++ ++* Bug fix: Going directly from MachineWhite to TwoMachines mode would kill ++off the second chess program after Black's first move. ++ ++* Added -timeIncrement feature. Thanks to Joel Rivat. ++ ++* Deleted code that tries to keep you from observing more than one game, ++or observing while playing or examining. There is actually no problem in ++doing this, except that every time an update comes in from a different ++game than is currently being displayed, xboard fetches the history of the ++new game, which may be time-consuming if you are on a slow link. ++ ++* Fixed configure so as not to crash when neither lex nor flex is found. ++lex or flex is needed only if the user wants to rebuild parser.c. Thanks ++to Phil Humpherys for reporting the crash. ++ ++* Bug fix: config.h.in used #define instead of #undef for some macros used ++in the pty code in childio.c. This causes the code to fail to compile on ++some architectures, because the symbols are supposed to be undefined, not ++defined to empty, when they are not set in configure. Bug originated in ++3.3.pl0 when config.h was introduced. Thanks to Phil Humpherys for report. ++ ++* Bug fix: ShowThinking would not show anything when current position had ++no move to display in the move window. E.g., if position was created by ++LoadPosition or EditPosition. ++ ++3.3, patchlevel 2 -- Mon Aug 28 11:11:11 PDT 1995 Tim Mann ++ ++* Zippy code was omitted from xboard-3.3.pl1 by mistake; now included. ++ ++* For WinBoard, added hint to help file that you may need to turn off ++LocalLineEditing while typing dialing commands to your modem. ++ ++3.3, patchlevel 1 -- Sat Aug 19 15:13:30 PDT 1995 Tim Mann ++ ++* Zippy distribution is no longer separate from regular xboard distribution. ++ ++* Deal properly with Show Thinking output from GNU Chess when it is ++thinking on its opponent's time. In TwoMachines mode this output is ++suppressed to avoid interfering with the output from the machine that is ++on move; in other modes it is displayed (including the move that GNU Chess ++is predicting the user will make next). GNU Chess produces this output ++only if it is built without -DQUIETBACKGROUND defined; this symbol is ++defined by default in patchlevels before pl75, but undefined by default in ++pl75. ++ ++* Bug fix: Handling of initial board position in move list for wild games ++was broken, so wild games could not be observed and adjourned wild games ++could not be continued. Thanks to "Maximum Entropy" for the bug report. ++ ++* Added feature: algebraic notation now shows "+" indicator for check ++and "#" for checkmate, as called for in PGN standard. Thanks to Kevin ++Maher for the suggestion. ++ ++3.3, patchlevel 0 -- Thu Jul 27 22:21:07 PDT 1995 Tim Mann ++ ++* Changed configuration to use a config.h file instead of passing zillions ++of -D options on the cc command line. ++ ++* Merged a small fix and some updates to the texinfo file from Jochen ++Wiedmann. The texinfo file still needs work. ++ ++3.2, patchlevel 5 -- Tue Jul 18 20:29:39 PDT 1995 Tim Mann ++ ++* Beta test release of xboard only. ++ ++* Updated WinBoard code to include new xboard features. ++ ++* Added texinfo file from Jochen Wiedmann to the release, but not as the ++primary documentation. It needs updating, and the English needs work. ++I did make a few improvements, mostly to change incorrect uses of @var to ++either @samp or @code as appropriate. ++ ++* Merged in code changes to 3.2.pl4beta from Jochen Wiedmann. ++ ++* Fixed EditComment; did not pop up window in previous beta. ++ ++* Added AutoComment feature. ++ ++* Added GameListDestroy to disable the outdated game list popup in cases ++where we load a new game file without building a new popup. ++ ++* Added yyskipmoves feature to parser.l to speed up building of gamelist. ++ ++* gamelist.c wouldn't compile with a non-ANSI compiler. Fixed. ++ ++* Change to yy_text handling in patchlevel 3 still had problems. Can't ++use AC_DECL_YYTEXT in configure.in, because that defines YYTEXT_POINTER ++according to whether the lexer on the current host makes yytext a pointer. ++But most people will be using a parser.c that was generated on another ++host and shipped with the package. ++ ++3.2, patchlevel 4 -- Sun Jun 25 19:13:43 PDT 1995 Tim Mann ++ ++* Beta test release of xboard only. ++ ++* Added FIREWALLS section to man page. ++ ++* Changed -icsport to be a string. Now with the -telnet option, ++specifying -icsport "" suppresses the second argument to telnet. ++ ++* Added EditTags feature. Removed AboutGame from menu, because EditTags ++subsumes it. EditTags suggested by Jochen Wiedmann and first implemented by ++him in AmyBoard. xboard implementation is my own. ++ ++* Fixed some missing or incorrect prototypes. ++ ++3.2, patchlevel 3 -- Sat Jun 3 18:57:38 1995 Tim Mann ++ ++* Beta test release of xboard only. ++ ++* New version of cmail from Evan Welsh, to fix compatibility problems with ++perl 5.0. ++ ++* Added game list feature on Load Game, based on code from Jochen ++Wiedmann. Integrated it with cmail. ++ ++* Several bug fixes from Jochen Wiedmann, including one to my yy_text ++workaround for the difference in the type of yytext between lex and flex. ++ ++* Handle clock pause on FICS. ++ ++* Suppress clocks in untimed FICS games (time control 0 0). ++ ++* Rebuilt configure script with autoconf 2.3. This fixes a bug in ++configuring for X11R6, where -lSM -lICE would not be added when needed. ++ ++* Fixed inconsistent type declarations on IntSigHandler and ++CmailSigHandler. Bug report from Josh Daynard. ++ ++* backend.c wouldn't compile with a non-ANSI compiler. Fixed. ++ ++3.2, patchlevel 2 -- Tue Feb 7 14:50:30 1995 Tim Mann ++ ++* Minor release of both xboard and WinBoard. ++ ++* Added recognition of some FICS messages. On the other hand FICS is also ++changing some of its messages to match what xboard already recognizes. ++ ++* Temporarily went back to using "promote" command on ICS instead of ++"a7a8=Q", because FICS doesn't implement the latter yet. ++ ++* We now avoid using overlapped I/O on pipes in WinBoard, to make Windows ++95 beta 2 happy. This lets WinBoard work with GNU Chess on Windows 95! ++ ++* Installed patches from Jochen Wiedmann to coordinate with Amiga XBoard. ++ ++* Installed patch to cmail bug in LoadGame from Evan Welsh. ++ ++* Bugfix: checkmate and stalemate moves entered with EditGame in ICS mode ++were not being handled correctly. Bug was in GameEnds(). ++ ++* Implemented EchoOn and EchoOff for xboard, using system("stty echo\n"). ++Now passwords won't be echoed when you connect directly to ICS. Also, ++telnet negotiation characters aren't displayed (when possible). ++ ++* Implemented more of the telnet protocol. Now connecting to a telnet ++server with "-icsport 23" should work even without giving the -telnet ++option. The telnet is in "old line-by-line mode". ++ ++3.2, patchlevel 1 -- Sat Dec 10 13:50:46 1994 Tim Mann ++ ++* This patchlevel released for WinBoard only. ++ ++* winboard.c: Fixed ConsoleInputThread(). Needed to change CRLF to LF, ++not to CR. This was stopping normal /ics mode from working. Thanks to ++Asher Kobin for the bug report. ++ ++* winboard.c: Fixed Raw(), EchoOn(), EchoOff(). Now they take effect ++immediately, not on the next console read after the one in progress. ++ ++* winboard.c: Attempted to make WinBoard work with gnuchessx running ++directly on Windows (not remotely via rsh). It now works on NT, but only ++if gnuchess is told not to think on its opponent's time ("easy\n" removed ++from initString). The problem seems to be that GenerateConsoleCtrlEvent ++is not doing anything. On Windows 95 beta 2, we get error messages on ++both reading and writing to gnuchessx; I didn't investigate why. ++ ++3.2, patchlevel 0 -- Wed Dec 7 13:23:36 1994 Tim Mann ++ ++* Thanks to all the beta testers who gave me feedback: Josef Nelissen, ++Steve Booth, Evan Welsh, Dima Dakhnovsky, Chris Petroff, Peter Jansen, ++Derek Terveer, Michel van der List, Richard Lloyd, Shelly Mistry, and Mike ++Lee. Sorry if I forgot anyone. Thanks to Virendra Kumar Mehta for ++information about DYNIX/ptx. ++ ++* Don't exit on keyboard EOF unless we get two in a row. ++ ++* WinBoard only: added -localLineEdit switch to allow turning off local ++line editing if you really want to. It is still a bad idea to let the ++echoing be done remotely, however; see below. ++ ++* Fixed some configure problems on HP-UX. [Steve Booth] ++ ++* Fixed (I hope) configure problem on SunOS 5.3/Solaris 2.3. [Josef Nelissen] ++ ++* cmail bugfix from Evan Welsh (cmail 3.4). ++ ++3.1, patchlevel 9 -- Fri Dec 2 23:54:56 1994 Tim Mann ++ ++* Beta distribution only ++ ++* Always do local echo/edit of user typing in ICS mode. Doing the echo ++downstream may seem nicer in some modes, and it can be hard to turn that ++echo off, but the echoed characters can be interleaved with ICS output ++and make it impossible to parse correctly. For xboard this involved only ++a change to recommendations in the man page, as Raw() isn't implemented. ++For WinBoard, removing Raw() made a real difference. Added code in ++WinBoard to change /r/n back into /r on keyboard input, as we get the ++former when Raw() is not called. ++ ++* Do not issue ICS "refresh" command after we start to observe a game ++unless we get to the next prompt without seeing a board image. Newest ++version of ICS doesn't require this refresh, but old versions around still ++do. ++ ++* cmail bugfix and small code cleanup in LoadGame, from Evan Welsh. ++ ++* Added keyboard accelerators N/P for LoadNextGame/LoadPreviousGame. Evan ++Welsh request. ++ ++* Using "-" on the command line as a filename for loading (saving) games ++or positions specifies the standard input (standard output). Alain Picard ++suggestion. ++ ++* On WinBoard only, a command line option without a leading '-' or '/' is ++now taken as the value of -lgf. ++ ++* Changed to not use stdin, stdout, stderr as initializers in backend.c; ++needed for GNU libc compatibility. You also must build parser.c with flex ++(not lex) if you are using GNU libc, to avoid having the same problem ++there. ++ ++* Changed WinBoard to avoid using "overlapped" input on the console. It ++now seems to fully work on Windows 95 beta 2. ++ ++* Improved comment popups on WinBoard. Now newlines are handled properly, ++and the plain Comment popup window doesn't disappear and reappear when we ++step to a new move with a new comment. ++ ++* Fixed bugs in detecting the absence of the time and otim commands. ++ ++* Added built-in implementation of rcmd protocol to WinBoard. Windows NT ++does not implement passing signals through rsh, and Windows 95 does not ++have rsh at all. ++ ++* Added -remoteUser option. ++ ++3.1, patchlevel 8 -- Mon Nov 28 15:26:07 1994 Tim Mann ++ ++* Beta distribution only ++ ++* Rearranged ChangeLog file into reverse chronological order to be closer ++to GNU standards. ++ ++* Integrated new cmail code from Evan Welsh (including cmail RCS rev 3.2). ++Includes a bug fix to TruncateGame. ++ ++* Updated ICS address to be chess.lm.com. ++ ++* Bug fixes to handling the aftermath of FatalError. Thanks to Chris ++Petroff for the bug report. ++ ++* Test for remsh before rsh, other fixes for HP-UX. Thanks to Richard ++Lloyd. I wasn't able to do all the things he suggested, so there may ++still be some rough edges in building on HP-UX. See the FAQ file for hints. ++ ++* Bug fix; added missing check for HAVE_SYS_SYSTEMINFO. Thanks to Josef ++Nelissen for testing on Solaris 2.x. ++ ++* Updated WinBoard to match xboard. (WinBoard still has a few option ++dialogs that don't exist in xboard.) ++ ++* Changed Hint output to a popup. ++ ++* ShowThinking output and move output no longer overwrite each other. ++ShowThinking output won't appear if the displayed position is not current. ++ShowThinking output in TwoMachines mode made clearer and documented. ++ ++* Implemented --enable-ptys and --disable-ptys arguments to configure. ++ ++* Fixed Book and Hint code to work over a pty with echo enabled and tabs ++expanded to spaces. Thanks to Dima Dahknovsky for the bug report. ++ ++* Moved Attention calls from all over xboard to one place, inside ++SendToProgram. ++ ++* Added bulletproofing to ShowThinkingEvent. ++ ++* Added code to handle "refresh N" boards that come in from ICS properly, ++assuming ICS is changed to mark them with a new relation code (-3). ++ ++3.1, patchlevel 7 -- Sun Nov 13 22:16:01 PST 1994 -- Tim Mann ++ ++* Beta distribution only ++ ++* Changed ShowThinking to just show the current best line in the ++DisplayMessage area, instead of dumping everything to stdout. ++ ++* Installed new cmail (RCS rev 3.1) and cmail.man (RCS rev 1.10), and ++changes to cmail code in backend.c, from Evan Welsh. ++ ++* Miscellaneous minor fixes. ++ ++3.1, patchlevel 6 -- Fri Nov 4 12:53:53 PST 1994 -- Tim Mann ++ ++* This patchlevel was not actually released to anyone. ++ ++* Updated the pty code to be based on GNU Emacs 19.24, and moved it to a ++separate file. It was hard to split out just the pty configuration from ++all the stuff emacs does with its custom configure script and .h files, ++but I did my best. ++ ++* Converted from imake to GNU autoconf. This was a serious upheaval. ++ ++* Put in code to help trap "error gathering move list" problem reported by ++Michel van der List if it recurs. I couldn't reproduce it. ++ ++3.1, patchlevel 5 -- Mon Oct 31 21:12:00 PST 1994 -- Tim Mann ++ ++* Beta distribution only. ++ ++* We now test for checkmate or stalemate in EditGame mode after every user ++move, and in LoadGame mode whenever we hit the end of a game without ++seeing a PGN end marker. cmail needs an update to deal with this ++correctly; Evan promises one. ++ ++* Bugfixes in new move generator. Thanks to Mike Lee for reporting one of ++the bugs. ++ ++* Imakefile was omitted from patchlevel 4. ++ ++3.1, patchlevel 4 -- Mon Sep 19 18:19:46 PDT 1994 -- Tim Mann ++ ++* Beta distribution only. ++ ++* The move generator includes a mate tester. Initially this is used only ++by cmail, and even that usage needs further work. ++ ++* Wrote a true move generator and used it to replace all the move ++disambiguation and legality checking code in parser.l. The move generator ++is capable of dealing correctly with en passant and castling availability, ++but the rest of the program still does not keep track of this information. ++ ++* Bug fix: xboard did not handle "foo has made you an examiner of game 23" ++message. Thus you could not use examine features until the next board ++came in, showing your new relation to the game. Thanks to POOKIEWOOKIE on ICS ++for the bug report. ++ ++* Added AutoObserve feature. Thanks to Chris Petroff for the idea. ++ ++* Added Book feature to use new gnuchess "bk" command. Mike McGann request. ++ ++* Redid code to handle missing "time" command in gnuchess, because latest ++gnuchess no longer sends a response to this command. ++ ++* Eliminated need for -DFLEX. Thanks to Michael Shields (Vladimir?) for ++the idea. ++ ++* Added missing code to implement MoveNow in TwoMachines mode. ++ ++* Added ShowThinking feature. Thanks to Richard Lloyd for the idea. ++ ++* Applied patches from Evan Welsh; some fixes and improvements to the ++cmail code. ++ ++* Fixed bug in moving from EndOfGame mode to MachineWhite or MachineBlack, ++introduced in previous patchlevel. Also fixed related bug in ending a ++game in ICS mode; was entering EndOfGame mode instead of IcsIdle. ++ ++* Added patch to implement internetChessServerLogonScript flag, from Kevin ++O'Connor. Thanks! ++ ++3.1, patchlevel 3 -- Wed Sep 7 13:22:07 PDT 1994 -- Tim Mann ++ ++* Beta distribution only. ++ ++* Merged in new cmail code from Evan Welsh. He added the ability to have ++more than one game per message, needed for official IECG matches. I added ++the ability to resign or offer/accept/decline a draw in a cmail game. ++ ++* Bugfix: invalid -tc option caused segmentation fault; DisplayFatalError ++was called too early in initialization. Georges Honore reported this bug. ++ ++* Decided to keep EndOfGame mode as an element of the user interface---it ++means that a gnuchess game or loaded game has ended, and the user must ++explicitly select EditGame to edit it, rather than just being able to ++enter more moves freely. But internally there is no longer an invariant ++tying this mode to whether the chess program is running. ++ ++* Zippy bugfix: Was saving only the final position in the -sgf file when ++the game ended by something other than resignation or flag. Also fixed ++the longstanding bug that Zippy would think the final board of such a game ++was a new game and restart the chess program. ++ ++* Now does a better job of faking castling availability in FEN. We still ++don't really keep track of it, but now at least we don't say that castling ++is still available when the king or rook is not on its home square. ++ ++* Bugfix: Initial board of game history for wild games was going through ++too much processing, causing us to forget the game length, which is now ++needed by ParseGameHistory. This was causing problems with resuming ++adjourned wild games. ++ ++* Updated ICS host to ics.onenet.net. ++ ++* Zippy now accepts challenges where the opponent specified his color. ++ ++* Added ZIPPYPASSWORD2 to let operator give commands directly to gnuchess. ++ ++* Bitmap directory can include alternative icons now, too. ++ ++* Handle "Game * (*) has no examiners" message from ICS. ++ ++* Revamped window title and icon name selection. ++ ++3.1, patchlevel 2 -- Sun Jun 12 17:16:28 PDT 1994 -- Tim Mann ++ ++* "Beta" distribution for Zippy users only. ++ ++* Bugfix: common.h was assuming that X11 type Boolean is char, which is ++not always true. This might have caused all sorts of obscure bugs! ++ ++* Installed new bitmaps from Elmar Bartel as the default. Many thanks! ++The old bitmaps can be used by changing the "bitmaps" symbolic link before ++compiling xboard, or by using the -bitmapDirectory option at runtime. ++ ++* Loading a game that ends with the PGN unfinished symbol ("*") now always ++leaves you in EditGame mode. ++ ++* Added documentation of -icscomm to man page. Thanks to Maarten Remkes ++for the linux script. ++ ++* ^C now kills gnuchess as well as xboard. Thanks to Dima Dakhnovsky for ++reminding me how to do this. ++ ++* Bitmap icon color now indicates player to move. Stuart Cracraft ++suggestion. ++ ++* Changed piece bitmap flags to have just one flag, which points to a ++directory full of bitmaps, instead of a flag for each bitmap. Also ++changed bitmap naming convention. ++ ++* "Connection closed by ICS" is no longer a FatalError popup. This was ++too annoying in the normal case where the user typed "quit". ++ ++* Changed default font to 14 pixels instead of 10 points. This seems to ++make it close to the size I want it to be on more displays. ++ ++* Major mode (GNU Chess, etc.) appears in title bar. Stuart Cracraft ++request. ++ ++* Bug fix: EditGameEvent, MachineBlackEvent, MachineWhiteEvent, and ++TwoMachinesEvent were calling PauseEvent to get out of pause mode, which ++now has undesired side effects, such as advancing the display to the ++forwardMostMove. It works fine to just set pausing = FALSE instead. ++ ++* IcsExamining mode now lets you access ICS edit position commands using ++the same popup menus as xboard's EditPosition mode. Thanks to DAV on ICS ++for inspiring the idea. ++ ++* Corrected test for gcc on HP in Imakefile; thanks to Richard Lloyd. ++ ++3.1, patchlevel 1 -- Wed Jun 1 16:25:11 PDT 1994 -- Tim Mann ++ ++* Added parser.c.lex and parser.c.flex to the distribution. ++ ++* Added HP gcc options to Imakefile, from Mats Nylen. ++ ++* EndOfGame mode no longer highlights EditGame mode indicator, because the ++modes really do differ. I would like to get rid of EndOfGame mode in the ++future, at least as far as users can see. ++ ++* Larger %a in parser.l, needed for RS/6000 users. ++ ++* Minor improvements to Mail Move error messages. ++ ++* When -debug flag is given to xboard, -v is passed to cmail. ++ ++* Old Save Style uses "1. ..." instead of "1..." when black moves after a ++comment; more like xboard 3.0's actual style. ++ ++* New version of cmail from Evan Welsh. Looks for UCB Mail in a more ++portable way and has some minor bug fixes. ++ ++* Bug fix: Saving a FEN position while in EditPosition mode with black to ++play was showing white to play in the saved position. ++ ++3.1, patchlevel 0 -- Fri May 20 16:36:15 PDT 1994 -- Tim Mann ++ ++* This is the first general release since 3.0, patchlevel 9. Releases ++since then have been limited-distribution or beta releases. ++ ++* Thanks to my version 3.1 beta testers: Dmitry Dakhnovsky, Ed Hanway, ++Richard Lloyd, Mike McGann, Shelly Mistry, Josef Nelissen, Chris Petroff, ++Jack Robertson, Michel van der List, Ky Macpherson, Derek Terveer, and ++Evan Welsh. Sorry if I've forgotten anyone who gave me feedback. ++ ++* Updated man page. ++ ++* Minor cleanup on menu sensitivity code. ++ ++* Integrated another even better version of cmail from Evan Welsh, ++including some code he supplied in xboard itself. ++ ++* A few more fixes to cmail support. ++ ++* Automatically update clocks after an ICS "moretime" command. ++ ++* Handle ICS automatic examine mode (set examine 1) after a game. ++ ++3.0, patchlevel 14 -- Tue May 17 13:41:44 PDT 1994 -- Tim Mann ++ ++* Beta test release only. ++ ++* Don't suppress prompt on first board of game being examined; otherwise ++it looks like nothing happened at all (i.e., like you're lagged). ++ ++* Added StopExamining and StopObserving (Chris Petroff suggestion). ++ ++* Made Reset do a refresh on ICS. John Chanak's original ICS code for ++xboard tried to do this; I finally decided it was a good idea after all. ++ ++* Fixed bugs in handling updates that come in while you are pausing in ++examine mode. This is pretty tricky to do right. ++ ++* Made un-Pausing immediately pop you to the current position. This is ++always necessary in examine mode, since the game may have changed under ++you; your remembered moves might no longer be right. So I made it do the ++same in all modes. ++ ++* Took Detach Examine mode back out...used Pause mode for this instead! ++ ++* Put in a trap for the GNU Chess bug of printing an Illegal Move message ++when its own hint move is illegal. ++ ++* Attempted to fix a Zippy bug; bogus "exited unexpectedly" messages after ++it checkmates its opponent. This involved adding an argument to GameEnds ++to say who says it ended (ICS, GNU, etc.) and taking different actions in ++different cases. Unfortunately, this just restored an older Zippy bug, where ++Zippy restarts gnuchess when it gets the board with the final position, ++because GameEnds still puts xboard in EndOfGame mode. Sigh. ++ ++* We now capture elapsed time on last move when getting game history. ++(Josef Nelissen bug report) ++ ++* Rewrote code to redisplay last file title so it really works. ++ ++* Fixed bug in oldSaveStyle. ++ ++* Larger %a and %o were needed for lex. ++ ++3.0, patchlevel 13 -- Mon May 16 16:26:22 PDT 1994 -- Tim Mann ++ ++* Beta test release only. ++ ++* FatalError popups stay on the screen now. If the error is really fatal, ++all functions are disabled, and the program exits when you press OK. ++ ++* Redisplay last file title when using Load (Next/Previous/Same) Game. ++ ++* Zippy understands new match challenge message format on ICS. ++ ++* Added Revert command. ++ ++* When examining a game on ICS, < > buttons do ICS backward/forward ++commands, unless you set the Detach Examine option. Thanks to Dima ++Dakhnovsky for the idea. ++ ++* Fixed various minor problems in cmail mode. ++ ++* cmail generates the tags now. New version of cmail from Evan Welsh. ++ ++* cmail mode won't let you do MailMove unless the currently displayed ++position is exactly one move past the end of the game you loaded. ++ ++* Fixed building of man pages in Imakefile ++ ++* Updates to INSTALL file ++ ++3.0, patchlevel 12 -- Sat May 7 21:10:03 PDT 1994 -- Tim Mann ++ ++* Beta test release only. ++ ++* Brought man page up to date. ++ ++* Added Shift+R to resign from keyboard. ++ ++* Some items on Action menu available in GNU Chess mode now. ++ ++* Revamped Action menu. ++ ++* Reordered functions in backend.c as a small step toward reorganizing ++this whole mess. ++ ++* Generate TimeControl PGN tag. ++ ++* Get type of ICS game (e.g., rated blitz) and save in PGN tags. ++ ++* Bug fix: Clocks were not redisplayed when entering EditGame mode. ++ ++* Bug fix: Clocks were not being redisplayed after loading a game file ++with -td 0, so they could show the wrong color active. ++ ++* Bug fix: Chess programs would be killed and match mode would exit ++prematurely when loading a PGN game fragment ending with "*". ++ ++* ICS command "sposition" no longer confuses xboard. ++ ++* Integrated new version of cmail (with support code in xboard) from Evan ++Welsh. ++ ++* Added TruncateGame, MoveNow, RetractMove, and QuietPlay. ++ ++* Bug fix: switching between MachineWhite and MachineBlack was not calling ++Attention(). Reported by Dino Dini. ++ ++* More improvements to INSTALL and Imakefile. ++ ++* Pack moves into 79 character lines in PGN output. We don't generate ++check indications, and we always break the line before the result, ++so this is not quite PGN export format. ++ ++* Use FEN tag in PGN. ++ ++* Improved finding and counting of game starts in save files. ++ ++* Negative position or game numbers in -lpi/-lgi mean to seek to that byte ++offset. Hook for possible future features, not in man page. ++ ++* Detect and handle absence of either "time" or "otim" commands in ++gnuchess. ++ ++* Don't use "promote" command to ICS anymore. ++ ++* Handle switching sides and taking back moves on FICS. ++ ++* Handle flip state flag in style 12 board. ++ ++* Handle examine mode on ICS. ++ ++* Improved error popups for various kinds of illegal moves. ++ ++* Suppress unasked-for hints from gnuchess (which it generates in post ++mode). ++ ++* Load/save position functions use FEN. Old style also supported. ++ ++* Added detailed error messages if loading a bitmap file fails. ++ ++* Small board has 2-pixel lines between squares instead of 3-pixel. ++ ++* Added OldSaveStyle and AboutGame. ++ ++* Renamed ForceMoves to EditGame. ++ ++3.0, patchlevel 11 -- Tue Sep 21 15:25:36 PDT 1993 -- Tim Mann ++ ++* The following changes were present in xboard 3.0, patchlevel 11, but the ++first group did not make it into WinBoard 3.0 until later. xboard ++3.0.pl11 was a limited-distribution release only, mostly to Zippy users. ++ ++* Man page minor fixes. ++ ++* Added a missing file close. ++ ++* Removed automatic error popdown on Reset, which was destroying some ++error messages before they could be read. ++ ++* Fixed char vs. unsigned char warnings on bitmaps. ++ ++* Use ICS board style 12. Some improvements to ICS parsing. ++ ++* Comment window is now labelled with the move the comment is on, and ++comments don't pop down when you step to the next move. ++ ++* Save files now in PGN format. ++ ++* Support for loading PGN files. PGN tags pop up when a PGN game file ++is loaded. ++ ++* More info in INSTALL and Imakefile about building for Suns (and ++other systems). ++ ++* WinBoard 3.0 patchlevel 11 split off from an early version of xboard ++3.0 patchlevel 11, so it does not have all the features of that ++patchlevel. The following changes made it into both xboard and ++WinBoard: ++ ++* Made Comment dialog non-modal in WinBoard. ++ ++* EndOfGame mode is now more transparent. It looks like ForceMoves ++mode except that there is no chess program running. ++ ++* Small bug fixes in clock management. Most noticeably, pausing when ++it is gnuchess's move now works as documented (again). ++ ++* Add minimal support for -icscomm option. Not documented yet because ++I haven't sorted out the issues with setting the tty modes on the comm ++port device, or with locking it properly. But it's usable by wizards. ++ ++* Don't restart the chess program upon Backward event from EndOfGame mode. ++ ++* Suppress extra prompt after ICS sends us a board. ++ ++3.0, patchlevel 10 -- Sat Sep 11 18:44:03 PDT 1993 -- Tim Mann ++ ++* Beta test release only. ++ ++* Zippy now plays chess. zippy.c and zippy.h are still not included ++in the standard distribution, but are available on request. ++ ++* Switched to using style 12 on ICS. ++ ++* Updated man page, and documented use of XBoard*form.translations to ++add more shortcut keys. ++ ++* Added shortcut keys "d" to claim/offer/accept a draw, and "t" to ++call flag. Suggested by venu on ICS. ++ ++* More explicit instructions in INSTALL file. ++ ++3.0, patchlevel 9 -- Tue Sep 7 14:02:00 PDT 1993 -- Tim Mann ++ ++* General release, minor update to 3.0.pl8. ++ ++* Loosened checking on whether it's okay to start a move, to satisfy ++ICS ultra-blitz players. Now we don't check whether it's your turn ++until you let go of the piece. ++ ++* Parser now recognizes "+-+" as meaning the game ended in a draw. ++ ++* Got rid of S_NONE symbol, which seems to conflict with some symbol ++Sun defines. ++ ++* Tweaked the man page. Clarified that there is currently no way for ++two people running copies of xboard to play each other without going ++through the Internet Chess Server. ++ ++* Fixed a bug in color name conversion. Asking for two different ++colors whose names were the same in the first four characters would ++get you two copies of the first one. Thanks to Volker Zink for the ++bug report. ++ ++* Improved confusing Usage() message. ++ ++* Added a bunch of Sun information to the Imakefile and INSTALL file. ++Thanks to Ed Hanway, Arik Klingensmith, and others who responded. ++ ++* Test for defined(WIN32) instead of !defined(unix). ++ ++* Avoid using (void *) type with non-ANSI C compilers. Thanks to ++James Altucher for the bug report. ++ ++3.0, patchlevel 8 -- Thu Sep 2 12:23:01 PDT 1993 -- Tim Mann ++ ++* Note: Patchlevel 8 was the first non-beta release of xboard 3.0 ++ ++* Added cmail to distribution. Contributed (and still maintained) by ++Evan Welsh. ++ ++* Bug fix: -queen option wasn't initializing menu check. Reported by ++Pat Surry. ++ ++3.0, patchlevel 7 -- Thu Aug 26 13:23:24 PDT 1993 -- Tim Mann ++ ++* Sent WinBoard 3.0.pl7 to Torre on ICS ++ ++* Added parser.h to hold the interface to parser.l ++ ++* Upgraded COPYING file and copyright notices to GNU GPL version 2. ++ ++3.0, patchlevel 6 -- Tue Aug 24 15:16:13 PDT 1993 -- Tim Mann ++ ++* We no longer display intermediate positions or intermediate comments ++while loading a game file with -timeDelay 0 or loading an opening to ++start up a -matchMode game. ++ ++* Loading an empty game from an xboard save file now gives a status ++message "No moves in game" instead of an error popup saying "Game not ++found in file." ++ ++* Added comment.awk to distribution. ++ ++3.0, patchlevel 5 -- Tue Aug 17 16:45:54 PDT 1993 -- Tim Mann ++ ++* Bug fix: xboard would crash if it couldn't get all its colors; now ++it switches to monoMode instead. Also, xboard was trying to convert ++color resources even when using a b/w display. Reported by Larry ++Rogers. ++ ++* Bug fix: Declared fields of TimeMark as signed so that we get signed ++instead of unsigned arithmetic. SubtractTimeMarks was breaking on ++Alpha AXP (which has 64-bit longs) with old declarations. Reported by ++Michel van der List. ++ ++* Bug fixes: Keyboard accelerators now work after EditComment window is ++popped down. Iconize keyboard accelerator now works even if xboard ++was started with -iconic flag and later deiconized. ++ ++* Bug fix: The routine that tests whether a move is illegal because it ++would leave you in check was not handling e.p. captures properly. ++Reported by Patrick Surry. ++ ++* Bug (?) fix: Was adding time to clocks at time control even when ++loading a game file. Actually it's not entirely clear how time ++controls should be dealt with when some moves are loaded from a file ++or clicked in with ForceMoves. For now ForceMoves mode does add the ++time (because it can be used to change moves during a live game), but ++LoadGame mode does not. ++ ++* Updated usage message. ++ ++* Previous attempted fix to matchMode had broken TwoMachines mode and ++generally needed more work. Also simplified command line interface to ++matchMode. ++ ++3.0, patchlevel 4 -- Thu Aug 5 14:17:18 PDT 1993 -- Tim Mann ++ ++* Thanks again to the beta testers listed for 3.0 patchlevel 3, and also ++Desnogues, Steve Cariglia, Niklas Engsner, Mark Silver, and Roger Rowe. ++ ++* Reorganized man page, splitting OPTIONS into subsections. ++ ++* matchMode was very broken; fixed. ++ ++* Changed convention for turning off command line options from --opt ++to -xopt, to be less inconsistent with GNU standards. Also changed ++the long command line options to take True/False arguments like ++resources; seems to make more sense this way. ++ ++* Added AlwaysQueen option -- suppresses promotion dialog and always ++promotes to a queen if you move a pawn to the last rank. Has no ++effect on gnuchess (or your ICS opponents!) -- they can still ++underpromote. ++ ++* Subtracted an extra fudge term when determining how wide message and ++title widgets should be. This fixes a problem some beta testers had. ++Wish I knew why it's needed. ++ ++* Bugfix in parser; symptom was that you couldn't do LoadGame after ++observing a game on ICS. ++ ++* Bugfix in Forward; didn't work after game ended while Pause was turned on. ++ ++* Removed bogus execute bits on .h files. ++ ++* Use REMOTE_SHELL and TELNET_PROGRAM definitions. ++ ++* MachineWhite and MachineBlack now work from TwoMachines mode. ++ ++* Popping down an error message with the [ok] button was not turning off ++the errorUp flag, so the next move would cause xboard to try to pop it ++down again, resulting in a wild memory reference and sometimes a crash. ++ ++3.0, patchlevel 3 -- Tue Aug 3 17:40:27 1993 -- Tim Mann ++ ++* Thanks to my beta testers: Patrick Surry, Takuya Kojima, Robert J. Luoma, ++Chris L. Petroff, Richard K. Lloyd, Michel van der List, Craig Metz, ++Antoon Frehe, Simon Clift, Shelly, Eric Peterson, Christopher Mitchell, ++Martin Koch, Ed Hanway, Steve Booth, Udo, Ken Hobday, and Joseph Duhamel. ++ ++* Improved error messages for trying to move the wrong color pieces or ++to move when it's not your turn. ++ ++* Special code for monoMode on 1-bit displays now understands displays ++where 1=white and 0=black. ++ ++* Declare getenv() if not included; avoids a compiler warning. ++ ++* Documented borderXoffset and borderYoffset. ++ ++* Added -titleInWindow option for use with X window managers that ++don't let us set the title in the window banner. ++ ++* Fixed error message printing in WinBoard; system error messages no ++longer appear as numeric codes. ++ ++* The error message popup is now non-modal; you don't have to press the ++[ok] button before you can do something else. In addition, the popup is ++positioned so that it doesn't cover up the board (too much), and making a ++move or otherwise clicking on the board pops it down. (Not implemented in ++WinBoard.) ++ ++* You can now call your opponent's flag in ICS mode by clicking on his ++clock. ++ ++* Fixed minor bugs in -flipView option and documented exactly how xboard ++decides which way to flip the view. ++ ++3.0, patchlevel 2 -- Fri Jul 30 22:20:23 PDT 1993 -- Tim Mann ++ ++* Added Autosave to Options menu. Would be better to have Save ++Options dialog as in WinBoard, but this was quick to do and gives the ++most-needed functionality. ++ ++* Changed "Reload Game" on menu to "Reload Same Game". ++ ++3.0, patchlevel 1 -- Thu Jul 8 21:22:59 PDT 1993 -- Tim Mann ++ ++* Sent a copy of patchlevel 1 to Patrick Surry to beta-test. ++ ++* Added -cmail option that sets appData.cmailMode. Currently a no-op. ++In the future this may set special modes for use by the cmail script ++for playing chess by email. ++ ++* Added LoadNextGame, LoadPreviousGame, and ReloadGame to File menu. ++ReloadGame suggested by Patrick Surry. ++ ++* Added -flipView command-line option. Suggested by Patrick Surry. ++ ++* Fixed bugs in parser.l: (1) Pattern for "# xboard game file ..." ++needed to match to end of line. (2) Start of a new file was not matching ++the ^ start-of-line character. The fix for this is a kludge. ++ ++* Made game counting code in LoadGame more robust, and made LoadGame ++able to detect the end of a saved partial game (by noticing the start ++of the next game) in game files created by XBoard itself. We don't ++try to find the start of the next game that way in other kinds of game ++files, because the only way I can think of to do that is to look for ++another move #1, and that technique gets too many false hits. ++ ++* Fixed recently introduced bug in LoadGame when game starts with a ++position diagram. ++ ++3.0, patchlevel 0 -- Fri Jun 25 14:17:17 PDT 1993 -- Tim Mann ++ ++* Changes in this patchlevel were too numerous to list. Larger ones are ++listed below. ++ ++* Added a popup dialog to enter and edit comments. Inspired by some ++code from Patrick Surry. Changed the normal read-only comment popup ++to the same style. ++ ++* Added ICS init script feature from Karl Schwamb. ++ ++* Added some ESIX fixes and OMIT_SOCKETS ifdef option, from Kayvan Sylvan. ++ ++* Revamped code to allow use of flex instead of lex on parser.l. ++Using flex requires adding -DFLEX to defines in Imakefile. ++ ++* Source code is split into front end (xboard.c), which knows about X ++and Unix, and back end (backend.c), which knows about chess, gnuchess, ++and the ICS. There is also a front end for Windows NT. ++ ++* Boolean command line options now use "-foo" to turn on and "--foo" ++to turn off instead of "-foo true" and "-foo false". [Later -xfoo; ++see above.] ++ ++* Added menu commands to control autoflag, bell, and coords options. ++ ++* User interface has a new look: (1) Menu bar instead of array of ++buttons. A few very commonly used features have small buttons in ++addition to being on the menus. (2) Large font for clock. (3) Pop-up ++dialogs for errors. ++ ++2.1, patchlevel 11 -- Sat Jun 5 00:01:01 PDT 1993 -- mann@src.dec.com ++ ++* Added code to deal with "wild" games on ICS. This includes allowing ++castling with the king on d1 or d8, which is allowed in wild(1) games ++if the king started there. Notation is o-o to castle "short"---to ++whichever side the king is closer to---and o-o-o to castle "long." ++Right now wild castling is always allowed by xboard; we rely on ICS or ++gnuchess to reject it when we aren't really in wild mode. ++ ++* memcpy call had arguments in wrong order. ++ ++* Removed April Fool code ++ ++2.1, patchlevel 10 -- Mon Feb 15 10:19:31 PST 1993 -- mann@src.dec.com ++ ++* Avoid trying to select on a pipe when using System V. Needed to ++copy some code from InitChessProgram() up into establish(). ++ ++* Bug fix in disambiguating pawn moves like "ed". ++ ++* Fix to error handling in ReceiveFromProgram. ++ ++* Bug fix: entering EditPosition mode with black to play highlighted ++White's clock instead of Black's. ++ ++* Added telnetProgram resource in case "telnet" is not the name of the ++telnet program. ++ ++2.1, patchlevel 9 -- Fri Jan 22 19:08:27 PST 1993 -- mann@src.dec.com ++ ++* Entering Force Moves mode clears "flag has fallen" messages from display. ++ ++* ICS host name can now be in numeric format; for example 128.2.232.4. ++ ++* Bug fix: LegalityTest was failing to test whether a pawn move was ++illegal because the move would discover a check. ++ ++* Handle ICS message "mann asserts a win over manntest, who disconnected." ++ ++* Bug fix: A recent change to PromotionCallBack had broken ++underpromotion to a knight. ++ ++* Bug fix: In EditPosition mode, dragging a piece onto a square border ++would make it vanish. xboard wasn't distinguishing this case from ++dragging the piece off the board. Thanks to Matthew Kidd. ++ ++* Removed "static" declaration from yywrap for compatibility with IRIX ++version of lex. Thanks to stiller@blaze.cs.jhu.edu. ++ ++* Added substitutes for bzero, bcopy, and gethostname for Solaris ++SVR4. Thanks to Michael Grant. ++ ++* Bug fixes to queen move disambiguation. Bugs showed up only when ++promotion resulted in more than one queen on the board. ++ ++2.1, patchlevel 8 -- Fri Dec 11 17:54:18 PST 1992 -- mann@src.dec.com ++ ++* parser bug fix: It now really works to leave off the piece a pawn is ++promoting to and let it default to queen. ++ ++* When starting to observe or play an ICS game, don't draw board in ++initial position and then immediately redraw it in the current ++position. ++ ++* Handle ICS messages when an "abuser" forfeits a game by ++disconnecting and when a game is aborted ("removed") by an ++administrator. ++ ++* Bug fix: A user move when in LoadGame+Pause mode was resuming the ++game load instead of putting us in force mode. ++ ++* It seems that crashes inside sscanf when xboard is compiled with gcc ++(as on IBM PS/2 AIX, mentioned below, and also on VAX Ultrix 3.1) are ++caused by an incompatibility between gcc and the sscanf implementation ++on these platforms. A workaround is to specify -fwritable-strings to ++gcc (see the gcc documentation). Added info on how to do this to the ++Imakefile. Thanks to Tom McConnell for this information. ++ ++* Clocks are allowed to go negative. This is mostly for ICS ++compatibility, but it affects gnuchess mode too. Also, we give the ++time bonus when a player hits the time control boundary even if his ++flag is already down. This choice is a bit debatable, but it makes ++things look better when you are in TwoMachines mode and gnuchess's ++time management screws up causing it to exceed its time limit. ++ ++* Implemented move legality checking code. Moves made with the mouse ++or parsed from a file are checked for legality before being made. ++This is mostly in preparation for future extensions, such as ++human-human play. For now it makes -noChessProgram mode more useful. ++ ++* If the user takes back moves, we restore the clocks to the earlier ++settings. ++ ++* We now handle the output of the ICS oldmoves command, including ++parsing the game end condition. ++ ++* Added autoCallFlag mode. ++ ++* Fixed glitches in the medium size outline king and rook bitmaps, and ++touched up the medium size solid king and outline queen. ++ ++* bug fix: DisplayMove would not display backwardMostMove - 1. ++ ++* Added CallFlag button and removed AcceptMatch. CallFlag is more ++important with new ICS, and accepting the current match offer is easy ++with the new ICS command "accept" (can be abbreviated "ac"). ++ ++* LoadGame and LoadPosition display tail of file name (plus index ++number, if any) as title. ++ ++* MachineWhite, MachineBlack, and TwoMachines now work properly from ++LoadGame and LoadGame+Pause mode. ++ ++* Use o-o and o-o-o to castle on ICS, not 00 and 000. ++ ++* Stripped out code for old ICS messages; new ICS is now installed. ++ ++* Bug fix: don't offer autosave when paused during LoadGame. ++ ++2.1, patchlevel 7 - Fri Dec 11 17:40:56 PST 1992 - mann@src.dec.com ++ ++* Track change to "Illegal move" message in new ICS. ++ ++2.1, patchlevel 6 -- Tue Dec 8 10:48:44 PST 1992 -- mann@src.dec.com ++ ++* Kludged around bug in keeping comment popup where you put it by ++adding borderXoffset and borderYoffset resources that give the width ++of the borders added by the window manager. Yucch. ++ ++* Changed searchDepth kludge back to using "help" instead of "bd"; the ++latter didn't work because the output contains a line starting with ++"White", so we think gnuchess is telling us that White won. Oops. ++ ++* Removed some code that uses an X11R5 feature, XrmGetDatabase. ++Without this, the auto font sizing code is harder to make work, so to ++keep my sanity I had to change it to affect only the fonts that appear ++in the main window and the comment popup, not the other popups. Maybe ++this is better anyway. ++ ++* AcceptMatch button now works after a counterchallenge, too. ++ ++* Added code for more variants of messages about games being adjourned ++or aborted. These messages need to be unified in new version of ICS. ++ ++* Added workaround for minor bug in ICS; game number on first board ++can be wrong. ++ ++* Removed code to say "refresh n" instead of "refresh"; was broken and ++wasn't needed anyway. ++ ++* Added missing casts for compilers that distinguish enums from ints ++and missing cast in connect call. ++ ++* Added code to recognize "both sides are out of time" draw message ++proposed for next version of ICS. ++ ++* Thanks to Danny Sleator and Joe Peterson for bug reports. ++ ++2.1, patchlevel 5 -- Sun Dec 6 19:52:40 PST 1992 -- mann@src.dec.com ++ ++* Removed gcc and CDEBUGFLAGS from Imakefile. ++ ++* Corrected setting of mode to ForceMoves when game file ends or ++contains an AmbiguousMove or BadMove. Previous bug was harmless. ++ ++* Added AcceptMatch button and mention of 50-move rule for Draw button ++to man page. ++ ++2.1, patchlevel 4 -- Sun Dec 6 02:55:42 PST 1992 -- mann@src.dec.com ++ ++* Now handles revised messages from new version of ICS. New ICS is ++not released yet, so this code might change further. Next patchlevel ++will remove support for old ICS; both are there now. ++ ++* Initial processing for a new game being watched or played now ++happens when we see the first board image. Removes the need to parse ++some messages and unifies some code. ++ ++2.1, patchlevel 3 -- Tue Dec 1 19:40:40 PST 1992 -- mann@src.dec.com ++ ++* Handles ICS messages "Draw : neither player has mating ++material" and "Draw : White has no material, Black has no time." ++ ++* Added AcceptMatch button for ICS mode. ++ ++* Fixed bug in previous fix to yylexstr(). ++ ++* Fixed bugs in code for loading old position files that don't start ++with "#" and for handling case where user asked for nth position in ++file but there aren't that many. ++ ++* Handles ICS message "* has restored your old game" ++ ++* ResetProc always clears title line now. ++ ++* Don't issue just "refresh" when watching a game; use game number. ++Upcoming new version of ICS may need this. ++ ++* Added code to try to prevent user from watching and/or playing more ++than one game at a time. There is a race condition inherent here; if ++we get more than one board from the game before our command to stop ++watching it takes effect, we'll think the user started it again. Not ++clear how to fix this. ++ ++* Redid ParseBoard8 to use sscanf. Code is a good deal cleaner now. ++Also, we now parse out the game number too, though we don't make much ++use of it yet. ++ ++* (Tried to put in a feature that recognizes the current game in a ++game file must have ended when we see the start of a new one, but had ++to disable it because we have too many false hits with the current ++parser, especially in gnuchess listing files.) ++ ++* Moves read from game files or received from ICS are now translated ++into canonical algebraic form just like all other moves. Minor nit: ++If you use Reset while playing or observing a game in ICS mode, the ++game history (including the current board position) is lost, so the ++next move of the current game can't be translated. ++ ++* Default fonts now vary with board size, and are chosen by pixel size ++instead of point size (since piece bitmaps have a fixed pixel size). ++ ++* Bug fix: An extra Forward was required to skip over time indications ++in game files. ++ ++2.1 patchlevel 2 -- Fri Nov 27 23:30:00 PST 1992 -- mann@src.dec.com ++ ++* If you move the comment popup, the next time it pops up it will come ++back where you put it. ++ ++* Fixed yylexstr() so calls to it can be interspersed with calls to ++yylex(). ++ ++* Fixed bugs in Forward/Backward while in LoadGame mode. ++ ++* Changed Save{Game,Position} functions to append instead of ++overwriting if file exists. Changed Load{Game,Position} functions to ++deal with multiple games/positions per file. ++ ++* Changed load{Game,Position}File resources to trigger automatic load ++on program startup. Changed save{Game,Position}File resources to ++trigger automatic save after every completed game and on program exit. ++ ++* Added autoSaveGames mode. ++ ++* Fixed bug with PromoPiece in call to MakeAlg from MakeMove. ++ ++* Many changes to get rid of picky compiler warnings and generally ++clean up the code. ++ ++2.1 patchlevel 1 -- Fri Nov 27 02:45:00 PST 1992 -- mann@src.dec.com ++ ++* A last minute change before patchlevel 0 went out broke ++ParseGameHistory(). Immediately fixed in patchlevel 1. ++ ++Version 2.1, patchlevel 0 -- Fri Nov 27 02:00:00 PST 1992 -- mann@src.dec.com ++ ++* Uses "time" command of gnuchess 4.0 and following to keep clocks in ++sync. Still works with older versions without this command; we test ++whether the command is present the first time each chess program is ++started. ++ ++* File name dialog pops up under the mouse cursor, so that it's got the ++keyboard focus if the window manager is using pointer focus. ++ ++* Attempts to move the wrong color piece or an empty square are filtered ++out in xboard instead of being passed on to GNU Chess or the ICS. ++ ++* The reason a game ended is now remembered even if you move backward ++and forward after it ends. It is forgotten only if you make a move ++(which is as it should be---this is now a different game, which hasn't ++ended yet). The message saying why the game ended no longer wipes out ++the last move. ++ ++* Pause, Backward, Forward, ForceMoves, and EditPosition now work from ++TwoMachines mode. ++ ++* Forward and Backward now change only the board display unless you ++are in ForceMoves mode. Pause mode keeps new moves that are received ++from being displayed on your screen until you unpause (or use ++Forward). ++ ++* Added option to ring the bell after opponents' moves. ++ ++* Saved games that start from other than the standard initial position ++now begin with a postion diagram as in saved position files. The ++loader is modified to understand such save files. ++ ++* Improved error checking when trying to read from gnuchess. ++ ++* Parser understands things that look like time indications, e.g., (0:12), ++instead of popping them up as comments. ++ ++* Send "quit" to gnuchess before trying to kill it. I needed this ++locally because sending a SIGTERM to rsh was not killing the remote ++program on some internal field test systems we have. ++ ++* Merged in code from John Chanak to make xboard a front end to the ++Internet Chess Server, and added several improvements of my own. ++(These include parsing end of game messages, loading the current state ++and previous history of a game that's joined in progress via "watch" ++or "load", automatic switch from board style 1 to 8 when needed, ++removing irrelevant buttons and adding some new ones, adding the ++useTelnet and gateway resources, and miscellaneous code cleanup, bug ++fixes, and documentation.) Many thanks to John for writing and ++contributing the initial version of this code. ++ ++Fri Oct 30 20:16:40 PST 1992 (patchlevel 25) mann@src.dec.com ++ ++* gnuchess now castles by sending us "o-o" or "o-o-o" (starting with a ++preliminary version of 4.0.pl60 that I have). Added code to handle ++this. The old format ("e1g1", etc.) still works too. ++ ++* Added code to format moves in normal abbreviated algebraic notation ++(for example, e4, exd4, f8Q, Nf6, 0-0) instead of coordinate algebraic ++(for example, e2e4, e3d4, f7f8q, g1f6, e1g1). Moves entered with the ++mouse or received from gnuchess are translated into this canonical ++format for display on the message line or in saved game files. Moves ++read from game files are not translated, however; they are shown and ++saved just as they appear in the file. ++ ++Mon Sep 14 13:19:01 PDT 1992 (patchlevel 24) mann@src.dec.com ++ ++* It's not really correct to write an ep capture of a pawn on e5 as ++fxe5; this should be written as fxe6 because e6 is where the capturing ++pawn ends up. Nevertheless, the parser now interprets fxe5 as the ep ++capture f5xe6 unless there is a pawn on f4, in which case it ++interprets fxe5 as f4xe5. By design, the parser does not flag fxe5 as ++ambiguous if there are pawns on both f4 and f5; instead it prefers the ++more legitimate f4xe5 interpretation. ++ ++* A move like fxe6 or fe6 is now interpreted as an e.p. capture of the ++pawn on e5 if there is one there and e6 is empty. ++ ++* A move like fxe5 can no longer be interpreted as an e.p. capture if ++there isn't a pawn on e5 to be captured. Previously this could happen ++erroneously if there were pawns on both f4 and f5, and the f4 pawn was ++capturing a piece on e5. ++ ++* The parser no longer munges the move it is parsing; in the past, for ++instance, it would remove the "x" from a move like dxc5 before echoing ++it to the screen. ++ ++* The parser now detects when a move is ambiguous and returns an ++error, instead of arbitrarily choosing one possibility as it used to. ++ ++Mon Aug 10 18:40:47 PDT 1992 (patchlevel 23) mann@src.dec.com ++ ++* Added code so parser can handle fully qualified algebraic, e.g., ++Ng1-f3, N/g1-f3, Ng1f3, or even Pe2-e4. The "P" and "/" work only for ++fully qualified moves, not generally. ++ ++* Fixed parser bugs in handling moves with rank or file disambiguator, ++e.g. N1f3 or Ngf3. ++ ++Mon Jul 6 17:55:32 PDT 1992 (patchlevel 22) mann@src.dec.com ++ ++* AIXV3 patch from Tom McConnell; thanks! ++ ++* After hitting the Backward button we see the last move made instead of ++the word "Pausing" displayed. ++ ++* Fixed a couple of problems compiling on IRIX; thanks to Michel Arsenault ++and Alan Walsh for bug reports and help with fixes. ++ ++* Added optional display of algebraic notation coordinates along left and ++bottom edges of board. This was inspired by some code from Jean-Christophe ++Engel; thanks! ++ ++* Swapped EditPosition and Pause buttons to reduce danger of losing the ++game in progress by hitting EditPosition when you wanted Backward. Thanks ++to Ove Lundberg for complaining (though it bugged me too). ++ ++* Despite one complaint, I kept the feature of changing both clocks when black ++makes time control, rather than changing each individually when the player ++involved makes it. This is to avoid having it look like White is way ahead on ++time while Black is thinking about the last move of the time control period ++(i.e., when White has made time control but Black hasn't yet). ++ ++* Corrected clocks to work as in real tournaments. Time is *added* when you ++reach time control; previously the clocks were simply set to the length of the ++new time period. Also, when a player's flag falls, he still does not receive a ++new time allotment at the next time control, but his opponent does still ++receive more time if *his* flag has not fallen; previously, time controls were ++ignored for both players if either flag fell. I forget who reported this bug. ++ ++* Added a small ESIX patch from Kayvan Sylvan. ++ ++Mon Jun 22 13:24:38 PDT 1992 (patchlevel 21) ++ ++* Added some SVR4 support code from Ronald Cole. It's Greek to me. ++ ++* Note: Stephen Meatheringham reports a bug causing xboard to crash with an ++error from the X server when run on a Sun Sparcstation IPX with Solaris 1.0.1 ++and OpenWindows 3.0. This bug has not been tracked down yet. ++ ++* Fixed a problem with ATTENTION code. On some operating systems, you have to ++be even more cautious about when you send a SIGINT to gnuchess, because the ++signal handler gets deinstalled each time it is used, and gnuchess does not ++reinstall it immediately. In particular, if you send a SIGINT and make an ++illegal move or ask for a hint, gnuchess does not reinstall the handler until ++*after* you make your next move, so you had better not send a SIGINT before ++it. I put a workaround for this case into xboard; I hope there are no more. ++ ++* The ATTENTION code is needed when compiling for the ESIX operating system, ++because ESIX has a bug in the FIONREAD ioctl, so the code in gnuchess that ++lets you interrupt its thinking on your time just by typing in your move does ++not work. Perhaps gnuchess will have a workaround for this eventually. ++ ++* Fixed yet another bug in using XtGetValues; code to inhibit shell resizing ++was leaving a null pointer as the place to store the current sizes. ++ ++* Man page fixes: corrected -sl to -sd, updated LIMITATIONS. ++ ++* Added include of conditional on HAS_GETTIMEOFDAY. I hope this ++works for all systems; on mine, and are the same file, ++but with an #ifndef that makes it harmless to include both. ++ ++* Thanks for reports from Mike Pearlman, Stephen Meatheringham, Kayvan Sylvan, ++d87-mal@nada.kth.se, Urban Koistinen, and Ronald Cole. ++ ++Mon Jun 8 11:39:18 PDT 1992 (patchlevel 20) ++ ++* Documented default value of initString and explained what it means. This ++paragraph also serves to inform the user that xboard by default will tell ++gnuchess to think on his time, something one user apparently didn't understand. ++ ++* Redid -searchDepth (formerly -searchLevel) and -searchTime code. They both ++work correctly with gnuchess 3.1 now. The -searchDepth option also works ++correctly with gnuchess 4.0. The -searchTime option does not work with ++gnuchess 4.0.pl50 or earlier because those gnuchess versions do not have a ++working searchTime feature. Instead of having xboard do a half-baked emulation ++of this feature by using a 1-move time control, I will be submitting a patch to ++the gnuchess folks to restore the feature as in 3.1. ++ ++* Improved clock code. It now keeps accurate track of fractional seconds of ++clock running time, if your system has gettimeofday(); if not, it is generous ++about them---if a clock has been going for n.m seconds when it is stopped, only ++n seconds are charged. Previously, xboard would charge one second immediately ++when a clock was started, so if n.m had elapsed when it was stopped, n+1 would ++be charged. This should stop xboard from thinking gnuchess has let its flag ++fall on the last move of a time control, as it often did before. I also ++improved the comments and condensed the code a little. I hope there are no ++systems that have X11 and don't have gettimeofday(), but if there are, I'd like ++to know what to replace it with. ++ ++* "Flag dropped" messages now show up on the top line, beside the clocks, so ++that they don't obscure more interesting messages on the second line. ++ ++* Fixed confusion of NULL and '\000'. ++ ++* Include time.h to get ctime() declaration. ++ ++* Fix to "parser bug" messages in parser.l. ++ ++* Changed code to work with old-fashioned tolower() macro that requires its ++argument to be an uppercase letter. ++ ++* Minor fix to some usage error messages; was reversing program name and ++erroneous argument value. ++ ++* Thanks to Mitch Wright, Ranier Orth, and Henrik Schmiediche for bug reports. ++ ++Fri Jun 5 13:06:08 PDT 1992 (patchlevel 19) ++ ++* Note: xboard does not seem to work when compiled with gcc 1.40 on a ++PS/2 running AIX. It crashes at the sscanf in line 768 of xboard.c. ++You can work around the problem by specifying the -timeControl option ++on the command line instead of defaulting it. This does not seem to ++be a bug in xboard itself; it runs okay on PS/2 AIX when compiled with ++MetaWare High C. [But see 2.1.pl8 above.] ++ ++* Removed bogus files from distribution. ++ ++* Changed variable name that conflicted with SVR4 ttyname function. ++ ++* Thanks to Christoph Strozyk for another bug report, and to several ++of the folks mentioned under patchlevel 18 for testing it. ++ ++Wed Jun 3 17:50:37 PDT 1992 (patchlevel 18) mann@src.dec.com ++ ++* Added an include of sys/fcntl.h to pick up the definition of O_RDWR for ++System V users. ++ ++* Fixed a bug in CatchPipeSignal; was testing the wrong variable to determine ++which chess program got the signal. ++ ++* Removed the declaration of strrchr, which was causing problems for some ++people, and added an include of or instead. ++ ++* Fixed a bunch of type errors uncovered by compilers that check more carefully ++than the one I was using. I just patched many of them with casts---typically ++cases where a function didn't take the same number and type of arguments as the ++X header file prototype said it should---because I didn't see any other way to ++fix them. The versions of the X header files that I have don't actually have ++full prototypes for these function types; they declare only the return type and ++just give the argument types as comments. ++ ++* InitChessProgram returns immediately if chess program died while we were ++waiting for it to say "Chess". I think this fixes a bug that could make xboard ++crash or go into an infinite loop printing "Warning: Select failed; error code ++9" if gnuchess crashed there. ++ ++* Removed code that tries to put the file descriptor used to read messages from ++gnuchess into nonblocking mode. I don't see how this kludge could ever have ++fixed the problem it was intended to (see below), and it seemed to be causing ++a race condition when we were waiting for the initial message from gnuchess ++after it started up. ++ ++* Thanks to Richard K. Lloyd, Konstantinos Konstantinides, Mark ++Seiden, Erik Schoenfelder, Andreas Stolcke, Rainer Orth, Henry Thomas, ++and Kris Van Hees for bug reports and help with fixes. ++ ++Sun May 31 08:00:00 PDT 1992 (patchlevel 17) Bart Massey bart@cs.uoregon.edu ++ ++* 'xboard' suffered from a couple of serious bugs. An initial ++ size needed to be given to the message label to avoid a race ++ condition (!) so I gave it some text (otherwise occasionally ++ xboard would fail because the message widget was 0 width under ++ MIT X11R4). The sizes needed to be Dimension, not int, because ++ they were written in by Xt -- on my big-endian box Dimension ++ is short, causing chaos. Also, I hacked a declaration in for ++ strrchr() to shut the compiler up -- this is arguably a kludge, ++ but I couldn't think of anything better; maybe you can. ++ ++Fri May 22 13:40:50 PDT 1992 (patchlevel 16) ++ ++* First real (non-beta) release of version 2.0. ++ ++* Added GNU copyleft notices covering version 2.0 enhancements. ++ ++Thu May 21 12:30:09 PDT 1992 (patchlevel 15) ++ ++* Removed -g from Imakefile. ++ ++* Added casts in parser.l to prevent warning messages from some C compilers. ++ ++* Bugfix: code to exit if chess program couldn't be started had bug in error ++message printing. ++ ++Tue May 19 11:58:06 PDT 1992 (patchlevel 14) ++ ++* Fixes one small bug: If LoadGame does not find a game in the file, it resets ++xboard to BeginningOfGame mode (as if the Reset button was pressed), instead of ++leaving it in LoadGame mode. ++ ++Mon Apr 13 18:32:27 PDT 1992 (patchlevel 13) ++ ++* Improved error handling when gnuchessx crashes. Now displays a message and ++enters EndOfGame state without exiting. This should help with diagnosing ++gnuchessx problems, since the position and move history are not lost. ++ ++* Debugged man page. ++ ++Version 2.0 -- Thu Apr 2 16:04:54 PST 1992 (patchlevel 12) ++ ++* Added small 40x40 pixel pieces; board size now specified as small, medium, or ++large. ++ ++* Improved man page. ++ ++* Saved position files now say "white to play" if it's white's move. ++ ++* SavePosition while in EditPosition mode now gets side to play right. ++ ++* Made "Pawn" the default on edit position menus. ++ ++* Removed "To play" from edit position menus, since it's redundant. Left ++support code in so it can be restored if someone wants it. ++ ++* Tightened parser's definition of a move number to help further with skipping ++over stuff before the first move. ++ ++* Put back feature of skipping over stuff in game files before a start of game ++marker. This helps when loading electronic mail messages that have things ++like "00" in the header (looks like castling), or that talk about moves in ++running text before the actual game score. Tradeoff is that we can't load ++games that don't either have move numbers or say "gnuchess game" just before ++the moves. ++ ++* Changed version number to 2.0 because others have used "1.3" for patched ++versions of 1.2. Display version number and patchlevel at startup. ++ ++Thu Apr 2 15:30:22 PST 1992 (patchlevel 11) ++ ++* Bugfix: Match started with TwoMachines button now handles the case where ++user loaded/edited a position *and* forced some moves. ++ ++* added error message feedback to many cases where the user's button press is ++rejected because it isn't allowed in the current mode. ++ ++* added -noChessProgram option to allow use as a passive chessboard without ++gnuchess, replacing old buggy scheme that tried to do this automatically when ++gnuchess was not found on the search path. ++ ++* parser accepts "=" in front of promotion piece ++ ++* parser accepts ":" notation for captures ++ ++* Removed SwitchSides button to make room for EditPosition. Left code in ++place, ifdef'ed out. ++ ++* Added EditPosition mode. ++ ++* Reformatted xboard.c to eliminate long lines. ++ ++* Promotion popup now appears near rank to which pawn is moving. ++ ++* UI improvement: Button representing current program mode is kept highlighted. ++ ++* Bug fix: Hint button is now disabled when machine is on move. ++ ++Sat Mar 21 14:57:37 PST 1992 (patchlevel 10) ++ ++* TwoMachines now works from MachineWhite or MachineBlack mode. ++ ++* ForceMoves and Backward/Forward now work at the end of a game started by ++the TwoMachines button. ++ ++* Sends o-o or o-o-o to gnuchess instead of O-O or O-O-O. ++ ++* Bug fix: SwitchSides button is now disabled when machine is on move. ++ ++* Added -searchLevel option and corrected handling of -searchTime to reflect ++the way gnuchess really handles command line options instead of what the ++documentation used to say. Allowed optional ":seconds" on times. ++ ++Tue Mar 17 21:00:35 PST 1992 (patchlevel 9) ++ ++* Removed non-working code that tried to recover when a remote chess program ++could not be started; now exits with a message instead. ++ ++* Now waits for chess program to print its first message (normally "Chess") ++before sending it any commands. ++ ++* Matches between two machines can now start from a black-to-play position or ++black-to-play opening. ++ ++* Bug fix: The program would sometimes lose track of the board position after ++the end of the game, drawing a board full of white pawns next time it got an X ++redraw request. Now fixed. ++ ++* Cleaned up handling of illegal moves in game files. Now we just stop reading ++and go into ForceMoves mode. ++ ++* Saved games against gnuchess indicate who won (restored and debugged 1.2 ++feature). ++ ++* Setting -searchTime turns off -clockMode. ++ ++* My trick for setting up a black-to-play position broke in the transition from ++gnuchess 3.1+ to 4.0. Installed a different trick that works with both. ++ ++* Bug fix: Was clobbering memory by mallocing one byte too few for the file ++name in SetupPositionFromFileProc. This usually resulted in a crash on the ++second attempt to load a position from a file. ++ ++Mon Mar 16 16:49:00 PST 1992 (patchlevel 8) ++ ++* Game and position files are saved in CHESSDIR as well as loaded from there. ++We actually chdir there, so gnuchess listing files also wind up there. ++ ++* Underpromotion moves from gnuchess really work now. ++ ++Sat Mar 14 14:55:24 PST 1992 (patchlevel 7) ++ ++* Cleaned up lots of bugs and kruft in parser.l. It's a wonder the old version ++worked at all. Improved rejection of random text interspersed with the moves. ++ ++* Relabeled buttons to reduce confusion (Play From File --> Load Game; ++Setup From File --> Load Position). ++ ++* Bug fix: Doesn't exit at the end of a game that was started by pressing ++the Two Machines button. ++ ++* Bug fix: Doesn't get confused if you hit Machine Black (White) while ++the machine is already playing black (white) and is on move. ++ ++* Prints "White to play" or "Black to play" after loading a position file. ++ ++* Bug fix: No longer hangs if no start-of-game is found in a game file. ++ ++* More permissive about game file format. The first line is not assumed ++to be a header comment unless it starts with "#". We don't insist on ++seeing a "1." before the first move. ++ ++* Added pop-up dialog to allow underpromotion. Moving a pawn to the last rank ++pops up a dialog to let you select what piece to promote to. Also added code ++to handle underpromotion moves from gnuchess or from a game file correctly. ++ ++* Added code to send SIGINT to gnuchess before trying to move, if gnuchess ++might be busy thinking on our time. The code is ifdef'ed out because it's ++not necessary; only beta-test versions of gnuchess 4.0 at patchlevel 19 or ++below require it. ++ ++Mon Feb 24 20:10:22 PST 1992 ++ ++* Merged fixes received from Stuart Cracraft and Mike McGann, to iconic mode ++and to ShutdownChessPrograms. (They both sent the same fixes.) I did not ++install the change that removed "easy" from the initialization string, so ++xboard will still try to run gnuchessx in "hard" mode (thinking on opponent's ++time) by sending this command. ++ ++Version 1.3 -- Thu Dec 19 18:19:00 PST 1991 mann@src.dec.com (Tim Mann) ++ ++* I've fixed a slew of bugs in this version of xboard: ++ ++* You can now back up from the end of a game, even if gnuchess was playing ++against you. Since gnuchess exits upon mate or draw (when it's not in force ++mode), this feature works by starting up a new copy of gnuchess and feeding it ++the saved starting position and moves. Drawback: the new gnuchess starts with ++clocks at the beginning of a fresh time control. ++ ++* Note: the "force" command to gnuchess is a toggle. I fixed a couple of ++places in xboard where "force" was being issued when gnuchess was already in ++force mode, which resulted in chaos. I don't know if they were in 1.2 or if I ++added them myself in the course of putting in new features. ++ ++* ForceMoves button is now legal in PlayFromFile mode. It closes the game file ++and lets you force moves (or go Backward) from whatever position you've ++reached. ++ ++* The parser now recognizes "white resigns" and "black resigns" (in any ++combination of upper and lower case, with or without the closing "s"). These ++used to be misinterpreted as meaning "white wins" or "black wins" respectively! ++Added "1 - 0" and "0 - 1" as equivalents for "1-0" and "0-1". ++ ++* I removed the parser feature of considering "!" as a comment delimiter. ++"!" is so common as an annotation in game scores that this feature seems like a ++very bad idea. ++ ++* Added a wait() after each successful call to kill() to avoid leaving zombie ++processes around. ++ ++* Removed the feature of putting an indication of how the game ended into the ++internal move list when playing from a file. The only benefit of this was that ++it would get written back out if you saved the game at that point. This ++feature doesn't seem too useful, since you are unlikely to save a game you've ++read in without making any changes, and it caused a lot of problems in the code ++and user interface. The end condition is still displayed as a message when ++it's first read in from the file. End conditions when playing against gnuchess ++are still saved, too. ++ ++* programName is now the last file name component of argv[0], not all of it. ++ ++* xboard.c got three compiler warnings due to arguments that didn't match the ++prototypes on X toolkit functions. I got rid of them by adding some casts, and ++adding extra unused arguments to the ReceiveFromProgram function. ++ ++* As I received it, the distribution had an extra period glued on the front ++of every line that started with a period. This broke the manpage in an ++obvious way. It also broke parser.l in a nonobvious way that stopped ++PlayFromFile from working. ++ ++* Fixed one or two bugs where the clock was started when it shouldn't have ++been. I think one example was if you tried an illegal move in ForceMoves mode. ++ ++* Now starts the machine's clock if you hit MachineWhite when white is on move ++or MachineBlack when black is on move. ++ ++* Now updates the to-move indicator (highlight on clock display) when you use ++Forward/Backward or ForceMoves. ++ ++* gnuchess 3.1+ has a bug that makes it try to think on its opponent's time ++even when in force mode; this causes problems with xboard's SetupFromFile ++command because gnuchess's saved hint move is garbage after the new position is ++loaded, so gnuchess prints out an error message when it tries to think about ++what it would do if the user made this move. Here is a patch for gnuchess ++3.1+: ++ ++*** nondsp.c~ Mon Dec 2 12:37:18 1991 ++*-- nondsp.c Thu Dec 19 15:36:06 1991 ++*************** ++*** 1223,1229 **** ++ ok = flag.quit = false; ++ player = opponent; ++ ft = 0; ++! if (hint > 0 && !flag.easy && Book == NULL) ++ { ++ fflush (stdout); ++ time0 = time ((long *) 0); ++*-- 1223,1229 ---- ++ ok = flag.quit = false; ++ player = opponent; ++ ft = 0; ++! if (hint > 0 && !flag.easy && Book == NULL && !flag.force) ++ { ++ fflush (stdout); ++ time0 = time ((long *) 0); ++ ++* SavePosition/SetupFromFile now handle black-to-play positions. If it's ++black's move in a saved position, the line "black to play" is printed ++immediately after the board display. Upon loading a position, xboard ++looks for "black" at the beginning of this line to determine whether it's ++black's move. ++ ++* SetupFromFile now leaves you (effectively) in ForceMoves mode. This ++eliminates some cases where the program would get into an inconsistent state, ++and hopefully is more intuitive for the user, too. ++ ++* PlayFromFile now leaves xboard in ForceMoves mode after playing through all ++the moves in the file. You can use Backward/Forward, make moves, get gnuchess ++to join the game with MachineWhite or MachineBlack, etc. The game file can end ++with either white or black to play. ++ ++* Backward/Forward now seem to work in all cases. Previously using these ++buttons during a game against the machine would get xboard out of sync with ++gnuchess's idea of what was going on, resulting in chaos. Now using these ++buttons puts xboard in ForceMoves mode; you can bring gnuchess back into the ++game using the MachineWhite or MachineBlack buttons. ++ ++Thu Jun 27 15:06:25 PDT 1991 ++ ++ * Remove comment popups during a reset. ++ ++ * Bug in my forward move fix. Didn't work for playgamefile mode. ++ ++Thu Jun 20 15:04:06 PDT 1991 ++ ++ * Can't do a backward move when it isn't your turn because gnuchess ++ gets confused. Similar bug for forward move. Do a bunch of moves, ++ back up move and go forward. These get filtered out now. ++ ++ * Put easy back into the initString. This DISABLES easy mode which by ++ default is ON. ++ ++ * New-line wasn't always being added to forward move strings sent to gnuchess. ++ ++ * Parsed comments as [ ..............text follows ] into d7d5 ++ ++ * Long game file comments cause core dumps on HP systems. ++ ++ * Multiple uses of the get positition file button got confused ++ on the second click. ++ ++ Minor fixes to the 1.2 release ++ ++Version 1.2 -- Tue Jun 11 17:14:12 PDT 1991 ++ ++ * For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D., ++ Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found ++ a lot of bugs that we put into xboard just to see if they were paying ++ attention. They were. ++ ++ * Changed the protocol that xboard uses to work with the new version of ++ gnuchessr. ++ ++ * There was an off by one error with the clock resetting code. Also, ++ the clock display highliting was wrong. Thanks to Bill Shauck for ++ pointing these out. ++ ++ * enumerations are not really integers on some C compilers. I added casting. ++ The new version of gnuchess expects the "go" command for two machine ++ and machine plays white cases. The whiteString resource is for ++ compatibility with previous gnuchess versions which get confused by go. ++ Thanks to Martin D. for catching these. ++ ++ * Fixed a bug where the checkmate message wasn't being parsed and xboard ++ kept playing. Also, the message was added to game file if saved. ++ Thanks to Scott Hemhill for pointing this out. ++ ++ * Fixed a bug where saving a long game, resetting and saving a short game ++ resulted in appending the end of the long game to the short one. ++ If a game is just being played out and there is no reason for gnuchessr ++ to be used, ignore pipe signals. This allows people to use xboard ++ as a chess board without need for gnuchess. Also, trivially bad moves ++ such as e2e2 are not passed on to gnuchessr but instead ignored out of ++ hand. This allows people using xboard as a chessboard with gnuchessr ++ to pick a piece up, think and put it back down without making a move. ++ Thanks to Jeff Kenton for pointing these out. ++ ++ * Added the CHESSDIR environment variable. Game and position files are ++ found in this directory. If this variable is not declared, then the ++ current directory is used. File names starting with / are treated ++ specially. ++ ++ * The bitmap file names were changed so that none exceeded 14 characters. ++ This is necessary for R5. ++ ++ fcntl(from_prog[0], F_SETFL, O_NDELAY); ++ ++ The xboard fix was to set non-blocking i/o on the read pipe for gnuchessr ++ ++ printz ("Illegal move (no matching move generated)"); ++ ++ * fixed a problem with the new version of gnuchessr where xboard wasn't ++ getting gnuchessr error messages for illegal moves. The problem seems ++ to be fixed *without* any gnuchess changes but this is likely to be ++ highly system dependant. There should be a new line on line 246 of nondsp.c ++ ++ * -iconic doesn't work at all now. The Iconify() does work. This was ++ a tradeoff and it is really an Xt bug. ++ ++ * Fixed a compiler warning for gcc and an error for the IBM RT compilers. ++ This is the VOID_PROC macro in xboard.h. Thanks to David Jensen for this. ++ ++ * If the DisplayWidth or DisplayHeight is less than 800, use small size mode. ++ Also the size of the name widget was reduced from 500 pixels to 400 pixels ++ because in small size mode there was a gap on the right. ++ Changed the default font from fixed to helvetica_oblique14 to: ++ **-helvetica-bold-r-normal--14-*-*-*-*-*-*-* ++ helvetica_oblique14 is a font alias not on all R4 systems. ++ Curiously enough, the 17 point is not available on 75dpi systems ++ and the 18 point font is not available on 100dpi systems. ++ Thanks to Richard K. Lloyd for pointing these out. ++ ++ * Minor hacks to work with R5 alpha. Had to add an event handler to the ++ boardWidget to get translations to work. This may go away with the real R5. ++ Added WM_PROTOCOLS: QuitProc() for R5 ICCCM compatibility. ++ ++ * If the first character of the file is not `1' then the first line ++ of a game or position file is displayed as the name in a label widget. ++ ++ * Added a PopUp dialog for getting file names. ++ ++ * Modified the code to use the R4 routines rather than R3 compatibility. ++ ++ * Changed the forwards/backwards/readgamefile code to allow a play to step ++ back and forth in a game. If he steps all the way to the beginning ++ he has to restart the game. If he gets into a mated position, same problem. ++ ++ * Moved the man page from xboard.1 to xboard.man. This makes imake man page ++ installs work correctly. Thanks to Richard K. Lloyd for pointing this out. ++ ++ * Corrected the queening code. XBoard was sending the wrong syntax. ++ It was sending for example h8(Q) when it should have been sending h8q. ++ Thanks to Paul Vaughan and Mike McGann for pointing this out. ++ ++ * Added a lex parser for algebraic games. It should be easy to use the parser ++ for other interfaces such as the Microsoft Windows version. ++ It parses comments of the form [anything] and ! to the end of a line. ++ ++Version 1.1 -- Mon Jan 7 14:46:03 PST 1991 ++ ++ * Roger Dubar, Konstantinos Konstantinides, Wolfgang S. Rupprecht, ++ Paul Scowen, Mvh Smidt and Kayvan Sylvan all helped immensely during ++ beta-testing. ++ ++ * older non-ANSI versions of Sun compilers complain vociferously. ++ ++ * the remoteShell resource was added for HP-UX systems ++ and other systems where the remoteShell isn't rsh. ++ ++ * -iconic doesn't work properly. If XBoard is opened iconic then ++ iconifying it later with a keystroke doesn't work. I think ++ this is an Xt bug. ++ ++ * For systems with smaller screens, XBoard can use smaller pieces, ++ and a smaller board. -bigSizeMode False uses a smaller set of pieces. ++ These are scaled versions of the large pieces. They look ok but could ++ be improved. ++ ++ * getlogin() does not work in all cases. ++ It was replaced by getpwuid(getuid())->pw_name). ++ ++ * Warning messages get displayed in the message box. ++ ++ * Any button restarts a paused game. ++ ++ * Kayvan Sylvan contributed a patch for ESIX. ++ It seems that select() on pipes is broken on his system. We declined ++ to incorporate his patch though, because it was a work-around for ++ something that was broken on one system, and selfishly, that system ++ was not my own. Nevertheless, it is likely that other System V users ++ on PC's may need to use this patch and it is is included as the file ++ ESIX.patch. To use it, type ++ ++ patch xboard.c ESIX.patch ++ ++ * Fixed a bug where hint didn't work. The local version of gnuchessr ++ had been hacked. The fix was to clone stderr and stdout for gnuchessr. ++ ++ * Fixed a bug where a player could play after a game had been finished. ++ ++ * The bitmaps have been pushed into the bitmaps directory. ++ ++ * Substantially rewrote and simplified the Two Machine code. ++ ++ * Added StrStr() because many systems don't have this ANSI function. ++ ++ * Added keyboard equivalents. Added an iconify keystroke, C or c. ++ ++ * Works with gcc now. gcc complained about casting float constants ++ as XtPointers. ++ ++ * Detect if the visual doesn't support color. If so, run in monoMode. ++ An alternative would be to detect grayscale visual and use a collection ++ of gray user interface colors. ++ ++ XBoard.clockMode: False ++ ++ * For people who don't like or use chess clocks a clockMode switch ++ has been added. It is on by default. It can be turned off in the ++ .Xdefaults file with ++ ++ * Added a declaration, xtVersion, which will quickly break on R3 Intrinsics. ++ ++ * Hal Peterson contributed a new Imakefile. ++ ++ * Rewrote DisplayClocks(). ++ ++ * Rewrote TwoMachinesPlay mode. ++ ++ * Konstantinos Konstantinides added the -searchTime option. ++ ++ * Substantially rewrote and simplified the clock code. If a game was paused ++ and then resumed, the clocks were out of sync. ++ ++ * Fixed a bug in HandleUserMove() where the user could make a move while the ++ machine was thinking. The fix detects and ignores these moves. onMove ++ was not being used and was removed. ++ diff --cc FAQ.html index 74435a1,2c07930..eef95e9 --- a/FAQ.html +++ b/FAQ.html @@@ -1,1699 -1,1701 +1,1700 @@@ -- --XBoard and WinBoard: Frequently Asked Questions -- --

XBoard and WinBoard: Frequently Asked Questions

-- --This document answers some frequently asked questions about the --graphical chess interfaces XBoard and WinBoard. --A hyperlinked version of this FAQ is available on --the Web through the page --http://www.tim-mann.org/chess.html. -- --This FAQ is in need of revision. Please contact us if you'd like --to help update it. -- --
--

Outline

-- -- -- --
--

Detailed contents

-- -- -- --
--

[A] Introduction and hot topics

--
--

[A.1] What are XBoard and WinBoard?

-- --XBoard and WinBoard are graphical user interfaces for chess. --XBoard runs with the X Window System on Unix systems (including --GNU/Linux); see topic --[B.1]. --WinBoard runs on true 32-bit Microsoft Windows operating --systems, such as Windows 95, 98, NT, --2000, ME, XP, and should continue to work --on future 32-bit Windows systems. It does --not work on Windows CE (also known as Pocket PC), nor does it work on --16-bit Windows systems such as Windows 3.1. See topic --[B.2]. -- --
--

[A.2] Where can I get chess information and chess --software?

-- --As a shortcut to most things mentioned in this FAQ, try Tim Mann's --Chess Web page, http://www.tim-mann.org/chess.html. This page page is a good --place to get the latest released versions of XBoard and WinBoard and --the most up-to-date version of this FAQ. Also see our Savannah --project pages at https://savannah.gnu.org/projects/xboard/. -- --

If you have other questions about XBoard/WinBoard that aren't answered --in this FAQ, you can try Aaron Tay's WinBoard and Chess Engines FAQ, at --http://www.aarontay.per.sg/Winboard/. -- --

For general news and information about chess, try the newsgroup hierarchy --rec.games.chess.*, especially the groups rec.games.chess.misc and --rec.games.chess.computer. Both of the latter groups have very informative --FAQs maintained by Steve Pribut; look for them on the newsgroups or at --http://www.clark.net/pub/pribut/chess.html. -- --

Like other GNU software, you can get XBoard, and --WinBoard by anonymous FTP from --ftp://ftp.gnu.org/pub/gnu/ --and its many mirror sites. Look in the subdirectories xboard, and winboard. --The .tar.gz suffix on the files there indicates they were packed with tar --and compressed with gzip. The .exe or .zip suffixes indicate files that --were packed and compressed with zip. -- --

For other chess software, try the Internet Chess Library. Use anonymous FTP --to connect to ftp.freechess.org, or go to the Web page --http://www.freechess.org/. --You can get chess software, game --collections, the FAQ file for rec.games.chess, and other chess-related --material there, in the directory pub/chess. The FTP server can --automatically decompress files for you as you download them, useful if you --don't have gzip. -- --

Here is a sample anonymous ftp session. Some of the ftp server's responses --are abbreviated, but all the commands you must type are included. -- --

--    % ftp ftp.gnu.org
--    Connected to ftp.gnu.org
--    Name: anonymous
--    Password: your-email-address@your-site
--    ftp> binary
--    200 Type set to I.
--    ftp> cd /pub/gnu/xboard
--    ftp> dir
--    -rw-r--r-- 1 14910 wheel  1057625 May 20 00:25 xboard-4.2.7.tar.gz
--    ftp> get xboard-4.2.7.tar.gz
--    150 BINARY connection for xboard-4.2.7.tar.gz (1057625 bytes).
--    226 Transfer complete.
--    ftp> quit
--
-- --
--

[A.3] What are the current version numbers for --XBoard and WinBoard?

-- --At this writing, the current version numbers are: -- --
    --
  • XBoard 4.2.7
  • --
  • WinBoard 4.2.7
  • --
-- --
--

[A.4] Who is working on this project?

-- --Please see our Savannah project pages at https://savannah.gnu.org/projects/xboard/ for a list of active --developers. Many others occasionally contribute suggestions and --snippets of code, for which we are grateful. -- --
--

[A.5] How do I report bugs, offer help, etc.?

-- --

Bug reports, suggestions, and offers to help on XBoard --or WinBoard should be sent to - bug-xboard@gnu.org. - -

Beginner questions and discussion about the program may get faster - answers on the WinBoard Forum at http://f11.parsimony.net/forum16635/. - -

If you are developing a - chess engine that works with XBoard or WinBoard (or an alternative - GUI that works with such engines), see the Chess Engines mailing - list, hosted at - http://groups.yahoo.com/group/chess-engines. - -

Any time you want to report a possible bug in XBoard or WinBoard, - we need to know exactly what you did, and exactly what error (or - other) messages you got. - -

If you are using Unix, run the "script" program, run XBoard with - the -debug flag (if you get as far as running it), do whatever is - necessary to reproduce the problem, type "exit" to the shell, and mail - us the resulting typescript file. We also need to know what - hardware/operating system combination you are using. The command - "uname -a" will usually tell you this; include its output in your - typescript. - -

If you are using MS Windows, run WinBoard with the -debug flag, and - send us a copy of the WinBoard.debug file. If you aren't sure how to - add command-line flags to WinBoard, you can hit Ctrl+Alt+F12 to create - a WinBoard.debug file after WinBoard starts, but that is not as good, - because a few messages that would have been printed at the start are - lost. - -

Either way, please send us the exact text of the commands you typed - and the output you got, not just your recollection of approximately - what they were. The messages may seem meaningless to you, but they - are very meaningful to us and essential for diagnosing problems. - -


-

[A.6] What are the future plans for XBoard and - WinBoard?

- -

Our plans are always in flux. As with most free software projects, - the next release will happen when it happens -- or it may never - happen. This has always been the policy for XBoard/WinBoard. - Releases have never been promised in specific time frames. - -

Starting in November 2003, several new developers have joined the - project, and work is now hosted at https://savannah.gnu.org/projects/xboard/. Lots of work is just - getting underway, but nothing is far along yet. - -

Here is a partial list of items that have a nonzero probability of - happening in finite time. - -

    -
  • Small bug fixes. Occasionally someone sends us a fix, or reports - a small bug very clearly so that we're able to fix it in a few minutes - work.

    - -

  • Protocol version 3. The members of the chess engine authors' - mailing list discussed a set of proposed features for the next version - of the XBoard/WinBoard chess engine communication protocol. - Unfortunately, this project has gotten only as far as that discussion - took it; no revisions of the protocol spec or coding have been done - yet. A few simple features are very clearly needed, though, and will - probably appear in time.

    - -

  • Contributed features. Several people have mailed me code to add - various features. Most of this code is available on the - XBoard/WinBoard extensions page at http://www.tim-mann.org/extensions.html, but it is not in any - official releases yet. We are in the process of getting folks to - formally assign the copyrights on their contributions to the Free - Software Foundation so that we can include it in official releases in - the future.

    - -

  • Internationalization. Several people have expressed interest in - internationalizing XBoard/WinBoard, and so hopefully this project will - go forward. Once the internationalization support is in, we will need - more translators. Watch for news on the xboard-devel mailing list on - our Savannah pages. - -
- -
-

[B] XBoard and WinBoard

-
-

[B.1] What is XBoard?

- - XBoard is a graphical user interface for chess. It displays a - chessboard on the screen, accepts moves made with the mouse, and loads - and saves games in Portable Game Notation (PGN). XBoard is free software. - It serves as a front-end for many different chess services, including: - -

Chess engines that will run on your machine and - play a game against you or help you analyze, such as GNU Chess and - Crafty (topic [D.3] below). - -

Chess servers on the Internet, where you can - connect to play chess with people from all over the world, watch other - users play, or just hang out and chat. - -

Correspondence chess played by electronic - mail. The cmail program (topic [B.6] below) - automates the tasks of parsing email from your opponent, playing his - moves out on your board, and mailing your reply move after you've - chosen it. - -

The Web and your own saved games. You can use - XBoard as a helper application to view PGN games in your - Web browser, or to load and save your own PGN files. - -

XBoard runs under Unix or Unix-compatible systems. It requires the - X Window System, version X11R4 or later. There are also ports of - XBoard to 32-bit Microsoft Windows and to - the Amiga. See topics [B.2] and [B.3] respectively. - -


-

[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?

- - WinBoard is a port of XBoard to 32-bit Microsoft Windows systems, such - as Windows 95, 98, NT, 2000, ME, and XP. It uses the same back end - chess code as XBoard, but the front end graphics code is a complete - rewrite. WinBoard is free software. - -

The WinBoard distribution includes a port of GNU Chess to Win32. - The GNU Chess port is distributed in executable form, with instructions for - rebuilding it from the standard GNU Chess sources (available separately). You - should have at least 16 to 24 MB of memory to run GNU Chess with WinBoard. - -

The WinBoard distribution also includes the ICC timestamp and FICS - timeseal programs (topic [B.12]). - -

cmail (topic [B.6]) has not been ported to - Windows. All the other XBoard functions are included in WinBoard. - The International Email Chess Group web site at http://www.iecg.org/ recommends - ECTool (http://www.ectool.nu/) - for playing correspondence chess under Windows. - -

You install WinBoard as follows. Download the WinBoard package to - your PC (see topic [A.2]). It will be a file - with a name like winboard-4_0_0.exe. Double-click on this file - in the Explorer or File Manager to run it. Follow the on-screen - prompts. - -


-

[B.3] Is there an XBoard for the Amiga? What is AmyBoard?

- - AmyBoard is a port of XBoard to the Amiga, by Jochen Wiedmann. - The distribution includes a port of GNU Chess. - AmyBoard is free software. - -

The current version of AmyBoard is 330.5 (based on XBoard 3.3.0). - No one is currently maintaining it. - -

System requirements: - -

    -
  • An Amiga (obviously :-), running OS 2.04 or later, 2Mb RAM or more.
  • -
  • MUI 2.0 or later.
  • -
  • Workbench or another screen with no less than 640x400 pixels (adjustable - with the MUI-Prefs); this restriction is just because we don't have - bitmaps with less than 40x40 pixels per square. If someone contributes - bitmaps with 20x20 or 20x25, they will work with any Hires mode.
  • -
-

- If you would like to use an ICS, you need an Internet connection via either - -

    -
  • a telnet-like program, or
  • -
  • a terminal program reading from stdin and writing to stdout.
  • -
-

- AmyBoard is available in the Internet Chess Library (topic [A.2]). - -


-

[B.4] Is there an XBoard for the Macintosh?

- - Note: I am not a Mac user and have not tried this myself, so I cannot - answer questions about it. - -

Because MacOS X has a Unix base, XBoard will compile and run on it. - You do need an X11 (X Window System) server and client libraries. I'm - told that these come standard with MacOS X 10.3 and later. Once you - install the X11 package, XBoard is reported to compile and run without - changes. - -

You can avoid having to compile XBoard (and GNU Chess) yourself by - using the Fink sofware packaging system. See - http://fink.sourceforge.net/ and - http://finkcommander.sourceforge.net/ for more info on Fink. - -

There is no version of XBoard or WinBoard that runs with the native - (non-X11) Mac graphical interface, and none that runs on MacOS 9 or - earlier. - - -


-

[B.5] Does XBoard run on VMS?

- - No. This port would probably be a lot easier than the Win32 and Amiga - ports were, because VMS has the X Window system (under the name - DECwindows) and is now POSIX compliant. If you are working on this, - send mail to bug-xboard@gnu.org to let us know. - -
-

[B.6] What is cmail?

- - cmail is a program that helps you play and keep track of electronic mail - correspondence chess games using XBoard. It is distributed with XBoard and - has its own manual page. cmail is free software. It was written by - Even Welsh. cmail has not been ported to Windows; sorry. - -
-

[B.7] How do I build XBoard? Do I need gcc?

- - The first step to building XBoard is to get the distribution file. See topic - [A.2] for places you can ftp the software from. - -

Next, decide what directory tree you are going to install XBoard - in. The default is /usr/local, but you probably don't have write - access to that directory unless you are a system administrator. If - you do, type the following to install it there: - -

-     gzip -cd xboard-*.tar.gz | tar -xvf -
-     cd xboard-*/
-     ./configure
-     make
-     su
-     make install
- 
- - If you want to install xboard in your personal home directory ($HOME/bin), - type this: - -

-     gzip -cd xboard-*.tar.gz | tar -xvf -
-     cd xboard-*/
-     ./configure --prefix=$HOME
-     make
-     make install
- 
- -

If the first step above fails because you don't have gzip, see - topic [A.2], and ask a local Unix expert if you - need more help. If you have any problems with the last two steps, - read the READ_ME and INSTALL files in the xboard-*/ directory. You - will also find this FAQ there. - -

You don't need to have gcc to build XBoard. Almost any Unix C - compiler should do. - -


-

[B.8] Can I use XBoard or WinBoard to play a game - of chess with another human?

- - The only way for two humans on different machines to play chess in - real time using XBoard/WinBoard is to use an Internet Chess Server - as an intermediary. That is, each player runs his own copy of XBoard - or WinBoard, both of them log into an ICS, and they play a game there. - Two copies of XBoard/WinBoard cannot communicate with each other - directly. - -

Instructions on how to get started with Internet chess are included - with the XBoard and WinBoard distributions. The network addresses - included in the distribution may not always be current. The oldest - and largest ICS is the Internet Chess Club at chessclub.com, which now - has a fee for registered use, but still allows free unregistered use. - There are also many newer sites with no fees, using the Free Internet - Chess Server implementation (FICS). The most active FICS site is - freechess.org. On these and most other chess servers, - the port number to use is 5000. - -

If you don't have network connectivity to any ICS site, you - can run your own server using a version of the FICS code, but this - is not easy. See http://www.tim-mann.org/ics.html#ownics for advice and pointers. - -

The cmail program included with XBoard lets you play email postal games with - another human; see topic [B.6]. - -

Two humans can play chess on the same machine using one copy of - XBoard/WinBoard in - Edit Game mode, but the clocks don't run in this mode, so it's of limited - usefulness. - -

See also topic [D.2], Winsock Chess. - -


-

[B.9] Will WinBoard run on Windows 3.1? - How about Windows CE (also known as Pocket PC)? -

- - WinBoard does not run on Windows 3.1, Windows for Workgroups 3.11, etc., - not even with the Win32s compatibility package. The main problem is - that Win32s does not have threads or real concurrent processes. A - port of WinBoard to Windows 3.1 is possible in theory, but it would be - difficult and messy, and no one is going to do it. - -

WinBoard does not run on Windows CE (also - known as Pocket PC). I don't know what would be required to port it. - -

WinBoard does run well on full 32-bit versions of Windows, such as - Windows 95, 98, NT, 2000, ME, and XP, and should continue to work - on future 32-bit Windows systems. - -


-

[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files - with my Web browser?

- - 1) On Unix systems: -

- - Add the following line to the file .mime.types in your home directory. - (Create the file if it doesn't exist already.) -

-     application/x-chess-pgn    pgn
- 
-

- - Add the following line to the file .mailcap in your home directory. - (Create the file if it doesn't exist already.) -

-     application/x-chess-pgn; xboard -ncp -lgf %s
- 
-

- - Exit from your Web browser and restart it. - -

2) On MS Windows systems: - -

The exact procedure depends on which Web browser you are using. - The current version of WinBoard automatically configures itself as - your PGN viewer for local files, Netscape 4.x and later, and Internet - Explorer. This automatic setup probably works for all other current Web - browsers, too. - -


-

[B.11] How do I use WinBoard as an external viewer - for PGN files with the MS Windows File Manager or Explorer?

- - WinBoard sets this up automatically when you install it, except on old - versions of Windows NT (prior to 4.0). On Windows NT 3.51 or earlier, - go to the File Manager, click on the File menu, select Associate, - enter "pgn" as the extension, and use the Browse button to find your - copy of WinBoard and set up the association. - -
-

[B.12] How do I use ICC timestamp or FICS timeseal - with XBoard?

- - First, get the appropriate version of timestamp or timeseal for your - machine from ftp.chessclub.com or ftp.freechess.org. - Second, be sure that you can connect using XBoard without - timestamp/timeseal. Third, be sure that you can connect using - timestamp/timeseal without XBoard. See the help files on ICC and FICS - or ask people online if you have problems. - -

If you are in a completely ordinary situation, where your machine - is directly on the Internet and you can connect to ICC or FICS - without timestamp/timeseal using - just the command "xboard -ics" or "xboard -ics -icshost freechess.org", - change that command to one of the following: - -

-     xboard -ics -icshost 204.178.125.65 -icshelper timestamp
- 
-     xboard -ics -icshost 164.58.253.13 -icshelper timeseal
- 
- -

If you have a firewall between your machine and the ICS, see topic - [B.19]. - -

If you normally have to use the "/icscomm" command line option on - xboard to log into a second machine, and then telnet to ICC or FICS - from there, you are going to have to run the Unix version of timestamp - or timeseal on the second machine. (If the second machine is not - running Unix, you are out of luck.) Get the appropriate version of - timestamp or timeseal onto the shell machine via FTP; see the help - files on ICC and FICS for instructions. Then simply run it when you - would normally run telnet. In this configuration you are not - protected against lag between your PC and the shell machine, or for - lag caused by heavy load on the shell machine itself from other users. - -

For further information on timestamp and timeseal, see the help - files on ICC and FICS. - -


-

[B.13] How do I use ICC timestamp or FICS timeseal - with WinBoard?

- -

If you select an ICS from either the WinBoard Startup dialog or the - Windows Start submenu that WinBoard installs, WinBoard automatically - runs timestamp or timeseal if the ICS you chose is known to support it. - -

If you are constructing a WinBoard command line by hand, add the - option "/icshelper timestamp" or "/icshelper timeseal" to the WinBoard - command line to use timestamp or timeseal. Both timestamp.exe and - timeseal.exe are included in the WinBoard distribution. They both - function identically to the Unix versions, as documented in "help - timestamp" on ICC and "help timeseal" on FICS. - -

If you have a firewall between your machine and the ICS, see topic - [B.19]. - -

If you normally have to use the "/icscomm" command line option on - WinBoard to log into a shell account, and then telnet to ICC or FICS - from there, you are going to have to run the Unix version of timestamp - or timeseal on the shell machine. (If the shell account is not on a - Unix machine, you are out of luck.) Get the appropriate version of - timestamp or timeseal onto the shell machine via FTP; see the help - files on ICC and FICS for instructions. Then simply run it when you - would normally run telnet. In this configuration you are not protected - against lag between your PC and the shell machine, or for lag caused by - heavy load on the shell machine itself from other users. - -

For further information on timestamp and timeseal, see the help - files on ICC and FICS. - -


-

[B.14] How do I play bughouse with XBoard or WinBoard? -

- - XBoard and WinBoard have simple but effective bughouse support. - Offboard piece holdings are shown in the board window's banner, and - you drop offboard pieces using the right mouse button. Press it over - the destination square to pop up a menu of pieces. - -

XBoard and WinBoard can display only one board at a time, but you - can observe your partner's game by running a second copy of the - program and logging in as a guest. (Unfortunately, this is not - possible if you are using the /icscomm option.) To observe your - partner's games automatically, use the "follow" or "pfollow" ICS - command; see the ICS online help for details. - -


-

[B.16] What is Zippy? How can I interface a - chess program to the Internet Chess Servers?

- - Zippy is an interface that lets a compatible chess engine (such as GNU - Chess or Crafty) act as a computer - player on an Internet Chess Server. Zippy is included in both the - XBoard and WinBoard distributions. It is implemented as a small - amount of additional code within XBoard or WinBoard. - For documentation, see the file - zippy.README, included in both distributions or available - from my chess Web page, - http://www.tim-mann/chess.html. - The version of zippy.README on my Web page is often more up-to-date - than those in the XBoard/WinBoard distributions. - You'll also find a "biography" of Zippy and pointers to the original - Zippy the Pinhead comic strips on my Web page. - Please read zippy.README carefully before you ask me any questions about Zippy. - -

Using a computer to choose your moves on a chess server is - considered cheating unless your account is on the computer (C) list. - Read "help computer" on your favorite server for details on their - policy. Most of the servers have plenty of computers running now, so they - will not be excited about having you run a new one unless you have - written your own chess engine. They don't really need yet another - Crafty or GNU Chess clone. - -


-

[B.17] How can I interface my own chess program - to XBoard or WinBoard?

- - This is a non-trivial task. XBoard and WinBoard were not designed - with a clean interface for talking to chess programs; they were - written to work with an existing version of GNU Chess that expects to - be talking to a person. Your program has to emulate GNU Chess's - rather idiosyncratic command structure to work with XBoard and - WinBoard. We are gradually cleaning up, improving, and documenting - the interface as newer versions of XBoard and WinBoard come out, - however. - -

For documentation, see the file engine-intf.html, included in both - distributions or available from my chess Web page, http://www.tim-mann.org/chess.html. - The version of engine-intf.html on my Web page is often more up-to-date - than those in the XBoard/WinBoard distributions. - -


-

[B.18] How can I recompile WinBoard from source?

- - The source code for WinBoard is available from the author's Web page, - http://www.tim-mann.org/chess.html. - -

WinBoard is currently developed using Microsoft Visual C++ 5.0. - You can build the program from the MSVC++ GUI by opening the project - file (winboard.dsp) and telling MSVC++ to build the project. You can - also build it from the the command line by using the nmake program - supplied with MSVC++. - -

To build WinBoard with the free Cygwin tools, available from http://www.cygwin.com/), use the - command "make -f cygwin.mak". WinBoard 4.2.5 was successfully - compiled with the net release of Cygwin as downloaded on 20-March-2001 - (cygwin1.dll 1.1.8, gcc 2.95.2-6, binutils 20001221-1, flex 2.5.4-1), - but exhibits a command-line parsing bug; see item 511 in the ToDo file - that comes with WinBoard. WinBoard 4.1.0 does not compile with - Cygwin. WinBoard 4.0.7 is known to compile with Cygwin BL20.1. - -

To build WinBoard with Borland C++ 4.5, use "borland.mak", supplied - with the WinBoard sources, as the Makefile. Support for Borland C++ - was contributed by Don Fong and has not been tested by the author of WinBoard. - -

WinBoard is a Win32 application, so you definitely need a compiler - and tool set that supports Win32. In particular, older versions of - DJGPP can build only 32-bit MSDOS programs; that is, programs that use - a DOS extender to get a 32-bit address space and do not make any - Windows calls. The latest versions of DJGPP are said to be able to - build Win32 programs when used with the proper extension package(s), - but this is not known to work with WinBoard. Use Cygwin instead. - -

See also topic [C.16]. - -


-

[B.19] - How can I use XBoard or WinBoard to talk - to an Internet Chess Server through a firewall or proxy? -

- -

There is no single answer to this question, because there are many - different kinds of firewalls in use. They work in various different - ways and have various different security policies. This answer can - only provide hints. - -

Note that you can't access Internet Chess Servers through a Web proxy, - because they are not a Web service. You talk to them through a raw - TCP connection, not an HTTP connection. If you can only access the - Web through a proxy, there may be a firewall that stops you from - making direct TCP connections, but there may also be a way through it. - Read on for hints, and contact your local system administrator if you - need more information about your local configuration. - -

A helpful user mailed me the following explanation of how to use - WinBoard with WinGate: -

- "I have managed to setup WinBoard though my WinGate proxy. I have the - Office version. What I needed to do was to setup the TCP/IP - connection to add the User/Host name and my provider service name for - the DNS, but I had to leave the HOST IP address blank. I have not - played with all the variations, so it may be just that I have the DNS - lookup enabled." -
- I hope this helps, though I don't find it very clear. I don't have - a copy of WinGate myself and can't help if you have questions about it. - -

If you are using some other non-SOCKS firewall, read the FIREWALLS section - in your XBoard or WinBoard documentation (man page, info document, or - Help file). If you can telnet to a chess server in some way, then you - can almost certainly connect to it with xboard/WinBoard, though in - some cases you may not be able to run timestamp or timeseal. The - timestamp and timeseal protocols require a clean, 8-bit wide TCP - connection from your machine to the ICS, which some firewalls do not - provide. - -

If you have a SOCKS firewall and are using XBoard, - you should be able to SOCKSify xboard and use it. See http://www.socks.nec.com/ for - information about SOCKS and socksification. However, if you do this, - you can't use timestamp or timeseal; what you really need is a - socksified version of timestamp or timeseal. This is hard because the - source code for timestamp and timeseal is proprietary; the folks - running the chess servers don't give it out because that would make it - too easy to cheat. On some versions of Unix, you may be able to - socksify a program that you don't have the source code to by running - it with an appropriate dynamic library; see http://www.socks.nec.com/. For - others, you might be able to get a pre-built socksified version from - the chess server administrators. For timeseal versions, see ftp://ftp.freechess.org/pub/chess/timeseal/. For timestamp - versions, the directory would be ftp://ftp.chessclub.com/pub/icc/timestamp/, but at this writing - there don't seem to be any socksified timestamps there. Once you have - a socksified timestamp or timeseal, simply run it with a normal, - non-socksified xboard in place of the standard timestamp or timeseal. - -

If you have a SOCKS firewall and you are using - WinBoard, we now know how to make this configuration - work, complete with timestamp or timeseal! - -

Start by getting SocksCap32. This software is freely available - from http://www.socks.nec.com/. - Install it on your machine, read the documentation, and learn to use - it. You may find it useful with many other programs besides WinBoard. - -

Next, don't socksify WinBoard. Socksifying - WinBoard itself doesn't let you use it with timestamp or timeseal. - For some reason I don't understand -- something strange that - SocksCap32 does -- the socksified WinBoard runs but does nothing, and - timestamp/timeseal runs all by itself in its own window. - -

Instead, use the following workaround. Follow the instructions - exactly; don't try to skip steps or simplify things. - -

First, make SocksCap32 application profiles for timestamp and - timeseal. Use the following command lines in the SocksCap32 - profiles. Name the first profile "timestamp" and the second - "timeseal". - -

-     "c:\program files\winboard\timestamp.exe" chessclub.com 5000 -p 5000
-     "c:\program files\winboard\timeseal.exe" freechess.org 5000 -p 5000
- 
- -

Second, run timestamp or timeseal by itself, socksified, using its - profile. This will open an unneeded, black window that will not - respond to typing. Minimize it to the task bar and ignore it. It will - go away when you exit from WinBoard. - -

Next, run WinBoard using the following command line. Make a shortcut - or type this command into an MS-DOS Prompt box. Don't run WinBoard - itself socksified, just run it directly. - -

-     "c:\program files\winboard.exe" /ics /icshost=localhost /icsport=5000
- 
- -

After you get this working, you can try getting the timestamp window to - auto-minimize by starting it from a shortcut instead of from the - SocksCap32 control window. As it says in the SocksCap32 help file, put - the following in the Target field of a shortcut's Properties page: - -

-     "c:\program files\sockscap32\sc32.exe" timestamp
- 
- - Then select "Run: Minimized" on the same page. Do the same for timeseal. - -

Another method that can work is to use a .bat file to start both - timestamp and WinBoard. It would look something like this: - -

-     REM --
-     REM -- icc.bat
-     REM -- Start timestamp under SocksCap32 and use WinBoard to connect to it.
-     REM -- The string "timestamp" refers to a SocksCap32 profile for timestamp.
-     REM --  Do not change it to the filename of the timestamp program!
-     REM --
-     start /minimized "c:\program files\sockscap32\sc32.exe" timestamp
-     cd "c:\program files\winboard"
-     winboard /ics /icshost=localhost /icsport=5000
- 
- -

This workaround has a problem if you want to run two copies of - WinBoard at once, talking to the same chess server twice (for - bughouse) or to two different chess servers. If you need to do that, - you will need to run a separate copy of timestamp with a different - port number for each connection. You'll need to make a second set of - profile entries with a different value after the -p flag (say, 5001) - and you'll need to change the WinBoard command line /icsport=5000 for - the second WinBoard to match. - -


-

[B.20] - How can I use XBoard or WinBoard on chess.net with accuclock? -

- -

I believe chess.net provides a Win32 command-line version of - accuclock that will work with WinBoard. Please see the documentation - on the chess.net server itself; don't ask the author of WinBoard. - -

I don't know whether chess.net provides versions of accuclock for - Unix at this time. Ask them. - -


-

[B.21] - Can I get Zippy to do one or more ICS commands automatically at the - start or end of each game?

- -

By default, Zippy automatically sends the command "gameend" to ICS - at the end of each game. You can alias this command (using the ICS - "alias" feature) to anything you want. On ICC, you can use the - "multi" feature to alias gameend to several commands, but other - servers don't have that feature. Zippy doesn't send anything at the - start of the game by default. - -

You can get Zippy to send one or more commands of your choosing, at - the start and/or end of each game, by using the -zippyGameStart and - -zippyGameEnd command line options, newly added in version 4.0.3. - Both xboard and WinBoard have (somewhat obscure) ways of getting - newlines into this option to send several commands. Here is an - example of one way to do it for each. - -

-     xboard -ics -zp -xrm '*zippyGameStart: say hi\nsay prepare to die\n'
- 
-     WinBoard /ics /zp /zippyGameEnd='say thanks\nseek 5 0\nseek 2 12\n'
- 
- -
-

[B.22] - How do I print from WinBoard? -

- - WinBoard does not have built-in printing functionality. - If you want to print a picture of the board, press Alt+PrintScrn, run the - standard Windows application Paintbrush, select Paste, and print from there. - If you want to print a list of moves, save your game as a PGN file, - then open the PGN file with Notepad or any other plain text editor and - print it from there. - -
-

[B.23] - Can I get Zippy to automatically reconnect to ICS when its connection - breaks?

- -

There isn't a perfect solution to this problem yet, but a pretty - good one is to write a shell script (for xboard) or .bat script (for - WinBoard) that automatically restarts the program whenever it exits. - Use the -xexit flag so that you don't get a popup dialog that must be - dismissed with the OK button before the program will exit. The gap in - this solution is that your connection to ICS can sometimes get into a - state where the program does not notice that the connection is broken - until the next time it tries to send a command. Perhaps some future - version of xboard/WinBoard will have an option to send a harmless - command every five minutes or so. - -

Anyway, here is a sample Windows .bat file that restarts WinBoard each - time it exits. Thanks to Jason Williamson. It assumes that you have put - your computer account's name and password in a file named logon.ini. - -

- REM --
- REM -- wbrecon.bat
- REM -- Start WinBoard in Zippy mode, and restart it each time it exits.
- REM -- Add or change parameters as needed for your application.
- REM --
- :loop
- start /w winboard /zp /ics /icslogon logon.ini /xexit /xautoraise
- REM -- The next line is to have a short delay setup for 139 seconds.
- REM -- Leave it out if it doesn't work on the version of Windows you use.
- TYPE NUL | CHOICE.COM /N /CY /TY,99 >NUL
- goto loop
- 
- -

Here is a Unix shell script to do the same thing for xboard. - It's a bit more elaborate. It is based on the script I use for the - original Zippy. It logs all ICS output to a file named zippy.out, - and it lets you type commands to Zippy by running "cat > zippy.fifo". - -

- #! /bin/sh
- host="204.178.125.65 -icsport 5000 -telnet -telnetProgram timestamp"
- #host="164.58.253.13 -icsport 5000 -telnet -telnetProgram timeseal"
- out=zippy.out
- fifo=zippy.fifo
- ZIPPYPASSWORD='something'
- export ZIPPYPASSWORD
- ZIPPYPASSWORD2='orother'
- export ZIPPYPASSWORD2
- ZIPPYLINES=`pwd`/all.lines
- export ZIPPYLINES
- ZIPPYGAMEEND='say Yow, that was FUN!
- gameend'
- export ZIPPYGAMEEND
- zippylogon=`pwd`/logon.ini
- DISPLAY=`hostname`:0.0
- export DISPLAY
- mv -f $out ${out}.old
- rm -f $fifo
- mkfifo $fifo
- pid=$$
- ( while [ true ] ; do cat -u $fifo ; done ) | \
-       ( while [ true ] ; do
-           xboard -iconic -ics -icshost $host \
-                  -zt -zp -xbell -xanimate \
-                  -xautosave -xquiet -fcp "gnuchessx -h" \
-                  -icslogon $zippylogon -xexit -autoflag -xautoraise $*
-           sleep 600
-         done ) > $out 2>&1 &
- 
- -
-

[B.24] - The chess engines are too strong and always beat me. How can I adjust - the difficulty level to make them weaker?

- -

The simplest way to get that effect is to make sure the - XBoard/WinBoard Auto Flag option is off, set a very fast time control - so that the chess engine can't think for long, but take as much time - over your own moves as you want. Also feel free to use Retract Move if - you make a blunder. - -

Many chess coaches will let you switch sides after - they get a stronger position so that you can get experience playing - positions where you are winning. You can try this with XBoard/WinBoard - by using the Machine White or Machine Black menu command to make the - machine take over your position. - -

The -depth command-line option to XBoard/WinBoard can also be used to - weaken the engine (see the man page or Help file). It's a bit of a - nuisance to set command line options in Windows, but see topic [C.7] for instructions. - -

Other ways of weakening engines are engine-specific. Many of them - let you adjust various parameters, and if you choose bad settings, the - engine will play more poorly. Consult whatever documentation came with - the engine you are using. - -


-

[B.25] - May I use the piece bitmaps from XBoard/WinBoard in my own program?

- -

The piece bitmaps used in XBoard and WinBoard were designed by - Elmar Bartel. He released them under the GNU General Public - License. This means that if your program is also free software - distributed under the GPL, you can use them freely. If your program - is distributed under some other license, including commercial, - shareware, or non-GPL freeware, then you cannot use the bitmaps unless - you obtain special permission from Elmar. See the file README.bitmaps - that comes with the XBoard and WinBoard source code for more - information and an email address you can write to. - -


[C] XBoard and WinBoard, bugs and problems

- -

[C.1] I can't build XBoard - because the X11/Xaw/... include files are not found.

- - These are the header files for the Athena Widgets library, which XBoard uses - heavily. Some versions of Unix don't supply these files, but they are part of - the standard X distribution, freely available from MIT. - -

For general information on getting missing X sources, see the FAQ on - comp.windows.x. Note that you may be missing only the header files, or you - may be missing the libraries themselves too. - -

HP-UX users are missing only the header files. You can get them by - anonymous FTP as follows. (But first check with your system - administrator to see if someone else at your site has already done - this.) Get the archive file /hpux9/X11R5/Core/Xaw-5.00.tar.gz (Xaw - header files) via anonymous FTP from the site hpux.csc.liv.ac.uk - (138.253.42.172), or one of the other official sites---Germany: - hpux.ask.uni-karlsruhe.de (129.13.200.57), US: hpux.cae.wisc.edu - (144.92.4.15), France: hpux.cict.fr (192.70.79.53) or Netherlands: - hpux.ced.tudelft.nl (130.161.140.100). Unpack the archive using gzip - and follow the instructions in its README and/or HPUX.Install files. - Thanks to Richard Lloyd for this information. - -

If you have the Xaw header files installed in a different place - than the other X11 headers, you may need to configure XBoard with an - extra flag to help it find them. For example, if yours are in - /foo/bar/X11/Xaw, try this: - -

-     rm config.cache
-     (setenv CFLAGS -I/foo/bar ; configure)
- 
-

- Also see topic [C.2]. - -


-

[C.2] Configuring or building XBoard fails due to - missing header files, missing libraries, or undefined symbols. -

- - Perhaps you have the X server and client programs installed on your - machine, but not the X header files and link-time libraries. If so, - you can run existing X programs, but you cannot compile a new X - program from source code. In this case the XBoard configure script - will fail and will tell you to look at this question in the FAQ. Many - GNU/Linux distributions put the headers and libraries in a separate - package, which you might not have installed. If you are using RedHat, - install the XFree86-devel package. If you are using some other - kind of Unix, ask your system administrator where to find the X header - files and link-time libraries. If this is not your problem, read on. - -

The configure script for XBoard looks for X libraries and header - files in some common places. Sometimes it fails: If yours are - installed in an odd place, it may not find them at all. If you have - more than one version of X installed on your system, it may find the - "wrong" one, or occasionally it may find libraries from one version - and incompatible header files from another. You can work around these - problems by telling the configure script where the files are. For - example: - -

-     configure --x-includes=/odd/place/include \
-               --x-libraries=/odd/place/lib
- 
- -

The directory named in the argument to --x-includes must have a - subdirectory "X11" that contains the actual .h files. That is, if - your X.h file has full pathname /odd/place/X11R6/include/X11/X.h, then - you must give the argument --x-includes=/odd/place/X11R6/include. - -

Some linkers have bugs that cause bogus error messages when you try - to link X programs. The configure script includes a workaround for a - bug of this kind that exists in some SunOS 4.x.x installations. See - the FAQ on comp.windows.x for more information about problems of this - kind. - -

If all else fails, check whether anyone else at your site has been able to - compile any X programs on your system. Your X installation might be buggy. - If so, the system administrator at your site might know how to fix or work - around the problem. - -

Also see topic [C.1]. - -


[C.3] I have problems using WinBoard on ICS - with a modem. I'm not running SLIP or PPP, but just dialing in to an - ordinary login account ("shell account").

- - Here are solutions to some common problems in this area. - -

Some people want to connect to ICS through HyperTerminal or some other - terminal program first, then run WinBoard. This is not how it works. - WinBoard wants to talk directly with your modem, acting as a terminal program - itself. Start out with the modem "on hook" (not making a call). - -

Run WinBoard with a command line like this (adding more options if desired): - -

-     WinBoard /ics /icscom com1
- 
- - Use com2, com3, or com4 in place of com1 if your modem is connected to one of - those ports. - -

After you start WinBoard, you may need to change some of the options in the - Communications dialog (on the Options menu). The dialog has the usual options - for talking to modems: bits per second, bits per byte, parity, number of stop - bits. You will probably want to use Save Settings Now when you're done. - -

Next, type dialing commands to your modem in the text window that WinBoard - creates. You may need to turn off Local Line Editing on the Options menu - while you are typing commands to your modem. Turn it back on when you're - done. See the WinBoard Help file for instructions if you see your typing - echoed an extra time after you hit Enter. - -


-

[C.4] - I have problems using WinBoard on ICS with Windows 95 and SLIP - or PPP. When trying to start up, it gets the error "Address family - not supported by protocol family" (or some equally strange message). -

- - WinBoard is a 32-bit application, but some Winsock (TCP/IP) implementations - support only 16-bit applications. You get a strange looking error message - if you try to use a 32-bit application because - there is no standard Winsock error code number - for "32-bit application not supported." - -

Microsoft TCP/IP works with both 16-bit and - 32-bit applications, supports SLIP, PPP, Ethernet, etc., and is included - with Windows 95 and later Windows systems. - If possible, I recommend that you uninstall - whatever Winsock you are using and install Microsoft TCP/IP instead. - For more information, see - http://walden.mo.net/~rymabry/95winfaq.html (the Win95-L FAQ). - -

Trumpet Winsock 2.1 (and earlier) supports only 16-bit - applications, and hence does not work with WinBoard. But there is a - beta-test release available that does support 32-bit applications. - I have not tried it with WinBoard, but it - should work. See Trumpet's Web page - http://www.trumpet.com.au/wsk/winsock.htm - for more information. - -

The 16-bit versions of America On-Line's software do not support - 32-bit Winsock applications. Get the 32-bit version. At one time the - 32-bit version was called "AOL for Windows 95," but I imagine that has - changed. Hopefully the current versions are all 32-bit. - -

A few versions of Winsock may have bugs that prevent - Windows timestamp/timeseal from working with them. I'm not sure if - such bugs exist in any versions that actually have 32-bit support, - so this point might be moot. Again, Microsoft TCP/IP is known to work. - -


[C.5] When I try to run WinBoard, I get the - message "Failed to start chess program gnuchess on localhost: NO - LANGFILE (file gnuchess.lan not found)".

- -

This message means that WinBoard is trying to run GNU Chess, but - GNU Chess cannot find a file that it needs, named gnuchess.lan. - If you see it, you've probably customized WinBoard's /fcp, /fd, /scp, - and/or /sd options and made a mistake in the process. Review what - you did, and see the WinBoard help file. - -


-

[C.6] I want to use XBoard or WinBoard as an Internet - Chess Server interface, but the ICS Client option is grayed out on the - menu.

- - XBoard and WinBoard have three major modes that can't be changed from the - menus: local chess engine mode, - ICS mode, and standalone mode. - -

With XBoard, you have to set the mode using command-line options. - Local chess engine mode is the default, -ics selects ICS mode, and - -ncp ("no chess program") selects standalone mode. - -

With WinBoard, if you don't set the mode using command-line - options, you get a dialog box asking which mode you want. To bypass - the dialog box, use -cp ("chess program") for local chess engine mode, - or -ics or -ncp as with XBoard. Also see topic [C.7]. - -


-

[C.7] How do I give command-line options to - a Windows program like WinBoard?

- -

There are many ways; pick your favorite: - -

    -
  • Type the command line into an MS-DOS Prompt box. Example: - "WinBoard -ics". - -
  • Make a Windows shortcut for WinBoard. You can do this by - right-dragging WinBoard.exe to the desktop and selecting "Create - Shortcut(s) Here" from the menu that appears. Right-click on the - shortcut, select Properties, and click the Shortcut tab. The - command-line text box is labelled "Target" instead of "Command line" - just to confuse you. Edit the text in this box, adding the command - line options to the end.
  • - -
  • Choose Run from the Start menu, or File / Run from the Program - Manager or File Manager, and type the command line into the dialog you - get. You may have to give WinBoard's full drivespec and filename if - it is not in a directory on your search path.
  • - -
  • Make a Program Manager icon for WinBoard. You can do this by - dragging WinBoard.exe from the File Manager into the Program Manager, - or by using File / New in the Program Manager. Select the icon and - choose File / Properties. Edit the Command Line text box to add the - command-line options to the end.
  • -
- -
-

[C.9] - When I exit from WinBoard after using it to play against a chess - program on my machine, the chess program keeps running in the background. -

- -

Be sure you have the current versions of WinBoard and the chess - engine you are using. WinBoard 3.4.1 and earlier had a bug that - caused this problem to occur with all chess engines. A buggy chess - engine that does not respond to the "quit" command will also cause - this. - -

If you still see this problem, you can stop the rogue chess engine - by pressing Ctrl+Alt+Del, selecting the chess engine process from the - menu, and pressing the End Task button. - -


-

[C.12] - Why do my ICS - opponents often get extra time after they make their moves? - Why do I sometimes lose time off my clock after I make my move? -

- - If you are playing with the ICS incremental clock, both you and your - opponent get a set amount of extra time after each move. - -

If your or your opponent has netlag, your opponent might appear to - get extra time, especially if your opponent is using timestamp or - timeseal. The ICS charges each player who is using timestamp or - timeseal only for the time between when the player received his - opponent's move and the time he sent his own move. Thus delays in - network transmission do not count against either player. But WinBoard - counts down the display of your opponent's clock on your screen under - the assumption that there is no netlag. When his move comes in, if - there was netlag, the ICS may not have really charged him for that - much time, and WinBoard corrects the clock to what the ICS says it - should read. - -

If you are not using timestamp or timeseal, you may appear to lose - time off your clock at some point after you make your move. In this - case, the ICS charges you for the time between when it sent you your - opponent's move and the time it received your move. Thus delays in - network transmission count against you. WinBoard stops counting down - the display of your clock on your screen (and starts your opponent's) - when you make your move. When the ICS echoes your move back to you, it - may have charged you for more time than that, and WinBoard corrects - the clocks to what the ICS says they should read. - -

See "help lag" and "help timestamp" or "help timeseal" on your ICS for - more detailed information. - -


-

[C.13] - I can't run WinBoard unless I delete the WinBoard.ini file each time! -

- -

Most people don't have this problem, but two or three people using - Windows NT 4.0 with Service Pack 3 or 4 have reported it. I have no - idea what causes this problem. Contrary to what was reported in a - previous version of this FAQ, reinstalling the service pack after - installing WinBoard does not seem to solve the problem. - -


-

[C.15] - I get errors compiling XBoard's parser.c. -

- -

The file parser.c is automatically generated from parser.l. The - copy included with XBoard 4.0.2 was generated by lex on Tru64 Unix and - has problems compiling and linking on current GNU/Linux versions. The - copy included with XBoard 4.0.3 was generated by flex on a GNU/Linux - machine, but it too won't necessarily work on other versions of Unix. - If you have this problem, you can fix it by deleting parser.c and - letting the Makefile re-create it from parser.l. This will work if - you have either lex or flex on your system. Flex is available in all - GNU/Linux distributions and can be obtained at no charge from the Free - Software Foundation, www.fsf.org. - -


-

[C.16] - I get an error building WinBoard from source because "flex" is not found. -

- -

The file parser.c is automatically generated from parser.l. The - Makefile included with the WinBoard source kit has a rule for - generating parser.c using the program "flex", which will fail if you - don't have flex. However, the source kit also includes a ready-made - copy of parser.c, so you don't really need flex unless you have made - changes to parser.l. Check that you still have a copy of parser.c; if - you don't, unpack the WinBoard source zip file again to get one. - Either set the last-modified time of parser.c to be later than that of - parser.l, delete parser.l, or comment out the Makefile rule for - building parser.c from parser.l, and then try building WinBoard again. - -

If you do want to change parser.l and rebuild parser.c, you can get - flex as part of the free Cygwin kit from - http://sourceware.cygnus.com/cygwin/. You can - probably also get flex for Windows by itself from various other places - around the Internet. It is free software distributed by the Free - Software Foundation, www.fsf.org. - -


-

[C.17] - XBoard hangs shortly after connecting to an ICS when used with dxterm, - cmdtool, dtterm, kterm, konsole, or other substitutes for xterm. -

- -

After connecting to a chess server, XBoard 4.0.2 and later sends an - escape sequence to its terminal that is meant to display your handle - and the ICS host name (for example, - "user@chessclub.com") in the - terminal's banner and icon. It seems that several of the alternative - X terminal programs have a bug that makes them hang when sent this - escape sequence. - -

You can work - around the problem by using xterm, nxterm, rxvt, aterm, xiterm, or - gnome-terminal, all of which seem to work fine. In fact, current - versions of kterm and konsole seem to work fine too, so if you are - having problems with one of them, be sure you are not running an - outdated version. - -

Alternatively, you can disable this feature by commenting out the - body of DisplayIcsInteractionTitle in xboard.c and recompling xboard. - -


-

[C.18] - The WinBoard pieces show up in the wrong colors, appear distorted, - or are not visible at all. -

- -

This can happen if you have a bug in your Windows display driver. - Check with the manufacturer of your display card, the manufacturer of - your computer, or Microsoft to see if there is an updated driver - available. You can usually download updated drivers from the Web. - -

If you can't find an updated driver, you can try running Windows - using a different number of colors and/or disabling some of the - hardware acceleration features on your display card. To change the - number of colors, go to Windows Start / Settings / Control Panel / - Display / Settings / Color Palette. To disable hardware acceleration - features, go to Windows Start / Settings / Control Panel / Display / - Settings / Advanced Properties / Performance / Hardware Acceleration. - -

It's also possible that Windows has the right driver for your - hardware already but you are not using it. It may help to reinstall - your driver. Go to Windows Start / Settings / Control Panel / System - and delete your display card (maybe even your monitor too), then - reboot. Windows should automatically re-detect your card and monitor - and re-install the drivers; if it doesn't, run Start / Settings / - Control Panel / Add New Hardware to force it to. - -

If all else fails, try Monochrome mode. On WinBoard's menus, go - to Options / Color and check Monochrome. WinBoard will display in black - and white. - -


-

[C.19] XBoard or WinBoard tells me "Error: first chess - program (...) exited unexpectedly".

- -

This message means that your chess engine crashed, probably due to - a bug in the engine, or because you have it configured incorrectly. - You can try running XBoard or WinBoard again with the "-debug" flag on - the command line. This will print out all the messages received from - the chess engine. (With WinBoard, the messages go into a file called - WinBoard.debug; with XBoard, they go to the xterm that you started - XBoard from.) - -

If you are using GNU Chess and you see this problem as soon as it - starts up, most likely GNU Chess is exiting with an error message. If - you see the message "NO LANGFILE", it means that you did not install - GNU Chess correctly, and it is unable to find the file gnuchess.lang. - Make sure that you defined LIBDIR in the gnuchess Makefile, and that - gnuchess.lang is in that directory. If gnuchess.lang is not there, - you probably didn't type "make install" in the gnuchess src directory; - you must do this to install gnuchess.lang (and the gnuchess book). If - you defined LIBDIR to something that is not an absolute pathname (that - is, to something that does not start with a "/"), GNU Chess will work - only if you run it from the GNU Chess "src" directory where you built - it. - -


[C.20] - XBoard tells me "Warning: Cannot allocate colormap entry", or - "too few colors available; trying monochrome mode", or - "XPM pieces cannot be used in monochrome mode". -

- -

You are running your X server with 8-bit color depth, and you are running - some program that has used up all 256 of your colors. Netscape tends - to do this, or maybe you have a background image that uses up all of - your colors. - -

If you have a modern machine, you probably have enough display - memory to run your X server with 16-, 24-, or 32-bit color depth. If - you're using "startx" to start the X server, try giving the command as - "startx -- -bpp 24" (or 16, or 32). On newer X servers you - may have to use -depth instead of -bpp. Further details on - configuring your X server are beyond the scope of this FAQ. - -

If you must run in 8-bit mode, try the following: - Avoid background images that use up all your colors. If you - run Netscape, try starting it up with the -install command-line - option; this gives Netscape its own private colormap that X will - switch to when Netscape has the keyboard focus. - -

If all else fails, another possibility is to run xboard in - monochrome (black and white) mode by giving it the -mono - command-line option. XBoard will try this by itself in some cases. - Monochrome mode works only with bitmap pieces, not pixmap pieces, so - trying to use it may give you the error "XPM pieces cannot be used in - monochrome mode". To get around this, either use the -bitmapDirectory - command line option to point XBoard to the directory containing the - bitmap pieces included with the XBoard source code, or rebuild XBoard - with pixmap support disabled, using "./configure --disable-xpm ; make - clean ; make". - -


[C.21] - When I log in to freechess.org, the Enter key doesn't work, and I - have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't - work either, so I'm stuck. -

- -

This is a pretty rare problem. It should only arise if you have to - reach freechess.org by telnetting (or connecting with WinBoard - /icsport=23) from a Windows PC to a Unix box, and then telnetting from - there to freechess.org. The Enter key should always work when - connecting directly from your PC to freechess.org. - -

The best way to get around the problem is to run timeseal on the - intermediate Unix box instead of telnet. Get the appropriate version - of timeseal for your box from ftp.freechess.org and follow the - directions in the help files on FICS. - -

If you can't run timeseal for some reason, there are some things - you can do to make telnet stay in line mode instead of going to - character mode. Then the Enter key will work. First, try "telnet - freechess.org 5000" instead of "telnet freechess.org." - If that still doesn't work, then when the Enter key stops working, - type the following. Here < and > surround the - names of keys. - -

-     <Ctrl+S><Ctrl+]>mode line<Enter>
- 
- -

[C.22] - XBoard says, "Failed to start first chess program gnuchessx - on localhost: gnuchessx: No such file or directory." -

- -

XBoard is looking for GNU Chess 4.0. If you didn't want to use - XBoard with GNU Chess, please see topic [C.6]. - If you did want to use GNU Chess 4.0, be sure you have it installed and - that it is on your $PATH. If you wanted to use GNU Chess 5 instead, - see topic [D.6]. - -


-

[D] Crafty and other topics

-
-

[D.1] What is XChess?

- - XChess is an older chessboard program that is no longer supported. XChess was - written for X version 10, and you may or may not be able to build and run it - on an X11 system. - -

XChess has only one significant feature that is not present in XBoard: Two - humans can play chess using XChess on different machines, without using the - Internet Chess Server as an intermediary. This feature is of interest only if - you don't have network connectivity to the Internet Chess Server. - -

Note: There actually have been several different programs called "XChess" in - circulation at various times. The above describes one that was associated - with GNU Chess. - -


-

[D.2] What is Winsock Chess?

- - Winsock Chess is a program that lets two people play chess across a - network. It runs only under Microsoft Windows. Some of the code in - Winsock Chess is derived from GNU Chess, but it is not maintained by - the GNU Chess team. You can get a copy from the Internet Chess - Library; see topic [A.2]. For more information, - contact its author, Donald Munro, - ccahdm@beluga.upe.ac.za. - -
-

[D.3] What is Crafty?

- - Crafty is a freely-available chess program written by Bob Hyatt. - Bob is the main author of the well-known chess program Cray - Blitz. Crafty is a very strong program, its code is available, commented - and fairly readable, and its author is actively working on improvements. - -

You can download Crafty from ftp://ftp.cis.uab.edu/pub/hyatt/. Start by getting the read.me file and - reading it. Among other things, this file contains instructions on - how to install Crafty as a command-line application on your machine. - -

There is a Crafty mailing list. - To subscribe, send email to - majordomo@cis.uab.edu, with - "subscribe crafty-list" in the body. - -


-

[D.4] How do I use Crafty with XBoard?

- -

First, you need to get Crafty and install it as a command-line - application on your machine. See topic [D.3]. - -

To use Crafty with XBoard, give the -fcp - parameter like this: - -

-     xboard -fcp "./crafty" -fd crafty_directory
- 
- - Here crafty_directory is the directory where you installed Crafty. - You can add more xboard options at the end of the command line. - -

Crafty 15.14 or later is required to work properly with XBoard - 4.0.0 or later. We generally recommend using the latest versions of - both XBoard and Crafty. - -


-

[D.5] How do I use Crafty with WinBoard?

- -

First, you need to get Crafty and install it as a command-line - application on your machine. See topic [D.3]. - It is best to use the latest version of Crafty with the latest version - of WinBoard to make sure all features are compatible and function - correctly. You can install Crafty in any directory you like. - -

You also need to get WinBoard and install it in the normal way - using its built-in installer. You can do that either before or after - you install Crafty. - -

After both Crafty and WinBoard are installed separately, follow the - directions in the WinBoard Help file (included with WinBoard) for - connecting new chess engines to WinBoard. - -

If you want to have Crafty act as an automated computer player on a - chess server, see topic [B.16]. Before you try - to get that working, be sure you can play against Crafty locally, - first without WinBoard, then with it. Also be sure you can use - WinBoard to play on the chess server yourself, without having Crafty - connected to it. You have to crawl before you can walk! - -


-

[D.6] How do I use GNU Chess 5 with XBoard?

- -

By default, XBoard still tries to use GNU Chess 4 by running the - command "gnuchessx". That's why if you don't have GNU Chess 4, you - get the error message "Failed to start first chess program gnuchessx - on localhost: gnuchessx: No such file or directory." - -

If you have GNU Chess 5, the command should be "gnuchess xboard" - instead. To make XBoard use this command, give the -fcp parameter - like this: - -

-     xboard -fd gnuchess_directory -fcp "./gnuchess xboard" 
- 
- - Here gnuchess_directory is the directory where you installed - GNU Chess 5 and its book. You can add more xboard options at the - end of the command line. - -


- $Id$
- ** End of XBoard/WinBoard FAQ ** - -bug-xboard@gnu.org. (Note: as of 4 Nov 2003, -this mailing list is temporarily broken. You can send mail to -bug-xboard@tim-mann.org instead until it is fixed.) - -

Beginner questions and discussion about the program may get faster -answers on the WinBoard Forum at http://f11.parsimony.net/forum16635/. - -

If you are developing a -chess engine that works with XBoard or WinBoard (or an alternative -GUI that works with such engines), see the Chess Engines mailing -list, hosted at -http://groups.yahoo.com/group/chess-engines. - -

Any time you want to report a possible bug in XBoard or WinBoard, -we need to know exactly what you did, and exactly what error (or -other) messages you got. - -

If you are using Unix, run the "script" program, run XBoard with -the -debug flag (if you get as far as running it), do whatever is -necessary to reproduce the problem, type "exit" to the shell, and mail -us the resulting typescript file. We also need to know what -hardware/operating system combination you are using. The command -"uname -a" will usually tell you this; include its output in your -typescript. - -

If you are using MS Windows, run WinBoard with the -debug flag, and -send us a copy of the WinBoard.debug file. If you aren't sure how to -add command-line flags to WinBoard, you can hit Ctrl+Alt+F12 to create -a WinBoard.debug file after WinBoard starts, but that is not as good, -because a few messages that would have been printed at the start are -lost. - -

Either way, please send us the exact text of the commands you typed -and the output you got, not just your recollection of approximately -what they were. The messages may seem meaningless to you, but they -are very meaningful to us and essential for diagnosing problems. - -


-

[A.6] What are the future plans for XBoard and - WinBoard?

- -

Our plans are always in flux. As with most free software projects, -the next release will happen when it happens -- or it may never -happen. This has always been the policy for XBoard/WinBoard. -Releases have never been promised in specific time frames. - -

Starting in November 2003, several new developers have joined the -project, and work is now hosted at https://savannah.gnu.org/projects/xboard/. Lots of work is just -getting underway, but nothing is far along yet. - -

Here is a partial list of items that have a nonzero probability of -happening in finite time. - -

    -
  • Small bug fixes. Occasionally someone sends us a fix, or reports -a small bug very clearly so that we're able to fix it in a few minutes -work.

    - -

  • Protocol version 3. The members of the chess engine authors' -mailing list discussed a set of proposed features for the next version -of the XBoard/WinBoard chess engine communication protocol. -Unfortunately, this project has gotten only as far as that discussion -took it; no revisions of the protocol spec or coding have been done -yet. A few simple features are very clearly needed, though, and will -probably appear in time.

    - -

  • Contributed features. Several people have mailed me code to add -various features. Most of this code is available on the -XBoard/WinBoard extensions page at http://www.tim-mann.org/extensions.html, but it is not in any -official releases yet. We are in the process of getting folks to -formally assign the copyrights on their contributions to the Free -Software Foundation so that we can include it in official releases in -the future.

    - -

  • Internationalization. Several people have expressed interest in -internationalizing XBoard/WinBoard, and so hopefully this project will -go forward. Once the internationalization support is in, we will need -more translators. Watch for news on the xboard-devel mailing list on -our Savannah pages. - -
- -
-

[B] XBoard and WinBoard

-
-

[B.1] What is XBoard?

- -XBoard is a graphical user interface for chess. It displays a -chessboard on the screen, accepts moves made with the mouse, and loads -and saves games in Portable Game Notation (PGN). XBoard is free software. -It serves as a front-end for many different chess services, including: - -

Chess engines that will run on your machine and -play a game against you or help you analyze, such as GNU Chess and -Crafty (topic [D.3] below). - -

Chess servers on the Internet, where you can -connect to play chess with people from all over the world, watch other -users play, or just hang out and chat. - -

Correspondence chess played by electronic -mail. The cmail program (topic [B.6] below) -automates the tasks of parsing email from your opponent, playing his -moves out on your board, and mailing your reply move after you've -chosen it. - -

The Web and your own saved games. You can use -XBoard as a helper application to view PGN games in your -Web browser, or to load and save your own PGN files. - -

XBoard runs under Unix or Unix-compatible systems. It requires the -X Window System, version X11R4 or later. There are also ports of -XBoard to 32-bit Microsoft Windows and to -the Amiga. See topics [B.2] and [B.3] respectively. - -


-

[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?

- -WinBoard is a port of XBoard to 32-bit Microsoft Windows systems, such -as Windows 95, 98, NT, 2000, ME, and XP. It uses the same back end -chess code as XBoard, but the front end graphics code is a complete -rewrite. WinBoard is free software. - -

The WinBoard distribution includes a port of GNU Chess to Win32. -The GNU Chess port is distributed in executable form, with instructions for -rebuilding it from the standard GNU Chess sources (available separately). You -should have at least 16 to 24 MB of memory to run GNU Chess with WinBoard. - -

The WinBoard distribution also includes the ICC timestamp and FICS -timeseal programs (topic [B.12]). - -

cmail (topic [B.6]) has not been ported to -Windows. All the other XBoard functions are included in WinBoard. -The International Email Chess Group web site at http://www.iecg.org/ recommends -ECTool (http://www.ectool.nu/) -for playing correspondence chess under Windows. - -

You install WinBoard as follows. Download the WinBoard package to -your PC (see topic [A.2]). It will be a file -with a name like winboard-4_0_0.exe. Double-click on this file -in the Explorer or File Manager to run it. Follow the on-screen -prompts. - -


-

[B.3] Is there an XBoard for the Amiga? What is AmyBoard?

- -AmyBoard is a port of XBoard to the Amiga, by Jochen Wiedmann. -The distribution includes a port of GNU Chess. -AmyBoard is free software. - -

The current version of AmyBoard is 330.5 (based on XBoard 3.3.0). -No one is currently maintaining it. - -

System requirements: - -

    -
  • An Amiga (obviously :-), running OS 2.04 or later, 2Mb RAM or more.
  • -
  • MUI 2.0 or later.
  • -
  • Workbench or another screen with no less than 640x400 pixels (adjustable - with the MUI-Prefs); this restriction is just because we don't have - bitmaps with less than 40x40 pixels per square. If someone contributes - bitmaps with 20x20 or 20x25, they will work with any Hires mode.
  • -
-

-If you would like to use an ICS, you need an Internet connection via either - -

    -
  • a telnet-like program, or
  • -
  • a terminal program reading from stdin and writing to stdout.
  • -
-

-AmyBoard is available in the Internet Chess Library (topic [A.2]). - -


-

[B.4] Is there an XBoard for the Macintosh?

- -Because MacOS X has a Unix base, XBoard will compile and run on it. -You do need an X11 (X Window System) server and client libraries. -These do not come with Mac OS, but both free and commercial versions -are available. Once you install the X11 package, XBoard is reported -to compile and run without changes. I am not a Mac user and have not -tried this myself, so I cannot answer questions about it. - -Version 4.2.6 and earlier of XBoard come with an old copy of the -config.sub utility that does not recognize Mac OS X, so to build -XBoard, you'll have to tell the configure program what OS you are -running. Follow the instructions in topic [B.7] -of this FAQ, but add the argument --host=powerpc-apple-bsd to -the end of the "configure" command line. - -There is no version of XBoard or WinBoard that runs with the native -(non-X11) Mac graphical interface, and none that runs on MacOS 9 or -earlier. - - -
-

[B.5] Does XBoard run on VMS?

- -No. This port would probably be a lot easier than the Win32 and Amiga -ports were, because VMS has the X Window system (under the name -DECwindows) and is now POSIX compliant. However, I don't know enough -about VMS to do the port myself, and I don't have time. If you do, -give it a try! Send mail to me, -tim@tim-mann.org (Tim Mann), if you're -working on this. - -
-

[B.6] What is cmail?

- -cmail is a program that helps you play and keep track of electronic mail -correspondence chess games using XBoard. It is distributed with XBoard and -has its own manual page. cmail is free software. It was written by -Even Welsh. cmail has not been ported to Windows; sorry. - -
-

[B.7] How do I build XBoard? Do I need gcc?

- -The first step to building XBoard is to get the distribution file. See topic -[A.2] for places you can ftp the software from. - -

Next, decide what directory tree you are going to install XBoard -in. The default is /usr/local, but you probably don't have write -access to that directory unless you are a system administrator. If -you do, type the following to install it there: - -

 -    gzip -cd xboard-*.tar.gz | tar -xvf -
 -    cd xboard-*/
 -    ./configure
 -    make
 -    su
 -    make install
 -
- -If you want to install xboard in your personal home directory ($HOME/bin), -type this: - -

 -    gzip -cd xboard-*.tar.gz | tar -xvf -
 -    cd xboard-*/
 -    ./configure --prefix=$HOME
 -    make
 -    make install
 -
- -

If the first step above fails because you don't have gzip, see -topic [A.2], and ask a local Unix expert if you -need more help. If you have any problems with the last two steps, -read the READ_ME and INSTALL files in the xboard-*/ directory. You -will also find this FAQ there. - -

You don't need to have gcc to build XBoard. Almost any Unix C -compiler should do. - -


-

[B.8] Can I use XBoard or WinBoard to play a game - of chess with another human?

- -The only way for two humans on different machines to play chess in -real time using XBoard/WinBoard is to use an Internet Chess Server -as an intermediary. That is, each player runs his own copy of XBoard -or WinBoard, both of them log into an ICS, and they play a game there. -Two copies of XBoard/WinBoard cannot communicate with each other -directly. - -

Instructions on how to get started with Internet chess are included -with the XBoard and WinBoard distributions. The network addresses -included in the distribution may not always be current. The oldest -and largest ICS is the Internet Chess Club at chessclub.com, which now -has a fee for registered use, but still allows free unregistered use. -There are also many newer sites with no fees, using the Free Internet -Chess Server implementation (FICS). The most active FICS site is -freechess.org. On these and most other chess servers, -the port number to use is 5000. - -

If you don't have network connectivity to any ICS site, you -can run your own server using a version of the FICS code, but this -is not easy. See http://www.tim-mann.org/ics.html#ownics for advice and pointers. - -

The cmail program included with XBoard lets you play email postal games with -another human; see topic [B.6]. - -

Two humans can play chess on the same machine using one copy of -XBoard/WinBoard in -Edit Game mode, but the clocks don't run in this mode, so it's of limited -usefulness. - -

See also topic [D.2], Winsock Chess. - -


-

[B.9] Will WinBoard run on Windows 3.1? - How about Windows CE (also known as Pocket PC)? -

- -WinBoard does not run on Windows 3.1, Windows for Workgroups 3.11, etc., -not even with the Win32s compatibility package. The main problem is -that Win32s does not have threads or real concurrent processes. A -port of WinBoard to Windows 3.1 is possible in theory, but it would be -difficult and messy, and no one is going to do it. - -

WinBoard does not run on Windows CE (also -known as Pocket PC). I don't know what would be required to port it. - -

WinBoard does run well on full 32-bit versions of Windows, such as -Windows 95, 98, NT, 2000, ME, and XP, and should continue to work -on future 32-bit Windows systems. - -


-

[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files - with my Web browser?

- -1) On Unix systems: -

-- Add the following line to the file .mime.types in your home directory. -(Create the file if it doesn't exist already.) -

 -    application/x-chess-pgn    pgn
 -
-

-- Add the following line to the file .mailcap in your home directory. -(Create the file if it doesn't exist already.) -

 -    application/x-chess-pgn; xboard -ncp -lgf %s
 -
-

-- Exit from your Web browser and restart it. - -

2) On MS Windows systems: - -

The exact procedure depends on which Web browser you are using. -The current version of WinBoard automatically configures itself as -your PGN viewer for local files, Netscape 4.x and later, and Internet -Explorer. This automatic setup probably works for all other current Web -browsers, too. - -


-

[B.11] How do I use WinBoard as an external viewer - for PGN files with the MS Windows File Manager or Explorer?

- -WinBoard sets this up automatically when you install it, except on old -versions of Windows NT (prior to 4.0). On Windows NT 3.51 or earlier, -go to the File Manager, click on the File menu, select Associate, -enter "pgn" as the extension, and use the Browse button to find your -copy of WinBoard and set up the association. - -
-

[B.12] How do I use ICC timestamp or FICS timeseal -with XBoard?

- -First, get the appropriate version of timestamp or timeseal for your -machine from ftp.chessclub.com or ftp.freechess.org. -Second, be sure that you can connect using XBoard without -timestamp/timeseal. Third, be sure that you can connect using -timestamp/timeseal without XBoard. See the help files on ICC and FICS -or ask people online if you have problems. - -

If you are in a completely ordinary situation, where your machine -is directly on the Internet and you can connect to ICC or FICS -without timestamp/timeseal using -just the command "xboard -ics" or "xboard -ics -icshost freechess.org", -change that command to one of the following: - -

 -    xboard -ics -icshost 204.178.125.65 -icshelper timestamp
 -
 -    xboard -ics -icshost 164.58.253.13 -icshelper timeseal
 -
- -

If you have a firewall between your machine and the ICS, see topic -[B.19]. - -

If you normally have to use the "/icscomm" command line option on -xboard to log into a second machine, and then telnet to ICC or FICS -from there, you are going to have to run the Unix version of timestamp -or timeseal on the second machine. (If the second machine is not -running Unix, you are out of luck.) Get the appropriate version of -timestamp or timeseal onto the shell machine via FTP; see the help -files on ICC and FICS for instructions. Then simply run it when you -would normally run telnet. In this configuration you are not -protected against lag between your PC and the shell machine, or for -lag caused by heavy load on the shell machine itself from other users. - -

For further information on timestamp and timeseal, see the help -files on ICC and FICS. - -


-

[B.13] How do I use ICC timestamp or FICS timeseal -with WinBoard?

- -

If you select an ICS from either the WinBoard Startup dialog or the -Windows Start submenu that WinBoard installs, WinBoard automatically -runs timestamp or timeseal if the ICS you chose is known to support it. - -

If you are constructing a WinBoard command line by hand, add the -option "/icshelper timestamp" or "/icshelper timeseal" to the WinBoard -command line to use timestamp or timeseal. Both timestamp.exe and -timeseal.exe are included in the WinBoard distribution. They both -function identically to the Unix versions, as documented in "help -timestamp" on ICC and "help timeseal" on FICS. - -

If you have a firewall between your machine and the ICS, see topic -[B.19]. - -

If you normally have to use the "/icscomm" command line option on -WinBoard to log into a shell account, and then telnet to ICC or FICS -from there, you are going to have to run the Unix version of timestamp -or timeseal on the shell machine. (If the shell account is not on a -Unix machine, you are out of luck.) Get the appropriate version of -timestamp or timeseal onto the shell machine via FTP; see the help -files on ICC and FICS for instructions. Then simply run it when you -would normally run telnet. In this configuration you are not protected -against lag between your PC and the shell machine, or for lag caused by -heavy load on the shell machine itself from other users. - -

For further information on timestamp and timeseal, see the help -files on ICC and FICS. - -


-

[B.14] How do I play bughouse with XBoard or WinBoard? -

- -XBoard and WinBoard have simple but effective bughouse support. -Offboard piece holdings are shown in the board window's banner, and -you drop offboard pieces using the right mouse button. Press it over -the destination square to pop up a menu of pieces. - -

XBoard and WinBoard can display only one board at a time, but you -can observe your partner's game by running a second copy of the -program and logging in as a guest. (Unfortunately, this is not -possible if you are using the /icscomm option.) To observe your -partner's games automatically, use the "follow" or "pfollow" ICS -command; see the ICS online help for details. - -


-

[B.16] What is Zippy? How can I interface a -chess program to the Internet Chess Servers?

- -Zippy is an interface that lets a compatible chess engine (such as GNU -Chess or Crafty) act as a computer -player on an Internet Chess Server. Zippy is included in both the -XBoard and WinBoard distributions. It is implemented as a small -amount of additional code within XBoard or WinBoard. -For documentation, see the file -zippy.README, included in both distributions or available -from my chess Web page, -http://www.tim-mann/chess.html. -The version of zippy.README on my Web page is often more up-to-date -than those in the XBoard/WinBoard distributions. -You'll also find a "biography" of Zippy and pointers to the original -Zippy the Pinhead comic strips on my Web page. -Please read zippy.README carefully before you ask me any questions about Zippy. - -

Using a computer to choose your moves on a chess server is -considered cheating unless your account is on the computer (C) list. -Read "help computer" on your favorite server for details on their -policy. Most of the servers have plenty of computers running now, so they -will not be excited about having you run a new one unless you have -written your own chess engine. They don't really need yet another -Crafty or GNU Chess clone. - -


-

[B.17] How can I interface my own chess program -to XBoard or WinBoard?

- -This is a non-trivial task. XBoard and WinBoard were not designed -with a clean interface for talking to chess programs; they were -written to work with an existing version of GNU Chess that expects to -be talking to a person. Your program has to emulate GNU Chess's -rather idiosyncratic command structure to work with XBoard and -WinBoard. We are gradually cleaning up, improving, and documenting -the interface as newer versions of XBoard and WinBoard come out, -however. - -

For documentation, see the file engine-intf.html, included in both -distributions or available from my chess Web page, http://www.tim-mann.org/chess.html. -The version of engine-intf.html on my Web page is often more up-to-date -than those in the XBoard/WinBoard distributions. - -


-

[B.18] How can I recompile WinBoard from source?

- -The source code for WinBoard is available from the author's Web page, -http://www.tim-mann.org/chess.html. - -

WinBoard is currently developed using Microsoft Visual C++ 5.0. -You can build the program from the MSVC++ GUI by opening the project -file (winboard.dsp) and telling MSVC++ to build the project. You can -also build it from the the command line by using the nmake program -supplied with MSVC++. - -

To build WinBoard with the free Cygwin tools, available from http://www.cygwin.com/), use the -command "make -f cygwin.mak". WinBoard 4.2.5 was successfully -compiled with the net release of Cygwin as downloaded on 20-March-2001 -(cygwin1.dll 1.1.8, gcc 2.95.2-6, binutils 20001221-1, flex 2.5.4-1), -but exhibits a command-line parsing bug; see item 511 in the ToDo file -that comes with WinBoard. WinBoard 4.1.0 does not compile with -Cygwin. WinBoard 4.0.7 is known to compile with Cygwin BL20.1. - -

To build WinBoard with Borland C++ 4.5, use "borland.mak", supplied -with the WinBoard sources, as the Makefile. Support for Borland C++ -was contributed by Don Fong and has not been tested by the author of WinBoard. - -

WinBoard is a Win32 application, so you definitely need a compiler -and tool set that supports Win32. In particular, older versions of -DJGPP can build only 32-bit MSDOS programs; that is, programs that use -a DOS extender to get a 32-bit address space and do not make any -Windows calls. The latest versions of DJGPP are said to be able to -build Win32 programs when used with the proper extension package(s), -but this is not known to work with WinBoard. Use Cygwin instead. - -

See also topic [C.16]. - -


-

[B.19] -How can I use XBoard or WinBoard to talk -to an Internet Chess Server through a firewall or proxy? -

- -

There is no single answer to this question, because there are many -different kinds of firewalls in use. They work in various different -ways and have various different security policies. This answer can -only provide hints. - -

Note that you can't access Internet Chess Servers through a Web proxy, -because they are not a Web service. You talk to them through a raw -TCP connection, not an HTTP connection. If you can only access the -Web through a proxy, there may be a firewall that stops you from -making direct TCP connections, but there may also be a way through it. -Read on for hints, and contact your local system administrator if you -need more information about your local configuration. - -

A helpful user mailed me the following explanation of how to use -WinBoard with WinGate: -

-"I have managed to setup WinBoard though my WinGate proxy. I have the -Office version. What I needed to do was to setup the TCP/IP -connection to add the User/Host name and my provider service name for -the DNS, but I had to leave the HOST IP address blank. I have not -played with all the variations, so it may be just that I have the DNS -lookup enabled." -
-I hope this helps, though I don't find it very clear. I don't have -a copy of WinGate myself and can't help if you have questions about it. - -

If you are using some other non-SOCKS firewall, read the FIREWALLS section -in your XBoard or WinBoard documentation (man page, info document, or -Help file). If you can telnet to a chess server in some way, then you -can almost certainly connect to it with xboard/WinBoard, though in -some cases you may not be able to run timestamp or timeseal. The -timestamp and timeseal protocols require a clean, 8-bit wide TCP -connection from your machine to the ICS, which some firewalls do not -provide. - -

If you have a SOCKS firewall and are using XBoard, -you should be able to SOCKSify xboard and use it. See http://www.socks.nec.com/ for -information about SOCKS and socksification. However, if you do this, -you can't use timestamp or timeseal; what you really need is a -socksified version of timestamp or timeseal. This is hard because the -source code for timestamp and timeseal is proprietary; the folks -running the chess servers don't give it out because that would make it -too easy to cheat. On some versions of Unix, you may be able to -socksify a program that you don't have the source code to by running -it with an appropriate dynamic library; see http://www.socks.nec.com/. For -others, you might be able to get a pre-built socksified version from -the chess server administrators. For timeseal versions, see ftp://ftp.freechess.org/pub/chess/timeseal/. For timestamp -versions, the directory would be ftp://ftp.chessclub.com/pub/icc/timestamp/, but at this writing -there don't seem to be any socksified timestamps there. Once you have -a socksified timestamp or timeseal, simply run it with a normal, -non-socksified xboard in place of the standard timestamp or timeseal. - -

If you have a SOCKS firewall and you are using -WinBoard, we now know how to make this configuration -work, complete with timestamp or timeseal! - -

Start by getting SocksCap32. This software is freely available -from http://www.socks.nec.com/. -Install it on your machine, read the documentation, and learn to use -it. You may find it useful with many other programs besides WinBoard. - -

Next, don't socksify WinBoard. Socksifying -WinBoard itself doesn't let you use it with timestamp or timeseal. -For some reason I don't understand -- something strange that -SocksCap32 does -- the socksified WinBoard runs but does nothing, and -timestamp/timeseal runs all by itself in its own window. - -

Instead, use the following workaround. Follow the instructions -exactly; don't try to skip steps or simplify things. - -

First, make SocksCap32 application profiles for timestamp and -timeseal. Use the following command lines in the SocksCap32 -profiles. Name the first profile "timestamp" and the second -"timeseal". - -

 -    "c:\program files\winboard\timestamp.exe" chessclub.com 5000 -p 5000
 -    "c:\program files\winboard\timeseal.exe" freechess.org 5000 -p 5000
 -
- -

Second, run timestamp or timeseal by itself, socksified, using its -profile. This will open an unneeded, black window that will not -respond to typing. Minimize it to the task bar and ignore it. It will -go away when you exit from WinBoard. - -

Next, run WinBoard using the following command line. Make a shortcut -or type this command into an MS-DOS Prompt box. Don't run WinBoard -itself socksified, just run it directly. - -

 -    "c:\program files\winboard.exe" /ics /icshost=localhost /icsport=5000
 -
- -

After you get this working, you can try getting the timestamp window to -auto-minimize by starting it from a shortcut instead of from the -SocksCap32 control window. As it says in the SocksCap32 help file, put -the following in the Target field of a shortcut's Properties page: - -

 -    "c:\program files\sockscap32\sc32.exe" timestamp
 -
- -Then select "Run: Minimized" on the same page. Do the same for timeseal. - -

Another method that can work is to use a .bat file to start both -timestamp and WinBoard. It would look something like this: - -

 -    REM --
 -    REM -- icc.bat
 -    REM -- Start timestamp under SocksCap32 and use WinBoard to connect to it.
 -    REM -- The string "timestamp" refers to a SocksCap32 profile for timestamp.
 -    REM --  Do not change it to the filename of the timestamp program!
 -    REM --
 -    start /minimized "c:\program files\sockscap32\sc32.exe" timestamp
 -    cd "c:\program files\winboard"
 -    winboard /ics /icshost=localhost /icsport=5000
 -
- -

This workaround has a problem if you want to run two copies of -WinBoard at once, talking to the same chess server twice (for -bughouse) or to two different chess servers. If you need to do that, -you will need to run a separate copy of timestamp with a different -port number for each connection. You'll need to make a second set of -profile entries with a different value after the -p flag (say, 5001) -and you'll need to change the WinBoard command line /icsport=5000 for -the second WinBoard to match. - -


-

[B.20] -How can I use XBoard or WinBoard on chess.net with accuclock? -

- -

I believe chess.net provides a Win32 command-line version of -accuclock that will work with WinBoard. Please see the documentation -on the chess.net server itself; don't ask the author of WinBoard. - -

I don't know whether chess.net provides versions of accuclock for -Unix at this time. Ask them. - -


-

[B.21] - Can I get Zippy to do one or more ICS commands automatically at the - start or end of each game?

- -

By default, Zippy automatically sends the command "gameend" to ICS -at the end of each game. You can alias this command (using the ICS -"alias" feature) to anything you want. On ICC, you can use the -"multi" feature to alias gameend to several commands, but other -servers don't have that feature. Zippy doesn't send anything at the -start of the game by default. - -

You can get Zippy to send one or more commands of your choosing, at -the start and/or end of each game, by using the -zippyGameStart and --zippyGameEnd command line options, newly added in version 4.0.3. -Both xboard and WinBoard have (somewhat obscure) ways of getting -newlines into this option to send several commands. Here is an -example of one way to do it for each. - -

 -    xboard -ics -zp -xrm '*zippyGameStart: say hi\nsay prepare to die\n'
 -
 -    WinBoard /ics /zp /zippyGameEnd='say thanks\nseek 5 0\nseek 2 12\n'
 -
- -
-

[B.22] - How do I print from WinBoard? -

- -WinBoard does not have built-in printing functionality. -If you want to print a picture of the board, press Alt+PrintScrn, run the -standard Windows application Paintbrush, select Paste, and print from there. -If you want to print a list of moves, save your game as a PGN file, -then open the PGN file with Notepad or any other plain text editor and -print it from there. - -
-

[B.23] - Can I get Zippy to automatically reconnect to ICS when its connection - breaks?

- -

There isn't a perfect solution to this problem yet, but a pretty -good one is to write a shell script (for xboard) or .bat script (for -WinBoard) that automatically restarts the program whenever it exits. -Use the -xexit flag so that you don't get a popup dialog that must be -dismissed with the OK button before the program will exit. The gap in -this solution is that your connection to ICS can sometimes get into a -state where the program does not notice that the connection is broken -until the next time it tries to send a command. Perhaps some future -version of xboard/WinBoard will have an option to send a harmless -command every five minutes or so. - -

Anyway, here is a sample Windows .bat file that restarts WinBoard each -time it exits. Thanks to Jason Williamson. It assumes that you have put -your computer account's name and password in a file named logon.ini. - -

 -REM --
 -REM -- wbrecon.bat
 -REM -- Start WinBoard in Zippy mode, and restart it each time it exits.
 -REM -- Add or change parameters as needed for your application.
 -REM --
 -:loop
 -start /w winboard /zp /ics /icslogon logon.ini /xexit /xautoraise
 -REM -- The next line is to have a short delay setup for 139 seconds.
 -REM -- Leave it out if it doesn't work on the version of Windows you use.
 -TYPE NUL | CHOICE.COM /N /CY /TY,99 >NUL
 -goto loop
 -
- -

Here is a Unix shell script to do the same thing for xboard. -It's a bit more elaborate. It is based on the script I use for the -original Zippy. It logs all ICS output to a file named zippy.out, -and it lets you type commands to Zippy by running "cat > zippy.fifo". - -

 -#! /bin/sh
 -host="204.178.125.65 -icsport 5000 -telnet -telnetProgram timestamp"
 -#host="164.58.253.13 -icsport 5000 -telnet -telnetProgram timeseal"
 -out=zippy.out
 -fifo=zippy.fifo
 -ZIPPYPASSWORD='something'
 -export ZIPPYPASSWORD
 -ZIPPYPASSWORD2='orother'
 -export ZIPPYPASSWORD2
 -ZIPPYLINES=`pwd`/all.lines
 -export ZIPPYLINES
 -ZIPPYGAMEEND='say Yow, that was FUN!
 -gameend'
 -export ZIPPYGAMEEND
 -zippylogon=`pwd`/logon.ini
 -DISPLAY=`hostname`:0.0
 -export DISPLAY
 -mv -f $out ${out}.old
 -rm -f $fifo
 -mkfifo $fifo
 -pid=$$
 -( while [ true ] ; do cat -u $fifo ; done ) | \
 -      ( while [ true ] ; do
 -          xboard -iconic -ics -icshost $host \
 -                 -zt -zp -xbell -xanimate \
 -                 -xautosave -xquiet -fcp "gnuchessx -h" \
 -                 -icslogon $zippylogon -xexit -autoflag -xautoraise $*
 -          sleep 600
 -        done ) > $out 2>&1 &
 -
- -
-

[B.24] - The chess engines are too strong and always beat me. How can I adjust - the difficulty level to make them weaker?

- -

The simplest way to get that effect is to make sure the -XBoard/WinBoard Auto Flag option is off, set a very fast time control -so that the chess engine can't think for long, but take as much time -over your own moves as you want. Also feel free to use Retract Move if -you make a blunder. - -

Many chess coaches will let you switch sides after -they get a stronger position so that you can get experience playing -positions where you are winning. You can try this with XBoard/WinBoard -by using the Machine White or Machine Black menu command to make the -machine take over your position. - -

The -depth command-line option to XBoard/WinBoard can also be used to -weaken the engine (see the man page or Help file). It's a bit of a -nuisance to set command line options in Windows, but see topic [C.7] for instructions. - -

Other ways of weakening engines are engine-specific. Many of them -let you adjust various parameters, and if you choose bad settings, the -engine will play more poorly. Consult whatever documentation came with -the engine you are using. - -


-

[B.25] - May I use the piece bitmaps from XBoard/WinBoard in my own program?

- -

The piece bitmaps used in XBoard and WinBoard were designed by -Elmar Bartel. He released them under the GNU General Public -License. This means that if your program is also free software -distributed under the GPL, you can use them freely. If your program -is distributed under some other license, including commercial, -shareware, or non-GPL freeware, then you cannot use the bitmaps unless -you obtain special permission from Elmar. See the file README.bitmaps -that comes with the XBoard and WinBoard source code for more -information and an email address you can write to. - -


[C] XBoard and WinBoard, bugs and problems

- -

[C.1] I can't build XBoard -because the X11/Xaw/... include files are not found.

- -These are the header files for the Athena Widgets library, which XBoard uses -heavily. Some versions of Unix don't supply these files, but they are part of -the standard X distribution, freely available from MIT. - -

For general information on getting missing X sources, see the FAQ on -comp.windows.x. Note that you may be missing only the header files, or you -may be missing the libraries themselves too. - -

HP-UX users are missing only the header files. You can get them by -anonymous FTP as follows. (But first check with your system -administrator to see if someone else at your site has already done -this.) Get the archive file /hpux9/X11R5/Core/Xaw-5.00.tar.gz (Xaw -header files) via anonymous FTP from the site hpux.csc.liv.ac.uk -(138.253.42.172), or one of the other official sites---Germany: -hpux.ask.uni-karlsruhe.de (129.13.200.57), US: hpux.cae.wisc.edu -(144.92.4.15), France: hpux.cict.fr (192.70.79.53) or Netherlands: -hpux.ced.tudelft.nl (130.161.140.100). Unpack the archive using gzip -and follow the instructions in its README and/or HPUX.Install files. -Thanks to Richard Lloyd for this information. - -

If you have the Xaw header files installed in a different place -than the other X11 headers, you may need to configure XBoard with an -extra flag to help it find them. For example, if yours are in -/foo/bar/X11/Xaw, try this: - -

 -    rm config.cache
 -    (setenv CFLAGS -I/foo/bar ; configure)
 -
-

-Also see topic [C.2]. - -


-

[C.2] Configuring or building XBoard fails due to -missing header files, missing libraries, or undefined symbols. -

- -Perhaps you have the X server and client programs installed on your -machine, but not the X header files and link-time libraries. If so, -you can run existing X programs, but you cannot compile a new X -program from source code. In this case the XBoard configure script -will fail and will tell you to look at this question in the FAQ. Many -GNU/Linux distributions put the headers and libraries in a separate -package, which you might not have installed. If you are using RedHat, -install the XFree86-devel package. If you are using some other -kind of Unix, ask your system administrator where to find the X header -files and link-time libraries. If this is not your problem, read on. - -

The configure script for XBoard looks for X libraries and header -files in some common places. Sometimes it fails: If yours are -installed in an odd place, it may not find them at all. If you have -more than one version of X installed on your system, it may find the -"wrong" one, or occasionally it may find libraries from one version -and incompatible header files from another. You can work around these -problems by telling the configure script where the files are. For -example: - -

 -    configure --x-includes=/odd/place/include \
 -              --x-libraries=/odd/place/lib
 -
- -

The directory named in the argument to --x-includes must have a -subdirectory "X11" that contains the actual .h files. That is, if -your X.h file has full pathname /odd/place/X11R6/include/X11/X.h, then -you must give the argument --x-includes=/odd/place/X11R6/include. - -

Some linkers have bugs that cause bogus error messages when you try -to link X programs. The configure script includes a workaround for a -bug of this kind that exists in some SunOS 4.x.x installations. See -the FAQ on comp.windows.x for more information about problems of this -kind. - -

If all else fails, check whether anyone else at your site has been able to -compile any X programs on your system. Your X installation might be buggy. -If so, the system administrator at your site might know how to fix or work -around the problem. - -

Also see topic [C.1]. - -


[C.3] I have problems using WinBoard on ICS -with a modem. I'm not running SLIP or PPP, but just dialing in to an -ordinary login account ("shell account").

- -Here are solutions to some common problems in this area. - -

Some people want to connect to ICS through HyperTerminal or some other -terminal program first, then run WinBoard. This is not how it works. -WinBoard wants to talk directly with your modem, acting as a terminal program -itself. Start out with the modem "on hook" (not making a call). - -

Run WinBoard with a command line like this (adding more options if desired): - -

 -    WinBoard /ics /icscom com1
 -
- -Use com2, com3, or com4 in place of com1 if your modem is connected to one of -those ports. - -

After you start WinBoard, you may need to change some of the options in the -Communications dialog (on the Options menu). The dialog has the usual options -for talking to modems: bits per second, bits per byte, parity, number of stop -bits. You will probably want to use Save Settings Now when you're done. - -

Next, type dialing commands to your modem in the text window that WinBoard -creates. You may need to turn off Local Line Editing on the Options menu -while you are typing commands to your modem. Turn it back on when you're -done. See the WinBoard Help file for instructions if you see your typing -echoed an extra time after you hit Enter. - -


-

[C.4] -I have problems using WinBoard on ICS with Windows 95 and SLIP -or PPP. When trying to start up, it gets the error "Address family -not supported by protocol family" (or some equally strange message). -

- -WinBoard is a 32-bit application, but some Winsock (TCP/IP) implementations -support only 16-bit applications. You get a strange looking error message -if you try to use a 32-bit application because -there is no standard Winsock error code number -for "32-bit application not supported." - -

Microsoft TCP/IP works with both 16-bit and -32-bit applications, supports SLIP, PPP, Ethernet, etc., and is included -with Windows 95 and later Windows systems. -If possible, I recommend that you uninstall -whatever Winsock you are using and install Microsoft TCP/IP instead. -For more information, see -http://walden.mo.net/~rymabry/95winfaq.html (the Win95-L FAQ). - -

Trumpet Winsock 2.1 (and earlier) supports only 16-bit -applications, and hence does not work with WinBoard. But there is a -beta-test release available that does support 32-bit applications. -I have not tried it with WinBoard, but it -should work. See Trumpet's Web page -http://www.trumpet.com.au/wsk/winsock.htm -for more information. - -

The 16-bit versions of America On-Line's software do not support -32-bit Winsock applications. Get the 32-bit version. At one time the -32-bit version was called "AOL for Windows 95," but I imagine that has -changed. Hopefully the current versions are all 32-bit. - -

A few versions of Winsock may have bugs that prevent -Windows timestamp/timeseal from working with them. I'm not sure if -such bugs exist in any versions that actually have 32-bit support, -so this point might be moot. Again, Microsoft TCP/IP is known to work. - -


[C.5] When I try to run WinBoard, I get the -message "Failed to start chess program gnuchess on localhost: NO -LANGFILE (file gnuchess.lan not found)".

- -

This message means that WinBoard is trying to run GNU Chess, but -GNU Chess cannot find a file that it needs, named gnuchess.lan. -If you see it, you've probably customized WinBoard's /fcp, /fd, /scp, -and/or /sd options and made a mistake in the process. Review what -you did, and see the WinBoard help file. - -


-

[C.6] I want to use XBoard or WinBoard as an Internet -Chess Server interface, but the ICS Client option is grayed out on the -menu.

- -XBoard and WinBoard have three major modes that can't be changed from the -menus: local chess engine mode, -ICS mode, and standalone mode. - -

With XBoard, you have to set the mode using command-line options. -Local chess engine mode is the default, -ics selects ICS mode, and --ncp ("no chess program") selects standalone mode. - -

With WinBoard, if you don't set the mode using command-line -options, you get a dialog box asking which mode you want. To bypass -the dialog box, use -cp ("chess program") for local chess engine mode, -or -ics or -ncp as with XBoard. Also see topic [C.7]. - -


-

[C.7] How do I give command-line options to -a Windows program like WinBoard?

- -

There are many ways; pick your favorite: - -

    -
  • Type the command line into an MS-DOS Prompt box. Example: -"WinBoard -ics". - -
  • Make a Windows shortcut for WinBoard. You can do this by -right-dragging WinBoard.exe to the desktop and selecting "Create -Shortcut(s) Here" from the menu that appears. Right-click on the -shortcut, select Properties, and click the Shortcut tab. The -command-line text box is labelled "Target" instead of "Command line" -just to confuse you. Edit the text in this box, adding the command -line options to the end.
  • - -
  • Choose Run from the Start menu, or File / Run from the Program -Manager or File Manager, and type the command line into the dialog you -get. You may have to give WinBoard's full drivespec and filename if -it is not in a directory on your search path.
  • - -
  • Make a Program Manager icon for WinBoard. You can do this by -dragging WinBoard.exe from the File Manager into the Program Manager, -or by using File / New in the Program Manager. Select the icon and -choose File / Properties. Edit the Command Line text box to add the -command-line options to the end.
  • -
- -
-

[C.9] -When I exit from WinBoard after using it to play against a chess -program on my machine, the chess program keeps running in the background. -

- -

Be sure you have the current versions of WinBoard and the chess -engine you are using. WinBoard 3.4.1 and earlier had a bug that -caused this problem to occur with all chess engines. A buggy chess -engine that does not respond to the "quit" command will also cause -this. - -

If you still see this problem, you can stop the rogue chess engine -by pressing Ctrl+Alt+Del, selecting the chess engine process from the -menu, and pressing the End Task button. - -


-

[C.12] -Why do my ICS -opponents often get extra time after they make their moves? -Why do I sometimes lose time off my clock after I make my move? -

- -If you are playing with the ICS incremental clock, both you and your -opponent get a set amount of extra time after each move. - -

If your or your opponent has netlag, your opponent might appear to -get extra time, especially if your opponent is using timestamp or -timeseal. The ICS charges each player who is using timestamp or -timeseal only for the time between when the player received his -opponent's move and the time he sent his own move. Thus delays in -network transmission do not count against either player. But WinBoard -counts down the display of your opponent's clock on your screen under -the assumption that there is no netlag. When his move comes in, if -there was netlag, the ICS may not have really charged him for that -much time, and WinBoard corrects the clock to what the ICS says it -should read. - -

If you are not using timestamp or timeseal, you may appear to lose -time off your clock at some point after you make your move. In this -case, the ICS charges you for the time between when it sent you your -opponent's move and the time it received your move. Thus delays in -network transmission count against you. WinBoard stops counting down -the display of your clock on your screen (and starts your opponent's) -when you make your move. When the ICS echoes your move back to you, it -may have charged you for more time than that, and WinBoard corrects -the clocks to what the ICS says they should read. - -

See "help lag" and "help timestamp" or "help timeseal" on your ICS for -more detailed information. - -


-

[C.13] -I can't run WinBoard unless I delete the WinBoard.ini file each time! -

- -

Most people don't have this problem, but two or three people using -Windows NT 4.0 with Service Pack 3 or 4 have reported it. I have no -idea what causes this problem. Contrary to what was reported in a -previous version of this FAQ, reinstalling the service pack after -installing WinBoard does not seem to solve the problem. - -


-

[C.15] -I get errors compiling XBoard's parser.c. -

- -

The file parser.c is automatically generated from parser.l. The -copy included with XBoard 4.0.2 was generated by lex on Tru64 Unix and -has problems compiling and linking on current GNU/Linux versions. The -copy included with XBoard 4.0.3 was generated by flex on a GNU/Linux -machine, but it too won't necessarily work on other versions of Unix. -If you have this problem, you can fix it by deleting parser.c and -letting the Makefile re-create it from parser.l. This will work if -you have either lex or flex on your system. Flex is available in all -GNU/Linux distributions and can be obtained at no charge from the Free -Software Foundation, www.fsf.org. - -


-

[C.16] -I get an error building WinBoard from source because "flex" is not found. -

- -

The file parser.c is automatically generated from parser.l. The -Makefile included with the WinBoard source kit has a rule for -generating parser.c using the program "flex", which will fail if you -don't have flex. However, the source kit also includes a ready-made -copy of parser.c, so you don't really need flex unless you have made -changes to parser.l. Check that you still have a copy of parser.c; if -you don't, unpack the WinBoard source zip file again to get one. -Either set the last-modified time of parser.c to be later than that of -parser.l, delete parser.l, or comment out the Makefile rule for -building parser.c from parser.l, and then try building WinBoard again. - -

If you do want to change parser.l and rebuild parser.c, you can get -flex as part of the free Cygwin kit from -http://sourceware.cygnus.com/cygwin/. You can -probably also get flex for Windows by itself from various other places -around the Internet. It is free software distributed by the Free -Software Foundation, www.fsf.org. - -


-

[C.17] - XBoard hangs shortly after connecting to an ICS when used with dxterm, - cmdtool, dtterm, kterm, konsole, or other substitutes for xterm. -

- -

After connecting to a chess server, XBoard 4.0.2 and later sends an -escape sequence to its terminal that is meant to display your handle -and the ICS host name (for example, "user@chessclub.com") in the -terminal's banner and icon. It seems that several of the alternative -X terminal programs have a bug that makes them hang when sent this -escape sequence. - -

You can work -around the problem by using xterm, nxterm, rxvt, aterm, xiterm, or -gnome-terminal, all of which seem to work fine. In fact, current -versions of kterm and konsole seem to work fine too, so if you are -having problems with one of them, be sure you are not running an -outdated version. - -

Alternatively, you can disable this feature by commenting out the -body of DisplayIcsInteractionTitle in xboard.c and recompling xboard. - -


-

[C.18] - The WinBoard pieces show up in the wrong colors, appear distorted, - or are not visible at all. -

- -

This can happen if you have a bug in your Windows display driver. -Check with the manufacturer of your display card, the manufacturer of -your computer, or Microsoft to see if there is an updated driver -available. You can usually download updated drivers from the Web. - -

If you can't find an updated driver, you can try running Windows -using a different number of colors and/or disabling some of the -hardware acceleration features on your display card. To change the -number of colors, go to Windows Start / Settings / Control Panel / -Display / Settings / Color Palette. To disable hardware acceleration -features, go to Windows Start / Settings / Control Panel / Display / -Settings / Advanced Properties / Performance / Hardware Acceleration. - -

It's also possible that Windows has the right driver for your -hardware already but you are not using it. It may help to reinstall -your driver. Go to Windows Start / Settings / Control Panel / System -and delete your display card (maybe even your monitor too), then -reboot. Windows should automatically re-detect your card and monitor -and re-install the drivers; if it doesn't, run Start / Settings / -Control Panel / Add New Hardware to force it to. - -

If all else fails, try Monochrome mode. On WinBoard's menus, go -to Options / Color and check Monochrome. WinBoard will display in black -and white. - -


-

[C.19] XBoard or WinBoard tells me "Error: first chess - program (...) exited unexpectedly".

- -

This message means that your chess engine crashed, probably due to -a bug in the engine, or because you have it configured incorrectly. -You can try running XBoard or WinBoard again with the "-debug" flag on -the command line. This will print out all the messages received from -the chess engine. (With WinBoard, the messages go into a file called -WinBoard.debug; with XBoard, they go to the xterm that you started -XBoard from.) - -

If you are using GNU Chess and you see this problem as soon as it -starts up, most likely GNU Chess is exiting with an error message. If -you see the message "NO LANGFILE", it means that you did not install -GNU Chess correctly, and it is unable to find the file gnuchess.lang. -Make sure that you defined LIBDIR in the gnuchess Makefile, and that -gnuchess.lang is in that directory. If gnuchess.lang is not there, -you probably didn't type "make install" in the gnuchess src directory; -you must do this to install gnuchess.lang (and the gnuchess book). If -you defined LIBDIR to something that is not an absolute pathname (that -is, to something that does not start with a "/"), GNU Chess will work -only if you run it from the GNU Chess "src" directory where you built -it. - -


[C.20] - XBoard tells me "Warning: Cannot allocate colormap entry", or - "too few colors available; trying monochrome mode", or - "XPM pieces cannot be used in monochrome mode". -

- -

You are running your X server with 8-bit color depth, and you are running -some program that has used up all 256 of your colors. Netscape tends -to do this, or maybe you have a background image that uses up all of -your colors. - -

If you have a modern machine, you probably have enough display -memory to run your X server with 16-, 24-, or 32-bit color depth. If -you're using "startx" to start the X server, try giving the command as -"startx -- -bpp 24" (or 16, or 32). On newer X servers you -may have to use -depth instead of -bpp. Further details on -configuring your X server are beyond the scope of this FAQ. - -

If you must run in 8-bit mode, try the following: -Avoid background images that use up all your colors. If you -run Netscape, try starting it up with the -install command-line -option; this gives Netscape its own private colormap that X will -switch to when Netscape has the keyboard focus. - -

If all else fails, another possibility is to run xboard in -monochrome (black and white) mode by giving it the -mono -command-line option. XBoard will try this by itself in some cases. -Monochrome mode works only with bitmap pieces, not pixmap pieces, so -trying to use it may give you the error "XPM pieces cannot be used in -monochrome mode". To get around this, either use the -bitmapDirectory -command line option to point XBoard to the directory containing the -bitmap pieces included with the XBoard source code, or rebuild XBoard -with pixmap support disabled, using "./configure --disable-xpm ; make -clean ; make". - -


[C.21] - When I log in to freechess.org, the Enter key doesn't work, and I - have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't - work either, so I'm stuck. -

- -

This is a pretty rare problem. It should only arise if you have to -reach freechess.org by telnetting (or connecting with WinBoard -/icsport=23) from a Windows PC to a Unix box, and then telnetting from -there to freechess.org. The Enter key should always work when -connecting directly from your PC to freechess.org. - -

The best way to get around the problem is to run timeseal on the -intermediate Unix box instead of telnet. Get the appropriate version -of timeseal for your box from ftp.freechess.org and follow the -directions in the help files on FICS. - -

If you can't run timeseal for some reason, there are some things -you can do to make telnet stay in line mode instead of going to -character mode. Then the Enter key will work. First, try "telnet -freechess.org 5000" instead of "telnet freechess.org." -If that still doesn't work, then when the Enter key stops working, -type the following. Here < and > surround the -names of keys. - -

 -    <Ctrl+S><Ctrl+]>mode line<Enter>
 -
- -

[C.22] - XBoard says, "Failed to start first chess program gnuchessx - on localhost: gnuchessx: No such file or directory." -

- -

XBoard is looking for GNU Chess 4.0. If you didn't want to use -XBoard with GNU Chess, please see topic [C.6]. -If you did want to use GNU Chess 4.0, be sure you have it installed and -that it is on your $PATH. If you wanted to use GNU Chess 5 instead, -see topic [D.6]. - -


-

[D] Crafty and other topics

-
-

[D.1] What is XChess?

- -XChess is an older chessboard program that is no longer supported. XChess was -written for X version 10, and you may or may not be able to build and run it -on an X11 system. - -

XChess has only one significant feature that is not present in XBoard: Two -humans can play chess using XChess on different machines, without using the -Internet Chess Server as an intermediary. This feature is of interest only if -you don't have network connectivity to the Internet Chess Server. - -

Note: There actually have been several different programs called "XChess" in -circulation at various times. The above describes one that was associated -with GNU Chess. - -


-

[D.2] What is Winsock Chess?

- -Winsock Chess is a program that lets two people play chess across a -network. It runs only under Microsoft Windows. Some of the code in -Winsock Chess is derived from GNU Chess, but it is not maintained by -the GNU Chess team. You can get a copy from the Internet Chess -Library; see topic [A.2]. For more information, -contact its author, Donald Munro, ccahdm@beluga.upe.ac.za. - -
-

[D.3] What is Crafty?

- -Crafty is a freely-available chess program written by Bob Hyatt. -Bob is the main author of the well-known chess program Cray -Blitz. Crafty is a very strong program, its code is available, commented -and fairly readable, and its author is actively working on improvements. - -

You can download Crafty from ftp://ftp.cis.uab.edu/pub/hyatt/. Start by getting the read.me file and -reading it. Among other things, this file contains instructions on -how to install Crafty as a command-line application on your machine. - -

There is a Crafty mailing list. -To subscribe, send email to majordomo@cis.uab.edu, with -"subscribe crafty-list" in the body. - -


-

[D.4] How do I use Crafty with XBoard?

- -

First, you need to get Crafty and install it as a command-line -application on your machine. See topic [D.3]. - -

To use Crafty with XBoard, give the -fcp -parameter like this: - -

 -    xboard -fcp "./crafty" -fd crafty_directory
 -
- -Here crafty_directory is the directory where you installed Crafty. -You can add more xboard options at the end of the command line. - -

Crafty 15.14 or later is required to work properly with XBoard -4.0.0 or later. We generally recommend using the latest versions of -both XBoard and Crafty. - -


-

[D.5] How do I use Crafty with WinBoard?

- -

First, you need to get Crafty and install it as a command-line -application on your machine. See topic [D.3]. -It is best to use the latest version of Crafty with the latest version -of WinBoard to make sure all features are compatible and function -correctly. You can install Crafty in any directory you like. - -

You also need to get WinBoard and install it in the normal way -using its built-in installer. You can do that either before or after -you install Crafty. - -

After both Crafty and WinBoard are installed separately, follow the -directions in the WinBoard Help file (included with WinBoard) for -connecting new chess engines to WinBoard. - -

If you want to have Crafty act as an automated computer player on a -chess server, see topic [B.16]. Before you try -to get that working, be sure you can play against Crafty locally, -first without WinBoard, then with it. Also be sure you can use -WinBoard to play on the chess server yourself, without having Crafty -connected to it. You have to crawl before you can walk! - -


-

[D.6] How do I use GNU Chess 5 with XBoard?

- -

By default, XBoard still tries to use GNU Chess 4 by running the -command "gnuchessx". That's why if you don't have GNU Chess 4, you -get the error message "Failed to start first chess program gnuchessx -on localhost: gnuchessx: No such file or directory." - -

If you have GNU Chess 5, the command should be "gnuchess xboard" -instead. To make XBoard use this command, give the -fcp parameter -like this: - -

 -    xboard -fd gnuchess_directory -fcp "./gnuchess xboard" 
 -
- -Here gnuchess_directory is the directory where you installed -GNU Chess 5 and its book. You can add more xboard options at the -end of the command line. - -


-$Id: FAQ.html,v 2.2 2003/11/28 09:35:21 mann Exp $
-** End of XBoard/WinBoard FAQ ** - ++ ++XBoard and WinBoard: Frequently Asked Questions ++ ++

XBoard and WinBoard: Frequently Asked Questions

++ ++This document answers some frequently asked questions about the ++graphical chess interfaces XBoard and WinBoard. ++A hyperlinked version of this FAQ is available on ++the Web through the page ++http://www.tim-mann.org/chess.html. ++ ++This FAQ is in need of revision. Please contact us if you'd like ++to help update it. ++ ++
++

Outline

++ ++ ++ ++
++

Detailed contents

++ ++ ++ ++
++

[A] Introduction and hot topics

++
++

[A.1] What are XBoard and WinBoard?

++ ++XBoard and WinBoard are graphical user interfaces for chess. ++XBoard runs with the X Window System on Unix systems (including ++GNU/Linux); see topic ++[B.1]. ++WinBoard runs on true 32-bit Microsoft Windows operating ++systems, such as Windows 95, 98, NT, ++2000, ME, XP, and should continue to work ++on future 32-bit Windows systems. It does ++not work on Windows CE (also known as Pocket PC), nor does it work on ++16-bit Windows systems such as Windows 3.1. See topic ++[B.2]. ++ ++
++

[A.2] Where can I get chess information and chess ++software?

++ ++As a shortcut to most things mentioned in this FAQ, try Tim Mann's ++Chess Web page, http://www.tim-mann.org/chess.html. This page page is a good ++place to get the latest released versions of XBoard and WinBoard and ++the most up-to-date version of this FAQ. Also see our Savannah ++project pages at https://savannah.gnu.org/projects/xboard/. ++ ++

If you have other questions about XBoard/WinBoard that aren't answered ++in this FAQ, you can try Aaron Tay's WinBoard and Chess Engines FAQ, at ++http://www.aarontay.per.sg/Winboard/. ++ ++

For general news and information about chess, try the newsgroup hierarchy ++rec.games.chess.*, especially the groups rec.games.chess.misc and ++rec.games.chess.computer. Both of the latter groups have very informative ++FAQs maintained by Steve Pribut; look for them on the newsgroups or at ++http://www.clark.net/pub/pribut/chess.html. ++ ++

Like other GNU software, you can get XBoard, and ++WinBoard by anonymous FTP from ++ftp://ftp.gnu.org/pub/gnu/ ++and its many mirror sites. Look in the subdirectories xboard, and winboard. ++The .tar.gz suffix on the files there indicates they were packed with tar ++and compressed with gzip. The .exe or .zip suffixes indicate files that ++were packed and compressed with zip. ++ ++

For other chess software, try the Internet Chess Library. Use anonymous FTP ++to connect to ftp.freechess.org, or go to the Web page ++http://www.freechess.org/. ++You can get chess software, game ++collections, the FAQ file for rec.games.chess, and other chess-related ++material there, in the directory pub/chess. The FTP server can ++automatically decompress files for you as you download them, useful if you ++don't have gzip. ++ ++

Here is a sample anonymous ftp session. Some of the ftp server's responses ++are abbreviated, but all the commands you must type are included. ++ ++

++    % ftp ftp.gnu.org
++    Connected to ftp.gnu.org
++    Name: anonymous
++    Password: your-email-address@your-site
++    ftp> binary
++    200 Type set to I.
++    ftp> cd /pub/gnu/xboard
++    ftp> dir
++    -rw-r--r-- 1 14910 wheel  1057625 May 20 00:25 xboard-4.2.7.tar.gz
++    ftp> get xboard-4.2.7.tar.gz
++    150 BINARY connection for xboard-4.2.7.tar.gz (1057625 bytes).
++    226 Transfer complete.
++    ftp> quit
++
++ ++
++

[A.3] What are the current version numbers for ++XBoard and WinBoard?

++ ++At this writing, the current version numbers are: ++ ++
    ++
  • XBoard 4.2.7
  • ++
  • WinBoard 4.2.7
  • ++
++ ++
++

[A.4] Who is working on this project?

++ ++Please see our Savannah project pages at https://savannah.gnu.org/projects/xboard/ for a list of active ++developers. Many others occasionally contribute suggestions and ++snippets of code, for which we are grateful. ++ ++
++

[A.5] How do I report bugs, offer help, etc.?

++ ++

Bug reports, suggestions, and offers to help on XBoard ++or WinBoard should be sent to ++bug-xboard@gnu.org. ++ ++

Beginner questions and discussion about the program may get faster ++answers on the WinBoard Forum at http://f11.parsimony.net/forum16635/. ++ ++

If you are developing a ++chess engine that works with XBoard or WinBoard (or an alternative ++GUI that works with such engines), see the Chess Engines mailing ++list, hosted at ++http://groups.yahoo.com/group/chess-engines. ++ ++

Any time you want to report a possible bug in XBoard or WinBoard, ++we need to know exactly what you did, and exactly what error (or ++other) messages you got. ++ ++

If you are using Unix, run the "script" program, run XBoard with ++the -debug flag (if you get as far as running it), do whatever is ++necessary to reproduce the problem, type "exit" to the shell, and mail ++us the resulting typescript file. We also need to know what ++hardware/operating system combination you are using. The command ++"uname -a" will usually tell you this; include its output in your ++typescript. ++ ++

If you are using MS Windows, run WinBoard with the -debug flag, and ++send us a copy of the WinBoard.debug file. If you aren't sure how to ++add command-line flags to WinBoard, you can hit Ctrl+Alt+F12 to create ++a WinBoard.debug file after WinBoard starts, but that is not as good, ++because a few messages that would have been printed at the start are ++lost. ++ ++

Either way, please send us the exact text of the commands you typed ++and the output you got, not just your recollection of approximately ++what they were. The messages may seem meaningless to you, but they ++are very meaningful to us and essential for diagnosing problems. ++ ++


++

[A.6] What are the future plans for XBoard and ++ WinBoard?

++ ++

Our plans are always in flux. As with most free software projects, ++the next release will happen when it happens -- or it may never ++happen. This has always been the policy for XBoard/WinBoard. ++Releases have never been promised in specific time frames. ++ ++

Starting in November 2003, several new developers have joined the ++project, and work is now hosted at https://savannah.gnu.org/projects/xboard/. Lots of work is just ++getting underway, but nothing is far along yet. ++ ++

Here is a partial list of items that have a nonzero probability of ++happening in finite time. ++ ++

    ++
  • Small bug fixes. Occasionally someone sends us a fix, or reports ++a small bug very clearly so that we're able to fix it in a few minutes ++work.

    ++ ++

  • Protocol version 3. The members of the chess engine authors' ++mailing list discussed a set of proposed features for the next version ++of the XBoard/WinBoard chess engine communication protocol. ++Unfortunately, this project has gotten only as far as that discussion ++took it; no revisions of the protocol spec or coding have been done ++yet. A few simple features are very clearly needed, though, and will ++probably appear in time.

    ++ ++

  • Contributed features. Several people have mailed me code to add ++various features. Most of this code is available on the ++XBoard/WinBoard extensions page at http://www.tim-mann.org/extensions.html, but it is not in any ++official releases yet. We are in the process of getting folks to ++formally assign the copyrights on their contributions to the Free ++Software Foundation so that we can include it in official releases in ++the future.

    ++ ++

  • Internationalization. Several people have expressed interest in ++internationalizing XBoard/WinBoard, and so hopefully this project will ++go forward. Once the internationalization support is in, we will need ++more translators. Watch for news on the xboard-devel mailing list on ++our Savannah pages. ++ ++
++ ++
++

[B] XBoard and WinBoard

++
++

[B.1] What is XBoard?

++ ++XBoard is a graphical user interface for chess. It displays a ++chessboard on the screen, accepts moves made with the mouse, and loads ++and saves games in Portable Game Notation (PGN). XBoard is free software. ++It serves as a front-end for many different chess services, including: ++ ++

Chess engines that will run on your machine and ++play a game against you or help you analyze, such as GNU Chess and ++Crafty (topic [D.3] below). ++ ++

Chess servers on the Internet, where you can ++connect to play chess with people from all over the world, watch other ++users play, or just hang out and chat. ++ ++

Correspondence chess played by electronic ++mail. The cmail program (topic [B.6] below) ++automates the tasks of parsing email from your opponent, playing his ++moves out on your board, and mailing your reply move after you've ++chosen it. ++ ++

The Web and your own saved games. You can use ++XBoard as a helper application to view PGN games in your ++Web browser, or to load and save your own PGN files. ++ ++

XBoard runs under Unix or Unix-compatible systems. It requires the ++X Window System, version X11R4 or later. There are also ports of ++XBoard to 32-bit Microsoft Windows and to ++the Amiga. See topics [B.2] and [B.3] respectively. ++ ++


++

[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?

++ ++WinBoard is a port of XBoard to 32-bit Microsoft Windows systems, such ++as Windows 95, 98, NT, 2000, ME, and XP. It uses the same back end ++chess code as XBoard, but the front end graphics code is a complete ++rewrite. WinBoard is free software. ++ ++

The WinBoard distribution includes a port of GNU Chess to Win32. ++The GNU Chess port is distributed in executable form, with instructions for ++rebuilding it from the standard GNU Chess sources (available separately). You ++should have at least 16 to 24 MB of memory to run GNU Chess with WinBoard. ++ ++

The WinBoard distribution also includes the ICC timestamp and FICS ++timeseal programs (topic [B.12]). ++ ++

cmail (topic [B.6]) has not been ported to ++Windows. All the other XBoard functions are included in WinBoard. ++The International Email Chess Group web site at http://www.iecg.org/ recommends ++ECTool (http://www.ectool.nu/) ++for playing correspondence chess under Windows. ++ ++

You install WinBoard as follows. Download the WinBoard package to ++your PC (see topic [A.2]). It will be a file ++with a name like winboard-4_0_0.exe. Double-click on this file ++in the Explorer or File Manager to run it. Follow the on-screen ++prompts. ++ ++


++

[B.3] Is there an XBoard for the Amiga? What is AmyBoard?

++ ++AmyBoard is a port of XBoard to the Amiga, by Jochen Wiedmann. ++The distribution includes a port of GNU Chess. ++AmyBoard is free software. ++ ++

The current version of AmyBoard is 330.5 (based on XBoard 3.3.0). ++No one is currently maintaining it. ++ ++

System requirements: ++ ++

    ++
  • An Amiga (obviously :-), running OS 2.04 or later, 2Mb RAM or more.
  • ++
  • MUI 2.0 or later.
  • ++
  • Workbench or another screen with no less than 640x400 pixels (adjustable ++ with the MUI-Prefs); this restriction is just because we don't have ++ bitmaps with less than 40x40 pixels per square. If someone contributes ++ bitmaps with 20x20 or 20x25, they will work with any Hires mode.
  • ++
++

++If you would like to use an ICS, you need an Internet connection via either ++ ++

    ++
  • a telnet-like program, or
  • ++
  • a terminal program reading from stdin and writing to stdout.
  • ++
++

++AmyBoard is available in the Internet Chess Library (topic [A.2]). ++ ++


++

[B.4] Is there an XBoard for the Macintosh?

++ ++Note: I am not a Mac user and have not tried this myself, so I cannot ++answer questions about it. ++ ++

Because MacOS X has a Unix base, XBoard will compile and run on it. ++You do need an X11 (X Window System) server and client libraries. I'm ++told that these come standard with MacOS X 10.3 and later. Once you ++install the X11 package, XBoard is reported to compile and run without ++changes. ++ ++

You can avoid having to compile XBoard (and GNU Chess) yourself by ++using the Fink sofware packaging system. See ++http://fink.sourceforge.net/ and ++http://finkcommander.sourceforge.net/ for more info on Fink. ++ ++

There is no version of XBoard or WinBoard that runs with the native ++(non-X11) Mac graphical interface, and none that runs on MacOS 9 or ++earlier.

++ ++ ++
++

[B.5] Does XBoard run on VMS?

++ ++No. This port would probably be a lot easier than the Win32 and Amiga ++ports were, because VMS has the X Window system (under the name ++DECwindows) and is now POSIX compliant. If you are working on this, ++send mail to bug-xboard@gnu.org to let us know. ++ ++ ++
++

[B.6] What is cmail?

++ ++cmail is a program that helps you play and keep track of electronic mail ++correspondence chess games using XBoard. It is distributed with XBoard and ++has its own manual page. cmail is free software. It was written by ++Even Welsh. cmail has not been ported to Windows; sorry. ++ ++
++

[B.7] How do I build XBoard? Do I need gcc?

++ ++The first step to building XBoard is to get the distribution file. See topic ++[A.2] for places you can ftp the software from. ++ ++

Next, decide what directory tree you are going to install XBoard ++in. The default is /usr/local, but you probably don't have write ++access to that directory unless you are a system administrator. If ++you do, type the following to install it there: ++ ++

++    gzip -cd xboard-*.tar.gz | tar -xvf -
++    cd xboard-*/
++    ./configure
++    make
++    su
++    make install
++
++ ++If you want to install xboard in your personal home directory ($HOME/bin), ++type this: ++ ++

++    gzip -cd xboard-*.tar.gz | tar -xvf -
++    cd xboard-*/
++    ./configure --prefix=$HOME
++    make
++    make install
++
++ ++

If the first step above fails because you don't have gzip, see ++topic [A.2], and ask a local Unix expert if you ++need more help. If you have any problems with the last two steps, ++read the READ_ME and INSTALL files in the xboard-*/ directory. You ++will also find this FAQ there. ++ ++

You don't need to have gcc to build XBoard. Almost any Unix C ++compiler should do. ++ ++


++

[B.8] Can I use XBoard or WinBoard to play a game ++ of chess with another human?

++ ++The only way for two humans on different machines to play chess in ++real time using XBoard/WinBoard is to use an Internet Chess Server ++as an intermediary. That is, each player runs his own copy of XBoard ++or WinBoard, both of them log into an ICS, and they play a game there. ++Two copies of XBoard/WinBoard cannot communicate with each other ++directly. ++ ++

Instructions on how to get started with Internet chess are included ++with the XBoard and WinBoard distributions. The network addresses ++included in the distribution may not always be current. The oldest ++and largest ICS is the Internet Chess Club at chessclub.com, which now ++has a fee for registered use, but still allows free unregistered use. ++There are also many newer sites with no fees, using the Free Internet ++Chess Server implementation (FICS). The most active FICS site is ++freechess.org. On these and most other chess servers, ++the port number to use is 5000. ++ ++

If you don't have network connectivity to any ICS site, you ++can run your own server using a version of the FICS code, but this ++is not easy. See http://www.tim-mann.org/ics.html#ownics for advice and pointers. ++ ++

The cmail program included with XBoard lets you play email postal games with ++another human; see topic [B.6]. ++ ++

Two humans can play chess on the same machine using one copy of ++XBoard/WinBoard in ++Edit Game mode, but the clocks don't run in this mode, so it's of limited ++usefulness. ++ ++

See also topic [D.2], Winsock Chess. ++ ++


++

[B.9] Will WinBoard run on Windows 3.1? ++ How about Windows CE (also known as Pocket PC)? ++

++ ++WinBoard does not run on Windows 3.1, Windows for Workgroups 3.11, etc., ++not even with the Win32s compatibility package. The main problem is ++that Win32s does not have threads or real concurrent processes. A ++port of WinBoard to Windows 3.1 is possible in theory, but it would be ++difficult and messy, and no one is going to do it. ++ ++

WinBoard does not run on Windows CE (also ++known as Pocket PC). I don't know what would be required to port it. ++ ++

WinBoard does run well on full 32-bit versions of Windows, such as ++Windows 95, 98, NT, 2000, ME, and XP, and should continue to work ++on future 32-bit Windows systems. ++ ++


++

[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files ++ with my Web browser?

++ ++1) On Unix systems: ++

++- Add the following line to the file .mime.types in your home directory. ++(Create the file if it doesn't exist already.) ++

++    application/x-chess-pgn    pgn
++
++

++- Add the following line to the file .mailcap in your home directory. ++(Create the file if it doesn't exist already.) ++

++    application/x-chess-pgn; xboard -ncp -lgf %s
++
++

++- Exit from your Web browser and restart it. ++ ++

2) On MS Windows systems: ++ ++

The exact procedure depends on which Web browser you are using. ++The current version of WinBoard automatically configures itself as ++your PGN viewer for local files, Netscape 4.x and later, and Internet ++Explorer. This automatic setup probably works for all other current Web ++browsers, too. ++ ++


++

[B.11] How do I use WinBoard as an external viewer ++ for PGN files with the MS Windows File Manager or Explorer?

++ ++WinBoard sets this up automatically when you install it, except on old ++versions of Windows NT (prior to 4.0). On Windows NT 3.51 or earlier, ++go to the File Manager, click on the File menu, select Associate, ++enter "pgn" as the extension, and use the Browse button to find your ++copy of WinBoard and set up the association. ++ ++
++

[B.12] How do I use ICC timestamp or FICS timeseal ++with XBoard?

++ ++First, get the appropriate version of timestamp or timeseal for your ++machine from ftp.chessclub.com or ftp.freechess.org. ++Second, be sure that you can connect using XBoard without ++timestamp/timeseal. Third, be sure that you can connect using ++timestamp/timeseal without XBoard. See the help files on ICC and FICS ++or ask people online if you have problems. ++ ++

If you are in a completely ordinary situation, where your machine ++is directly on the Internet and you can connect to ICC or FICS ++without timestamp/timeseal using ++just the command "xboard -ics" or "xboard -ics -icshost freechess.org", ++change that command to one of the following: ++ ++

++    xboard -ics -icshost 204.178.125.65 -icshelper timestamp
++
++    xboard -ics -icshost 164.58.253.13 -icshelper timeseal
++
++ ++

If you have a firewall between your machine and the ICS, see topic ++[B.19]. ++ ++

If you normally have to use the "/icscomm" command line option on ++xboard to log into a second machine, and then telnet to ICC or FICS ++from there, you are going to have to run the Unix version of timestamp ++or timeseal on the second machine. (If the second machine is not ++running Unix, you are out of luck.) Get the appropriate version of ++timestamp or timeseal onto the shell machine via FTP; see the help ++files on ICC and FICS for instructions. Then simply run it when you ++would normally run telnet. In this configuration you are not ++protected against lag between your PC and the shell machine, or for ++lag caused by heavy load on the shell machine itself from other users. ++ ++

For further information on timestamp and timeseal, see the help ++files on ICC and FICS. ++ ++


++

[B.13] How do I use ICC timestamp or FICS timeseal ++with WinBoard?

++ ++

If you select an ICS from either the WinBoard Startup dialog or the ++Windows Start submenu that WinBoard installs, WinBoard automatically ++runs timestamp or timeseal if the ICS you chose is known to support it. ++ ++

If you are constructing a WinBoard command line by hand, add the ++option "/icshelper timestamp" or "/icshelper timeseal" to the WinBoard ++command line to use timestamp or timeseal. Both timestamp.exe and ++timeseal.exe are included in the WinBoard distribution. They both ++function identically to the Unix versions, as documented in "help ++timestamp" on ICC and "help timeseal" on FICS. ++ ++

If you have a firewall between your machine and the ICS, see topic ++[B.19]. ++ ++

If you normally have to use the "/icscomm" command line option on ++WinBoard to log into a shell account, and then telnet to ICC or FICS ++from there, you are going to have to run the Unix version of timestamp ++or timeseal on the shell machine. (If the shell account is not on a ++Unix machine, you are out of luck.) Get the appropriate version of ++timestamp or timeseal onto the shell machine via FTP; see the help ++files on ICC and FICS for instructions. Then simply run it when you ++would normally run telnet. In this configuration you are not protected ++against lag between your PC and the shell machine, or for lag caused by ++heavy load on the shell machine itself from other users. ++ ++

For further information on timestamp and timeseal, see the help ++files on ICC and FICS. ++ ++


++

[B.14] How do I play bughouse with XBoard or WinBoard? ++

++ ++XBoard and WinBoard have simple but effective bughouse support. ++Offboard piece holdings are shown in the board window's banner, and ++you drop offboard pieces using the right mouse button. Press it over ++the destination square to pop up a menu of pieces. ++ ++

XBoard and WinBoard can display only one board at a time, but you ++can observe your partner's game by running a second copy of the ++program and logging in as a guest. (Unfortunately, this is not ++possible if you are using the /icscomm option.) To observe your ++partner's games automatically, use the "follow" or "pfollow" ICS ++command; see the ICS online help for details. ++ ++


++

[B.16] What is Zippy? How can I interface a ++chess program to the Internet Chess Servers?

++ ++Zippy is an interface that lets a compatible chess engine (such as GNU ++Chess or Crafty) act as a computer ++player on an Internet Chess Server. Zippy is included in both the ++XBoard and WinBoard distributions. It is implemented as a small ++amount of additional code within XBoard or WinBoard. ++For documentation, see the file ++zippy.README, included in both distributions or available ++from my chess Web page, ++http://www.tim-mann/chess.html. ++The version of zippy.README on my Web page is often more up-to-date ++than those in the XBoard/WinBoard distributions. ++You'll also find a "biography" of Zippy and pointers to the original ++Zippy the Pinhead comic strips on my Web page. ++Please read zippy.README carefully before you ask me any questions about Zippy. ++ ++

Using a computer to choose your moves on a chess server is ++considered cheating unless your account is on the computer (C) list. ++Read "help computer" on your favorite server for details on their ++policy. Most of the servers have plenty of computers running now, so they ++will not be excited about having you run a new one unless you have ++written your own chess engine. They don't really need yet another ++Crafty or GNU Chess clone. ++ ++


++

[B.17] How can I interface my own chess program ++to XBoard or WinBoard?

++ ++This is a non-trivial task. XBoard and WinBoard were not designed ++with a clean interface for talking to chess programs; they were ++written to work with an existing version of GNU Chess that expects to ++be talking to a person. Your program has to emulate GNU Chess's ++rather idiosyncratic command structure to work with XBoard and ++WinBoard. We are gradually cleaning up, improving, and documenting ++the interface as newer versions of XBoard and WinBoard come out, ++however. ++ ++

For documentation, see the file engine-intf.html, included in both ++distributions or available from my chess Web page, http://www.tim-mann.org/chess.html. ++The version of engine-intf.html on my Web page is often more up-to-date ++than those in the XBoard/WinBoard distributions. ++ ++


++

[B.18] How can I recompile WinBoard from source?

++ ++The source code for WinBoard is available from the author's Web page, ++http://www.tim-mann.org/chess.html. ++ ++

WinBoard is currently developed using Microsoft Visual C++ 5.0. ++You can build the program from the MSVC++ GUI by opening the project ++file (winboard.dsp) and telling MSVC++ to build the project. You can ++also build it from the the command line by using the nmake program ++supplied with MSVC++. ++ ++

To build WinBoard with the free Cygwin tools, available from http://www.cygwin.com/), use the ++command "make -f cygwin.mak". WinBoard 4.2.5 was successfully ++compiled with the net release of Cygwin as downloaded on 20-March-2001 ++(cygwin1.dll 1.1.8, gcc 2.95.2-6, binutils 20001221-1, flex 2.5.4-1), ++but exhibits a command-line parsing bug; see item 511 in the ToDo file ++that comes with WinBoard. WinBoard 4.1.0 does not compile with ++Cygwin. WinBoard 4.0.7 is known to compile with Cygwin BL20.1. ++ ++

To build WinBoard with Borland C++ 4.5, use "borland.mak", supplied ++with the WinBoard sources, as the Makefile. Support for Borland C++ ++was contributed by Don Fong and has not been tested by the author of WinBoard. ++ ++

WinBoard is a Win32 application, so you definitely need a compiler ++and tool set that supports Win32. In particular, older versions of ++DJGPP can build only 32-bit MSDOS programs; that is, programs that use ++a DOS extender to get a 32-bit address space and do not make any ++Windows calls. The latest versions of DJGPP are said to be able to ++build Win32 programs when used with the proper extension package(s), ++but this is not known to work with WinBoard. Use Cygwin instead. ++ ++

See also topic [C.16]. ++ ++


++

[B.19] ++How can I use XBoard or WinBoard to talk ++to an Internet Chess Server through a firewall or proxy? ++

++ ++

There is no single answer to this question, because there are many ++different kinds of firewalls in use. They work in various different ++ways and have various different security policies. This answer can ++only provide hints. ++ ++

Note that you can't access Internet Chess Servers through a Web proxy, ++because they are not a Web service. You talk to them through a raw ++TCP connection, not an HTTP connection. If you can only access the ++Web through a proxy, there may be a firewall that stops you from ++making direct TCP connections, but there may also be a way through it. ++Read on for hints, and contact your local system administrator if you ++need more information about your local configuration. ++ ++

A helpful user mailed me the following explanation of how to use ++WinBoard with WinGate: ++

++"I have managed to setup WinBoard though my WinGate proxy. I have the ++Office version. What I needed to do was to setup the TCP/IP ++connection to add the User/Host name and my provider service name for ++the DNS, but I had to leave the HOST IP address blank. I have not ++played with all the variations, so it may be just that I have the DNS ++lookup enabled." ++
++I hope this helps, though I don't find it very clear. I don't have ++a copy of WinGate myself and can't help if you have questions about it. ++ ++

If you are using some other non-SOCKS firewall, read the FIREWALLS section ++in your XBoard or WinBoard documentation (man page, info document, or ++Help file). If you can telnet to a chess server in some way, then you ++can almost certainly connect to it with xboard/WinBoard, though in ++some cases you may not be able to run timestamp or timeseal. The ++timestamp and timeseal protocols require a clean, 8-bit wide TCP ++connection from your machine to the ICS, which some firewalls do not ++provide. ++ ++

If you have a SOCKS firewall and are using XBoard, ++you should be able to SOCKSify xboard and use it. See http://www.socks.nec.com/ for ++information about SOCKS and socksification. However, if you do this, ++you can't use timestamp or timeseal; what you really need is a ++socksified version of timestamp or timeseal. This is hard because the ++source code for timestamp and timeseal is proprietary; the folks ++running the chess servers don't give it out because that would make it ++too easy to cheat. On some versions of Unix, you may be able to ++socksify a program that you don't have the source code to by running ++it with an appropriate dynamic library; see http://www.socks.nec.com/. For ++others, you might be able to get a pre-built socksified version from ++the chess server administrators. For timeseal versions, see ftp://ftp.freechess.org/pub/chess/timeseal/. For timestamp ++versions, the directory would be ftp://ftp.chessclub.com/pub/icc/timestamp/, but at this writing ++there don't seem to be any socksified timestamps there. Once you have ++a socksified timestamp or timeseal, simply run it with a normal, ++non-socksified xboard in place of the standard timestamp or timeseal. ++ ++

If you have a SOCKS firewall and you are using ++WinBoard, we now know how to make this configuration ++work, complete with timestamp or timeseal! ++ ++

Start by getting SocksCap32. This software is freely available ++from http://www.socks.nec.com/. ++Install it on your machine, read the documentation, and learn to use ++it. You may find it useful with many other programs besides WinBoard. ++ ++

Next, don't socksify WinBoard. Socksifying ++WinBoard itself doesn't let you use it with timestamp or timeseal. ++For some reason I don't understand -- something strange that ++SocksCap32 does -- the socksified WinBoard runs but does nothing, and ++timestamp/timeseal runs all by itself in its own window. ++ ++

Instead, use the following workaround. Follow the instructions ++exactly; don't try to skip steps or simplify things. ++ ++

First, make SocksCap32 application profiles for timestamp and ++timeseal. Use the following command lines in the SocksCap32 ++profiles. Name the first profile "timestamp" and the second ++"timeseal". ++ ++

++    "c:\program files\winboard\timestamp.exe" chessclub.com 5000 -p 5000
++    "c:\program files\winboard\timeseal.exe" freechess.org 5000 -p 5000
++
++ ++

Second, run timestamp or timeseal by itself, socksified, using its ++profile. This will open an unneeded, black window that will not ++respond to typing. Minimize it to the task bar and ignore it. It will ++go away when you exit from WinBoard. ++ ++

Next, run WinBoard using the following command line. Make a shortcut ++or type this command into an MS-DOS Prompt box. Don't run WinBoard ++itself socksified, just run it directly. ++ ++

++    "c:\program files\winboard.exe" /ics /icshost=localhost /icsport=5000
++
++ ++

After you get this working, you can try getting the timestamp window to ++auto-minimize by starting it from a shortcut instead of from the ++SocksCap32 control window. As it says in the SocksCap32 help file, put ++the following in the Target field of a shortcut's Properties page: ++ ++

++    "c:\program files\sockscap32\sc32.exe" timestamp
++
++ ++Then select "Run: Minimized" on the same page. Do the same for timeseal. ++ ++

Another method that can work is to use a .bat file to start both ++timestamp and WinBoard. It would look something like this: ++ ++

++    REM --
++    REM -- icc.bat
++    REM -- Start timestamp under SocksCap32 and use WinBoard to connect to it.
++    REM -- The string "timestamp" refers to a SocksCap32 profile for timestamp.
++    REM --  Do not change it to the filename of the timestamp program!
++    REM --
++    start /minimized "c:\program files\sockscap32\sc32.exe" timestamp
++    cd "c:\program files\winboard"
++    winboard /ics /icshost=localhost /icsport=5000
++
++ ++

This workaround has a problem if you want to run two copies of ++WinBoard at once, talking to the same chess server twice (for ++bughouse) or to two different chess servers. If you need to do that, ++you will need to run a separate copy of timestamp with a different ++port number for each connection. You'll need to make a second set of ++profile entries with a different value after the -p flag (say, 5001) ++and you'll need to change the WinBoard command line /icsport=5000 for ++the second WinBoard to match. ++ ++


++

[B.20] ++How can I use XBoard or WinBoard on chess.net with accuclock? ++

++ ++

I believe chess.net provides a Win32 command-line version of ++accuclock that will work with WinBoard. Please see the documentation ++on the chess.net server itself; don't ask the author of WinBoard. ++ ++

I don't know whether chess.net provides versions of accuclock for ++Unix at this time. Ask them. ++ ++


++

[B.21] ++ Can I get Zippy to do one or more ICS commands automatically at the ++ start or end of each game?

++ ++

By default, Zippy automatically sends the command "gameend" to ICS ++at the end of each game. You can alias this command (using the ICS ++"alias" feature) to anything you want. On ICC, you can use the ++"multi" feature to alias gameend to several commands, but other ++servers don't have that feature. Zippy doesn't send anything at the ++start of the game by default. ++ ++

You can get Zippy to send one or more commands of your choosing, at ++the start and/or end of each game, by using the -zippyGameStart and ++-zippyGameEnd command line options, newly added in version 4.0.3. ++Both xboard and WinBoard have (somewhat obscure) ways of getting ++newlines into this option to send several commands. Here is an ++example of one way to do it for each. ++ ++

++    xboard -ics -zp -xrm '*zippyGameStart: say hi\nsay prepare to die\n'
++
++    WinBoard /ics /zp /zippyGameEnd='say thanks\nseek 5 0\nseek 2 12\n'
++
++ ++
++

[B.22] ++ How do I print from WinBoard? ++

++ ++WinBoard does not have built-in printing functionality. ++If you want to print a picture of the board, press Alt+PrintScrn, run the ++standard Windows application Paintbrush, select Paste, and print from there. ++If you want to print a list of moves, save your game as a PGN file, ++then open the PGN file with Notepad or any other plain text editor and ++print it from there. ++ ++
++

[B.23] ++ Can I get Zippy to automatically reconnect to ICS when its connection ++ breaks?

++ ++

There isn't a perfect solution to this problem yet, but a pretty ++good one is to write a shell script (for xboard) or .bat script (for ++WinBoard) that automatically restarts the program whenever it exits. ++Use the -xexit flag so that you don't get a popup dialog that must be ++dismissed with the OK button before the program will exit. The gap in ++this solution is that your connection to ICS can sometimes get into a ++state where the program does not notice that the connection is broken ++until the next time it tries to send a command. Perhaps some future ++version of xboard/WinBoard will have an option to send a harmless ++command every five minutes or so. ++ ++

Anyway, here is a sample Windows .bat file that restarts WinBoard each ++time it exits. Thanks to Jason Williamson. It assumes that you have put ++your computer account's name and password in a file named logon.ini. ++ ++

++REM --
++REM -- wbrecon.bat
++REM -- Start WinBoard in Zippy mode, and restart it each time it exits.
++REM -- Add or change parameters as needed for your application.
++REM --
++:loop
++start /w winboard /zp /ics /icslogon logon.ini /xexit /xautoraise
++REM -- The next line is to have a short delay setup for 139 seconds.
++REM -- Leave it out if it doesn't work on the version of Windows you use.
++TYPE NUL | CHOICE.COM /N /CY /TY,99 >NUL
++goto loop
++
++ ++

Here is a Unix shell script to do the same thing for xboard. ++It's a bit more elaborate. It is based on the script I use for the ++original Zippy. It logs all ICS output to a file named zippy.out, ++and it lets you type commands to Zippy by running "cat > zippy.fifo". ++ ++

++#! /bin/sh
++host="204.178.125.65 -icsport 5000 -telnet -telnetProgram timestamp"
++#host="164.58.253.13 -icsport 5000 -telnet -telnetProgram timeseal"
++out=zippy.out
++fifo=zippy.fifo
++ZIPPYPASSWORD='something'
++export ZIPPYPASSWORD
++ZIPPYPASSWORD2='orother'
++export ZIPPYPASSWORD2
++ZIPPYLINES=`pwd`/all.lines
++export ZIPPYLINES
++ZIPPYGAMEEND='say Yow, that was FUN!
++gameend'
++export ZIPPYGAMEEND
++zippylogon=`pwd`/logon.ini
++DISPLAY=`hostname`:0.0
++export DISPLAY
++mv -f $out ${out}.old
++rm -f $fifo
++mkfifo $fifo
++pid=$$
++( while [ true ] ; do cat -u $fifo ; done ) | \
++      ( while [ true ] ; do
++          xboard -iconic -ics -icshost $host \
++                 -zt -zp -xbell -xanimate \
++                 -xautosave -xquiet -fcp "gnuchessx -h" \
++                 -icslogon $zippylogon -xexit -autoflag -xautoraise $*
++          sleep 600
++        done ) > $out 2>&1 &
++
++ ++
++

[B.24] ++ The chess engines are too strong and always beat me. How can I adjust ++ the difficulty level to make them weaker?

++ ++

The simplest way to get that effect is to make sure the ++XBoard/WinBoard Auto Flag option is off, set a very fast time control ++so that the chess engine can't think for long, but take as much time ++over your own moves as you want. Also feel free to use Retract Move if ++you make a blunder. ++ ++

Many chess coaches will let you switch sides after ++they get a stronger position so that you can get experience playing ++positions where you are winning. You can try this with XBoard/WinBoard ++by using the Machine White or Machine Black menu command to make the ++machine take over your position. ++ ++

The -depth command-line option to XBoard/WinBoard can also be used to ++weaken the engine (see the man page or Help file). It's a bit of a ++nuisance to set command line options in Windows, but see topic [C.7] for instructions. ++ ++

Other ways of weakening engines are engine-specific. Many of them ++let you adjust various parameters, and if you choose bad settings, the ++engine will play more poorly. Consult whatever documentation came with ++the engine you are using. ++ ++


++

[B.25] ++ May I use the piece bitmaps from XBoard/WinBoard in my own program?

++ ++

The piece bitmaps used in XBoard and WinBoard were designed by ++Elmar Bartel. He released them under the GNU General Public ++License. This means that if your program is also free software ++distributed under the GPL, you can use them freely. If your program ++is distributed under some other license, including commercial, ++shareware, or non-GPL freeware, then you cannot use the bitmaps unless ++you obtain special permission from Elmar. See the file README.bitmaps ++that comes with the XBoard and WinBoard source code for more ++information and an email address you can write to. ++ ++


[C] XBoard and WinBoard, bugs and problems

++ ++

[C.1] I can't build XBoard ++because the X11/Xaw/... include files are not found.

++ ++These are the header files for the Athena Widgets library, which XBoard uses ++heavily. Some versions of Unix don't supply these files, but they are part of ++the standard X distribution, freely available from MIT. ++ ++

For general information on getting missing X sources, see the FAQ on ++comp.windows.x. Note that you may be missing only the header files, or you ++may be missing the libraries themselves too. ++ ++

HP-UX users are missing only the header files. You can get them by ++anonymous FTP as follows. (But first check with your system ++administrator to see if someone else at your site has already done ++this.) Get the archive file /hpux9/X11R5/Core/Xaw-5.00.tar.gz (Xaw ++header files) via anonymous FTP from the site hpux.csc.liv.ac.uk ++(138.253.42.172), or one of the other official sites---Germany: ++hpux.ask.uni-karlsruhe.de (129.13.200.57), US: hpux.cae.wisc.edu ++(144.92.4.15), France: hpux.cict.fr (192.70.79.53) or Netherlands: ++hpux.ced.tudelft.nl (130.161.140.100). Unpack the archive using gzip ++and follow the instructions in its README and/or HPUX.Install files. ++Thanks to Richard Lloyd for this information. ++ ++

If you have the Xaw header files installed in a different place ++than the other X11 headers, you may need to configure XBoard with an ++extra flag to help it find them. For example, if yours are in ++/foo/bar/X11/Xaw, try this: ++ ++

++    rm config.cache
++    (setenv CFLAGS -I/foo/bar ; configure)
++
++

++Also see topic [C.2]. ++ ++


++

[C.2] Configuring or building XBoard fails due to ++missing header files, missing libraries, or undefined symbols. ++

++ ++Perhaps you have the X server and client programs installed on your ++machine, but not the X header files and link-time libraries. If so, ++you can run existing X programs, but you cannot compile a new X ++program from source code. In this case the XBoard configure script ++will fail and will tell you to look at this question in the FAQ. Many ++GNU/Linux distributions put the headers and libraries in a separate ++package, which you might not have installed. If you are using RedHat, ++install the XFree86-devel package. If you are using some other ++kind of Unix, ask your system administrator where to find the X header ++files and link-time libraries. If this is not your problem, read on. ++ ++

The configure script for XBoard looks for X libraries and header ++files in some common places. Sometimes it fails: If yours are ++installed in an odd place, it may not find them at all. If you have ++more than one version of X installed on your system, it may find the ++"wrong" one, or occasionally it may find libraries from one version ++and incompatible header files from another. You can work around these ++problems by telling the configure script where the files are. For ++example: ++ ++

++    configure --x-includes=/odd/place/include \
++              --x-libraries=/odd/place/lib
++
++ ++

The directory named in the argument to --x-includes must have a ++subdirectory "X11" that contains the actual .h files. That is, if ++your X.h file has full pathname /odd/place/X11R6/include/X11/X.h, then ++you must give the argument --x-includes=/odd/place/X11R6/include. ++ ++

Some linkers have bugs that cause bogus error messages when you try ++to link X programs. The configure script includes a workaround for a ++bug of this kind that exists in some SunOS 4.x.x installations. See ++the FAQ on comp.windows.x for more information about problems of this ++kind. ++ ++

If all else fails, check whether anyone else at your site has been able to ++compile any X programs on your system. Your X installation might be buggy. ++If so, the system administrator at your site might know how to fix or work ++around the problem. ++ ++

Also see topic [C.1]. ++ ++


[C.3] I have problems using WinBoard on ICS ++with a modem. I'm not running SLIP or PPP, but just dialing in to an ++ordinary login account ("shell account").

++ ++Here are solutions to some common problems in this area. ++ ++

Some people want to connect to ICS through HyperTerminal or some other ++terminal program first, then run WinBoard. This is not how it works. ++WinBoard wants to talk directly with your modem, acting as a terminal program ++itself. Start out with the modem "on hook" (not making a call). ++ ++

Run WinBoard with a command line like this (adding more options if desired): ++ ++

++    WinBoard /ics /icscom com1
++
++ ++Use com2, com3, or com4 in place of com1 if your modem is connected to one of ++those ports. ++ ++

After you start WinBoard, you may need to change some of the options in the ++Communications dialog (on the Options menu). The dialog has the usual options ++for talking to modems: bits per second, bits per byte, parity, number of stop ++bits. You will probably want to use Save Settings Now when you're done. ++ ++

Next, type dialing commands to your modem in the text window that WinBoard ++creates. You may need to turn off Local Line Editing on the Options menu ++while you are typing commands to your modem. Turn it back on when you're ++done. See the WinBoard Help file for instructions if you see your typing ++echoed an extra time after you hit Enter. ++ ++


++

[C.4] ++I have problems using WinBoard on ICS with Windows 95 and SLIP ++or PPP. When trying to start up, it gets the error "Address family ++not supported by protocol family" (or some equally strange message). ++

++ ++WinBoard is a 32-bit application, but some Winsock (TCP/IP) implementations ++support only 16-bit applications. You get a strange looking error message ++if you try to use a 32-bit application because ++there is no standard Winsock error code number ++for "32-bit application not supported." ++ ++

Microsoft TCP/IP works with both 16-bit and ++32-bit applications, supports SLIP, PPP, Ethernet, etc., and is included ++with Windows 95 and later Windows systems. ++If possible, I recommend that you uninstall ++whatever Winsock you are using and install Microsoft TCP/IP instead. ++For more information, see ++http://walden.mo.net/~rymabry/95winfaq.html (the Win95-L FAQ). ++ ++

Trumpet Winsock 2.1 (and earlier) supports only 16-bit ++applications, and hence does not work with WinBoard. But there is a ++beta-test release available that does support 32-bit applications. ++I have not tried it with WinBoard, but it ++should work. See Trumpet's Web page ++http://www.trumpet.com.au/wsk/winsock.htm ++for more information. ++ ++

The 16-bit versions of America On-Line's software do not support ++32-bit Winsock applications. Get the 32-bit version. At one time the ++32-bit version was called "AOL for Windows 95," but I imagine that has ++changed. Hopefully the current versions are all 32-bit. ++ ++

A few versions of Winsock may have bugs that prevent ++Windows timestamp/timeseal from working with them. I'm not sure if ++such bugs exist in any versions that actually have 32-bit support, ++so this point might be moot. Again, Microsoft TCP/IP is known to work. ++ ++


[C.5] When I try to run WinBoard, I get the ++message "Failed to start chess program gnuchess on localhost: NO ++LANGFILE (file gnuchess.lan not found)".

++ ++

This message means that WinBoard is trying to run GNU Chess, but ++GNU Chess cannot find a file that it needs, named gnuchess.lan. ++If you see it, you've probably customized WinBoard's /fcp, /fd, /scp, ++and/or /sd options and made a mistake in the process. Review what ++you did, and see the WinBoard help file. ++ ++


++

[C.6] I want to use XBoard or WinBoard as an Internet ++Chess Server interface, but the ICS Client option is grayed out on the ++menu.

++ ++XBoard and WinBoard have three major modes that can't be changed from the ++menus: local chess engine mode, ++ICS mode, and standalone mode. ++ ++

With XBoard, you have to set the mode using command-line options. ++Local chess engine mode is the default, -ics selects ICS mode, and ++-ncp ("no chess program") selects standalone mode. ++ ++

With WinBoard, if you don't set the mode using command-line ++options, you get a dialog box asking which mode you want. To bypass ++the dialog box, use -cp ("chess program") for local chess engine mode, ++or -ics or -ncp as with XBoard. Also see topic [C.7]. ++ ++


++

[C.7] How do I give command-line options to ++a Windows program like WinBoard?

++ ++

There are many ways; pick your favorite: ++ ++

    ++
  • Type the command line into an MS-DOS Prompt box. Example: ++"WinBoard -ics". ++ ++
  • Make a Windows shortcut for WinBoard. You can do this by ++right-dragging WinBoard.exe to the desktop and selecting "Create ++Shortcut(s) Here" from the menu that appears. Right-click on the ++shortcut, select Properties, and click the Shortcut tab. The ++command-line text box is labelled "Target" instead of "Command line" ++just to confuse you. Edit the text in this box, adding the command ++line options to the end.
  • ++ ++
  • Choose Run from the Start menu, or File / Run from the Program ++Manager or File Manager, and type the command line into the dialog you ++get. You may have to give WinBoard's full drivespec and filename if ++it is not in a directory on your search path.
  • ++ ++
  • Make a Program Manager icon for WinBoard. You can do this by ++dragging WinBoard.exe from the File Manager into the Program Manager, ++or by using File / New in the Program Manager. Select the icon and ++choose File / Properties. Edit the Command Line text box to add the ++command-line options to the end.
  • ++
++ ++
++

[C.9] ++When I exit from WinBoard after using it to play against a chess ++program on my machine, the chess program keeps running in the background. ++

++ ++

Be sure you have the current versions of WinBoard and the chess ++engine you are using. WinBoard 3.4.1 and earlier had a bug that ++caused this problem to occur with all chess engines. A buggy chess ++engine that does not respond to the "quit" command will also cause ++this. ++ ++

If you still see this problem, you can stop the rogue chess engine ++by pressing Ctrl+Alt+Del, selecting the chess engine process from the ++menu, and pressing the End Task button. ++ ++


++

[C.12] ++Why do my ICS ++opponents often get extra time after they make their moves? ++Why do I sometimes lose time off my clock after I make my move? ++

++ ++If you are playing with the ICS incremental clock, both you and your ++opponent get a set amount of extra time after each move. ++ ++

If your or your opponent has netlag, your opponent might appear to ++get extra time, especially if your opponent is using timestamp or ++timeseal. The ICS charges each player who is using timestamp or ++timeseal only for the time between when the player received his ++opponent's move and the time he sent his own move. Thus delays in ++network transmission do not count against either player. But WinBoard ++counts down the display of your opponent's clock on your screen under ++the assumption that there is no netlag. When his move comes in, if ++there was netlag, the ICS may not have really charged him for that ++much time, and WinBoard corrects the clock to what the ICS says it ++should read. ++ ++

If you are not using timestamp or timeseal, you may appear to lose ++time off your clock at some point after you make your move. In this ++case, the ICS charges you for the time between when it sent you your ++opponent's move and the time it received your move. Thus delays in ++network transmission count against you. WinBoard stops counting down ++the display of your clock on your screen (and starts your opponent's) ++when you make your move. When the ICS echoes your move back to you, it ++may have charged you for more time than that, and WinBoard corrects ++the clocks to what the ICS says they should read. ++ ++

See "help lag" and "help timestamp" or "help timeseal" on your ICS for ++more detailed information. ++ ++


++

[C.13] ++I can't run WinBoard unless I delete the WinBoard.ini file each time! ++

++ ++

Most people don't have this problem, but two or three people using ++Windows NT 4.0 with Service Pack 3 or 4 have reported it. I have no ++idea what causes this problem. Contrary to what was reported in a ++previous version of this FAQ, reinstalling the service pack after ++installing WinBoard does not seem to solve the problem. ++ ++


++

[C.15] ++I get errors compiling XBoard's parser.c. ++

++ ++

The file parser.c is automatically generated from parser.l. The ++copy included with XBoard 4.0.2 was generated by lex on Tru64 Unix and ++has problems compiling and linking on current GNU/Linux versions. The ++copy included with XBoard 4.0.3 was generated by flex on a GNU/Linux ++machine, but it too won't necessarily work on other versions of Unix. ++If you have this problem, you can fix it by deleting parser.c and ++letting the Makefile re-create it from parser.l. This will work if ++you have either lex or flex on your system. Flex is available in all ++GNU/Linux distributions and can be obtained at no charge from the Free ++Software Foundation, www.fsf.org. ++ ++


++

[C.16] ++I get an error building WinBoard from source because "flex" is not found. ++

++ ++

The file parser.c is automatically generated from parser.l. The ++Makefile included with the WinBoard source kit has a rule for ++generating parser.c using the program "flex", which will fail if you ++don't have flex. However, the source kit also includes a ready-made ++copy of parser.c, so you don't really need flex unless you have made ++changes to parser.l. Check that you still have a copy of parser.c; if ++you don't, unpack the WinBoard source zip file again to get one. ++Either set the last-modified time of parser.c to be later than that of ++parser.l, delete parser.l, or comment out the Makefile rule for ++building parser.c from parser.l, and then try building WinBoard again. ++ ++

If you do want to change parser.l and rebuild parser.c, you can get ++flex as part of the free Cygwin kit from ++http://sourceware.cygnus.com/cygwin/. You can ++probably also get flex for Windows by itself from various other places ++around the Internet. It is free software distributed by the Free ++Software Foundation, www.fsf.org. ++ ++


++

[C.17] ++ XBoard hangs shortly after connecting to an ICS when used with dxterm, ++ cmdtool, dtterm, kterm, konsole, or other substitutes for xterm. ++

++ ++

After connecting to a chess server, XBoard 4.0.2 and later sends an ++escape sequence to its terminal that is meant to display your handle ++and the ICS host name (for example, ++"user@chessclub.com") in the ++terminal's banner and icon. It seems that several of the alternative ++X terminal programs have a bug that makes them hang when sent this ++escape sequence. ++ ++

You can work ++around the problem by using xterm, nxterm, rxvt, aterm, xiterm, or ++gnome-terminal, all of which seem to work fine. In fact, current ++versions of kterm and konsole seem to work fine too, so if you are ++having problems with one of them, be sure you are not running an ++outdated version. ++ ++

Alternatively, you can disable this feature by commenting out the ++body of DisplayIcsInteractionTitle in xboard.c and recompling xboard. ++ ++


++

[C.18] ++ The WinBoard pieces show up in the wrong colors, appear distorted, ++ or are not visible at all. ++

++ ++

This can happen if you have a bug in your Windows display driver. ++Check with the manufacturer of your display card, the manufacturer of ++your computer, or Microsoft to see if there is an updated driver ++available. You can usually download updated drivers from the Web. ++ ++

If you can't find an updated driver, you can try running Windows ++using a different number of colors and/or disabling some of the ++hardware acceleration features on your display card. To change the ++number of colors, go to Windows Start / Settings / Control Panel / ++Display / Settings / Color Palette. To disable hardware acceleration ++features, go to Windows Start / Settings / Control Panel / Display / ++Settings / Advanced Properties / Performance / Hardware Acceleration. ++ ++

It's also possible that Windows has the right driver for your ++hardware already but you are not using it. It may help to reinstall ++your driver. Go to Windows Start / Settings / Control Panel / System ++and delete your display card (maybe even your monitor too), then ++reboot. Windows should automatically re-detect your card and monitor ++and re-install the drivers; if it doesn't, run Start / Settings / ++Control Panel / Add New Hardware to force it to. ++ ++

If all else fails, try Monochrome mode. On WinBoard's menus, go ++to Options / Color and check Monochrome. WinBoard will display in black ++and white. ++ ++


++

[C.19] XBoard or WinBoard tells me "Error: first chess ++ program (...) exited unexpectedly".

++ ++

This message means that your chess engine crashed, probably due to ++a bug in the engine, or because you have it configured incorrectly. ++You can try running XBoard or WinBoard again with the "-debug" flag on ++the command line. This will print out all the messages received from ++the chess engine. (With WinBoard, the messages go into a file called ++WinBoard.debug; with XBoard, they go to the xterm that you started ++XBoard from.) ++ ++

If you are using GNU Chess and you see this problem as soon as it ++starts up, most likely GNU Chess is exiting with an error message. If ++you see the message "NO LANGFILE", it means that you did not install ++GNU Chess correctly, and it is unable to find the file gnuchess.lang. ++Make sure that you defined LIBDIR in the gnuchess Makefile, and that ++gnuchess.lang is in that directory. If gnuchess.lang is not there, ++you probably didn't type "make install" in the gnuchess src directory; ++you must do this to install gnuchess.lang (and the gnuchess book). If ++you defined LIBDIR to something that is not an absolute pathname (that ++is, to something that does not start with a "/"), GNU Chess will work ++only if you run it from the GNU Chess "src" directory where you built ++it. ++ ++


[C.20] ++ XBoard tells me "Warning: Cannot allocate colormap entry", or ++ "too few colors available; trying monochrome mode", or ++ "XPM pieces cannot be used in monochrome mode". ++

++ ++

You are running your X server with 8-bit color depth, and you are running ++some program that has used up all 256 of your colors. Netscape tends ++to do this, or maybe you have a background image that uses up all of ++your colors. ++ ++

If you have a modern machine, you probably have enough display ++memory to run your X server with 16-, 24-, or 32-bit color depth. If ++you're using "startx" to start the X server, try giving the command as ++"startx -- -bpp 24" (or 16, or 32). On newer X servers you ++may have to use -depth instead of -bpp. Further details on ++configuring your X server are beyond the scope of this FAQ. ++ ++

If you must run in 8-bit mode, try the following: ++Avoid background images that use up all your colors. If you ++run Netscape, try starting it up with the -install command-line ++option; this gives Netscape its own private colormap that X will ++switch to when Netscape has the keyboard focus. ++ ++

If all else fails, another possibility is to run xboard in ++monochrome (black and white) mode by giving it the -mono ++command-line option. XBoard will try this by itself in some cases. ++Monochrome mode works only with bitmap pieces, not pixmap pieces, so ++trying to use it may give you the error "XPM pieces cannot be used in ++monochrome mode". To get around this, either use the -bitmapDirectory ++command line option to point XBoard to the directory containing the ++bitmap pieces included with the XBoard source code, or rebuild XBoard ++with pixmap support disabled, using "./configure --disable-xpm ; make ++clean ; make". ++ ++


[C.21] ++ When I log in to freechess.org, the Enter key doesn't work, and I ++ have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't ++ work either, so I'm stuck. ++

++ ++

This is a pretty rare problem. It should only arise if you have to ++reach freechess.org by telnetting (or connecting with WinBoard ++/icsport=23) from a Windows PC to a Unix box, and then telnetting from ++there to freechess.org. The Enter key should always work when ++connecting directly from your PC to freechess.org. ++ ++

The best way to get around the problem is to run timeseal on the ++intermediate Unix box instead of telnet. Get the appropriate version ++of timeseal for your box from ftp.freechess.org and follow the ++directions in the help files on FICS. ++ ++

If you can't run timeseal for some reason, there are some things ++you can do to make telnet stay in line mode instead of going to ++character mode. Then the Enter key will work. First, try "telnet ++freechess.org 5000" instead of "telnet freechess.org." ++If that still doesn't work, then when the Enter key stops working, ++type the following. Here < and > surround the ++names of keys. ++ ++

++    <Ctrl+S><Ctrl+]>mode line<Enter>
++
++ ++

[C.22] ++ XBoard says, "Failed to start first chess program gnuchessx ++ on localhost: gnuchessx: No such file or directory." ++

++ ++

XBoard is looking for GNU Chess 4.0. If you didn't want to use ++XBoard with GNU Chess, please see topic [C.6]. ++If you did want to use GNU Chess 4.0, be sure you have it installed and ++that it is on your $PATH. If you wanted to use GNU Chess 5 instead, ++see topic [D.6]. ++ ++


++

[D] Crafty and other topics

++
++

[D.1] What is XChess?

++ ++XChess is an older chessboard program that is no longer supported. XChess was ++written for X version 10, and you may or may not be able to build and run it ++on an X11 system. ++ ++

XChess has only one significant feature that is not present in XBoard: Two ++humans can play chess using XChess on different machines, without using the ++Internet Chess Server as an intermediary. This feature is of interest only if ++you don't have network connectivity to the Internet Chess Server. ++ ++

Note: There actually have been several different programs called "XChess" in ++circulation at various times. The above describes one that was associated ++with GNU Chess. ++ ++


++

[D.2] What is Winsock Chess?

++ ++Winsock Chess is a program that lets two people play chess across a ++network. It runs only under Microsoft Windows. Some of the code in ++Winsock Chess is derived from GNU Chess, but it is not maintained by ++the GNU Chess team. You can get a copy from the Internet Chess ++Library; see topic [A.2]. For more information, ++contact its author, Donald Munro, ++ccahdm@beluga.upe.ac.za. ++ ++
++

[D.3] What is Crafty?

++ ++Crafty is a freely-available chess program written by Bob Hyatt. ++Bob is the main author of the well-known chess program Cray ++Blitz. Crafty is a very strong program, its code is available, commented ++and fairly readable, and its author is actively working on improvements. ++ ++

You can download Crafty from ftp://ftp.cis.uab.edu/pub/hyatt/. Start by getting the read.me file and ++reading it. Among other things, this file contains instructions on ++how to install Crafty as a command-line application on your machine. ++ ++

There is a Crafty mailing list. ++To subscribe, send email to ++majordomo@cis.uab.edu, with ++"subscribe crafty-list" in the body. ++ ++


++

[D.4] How do I use Crafty with XBoard?

++ ++

First, you need to get Crafty and install it as a command-line ++application on your machine. See topic [D.3]. ++ ++

To use Crafty with XBoard, give the -fcp ++parameter like this: ++ ++

++    xboard -fcp "./crafty" -fd crafty_directory
++
++ ++Here crafty_directory is the directory where you installed Crafty. ++You can add more xboard options at the end of the command line. ++ ++

Crafty 15.14 or later is required to work properly with XBoard ++4.0.0 or later. We generally recommend using the latest versions of ++both XBoard and Crafty. ++ ++


++

[D.5] How do I use Crafty with WinBoard?

++ ++

First, you need to get Crafty and install it as a command-line ++application on your machine. See topic [D.3]. ++It is best to use the latest version of Crafty with the latest version ++of WinBoard to make sure all features are compatible and function ++correctly. You can install Crafty in any directory you like. ++ ++

You also need to get WinBoard and install it in the normal way ++using its built-in installer. You can do that either before or after ++you install Crafty. ++ ++

After both Crafty and WinBoard are installed separately, follow the ++directions in the WinBoard Help file (included with WinBoard) for ++connecting new chess engines to WinBoard. ++ ++

If you want to have Crafty act as an automated computer player on a ++chess server, see topic [B.16]. Before you try ++to get that working, be sure you can play against Crafty locally, ++first without WinBoard, then with it. Also be sure you can use ++WinBoard to play on the chess server yourself, without having Crafty ++connected to it. You have to crawl before you can walk! ++ ++


++

[D.6] How do I use GNU Chess 5 with XBoard?

++ ++

By default, XBoard still tries to use GNU Chess 4 by running the ++command "gnuchessx". That's why if you don't have GNU Chess 4, you ++get the error message "Failed to start first chess program gnuchessx ++on localhost: gnuchessx: No such file or directory." ++ ++

If you have GNU Chess 5, the command should be "gnuchess xboard" ++instead. To make XBoard use this command, give the -fcp parameter ++like this: ++ ++

++    xboard -fd gnuchess_directory -fcp "./gnuchess xboard" 
++
++ ++Here gnuchess_directory is the directory where you installed ++GNU Chess 5 and its book. You can add more xboard options at the ++end of the command line. ++ ++


++$Id: FAQ.html,v 2.2 2003/11/28 09:35:21 mann Exp $
++** End of XBoard/WinBoard FAQ ** ++ diff --cc ToDo index 08db643,d3d6f1a..2ffa540 --- a/ToDo +++ b/ToDo @@@ -1,1369 -1,1377 +1,1419 @@@ - Possible improvements **=somewhat higher priority - --------------------------------------------------- - - 20. Some way to back up, explore variations, then return to the main - line and restore moves we backed out. Should also support exploring - side branches while loading a game file. Push/pop buttons? Button to - fork another xboard in same state as current one? - - 20a. Allow side branches to be remembered in game files (and - understood on LoadGame). Use PGN variation notation. - - **62a. Support series of time controls as in later gnuchess 4.0.x - versions (and real tournaments!). Needs a protocol extension to - "level"; this is now planned for protover 3. - - 62b. Perhaps we could also support the kind of clock where you get K - seconds per move, plus a reserve of J seconds per game that is used - when a move takes more than K seconds. The degenerate form of this - with J=0 is desirable in itself. Needs a protocol extension. - - 68. WinBoard has some features not in xboard. Among others: - 68a. LoadGameOptions dialog (good to add) - 68b. SaveGameOptions dialog (good to add) - 68c. TimeControl dialog (good to add) - 68g. Font dialog. (leave out) - 68h. Colors dialog. (leave out) - 68i. Board size on Options menu (good to add) - 68j. Resize with mouse - 68k. Highlight dragging - 68m. Move typein from keyboard. (good to add) - - 69. xboard has some features not in WinBoard. Among others: - 69c. Font size selection by pattern fill-in. (leave out) - 69d. Alternate bitmaps specified at runtime. (good to add, often requested) - 69e. Flashing. - - 71. Allow restart after ICS logout instead of exiting? Many requests - for this. - - 71a. Would be useful to drop into NCP mode after ICS logout and allow - for reconnect later. For instance, this would let you save your last - partial game if you didn't have autosave on. - - 72. Allow switching among ICS, NCP, GNU modes?? - - 74. Observe/play multiple games, each with its own window. Hard. - - 80. Clone command. Saves current game to a file foo, then starts up - another copy of xboard with -lgf foo. Should probably note current - state of some options and give command line flags to set them the same - way in child. What about -ncp mode, though? Might want that to be - different. Would be nice to have a -moveNumber flag to position the - child to the same move number in the current game. - - 91. Would be nice to have an option to overwrite save file instead of - appending. - - 95. "Have the clock indicate how long the computer/player has been - thinking for when the -st option is used. This should be how long for - the current move only." (Dino Dini) - - 97. "Have the ability to change the level of the gnuchess during a - game. For analysis purposes, sometimes it is useful to have the - computer think really hard about certain positions." (Dino Dini) - - 98. Reorganize the source and split it into more files. - - 107. Changing time control during a game could be made to work. - Current (WinBoard only) way of changing at start is suboptimal. - - **108. Could add search depth and time per move to (WinBoard) - TimeControl dialog. - - 140. LoadPosition needs better checking for invalid data. - - 142. xboard needs a real file chooser dialog. Jeff Woolsey submitted - code to merge in the one from Ghostview, but said it works only on - X11R5 or later. I have not yet tried his code or looked to see if it - could be made to work on X11R4. - - 147. Improve display of held pieces in bughouse mode, putting them - closer to the player's side of the board, and perhaps using icons (and - allowing dragging from the icons to drop a piece). Actually, moving - the clocks would be beneficial too, so that it's easier to visually - associate the right clock with the right player when looking at two - boards during a bughouse match (with two copies of xboard running). - Maybe multiple window layouts should be user-selectable. - - 150. Keep track of castling availability, en-passant availability, and - FEN half-move clock (for 50-move rule), pass the availability - information to the move generator through the existing interface, and - load/save it in the FEN code. - - 150a. Note that not keeping track of ep creates a bug in mate - detection. In certain positions, moving a pawn from the 3rd to 4th - rank gives mate, but it is not detected because if the pawn had moved - to the same position from the 2nd rank, ep capture would have been - legal and there would be no mate. - - 150b. Note that although we try to put in e.p. availability when - writing FEN, this works only if we have the move that got us to this - position in the moveList. If we load a position from FEN, the - e.p. availability field of the FEN is lost. - - 152. Generate the info file, man page, perhaps html, and perhaps even - the WinBoard help file from the same sources. Right now, - substantially the same text is duplicated in three places. This is - a huge pain in the neck. - - 157. Idea: if Zippy flags some number of times in a row and keeps - getting told the opponent is not out of time (presumably due to - timestamp/timeseal), he should issue an adjourn or abort. - - 160. The xboard CTRL key flashback feature is bad in Analysis mode. - Flashing back throws away the analysis. - - 161. SIGINT doesn't work for local programs on Win32. There is an - equivalent, GenerateConsoleCtrlEvent(CTRL_C_EVENT), but I haven't - gotten it to work thus far. It seems that WinBoard and the chess - engine don't "have the same console"; indeed, neither has a console. - - 162. Supply a non-X Zippy for Unix. Perhaps use the code from Klaus - Knopper. - - 167. Alternative bitmaps loaded at runtime for WinBoard. - - 169. Upload Game on file menu? This would upload the current game - moves into a scratch examined game on ICS. Could do Upload Position - too. Some code to do Upload Game was contributed, but it didn't - handle setup positions, variants, checking for proper gameMode, etc., - so I couldn't use it. - - 170. Auto step every k seconds should be a general feature you can - turn on at any time, not just in LoadGame. What should GUI be? - - 171. Displaying thinking in a separate window should be an option - available at all times when Show Thinking makes sense, not just in - analysis mode. It should perhaps be orthogonal to analysis mode. - - 172. Should analysis window scroll instead of showing only the last - line? There could be an extra checkbox to show all chess engine - output in it. - - 178. Need reliable kill for chess engine on Win32. See also 161. - - 181. Some people want -sgf to save only played games, not observed and - examined games. Others like it to save them all. Make this an option? - - 183. Search feature in Game List dialog [Igor Eged]. - - 187. "Log session" feature for ICS window. - - 193. Some users have reported xboard redraw bugs, but I have not - been able to reproduce them on the Digital Unix, Linux, or eXcursion X - servers (xboard). - - c. From Hawk: - Dragging in xboard does not work 100%. - * The dragged piece may disappear (try some fast e2-d3 movements - - this is easy to reproduce). - * The dragged piece may be placed on an illegal position (this - happens less frequently, but it _can_ be reproduced by doing the same - as above). - * In both of the above cases, the board is correct after forcing a - redraw (ie. minimizing/restoring the window) - I'm using eXodus - a win32 X server, perhaps it's buggy. [Seems that way, - or just possibly, these could be bugs that are fixed in 3.6.11beta or - 3.6.12beta.] - - d. One user reports: "If you are 'holding' a piece over the square you - want to go to and that move becomes illegal but you make it anyway, - the display sometimes corrupts and a partial piece appears..sometimes - a whole piece." This was under RedHat 6.0. - - 194. A few users have reported drawing problems with WinBoard. There - may be some color map problem on certain displays. I might possibly - have fixed this already; I cannot reproduce it. The common thing - seems to be black pieces changing to white. This may depend on having - customized the board colors. I suspect many of these problems are - buggy Windows drivers for particular display cards. (May be worked - around in 4.2.0 with reprocessed .bmp files.) - - a. From mulesmurf: if i log in and then move the board, it will happen - that the black [pieces] change to white. - - c. People have sent pictures where the grid didn't get redrawn. This - produces random bits in the grid area from uninitialized memory. - Could this be a resource leak? - - d. From James Van Buskirk: I did notice one problem tonight playing - against Comet under FX!32 1.2 (Comet, not winboard ran under FX!32): - for a couple of moves winboard didn't turn off the highlighting of the - square I dropped the piece on until Comet had moved. Later, the - problem fixed itself. Have other users noticed this? [No.] - - e. One user reports: Lastly, there is some sort of slight bug in the - piece dragging code, but it comes up only very occasionally (once in - 500 moves?)...basically, I'm dragging, change my mind, throw the piece - of the side of the board, and instead it gets stuck not inside a - square. It's really disconcerting, this piece just sitting across - square boundaries. When you make another move, it gets cleared up and - goes back where it's supposed to. [Might be fixed in 4.0.6, but I - couldn't reproduce this, so I can't be sure.] - - f. DAV says: "When I resized the board on win 95 and made it smaller - some of the pieces turned into junk (I'm not able to give a screen - shot)." Later: "Seems to happen on the three sizes below small. - Win98 and NT seem to be ok, trying to get more win95 users to test - it." Works fine for me on Win 95... [Might have been fixed by the - cleanup of the Windows .bmp's that happened sometime before version - 4.2.3] - - 195. Flash Moves works at the end of every change to the board, using - some rather gross code in DrawPosition. This code should perhaps be - ripped out and the flashing done from inside AnimateMove instead. - - 197. More color distinctions. Maybe allow several user-selected channels - to have their own colors. - - 198. More sounds. Some possiblities: distinguish White vs. Black move - or your move vs. opponents, distinguish different kinds of - win/loss/draw/unfinished (checkmate, resignation, stalemate, other - draws, opponent disconnected, etc.), game ends when you aren't playing - and/or aren't in ICS mode, differentiate amongst requests (draw offer, - etc.), **check, got new offboard piece (by piece type?), opponent got - new offboard piece (ditto), arrival notification, "* who has an - adjourned game with you," draw declined, moretime received. - - 199. Maybe put user names instead of White and Black on clocks, or - user names above or below clocks in a smaller font. - - 200. I don't like these ideas, but some people do: - a. Highlight all of the squares that the piece you are moving can go to. - b. Clicking on the piece moves it immediately if it has only one legal move. - c. Allow clicking on the destination, then the source. - d. I guess highlight the pieces that can go to that destination. - e. Clicking on a destination that only one piece can go to moves it there. - - 201. mulesmurf: piece counter so we know exactly the score - - 202. mulesmurf: ziics pieces, board along with color intensity - - 204. Hawk at Fri May 15, 12:58 CDT 1998: a minor thing with xboard: - the coords disappear while dragging from a square with coords on it. - [They come back when the drag is finished.] - - 208. WinBoard sometimes comes up with one of the menu bar items grayed - out (one that should not be). I've seen this on different entries at - different times. - - 213. Maybe add Silence to sound menu -- parallel to Monochrome on - color menus. - - 214. Maybe easier startup dialog customize: - a. Buttons to add/delete/move(?) current string to/from/within current list. - b. Or maybe auto-add newly typed/edited strings up to some limit. - c. Also a drop-down for Additional Options. - - 216. Maybe shorten menu names in WinBoard to one char if and only if - the menu bar would wrap with longer names. - - **217. Easier way to add engines to the WinBoard startup dialog. - Ideally, an engine author should be able to supply a simple - configuration file or script that installs his engine. "*.wbe" idea. - - 218. Some folks would like Highlight Last Move to apply only to - opponent's moves. - - 219. From Jorge Monasterio: Support automatic game starts when in - tournament. In other words, do that "match bigolfish mann 5 0 black" - automatically based on the info sent from mamer. [I would need to - play in some tournaments before I could evaluate this idea or fill in - the details.] - - 222. Could support time handicaps. - - 223. Bug: very long comments cause buffer overflow. Need to revamp - the way comments are parsed and returned from parser.l to fix this. - - 224. Larry Parrish requests: In an automated multi-games match I would - like to load the n-th game from the file for the n-th game of the - match. [That is, when -mg and -lgf or -lpf are used together without - -lgi or -lpi.] - - 225. From pulp: another bug (maybe with the Microsoft RichEdit - control) I've observed is when you flood the edit control it loses the - bottom. Eg. "games" will scroll along then start slipping until by - the end of the list you are really looking at the middle of the list - and have to manually scroll back to the bottom. [May be fixed?] - - 225a. Resizing the WinBoard ICS interaction window can cause the cursor - to be off the screen, which stops scrolling. - - 226. From pulp: Clipboard persistence. If I copy text, then the text - disappears when Winboard is closed. Eg.: Log in, highlight and copy a - web page address, close, go to browser, paste *nothing*. [How does - one do this in Windows?] - - 227a. In engine-engine matches, an engine that crashes should lose and - perhaps get restarted for the next game. - - 227b. Maybe when an engine playing in Zippy mode exhibits a bug, we - should do a little more too. Perhaps "say Sorry, the engine seems to - have a bug", resign or abort, and maybe force an engine restart for the - next game. - - **227c. We should also detect and stop the game on false mate or draw - claims, rejecting a legal move, or (maybe) missed claims of mate or - draw. Note that draw claims require checking for repetition, 50 move - rule, and insufficient material as well as stalemate, so this is - nontrivial. - - 228. RichEdit bug: sometimes a line gets indented as if it were - wrapped when it should be flush left. - - **229. Support for sending moves from the partner's game to a bughouse - engine. Ben Dean-Kanemura submitted support that works without adding - general multi-game support, by relaying the moves without processing - them. Should also send holding updates and clock times; not sure if - Ben's code does that. Needs to be a new "feature" command option, and - to be documented in engine-intf.html, removing the note that this may - be done in the future. - - 231. See Ed Collins's WinBoard bug list on his pages: - - 231b. If you save an ICS examined game to disk as a PGN file, it - doesn't report the end-of-game result in both the header and at the - end of the notation. [It doesn't get this info from the server, but - maybe there is a way it could.] - - 232. From Ed Collins's WinBoard wish list on his pages: - - 232b. Multiple winboard.ini files for different moods, loadable from - inside the program. - - 232c. Fix bug where fics% prompt is not suppressed when using - timeseal. This has something to do with a timeseal deficiency whose - details I've forgotten, but there must be some way to fix it. - - 232e. When using the server's "examine" mode to examine a previously - played game, have the game clocks display the time that each player - currently had after each move was made. - - 232f. [Not from Ed] Deal with ICC game relays where an "examined" game - is supposed to have running clocks. Not sure if this is still an issue. - - 232g. Customizable on-screen buttons [i.e., toolbar or toolbox]. - - 232h. Customizable function keys. Currently xboard can bind a key to - any built-in xboard function. Should extend this to WinBoard, and - also (in both programs) support sending an arbitrary ICS command when - button is pressed. - - 233. See if anything from LightningRulez should be added. Premove is - now included (from Winboard Plus), but maybe there are other useful - things too. - - 241. There might still be bugs in xboard and/or winboard when moves - come in from ICS during drag animation, though I can't reproduce them. - DAV saw the opponent's piece fail to be erased from the source square, if - I understood his message right. [DAV says this still exists in 4.2.5. - I think bug 426 is a duplicate. The description is clearer there.] - - 242. User-defined "looking_at" patterns and actions. This is hard to - bombproof. - - **243. "Rematch" shortcut in /cp mode. - - 246. Maybe auto-close comment window when user goes to the next move. - Whether this is desirable really depends on the content of the - comment, but maybe it is rare to have a long comment that discusses - the plan several moves ahead and should be left up. - - 248. Would be nice to support retract move after checkmate or draw (etc.). - - 254. Different tray icons for interaction window vs. board (suggestion - from FICS). - - 256. One user asked for "delete" option in game lists. This requires - rewriting the file to close up the hole, so it's pretty heavyweight. - Next people will be asking for move, sort, search, and other game - database functionality; ugh. - - **257. Would be nice to find a way to safely implement "retract move" - when the engine is still on move. (using ping/pong) - - **260. General mechanism where engine can declare engine properties that - the user can frob and xboard/winboard will put up a simple dialog to - allow user to view and set them. See email message "special engine - commands" from Steffen Jakob: - - From: "Steffen A. Jakob" - To: mann@xxx - Cc: chess-engines@xxx - Subject: special engine commands - Date: Fri, 26 Feb 1999 09:12:26 +0100 - - Hi Tim! - - Here comes a summary of our ICC chat (I cc this mail to the - list... maybe other engine programmers can give some feedback if - they find this feature useful): - - Please add a protocol command which enables the engine to tell - xboard its special commands. Maybe a set of (label, command string) - pairs would be useful. Then create a menu for these commands. It - could look like this (that's what I would like to see for Hossa): - - engine->interface: - ------------------ - command "Reset the log file" "reset log" - command "Save Diagram as PNG" "png dia.png" - command "Disable Book" "book off" - command "Show Evaluation details" "eval" - command "Show Search statistics" "stat" - - etc. - - While typing this list I realized that an additional parameter like - this would be needed/nice (of course you can think of many more - improvements): - - command "Save Diagram as PNG" "png %s" 1 - - "1" tells xboard to ask for an additional parameter (here: filename) - which will replace the "%s" in the command string. - - 261. Check that "quit" is sent to engine properly if ICS connection - fails to open due to error from timestamp/timeseal. "wzrdking" had a - case where it didn't. Timetamp had failed with "Host name not found - by name server" (because in fact there was no internet connection, arrgh). - - 273. Displaying the names of the players from a PGN file in the header - of the window does not work if there is only one game in the file. - The filename is shown instead. (This was intentional, but maybe a - poor idea.) - - 274. Command to go to move number N, with entry box for N. - - 276. Make grid optional in winboard? Note that the highlight options - don't work without it. - - 276a. Make color of grid an option, instead of always black. - - 277. Flooding xboard -zt + timestamp with tells hangs timestamp after - a while. xboard is blocked writing to the timestamp pipe. timestamp - is in an unknown state, not reading from the pipe nor responding to - pings. (Confirmed with the software running on milwaukee, Red Hat - 5.2) - - 278. Flooding winboard -zt + timestamp with tells hangs winboard after - a while. timestamp still responds to pings. This reported by - nudnick; I haven't tried to reproduce it yet. He also says that - windows explorer then crashed when he tried to close winboard. - - 279. Idea from an anonymous ICSer: piece drop menu could have images, - not words. [Or maybe both?] Also might be easier to select - accurately from it if horizontally arranged, or in a 3x2 grid. - - 284. dxterm hangs when it receives the escape sequence that sets the - title bar on xterm. I think some other xterm substitutes do too. - - **287. WinBoard can look funny if you are using themes because it - unconditionally uses white for certain colors instead of the default - background. - - 289. Merge WinBoard support for the Henter-Joyce JAWS screen reader. - Source code (zip file containing modified WinBoard 4.0.2 source) is at - ftp://ftp.henter-joyce.com/users/hj/winboard/WinboardSource.exe. It - would be interesting to make this work with festival (free Unix speech - synth) or other speech synthesizers too. - - 290. Could have limited voice output without a speech synthesizer by playing - wav files for piece names and square numbers. Idea suggested by Hannu - Wegner. - - 291. Would be great to support DGT, Novag Universal chessboard, etc. - I'm not likely to fork out the cash to buy either for testing, however. - Note users have done various things along these lines. - - 292. When an engine is analyzing, it would be cool to have a way to - automatically play out its current PV (or even older ones) on a board. - These PVs could be saved as variations when we have variation support. - - 297. Windows users expect all programs to have a Print function, even - though there are other ways to print. Useful items to make printable: - PGN game scores (which are plain text, of course), maybe FEN position - diagrams, maybe graphical position diagrams (i.e., same as pressing - the "Print Screen" function key and printing the clipboard). - - 298. One user suggests that automatic move stepping should not start - until you press OK in the tags window. This could be a good idea, but - I think I'd rather have automatic stepping never start until you press - a "play" button on the main window, and have that button always - available, not just when loading a game from a file. - - 299. One user suggested being able to jump to a specific move by - typing its number (followed by ... if it's to be black's move). - - 300. Can I put a hyperlink (that will invoke a browser) directly onto - the WinBoard Help menu or in the Help file? Useful to take users to - my chess page. - - 302. On NT, check if the board is redrawn properly when exiting from - the screen saver. - - 308. There is some tricky way to maximize the WinBoard board window, - although there isn't supposed to be. Maybe prevent this, or else - legalize it and make sure something reasonable looking happens. - Note: the trick is to select one of the "tile" options on the Windows - task bar. Not clear what should happen in this case. - - 309. Avoid endlessly flagging every second when opponent is lagged out - and autoflag is on. Automatically courtesy-adjourn (or abort if - unrated) instead, at least if in zippy mode. - - 310. Weird bug: the last character of a FICS output can appear on the - next line, *after* the fics% prompt, according to one user. I might - have seen something like this myself once too. - - 314. One person wanted his engine to see tells when running in Zippy - mode. I doubt this is generally useful, so I haven't added the code I - wrote for him. (I can query for "tellfrom" in my mail file to find - it.) - - 314a. Another person wants his computer account to relay tells to his - personal account. - - 319. One user would like to be able to reload a PGN file and resume a - game against an engine as if after an adjournment, with the clocks - (and moves to next time control) restored as they were when the game - was saved. - - 320. Display ratings of ICS players in the title bar (if there is room, - presumably), or somewhere, anyway. - - 321. Maybe refresh the EditTags window if the gameInfo changes and the - window is up. (WinBoard now does this when entering MachineWhite, - MachineBlack, or TwoMachines mode -- not very general. From Winboard Plus.) - - 322. One user requested that Zippy games use the engine name instead - of the ICS handle in the PGN tags, as he uses multiple engines on his - account. (My response was "I'd say it should give both"; not sure just - how to do that, though.) - - 324. I'm told that Blitzin supports animated dragging without holding - down the mouse button and that this is "much better" and I should try - it too. As yet I haven't. - - 326. Full support for variants and variant-capable engines in all - modes, not just ICS mode. Here are some items still needed. Some if - not all should probably wait for a rewrite, not be added to the - current code base. - - 326a. Menu to let you see and change the current variant type, not - just a command-line argument as at present. - - 326b. crazyhouse: Keep track of holdings and display them, keep track - of what onboard pieces are promoted so they will revert if captured, - understand offboard interposition to stop mate. - - 326bb. One user asked for a Czech variant of crazyhouse where pawns are - given to the opponent when they reach the 8th rank (after capturing, if - it's a capture) instead of promoting. - - 326c. bughouse: Features in 326a would be helpful for editing one board - of a bughouse game, and getting mate indication right even in ICS mode. - In the longer term, could understand BPGN, support editing two-board games. - - 326d. wildcastle: Allow wildcastle castling only when playing this variant! - Maybe support automatic shuffling for local play. - - 326e. nocastle: Maybe support automatic shuffling for local play. - Note that several types of ICS shuffle chess fall under this variant. - Note that this isn't really a variant, since if we kept proper track - of castling rights and used "setboard FEN" or the ChessBase extension - of "edit" to set them, it could be treated as normal chess with a - different starting position. - - 326f. fischerandom: Maybe support automatic shuffling for local play. - Support castling. Currently, you can probably play Fischer Random - successfully on ICS by typing castling moves into the ICS Interaction - window, but they will not be animated correctly, and saved games will - not be loaded correctly if castling occurs. FR castling is - problematic because the move cannot be specified by the starting and - ending coordinates of the king; in some starting positions there is a - legal non-castling move that moves the king the same way. This - violates a deeply ingrained assumption in the implementation. It also - breaks the GUI -- you need more than just dragging the king two - squares to indicate castling. (Note: In FR notation, O-O is h-side - castling, O-O-O is a-side. See "help fr_rules" and "help fr" on FICS - for rules.) - - 326g. kriegspiel: Could give some thought to how to support a - kriegspiel engine. I doubt anyone will ever write one, though. - - 326h. losers: Know that captures are mandatory. Understand the win - condition. - - 326i. suicide: Know that captures are mandatory. Understand the win/draw - condition. - - 326j. giveaway: Know that captures are mandatory. Understand the win - condition. - - 326k. atomic: Understand the win condition. - - 326l. 3check: Understand the win condition -- ugh, have to keep a - check counter! - - 327. Option to set the coord font color (or something) to make sure - there is always enough contrast with the square colors. - - 329. Bernhard Maerz would like a command line option to choose the PGN - player name for an engine, overriding the default of generating the - name from the engine filename. This is for his ChessCall program. - - 331. Maybe the local autoflag menu option should *also* turn - server-side autoflag on/off by sending an appropriate set command. - - **332. Bug: Autoflag for local engine/engine or engine/human matches - does not recognize that having your flag fall when your opponent has - insufficient mating material is a draw. It counts the flag fall as a - loss. - - 336. Of course lots of people ask for a graphical seek window. - - 339. There are probably some incompatibilities with chess.net, as they - have made a few gratuitous changes to message formats from the FICS - code base they started with, and perhaps they've added features since - without duplicating the syntax closely enough. In particular it's - been reported that Zippy does not correctly send "partner" and - "variant" commands to bughouse engines on chess.net. Also, I doubt - colorization works. As a matter of personal choice I do not spend any - of my time supporting chess.net, but if others want to donate patches - that allow chess.net to be supported without breaking the support for - ICC and FICS, I am willing to install them. - - 342. Analysis mode automatically turns on the Show Thinking option; - the user must then turn it off manually after leaving analysis mode if - he doesn't want it. - - 343. Would be nice to change xboard keyboard shortcuts to not be plain - letters, make the new shortcuts work also in the ICS input box, and - make typing plain letters to the board redirect to the ICS input box - or the xterm. Might want to change/remove the Ctrl binding at that time. - - 344. One user suggested having a way to save a position as a character - string that would produce a board diagram when rendered in MS Word in - a chess font. Perhaps there is already a nice standalone tool for - this, though? - - 346. Could use a better way to pick default size. Now we choose the - largest that fits on the screen, which is typically too big. Not too - bad for WinBoard, but painful for xboard since it can't be resized - after starting. - - 349. Check that "quit" definitely makes it to the engine before exit, - if you exit via the File menu while a match is running. Uli Tuerke - reported that maybe it sometimes doesn't (in WinBoard 4.0.5). - - 352. Perhaps recognize the ANSI escape sequence that FICS sends out - for the cls command and clear the ICS interaction window. - - **353. WinBoard can crash when the engine outputs very long PV lines - (or debug output that looks like a PV). In particular, lines that - start with 4 or more blanks following a "thinking" output line are - treated as continuation lines, and get concatenated into a 512-byte - buffer with no checking for overflow. Generally we need a lot more - care to avoid buffer overflows inside both xboard and WinBoard. - [Note: changed the buffers to be 5120 bytes as a band-aid.] - - Guido Flohr expands on this bug: - - The problem is easy to reproduce, simply write a program/script that - spits out lines of more than 8192 bytes (INPUT_SOURCE_BUF_SIZE) and - connect it as a chess engine to xboard. No surprise, xboard cannot - handle such long lines, but the resulting behavior is really weird: - - The program enters DoInputCallback() in xboard.c, reads the first - 8192 bytes, searches for a linefeed in vain, then closes its eyes, - sets the member "unused" of the InputSource to is->buf + 8192 and - waits for more input although the buffer is already full. - - The next time it calls the same function, is->unused is exactly - these 8192 bytes away from is->buf, xboard computes the amount of - bytes to read in this round, which sums up to 0 nothing. It then - calls read(2) with a bufsize argument of 0, and then assumes end - of file when the kernel call returns 0 (which is the documented - behavior). - - For local engines, we now jump into backend.c, ReceiveFromProgram(), - and this function reports that the engine has exited unexpectedly. - In fact the engine is still very vivid, which is good, because in - spite of xboard's assumption that its child has died, it still - sends "force", "ping N", and "quit" to the false dead. If the child - was really dead, the alert boxes "error writing to ... engine" - would hide the first alert box "... has exited unexpectedly". - - From xboard's side, it is not exactly clean to call read(2) with - a zero bufsize argument. In my opinion, a sane solution would be - to eat the INPUT_SOURCE_BUF_SIZE bytes, and when they contain no - linefeed, print the partial line to standard error (in debug mode) - and report something like »Maximum line size exceeded« (and then - kill the engine). - - **354. We currently let the user go directly from TwoMachines mode to - various other modes like MachineWhite or MachineBlack. This may - confuse the engine that was on move, since we don't have a way to - force it to stop before it makes the move it was thinking about. - (use ping/pong to know when the engine has stopped) - - 355. Idea from LiveAndLetDie: have Zippy specially log games where it - loses to a substantially lower-rated player. Such a game could - indicate an xboard bug, engine bug, or perhaps a computer-using - cheater. - - 356. Colorization for FICS tourney tells? They look like this (ugh): - :DChessmaster [tourney #4]: - :hi - - 357. A few reports of WinBoard pieces being drawn incorrectly at - certain sizes. I haven't reproduced this. [Maybe worked around in - 4.2.0. Or is/was this the same as 194f? I don't recall the details.] - - 358. One report of WinBoard colorization not working, even after - restart, until the computer was rebooted. Weird. - - 362. Running a very long automated match (/mg option) seems to crash - WinBoard eventually, usually after 300 to 500 games, sometimes later. - Reported by Josh Haglund. Gets a "WINBOARD caused an invalid page - fault in module KERNEL32.DLL" dialog box from Windows. See messages - from Josh for examples of the registers and stack dump. - - 362a. A few people have reported WinBoard crashing upon exit. - - 363. Maybe xboard should not set the window geometry for new popups, - or at least not the position. The default positions aren't very good, - and setting them programmatically keeps knowledgeable X users from - customizing the positions with X resources. - - 366. Feature to let an engine observe an ICS game and run analysis - mode on the moves, perhaps whispering or channel-telling the results. - It's a little too easy to cheat with this feature or I might have - added it long ago. - - 369. Optionally send a periodic keepalive command to ICS. Can be - used to defeat autologout, so should probably not be on by default. - Also should be useful to help Zippy notice more reliably when its - connection has hung, so that it can exit and a shell script (batch - file) can restart it. - - 370. One user requested a local noplay list for his computer player - because the FICS limit of 50 is too small. He wants several hundred so - that he can noplay everyone who disconnects in a lost position. - - 374. Would be good to have a way to change engines without restarting - the interface. - - 376. WinBoard is said to crash or "lock up" when loading enormous PGN - files, like a 98 MB file that comes with (??) Crafty. Win32 (at least - in the Win95 lineage) has a limit of 32,767 items in a list box - widget. That might explain this problem. - - 376a. xboard exceeds limits in X and/or Xaw if a PGN file has too many - games. (The virtual window that the list box can scroll through - becomes too many pixels high.) This has odd effects; the window - height of the game list seems to get reduced mod 2^16 or something. - Maybe detect this and do something nicer about it, like stop loading - when the window is full and pop up a warning. - - 378. One Solaris user didn't have the "strip" program, so the - install-sh script used by xboard "make install" failed. Check for - this? Yuck. - - 381. "Illegal move: post" is apparently not handled. Should it be? - - 382. The UI for entering Training mode is a bit obscure: you must - first select Load Game, then Training becomes enabled in the upper (!) - part of the Mode menu and you can select it. You can then select it - again to toggle it off. This mode is something like Analyze File - (which has a problematic UI too, but somewhat less so); both should - probably use a similar UI style. I consider disabling the - step-forward button to be overkill, and I think you need to manually - turn off auto-step when loading a game (?). One user expected it to - work with .epd files that give a position and a recommended move. - That seems reasonable, but doing it would require quite different code - from the current pgn-game training mode. - - 383. Premove piece drop for bughouse/crazyhouse. - - 384. Pre-first-move for xboard. I don't much like the fill-in field - method used in winboard. Maybe allow a move to be made for white - before the game starts (in both xboard and winboard). If you get - black, it's cancelled. Black can already premove after the game - starts, during white's first move think time, so I don't see that a - black pre-first-move is needed. - - **387. Have winboard draw opaque details on black pieces too. - Hmm, this should probably be optional, and the detail colors should - be selectable instead of hardwired to the opposite piece color. - - **387a. Add "no piece border" option to WinBoard. See code from - Robert Jurjevic sent 4/9/2001. - - 391. I have a bug report from Stefan Zipproth about engines sometimes - failing to make their first move in an engine-engine match. So far I - can't reproduce it. This might be fixed by the Sleep(500) voodoo in 4.2.4. - - 394. See about tightening matching for the "request" event. Right now - it matches on help files a bit too often. (e.g. FICS "help sr_info") - **Also clarify documentation on what the request event is. - - 396. xboard's -size defaulting code for bitmaps unfortunately always - picks a size from the built-in list, even if you gave the - -bitmapDirectory option. It would be more user-friendly to have some - extra code that lists the directory and considers exactly the sizes - that are found there, as the pixmap code does. - - 397. It would be nice to be able to configure xboard with bitmap - pieces as the default without having to disable xpm support entirely. - This should be a pretty simple mod to configure.in (and xboard.c). - - 397a. It would be very nice to be able to compile in both the bitmap - and pixmap pieces. This would allow us to automatically switch to bitmap - pieces in -mono mode, including when -mono mode was automatically selected - because too few colors were available. - - 398. It would be nice to have the new .xpm pieces in .xim format too, - since I restrained myself from ripping out the .xim support. - - 399. It would be nice to have a configure option to change the - directory where the default piece set is taken from. Slightly nicer - than having to rename the desired directory to "bitmaps" or "pixmaps" - as at present. - - 400. TypeinMove should be grayed in ICS mode, or should raise the - console window, or something. - - 402. Internationalization. It probably isn't practical to retrofit - this into the current code base. - - 409. One user requested a way to put a time delay in the middle of - sending zippyGameEnd commands. This would (for example) let the - computer do a seek only if its opponent doesn't accept a rematch - within 10 seconds. Nontrivial because Zippy has to continue to listen - to input during the delay; it can't simply call sleep(). Maybe - ScheduleDelayedEvent is OK, but I think it may already be in use in - this situation, and it only supports one event at a time. - - 411. Add zippyKibitzThinking and zippyWhisperThinking features? - - 412. Maybe optimize setting the move list in the case where only the - current move number changes; avoid slow XawListChange. - - **413. Add movelist window to WinBoard too. Wilkin Ng submitted a - patch that I believe includes this; need to integrate and test it. - - **415. It was suggested that a few common options that many chess - engines need be promoted to xboard/WinBoard options so that the user - can set them from the GUI in a uniform way. In particular: hash size, - directory name for endgame tables. - - **416. Can we avoid dying when xboard is in 8-bit mode, pixmap pieces - are chosen (by default), and we can't get enough colors? Ugh. - - **419. It was suggested that stat01 be generated/accepted during normal - play with "post" on, not just during analysis mode. This would need - to be a "feature" command option. - - 422. Track FICS change to details of how timeseal works; is this - implemented at FICS yet? - - 423. When locally stepping through an ICS game that is over, it would - be nice to display the historical clock times at each move. - - 424. DAV at Thu Nov 9, 01:20 CST 2000: any chance on winboard/xboard - of a key press and a move executing draw ? that way you at least - have a chance of claiming a draw in 1 0. - - **426. DAV says, in xboard: If you are not on clock and you hover a - piece over a square where your opponent then moves to and then move - the piece away the piece the opp moved or part of it has not been - drawn. [Duplicate of bug 241?] - - 429a. Check whether more support is needed for WinBoard to work with - scroll wheel mice in the absence of special mouse drivers that generate - scroll bar events directly. - - 431. People find Analyze File confusing; they think it should do - Crafty's relatively new Annotate function. Also, it's somewhat - superfluous now that you can enter Analysis mode and then load the - file, or vice versa. - - **436. WinBoard is said to crash if started while WinBoard.debug is - being tail -f'ed. - - **441. Can I prevent an undo after new in the odd case where it can - happen now? See mail from Bob Hyatt. - - 450. Suggested: an option to let an engine keep pondering while an ICC - game is adjourned. This seems a bit difficult. - - 451. Suggested: support SuperMamer messages on FICS, aka qtells. See - http://www.freechess.org/SuperMamer/parsing.html. - - 452. Suggested: a way to say "prompt for the password" in a login.ini file. - See 510 instead. - - **454. Add a way to claim a draw together with making a move, as can - be needed for draw by repetition (creating the 3rd repetition with the - move) and by the 50 move rule (the move is the 50th). Add to - protocol, and implement using the individual methods on FICS and ICC. - Need to be sure it's really a FICS that has the feature (somehow). - - 455. Suggested: Add the epdkit commands such as epdpfga to the - protocol, since Crafty and "many" (which?) other engines include the - epdkit. - - **456. Bob Hyatt suggests: "feature match=1" which says "send match - requests to the engine and let it decide on who to play next". - I.e., maybe send an abbreviated but fixed format message like this: - match time inc R/U. The engine would use "tellics - accept " to accept. Add as feature to protover 3. - - **457. Standardize on the meaning of scores (e.g. in stat01 responses). - Is positive good for white or good for the engine? Do certain scores - mean forced (tablebase) draw, or forced mate in N? This should align - with the EPD spec. Maybe a feature command should indicate that the - engine matches this part of the spec, but then again, it's not clear - what we can do about it if the engine doesn't give that command, so - maybe there is no point. See discussion on chess-engines list. - - 458. Bug: xboard will try to use an engine to play normal chess even - if the engine has given the feature variant command and did not - include "normal" on the list. Crafty 18.1 inadvertently relies on - this bug, so it probably can't be fixed right away. - - **468. Need to look at Wilkin Ng's contributions! - - **469. Look at Zippy's behavior if the operator observes, follows, - examines, etc. Some bugs in this area have been fixed, but it's - received very little testing, as Zippy was never meant to be used that - way. Noted later: Examining in -zp mode definitely has problems. If - you go forward one move at a time, moves are sent to the engine - correctly. If you go backward one move, "undo" is not sent to engine - as it needs to be. Going forward or back by more than one move at a - time needs to be looked at too. - - **471. Look at 3/17/2001 message from Laszlo Vecsey about crashes when - exiting on Win ME while data is coming in from the server. - - **473. Visual low-time indicator. See patch in Brian Mays message of - 3/27/2001. - - **474. Crash reported when sending certain 8-bit characters through - WinBoard (180, 167, others). I'm almost certain this is a FICS - timeseal issue and nothing to do with WinBoard itself. - - **475. Look at Laszlo Vecsey's mousewheel patch of 4/10/2001. - - 476. For some reason (I guess some GUI supports them), most WinBoard - engines now have a graphical logo, 100x50 pixels in Windows .bmp - format. It's been requested that WinBoard have a place to show the - logo. - - 477. Implement the "book engine" idea I proposed in the protover 3 - discussions. Some folks have offered to write them (e.g., Bruce - Morland). - - 478. Recognize URLs in the WinBoard ics interaction window and make - them work as hyperlinks (firing up your browser). - - **479. Possibly use Scott Gasch's 7 May 2001 patch to delay accepting - challenges when ping > pong instead of declining them. Bug: if you - get more than one challenge, Scott's patch forgets about all but the - last one. If that guy then withdraws his challenge, the others are - left in limbo, neither accepted nor declined. I suppose we could - decline challenges when there is one waiting. However, if we make the - change to optionally pass match requests through to the engine, Bruce - Moreland would like us to queue up challenges and pass them all on. - - 481. 8 May 2001, Bob Hyatt "matchscore" feature suggestion could go in - protover 3: "matchscore A B C D E says we are in a match, this is game - A of B games. The current match score is I have won C, drawn D, and - lost E games in this match. This would give the engine a chance to - adjust the draw score as needed to try to win the match rather than - just trying to win a single game." - - **482. Suggestion from Bruce Moreland: if the user goes into ICS - examine mode while -zp is active, and the engine supports analyze, - then put it into analyze mode and let it work on the examined game. I - guess this could work for observed games too. Should it be optional - or always done? - - 483. It would be nice if the KingShine 3D board could be integrated - as an alternative xboard GUI rendering. - - **484. Add -feature1 and -feature2 options to pretend the engine sent - us those feature commands. Useful kludge for certain buggy engines. - - 485. Add "reset" to protover 3. (Clear the hash tables and other such - info; used to put the engine into a known state before running a - test/benchmark position.) - - 486. Other protover 3 features listed in my 6/21/2001 message to - chess-engines list. Write a full protover 3 draft for comment. - - 487. Adjudicate non-ICS games as a draw when there is insufficient - mating material on both sides, especially engine/engine games. Well, - maybe. I argued against this in a 6/26/2001 message to chess-engines. - - 487a. Probably also adjudicate when we detect checkmate or stalemate, - before bothering to notice whether the engine detected this. - - 487b. Note: Do not adjudicate 50 move rule or 3x repetition since those - must be claimed by a player -- at least not by default. It would be - OK to have a flag to do this someday when we are smart enough to - notice it. Would definitely be good to be smart enough to notice an - incorrect draw claim by an engine. - - 487c. Another request: allow the operator to adjudicate engine/engine games. - - 488. Option to suppress tags popup on game load? This has been - requested a few times, and I received one partial implementation (not - enough to be useful). Needs to be on the options menu, etc. Note - conflict with 298 above. - - 488a. Also option to suppress comment popups. - - 489. Maybe have Zippy use xtell for tells to avoid redefining "." if - the operator is also doing tells. Do all ICSes support xtell, though? - - 490. Bruce Moreland request: a way to turn Zippy auto-accept on and - off dynamically. - - 491. Bruce Moreland request: a defined way to turn on/off PV (etc.) - kibitzing from the engine dynamically. I had thought it would be - better to make the GUI able to relay thinking output as kibitzing on - its own (and be able to turn this on/off dynamically), but Bruce - points out that what engine authors want to send as kibitzing output - usually includes more than the PV thinking output. - - 492. One user reports that GNU Chess 5 crashes if you start a game, - play far enough to get GNU Chess out of book, select Reset, and play - e3 in the new game. This is probably a GNU Chess 5.00 bug, unrelated - to WinBoard. Can't reproduce on Linux; didn't try yet on Windows. - Need to see if 5.02 fixes it. - - 493. DAV suggests stripping off first arguments that are obviously - not the name of the engine when trying to parse out the engine name - from its command line -- things like nice, nohup, sh, csh, bash, etc. - Ugh, but I suppose it would be helpful sometimes. - - 494. Internationalization. A couple of people have done (or told me - they were doing) partial conversions of WinBoard to German or Spanish - by manually translating the messages. I think it would be much better - (but a big job) to use GNU gettext. I haven't looked into the details - of that at all. - - 495. JamesBaud points out that FEN is not sufficient to correctly - represent a crazyhouse position (or bughouse, for that matter), - because it does not distinguish promoted pawns that will revert when - captured from real pieces. ICS style 12 also does not give us this - information. I really don't know what I could do about this -- take - the lead in proposing an extension to FEN and to style 12 with new - piece letters, I suppose. I don't really have time or motivation for - that. If you always use PGN, not FEN, to save Crazyhouse, that works - around the problem. - - **496. DAV sent some code to save a screen shot in xboard. Look at - merging this in. - - **497. Igor Eged reports: I make a move on opponents time using - premove. Right in the time I am holding another piece in case of - unexpected check that I can have other possibility. But then the piece - hangs in the void and its invalid move, what means often loss in 1 0 - lightning. - - 498. It would be nice for Zippy to be able to play ICC wild 20 and 21 - (the types where loadgame is allowed). Presumably there would have to - be an option to either send the loadgame command with a specified - position, or to deal with an opponent sending it. I'm not sure how - this should work exactly, or how to prevent opponents from cheating in - various ways. - - 499. It would be nice for Zippy to be able to switch amongst several - different engines depending on which variant type is being played. - - 500. It would be nice if Zippy could have an option to accept - takebacks. Hmmm, also, the operator might want to manually offer a - takeback; it would be good if that worked. - - 501. People would like to be able to add more bot functionality to - Zippy without C programming. I don't have any ideas on how to do that. - - 502. One user requests the ability to have a game list file open for - more than one PGN file at a time. - - 503. We don't do protover 2 feature negotiation properly when - restarting an engine due to -xreuse mode. The timeout and done=0/1 - features don't work on the restart; instead we basically assume that - all the features will be the same as last time and that the engine - will be ready to accept commands immediately. This probably doesn't - cause a lot of problems, but if you try to replace the engine with one - that sets different features, the changes might not be noticed before - the first move, and the defaults will be the values from the old - engine, not the documented defaults. Also, if the engine takes time - to initialize and wants us to wait to send commands until it says - done=1, we fail to wait. However, we do send commands in the right - order and use ping, so most engines should work fine. - - 506. One user wants a board size even smaller than Tiny. - - 507. Suggested: have the cursor change to a gripping hand while moving - pieces. Currently in WinBoard it's always an arrow, while in xboard - it's always a hand with pointing finger while over the board and an - arrow elsewhere. - - 508. It would be nice to make -xclock work with -ics, just for - orthogonality, though it's not terribly useful. - - 509. It would be nice to make -clock work with -st. Perhaps each - player's clock should start with the specified time on each move and - count down until he moves. - - **510. A FICS service rep tells me that many users expect an autologin - feature in winboard (other than the non-user-friendly login.ini file). - Seems easy enough to add such a thing. - - 512. Some users dislike the clocks counting in tenths when below 10 - seconds, as it's distracting, and would like this to be configurable. - (From the Debian bug tracking system.) - - 513. Perhaps have Alt+P and Alt+C as synonyms for Pause in WinBoard, - since the P or C on the button makes it look like that should be the - shortcut. I suppose Alt+< and Alt+>, and the same with Shift for << - and >>, would also be a good idea. Oops, but Alt+C is already - CopyGame, so maybe this is a bad idea. - - 514. Gian-Carlo Pascutto reports: "when pasting a FEN/EPD position - into WinBoard, and selecting analysis mode, the engine analyses the - starting position instead of the pasted one. Re-pasting fixes this." - - 515. Troy Edwards suggests: "It would be nice to have the option to - 'wrap text' in the comment window." - - 516. DAV says: "FICS now supports the setting and the making clocks - tick using unpause/pause in examine mode. It seems either the clocks - don't tick or are not present when using xboard. Is it possible to - change the policy and base things upon the clock is paused flag in - style 12?" - - 517. Clarify in engine-intf.html that "sd" is an extra dumbing-down - feature, not a time control. Some text: - - In the protocol, the "sd" command isn't a time control. It doesn't - say that your engine has unlimited time but must search to exactly the - given depth. It says that you should pay attention to the time - control as normal, but cut off the search at the specified depth even - if you have time to search deeper. If you don't have time to search - to the specified depth, given your normal time management algorithm, - then you will want to stop sooner than the given depth. - - The "new" command should set the search depth back to unlimited. This - is already stated in the spec. The "level" command should not affect - the search depth. As it happens, xboard/WinBoard currently always - sends sd (if needed) right after level, but that isn't part of the - spec. - - 518. Warn in doc that -initString is a dangerous feature. Also move - doc of dalogs for sending commands directly to the engine out of the - protocol spec and into the man page and help file, but warn they are - dangerous too. - - 519. In engine-intf.html, change "st" description to not use the word - "exact", which is misleading. Make sure it says this is the maximum - time per move (and does not accumulate). - - 520. Check whether Alt+C (CopyGame) works in XP. One user says it - gives an error message. - - 522. engine-intf.html should really be rewritten to describe the - protocol as a state machine (on each end), with every command - precisely defined as to what it does in each state (including perhaps - being illegal). - - 523. Figure out what, if anything, to do with the FICS "iset singleboard". - I lean toward not bothering to set it, as it only disables functionality, - but maybe I'm confused. - - 524. theblob at Mon Mar 4, 23:23 PST 2002: it'd be nice in the xboard - interaction window if control-w and control-u respectively erased the - line and word, even in a Windows environment. At least, I think it'd - be nice. - - 525. Support a 64-bit node counter in analysis mode when compiled with - something that has 64-bit integer support. Both gcc and msvc++ have - this, though under different names. - - 526. "-initialMode analysis -lgf -" doesn't get the engine into - analysis mode properly. "-initialMode analyzeFile" is a workaround, - but bug should be fixed. - - 527. Clarify ICS.ini more in the doc, if possible. Some sample words: - > You should create this file in - > WinBoard's directory (usually C:\Program Files\WinBoard) using a plain - > text editor such as Notepad. Make sure that Notepad doesn't decide to - > call the file ICS.ini.txt for you -- you may have to select "All - > Files" instead of "Text Files" in the Notepad save dialog. - > - > The file is simply sent to the chess server, just as if you had typed it. - > So if your username is foo and password is bar, the file would look - > like what is between ==== below, without the ===='s: - > - > ==== - > foo - > bar - > iset movecase 1 - > ==== - - 528. Check on updates/revisions to PGN from Steven Edwards and others. - Any support needed? - - 529. Protover 3 needs a prefix character that says "this is debug - output" and prevents the GUI from parsing that line (say ";"). - - 530. The undocumented (?) checking for rsh error messages tripped up - one engine author who had a "not found" in a message. Tighten this - up. - - 531. Do we always wait for pongs to catch up with pings before - starting the engine's clock? I suppose we should. - - 532. On FICS the clock does not start until after the first move has - been made. So perhaps we don't need the "not ready, try again soon" - response from Zippy there. What if Zippy is black, does black's clock - also not start until he makes his first move? - - 533. theblob at Mon Jun 24, 20:05 PDT 2002: here's a suggestion for - xboard -- give priority to fitting in amounts of material in the title - bar, and truncate names instead, e.g., use "tyrionsAp...(50) vs. woden - (51)" rather than "TyrionsApprentice (50) vs. woden..." -- it's much - more important to see the material than the full names, especially - when you're playing. - - 534. Steffen Jakob reports: "I use xboard 4.2.6. Yesterday I played - some bullet games at ICC. In one game I lost on time. In the last move - I already clicked on my queen and wanted it to move to its destination - square when I forfeited on time. After that my mouse pointer was the - queen piece. I couldnt drop it to any square." - - 535. For protover 3, the "st" command in the protocol could be - extended to allow for smaller units, not just seconds. - - 537. Clarify in the protocol that "force" while searching means you - should stop the search as soon as you can. (Isn't this clear - already?) - - 538. Need a way for the user to adjust the clocks. This is important - for WCCC and other computer competitions, where xboard/winboard's - clock is not the master. I was going to do it in time for the July - 2002 WCCC. Oops. - - 541. Related to #327, John Iverson says, "It would be nice to have the - coordinates shown outside of the board along the edges, rather than in - the squares where they are hard to see and give a cluttered - appearance, especially on smaller board sizes. (The coordinates can - be handy in certain situations, such as posting a screenshot of xboard - showing an email game in progress, with the view flipped.)" - - 542. If you start xboard with the -geometry NxM option, it will - dutifully make the window exactly that size, but it doesn't choose a - -size option that fits into such a window size, so the board is cut - off or has a lot of whitespace around it. In fact, the layout is - generally messed up because the code doesn't expect the window to be - the wrong size for the layout. We should at least ignore the size - part of the -geometry option if we aren't going to do something - sensible with it. How is that done with Xt? - - 543. See the patches and extensions on - http://www.tim-mann.org/extensions.html#patches and integrate those - that are worthwhile into the main code base. (Some are also mentioned - elsewhere in this ToDo list.) They are pretty much all over 15 lines, - so copyright assignment from their authors is needed. Unfortunately - some of the authors may be hard to reach. - - 544. Possibly rework looking_at pattern matching to have a "match at - beginning of line" character (perhaps ^). It looks like this may - actually be useful after all. The historical cases where you could - get a board or other output that needs parsing on the same line as a - prompt *may* have been fixed. Confirming this would need testing on - all the ICSes that are in use. - - 546. Odd bug reported by travelGirl. The last line of a multi-line - macro from the ICS context menu sometimes "sticks" at the bottom of - the ICS interaction window. New text gets inserted before instead of - after it. This started when she upgraded to win2k. See mail. - - 548. Guido Flohr reports: - - Another "not really a bug" problem: When xboard forks in order to - start a second chess engine, it is only concerned about duplicating - the descriptors for the standard channels in the child. This is - very interesting for the second chess engine, since it inherits the - pipes to its opponent, and can use them for sending commands like - "sd 2", "easy", or even for feeding a bogus FEN string into the - first engine (exchanging the opponent's queen with a bishop looks - really attractive to me). A very interesting feature, but not exactly - what you intended? ;-) - - Closing the other descriptors after the fork will not completely - avoid the problem, since - at least under Solaris and Linux - it - is still possible to peek and write into xboard's open descriptors via the - /proc pseudo file system (unless you make xboard setuid root), but - leaving them open, makes this cheat very obvious. - - 549. "Ron" (no last name given) reports that when compiling WinBoard - under VC++ 6.0, there are many warnings. These ought to be looked at. - - 551. "Miguel" (no last name given) reports "When you make a premove in - Winboard 4.2.6, and then opponent move and premove is illegal, then - and you try to make a legal move but you cannot, because piece are - erased and you have to replace your move again, move twice... in - lightining this is annoying." I'm not really sure what that means or - if it is the same bug as 497. - - 552. Get rid of the need for proprietary tools to build WinBoard. - It's already possible to compile winboard.exe using the Cygwin - toolchain. You can even compile it with -mno-cygwin to avoid the need - for cygwin1.dll. However: - - 552a. The Help file needs Microsoft Word to edit the source file - winboard.rtf and the Microsoft Help Compiler to compile it into - winboard.hlp. I tried using OpenOffice.org on the RTF file, but the - result was missing some formatting that the help compiler needs. The - help compiler itself is a free-as-in-beer download, but it's still - proprietary software. Perhaps the help could be converted to vanilla - HTML, at the cost of losing the index and search capability. - - 552b. The WinBoard installer package is built with InstallShield. - Possible replacements: - Inno Setup (http://www.jrsoftware.org/isinfo.php) - looks best - NSIS (http://nsis.sourceforge.net/site/index.php) - Cygwin setup (http://www.cygwin.com) - a long shot - - 552c. Although the cygwin resource compiler works on winboard.rc, it's - a pain to create new dialogs by editing the text file. The original - ones were all created using the graphical dialog editor in MSVC 5. - - 553. It would be nice for xboard's ICS Input box to have a history - feature similar to WinBoard's ICS Interaction window. Actually it - would be nice for xboard to have its own ICS Interaction window with - all the bells and whistles that WinBoard's has instead of limping - along using an xterm for interaction. - - * * * - - Before each release: - - make sure both xboard and winboard build and are up to date with each other - - run zippy with new version as a shakedown - - be sure gnu5 binary is up to date in winboard, and gnu5 patch (if needed) - is included in both xboard and winboard kits - - recheck cygwin compiling winboard - - make sure ChangeLog is complete - - test changes - - *** up to date with mail received through 5 Nov 2003, except - for the "protover 3" discussions on the chess-engines mailing list *** + Possible improvements **=somewhat higher priority + --------------------------------------------------- + + 20. Some way to back up, explore variations, then return to the main + line and restore moves we backed out. Should also support exploring + side branches while loading a game file. Push/pop buttons? Button to + fork another xboard in same state as current one? + + 20a. Allow side branches to be remembered in game files (and + understood on LoadGame). Use PGN variation notation. + + **62a. Support series of time controls as in later gnuchess 4.0.x + versions (and real tournaments!). Needs a protocol extension to + "level"; this is now planned for protover 3. + + 62b. Perhaps we could also support the kind of clock where you get K + seconds per move, plus a reserve of J seconds per game that is used + when a move takes more than K seconds. The degenerate form of this + with J=0 is desirable in itself. Needs a protocol extension. + + 68. WinBoard has some features not in xboard. Among others: + 68a. LoadGameOptions dialog (good to add) + 68b. SaveGameOptions dialog (good to add) + 68c. TimeControl dialog (good to add) + 68g. Font dialog. (leave out) + 68h. Colors dialog. (leave out) + 68i. Board size on Options menu (good to add) + 68j. Resize with mouse + 68k. Highlight dragging + 68m. Move typein from keyboard. (good to add) + + 69. xboard has some features not in WinBoard. Among others: + 69c. Font size selection by pattern fill-in. (leave out) + 69d. Alternate bitmaps specified at runtime. (good to add, often requested) + 69e. Flashing. + + 71. Allow restart after ICS logout instead of exiting? Many requests + for this. + + 71a. Would be useful to drop into NCP mode after ICS logout and allow + for reconnect later. For instance, this would let you save your last + partial game if you didn't have autosave on. + + 72. Allow switching among ICS, NCP, GNU modes?? + + 74. Observe/play multiple games, each with its own window. Hard. + + 80. Clone command. Saves current game to a file foo, then starts up + another copy of xboard with -lgf foo. Should probably note current + state of some options and give command line flags to set them the same + way in child. What about -ncp mode, though? Might want that to be + different. Would be nice to have a -moveNumber flag to position the + child to the same move number in the current game. + + 91. Would be nice to have an option to overwrite save file instead of + appending. + + 95. "Have the clock indicate how long the computer/player has been + thinking for when the -st option is used. This should be how long for + the current move only." (Dino Dini) + + 97. "Have the ability to change the level of the gnuchess during a + game. For analysis purposes, sometimes it is useful to have the + computer think really hard about certain positions." (Dino Dini) + + 98. Reorganize the source and split it into more files. + + 107. Changing time control during a game could be made to work. + Current (WinBoard only) way of changing at start is suboptimal. + + **108. Could add search depth and time per move to (WinBoard) + TimeControl dialog. + + 140. LoadPosition needs better checking for invalid data. + + 142. xboard needs a real file chooser dialog. Jeff Woolsey submitted + code to merge in the one from Ghostview, but said it works only on + X11R5 or later. I have not yet tried his code or looked to see if it + could be made to work on X11R4. + + 147. Improve display of held pieces in bughouse mode, putting them + closer to the player's side of the board, and perhaps using icons (and + allowing dragging from the icons to drop a piece). Actually, moving + the clocks would be beneficial too, so that it's easier to visually + associate the right clock with the right player when looking at two + boards during a bughouse match (with two copies of xboard running). + Maybe multiple window layouts should be user-selectable. [4.3 supports + drag-drops from holdings] + + 150. Keep track of castling availability, en-passant availability, and + FEN half-move clock (for 50-move rule), pass the availability + information to the move generator through the existing interface, and + load/save it in the FEN code. [Fixed in 4.3] + + 150a. Note that not keeping track of ep creates a bug in mate + detection. In certain positions, moving a pawn from the 3rd to 4th + rank gives mate, but it is not detected because if the pawn had moved + to the same position from the 2nd rank, ep capture would have been + legal and there would be no mate. [problem disappeared in 4.3] + + 150b. Note that although we try to put in e.p. availability when + writing FEN, this works only if we have the move that got us to this + position in the moveList. If we load a position from FEN, the + e.p. availability field of the FEN is lost. [disappeared in 4.3] + + 152. Generate the info file, man page, perhaps html, and perhaps even + the WinBoard help file from the same sources. Right now, + substantially the same text is duplicated in three places. This is + a huge pain in the neck. + + 157. Idea: if Zippy flags some number of times in a row and keeps + getting told the opponent is not out of time (presumably due to + timestamp/timeseal), he should issue an adjourn or abort. + + 160. The xboard CTRL key flashback feature is bad in Analysis mode. + Flashing back throws away the analysis. + + 161. SIGINT doesn't work for local programs on Win32. There is an + equivalent, GenerateConsoleCtrlEvent(CTRL_C_EVENT), but I haven't + gotten it to work thus far. It seems that WinBoard and the chess + engine don't "have the same console"; indeed, neither has a console. + + 162. Supply a non-X Zippy for Unix. Perhaps use the code from Klaus + Knopper. + + 167. Alternative bitmaps loaded at runtime for WinBoard. [font-based + piece rendering provides this functionality since WinBoard_x] + + 169. Upload Game on file menu? This would upload the current game + moves into a scratch examined game on ICS. Could do Upload Position + too. Some code to do Upload Game was contributed, but it didn't + handle setup positions, variants, checking for proper gameMode, etc., + so I couldn't use it. + + 170. Auto step every k seconds should be a general feature you can + turn on at any time, not just in LoadGame. What should GUI be? + + 171. Displaying thinking in a separate window should be an option + available at all times when Show Thinking makes sense, not just in + analysis mode. It should perhaps be orthogonal to analysis mode. + [added in WinBoard_x] + + 172. Should analysis window scroll instead of showing only the last + line? There could be an extra checkbox to show all chess engine + output in it. [fixed in WinBoard_x] + + 178. Need reliable kill for chess engine on Win32. See also 161. + + 181. Some people want -sgf to save only played games, not observed and + examined games. Others like it to save them all. Make this an option? + + 183. Search feature in Game List dialog [Igor Eged]. + + 187. "Log session" feature for ICS window. + + 193. Some users have reported xboard redraw bugs, but I have not + been able to reproduce them on the Digital Unix, Linux, or eXcursion X + servers (xboard). + + c. From Hawk: + Dragging in xboard does not work 100%. + * The dragged piece may disappear (try some fast e2-d3 movements - + this is easy to reproduce). + * The dragged piece may be placed on an illegal position (this + happens less frequently, but it _can_ be reproduced by doing the same + as above). + * In both of the above cases, the board is correct after forcing a + redraw (ie. minimizing/restoring the window) + I'm using eXodus - a win32 X server, perhaps it's buggy. [Seems that way, + or just possibly, these could be bugs that are fixed in 3.6.11beta or + 3.6.12beta.] + + d. One user reports: "If you are 'holding' a piece over the square you + want to go to and that move becomes illegal but you make it anyway, + the display sometimes corrupts and a partial piece appears..sometimes + a whole piece." This was under RedHat 6.0. + + 194. A few users have reported drawing problems with WinBoard. There + may be some color map problem on certain displays. I might possibly + have fixed this already; I cannot reproduce it. The common thing + seems to be black pieces changing to white. This may depend on having + customized the board colors. I suspect many of these problems are + buggy Windows drivers for particular display cards. (May be worked + around in 4.2.0 with reprocessed .bmp files.) + + a. From mulesmurf: if i log in and then move the board, it will happen + that the black [pieces] change to white. + + c. People have sent pictures where the grid didn't get redrawn. This + produces random bits in the grid area from uninitialized memory. + Could this be a resource leak? + + d. From James Van Buskirk: I did notice one problem tonight playing + against Comet under FX!32 1.2 (Comet, not winboard ran under FX!32): + for a couple of moves winboard didn't turn off the highlighting of the + square I dropped the piece on until Comet had moved. Later, the + problem fixed itself. Have other users noticed this? [No.] + + e. One user reports: Lastly, there is some sort of slight bug in the + piece dragging code, but it comes up only very occasionally (once in + 500 moves?)...basically, I'm dragging, change my mind, throw the piece + of the side of the board, and instead it gets stuck not inside a + square. It's really disconcerting, this piece just sitting across + square boundaries. When you make another move, it gets cleared up and + goes back where it's supposed to. [Might be fixed in 4.0.6, but I + couldn't reproduce this, so I can't be sure.] + + f. DAV says: "When I resized the board on win 95 and made it smaller + some of the pieces turned into junk (I'm not able to give a screen + shot)." Later: "Seems to happen on the three sizes below small. + Win98 and NT seem to be ok, trying to get more win95 users to test + it." Works fine for me on Win 95... [Might have been fixed by the + cleanup of the Windows .bmp's that happened sometime before version + 4.2.3] + + 195. Flash Moves works at the end of every change to the board, using + some rather gross code in DrawPosition. This code should perhaps be + ripped out and the flashing done from inside AnimateMove instead. + + 197. More color distinctions. Maybe allow several user-selected channels + to have their own colors. + + 198. More sounds. Some possiblities: distinguish White vs. Black move + or your move vs. opponents, distinguish different kinds of + win/loss/draw/unfinished (checkmate, resignation, stalemate, other + draws, opponent disconnected, etc.), game ends when you aren't playing + and/or aren't in ICS mode, differentiate amongst requests (draw offer, + etc.), **check, got new offboard piece (by piece type?), opponent got + new offboard piece (ditto), arrival notification, "* who has an + adjourned game with you," draw declined, moretime received. + + 199. Maybe put user names instead of White and Black on clocks, or + user names above or below clocks in a smaller font. + + 200. I don't like these ideas, but some people do: + a. Highlight all of the squares that the piece you are moving can go to. + b. Clicking on the piece moves it immediately if it has only one legal move. + c. Allow clicking on the destination, then the source. + d. I guess highlight the pieces that can go to that destination. + e. Clicking on a destination that only one piece can go to moves it there. + + 201. mulesmurf: piece counter so we know exactly the score + + 202. mulesmurf: ziics pieces, board along with color intensity + + 204. Hawk at Fri May 15, 12:58 CDT 1998: a minor thing with xboard: + the coords disappear while dragging from a square with coords on it. + [They come back when the drag is finished.] + + 208. WinBoard sometimes comes up with one of the menu bar items grayed + out (one that should not be). I've seen this on different entries at + different times. + + 213. Maybe add Silence to sound menu -- parallel to Monochrome on + color menus. + + 214. Maybe easier startup dialog customize: + a. Buttons to add/delete/move(?) current string to/from/within current list. + b. Or maybe auto-add newly typed/edited strings up to some limit. + c. Also a drop-down for Additional Options. + + 216. Maybe shorten menu names in WinBoard to one char if and only if + the menu bar would wrap with longer names. + + **217. Easier way to add engines to the WinBoard startup dialog. + Ideally, an engine author should be able to supply a simple + configuration file or script that installs his engine. "*.wbe" idea. + + 218. Some folks would like Highlight Last Move to apply only to + opponent's moves. + + 219. From Jorge Monasterio: Support automatic game starts when in + tournament. In other words, do that "match bigolfish mann 5 0 black" + automatically based on the info sent from mamer. [I would need to + play in some tournaments before I could evaluate this idea or fill in + the details.] + + 222. Could support time handicaps. [Added in 4.3] + + 223. Bug: very long comments cause buffer overflow. Need to revamp + the way comments are parsed and returned from parser.l to fix this. + + 224. Larry Parrish requests: In an automated multi-games match I would + like to load the n-th game from the file for the n-th game of the + match. [That is, when -mg and -lgf or -lpf are used together without --lgi or -lpi.] ++-lgi or -lpi.] [4.3.15 provides auto-increment og game and pos index] + + 225. From pulp: another bug (maybe with the Microsoft RichEdit + control) I've observed is when you flood the edit control it loses the + bottom. Eg. "games" will scroll along then start slipping until by + the end of the list you are really looking at the middle of the list + and have to manually scroll back to the bottom. [May be fixed?] + + 225a. Resizing the WinBoard ICS interaction window can cause the cursor + to be off the screen, which stops scrolling. + + 226. From pulp: Clipboard persistence. If I copy text, then the text + disappears when Winboard is closed. Eg.: Log in, highlight and copy a + web page address, close, go to browser, paste *nothing*. [How does + one do this in Windows?] + + 227a. In engine-engine matches, an engine that crashes should lose and -perhaps get restarted for the next game. [Added in 4.3] ++perhaps get restarted for the next game. [In 4.3 a crashing engine ++forfeits the game, but still terminates a match.] + + 227b. Maybe when an engine playing in Zippy mode exhibits a bug, we + should do a little more too. Perhaps "say Sorry, the engine seems to + have a bug", resign or abort, and maybe force an engine restart for the + next game. + + **227c. We should also detect and stop the game on false mate or draw + claims, rejecting a legal move, or (maybe) missed claims of mate or + draw. Note that draw claims require checking for repetition, 50 move + rule, and insufficient material as well as stalemate, so this is + nontrivial. [Added in 4.3] + + 228. RichEdit bug: sometimes a line gets indented as if it were + wrapped when it should be flush left. + + **229. Support for sending moves from the partner's game to a bughouse + engine. Ben Dean-Kanemura submitted support that works without adding + general multi-game support, by relaying the moves without processing + them. Should also send holding updates and clock times; not sure if + Ben's code does that. Needs to be a new "feature" command option, and + to be documented in engine-intf.html, removing the note that this may + be done in the future. + + 231. See Ed Collins's WinBoard bug list on his pages: + + 231b. If you save an ICS examined game to disk as a PGN file, it + doesn't report the end-of-game result in both the header and at the + end of the notation. [It doesn't get this info from the server, but + maybe there is a way it could.] + + 232. From Ed Collins's WinBoard wish list on his pages: + + 232b. Multiple winboard.ini files for different moods, loadable from + inside the program. + + 232c. Fix bug where fics% prompt is not suppressed when using + timeseal. This has something to do with a timeseal deficiency whose + details I've forgotten, but there must be some way to fix it. + + 232e. When using the server's "examine" mode to examine a previously + played game, have the game clocks display the time that each player + currently had after each move was made. + + 232f. [Not from Ed] Deal with ICC game relays where an "examined" game + is supposed to have running clocks. Not sure if this is still an issue. + + 232g. Customizable on-screen buttons [i.e., toolbar or toolbox]. + + 232h. Customizable function keys. Currently xboard can bind a key to + any built-in xboard function. Should extend this to WinBoard, and + also (in both programs) support sending an arbitrary ICS command when + button is pressed. + + 233. See if anything from LightningRulez should be added. Premove is + now included (from Winboard Plus), but maybe there are other useful + things too. + + 241. There might still be bugs in xboard and/or winboard when moves + come in from ICS during drag animation, though I can't reproduce them. + DAV saw the opponent's piece fail to be erased from the source square, if + I understood his message right. [DAV says this still exists in 4.2.5. + I think bug 426 is a duplicate. The description is clearer there.] + + 242. User-defined "looking_at" patterns and actions. This is hard to + bombproof. + + **243. "Rematch" shortcut in /cp mode. + + 246. Maybe auto-close comment window when user goes to the next move. + Whether this is desirable really depends on the content of the + comment, but maybe it is rare to have a long comment that discusses + the plan several moves ahead and should be left up. + + 248. Would be nice to support retract move after checkmate or draw (etc.). + + 254. Different tray icons for interaction window vs. board (suggestion + from FICS). + + 256. One user asked for "delete" option in game lists. This requires + rewriting the file to close up the hole, so it's pretty heavyweight. + Next people will be asking for move, sort, search, and other game + database functionality; ugh. + + **257. Would be nice to find a way to safely implement "retract move" + when the engine is still on move. (using ping/pong) + + **260. General mechanism where engine can declare engine properties that + the user can frob and xboard/winboard will put up a simple dialog to + allow user to view and set them. See email message "special engine + commands" from Steffen Jakob: + + From: "Steffen A. Jakob" + To: mann@xxx + Cc: chess-engines@xxx + Subject: special engine commands + Date: Fri, 26 Feb 1999 09:12:26 +0100 + + Hi Tim! + + Here comes a summary of our ICC chat (I cc this mail to the + list... maybe other engine programmers can give some feedback if + they find this feature useful): + + Please add a protocol command which enables the engine to tell + xboard its special commands. Maybe a set of (label, command string) + pairs would be useful. Then create a menu for these commands. It + could look like this (that's what I would like to see for Hossa): + + engine->interface: + ------------------ + command "Reset the log file" "reset log" + command "Save Diagram as PNG" "png dia.png" + command "Disable Book" "book off" + command "Show Evaluation details" "eval" + command "Show Search statistics" "stat" + + etc. + + While typing this list I realized that an additional parameter like + this would be needed/nice (of course you can think of many more + improvements): + + command "Save Diagram as PNG" "png %s" 1 + + "1" tells xboard to ask for an additional parameter (here: filename) + which will replace the "%s" in the command string. ++[XBoard 4.3.16 has an experimental implementation of this ide through ++the 'feature option="..."' command.] + + 261. Check that "quit" is sent to engine properly if ICS connection + fails to open due to error from timestamp/timeseal. "wzrdking" had a + case where it didn't. Timetamp had failed with "Host name not found + by name server" (because in fact there was no internet connection, arrgh). + + 273. Displaying the names of the players from a PGN file in the header + of the window does not work if there is only one game in the file. + The filename is shown instead. (This was intentional, but maybe a + poor idea.) + + 274. Command to go to move number N, with entry box for N. + + 276. Make grid optional in winboard? Note that the highlight options -don't work without it. ++don't work without it. [The Winboard_x -overrideLineGap option provides ++this.] + + 276a. Make color of grid an option, instead of always black. + + 277. Flooding xboard -zt + timestamp with tells hangs timestamp after + a while. xboard is blocked writing to the timestamp pipe. timestamp + is in an unknown state, not reading from the pipe nor responding to + pings. (Confirmed with the software running on milwaukee, Red Hat + 5.2) + + 278. Flooding winboard -zt + timestamp with tells hangs winboard after + a while. timestamp still responds to pings. This reported by + nudnick; I haven't tried to reproduce it yet. He also says that + windows explorer then crashed when he tried to close winboard. + + 279. Idea from an anonymous ICSer: piece drop menu could have images, + not words. [Or maybe both?] Also might be easier to select + accurately from it if horizontally arranged, or in a 3x2 grid. + [Now 4.3 has drag & drop, piece-drop menu should be deprecated] + + 284. dxterm hangs when it receives the escape sequence that sets the + title bar on xterm. I think some other xterm substitutes do too. + + **287. WinBoard can look funny if you are using themes because it + unconditionally uses white for certain colors instead of the default + background. + + 289. Merge WinBoard support for the Henter-Joyce JAWS screen reader. + Source code (zip file containing modified WinBoard 4.0.2 source) is at + ftp://ftp.henter-joyce.com/users/hj/winboard/WinboardSource.exe. It + would be interesting to make this work with festival (free Unix speech + synth) or other speech synthesizers too. + + 290. Could have limited voice output without a speech synthesizer by playing + wav files for piece names and square numbers. Idea suggested by Hannu + Wegner. + + 291. Would be great to support DGT, Novag Universal chessboard, etc. + I'm not likely to fork out the cash to buy either for testing, however. + Note users have done various things along these lines. + + 292. When an engine is analyzing, it would be cool to have a way to + automatically play out its current PV (or even older ones) on a board. + These PVs could be saved as variations when we have variation support. + + 297. Windows users expect all programs to have a Print function, even + though there are other ways to print. Useful items to make printable: + PGN game scores (which are plain text, of course), maybe FEN position + diagrams, maybe graphical position diagrams (i.e., same as pressing + the "Print Screen" function key and printing the clipboard). + + 298. One user suggests that automatic move stepping should not start + until you press OK in the tags window. This could be a good idea, but + I think I'd rather have automatic stepping never start until you press + a "play" button on the main window, and have that button always + available, not just when loading a game from a file. + + 299. One user suggested being able to jump to a specific move by + typing its number (followed by ... if it's to be black's move). + + 300. Can I put a hyperlink (that will invoke a browser) directly onto + the WinBoard Help menu or in the Help file? Useful to take users to + my chess page. + + 302. On NT, check if the board is redrawn properly when exiting from + the screen saver. + + 308. There is some tricky way to maximize the WinBoard board window, + although there isn't supposed to be. Maybe prevent this, or else + legalize it and make sure something reasonable looking happens. + Note: the trick is to select one of the "tile" options on the Windows + task bar. Not clear what should happen in this case. + + 309. Avoid endlessly flagging every second when opponent is lagged out + and autoflag is on. Automatically courtesy-adjourn (or abort if + unrated) instead, at least if in zippy mode. + + 310. Weird bug: the last character of a FICS output can appear on the + next line, *after* the fics% prompt, according to one user. I might + have seen something like this myself once too. + + 314. One person wanted his engine to see tells when running in Zippy + mode. I doubt this is generally useful, so I haven't added the code I + wrote for him. (I can query for "tellfrom" in my mail file to find + it.) + + 314a. Another person wants his computer account to relay tells to his + personal account. + + 319. One user would like to be able to reload a PGN file and resume a + game against an engine as if after an adjournment, with the clocks + (and moves to next time control) restored as they were when the game + was saved. + + 320. Display ratings of ICS players in the title bar (if there is room, + presumably), or somewhere, anyway. + + 321. Maybe refresh the EditTags window if the gameInfo changes and the + window is up. (WinBoard now does this when entering MachineWhite, + MachineBlack, or TwoMachines mode -- not very general. From Winboard Plus.) + + 322. One user requested that Zippy games use the engine name instead + of the ICS handle in the PGN tags, as he uses multiple engines on his + account. (My response was "I'd say it should give both"; not sure just + how to do that, though.) + + 324. I'm told that Blitzin supports animated dragging without holding + down the mouse button and that this is "much better" and I should try + it too. As yet I haven't. + + 326. Full support for variants and variant-capable engines in all + modes, not just ICS mode. Here are some items still needed. Some if + not all should probably wait for a rewrite, not be added to the + current code base. [4.3 supports many variants, even those not supported + by ICS. Not bughouse, though] + + 326a. Menu to let you see and change the current variant type, not -just a command-line argument as at present. [Added in 4.3 WinBoard] ++just a command-line argument as at present. [Added in 4.3] + + 326b. crazyhouse: Keep track of holdings and display them, keep track + of what onboard pieces are promoted so they will revert if captured, + understand offboard interposition to stop mate. [Added in 4.3, (not + sure about the interposition)] + + 326bb. One user asked for a Czech variant of crazyhouse where pawns are + given to the opponent when they reach the 8th rank (after capturing, if + it's a capture) instead of promoting. + + 326c. bughouse: Features in 326a would be helpful for editing one board + of a bughouse game, and getting mate indication right even in ICS mode. + In the longer term, could understand BPGN, support editing two-board games. + + 326d. wildcastle: Allow wildcastle castling only when playing this variant! + Maybe support automatic shuffling for local play. [4.3 adds shuffling + for any variant played locally] + + 326e. nocastle: Maybe support automatic shuffling for local play. + Note that several types of ICS shuffle chess fall under this variant. + Note that this isn't really a variant, since if we kept proper track + of castling rights and used "setboard FEN" or the ChessBase extension + of "edit" to set them, it could be treated as normal chess with a + different starting position. + + 326f. fischerandom: Maybe support automatic shuffling for local play. + Support castling. Currently, you can probably play Fischer Random + successfully on ICS by typing castling moves into the ICS Interaction + window, but they will not be animated correctly, and saved games will + not be loaded correctly if castling occurs. FR castling is + problematic because the move cannot be specified by the starting and + ending coordinates of the king; in some starting positions there is a + legal non-castling move that moves the king the same way. This + violates a deeply ingrained assumption in the implementation. It also + breaks the GUI -- you need more than just dragging the king two + squares to indicate castling. (Note: In FR notation, O-O is h-side + castling, O-O-O is a-side. See "help fr_rules" and "help fr" on FICS + for rules.) [All fixed in 4.3] + + 326g. kriegspiel: Could give some thought to how to support a + kriegspiel engine. I doubt anyone will ever write one, though. + + 326h. losers: Know that captures are mandatory. Understand the win + condition. + + 326i. suicide: Know that captures are mandatory. Understand the win/draw + condition. + + 326j. giveaway: Know that captures are mandatory. Understand the win + condition. + + 326k. atomic: Understand the win condition. + + 326l. 3check: Understand the win condition -- ugh, have to keep a + check counter! + + 327. Option to set the coord font color (or something) to make sure + there is always enough contrast with the square colors. + + 329. Bernhard Maerz would like a command line option to choose the PGN + player name for an engine, overriding the default of generating the + name from the engine filename. This is for his ChessCall program. + + 331. Maybe the local autoflag menu option should *also* turn + server-side autoflag on/off by sending an appropriate set command. + + **332. Bug: Autoflag for local engine/engine or engine/human matches + does not recognize that having your flag fall when your opponent has + insufficient mating material is a draw. It counts the flag fall as a -loss. ++loss. [Partly fixed in 4.3, which corrects any kind of losses against ++a bare King to draws.] + + 336. Of course lots of people ask for a graphical seek window. + + 339. There are probably some incompatibilities with chess.net, as they + have made a few gratuitous changes to message formats from the FICS + code base they started with, and perhaps they've added features since + without duplicating the syntax closely enough. In particular it's + been reported that Zippy does not correctly send "partner" and + "variant" commands to bughouse engines on chess.net. Also, I doubt + colorization works. As a matter of personal choice I do not spend any + of my time supporting chess.net, but if others want to donate patches + that allow chess.net to be supported without breaking the support for + ICC and FICS, I am willing to install them. + + 342. Analysis mode automatically turns on the Show Thinking option; + the user must then turn it off manually after leaving analysis mode if + he doesn't want it. + + 343. Would be nice to change xboard keyboard shortcuts to not be plain + letters, make the new shortcuts work also in the ICS input box, and + make typing plain letters to the board redirect to the ICS input box + or the xterm. Might want to change/remove the Ctrl binding at that time. + + 344. One user suggested having a way to save a position as a character + string that would produce a board diagram when rendered in MS Word in + a chess font. Perhaps there is already a nice standalone tool for + this, though? + + 346. Could use a better way to pick default size. Now we choose the + largest that fits on the screen, which is typically too big. Not too + bad for WinBoard, but painful for xboard since it can't be resized + after starting. + + 349. Check that "quit" definitely makes it to the engine before exit, + if you exit via the File menu while a match is running. Uli Tuerke + reported that maybe it sometimes doesn't (in WinBoard 4.0.5). + + 352. Perhaps recognize the ANSI escape sequence that FICS sends out + for the cls command and clear the ICS interaction window. + + **353. WinBoard can crash when the engine outputs very long PV lines + (or debug output that looks like a PV). In particular, lines that + start with 4 or more blanks following a "thinking" output line are + treated as continuation lines, and get concatenated into a 512-byte + buffer with no checking for overflow. Generally we need a lot more + care to avoid buffer overflows inside both xboard and WinBoard. + [Note: changed the buffers to be 5120 bytes as a band-aid.] + + Guido Flohr expands on this bug: + + The problem is easy to reproduce, simply write a program/script that + spits out lines of more than 8192 bytes (INPUT_SOURCE_BUF_SIZE) and + connect it as a chess engine to xboard. No surprise, xboard cannot + handle such long lines, but the resulting behavior is really weird: + + The program enters DoInputCallback() in xboard.c, reads the first + 8192 bytes, searches for a linefeed in vain, then closes its eyes, + sets the member "unused" of the InputSource to is->buf + 8192 and + waits for more input although the buffer is already full. + + The next time it calls the same function, is->unused is exactly + these 8192 bytes away from is->buf, xboard computes the amount of + bytes to read in this round, which sums up to 0 nothing. It then + calls read(2) with a bufsize argument of 0, and then assumes end + of file when the kernel call returns 0 (which is the documented + behavior). + + For local engines, we now jump into backend.c, ReceiveFromProgram(), + and this function reports that the engine has exited unexpectedly. + In fact the engine is still very vivid, which is good, because in + spite of xboard's assumption that its child has died, it still + sends "force", "ping N", and "quit" to the false dead. If the child + was really dead, the alert boxes "error writing to ... engine" + would hide the first alert box "... has exited unexpectedly". + + From xboard's side, it is not exactly clean to call read(2) with + a zero bufsize argument. In my opinion, a sane solution would be + to eat the INPUT_SOURCE_BUF_SIZE bytes, and when they contain no + linefeed, print the partial line to standard error (in debug mode) + and report something like »Maximum line size exceeded« (and then + kill the engine). + + **354. We currently let the user go directly from TwoMachines mode to + various other modes like MachineWhite or MachineBlack. This may + confuse the engine that was on move, since we don't have a way to + force it to stop before it makes the move it was thinking about. + (use ping/pong to know when the engine has stopped) + + 355. Idea from LiveAndLetDie: have Zippy specially log games where it + loses to a substantially lower-rated player. Such a game could + indicate an xboard bug, engine bug, or perhaps a computer-using + cheater. + + 356. Colorization for FICS tourney tells? They look like this (ugh): + :DChessmaster [tourney #4]: + :hi + + 357. A few reports of WinBoard pieces being drawn incorrectly at + certain sizes. I haven't reproduced this. [Maybe worked around in + 4.2.0. Or is/was this the same as 194f? I don't recall the details.] + + 358. One report of WinBoard colorization not working, even after + restart, until the computer was rebooted. Weird. + + 362. Running a very long automated match (/mg option) seems to crash + WinBoard eventually, usually after 300 to 500 games, sometimes later. + Reported by Josh Haglund. Gets a "WINBOARD caused an invalid page + fault in module KERNEL32.DLL" dialog box from Windows. See messages + from Josh for examples of the registers and stack dump. + + 362a. A few people have reported WinBoard crashing upon exit. + + 363. Maybe xboard should not set the window geometry for new popups, + or at least not the position. The default positions aren't very good, + and setting them programmatically keeps knowledgeable X users from + customizing the positions with X resources. + + 366. Feature to let an engine observe an ICS game and run analysis + mode on the moves, perhaps whispering or channel-telling the results. + It's a little too easy to cheat with this feature or I might have -added it long ago. ++added it long ago. [Added in 4.2.8 and 4.4] + + 369. Optionally send a periodic keepalive command to ICS. Can be + used to defeat autologout, so should probably not be on by default. + Also should be useful to help Zippy notice more reliably when its + connection has hung, so that it can exit and a shell script (batch + file) can restart it. + + 370. One user requested a local noplay list for his computer player + because the FICS limit of 50 is too small. He wants several hundred so + that he can noplay everyone who disconnects in a lost position. + + 374. Would be good to have a way to change engines without restarting + the interface. + + 376. WinBoard is said to crash or "lock up" when loading enormous PGN + files, like a 98 MB file that comes with (??) Crafty. Win32 (at least + in the Win95 lineage) has a limit of 32,767 items in a list box + widget. That might explain this problem. + + 376a. xboard exceeds limits in X and/or Xaw if a PGN file has too many + games. (The virtual window that the list box can scroll through + becomes too many pixels high.) This has odd effects; the window + height of the game list seems to get reduced mod 2^16 or something. + Maybe detect this and do something nicer about it, like stop loading + when the window is full and pop up a warning. + + 378. One Solaris user didn't have the "strip" program, so the + install-sh script used by xboard "make install" failed. Check for + this? Yuck. + + 381. "Illegal move: post" is apparently not handled. Should it be? + + 382. The UI for entering Training mode is a bit obscure: you must + first select Load Game, then Training becomes enabled in the upper (!) + part of the Mode menu and you can select it. You can then select it + again to toggle it off. This mode is something like Analyze File + (which has a problematic UI too, but somewhat less so); both should + probably use a similar UI style. I consider disabling the + step-forward button to be overkill, and I think you need to manually + turn off auto-step when loading a game (?). One user expected it to + work with .epd files that give a position and a recommended move. + That seems reasonable, but doing it would require quite different code + from the current pgn-game training mode. + + 383. Premove piece drop for bughouse/crazyhouse. + + 384. Pre-first-move for xboard. I don't much like the fill-in field + method used in winboard. Maybe allow a move to be made for white + before the game starts (in both xboard and winboard). If you get + black, it's cancelled. Black can already premove after the game + starts, during white's first move think time, so I don't see that a + black pre-first-move is needed. + + **387. Have winboard draw opaque details on black pieces too. + Hmm, this should probably be optional, and the detail colors should + be selectable instead of hardwired to the opposite piece color. ++[The 4.3 -allWhite option goes in this direction. Details always ++in black, though.] + + **387a. Add "no piece border" option to WinBoard. See code from + Robert Jurjevic sent 4/9/2001. + + 391. I have a bug report from Stefan Zipproth about engines sometimes + failing to make their first move in an engine-engine match. So far I + can't reproduce it. This might be fixed by the Sleep(500) voodoo in 4.2.4. + + 394. See about tightening matching for the "request" event. Right now + it matches on help files a bit too often. (e.g. FICS "help sr_info") + **Also clarify documentation on what the request event is. + + 396. xboard's -size defaulting code for bitmaps unfortunately always + picks a size from the built-in list, even if you gave the + -bitmapDirectory option. It would be more user-friendly to have some + extra code that lists the directory and considers exactly the sizes + that are found there, as the pixmap code does. + + 397. It would be nice to be able to configure xboard with bitmap + pieces as the default without having to disable xpm support entirely. + This should be a pretty simple mod to configure.in (and xboard.c). + + 397a. It would be very nice to be able to compile in both the bitmap + and pixmap pieces. This would allow us to automatically switch to bitmap + pieces in -mono mode, including when -mono mode was automatically selected + because too few colors were available. + + 398. It would be nice to have the new .xpm pieces in .xim format too, + since I restrained myself from ripping out the .xim support. + + 399. It would be nice to have a configure option to change the + directory where the default piece set is taken from. Slightly nicer + than having to rename the desired directory to "bitmaps" or "pixmaps" + as at present. + + 400. TypeinMove should be grayed in ICS mode, or should raise the + console window, or something. + + 402. Internationalization. It probably isn't practical to retrofit -this into the current code base. ++this into the current code base. [4.2.8 and 4.4 have international- ++ization of xboard.] + + 409. One user requested a way to put a time delay in the middle of + sending zippyGameEnd commands. This would (for example) let the + computer do a seek only if its opponent doesn't accept a rematch + within 10 seconds. Nontrivial because Zippy has to continue to listen + to input during the delay; it can't simply call sleep(). Maybe + ScheduleDelayedEvent is OK, but I think it may already be in use in + this situation, and it only supports one event at a time. + + 411. Add zippyKibitzThinking and zippyWhisperThinking features? + [4.3 has an -autoKibitz option] + + 412. Maybe optimize setting the move list in the case where only the + current move number changes; avoid slow XawListChange. + + **413. Add movelist window to WinBoard too. Wilkin Ng submitted a + patch that I believe includes this; need to integrate and test it. + + **415. It was suggested that a few common options that many chess + engines need be promoted to xboard/WinBoard options so that the user + can set them from the GUI in a uniform way. In particular: hash size, -directory name for endgame tables. ++directory name for endgame tables. [4.3 has extended WB protocol ++with a memory, egtpath and cores command.] + + **416. Can we avoid dying when xboard is in 8-bit mode, pixmap pieces + are chosen (by default), and we can't get enough colors? Ugh. + + **419. It was suggested that stat01 be generated/accepted during normal + play with "post" on, not just during analysis mode. This would need + to be a "feature" command option. + + 422. Track FICS change to details of how timeseal works; is this + implemented at FICS yet? + + 423. When locally stepping through an ICS game that is over, it would + be nice to display the historical clock times at each move. + + 424. DAV at Thu Nov 9, 01:20 CST 2000: any chance on winboard/xboard + of a key press and a move executing draw ? that way you at least + have a chance of claiming a draw in 1 0. + + **426. DAV says, in xboard: If you are not on clock and you hover a + piece over a square where your opponent then moves to and then move + the piece away the piece the opp moved or part of it has not been + drawn. [Duplicate of bug 241?] + + 429a. Check whether more support is needed for WinBoard to work with + scroll wheel mice in the absence of special mouse drivers that generate + scroll bar events directly. + + 431. People find Analyze File confusing; they think it should do + Crafty's relatively new Annotate function. Also, it's somewhat + superfluous now that you can enter Analysis mode and then load the + file, or vice versa. + + **436. WinBoard is said to crash if started while WinBoard.debug is + being tail -f'ed. + + **441. Can I prevent an undo after new in the odd case where it can + happen now? See mail from Bob Hyatt. + + 450. Suggested: an option to let an engine keep pondering while an ICC + game is adjourned. This seems a bit difficult. + + 451. Suggested: support SuperMamer messages on FICS, aka qtells. See + http://www.freechess.org/SuperMamer/parsing.html. + + 452. Suggested: a way to say "prompt for the password" in a login.ini file. + See 510 instead. + + **454. Add a way to claim a draw together with making a move, as can + be needed for draw by repetition (creating the 3rd repetition with the + move) and by the 50 move rule (the move is the 50th). Add to + protocol, and implement using the individual methods on FICS and ICC. + Need to be sure it's really a FICS that has the feature (somehow). + [Fixed in 4.3 by usng 'offer draw' for this purpose] + + 455. Suggested: Add the epdkit commands such as epdpfga to the + protocol, since Crafty and "many" (which?) other engines include the + epdkit. + + **456. Bob Hyatt suggests: "feature match=1" which says "send match + requests to the engine and let it decide on who to play next". + I.e., maybe send an abbreviated but fixed format message like this: + match time inc R/U. The engine would use "tellics + accept " to accept. Add as feature to protover 3. + + **457. Standardize on the meaning of scores (e.g. in stat01 responses). + Is positive good for white or good for the engine? Do certain scores + mean forced (tablebase) draw, or forced mate in N? This should align + with the EPD spec. Maybe a feature command should indicate that the + engine matches this part of the spec, but then again, it's not clear + what we can do about it if the engine doesn't give that command, so + maybe there is no point. See discussion on chess-engines list. -[WinBoard_x adds an argument to tell WInBoard an egine uses absolute ++[Winboard_x adds an argument to tell WinBoard an egine uses absolute + scores] + + 458. Bug: xboard will try to use an engine to play normal chess even + if the engine has given the feature variant command and did not + include "normal" on the list. Crafty 18.1 inadvertently relies on + this bug, so it probably can't be fixed right away. + + **468. Need to look at Wilkin Ng's contributions! + + **469. Look at Zippy's behavior if the operator observes, follows, + examines, etc. Some bugs in this area have been fixed, but it's + received very little testing, as Zippy was never meant to be used that + way. Noted later: Examining in -zp mode definitely has problems. If + you go forward one move at a time, moves are sent to the engine + correctly. If you go backward one move, "undo" is not sent to engine + as it needs to be. Going forward or back by more than one move at a + time needs to be looked at too. + + **471. Look at 3/17/2001 message from Laszlo Vecsey about crashes when + exiting on Win ME while data is coming in from the server. + + **473. Visual low-time indicator. See patch in Brian Mays message of + 3/27/2001. + + **474. Crash reported when sending certain 8-bit characters through + WinBoard (180, 167, others). I'm almost certain this is a FICS + timeseal issue and nothing to do with WinBoard itself. + + **475. Look at Laszlo Vecsey's mousewheel patch of 4/10/2001. + + 476. For some reason (I guess some GUI supports them), most WinBoard + engines now have a graphical logo, 100x50 pixels in Windows .bmp + format. It's been requested that WinBoard have a place to show the -logo. ++logo. [4.3.16 supports logos] + + 477. Implement the "book engine" idea I proposed in the protover 3 + discussions. Some folks have offered to write them (e.g., Bruce -Morland). ++Morland). [4.3.15 supports a GUI book, which is another way to ++acheive the same, as the only thing that would distinguish book ++engines is their book, not what they do.] + + 478. Recognize URLs in the WinBoard ics interaction window and make + them work as hyperlinks (firing up your browser). + + **479. Possibly use Scott Gasch's 7 May 2001 patch to delay accepting + challenges when ping > pong instead of declining them. Bug: if you + get more than one challenge, Scott's patch forgets about all but the + last one. If that guy then withdraws his challenge, the others are + left in limbo, neither accepted nor declined. I suppose we could + decline challenges when there is one waiting. However, if we make the + change to optionally pass match requests through to the engine, Bruce + Moreland would like us to queue up challenges and pass them all on. + + 481. 8 May 2001, Bob Hyatt "matchscore" feature suggestion could go in + protover 3: "matchscore A B C D E says we are in a match, this is game + A of B games. The current match score is I have won C, drawn D, and + lost E games in this match. This would give the engine a chance to + adjust the draw score as needed to try to win the match rather than + just trying to win a single game." + + **482. Suggestion from Bruce Moreland: if the user goes into ICS + examine mode while -zp is active, and the engine supports analyze, + then put it into analyze mode and let it work on the examined game. I + guess this could work for observed games too. Should it be optional -or always done? ++or always done? [4.2.8 and 4.4 support analysis in zippy mode, but ++as yet only while observing games.] + + 483. It would be nice if the KingShine 3D board could be integrated + as an alternative xboard GUI rendering. + + **484. Add -feature1 and -feature2 options to pretend the engine sent + us those feature commands. Useful kludge for certain buggy engines. + + 485. Add "reset" to protover 3. (Clear the hash tables and other such + info; used to put the engine into a known state before running a -test/benchmark position.) ++test/benchmark position.) [the WB 'memory' command could be defined ++to have this side effect? Normally we would have to clear the hash ++table when changing its size.] + + 486. Other protover 3 features listed in my 6/21/2001 message to + chess-engines list. Write a full protover 3 draft for comment. ++[Note that 4.3 already uses protocol extensions that differ from ++the v3 specs.] + + 487. Adjudicate non-ICS games as a draw when there is insufficient + mating material on both sides, especially engine/engine games. Well, + maybe. I argued against this in a 6/26/2001 message to chess-engines. + [Added in 4.3] + + 487a. Probably also adjudicate when we detect checkmate or stalemate, + before bothering to notice whether the engine detected this. [Added + in 4.3] + + 487b. Note: Do not adjudicate 50 move rule or 3x repetition since those + must be claimed by a player -- at least not by default. It would be + OK to have a flag to do this someday when we are smart enough to + notice it. Would definitely be good to be smart enough to notice an + incorrect draw claim by an engine. [In 4.3 you can set the number of + moves or repeats after which draw is adjudicated] + + 487c. Another request: allow the operator to adjudicate engine/engine games. ++[Winboard_x provided menu items for this.] + + 488. Option to suppress tags popup on game load? This has been + requested a few times, and I received one partial implementation (not + enough to be useful). Needs to be on the options menu, etc. Note + conflict with 298 above. + + 488a. Also option to suppress comment popups. + + 489. Maybe have Zippy use xtell for tells to avoid redefining "." if + the operator is also doing tells. Do all ICSes support xtell, though? + + 490. Bruce Moreland request: a way to turn Zippy auto-accept on and + off dynamically. + + 491. Bruce Moreland request: a defined way to turn on/off PV (etc.) + kibitzing from the engine dynamically. I had thought it would be + better to make the GUI able to relay thinking output as kibitzing on + its own (and be able to turn this on/off dynamically), but Bruce + points out that what engine authors want to send as kibitzing output -usually includes more than the PV thinking output. ++usually includes more than the PV thinking output. [Note that engines ++can put whatever info they want in the PV field of the thinking ++output]. + + 492. One user reports that GNU Chess 5 crashes if you start a game, + play far enough to get GNU Chess out of book, select Reset, and play + e3 in the new game. This is probably a GNU Chess 5.00 bug, unrelated + to WinBoard. Can't reproduce on Linux; didn't try yet on Windows. + Need to see if 5.02 fixes it. + + 493. DAV suggests stripping off first arguments that are obviously + not the name of the engine when trying to parse out the engine name + from its command line -- things like nice, nohup, sh, csh, bash, etc. + Ugh, but I suppose it would be helpful sometimes. + + 494. Internationalization. A couple of people have done (or told me + they were doing) partial conversions of WinBoard to German or Spanish + by manually translating the messages. I think it would be much better + (but a big job) to use GNU gettext. I haven't looked into the details -of that at all. ++of that at all. [4.2.8 and 4.4 have gettext support.] + + 495. JamesBaud points out that FEN is not sufficient to correctly + represent a crazyhouse position (or bughouse, for that matter), + because it does not distinguish promoted pawns that will revert when + captured from real pieces. ICS style 12 also does not give us this + information. I really don't know what I could do about this -- take + the lead in proposing an extension to FEN and to style 12 with new + piece letters, I suppose. I don't really have time or motivation for + that. If you always use PGN, not FEN, to save Crazyhouse, that works -around the problem. [4.3 uses bFENs which fix this] ++around the problem. [4.3 uses bFENs which fix this, but not in ICS ++mode] + + **496. DAV sent some code to save a screen shot in xboard. Look at -merging this in. ++merging this in. [4.3 has an option to save the board display (but ++not the entire window) as bitmap.] + + **497. Igor Eged reports: I make a move on opponents time using + premove. Right in the time I am holding another piece in case of + unexpected check that I can have other possibility. But then the piece + hangs in the void and its invalid move, what means often loss in 1 0 + lightning. + + 498. It would be nice for Zippy to be able to play ICC wild 20 and 21 + (the types where loadgame is allowed). Presumably there would have to + be an option to either send the loadgame command with a specified + position, or to deal with an opponent sending it. I'm not sure how + this should work exactly, or how to prevent opponents from cheating in + various ways. + + 499. It would be nice for Zippy to be able to switch amongst several + different engines depending on which variant type is being played. + + 500. It would be nice if Zippy could have an option to accept + takebacks. Hmmm, also, the operator might want to manually offer a + takeback; it would be good if that worked. + + 501. People would like to be able to add more bot functionality to + Zippy without C programming. I don't have any ideas on how to do that. + + 502. One user requests the ability to have a game list file open for + more than one PGN file at a time. + + 503. We don't do protover 2 feature negotiation properly when + restarting an engine due to -xreuse mode. The timeout and done=0/1 + features don't work on the restart; instead we basically assume that + all the features will be the same as last time and that the engine + will be ready to accept commands immediately. This probably doesn't + cause a lot of problems, but if you try to replace the engine with one + that sets different features, the changes might not be noticed before + the first move, and the defaults will be the values from the old + engine, not the documented defaults. Also, if the engine takes time + to initialize and wants us to wait to send commands until it says + done=1, we fail to wait. However, we do send commands in the right + order and use ping, so most engines should work fine. + + 506. One user wants a board size even smaller than Tiny. + + 507. Suggested: have the cursor change to a gripping hand while moving + pieces. Currently in WinBoard it's always an arrow, while in xboard + it's always a hand with pointing finger while over the board and an + arrow elsewhere. + + 508. It would be nice to make -xclock work with -ics, just for + orthogonality, though it's not terribly useful. + + 509. It would be nice to make -clock work with -st. Perhaps each + player's clock should start with the specified time on each move and + count down until he moves. + + **510. A FICS service rep tells me that many users expect an autologin + feature in winboard (other than the non-user-friendly login.ini file). + Seems easy enough to add such a thing. + + 512. Some users dislike the clocks counting in tenths when below 10 + seconds, as it's distracting, and would like this to be configurable. + (From the Debian bug tracking system.) + + 513. Perhaps have Alt+P and Alt+C as synonyms for Pause in WinBoard, + since the P or C on the button makes it look like that should be the + shortcut. I suppose Alt+< and Alt+>, and the same with Shift for << + and >>, would also be a good idea. Oops, but Alt+C is already + CopyGame, so maybe this is a bad idea. + + 514. Gian-Carlo Pascutto reports: "when pasting a FEN/EPD position + into WinBoard, and selecting analysis mode, the engine analyses the + starting position instead of the pasted one. Re-pasting fixes this." + + 515. Troy Edwards suggests: "It would be nice to have the option to + 'wrap text' in the comment window." + + 516. DAV says: "FICS now supports the setting and the making clocks + tick using unpause/pause in examine mode. It seems either the clocks + don't tick or are not present when using xboard. Is it possible to + change the policy and base things upon the clock is paused flag in + style 12?" + + 517. Clarify in engine-intf.html that "sd" is an extra dumbing-down + feature, not a time control. Some text: + + In the protocol, the "sd" command isn't a time control. It doesn't + say that your engine has unlimited time but must search to exactly the + given depth. It says that you should pay attention to the time + control as normal, but cut off the search at the specified depth even + if you have time to search deeper. If you don't have time to search + to the specified depth, given your normal time management algorithm, + then you will want to stop sooner than the given depth. + + The "new" command should set the search depth back to unlimited. This + is already stated in the spec. The "level" command should not affect + the search depth. As it happens, xboard/WinBoard currently always + sends sd (if needed) right after level, but that isn't part of the -spec. ++spec. [Added to the specs that go with 4.4] + + 518. Warn in doc that -initString is a dangerous feature. Also move + doc of dalogs for sending commands directly to the engine out of the + protocol spec and into the man page and help file, but warn they are + dangerous too. + + 519. In engine-intf.html, change "st" description to not use the word + "exact", which is misleading. Make sure it says this is the maximum + time per move (and does not accumulate). + + 520. Check whether Alt+C (CopyGame) works in XP. One user says it + gives an error message. + + 522. engine-intf.html should really be rewritten to describe the + protocol as a state machine (on each end), with every command + precisely defined as to what it does in each state (including perhaps + being illegal). + + 523. Figure out what, if anything, to do with the FICS "iset singleboard". + I lean toward not bothering to set it, as it only disables functionality, + but maybe I'm confused. + + 524. theblob at Mon Mar 4, 23:23 PST 2002: it'd be nice in the xboard + interaction window if control-w and control-u respectively erased the + line and word, even in a Windows environment. At least, I think it'd + be nice. + + 525. Support a 64-bit node counter in analysis mode when compiled with + something that has 64-bit integer support. Both gcc and msvc++ have -this, though under different names. ++this, though under different names. [Done in 4.2.8 and 4.4] + + 526. "-initialMode analysis -lgf -" doesn't get the engine into + analysis mode properly. "-initialMode analyzeFile" is a workaround, + but bug should be fixed. + + 527. Clarify ICS.ini more in the doc, if possible. Some sample words: + > You should create this file in + > WinBoard's directory (usually C:\Program Files\WinBoard) using a plain + > text editor such as Notepad. Make sure that Notepad doesn't decide to + > call the file ICS.ini.txt for you -- you may have to select "All + > Files" instead of "Text Files" in the Notepad save dialog. + > + > The file is simply sent to the chess server, just as if you had typed it. + > So if your username is foo and password is bar, the file would look + > like what is between ==== below, without the ===='s: + > + > ==== + > foo + > bar + > iset movecase 1 + > ==== + + 528. Check on updates/revisions to PGN from Steven Edwards and others. + Any support needed? + + 529. Protover 3 needs a prefix character that says "this is debug + output" and prevents the GUI from parsing that line (say ";"). ++[4.3 uses '#' for this purpose, when the engine sets feature debug=1] + + 530. The undocumented (?) checking for rsh error messages tripped up + one engine author who had a "not found" in a message. Tighten this + up. + + 531. Do we always wait for pongs to catch up with pings before + starting the engine's clock? I suppose we should. + + 532. On FICS the clock does not start until after the first move has + been made. So perhaps we don't need the "not ready, try again soon" + response from Zippy there. What if Zippy is black, does black's clock + also not start until he makes his first move? + + 533. theblob at Mon Jun 24, 20:05 PDT 2002: here's a suggestion for + xboard -- give priority to fitting in amounts of material in the title + bar, and truncate names instead, e.g., use "tyrionsAp...(50) vs. woden + (51)" rather than "TyrionsApprentice (50) vs. woden..." -- it's much + more important to see the material than the full names, especially + when you're playing. + + 534. Steffen Jakob reports: "I use xboard 4.2.6. Yesterday I played + some bullet games at ICC. In one game I lost on time. In the last move + I already clicked on my queen and wanted it to move to its destination + square when I forfeited on time. After that my mouse pointer was the + queen piece. I couldnt drop it to any square." + + 535. For protover 3, the "st" command in the protocol could be + extended to allow for smaller units, not just seconds. + + 537. Clarify in the protocol that "force" while searching means you + should stop the search as soon as you can. (Isn't this clear + already?) + + 538. Need a way for the user to adjust the clocks. This is important + for WCCC and other computer competitions, where xboard/winboard's + clock is not the master. I was going to do it in time for the July -2002 WCCC. Oops. ++2002 WCCC. Oops. [4.3 allows adjusting the clocks by clicking them ++in 'edit game' mode, in steps of 1 minute] + + 541. Related to #327, John Iverson says, "It would be nice to have the + coordinates shown outside of the board along the edges, rather than in + the squares where they are hard to see and give a cluttered + appearance, especially on smaller board sizes. (The coordinates can + be handy in certain situations, such as posting a screenshot of xboard + showing an email game in progress, with the view flipped.)" + + 542. If you start xboard with the -geometry NxM option, it will + dutifully make the window exactly that size, but it doesn't choose a + -size option that fits into such a window size, so the board is cut + off or has a lot of whitespace around it. In fact, the layout is + generally messed up because the code doesn't expect the window to be + the wrong size for the layout. We should at least ignore the size + part of the -geometry option if we aren't going to do something + sensible with it. How is that done with Xt? + + 543. See the patches and extensions on + http://www.tim-mann.org/extensions.html#patches and integrate those + that are worthwhile into the main code base. (Some are also mentioned + elsewhere in this ToDo list.) They are pretty much all over 15 lines, + so copyright assignment from their authors is needed. Unfortunately + some of the authors may be hard to reach. + + 544. Possibly rework looking_at pattern matching to have a "match at + beginning of line" character (perhaps ^). It looks like this may + actually be useful after all. The historical cases where you could + get a board or other output that needs parsing on the same line as a + prompt *may* have been fixed. Confirming this would need testing on + all the ICSes that are in use. + + 546. Odd bug reported by travelGirl. The last line of a multi-line + macro from the ICS context menu sometimes "sticks" at the bottom of + the ICS interaction window. New text gets inserted before instead of + after it. This started when she upgraded to win2k. See mail. + + 548. Guido Flohr reports: + + Another "not really a bug" problem: When xboard forks in order to + start a second chess engine, it is only concerned about duplicating + the descriptors for the standard channels in the child. This is + very interesting for the second chess engine, since it inherits the + pipes to its opponent, and can use them for sending commands like + "sd 2", "easy", or even for feeding a bogus FEN string into the + first engine (exchanging the opponent's queen with a bishop looks + really attractive to me). A very interesting feature, but not exactly + what you intended? ;-) + + Closing the other descriptors after the fork will not completely + avoid the problem, since - at least under Solaris and Linux - it + is still possible to peek and write into xboard's open descriptors via the + /proc pseudo file system (unless you make xboard setuid root), but + leaving them open, makes this cheat very obvious. + + 549. "Ron" (no last name given) reports that when compiling WinBoard + under VC++ 6.0, there are many warnings. These ought to be looked at. + + 551. "Miguel" (no last name given) reports "When you make a premove in + Winboard 4.2.6, and then opponent move and premove is illegal, then + and you try to make a legal move but you cannot, because piece are + erased and you have to replace your move again, move twice... in + lightining this is annoying." I'm not really sure what that means or + if it is the same bug as 497. + + 552. Get rid of the need for proprietary tools to build WinBoard. + It's already possible to compile winboard.exe using the Cygwin + toolchain. You can even compile it with -mno-cygwin to avoid the need + for cygwin1.dll. However: + + 552a. The Help file needs Microsoft Word to edit the source file + winboard.rtf and the Microsoft Help Compiler to compile it into + winboard.hlp. I tried using OpenOffice.org on the RTF file, but the + result was missing some formatting that the help compiler needs. The + help compiler itself is a free-as-in-beer download, but it's still + proprietary software. Perhaps the help could be converted to vanilla + HTML, at the cost of losing the index and search capability. + + 552b. The WinBoard installer package is built with InstallShield. + Possible replacements: + Inno Setup (http://www.jrsoftware.org/isinfo.php) - looks best + NSIS (http://nsis.sourceforge.net/site/index.php) + Cygwin setup (http://www.cygwin.com) - a long shot + + 552c. Although the cygwin resource compiler works on winboard.rc, it's + a pain to create new dialogs by editing the text file. The original + ones were all created using the graphical dialog editor in MSVC 5. + ++553. It would be nice for xboard's ICS Input box to have a history ++feature similar to WinBoard's ICS Interaction window. Actually it ++would be nice for xboard to have its own ICS Interaction window with ++all the bells and whistles that WinBoard's has instead of limping ++along using an xterm for interaction. ++ ++**554. Port evaluation-graph window to XBoard. ++ ++555. Split x/wengineoutput.c in a front-end and common backend file. ++ ++556. Fix -stickyWindows option under XP and Vista, and port to XBoard. ++ ++557. Port display of engine logos to XBoard. ++ ++558. Device a smart way for -autoLogo to select logos in other modes ++than Two Machines. ++ ++ ++ + * * * + + Before each release: + - make sure both xboard and winboard build and are up to date with each other + - run zippy with new version as a shakedown + - be sure gnu5 binary is up to date in winboard, and gnu5 patch (if needed) + is included in both xboard and winboard kits + - recheck cygwin compiling winboard + - make sure ChangeLog is complete + - test changes + + *** up to date with mail received through 5 Nov 2003, except + for the "protover 3" discussions on the chess-engines mailing list *** diff --cc aclocal.m4 index 8898216,eb3b99a..eb3b99a mode 100755,100644..100755 --- a/aclocal.m4 +++ b/aclocal.m4 diff --cc backend.c index 84937ae,25ee4c0..b8cfa92 --- a/backend.c +++ b/backend.c @@@ -1,10051 -1,13638 +1,13720 @@@ - /* - * backend.c -- Common back end for X and Windows NT versions of - * XBoard $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - * - * See the file ChangeLog for a revision history. */ - - #include "config.h" - - #include - #include - #include - #include - #include - #include - - #if STDC_HEADERS - # include - # include - #else /* not STDC_HEADERS */ - # if HAVE_STRING_H - # include - # else /* not HAVE_STRING_H */ - # include - # endif /* not HAVE_STRING_H */ - #endif /* not STDC_HEADERS */ - - #if HAVE_SYS_FCNTL_H - # include - #else /* not HAVE_SYS_FCNTL_H */ - # if HAVE_FCNTL_H - # include - # endif /* HAVE_FCNTL_H */ - #endif /* not HAVE_SYS_FCNTL_H */ - - #if TIME_WITH_SYS_TIME - # include - # include - #else - # if HAVE_SYS_TIME_H - # include - # else - # include - # endif - #endif - - #if defined(_amigados) && !defined(__GNUC__) - struct timezone { - int tz_minuteswest; - int tz_dsttime; - }; - extern int gettimeofday(struct timeval *, struct timezone *); - #endif - - #if HAVE_UNISTD_H - # include - #endif - - #include "common.h" - #include "frontend.h" - #include "backend.h" - #include "parser.h" - #include "moves.h" - #if ZIPPY - # include "zippy.h" - #endif - #include "backendz.h" - #include "gettext.h" - - #ifdef ENABLE_NLS - # define _(s) gettext (s) - # define N_(s) gettext_noop (s) - #else - # define _(s) (s) - # define N_(s) s - #endif - - - /* A point in time */ - typedef struct { - long sec; /* Assuming this is >= 32 bits */ - int ms; /* Assuming this is >= 16 bits */ - } TimeMark; - - /* Search stats from chessprogram */ - typedef struct { - char movelist[2*MSG_SIZ]; /* Last PV we were sent */ - int depth; /* Current search depth */ - int nr_moves; /* Total nr of root moves */ - int moves_left; /* Moves remaining to be searched */ - char move_name[MOVE_LEN]; /* Current move being searched, if provided */ - u64 nodes; /* # of nodes searched */ - int time; /* Search time (centiseconds) */ - int score; /* Score (centipawns) */ - int got_only_move; /* If last msg was "(only move)" */ - int got_fail; /* 0 - nothing, 1 - got "--", 2 - got "++" */ - int ok_to_send; /* handshaking between send & recv */ - int line_is_book; /* 1 if movelist is book moves */ - int seen_stat; /* 1 if we've seen the stat01: line */ - } ChessProgramStats; - - int establish P((void)); - void read_from_player P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); - void read_from_ics P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); - void SendToICS P((char *s)); - void SendToICSDelayed P((char *s, long msdelay)); - void SendMoveToICS P((ChessMove moveType, int fromX, int fromY, - int toX, int toY)); - void InitPosition P((int redraw)); - void HandleMachineMove P((char *message, ChessProgramState *cps)); - int AutoPlayOneMove P((void)); - int LoadGameOneMove P((ChessMove readAhead)); - int LoadGameFromFile P((char *filename, int n, char *title, int useList)); - int LoadPositionFromFile P((char *filename, int n, char *title)); - int SavePositionToFile P((char *filename)); - void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, - Board board)); - void MakeMove P((int fromX, int fromY, int toX, int toY, int promoChar)); - void ShowMove P((int fromX, int fromY, int toX, int toY)); - void FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, - /*char*/int promoChar)); - void BackwardInner P((int target)); - void ForwardInner P((int target)); - void GameEnds P((ChessMove result, char *resultDetails, int whosays)); - void EditPositionDone P((void)); - void PrintOpponents P((FILE *fp)); - void PrintPosition P((FILE *fp, int move)); - void StartChessProgram P((ChessProgramState *cps)); - void SendToProgram P((char *message, ChessProgramState *cps)); - void SendMoveToProgram P((int moveNum, ChessProgramState *cps)); - void ReceiveFromProgram P((InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error)); - void SendTimeControl P((ChessProgramState *cps, - int mps, long tc, int inc, int sd, int st)); - char *TimeControlTagValue P((void)); - void Attention P((ChessProgramState *cps)); - void FeedMovesToProgram P((ChessProgramState *cps, int upto)); - void ResurrectChessProgram P((void)); - void DisplayComment P((int moveNumber, char *text)); - void DisplayMove P((int moveNumber)); - void DisplayAnalysis P((void)); - - void ParseGameHistory P((char *game)); - void ParseBoard12 P((char *string)); - void StartClocks P((void)); - void SwitchClocks P((void)); - void StopClocks P((void)); - void ResetClocks P((void)); - char *PGNDate P((void)); - void SetGameInfo P((void)); - Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen)); - int RegisterMove P((void)); - void MakeRegisteredMove P((void)); - void TruncateGame P((void)); - int looking_at P((char *, int *, char *)); - void CopyPlayerNameIntoFileName P((char **, char *)); - char *SavePart P((char *)); - int SaveGameOldStyle P((FILE *)); - int SaveGamePGN P((FILE *)); - void GetTimeMark P((TimeMark *)); - long SubtractTimeMarks P((TimeMark *, TimeMark *)); - int CheckFlags P((void)); - long NextTickLength P((long)); - void CheckTimeControl P((void)); - void show_bytes P((FILE *, char *, int)); - int string_to_rating P((char *str)); - void ParseFeatures P((char* args, ChessProgramState *cps)); - void InitBackEnd3 P((void)); - void FeatureDone P((ChessProgramState* cps, int val)); - void InitChessProgram P((ChessProgramState *cps)); - double u64ToDouble P((u64 value)); - - #ifdef WIN32 - extern void ConsoleCreate(); - #endif - - extern int tinyLayout, smallLayout; - static ChessProgramStats programStats; - - /* States for ics_getting_history */ - #define H_FALSE 0 - #define H_REQUESTED 1 - #define H_GOT_REQ_HEADER 2 - #define H_GOT_UNREQ_HEADER 3 - #define H_GETTING_MOVES 4 - #define H_GOT_UNWANTED_HEADER 5 - - /* whosays values for GameEnds */ - #define GE_ICS 0 - #define GE_ENGINE 1 - #define GE_PLAYER 2 - #define GE_FILE 3 - #define GE_XBOARD 4 - - /* Maximum number of games in a cmail message */ - #define CMAIL_MAX_GAMES 20 - - /* Different types of move when calling RegisterMove */ - #define CMAIL_MOVE 0 - #define CMAIL_RESIGN 1 - #define CMAIL_DRAW 2 - #define CMAIL_ACCEPT 3 - - /* Different types of result to remember for each game */ - #define CMAIL_NOT_RESULT 0 - #define CMAIL_OLD_RESULT 1 - #define CMAIL_NEW_RESULT 2 - - /* Telnet protocol constants */ - #define TN_WILL 0373 - #define TN_WONT 0374 - #define TN_DO 0375 - #define TN_DONT 0376 - #define TN_IAC 0377 - #define TN_ECHO 0001 - #define TN_SGA 0003 - #define TN_PORT 23 - - /* Some compiler can't cast u64 to double - * This function do the job for us: - - * We use the highest bit for cast, this only - * works if the highest bit is not - * in use (This should not happen) - * - * We used this for all compiler - */ - double - u64ToDouble(u64 value) - { - double r; - u64 tmp = value & u64Const(0x7fffffffffffffff); - r = (double)(s64)tmp; - if (value & u64Const(0x8000000000000000)) - r += 9.2233720368547758080e18; /* 2^63 */ - return r; - } - - /* Fake up flags for now, as we aren't keeping track of castling - availability yet */ - int - PosFlags(index) - { - int flags = F_ALL_CASTLE_OK; - if ((index % 2) == 0) flags |= F_WHITE_ON_MOVE; - switch (gameInfo.variant) { - case VariantSuicide: - case VariantGiveaway: - flags |= F_IGNORE_CHECK; - flags &= ~F_ALL_CASTLE_OK; - break; - case VariantAtomic: - flags |= F_IGNORE_CHECK | F_ATOMIC_CAPTURE; - break; - case VariantKriegspiel: - flags |= F_KRIEGSPIEL_CAPTURE; - break; - case VariantNoCastle: - flags &= ~F_ALL_CASTLE_OK; - break; - default: - break; - } - return flags; - } - - FILE *gameFileFP, *debugFP; - - char cmailMove[CMAIL_MAX_GAMES][MOVE_LEN], cmailMsg[MSG_SIZ]; - char bookOutput[MSG_SIZ*10], thinkOutput[MSG_SIZ*10], lastHint[MSG_SIZ]; - char thinkOutput1[MSG_SIZ*10]; - - ChessProgramState first, second; - - /* premove variables */ - int premoveToX = 0; - int premoveToY = 0; - int premoveFromX = 0; - int premoveFromY = 0; - int premovePromoChar = 0; - int gotPremove = 0; - Boolean alarmSounded; - /* end premove variables */ - - char *ics_prefix = "$"; - int ics_type = ICS_GENERIC; - - int currentMove = 0, forwardMostMove = 0, backwardMostMove = 0; - int pauseExamForwardMostMove = 0; - int nCmailGames = 0, nCmailResults = 0, nCmailMovesRegistered = 0; - int cmailMoveRegistered[CMAIL_MAX_GAMES], cmailResult[CMAIL_MAX_GAMES]; - int cmailMsgLoaded = FALSE, cmailMailedMove = FALSE; - int cmailOldMove = -1, firstMove = TRUE, flipView = FALSE; - int blackPlaysFirst = FALSE, startedFromSetupPosition = FALSE; - int searchTime = 0, pausing = FALSE, pauseExamInvalid = FALSE; - int whiteFlag = FALSE, blackFlag = FALSE; - int userOfferedDraw = FALSE; - int ics_user_moved = 0, ics_gamenum = -1, ics_getting_history = H_FALSE; - int matchMode = FALSE, hintRequested = FALSE, bookRequested = FALSE; - int cmailMoveType[CMAIL_MAX_GAMES]; - long ics_clock_paused = 0; - ProcRef icsPR = NoProc, cmailPR = NoProc; - InputSourceRef telnetISR = NULL, fromUserISR = NULL, cmailISR = NULL; - GameMode gameMode = BeginningOfGame; - char moveList[MAX_MOVES][MOVE_LEN], parseList[MAX_MOVES][MOVE_LEN * 2]; - char *commentList[MAX_MOVES], *cmailCommentList[CMAIL_MAX_GAMES]; - char white_holding[64], black_holding[64]; - TimeMark lastNodeCountTime; - long lastNodeCount=0; - int have_sent_ICS_logon = 0; - int movesPerSession; - long whiteTimeRemaining, blackTimeRemaining, timeControl, timeIncrement; - long timeRemaining[2][MAX_MOVES]; - int matchGame = 0; - TimeMark programStartTime; - char ics_handle[MSG_SIZ]; - int have_set_title = 0; - - /* animateTraining preserves the state of appData.animate - * when Training mode is activated. This allows the - * response to be animated when appData.animate == TRUE and - * appData.animateDragging == TRUE. - */ - Boolean animateTraining; - - GameInfo gameInfo; - - AppData appData; - - Board boards[MAX_MOVES]; - Board initialPosition = { - { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, - WhiteKing, WhiteBishop, WhiteKnight, WhiteRook }, - { WhitePawn, WhitePawn, WhitePawn, WhitePawn, - WhitePawn, WhitePawn, WhitePawn, WhitePawn }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { BlackPawn, BlackPawn, BlackPawn, BlackPawn, - BlackPawn, BlackPawn, BlackPawn, BlackPawn }, - { BlackRook, BlackKnight, BlackBishop, BlackQueen, - BlackKing, BlackBishop, BlackKnight, BlackRook } - }; - Board twoKingsPosition = { - { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, - WhiteKing, WhiteKing, WhiteKnight, WhiteRook }, - { WhitePawn, WhitePawn, WhitePawn, WhitePawn, - WhitePawn, WhitePawn, WhitePawn, WhitePawn }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { EmptySquare, EmptySquare, EmptySquare, EmptySquare, - EmptySquare, EmptySquare, EmptySquare, EmptySquare }, - { BlackPawn, BlackPawn, BlackPawn, BlackPawn, - BlackPawn, BlackPawn, BlackPawn, BlackPawn }, - { BlackRook, BlackKnight, BlackBishop, BlackQueen, - BlackKing, BlackKing, BlackKnight, BlackRook } - }; - - - /* Convert str to a rating. Checks for special cases of "----", - "++++", etc. Also strips ()'s */ - int - string_to_rating(str) - char *str; - { - while(*str && !isdigit(*str)) ++str; - if (!*str) - return 0; /* One of the special "no rating" cases */ - else - return atoi(str); - } - - void - ClearProgramStats() - { - /* Init programStats */ - programStats.movelist[0] = 0; - programStats.depth = 0; - programStats.nr_moves = 0; - programStats.moves_left = 0; - programStats.nodes = 0; - programStats.time = 100; - programStats.score = 0; - programStats.got_only_move = 0; - programStats.got_fail = 0; - programStats.line_is_book = 0; - } - - void - InitBackEnd1() - { - int matched, min, sec; - - GetTimeMark(&programStartTime); - - ClearProgramStats(); - programStats.ok_to_send = 1; - programStats.seen_stat = 0; - - /* - * Initialize game list - */ - ListNew(&gameList); - - - /* - * Internet chess server status - */ - if (appData.icsActive) { - appData.matchMode = FALSE; - appData.matchGames = 0; - #if ZIPPY - appData.noChessProgram = !appData.zippyPlay; - #else - appData.zippyPlay = FALSE; - appData.zippyTalk = FALSE; - appData.noChessProgram = TRUE; - #endif - if (*appData.icsHelper != NULLCHAR) { - appData.useTelnet = TRUE; - appData.telnetProgram = appData.icsHelper; - } - } else { - appData.zippyTalk = appData.zippyPlay = FALSE; - } - - /* - * Parse timeControl resource - */ - if (!ParseTimeControl(appData.timeControl, appData.timeIncrement, - appData.movesPerSession)) { - char buf[MSG_SIZ]; - sprintf(buf, _("bad timeControl option %s"), appData.timeControl); - DisplayFatalError(buf, 0, 2); - } - - /* - * Parse searchTime resource - */ - if (*appData.searchTime != NULLCHAR) { - matched = sscanf(appData.searchTime, "%d:%d", &min, &sec); - if (matched == 1) { - searchTime = min * 60; - } else if (matched == 2) { - searchTime = min * 60 + sec; - } else { - char buf[MSG_SIZ]; - sprintf(buf, _("bad searchTime option %s"), appData.searchTime); - DisplayFatalError(buf, 0, 2); - } - } - - first.which = "first"; - second.which = "second"; - first.maybeThinking = second.maybeThinking = FALSE; - first.pr = second.pr = NoProc; - first.isr = second.isr = NULL; - first.sendTime = second.sendTime = 2; - first.sendDrawOffers = 1; - if (appData.firstPlaysBlack) { - first.twoMachinesColor = "black\n"; - second.twoMachinesColor = "white\n"; - } else { - first.twoMachinesColor = "white\n"; - second.twoMachinesColor = "black\n"; - } - first.program = appData.firstChessProgram; - second.program = appData.secondChessProgram; - first.host = appData.firstHost; - second.host = appData.secondHost; - first.dir = appData.firstDirectory; - second.dir = appData.secondDirectory; - first.other = &second; - second.other = &first; - first.initString = appData.initString; - second.initString = appData.secondInitString; - first.computerString = appData.firstComputerString; - second.computerString = appData.secondComputerString; - first.useSigint = second.useSigint = TRUE; - first.useSigterm = second.useSigterm = TRUE; - first.reuse = appData.reuseFirst; - second.reuse = appData.reuseSecond; - first.useSetboard = second.useSetboard = FALSE; - first.useSAN = second.useSAN = FALSE; - first.usePing = second.usePing = FALSE; - first.lastPing = second.lastPing = 0; - first.lastPong = second.lastPong = 0; - first.usePlayother = second.usePlayother = FALSE; - first.useColors = second.useColors = TRUE; - first.useUsermove = second.useUsermove = FALSE; - first.sendICS = second.sendICS = FALSE; - first.sendName = second.sendName = appData.icsActive; - first.sdKludge = second.sdKludge = FALSE; - first.stKludge = second.stKludge = FALSE; - TidyProgramName(first.program, first.host, first.tidy); - TidyProgramName(second.program, second.host, second.tidy); - first.matchWins = second.matchWins = 0; - strcpy(first.variants, appData.variant); - strcpy(second.variants, appData.variant); - first.analysisSupport = second.analysisSupport = 2; /* detect */ - first.analyzing = second.analyzing = FALSE; - first.initDone = second.initDone = FALSE; - - if (appData.firstProtocolVersion > PROTOVER || - appData.firstProtocolVersion < 1) { - char buf[MSG_SIZ]; - sprintf(buf, _("protocol version %d not supported"), - appData.firstProtocolVersion); - DisplayFatalError(buf, 0, 2); - } else { - first.protocolVersion = appData.firstProtocolVersion; - } - - if (appData.secondProtocolVersion > PROTOVER || - appData.secondProtocolVersion < 1) { - char buf[MSG_SIZ]; - sprintf(buf, _("protocol version %d not supported"), - appData.secondProtocolVersion); - DisplayFatalError(buf, 0, 2); - } else { - second.protocolVersion = appData.secondProtocolVersion; - } - - if (appData.icsActive) { - appData.clockMode = TRUE; /* changes dynamically in ICS mode */ - } else if (*appData.searchTime != NULLCHAR || appData.noChessProgram) { - appData.clockMode = FALSE; - first.sendTime = second.sendTime = 0; - } - - #if ZIPPY - /* Override some settings from environment variables, for backward - compatibility. Unfortunately it's not feasible to have the env - vars just set defaults, at least in xboard. Ugh. - */ - if (appData.icsActive && (appData.zippyPlay || appData.zippyTalk)) { - ZippyInit(); - } - #endif - - if (appData.noChessProgram) { - programVersion = (char*) malloc(5 + strlen(PRODUCT) + strlen(VERSION) - + strlen(PATCHLEVEL)); - sprintf(programVersion, "%s %s.%s", PRODUCT, VERSION, PATCHLEVEL); - } else { - char *p, *q; - q = first.program; - while (*q != ' ' && *q != NULLCHAR) q++; - p = q; - while (p > first.program && *(p-1) != '/') p--; - programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) - + strlen(PATCHLEVEL) + (q - p)); - sprintf(programVersion, "%s %s.%s + ", PRODUCT, VERSION, PATCHLEVEL); - strncat(programVersion, p, q - p); - } - - if (!appData.icsActive) { - char buf[MSG_SIZ]; - /* Check for variants that are supported only in ICS mode, - or not at all. Some that are accepted here nevertheless - have bugs; see comments below. - */ - VariantClass variant = StringToVariant(appData.variant); - switch (variant) { - case VariantBughouse: /* need four players and two boards */ - case VariantKriegspiel: /* need to hide pieces and move details */ - case VariantFischeRandom: /* castling doesn't work, shuffle not done */ - sprintf(buf, _("Variant %s supported only in ICS mode"), appData.variant); - DisplayFatalError(buf, 0, 2); - return; - - case VariantUnknown: - case VariantLoadable: - case Variant29: - case Variant30: - case Variant31: - case Variant32: - case Variant33: - case Variant34: - case Variant35: - case Variant36: - default: - sprintf(buf, _("Unknown variant name %s"), appData.variant); - DisplayFatalError(buf, 0, 2); - return; - - case VariantNormal: /* definitely works! */ - case VariantWildCastle: /* pieces not automatically shuffled */ - case VariantNoCastle: /* pieces not automatically shuffled */ - case VariantCrazyhouse: /* holdings not shown, - offboard interposition not understood */ - case VariantLosers: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantSuicide: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantGiveaway: /* should work except for win condition, - and doesn't know captures are mandatory */ - case VariantTwoKings: /* should work */ - case VariantAtomic: /* should work except for win condition */ - case Variant3Check: /* should work except for win condition */ - case VariantShatranj: /* might work if TestLegality is off */ - break; - } - } - } - - int - ParseTimeControl(tc, ti, mps) - char *tc; - int ti; - int mps; - { - int matched, min, sec; - - matched = sscanf(tc, "%d:%d", &min, &sec); - if (matched == 1) { - timeControl = min * 60 * 1000; - } else if (matched == 2) { - timeControl = (min * 60 + sec) * 1000; - } else { - return FALSE; - } - - if (ti >= 0) { - timeIncrement = ti * 1000; /* convert to ms */ - movesPerSession = 0; - } else { - timeIncrement = 0; - movesPerSession = mps; - } - return TRUE; - } - - void - InitBackEnd2() - { - if (appData.debugMode) { - fprintf(debugFP, "%s\n", programVersion); - } - - if (appData.matchGames > 0) { - appData.matchMode = TRUE; - } else if (appData.matchMode) { - appData.matchGames = 1; - } - Reset(TRUE, FALSE); - if (appData.noChessProgram || first.protocolVersion == 1) { - InitBackEnd3(); - } else { - /* kludge: allow timeout for initial "feature" commands */ - FreezeUI(); - DisplayMessage("", "Starting chess program"); - ScheduleDelayedEvent(InitBackEnd3, FEATURE_TIMEOUT); - } - } - - void - InitBackEnd3 P((void)) - { - GameMode initialMode; - char buf[MSG_SIZ]; - int err; - - InitChessProgram(&first); - - #ifdef WIN32 - /* Make a console window if needed */ - if (appData.icsActive) ConsoleCreate(); - #endif - - if (appData.icsActive) { - err = establish(); - if (err != 0) { - if (*appData.icsCommPort != NULLCHAR) { - sprintf(buf, _("Could not open comm port %s"), - appData.icsCommPort); - } else { - sprintf(buf, _("Could not connect to host %s, port %s"), - appData.icsHost, appData.icsPort); - } - DisplayFatalError(buf, err, 1); - return; - } - SetICSMode(); - telnetISR = - AddInputSource(icsPR, FALSE, read_from_ics, &telnetISR); - fromUserISR = - AddInputSource(NoProc, FALSE, read_from_player, &fromUserISR); - } else if (appData.noChessProgram) { - SetNCPMode(); - } else { - SetGNUMode(); - } - - if (*appData.cmailGameName != NULLCHAR) { - SetCmailMode(); - OpenLoopback(&cmailPR); - cmailISR = - AddInputSource(cmailPR, FALSE, CmailSigHandlerCallBack, &cmailISR); - } - - ThawUI(); - DisplayMessage("", ""); - if (StrCaseCmp(appData.initialMode, "") == 0) { - initialMode = BeginningOfGame; - } else if (StrCaseCmp(appData.initialMode, "TwoMachines") == 0) { - initialMode = TwoMachinesPlay; - } else if (StrCaseCmp(appData.initialMode, "AnalyzeFile") == 0) { - initialMode = AnalyzeFile; - } else if (StrCaseCmp(appData.initialMode, "Analysis") == 0) { - initialMode = AnalyzeMode; - } else if (StrCaseCmp(appData.initialMode, "MachineWhite") == 0) { - initialMode = MachinePlaysWhite; - } else if (StrCaseCmp(appData.initialMode, "MachineBlack") == 0) { - initialMode = MachinePlaysBlack; - } else if (StrCaseCmp(appData.initialMode, "EditGame") == 0) { - initialMode = EditGame; - } else if (StrCaseCmp(appData.initialMode, "EditPosition") == 0) { - initialMode = EditPosition; - } else if (StrCaseCmp(appData.initialMode, "Training") == 0) { - initialMode = Training; - } else { - sprintf(buf, _("Unknown initialMode %s"), appData.initialMode); - DisplayFatalError(buf, 0, 2); - return; - } - - if (appData.matchMode) { - /* Set up machine vs. machine match */ - if (appData.noChessProgram) { - DisplayFatalError(_("Can't have a match with no chess programs"), - 0, 2); - return; - } - matchMode = TRUE; - matchGame = 1; - if (*appData.loadGameFile != NULLCHAR) { - if (!LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, - appData.loadGameFile, FALSE)) { - DisplayFatalError(_("Bad game file"), 0, 1); - return; - } - } else if (*appData.loadPositionFile != NULLCHAR) { - if (!LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, - appData.loadPositionFile)) { - DisplayFatalError(_("Bad position file"), 0, 1); - return; - } - } - TwoMachinesEvent(); - } else if (*appData.cmailGameName != NULLCHAR) { - /* Set up cmail mode */ - ReloadCmailMsgEvent(TRUE); - } else { - /* Set up other modes */ - if (initialMode == AnalyzeFile) { - if (*appData.loadGameFile == NULLCHAR) { - DisplayFatalError(_("AnalyzeFile mode requires a game file"), 0, 1); - return; - } - } - if (*appData.loadGameFile != NULLCHAR) { - (void) LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, - appData.loadGameFile, TRUE); - } else if (*appData.loadPositionFile != NULLCHAR) { - (void) LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, - appData.loadPositionFile); - } - if (initialMode == AnalyzeMode) { - if (appData.noChessProgram) { - DisplayFatalError(_("Analysis mode requires a chess engine"), 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("Analysis mode does not work with ICS mode"),0,2); - return; - } - AnalyzeModeEvent(); - } else if (initialMode == AnalyzeFile) { - ShowThinkingEvent(TRUE); - AnalyzeFileEvent(); - AnalysisPeriodicEvent(1); - } else if (initialMode == MachinePlaysWhite) { - if (appData.noChessProgram) { - DisplayFatalError(_("MachineWhite mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("MachineWhite mode does not work with ICS mode"), - 0, 2); - return; - } - MachineWhiteEvent(); - } else if (initialMode == MachinePlaysBlack) { - if (appData.noChessProgram) { - DisplayFatalError(_("MachineBlack mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("MachineBlack mode does not work with ICS mode"), - 0, 2); - return; - } - MachineBlackEvent(); - } else if (initialMode == TwoMachinesPlay) { - if (appData.noChessProgram) { - DisplayFatalError(_("TwoMachines mode requires a chess engine"), - 0, 2); - return; - } - if (appData.icsActive) { - DisplayFatalError(_("TwoMachines mode does not work with ICS mode"), - 0, 2); - return; - } - TwoMachinesEvent(); - } else if (initialMode == EditGame) { - EditGameEvent(); - } else if (initialMode == EditPosition) { - EditPositionEvent(); - } else if (initialMode == Training) { - if (*appData.loadGameFile == NULLCHAR) { - DisplayFatalError(_("Training mode requires a game file"), 0, 2); - return; - } - TrainingEvent(); - } - } - } - - /* - * Establish will establish a contact to a remote host.port. - * Sets icsPR to a ProcRef for a process (or pseudo-process) - * used to talk to the host. - * Returns 0 if okay, error code if not. - */ - int - establish() - { - char buf[MSG_SIZ]; - - if (*appData.icsCommPort != NULLCHAR) { - /* Talk to the host through a serial comm port */ - return OpenCommPort(appData.icsCommPort, &icsPR); - - } else if (*appData.gateway != NULLCHAR) { - if (*appData.remoteShell == NULLCHAR) { - /* Use the rcmd protocol to run telnet program on a gateway host */ - sprintf(buf, "%s %s %s", - appData.telnetProgram, appData.icsHost, appData.icsPort); - return OpenRcmd(appData.gateway, appData.remoteUser, buf, &icsPR); - - } else { - /* Use the rsh program to run telnet program on a gateway host */ - if (*appData.remoteUser == NULLCHAR) { - sprintf(buf, "%s %s %s %s %s", appData.remoteShell, - appData.gateway, appData.telnetProgram, - appData.icsHost, appData.icsPort); - } else { - sprintf(buf, "%s %s -l %s %s %s %s", - appData.remoteShell, appData.gateway, - appData.remoteUser, appData.telnetProgram, - appData.icsHost, appData.icsPort); - } - return StartChildProcess(buf, "", &icsPR); - - } - } else if (appData.useTelnet) { - return OpenTelnet(appData.icsHost, appData.icsPort, &icsPR); - - } else { - /* TCP socket interface differs somewhat between - Unix and NT; handle details in the front end. - */ - return OpenTCP(appData.icsHost, appData.icsPort, &icsPR); - } - } - - void - show_bytes(fp, buf, count) - FILE *fp; - char *buf; - int count; - { - while (count--) { - if (*buf < 040 || *(unsigned char *) buf > 0177) { - fprintf(fp, "\\%03o", *buf & 0xff); - } else { - putc(*buf, fp); - } - buf++; - } - fflush(fp); - } - - /* Returns an errno value */ - int - OutputMaybeTelnet(pr, message, count, outError) - ProcRef pr; - char *message; - int count; - int *outError; - { - char buf[8192], *p, *q, *buflim; - int left, newcount, outcount; - - if (*appData.icsCommPort != NULLCHAR || appData.useTelnet || - *appData.gateway != NULLCHAR) { - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, message, count); - fprintf(debugFP, "\n"); - } - return OutputToProcess(pr, message, count, outError); - } - - buflim = &buf[sizeof(buf)-1]; /* allow 1 byte for expanding last char */ - p = message; - q = buf; - left = count; - newcount = 0; - while (left) { - if (q >= buflim) { - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, buf, newcount); - fprintf(debugFP, "\n"); - } - outcount = OutputToProcess(pr, buf, newcount, outError); - if (outcount < newcount) return -1; /* to be sure */ - q = buf; - newcount = 0; - } - if (*p == '\n') { - *q++ = '\r'; - newcount++; - } else if (((unsigned char) *p) == TN_IAC) { - *q++ = (char) TN_IAC; - newcount ++; - } - *q++ = *p++; - newcount++; - left--; - } - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, buf, newcount); - fprintf(debugFP, "\n"); - } - outcount = OutputToProcess(pr, buf, newcount, outError); - if (outcount < newcount) return -1; /* to be sure */ - return count; - } - - void - read_from_player(isr, closure, message, count, error) - InputSourceRef isr; - VOIDSTAR closure; - char *message; - int count; - int error; - { - int outError, outCount; - static int gotEof = 0; - - /* Pass data read from player on to ICS */ - if (count > 0) { - gotEof = 0; - outCount = OutputMaybeTelnet(icsPR, message, count, &outError); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } - } else if (count < 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Error reading from keyboard"), error, 1); - } else if (gotEof++ > 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Got end of file from keyboard"), 0, 0); - } - } - - void - SendToICS(s) - char *s; - { - int count, outCount, outError; - - if (icsPR == NULL) return; - - count = strlen(s); - outCount = OutputMaybeTelnet(icsPR, s, count, &outError); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } - } - - /* This is used for sending logon scripts to the ICS. Sending - without a delay causes problems when using timestamp on ICC - (at least on my machine). */ - void - SendToICSDelayed(s,msdelay) - char *s; - long msdelay; - { - int count, outCount, outError; - - if (icsPR == NULL) return; - - count = strlen(s); - if (appData.debugMode) { - fprintf(debugFP, ">ICS: "); - show_bytes(debugFP, s, count); - fprintf(debugFP, "\n"); - } - outCount = OutputToProcessDelayed(icsPR, s, count, &outError, - msdelay); - if (outCount < count) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } - } - - - /* Remove all highlighting escape sequences in s - Also deletes any suffix starting with '(' - */ - char * - StripHighlightAndTitle(s) - char *s; - { - static char retbuf[MSG_SIZ]; - char *p = retbuf; - - while (*s != NULLCHAR) { - while (*s == '\033') { - while (*s != NULLCHAR && !isalpha(*s)) s++; - if (*s != NULLCHAR) s++; - } - while (*s != NULLCHAR && *s != '\033') { - if (*s == '(' || *s == '[') { - *p = NULLCHAR; - return retbuf; - } - *p++ = *s++; - } - } - *p = NULLCHAR; - return retbuf; - } - - /* Remove all highlighting escape sequences in s */ - char * - StripHighlight(s) - char *s; - { - static char retbuf[MSG_SIZ]; - char *p = retbuf; - - while (*s != NULLCHAR) { - while (*s == '\033') { - while (*s != NULLCHAR && !isalpha(*s)) s++; - if (*s != NULLCHAR) s++; - } - while (*s != NULLCHAR && *s != '\033') { - *p++ = *s++; - } - } - *p = NULLCHAR; - return retbuf; - } - - char *variantNames[] = VARIANT_NAMES; - char * - VariantName(v) - VariantClass v; - { - return variantNames[v]; - } - - - /* Identify a variant from the strings the chess servers use or the - PGN Variant tag names we use. */ - VariantClass - StringToVariant(e) - char *e; - { - char *p; - int wnum = -1; - VariantClass v = VariantNormal; - int i, found = FALSE; - char buf[MSG_SIZ]; - - if (!e) return v; - - for (i=0; i%s %s ", ddwwStr, optionStr); - } - msg[0] = TN_IAC; - msg[1] = ddww; - msg[2] = option; - outCount = OutputToProcess(icsPR, (char *)msg, 3, &outError); - if (outCount < 3) { - DisplayFatalError(_("Error writing to ICS"), outError, 1); - } - } - - void - DoEcho() - { - if (!appData.icsActive) return; - TelnetRequest(TN_DO, TN_ECHO); - } - - void - DontEcho() - { - if (!appData.icsActive) return; - TelnetRequest(TN_DONT, TN_ECHO); - } - - static int loggedOn = FALSE; - - /*-- Game start info cache: --*/ - int gs_gamenum; - char gs_kind[MSG_SIZ]; - static char player1Name[128] = ""; - static char player2Name[128] = ""; - static int player1Rating = -1; - static int player2Rating = -1; - /*----------------------------*/ - - void - read_from_ics(isr, closure, data, count, error) - InputSourceRef isr; - VOIDSTAR closure; - char *data; - int count; - int error; - { - #define BUF_SIZE 8192 - #define STARTED_NONE 0 - #define STARTED_MOVES 1 - #define STARTED_BOARD 2 - #define STARTED_OBSERVE 3 - #define STARTED_HOLDINGS 4 - #define STARTED_CHATTER 5 - #define STARTED_COMMENT 6 - #define STARTED_MOVES_NOHIDE 7 - - static int started = STARTED_NONE; - static char parse[20000]; - static int parse_pos = 0; - static char buf[BUF_SIZE + 1]; - static int firstTime = TRUE, intfSet = FALSE; - static ColorClass curColor = ColorNormal; - static ColorClass prevColor = ColorNormal; - static int savingComment = FALSE; - char str[500]; - int i, oldi; - int buf_len; - int next_out; - int tkind; - int backup; - char *p; - - if (appData.debugMode) { - if (!error) { - fprintf(debugFP, " 0) { - /* If last read ended with a partial line that we couldn't parse, - prepend it to the new read and try again. */ - if (leftover_len > 0) { - for (i=0; i= 3 && (unsigned char) buf[i] == TN_IAC) { - static int remoteEchoOption = FALSE; /* telnet ECHO option */ - unsigned char option; - oldi = i; - switch ((unsigned char) buf[++i]) { - case TN_WILL: - if (appData.debugMode) - fprintf(debugFP, "\n next_out) - SendToPlayer(&buf[next_out], oldi - next_out); - if (++i > next_out) - next_out = i; - continue; - } - - /* OK, this at least will *usually* work */ - if (!loggedOn && looking_at(buf, &i, "ics%")) { - loggedOn = TRUE; - } - - if (loggedOn && !intfSet) { - if (ics_type == ICS_ICC) { - sprintf(str, - "/set-quietly interface %s\n/set-quietly style 12\n", - programVersion); - - } else if (ics_type == ICS_CHESSNET) { - sprintf(str, "/style 12\n"); - } else { - strcpy(str, "alias $ @\n$set interface "); - strcat(str, programVersion); - strcat(str, "\n$iset startpos 1\n$iset ms 1\n"); - #ifdef WIN32 - strcat(str, "$iset nohighlight 1\n"); - #endif - strcat(str, "$iset lock 1\n$style 12\n"); - } - SendToICS(str); - intfSet = TRUE; - } - - if (started == STARTED_COMMENT) { - /* Accumulate characters in comment */ - parse[parse_pos++] = buf[i]; - if (buf[i] == '\n') { - parse[parse_pos] = NULLCHAR; - AppendComment(forwardMostMove, StripHighlight(parse)); - started = STARTED_NONE; - } else { - /* Don't match patterns against characters in chatter */ - i++; - continue; - } - } - if (started == STARTED_CHATTER) { - if (buf[i] != '\n') { - /* Don't match patterns against characters in chatter */ - i++; - continue; - } - started = STARTED_NONE; - } - - /* Kludge to deal with rcmd protocol */ - if (firstTime && looking_at(buf, &i, "\001*")) { - DisplayFatalError(&buf[1], 0, 1); - continue; - } else { - firstTime = FALSE; - } - - if (!loggedOn && looking_at(buf, &i, "chessclub.com")) { - ics_type = ICS_ICC; - ics_prefix = "/"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - if (!loggedOn && looking_at(buf, &i, "freechess.org")) { - ics_type = ICS_FICS; - ics_prefix = "$"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - if (!loggedOn && looking_at(buf, &i, "chess.net")) { - ics_type = ICS_CHESSNET; - ics_prefix = "/"; - if (appData.debugMode) - fprintf(debugFP, "ics_type %d\n", ics_type); - continue; - } - - if (!loggedOn && - (looking_at(buf, &i, "\"*\" is *a registered name") || - looking_at(buf, &i, "Logging you in as \"*\"") || - looking_at(buf, &i, "will be \"*\""))) { - strcpy(ics_handle, star_match[0]); - continue; - } - - if (loggedOn && !have_set_title && ics_handle[0] != NULLCHAR) { - char buf[MSG_SIZ]; - sprintf(buf, "%s@%s", ics_handle, appData.icsHost); - DisplayIcsInteractionTitle(buf); - have_set_title = TRUE; - } - - /* skip finger notes */ - if (started == STARTED_NONE && - ((buf[i] == ' ' && isdigit(buf[i+1])) || - (buf[i] == '1' && buf[i+1] == '0')) && - buf[i+2] == ':' && buf[i+3] == ' ') { - started = STARTED_CHATTER; - i += 3; - continue; - } - - /* skip formula vars */ - if (started == STARTED_NONE && - buf[i] == 'f' && isdigit(buf[i+1]) && buf[i+2] == ':') { - started = STARTED_CHATTER; - i += 3; - continue; - } - - oldi = i; - if (appData.zippyTalk || appData.zippyPlay) { - /* Backup address for color zippy lines */ - backup = i; - #if ZIPPY - #ifdef WIN32 - if (loggedOn == TRUE) - if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || - (appData.zippyPlay && ZippyMatch(buf, &backup))); - #else - if (ZippyControl(buf, &i) || - ZippyConverse(buf, &i) || - (appData.zippyPlay && ZippyMatch(buf, &i))) { - loggedOn = TRUE; - if (!appData.colorize) continue; - } - #endif - #endif - } - if (/* Don't color "message" or "messages" output */ - (tkind = 5, looking_at(buf, &i, "*. * (*:*): ")) || - looking_at(buf, &i, "*. * at *:*: ") || - looking_at(buf, &i, "--* (*:*): ") || - /* Regular tells and says */ - (tkind = 1, looking_at(buf, &i, "* tells you: ")) || - looking_at(buf, &i, "* (your partner) tells you: ") || - looking_at(buf, &i, "* says: ") || - /* Message notifications (same color as tells) */ - looking_at(buf, &i, "* has left a message ") || - looking_at(buf, &i, "* just sent you a message:\n") || - /* Whispers and kibitzes */ - (tkind = 2, looking_at(buf, &i, "* whispers: ")) || - looking_at(buf, &i, "* kibitzes: ") || - /* Channel tells */ - (tkind = 3, looking_at(buf, &i, "*(*: "))) { - - if (tkind == 1 && strchr(star_match[0], ':')) { - /* Avoid "tells you:" spoofs in channels */ - tkind = 3; - } - if (star_match[0][0] == NULLCHAR || - strchr(star_match[0], ' ') || - (tkind == 3 && strchr(star_match[1], ' '))) { - /* Reject bogus matches */ - i = oldi; - } else { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - switch (tkind) { - case 1: - Colorize(ColorTell, FALSE); - curColor = ColorTell; - break; - case 2: - Colorize(ColorKibitz, FALSE); - curColor = ColorKibitz; - break; - case 3: - p = strrchr(star_match[1], '('); - if (p == NULL) { - p = star_match[1]; - } else { - p++; - } - if (atoi(p) == 1) { - Colorize(ColorChannel1, FALSE); - curColor = ColorChannel1; - } else { - Colorize(ColorChannel, FALSE); - curColor = ColorChannel; - } - break; - case 5: - curColor = ColorNormal; - break; - } - } - if (started == STARTED_NONE && appData.autoComment && - (gameMode == IcsObserving || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack)) { - parse_pos = i - oldi; - memcpy(parse, &buf[oldi], parse_pos); - parse[parse_pos] = NULLCHAR; - started = STARTED_COMMENT; - savingComment = TRUE; - } else { - started = STARTED_CHATTER; - savingComment = FALSE; - } - loggedOn = TRUE; - continue; - } - } - - if (looking_at(buf, &i, "* s-shouts: ") || - looking_at(buf, &i, "* c-shouts: ")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorSShout, FALSE); - curColor = ColorSShout; - } - loggedOn = TRUE; - started = STARTED_CHATTER; - continue; - } - - if (looking_at(buf, &i, "--->")) { - loggedOn = TRUE; - continue; - } - - if (looking_at(buf, &i, "* shouts: ") || - looking_at(buf, &i, "--> ")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorShout, FALSE); - curColor = ColorShout; - } - loggedOn = TRUE; - started = STARTED_CHATTER; - continue; - } - - if (looking_at( buf, &i, "Challenge:")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorChallenge, FALSE); - curColor = ColorChallenge; - } - loggedOn = TRUE; - continue; - } - - if (looking_at(buf, &i, "* offers you") || - looking_at(buf, &i, "* offers to be") || - looking_at(buf, &i, "* would like to") || - looking_at(buf, &i, "* requests to") || - looking_at(buf, &i, "Your opponent offers") || - looking_at(buf, &i, "Your opponent requests")) { - - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorRequest, FALSE); - curColor = ColorRequest; - } - continue; - } - - if (looking_at(buf, &i, "* (*) seeking")) { - if (appData.colorize) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorSeek, FALSE); - curColor = ColorSeek; - } - continue; - } - - if (looking_at(buf, &i, "\\ ")) { - if (prevColor != ColorNormal) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(prevColor, TRUE); - curColor = prevColor; - } - if (savingComment) { - parse_pos = i - oldi; - memcpy(parse, &buf[oldi], parse_pos); - parse[parse_pos] = NULLCHAR; - started = STARTED_COMMENT; - } else { - started = STARTED_CHATTER; - } - continue; - } - - if (looking_at(buf, &i, "Black Strength :") || - looking_at(buf, &i, "<<< style 10 board >>>") || - looking_at(buf, &i, "<10>") || - looking_at(buf, &i, "#@#")) { - /* Wrong board style */ - loggedOn = TRUE; - SendToICS(ics_prefix); - SendToICS("set style 12\n"); - SendToICS(ics_prefix); - SendToICS("refresh\n"); - continue; - } - - if (!have_sent_ICS_logon && looking_at(buf, &i, "login:")) { - ICSInitScript(); - have_sent_ICS_logon = 1; - continue; - } - - if (ics_getting_history != H_GETTING_MOVES /*smpos kludge*/ && - (looking_at(buf, &i, "\n<12> ") || - looking_at(buf, &i, "<12> "))) { - loggedOn = TRUE; - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - next_out = i; - started = STARTED_BOARD; - parse_pos = 0; - continue; - } - - if ((started == STARTED_NONE && looking_at(buf, &i, "\n ")) || - looking_at(buf, &i, " ")) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - next_out = i; - started = STARTED_HOLDINGS; - parse_pos = 0; - continue; - } - - if (looking_at(buf, &i, "* *vs. * *--- *")) { - loggedOn = TRUE; - /* Header for a move list -- first line */ - - switch (ics_getting_history) { - case H_FALSE: - switch (gameMode) { - case IcsIdle: - case BeginningOfGame: - /* User typed "moves" or "oldmoves" while we - were idle. Pretend we asked for these - moves and soak them up so user can step - through them and/or save them. - */ - Reset(FALSE, TRUE); - gameMode = IcsObserving; - ModeHighlight(); - ics_gamenum = -1; - ics_getting_history = H_GOT_UNREQ_HEADER; - break; - case EditGame: /*?*/ - case EditPosition: /*?*/ - /* Should above feature work in these modes too? */ - /* For now it doesn't */ - ics_getting_history = H_GOT_UNWANTED_HEADER; - break; - default: - ics_getting_history = H_GOT_UNWANTED_HEADER; - break; - } - break; - case H_REQUESTED: - /* Is this the right one? */ - if (gameInfo.white && gameInfo.black && - strcmp(gameInfo.white, star_match[0]) == 0 && - strcmp(gameInfo.black, star_match[2]) == 0) { - /* All is well */ - ics_getting_history = H_GOT_REQ_HEADER; - } - break; - case H_GOT_REQ_HEADER: - case H_GOT_UNREQ_HEADER: - case H_GOT_UNWANTED_HEADER: - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: two headers"), 0); - ics_getting_history = H_FALSE; - break; - } - - /* Save player ratings into gameInfo if needed */ - if ((ics_getting_history == H_GOT_REQ_HEADER || - ics_getting_history == H_GOT_UNREQ_HEADER) && - (gameInfo.whiteRating == -1 || - gameInfo.blackRating == -1)) { - - gameInfo.whiteRating = string_to_rating(star_match[1]); - gameInfo.blackRating = string_to_rating(star_match[3]); - if (appData.debugMode) - fprintf(debugFP, _("Ratings from header: W %d, B %d\n"), - gameInfo.whiteRating, gameInfo.blackRating); - } - continue; - } - - if (looking_at(buf, &i, - "* * match, initial time: * minute*, increment: * second")) { - /* Header for a move list -- second line */ - /* Initial board will follow if this is a wild game */ - - if (gameInfo.event != NULL) free(gameInfo.event); - sprintf(str, "ICS %s %s match", star_match[0], star_match[1]); - gameInfo.event = StrSave(str); - gameInfo.variant = StringToVariant(gameInfo.event); - continue; - } - - if (looking_at(buf, &i, "Move ")) { - /* Beginning of a move list */ - switch (ics_getting_history) { - case H_FALSE: - /* Normally should not happen */ - /* Maybe user hit reset while we were parsing */ - break; - case H_REQUESTED: - /* Happens if we are ignoring a move list that is not - * the one we just requested. Common if the user - * tries to observe two games without turning off - * getMoveList */ - break; - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: nested"), 0); - ics_getting_history = H_FALSE; - break; - case H_GOT_REQ_HEADER: - ics_getting_history = H_GETTING_MOVES; - started = STARTED_MOVES; - parse_pos = 0; - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - } - break; - case H_GOT_UNREQ_HEADER: - ics_getting_history = H_GETTING_MOVES; - started = STARTED_MOVES_NOHIDE; - parse_pos = 0; - break; - case H_GOT_UNWANTED_HEADER: - ics_getting_history = H_FALSE; - break; - } - continue; - } - - if (looking_at(buf, &i, "% ") || - ((started == STARTED_MOVES || started == STARTED_MOVES_NOHIDE) - && looking_at(buf, &i, "}*"))) { - savingComment = FALSE; - switch (started) { - case STARTED_MOVES: - case STARTED_MOVES_NOHIDE: - memcpy(&parse[parse_pos], &buf[oldi], i - oldi); - parse[parse_pos + i - oldi] = NULLCHAR; - ParseGameHistory(parse); - #if ZIPPY - if (appData.zippyPlay && first.initDone) { - FeedMovesToProgram(&first, forwardMostMove); - if (gameMode == IcsPlayingWhite) { - if (WhiteOnMove(forwardMostMove)) { - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); - } - SendTimeRemaining(&first, TRUE); - } - if (first.useColors) { - SendToProgram("white\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - first.maybeThinking = TRUE; - } else { - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, TRUE); - } - SendToProgram("playother\n", &first); - firstMove = FALSE; - } else { - firstMove = TRUE; - } - } - } else if (gameMode == IcsPlayingBlack) { - if (!WhiteOnMove(forwardMostMove)) { - if (first.sendTime) { - if (first.useColors) { - SendToProgram("white\n", &first); - } - SendTimeRemaining(&first, FALSE); - } - if (first.useColors) { - SendToProgram("black\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - first.maybeThinking = TRUE; - } else { - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, FALSE); - } - SendToProgram("playother\n", &first); - firstMove = FALSE; - } else { - firstMove = TRUE; - } - } - } - } - #endif - if (gameMode == IcsObserving && ics_gamenum == -1) { - /* Moves came from oldmoves or moves command - while we weren't doing anything else. - */ - currentMove = forwardMostMove; - ClearHighlights();/*!!could figure this out*/ - flipView = appData.flipView; - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - sprintf(str, "%s vs. %s", - gameInfo.white, gameInfo.black); - DisplayTitle(str); - gameMode = IcsIdle; - } else { - /* Moves were history of an active game */ - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - } - HistorySet(parseList, backwardMostMove, - forwardMostMove, currentMove-1); - DisplayMove(currentMove - 1); - if (started == STARTED_MOVES) next_out = i; - started = STARTED_NONE; - ics_getting_history = H_FALSE; - break; - - case STARTED_OBSERVE: - started = STARTED_NONE; - SendToICS(ics_prefix); - SendToICS("refresh\n"); - break; - - default: - break; - } - continue; - } - - if ((started == STARTED_MOVES || started == STARTED_BOARD || - started == STARTED_HOLDINGS || - started == STARTED_MOVES_NOHIDE) && i >= leftover_len) { - /* Accumulate characters in move list or board */ - parse[parse_pos++] = buf[i]; - } - - /* Start of game messages. Mostly we detect start of game - when the first board image arrives. On some versions - of the ICS, though, we need to do a "refresh" after starting - to observe in order to get the current board right away. */ - if (looking_at(buf, &i, "Adding game * to observation list")) { - started = STARTED_OBSERVE; - continue; - } - - /* Handle auto-observe */ - if (appData.autoObserve && - (gameMode == IcsIdle || gameMode == BeginningOfGame) && - looking_at(buf, &i, "Game notification: * (*) vs. * (*)")) { - char *player; - /* Choose the player that was highlighted, if any. */ - if (star_match[0][0] == '\033' || - star_match[1][0] != '\033') { - player = star_match[0]; - } else { - player = star_match[2]; - } - sprintf(str, "%sobserve %s\n", - ics_prefix, StripHighlightAndTitle(player)); - SendToICS(str); - - /* Save ratings from notify string */ - strcpy(player1Name, star_match[0]); - player1Rating = string_to_rating(star_match[1]); - strcpy(player2Name, star_match[2]); - player2Rating = string_to_rating(star_match[3]); - - if (appData.debugMode) - fprintf(debugFP, - "Ratings from 'Game notification:' %s %d, %s %d\n", - player1Name, player1Rating, - player2Name, player2Rating); - - continue; - } - - /* Deal with automatic examine mode after a game, - and with IcsObserving -> IcsExamining transition */ - if (looking_at(buf, &i, "Entering examine mode for game *") || - looking_at(buf, &i, "has made you an examiner of game *")) { - - int gamenum = atoi(star_match[0]); - if ((gameMode == IcsIdle || gameMode == IcsObserving) && - gamenum == ics_gamenum) { - /* We were already playing or observing this game; - no need to refetch history */ - gameMode = IcsExamining; - if (pausing) { - pauseExamForwardMostMove = forwardMostMove; - } else if (currentMove < forwardMostMove) { - ForwardInner(forwardMostMove); - } - } else { - /* I don't think this case really can happen */ - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } - continue; - } - - /* Error messages */ - if (ics_user_moved) { - if (looking_at(buf, &i, "Illegal move") || - looking_at(buf, &i, "Not a legal move") || - looking_at(buf, &i, "Your king is in check") || - looking_at(buf, &i, "It isn't your turn") || - looking_at(buf, &i, "It is not your move")) { - /* Illegal move */ - ics_user_moved = 0; - if (forwardMostMove > backwardMostMove) { - currentMove = --forwardMostMove; - DisplayMove(currentMove - 1); /* before DMError */ - DisplayMoveError("Illegal move (rejected by ICS)"); - DrawPosition(FALSE, boards[currentMove]); - SwitchClocks(); - DisplayBothClocks(); - } - continue; - } - } - - if (looking_at(buf, &i, "still have time") || - looking_at(buf, &i, "not out of time") || - looking_at(buf, &i, "either player is out of time") || - looking_at(buf, &i, "has timeseal; checking")) { - /* We must have called his flag a little too soon */ - whiteFlag = blackFlag = FALSE; - continue; - } - - if (looking_at(buf, &i, "added * seconds to") || - looking_at(buf, &i, "seconds were added to")) { - /* Update the clocks */ - SendToICS(ics_prefix); - SendToICS("refresh\n"); - continue; - } - - if (!ics_clock_paused && looking_at(buf, &i, "clock paused")) { - ics_clock_paused = TRUE; - StopClocks(); - continue; - } - - if (ics_clock_paused && looking_at(buf, &i, "clock resumed")) { - ics_clock_paused = FALSE; - StartClocks(); - continue; - } - - /* Grab player ratings from the Creating: message. - Note we have to check for the special case when - the ICS inserts things like [white] or [black]. */ - if (looking_at(buf, &i, "Creating: * (*)* * (*)") || - looking_at(buf, &i, "Creating: * (*) [*] * (*)")) { - /* star_matches: - 0 player 1 name (not necessarily white) - 1 player 1 rating - 2 empty, white, or black (IGNORED) - 3 player 2 name (not necessarily black) - 4 player 2 rating - - The names/ratings are sorted out when the game - actually starts (below). - */ - strcpy(player1Name, StripHighlightAndTitle(star_match[0])); - player1Rating = string_to_rating(star_match[1]); - strcpy(player2Name, StripHighlightAndTitle(star_match[3])); - player2Rating = string_to_rating(star_match[4]); - - if (appData.debugMode) - fprintf(debugFP, - "Ratings from 'Creating:' %s %d, %s %d\n", - player1Name, player1Rating, - player2Name, player2Rating); - - continue; - } - - /* Improved generic start/end-of-game messages */ - if ((tkind=0, looking_at(buf, &i, "{Game * (* vs. *) *}*")) || - (tkind=1, looking_at(buf, &i, "{Game * (*(*) vs. *(*)) *}*"))){ - /* If tkind == 0: */ - /* star_match[0] is the game number */ - /* [1] is the white player's name */ - /* [2] is the black player's name */ - /* For end-of-game: */ - /* [3] is the reason for the game end */ - /* [4] is a PGN end game-token, preceded by " " */ - /* For start-of-game: */ - /* [3] begins with "Creating" or "Continuing" */ - /* [4] is " *" or empty (don't care). */ - int gamenum = atoi(star_match[0]); - char *whitename, *blackname, *why, *endtoken; - ChessMove endtype = (ChessMove) 0; - - if (tkind == 0) { - whitename = star_match[1]; - blackname = star_match[2]; - why = star_match[3]; - endtoken = star_match[4]; - } else { - whitename = star_match[1]; - blackname = star_match[3]; - why = star_match[5]; - endtoken = star_match[6]; - } - - /* Game start messages */ - if (strncmp(why, "Creating ", 9) == 0 || - strncmp(why, "Continuing ", 11) == 0) { - gs_gamenum = gamenum; - strcpy(gs_kind, strchr(why, ' ') + 1); - #if ZIPPY - if (appData.zippyPlay) { - ZippyGameStart(whitename, blackname); - } - #endif /*ZIPPY*/ - continue; - } - - /* Game end messages */ - if (gameMode == IcsIdle || gameMode == BeginningOfGame || - ics_gamenum != gamenum) { - continue; - } - while (endtoken[0] == ' ') endtoken++; - switch (endtoken[0]) { - case '*': - default: - endtype = GameUnfinished; - break; - case '0': - endtype = BlackWins; - break; - case '1': - if (endtoken[1] == '/') - endtype = GameIsDrawn; - else - endtype = WhiteWins; - break; - } - GameEnds(endtype, why, GE_ICS); - #if ZIPPY - if (appData.zippyPlay && first.initDone) { - ZippyGameEnd(endtype, why); - if (first.pr == NULL) { - /* Start the next process early so that we'll - be ready for the next challenge */ - StartChessProgram(&first); - } - /* Send "new" early, in case this command takes - a long time to finish, so that we'll be ready - for the next challenge. */ - Reset(TRUE, TRUE); - } - #endif /*ZIPPY*/ - continue; - } - - if (looking_at(buf, &i, "Removing game * from observation") || - looking_at(buf, &i, "no longer observing game *") || - looking_at(buf, &i, "Game * (*) has no examiners")) { - if (gameMode == IcsObserving && - atoi(star_match[0]) == ics_gamenum) - { - /* icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - } - StopClocks(); - gameMode = IcsIdle; - ics_gamenum = -1; - ics_user_moved = FALSE; - } - continue; - } - - if (looking_at(buf, &i, "no longer examining game *")) { - if (gameMode == IcsExamining && - atoi(star_match[0]) == ics_gamenum) - { - gameMode = IcsIdle; - ics_gamenum = -1; - ics_user_moved = FALSE; - } - continue; - } - - /* Advance leftover_start past any newlines we find, - so only partial lines can get reparsed */ - if (looking_at(buf, &i, "\n")) { - prevColor = curColor; - if (curColor != ColorNormal) { - if (oldi > next_out) { - SendToPlayer(&buf[next_out], oldi - next_out); - next_out = oldi; - } - Colorize(ColorNormal, FALSE); - curColor = ColorNormal; - } - if (started == STARTED_BOARD) { - started = STARTED_NONE; - parse[parse_pos] = NULLCHAR; - ParseBoard12(parse); - ics_user_moved = 0; - - /* Send premove here */ - if (appData.premove) { - char str[MSG_SIZ]; - if (currentMove == 0 && - gameMode == IcsPlayingWhite && - appData.premoveWhite) { - sprintf(str, "%s%s\n", ics_prefix, - appData.premoveWhiteText); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - SendToICS(str); - } else if (currentMove == 1 && - gameMode == IcsPlayingBlack && - appData.premoveBlack) { - sprintf(str, "%s%s\n", ics_prefix, - appData.premoveBlackText); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - SendToICS(str); - } else if (gotPremove) { - gotPremove = 0; - ClearPremoveHighlights(); - if (appData.debugMode) - fprintf(debugFP, "Sending premove:\n"); - UserMoveEvent(premoveFromX, premoveFromY, - premoveToX, premoveToY, - premovePromoChar); - } - } - - /* Usually suppress following prompt */ - if (!(forwardMostMove == 0 && gameMode == IcsExamining)) { - if (looking_at(buf, &i, "*% ")) { - savingComment = FALSE; - } - } - next_out = i; - } else if (started == STARTED_HOLDINGS) { - int gamenum; - char new_piece[MSG_SIZ]; - started = STARTED_NONE; - parse[parse_pos] = NULLCHAR; - if (appData.debugMode) - fprintf(debugFP, "Parsing holdings: %s\n", parse); - if (sscanf(parse, " game %d", &gamenum) == 1 && - gamenum == ics_gamenum) { - if (gameInfo.variant == VariantNormal) { - gameInfo.variant = VariantCrazyhouse; /*temp guess*/ - /* Get a move list just to see the header, which - will tell us whether this is really bug or zh */ - if (ics_getting_history == H_FALSE) { - ics_getting_history = H_REQUESTED; - sprintf(str, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } - new_piece[0] = NULLCHAR; - sscanf(parse, "game %d white [%s black [%s <- %s", - &gamenum, white_holding, black_holding, - new_piece); - white_holding[strlen(white_holding)-1] = NULLCHAR; - black_holding[strlen(black_holding)-1] = NULLCHAR; - #if ZIPPY - if (appData.zippyPlay && first.initDone) { - ZippyHoldings(white_holding, black_holding, - new_piece); - } - #endif /*ZIPPY*/ - if (tinyLayout || smallLayout) { - char wh[16], bh[16]; - PackHolding(wh, white_holding); - PackHolding(bh, black_holding); - sprintf(str, "[%s-%s] %s-%s", wh, bh, - gameInfo.white, gameInfo.black); - } else { - sprintf(str, "%s [%s] vs. %s [%s]", - gameInfo.white, white_holding, - gameInfo.black, black_holding); - } - DrawPosition(FALSE, NULL); - DisplayTitle(str); - } - /* Suppress following prompt */ - if (looking_at(buf, &i, "*% ")) { - savingComment = FALSE; - } - next_out = i; - } - continue; - } - - i++; /* skip unparsed character and loop back */ - } - - if (started != STARTED_MOVES && started != STARTED_BOARD && - started != STARTED_HOLDINGS && i > next_out) { - SendToPlayer(&buf[next_out], i - next_out); - next_out = i; - } - - leftover_len = buf_len - leftover_start; - /* if buffer ends with something we couldn't parse, - reparse it after appending the next read */ - - } else if (count == 0) { - RemoveInputSource(isr); - DisplayFatalError(_("Connection closed by ICS"), 0, 0); - } else { - DisplayFatalError(_("Error reading from ICS"), error, 1); - } - } - - - /* Board style 12 looks like this: - - <12> r-b---k- pp----pp ---bP--- ---p---- q------- ------P- P--Q--BP -----R-K W -1 0 0 0 0 0 0 paf MaxII 0 2 12 21 25 234 174 24 Q/d7-a4 (0:06) Qxa4 0 0 - - * The "<12> " is stripped before it gets to this routine. The two - * trailing 0's (flip state and clock ticking) are later addition, and - * some chess servers may not have them, or may have only the first. - * Additional trailing fields may be added in the future. - */ - - #define PATTERN "%72c%c%d%d%d%d%d%d%d%s%s%d%d%d%d%d%d%d%d%s%s%s%d%d" - - #define RELATION_OBSERVING_PLAYED 0 - #define RELATION_OBSERVING_STATIC -2 /* examined, oldmoves, or smoves */ - #define RELATION_PLAYING_MYMOVE 1 - #define RELATION_PLAYING_NOTMYMOVE -1 - #define RELATION_EXAMINING 2 - #define RELATION_ISOLATED_BOARD -3 - #define RELATION_STARTING_POSITION -4 /* FICS only */ - - void - ParseBoard12(string) - char *string; - { - GameMode newGameMode; - int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0, i; - int j, k, n, moveNum, white_stren, black_stren, white_time, black_time, takeback; - int double_push, castle_ws, castle_wl, castle_bs, castle_bl, irrev_count; - char to_play, board_chars[72]; - char move_str[500], str[500], elapsed_time[500]; - char black[32], white[32]; - Board board; - int prevMove = currentMove; - int ticking = 2; - ChessMove moveType; - int fromX, fromY, toX, toY; - char promoChar; - - fromX = fromY = toX = toY = -1; - - newGame = FALSE; - - if (appData.debugMode) - fprintf(debugFP, _("Parsing board: %s\n"), string); - - move_str[0] = NULLCHAR; - elapsed_time[0] = NULLCHAR; - n = sscanf(string, PATTERN, board_chars, &to_play, &double_push, - &castle_ws, &castle_wl, &castle_bs, &castle_bl, &irrev_count, - &gamenum, white, black, &relation, &basetime, &increment, - &white_stren, &black_stren, &white_time, &black_time, - &moveNum, str, elapsed_time, move_str, &ics_flip, - &ticking); - - if (n < 22) { - sprintf(str, _("Failed to parse board string:\n\"%s\""), string); - DisplayError(str, 0); - return; - } - - /* Convert the move number to internal form */ - moveNum = (moveNum - 1) * 2; - if (to_play == 'B') moveNum++; - if (moveNum >= MAX_MOVES) { - DisplayFatalError(_("Game too long; increase MAX_MOVES and recompile"), - 0, 1); - return; - } - - switch (relation) { - case RELATION_OBSERVING_PLAYED: - case RELATION_OBSERVING_STATIC: - if (gamenum == -1) { - /* Old ICC buglet */ - relation = RELATION_OBSERVING_STATIC; - } - newGameMode = IcsObserving; - break; - case RELATION_PLAYING_MYMOVE: - case RELATION_PLAYING_NOTMYMOVE: - newGameMode = - ((relation == RELATION_PLAYING_MYMOVE) == (to_play == 'W')) ? - IcsPlayingWhite : IcsPlayingBlack; - break; - case RELATION_EXAMINING: - newGameMode = IcsExamining; - break; - case RELATION_ISOLATED_BOARD: - default: - /* Just display this board. If user was doing something else, - we will forget about it until the next board comes. */ - newGameMode = IcsIdle; - break; - case RELATION_STARTING_POSITION: - newGameMode = gameMode; - break; - } - - /* Modify behavior for initial board display on move listing - of wild games. - */ - switch (ics_getting_history) { - case H_FALSE: - case H_REQUESTED: - break; - case H_GOT_REQ_HEADER: - case H_GOT_UNREQ_HEADER: - /* This is the initial position of the current game */ - gamenum = ics_gamenum; - moveNum = 0; /* old ICS bug workaround */ - if (to_play == 'B') { - startedFromSetupPosition = TRUE; - blackPlaysFirst = TRUE; - moveNum = 1; - if (forwardMostMove == 0) forwardMostMove = 1; - if (backwardMostMove == 0) backwardMostMove = 1; - if (currentMove == 0) currentMove = 1; - } - newGameMode = gameMode; - relation = RELATION_STARTING_POSITION; /* ICC needs this */ - break; - case H_GOT_UNWANTED_HEADER: - /* This is an initial board that we don't want */ - return; - case H_GETTING_MOVES: - /* Should not happen */ - DisplayError(_("Error gathering move list: extra board"), 0); - ics_getting_history = H_FALSE; - return; - } - - /* Take action if this is the first board of a new game, or of a - different game than is currently being displayed. */ - if (gamenum != ics_gamenum || newGameMode != gameMode || - relation == RELATION_ISOLATED_BOARD) { - - /* Forget the old game and get the history (if any) of the new one */ - if (gameMode != BeginningOfGame) { - Reset(FALSE, TRUE); - } - newGame = TRUE; - if (appData.autoRaiseBoard) BoardToTop(); - prevMove = -3; - if (gamenum == -1) { - newGameMode = IcsIdle; - } else if (moveNum > 0 && newGameMode != IcsIdle && - appData.getMoveList) { - /* Need to get game history */ - ics_getting_history = H_REQUESTED; - sprintf(str, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - - /* Initially flip the board to have black on the bottom if playing - black or if the ICS flip flag is set, but let the user change - it with the Flip View button. */ - flipView = appData.autoFlipView ? - (newGameMode == IcsPlayingBlack) || ics_flip : - appData.flipView; - - /* Done with values from previous mode; copy in new ones */ - gameMode = newGameMode; - ModeHighlight(); - ics_gamenum = gamenum; - if (gamenum == gs_gamenum) { - int klen = strlen(gs_kind); - if (gs_kind[klen - 1] == '.') gs_kind[klen - 1] = NULLCHAR; - sprintf(str, "ICS %s", gs_kind); - gameInfo.event = StrSave(str); - } else { - gameInfo.event = StrSave("ICS game"); - } - gameInfo.site = StrSave(appData.icsHost); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(white); - gameInfo.black = StrSave(black); - timeControl = basetime * 60 * 1000; - timeIncrement = increment * 1000; - movesPerSession = 0; - gameInfo.timeControl = TimeControlTagValue(); - gameInfo.variant = StringToVariant(gameInfo.event); - - /* Do we have the ratings? */ - if (strcmp(player1Name, white) == 0 && - strcmp(player2Name, black) == 0) { - if (appData.debugMode) - fprintf(debugFP, "Remembered ratings: W %d, B %d\n", - player1Rating, player2Rating); - gameInfo.whiteRating = player1Rating; - gameInfo.blackRating = player2Rating; - } else if (strcmp(player2Name, white) == 0 && - strcmp(player1Name, black) == 0) { - if (appData.debugMode) - fprintf(debugFP, "Remembered ratings: W %d, B %d\n", - player2Rating, player1Rating); - gameInfo.whiteRating = player2Rating; - gameInfo.blackRating = player1Rating; - } - player1Name[0] = player2Name[0] = NULLCHAR; - - /* Silence shouts if requested */ - if (appData.quietPlay && - (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack)) { - SendToICS(ics_prefix); - SendToICS("set shout 0\n"); - } - } - - /* Deal with midgame name changes */ - if (!newGame) { - if (!gameInfo.white || strcmp(gameInfo.white, white) != 0) { - if (gameInfo.white) free(gameInfo.white); - gameInfo.white = StrSave(white); - } - if (!gameInfo.black || strcmp(gameInfo.black, black) != 0) { - if (gameInfo.black) free(gameInfo.black); - gameInfo.black = StrSave(black); - } - } - - /* Throw away game result if anything actually changes in examine mode */ - if (gameMode == IcsExamining && !newGame) { - gameInfo.result = GameUnfinished; - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - } - - /* In pausing && IcsExamining mode, we ignore boards coming - in if they are in a different variation than we are. */ - if (pauseExamInvalid) return; - if (pausing && gameMode == IcsExamining) { - if (moveNum <= pauseExamForwardMostMove) { - pauseExamInvalid = TRUE; - forwardMostMove = pauseExamForwardMostMove; - return; - } - } - - /* Parse the board */ - for (k = 0; k < 8; k++) - for (j = 0; j < 8; j++) - board[k][j] = CharToPiece(board_chars[(7-k)*9 + j]); - CopyBoard(boards[moveNum], board); - if (moveNum == 0) { - startedFromSetupPosition = - !CompareBoards(board, initialPosition); - } - - if (ics_getting_history == H_GOT_REQ_HEADER || - ics_getting_history == H_GOT_UNREQ_HEADER) { - /* This was an initial position from a move list, not - the current position */ - return; - } - - /* Update currentMove and known move number limits */ - newMove = newGame || moveNum > forwardMostMove; - - /* If we found takebacks during icsEngineAnalyze - try send to engine */ - if (!newGame && appData.icsEngineAnalyze && moveNum < forwardMostMove) { - takeback = forwardMostMove - moveNum; - for (i = 0; i < takeback; i++) { - if (appData.debugMode) fprintf(debugFP, "take back move\n"); - SendToProgram("undo\n", &first); - } - } - if (newGame) { - forwardMostMove = backwardMostMove = currentMove = moveNum; - if (gameMode == IcsExamining && moveNum == 0) { - /* Workaround for ICS limitation: we are not told the wild - type when starting to examine a game. But if we ask for - the move list, the move list header will tell us */ - ics_getting_history = H_REQUESTED; - sprintf(str, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } else if (moveNum == forwardMostMove + 1 || moveNum == forwardMostMove - || (moveNum < forwardMostMove && moveNum >= backwardMostMove)) { - forwardMostMove = moveNum; - if (!pausing || currentMove > forwardMostMove) - currentMove = forwardMostMove; - } else { - /* New part of history that is not contiguous with old part */ - if (pausing && gameMode == IcsExamining) { - pauseExamInvalid = TRUE; - forwardMostMove = pauseExamForwardMostMove; - return; - } - forwardMostMove = backwardMostMove = currentMove = moveNum; - if (gameMode == IcsExamining && moveNum > 0 && appData.getMoveList) { - ics_getting_history = H_REQUESTED; - sprintf(str, "%smoves %d\n", ics_prefix, gamenum); - SendToICS(str); - } - } - - /* Update the clocks */ - if (strchr(elapsed_time, '.')) { - /* Time is in ms */ - timeRemaining[0][moveNum] = whiteTimeRemaining = white_time; - timeRemaining[1][moveNum] = blackTimeRemaining = black_time; - } else { - /* Time is in seconds */ - timeRemaining[0][moveNum] = whiteTimeRemaining = white_time * 1000; - timeRemaining[1][moveNum] = blackTimeRemaining = black_time * 1000; - } - - - #if ZIPPY - if (appData.zippyPlay && newGame && - gameMode != IcsObserving && gameMode != IcsIdle && - gameMode != IcsExamining) - ZippyFirstBoard(moveNum, basetime, increment); - #endif - - /* Put the move on the move list, first converting - to canonical algebraic form. */ - if (moveNum > 0) { - if (moveNum <= backwardMostMove) { - /* We don't know what the board looked like before - this move. Punt. */ - strcpy(parseList[moveNum - 1], move_str); - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - moveList[moveNum - 1][0] = NULLCHAR; - } else if (ParseOneMove(move_str, moveNum - 1, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - (void) CoordsToAlgebraic(boards[moveNum - 1], - PosFlags(moveNum - 1), EP_UNKNOWN, - fromY, fromX, toY, toX, promoChar, - parseList[moveNum-1]); - switch (MateTest(boards[moveNum], PosFlags(moveNum), EP_UNKNOWN)){ - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - strcat(parseList[moveNum - 1], "+"); - break; - case MT_CHECKMATE: - strcat(parseList[moveNum - 1], "#"); - break; - } - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - /* currentMoveString is set as a side-effect of ParseOneMove */ - strcpy(moveList[moveNum - 1], currentMoveString); - strcat(moveList[moveNum - 1], "\n"); - } else if (strcmp(move_str, "none") == 0) { - /* Again, we don't know what the board looked like; - this is really the start of the game. */ - parseList[moveNum - 1][0] = NULLCHAR; - moveList[moveNum - 1][0] = NULLCHAR; - backwardMostMove = moveNum; - startedFromSetupPosition = TRUE; - fromX = fromY = toX = toY = -1; - } else { - /* Move from ICS was illegal!? Punt. */ - #if 0 - if (appData.testLegality && appData.debugMode) { - sprintf(str, "Illegal move \"%s\" from ICS", move_str); - DisplayError(str, 0); - } - #endif - strcpy(parseList[moveNum - 1], move_str); - strcat(parseList[moveNum - 1], " "); - strcat(parseList[moveNum - 1], elapsed_time); - moveList[moveNum - 1][0] = NULLCHAR; - fromX = fromY = toX = toY = -1; - } - - #if ZIPPY - /* Send move to chess program (BEFORE animating it). */ - if (appData.zippyPlay && !newGame && newMove && - (!appData.getMoveList || backwardMostMove == 0) && first.initDone) { - - if ((gameMode == IcsPlayingWhite && WhiteOnMove(moveNum)) || - (gameMode == IcsPlayingBlack && !WhiteOnMove(moveNum))) { - if (moveList[moveNum - 1][0] == NULLCHAR) { - sprintf(str, _("Couldn't parse move \"%s\" from ICS"), - move_str); - DisplayError(str, 0); - } else { - if (first.sendTime) { - SendTimeRemaining(&first, gameMode == IcsPlayingWhite); - } - SendMoveToProgram(moveNum - 1, &first); - if (firstMove) { - firstMove = FALSE; - if (first.useColors) { - SendToProgram(gameMode == IcsPlayingWhite ? - "white\ngo\n" : - "black\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - first.maybeThinking = TRUE; - } - } - } else if (gameMode == IcsObserving || gameMode == IcsExamining) { - if (moveList[moveNum - 1][0] == NULLCHAR) { - sprintf(str, _("Couldn't parse move \"%s\" from ICS"), move_str); - DisplayError(str, 0); - } else { - SendMoveToProgram(moveNum - 1, &first); - } - } - } - #endif - } - - if (moveNum > 0 && !gotPremove) { - /* If move comes from a remote source, animate it. If it - isn't remote, it will have already been animated. */ - if (!pausing && !ics_user_moved && prevMove == moveNum - 1) { - AnimateMove(boards[moveNum - 1], fromX, fromY, toX, toY); - } - if (!pausing && appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - - /* Start the clocks */ - whiteFlag = blackFlag = FALSE; - appData.clockMode = !(basetime == 0 && increment == 0); - if (ticking == 0) { - ics_clock_paused = TRUE; - StopClocks(); - } else if (ticking == 1) { - ics_clock_paused = FALSE; - } - if (gameMode == IcsIdle || - relation == RELATION_OBSERVING_STATIC || - relation == RELATION_EXAMINING || - ics_clock_paused) - DisplayBothClocks(); - else - StartClocks(); - - /* Display opponents and material strengths */ - if (gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse) { - if (tinyLayout || smallLayout) { - sprintf(str, "%s(%d) %s(%d) {%d %d}", - gameInfo.white, white_stren, gameInfo.black, black_stren, - basetime, increment); - } else { - sprintf(str, "%s (%d) vs. %s (%d) {%d %d}", - gameInfo.white, white_stren, gameInfo.black, black_stren, - basetime, increment); - } - DisplayTitle(str); - } - - - /* Display the board */ - if (!pausing) { - - if (appData.premove) - if (!gotPremove || - ((gameMode == IcsPlayingWhite) && (WhiteOnMove(currentMove))) || - ((gameMode == IcsPlayingBlack) && (!WhiteOnMove(currentMove)))) - ClearPremoveHighlights(); - - DrawPosition(FALSE, boards[currentMove]); - DisplayMove(moveNum - 1); - if (appData.ringBellAfterMoves && !ics_user_moved) - RingBell(); - } - - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - } - - void - GetMoveListEvent() - { - char buf[MSG_SIZ]; - if (appData.icsActive && gameMode != IcsIdle && ics_gamenum > 0) { - ics_getting_history = H_REQUESTED; - sprintf(buf, "%smoves %d\n", ics_prefix, ics_gamenum); - SendToICS(buf); - } - } - - void - AnalysisPeriodicEvent(force) - int force; - { - if (((programStats.ok_to_send == 0 || programStats.line_is_book) - && !force) || !appData.periodicUpdates) - return; - - /* Send . command to Crafty to collect stats */ - SendToProgram(".\n", &first); - - /* Don't send another until we get a response (this makes - us stop sending to old Crafty's which don't understand - the "." command (sending illegal cmds resets node count & time, - which looks bad)) */ - programStats.ok_to_send = 0; - } - - void - SendMoveToProgram(moveNum, cps) - int moveNum; - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - if (cps->useUsermove) { - SendToProgram("usermove ", cps); - } - if (cps->useSAN) { - char *space; - if ((space = strchr(parseList[moveNum], ' ')) != NULL) { - int len = space - parseList[moveNum]; - memcpy(buf, parseList[moveNum], len); - buf[len++] = '\n'; - buf[len] = NULLCHAR; - } else { - sprintf(buf, "%s\n", parseList[moveNum]); - } - SendToProgram(buf, cps); - } else { - SendToProgram(moveList[moveNum], cps); - } - } - - void - SendMoveToICS(moveType, fromX, fromY, toX, toY) - ChessMove moveType; - int fromX, fromY, toX, toY; - { - char user_move[MSG_SIZ]; - - switch (moveType) { - default: - sprintf(user_move, "say Internal error; bad moveType %d (%d,%d-%d,%d)", - (int)moveType, fromX, fromY, toX, toY); - DisplayError(user_move + strlen("say "), 0); - break; - case WhiteKingSideCastle: - case BlackKingSideCastle: - case WhiteQueenSideCastleWild: - case BlackQueenSideCastleWild: - sprintf(user_move, "o-o\n"); - break; - case WhiteQueenSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case BlackKingSideCastleWild: - sprintf(user_move, "o-o-o\n"); - break; - case WhitePromotionQueen: - case BlackPromotionQueen: - case WhitePromotionRook: - case BlackPromotionRook: - case WhitePromotionBishop: - case BlackPromotionBishop: - case WhitePromotionKnight: - case BlackPromotionKnight: - case WhitePromotionKing: - case BlackPromotionKing: - sprintf(user_move, "%c%c%c%c=%c\n", - 'a' + fromX, '1' + fromY, 'a' + toX, '1' + toY, - PieceToChar(PromoPiece(moveType))); - break; - case WhiteDrop: - case BlackDrop: - sprintf(user_move, "%c@%c%c\n", - ToUpper(PieceToChar((ChessSquare) fromX)), - 'a' + toX, '1' + toY); - break; - case NormalMove: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case IllegalMove: /* could be a variant we don't quite understand */ - sprintf(user_move, "%c%c%c%c\n", - 'a' + fromX, '1' + fromY, 'a' + toX, '1' + toY); - break; - } - SendToICS(user_move); - } - - void - CoordsToComputerAlgebraic(rf, ff, rt, ft, promoChar, move) - int rf, ff, rt, ft; - char promoChar; - char move[7]; - { - if (rf == DROP_RANK) { - sprintf(move, "%c@%c%c\n", - ToUpper(PieceToChar((ChessSquare) ff)), 'a' + ft, '1' + rt); - } else { - if (promoChar == 'x' || promoChar == NULLCHAR) { - sprintf(move, "%c%c%c%c\n", - 'a' + ff, '1' + rf, 'a' + ft, '1' + rt); - } else { - sprintf(move, "%c%c%c%c%c\n", - 'a' + ff, '1' + rf, 'a' + ft, '1' + rt, promoChar); - } - } - } - - void - ProcessICSInitScript(f) - FILE *f; - { - char buf[MSG_SIZ]; - - while (fgets(buf, MSG_SIZ, f)) { - SendToICSDelayed(buf,(long)appData.msLoginDelay); - } - - fclose(f); - } - - - /* Parser for moves from gnuchess, ICS, or user typein box */ - Boolean - ParseOneMove(move, moveNum, moveType, fromX, fromY, toX, toY, promoChar) - char *move; - int moveNum; - ChessMove *moveType; - int *fromX, *fromY, *toX, *toY; - char *promoChar; - { - *moveType = yylexstr(moveNum, move); - switch (*moveType) { - case WhitePromotionQueen: - case BlackPromotionQueen: - case WhitePromotionRook: - case BlackPromotionRook: - case WhitePromotionBishop: - case BlackPromotionBishop: - case WhitePromotionKnight: - case BlackPromotionKnight: - case WhitePromotionKing: - case BlackPromotionKing: - case NormalMove: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - case IllegalMove: /* bug or odd chess variant */ - *fromX = currentMoveString[0] - 'a'; - *fromY = currentMoveString[1] - '1'; - *toX = currentMoveString[2] - 'a'; - *toY = currentMoveString[3] - '1'; - *promoChar = currentMoveString[4]; - if (*fromX < 0 || *fromX > 7 || *fromY < 0 || *fromY > 7 || - *toX < 0 || *toX > 7 || *toY < 0 || *toY > 7) { - *fromX = *fromY = *toX = *toY = 0; - return FALSE; - } - if (appData.testLegality) { - return (*moveType != IllegalMove); - } else { - return !(fromX == fromY && toX == toY); - } - - case WhiteDrop: - case BlackDrop: - *fromX = *moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - *fromY = DROP_RANK; - *toX = currentMoveString[2] - 'a'; - *toY = currentMoveString[3] - '1'; - *promoChar = NULLCHAR; - return TRUE; - - case AmbiguousMove: - case ImpossibleMove: - case (ChessMove) 0: /* end of file */ - case ElapsedTime: - case Comment: - case PGNTag: - case NAG: - case WhiteWins: - case BlackWins: - case GameIsDrawn: - default: - /* bug? */ - *fromX = *fromY = *toX = *toY = 0; - *promoChar = NULLCHAR; - return FALSE; - } - } - - - void - InitPosition(redraw) - int redraw; - { - currentMove = forwardMostMove = backwardMostMove = 0; - switch (gameInfo.variant) { - default: - CopyBoard(boards[0], initialPosition); - break; - case VariantTwoKings: - CopyBoard(boards[0], twoKingsPosition); - startedFromSetupPosition = TRUE; - break; - case VariantWildCastle: - CopyBoard(boards[0], initialPosition); - /* !!?shuffle with kings guaranteed to be on d or e file */ - break; - case VariantNoCastle: - CopyBoard(boards[0], initialPosition); - /* !!?unconstrained back-rank shuffle */ - break; - case VariantFischeRandom: - CopyBoard(boards[0], initialPosition); - /* !!shuffle according to FR rules */ - break; - } - if (redraw) - DrawPosition(FALSE, boards[currentMove]); - } - - void - SendBoard(cps, moveNum) - ChessProgramState *cps; - int moveNum; - { - char message[MSG_SIZ]; - - if (cps->useSetboard) { - char* fen = PositionToFEN(moveNum); - sprintf(message, "setboard %s\n", fen); - SendToProgram(message, cps); - free(fen); - - } else { - ChessSquare *bp; - int i, j; - /* Kludge to set black to move, avoiding the troublesome and now - * deprecated "black" command. - */ - if (!WhiteOnMove(moveNum)) SendToProgram("a2a3\n", cps); - - SendToProgram("edit\n", cps); - SendToProgram("#\n", cps); - for (i = BOARD_SIZE - 1; i >= 0; i--) { - bp = &boards[moveNum][i][0]; - for (j = 0; j < BOARD_SIZE; j++, bp++) { - if ((int) *bp < (int) BlackPawn) { - sprintf(message, "%c%c%c\n", PieceToChar(*bp), - 'a' + j, '1' + i); - SendToProgram(message, cps); - } - } - } - - SendToProgram("c\n", cps); - for (i = BOARD_SIZE - 1; i >= 0; i--) { - bp = &boards[moveNum][i][0]; - for (j = 0; j < BOARD_SIZE; j++, bp++) { - if (((int) *bp != (int) EmptySquare) - && ((int) *bp >= (int) BlackPawn)) { - sprintf(message, "%c%c%c\n", ToUpper(PieceToChar(*bp)), - 'a' + j, '1' + i); - SendToProgram(message, cps); - } - } - } - - SendToProgram(".\n", cps); - } - } - - int - IsPromotion(fromX, fromY, toX, toY) - int fromX, fromY, toX, toY; - { - return gameMode != EditPosition && - fromX >=0 && fromY >= 0 && toX >= 0 && toY >= 0 && - ((boards[currentMove][fromY][fromX] == WhitePawn && toY == 7) || - (boards[currentMove][fromY][fromX] == BlackPawn && toY == 0)); - } - - - int - PieceForSquare (x, y) - int x; - int y; - { - if (x < 0 || x >= BOARD_SIZE || y < 0 || y >= BOARD_SIZE) - return -1; - else - return boards[currentMove][y][x]; - } - - int - OKToStartUserMove(x, y) - int x, y; - { - ChessSquare from_piece; - int white_piece; - - if (matchMode) return FALSE; - if (gameMode == EditPosition) return TRUE; - - if (x >= 0 && y >= 0) - from_piece = boards[currentMove][y][x]; - else - from_piece = EmptySquare; - - if (from_piece == EmptySquare) return FALSE; - - white_piece = (int)from_piece >= (int)WhitePawn && - (int)from_piece <= (int)WhiteKing; - - switch (gameMode) { - case PlayFromGameFile: - case AnalyzeFile: - case TwoMachinesPlay: - case EndOfGame: - return FALSE; - - case IcsObserving: - case IcsIdle: - return FALSE; - - case MachinePlaysWhite: - case IcsPlayingBlack: - if (appData.zippyPlay) return FALSE; - if (white_piece) { - DisplayMoveError(_("You are playing Black")); - return FALSE; - } - break; - - case MachinePlaysBlack: - case IcsPlayingWhite: - if (appData.zippyPlay) return FALSE; - if (!white_piece) { - DisplayMoveError(_("You are playing White")); - return FALSE; - } - break; - - case EditGame: - if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return FALSE; - } - if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return FALSE; - } - if (cmailMsgLoaded && (currentMove < cmailOldMove)) { - /* Editing correspondence game history */ - /* Could disallow this or prompt for confirmation */ - cmailOldMove = -1; - } - if (currentMove < forwardMostMove) { - /* Discarding moves */ - /* Could prompt for confirmation here, - but I don't think that's such a good idea */ - forwardMostMove = currentMove; - } - break; - - case BeginningOfGame: - if (appData.icsActive) return FALSE; - if (!appData.noChessProgram) { - if (!white_piece) { - DisplayMoveError(_("You are playing White")); - return FALSE; - } - } - break; - - case Training: - if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return FALSE; - } - if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return FALSE; - } - break; - - default: - case IcsExamining: - break; - } - if (currentMove != forwardMostMove && gameMode != AnalyzeMode - && gameMode != AnalyzeFile && gameMode != Training) { - DisplayMoveError(_("Displayed position is not current")); - return FALSE; - } - return TRUE; - } - - FILE *lastLoadGameFP = NULL, *lastLoadPositionFP = NULL; - int lastLoadGameNumber = 0, lastLoadPositionNumber = 0; - int lastLoadGameUseList = FALSE; - char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ]; - ChessMove lastLoadGameStart = (ChessMove) 0; - - - void - UserMoveEvent(fromX, fromY, toX, toY, promoChar) - int fromX, fromY, toX, toY; - int promoChar; - { - ChessMove moveType; - - if (fromX < 0 || fromY < 0) return; - if ((fromX == toX) && (fromY == toY)) { - return; - } - - /* Check if the user is playing in turn. This is complicated because we - let the user "pick up" a piece before it is his turn. So the piece he - tried to pick up may have been captured by the time he puts it down! - Therefore we use the color the user is supposed to be playing in this - test, not the color of the piece that is currently on the starting - square---except in EditGame mode, where the user is playing both - sides; fortunately there the capture race can't happen. (It can - now happen in IcsExamining mode, but that's just too bad. The user - will get a somewhat confusing message in that case.) - */ - - switch (gameMode) { - case PlayFromGameFile: - case AnalyzeFile: - case TwoMachinesPlay: - case EndOfGame: - case IcsObserving: - case IcsIdle: - /* We switched into a game mode where moves are not accepted, - perhaps while the mouse button was down. */ - return; - - case MachinePlaysWhite: - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - break; - - case MachinePlaysBlack: - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - break; - - case EditGame: - case IcsExamining: - case BeginningOfGame: - case AnalyzeMode: - case Training: - if ((int) boards[currentMove][fromY][fromX] >= (int) BlackPawn && - (int) boards[currentMove][fromY][fromX] <= (int) BlackKing) { - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - } else { - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - } - break; - - case IcsPlayingBlack: - /* User is moving for Black */ - if (WhiteOnMove(currentMove)) { - if (!appData.premove) { - DisplayMoveError(_("It is White's turn")); - } else if (toX >= 0 && toY >= 0) { - premoveToX = toX; - premoveToY = toY; - premoveFromX = fromX; - premoveFromY = fromY; - premovePromoChar = promoChar; - gotPremove = 1; - if (appData.debugMode) - fprintf(debugFP, "Got premove: fromX %d," - "fromY %d, toX %d, toY %d\n", - fromX, fromY, toX, toY); - } - return; - } - break; - - case IcsPlayingWhite: - /* User is moving for White */ - if (!WhiteOnMove(currentMove)) { - if (!appData.premove) { - DisplayMoveError(_("It is Black's turn")); - } else if (toX >= 0 && toY >= 0) { - premoveToX = toX; - premoveToY = toY; - premoveFromX = fromX; - premoveFromY = fromY; - premovePromoChar = promoChar; - gotPremove = 1; - if (appData.debugMode) - fprintf(debugFP, "Got premove: fromX %d," - "fromY %d, toX %d, toY %d\n", - fromX, fromY, toX, toY); - } - return; - } - break; - - default: - break; - - case EditPosition: - if (toX == -2 || toY == -2) { - boards[0][fromY][fromX] = EmptySquare; - DrawPosition(FALSE, boards[currentMove]); - } else if (toX >= 0 && toY >= 0) { - boards[0][toY][toX] = boards[0][fromY][fromX]; - boards[0][fromY][fromX] = EmptySquare; - DrawPosition(FALSE, boards[currentMove]); - } - return; - } - - if (toX < 0 || toY < 0) return; - userOfferedDraw = FALSE; - - if (appData.testLegality) { - moveType = LegalityTest(boards[currentMove], PosFlags(currentMove), - EP_UNKNOWN, fromY, fromX, toY, toX, promoChar); - if (moveType == IllegalMove || moveType == ImpossibleMove) { - DisplayMoveError(_("Illegal move")); - return; - } - } else { - moveType = PromoCharToMoveType(WhiteOnMove(currentMove), promoChar); - } - - if (gameMode == Training) { - /* compare the move played on the board to the next move in the - * game. If they match, display the move and the opponent's response. - * If they don't match, display an error message. - */ - int saveAnimate; - Board testBoard; - CopyBoard(testBoard, boards[currentMove]); - ApplyMove(fromX, fromY, toX, toY, promoChar, testBoard); - - if (CompareBoards(testBoard, boards[currentMove+1])) { - ForwardInner(currentMove+1); - - /* Autoplay the opponent's response. - * if appData.animate was TRUE when Training mode was entered, - * the response will be animated. - */ - saveAnimate = appData.animate; - appData.animate = animateTraining; - ForwardInner(currentMove+1); - appData.animate = saveAnimate; - - /* check for the end of the game */ - if (currentMove >= forwardMostMove) { - gameMode = PlayFromGameFile; - ModeHighlight(); - SetTrainingModeOff(); - DisplayInformation(_("End of game")); - } - } else { - DisplayError(_("Incorrect move"), 0); - } - return; - } - - FinishMove(moveType, fromX, fromY, toX, toY, promoChar); - } - - /* Common tail of UserMoveEvent and DropMenuEvent */ - void - FinishMove(moveType, fromX, fromY, toX, toY, promoChar) - ChessMove moveType; - int fromX, fromY, toX, toY; - /*char*/int promoChar; - { - /* Ok, now we know that the move is good, so we can kill - the previous line in Analysis Mode */ - if (gameMode == AnalyzeMode && currentMove < forwardMostMove) { - forwardMostMove = currentMove; - } - - /* If we need the chess program but it's dead, restart it */ - ResurrectChessProgram(); - - /* A user move restarts a paused game*/ - if (pausing) - PauseEvent(); - - thinkOutput[0] = NULLCHAR; - - MakeMove(fromX, fromY, toX, toY, promoChar); /*updates forwardMostMove*/ - - if (gameMode == BeginningOfGame) { - if (appData.noChessProgram) { - gameMode = EditGame; - SetGameInfo(); - } else { - char buf[MSG_SIZ]; - gameMode = MachinePlaysBlack; - SetGameInfo(); - sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - sprintf(buf, "name %s\n", gameInfo.white); - SendToProgram(buf, &first); - } - } - ModeHighlight(); - } - - /* Relay move to ICS or chess engine */ - if (appData.icsActive) { - if (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || - gameMode == IcsExamining) { - SendMoveToICS(moveType, fromX, fromY, toX, toY); - ics_user_moved = 1; - } - } else { - if (first.sendTime && (gameMode == BeginningOfGame || - gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack)) { - SendTimeRemaining(&first, gameMode != MachinePlaysBlack); - } - SendMoveToProgram(forwardMostMove-1, &first); - if (gameMode != EditGame && gameMode != PlayFromGameFile) { - first.maybeThinking = TRUE; - } - if (currentMove == cmailOldMove + 1) { - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } - - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - - switch (gameMode) { - case EditGame: - switch (MateTest(boards[currentMove], PosFlags(currentMove), - EP_UNKNOWN)) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_PLAYER); - } else { - GameEnds(WhiteWins, "White mates", GE_PLAYER); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); - break; - } - break; - - case MachinePlaysBlack: - case MachinePlaysWhite: - /* disable certain menu options while machine is thinking */ - SetMachineThinkingEnables(); - break; - - default: - break; - } - } - - void - HandleMachineMove(message, cps) - char *message; - ChessProgramState *cps; - { - char machineMove[MSG_SIZ], buf1[MSG_SIZ*10], buf2[MSG_SIZ]; - char realname[MSG_SIZ]; - int fromX, fromY, toX, toY; - ChessMove moveType; - char promoChar; - char *p; - int machineWhite; - - /* - * Kludge to ignore BEL characters - */ - while (*message == '\007') message++; - - /* - * Look for book output - */ - if (cps == &first && bookRequested) { - if (message[0] == '\t' || message[0] == ' ') { - /* Part of the book output is here; append it */ - strcat(bookOutput, message); - strcat(bookOutput, " \n"); - return; - } else if (bookOutput[0] != NULLCHAR) { - /* All of book output has arrived; display it */ - char *p = bookOutput; - while (*p != NULLCHAR) { - if (*p == '\t') *p = ' '; - p++; - } - DisplayInformation(bookOutput); - bookRequested = FALSE; - /* Fall through to parse the current output */ - } - } - - /* - * Look for machine move. - */ - if ((sscanf(message, "%s %s %s", buf1, buf2, machineMove) == 3 && - strcmp(buf2, "...") == 0) || - (sscanf(message, "%s %s", buf1, machineMove) == 2 && - strcmp(buf1, "move") == 0)) { - - /* This method is only useful on engines that support ping */ - if (cps->lastPing != cps->lastPong) { - if (gameMode == BeginningOfGame) { - /* Extra move from before last new; ignore */ - if (appData.debugMode) { - fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); - } - } else { - if (appData.debugMode) { - fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", - cps->which, gameMode); - } - SendToProgram("undo\n", cps); - } - return; - } - - switch (gameMode) { - case BeginningOfGame: - /* Extra move from before last reset; ignore */ - if (appData.debugMode) { - fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); - } - return; - - case EndOfGame: - case IcsIdle: - default: - /* Extra move after we tried to stop. The mode test is - not a reliable way of detecting this problem, but it's - the best we can do on engines that don't support ping. - */ - if (appData.debugMode) { - fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", - cps->which, gameMode); - } - SendToProgram("undo\n", cps); - return; - - case MachinePlaysWhite: - case IcsPlayingWhite: - machineWhite = TRUE; - break; - - case MachinePlaysBlack: - case IcsPlayingBlack: - machineWhite = FALSE; - break; - - case TwoMachinesPlay: - machineWhite = (cps->twoMachinesColor[0] == 'w'); - break; - } - if (WhiteOnMove(forwardMostMove) != machineWhite) { - if (appData.debugMode) { - fprintf(debugFP, - "Ignoring move out of turn by %s, gameMode %d" - ", forwardMost %d\n", - cps->which, gameMode, forwardMostMove); - } - return; - } - - if (!ParseOneMove(machineMove, forwardMostMove, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - /* Machine move could not be parsed; ignore it. */ - sprintf(buf1, _("Illegal move \"%s\" from %s machine"), - machineMove, cps->which); - DisplayError(buf1, 0); - if (gameMode == TwoMachinesPlay) { - GameEnds(machineWhite ? BlackWins : WhiteWins, - "Forfeit due to illegal move", GE_XBOARD); - } - return; - } - - hintRequested = FALSE; - lastHint[0] = NULLCHAR; - bookRequested = FALSE; - /* Program may be pondering now */ - cps->maybeThinking = TRUE; - if (cps->sendTime == 2) cps->sendTime = 1; - if (cps->offeredDraw) cps->offeredDraw--; - - #if ZIPPY - if ((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack) && - first.initDone) { - SendMoveToICS(moveType, fromX, fromY, toX, toY); - ics_user_moved = 1; - } - #endif - /* currentMoveString is set as a side-effect of ParseOneMove */ - strcpy(machineMove, currentMoveString); - strcat(machineMove, "\n"); - strcpy(moveList[forwardMostMove], machineMove); - - MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/ - - if (gameMode == TwoMachinesPlay) { - if (cps->other->sendTime) { - SendTimeRemaining(cps->other, - cps->other->twoMachinesColor[0] == 'w'); - } - SendMoveToProgram(forwardMostMove-1, cps->other); - if (firstMove) { - firstMove = FALSE; - if (cps->other->useColors) { - SendToProgram(cps->other->twoMachinesColor, cps->other); - } - SendToProgram("go\n", cps->other); - } - cps->other->maybeThinking = TRUE; - } - - ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ - if (!pausing && appData.ringBellAfterMoves) { - RingBell(); - } - /* - * Reenable menu items that were disabled while - * machine was thinking - */ - if (gameMode != TwoMachinesPlay) - SetUserThinkingEnables(); - return; - } - - /* Set special modes for chess engines. Later something general - * could be added here; for now there is just one kludge feature, - * needed because Crafty 15.10 and earlier don't ignore SIGINT - * when "xboard" is given as an interactive command. - */ - if (strncmp(message, "kibitz Hello from Crafty", 24) == 0) { - cps->useSigint = FALSE; - cps->useSigterm = FALSE; - } - - /* - * Look for communication commands - */ - if (!strncmp(message, "telluser ", 9)) { - DisplayNote(message + 9); - return; - } - if (!strncmp(message, "tellusererror ", 14)) { - DisplayError(message + 14, 0); - return; - } - if (!strncmp(message, "tellopponent ", 13)) { - if (appData.icsActive) { - if (loggedOn) { - sprintf(buf1, "%ssay %s\n", ics_prefix, message + 13); - SendToICS(buf1); - } - } else { - DisplayNote(message + 13); - } - return; - } - if (!strncmp(message, "tellothers ", 11)) { - if (appData.icsActive) { - if (loggedOn) { - sprintf(buf1, "%swhisper %s\n", ics_prefix, message + 11); - SendToICS(buf1); - } - } - return; - } - if (!strncmp(message, "tellall ", 8)) { - if (appData.icsActive) { - if (loggedOn) { - sprintf(buf1, "%skibitz %s\n", ics_prefix, message + 8); - SendToICS(buf1); - } - } else { - DisplayNote(message + 8); - } - return; - } - if (strncmp(message, "warning", 7) == 0) { - /* Undocumented feature, use tellusererror in new code */ - DisplayError(message, 0); - return; - } - if (sscanf(message, "askuser %s %[^\n]", buf1, buf2) == 2) { - strcpy(realname, cps->tidy); - strcat(realname, " query"); - AskQuestion(realname, buf2, buf1, cps->pr); - return; - } - /* Commands from the engine directly to ICS. We don't allow these to be - * sent until we are logged on. Crafty kibitzes have been known to - * interfere with the login process. - */ - if (loggedOn) { - if (!strncmp(message, "tellics ", 8)) { - SendToICS(message + 8); - SendToICS("\n"); - return; - } - if (!strncmp(message, "tellicsnoalias ", 15)) { - SendToICS(ics_prefix); - SendToICS(message + 15); - SendToICS("\n"); - return; - } - /* The following are for backward compatibility only */ - if (!strncmp(message,"whisper",7) || !strncmp(message,"kibitz",6) || - !strncmp(message,"draw",4) || !strncmp(message,"tell",3)) { - SendToICS(ics_prefix); - SendToICS(message); - SendToICS("\n"); - return; - } - } - if (strncmp(message, "feature ", 8) == 0) { - ParseFeatures(message+8, cps); - } - if (sscanf(message, "pong %d", &cps->lastPong) == 1) { - return; - } - /* - * If the move is illegal, cancel it and redraw the board. - * Also deal with other error cases. Matching is rather loose - * here to accommodate engines written before the spec. - */ - if (strncmp(message + 1, "llegal move", 11) == 0 || - strncmp(message, "Error", 5) == 0) { - if (StrStr(message, "name") || - StrStr(message, "rating") || StrStr(message, "?") || - StrStr(message, "result") || StrStr(message, "board") || - StrStr(message, "bk") || StrStr(message, "computer") || - StrStr(message, "variant") || StrStr(message, "hint") || - StrStr(message, "random") || StrStr(message, "depth") || - StrStr(message, "accepted")) { - return; - } - if (StrStr(message, "protover")) { - /* Program is responding to input, so it's apparently done - initializing, and this error message indicates it is - protocol version 1. So we don't need to wait any longer - for it to initialize and send feature commands. */ - FeatureDone(cps, 1); - cps->protocolVersion = 1; - return; - } - cps->maybeThinking = FALSE; - - if (StrStr(message, "draw")) { - /* Program doesn't have "draw" command */ - cps->sendDrawOffers = 0; - return; - } - if (cps->sendTime != 1 && - (StrStr(message, "time") || StrStr(message, "otim"))) { - /* Program apparently doesn't have "time" or "otim" command */ - cps->sendTime = 0; - return; - } - if (StrStr(message, "analyze")) { - cps->analysisSupport = FALSE; - cps->analyzing = FALSE; - Reset(FALSE, TRUE); - sprintf(buf2, "%s does not support analysis", cps->tidy); - DisplayError(buf2, 0); - return; - } - if (StrStr(message, "(no matching move)st")) { - /* Special kludge for GNU Chess 4 only */ - cps->stKludge = TRUE; - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - return; - } - if (StrStr(message, "(no matching move)sd")) { - /* Special kludge for GNU Chess 4 only */ - cps->sdKludge = TRUE; - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - return; - } - if (!StrStr(message, "llegal")) return; - if (gameMode == BeginningOfGame || gameMode == EndOfGame || - gameMode == IcsIdle) return; - if (forwardMostMove <= backwardMostMove) return; - #if 0 - /* Following removed: it caused a bug where a real illegal move - message in analyze mored would be ignored. */ - if (cps == &first && programStats.ok_to_send == 0) { - /* Bogus message from Crafty responding to "." This filtering - can miss some of the bad messages, but fortunately the bug - is fixed in current Crafty versions, so it doesn't matter. */ - return; - } - #endif - if (pausing) PauseEvent(); - if (gameMode == PlayFromGameFile) { - /* Stop reading this game file */ - gameMode = EditGame; - ModeHighlight(); - } - currentMove = --forwardMostMove; - DisplayMove(currentMove-1); /* before DisplayMoveError */ - SwitchClocks(); - DisplayBothClocks(); - sprintf(buf1, _("Illegal move \"%s\" (rejected by %s chess program)"), - parseList[currentMove], cps->which); - DisplayMoveError(buf1); - DrawPosition(FALSE, boards[currentMove]); - return; - } - if (strncmp(message, "time", 4) == 0 && StrStr(message, "Illegal")) { - /* Program has a broken "time" command that - outputs a string not ending in newline. - Don't use it. */ - cps->sendTime = 0; - } - - /* - * If chess program startup fails, exit with an error message. - * Attempts to recover here are futile. - */ - if ((StrStr(message, "unknown host") != NULL) - || (StrStr(message, "No remote directory") != NULL) - || (StrStr(message, "not found") != NULL) - || (StrStr(message, "No such file") != NULL) - || (StrStr(message, "can't alloc") != NULL) - || (StrStr(message, "Permission denied") != NULL)) { - - cps->maybeThinking = FALSE; - sprintf(buf1, _("Failed to start %s chess program %s on %s: %s\n"), - cps->which, cps->program, cps->host, message); - RemoveInputSource(cps->isr); - DisplayFatalError(buf1, 0, 1); - return; - } - - /* - * Look for hint output - */ - if (sscanf(message, "Hint: %s", buf1) == 1) { - if (cps == &first && hintRequested) { - hintRequested = FALSE; - if (ParseOneMove(buf1, forwardMostMove, &moveType, - &fromX, &fromY, &toX, &toY, &promoChar)) { - (void) CoordsToAlgebraic(boards[forwardMostMove], - PosFlags(forwardMostMove), EP_UNKNOWN, - fromY, fromX, toY, toX, promoChar, buf1); - sprintf(buf2, "Hint: %s", buf1); - DisplayInformation(buf2); - } else { - /* Hint move could not be parsed!? */ - sprintf(buf2, - _("Illegal hint move \"%s\"\nfrom %s chess program"), - buf1, cps->which); - DisplayError(buf2, 0); - } - } else { - strcpy(lastHint, buf1); - } - return; - } - - /* - * Ignore other messages if game is not in progress - */ - if (gameMode == BeginningOfGame || gameMode == EndOfGame || - gameMode == IcsIdle || cps->lastPing != cps->lastPong) return; - - /* - * look for win, lose, draw, or draw offer - */ - if (strncmp(message, "1-0", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - GameEnds(WhiteWins, r, GE_ENGINE); - return; - } else if (strncmp(message, "0-1", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - /* Kludge for Arasan 4.1 bug */ - if (strcmp(r, "Black resigns") == 0) { - GameEnds(WhiteWins, r, GE_ENGINE); - return; - } - GameEnds(BlackWins, r, GE_ENGINE); - return; - } else if (strncmp(message, "1/2", 3) == 0) { - char *p, *q, *r = ""; - p = strchr(message, '{'); - if (p) { - q = strchr(p, '}'); - if (q) { - *q = NULLCHAR; - r = p + 1; - } - } - GameEnds(GameIsDrawn, r, GE_ENGINE); - return; - - } else if (strncmp(message, "White resign", 12) == 0) { - GameEnds(BlackWins, "White resigns", GE_ENGINE); - return; - } else if (strncmp(message, "Black resign", 12) == 0) { - GameEnds(WhiteWins, "Black resigns", GE_ENGINE); - return; - } else if (strncmp(message, "White", 5) == 0 && - message[5] != '(' && - StrStr(message, "Black") == NULL) { - GameEnds(WhiteWins, "White mates", GE_ENGINE); - return; - } else if (strncmp(message, "Black", 5) == 0 && - message[5] != '(') { - GameEnds(BlackWins, "Black mates", GE_ENGINE); - return; - } else if (strcmp(message, "resign") == 0 || - strcmp(message, "computer resigns") == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(WhiteWins, "Black resigns", GE_ENGINE); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(BlackWins, "White resigns", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(BlackWins, "White resigns", GE_ENGINE); - else - GameEnds(WhiteWins, "Black resigns", GE_ENGINE); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "opponent mates", 14) == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(WhiteWins, "White mates", GE_ENGINE); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(BlackWins, "Black mates", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(BlackWins, "Black mates", GE_ENGINE); - else - GameEnds(WhiteWins, "White mates", GE_ENGINE); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "computer mates", 14) == 0) { - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - GameEnds(BlackWins, "Black mates", GE_ENGINE); - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - GameEnds(WhiteWins, "White mates", GE_ENGINE); - break; - case TwoMachinesPlay: - if (cps->twoMachinesColor[0] == 'w') - GameEnds(WhiteWins, "White mates", GE_ENGINE); - else - GameEnds(BlackWins, "Black mates", GE_ENGINE); - break; - default: - /* can't happen */ - break; - } - return; - } else if (strncmp(message, "checkmate", 9) == 0) { - if (WhiteOnMove(forwardMostMove)) { - GameEnds(BlackWins, "Black mates", GE_ENGINE); - } else { - GameEnds(WhiteWins, "White mates", GE_ENGINE); - } - return; - } else if (strstr(message, "Draw") != NULL || - strstr(message, "game is a draw") != NULL) { - GameEnds(GameIsDrawn, "Draw", GE_ENGINE); - return; - } else if (strstr(message, "offer") != NULL && - strstr(message, "draw") != NULL) { - #if ZIPPY - if (appData.zippyPlay && first.initDone) { - /* Relay offer to ICS */ - SendToICS(ics_prefix); - SendToICS("draw\n"); - } - #endif - cps->offeredDraw = 2; /* valid until this engine moves twice */ - if (gameMode == TwoMachinesPlay) { - if (cps->other->offeredDraw) { - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - } else { - if (cps->other->sendDrawOffers) { - SendToProgram("draw\n", cps->other); - } - } - } else if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack) { - if (userOfferedDraw) { - DisplayInformation(_("Machine accepts your draw offer")); - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - } else { - DisplayInformation(_("Machine offers a draw\nSelect Action / Draw to agree")); - } - } - } - - - /* - * Look for thinking output - */ - if (appData.showThinking) { - int plylev, mvleft, mvtot, curscore, time; - char mvname[MOVE_LEN]; - u64 nodes; - char plyext; - int ignore = FALSE; - int prefixHint = FALSE; - mvname[0] = NULLCHAR; - - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - if (WhiteOnMove(forwardMostMove)) prefixHint = TRUE; - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - if (!WhiteOnMove(forwardMostMove)) prefixHint = TRUE; - break; - case AnalyzeMode: - case AnalyzeFile: - break; - /* icsEngineAnalyze */ - case IcsObserving: - if (!appData.icsEngineAnalyze) ignore = TRUE; - break; - case TwoMachinesPlay: - if ((cps->twoMachinesColor[0] == 'w') != - WhiteOnMove(forwardMostMove)) { - ignore = TRUE; - } - break; - default: - ignore = TRUE; - break; - } - - if (!ignore) { - buf1[0] = NULLCHAR; - if (sscanf(message, "%d%c %d %d" u64Display "%[^\n]\n", - &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) { - - if (plyext != ' ' && plyext != '\t') { - time *= 100; - } - programStats.depth = plylev; - programStats.nodes = nodes; - programStats.time = time; - programStats.score = curscore; - programStats.got_only_move = 0; - - /* Buffer overflow protection */ - if (buf1[0] != NULLCHAR) { - if (strlen(buf1) >= sizeof(programStats.movelist) - && appData.debugMode) { - fprintf(debugFP, - "PV is too long; using the first %d bytes.\n", - sizeof(programStats.movelist) - 1); - } - strncpy(programStats.movelist, buf1, - sizeof(programStats.movelist)); - programStats.movelist[sizeof(programStats.movelist) - 1] - = NULLCHAR; - } else { - sprintf(programStats.movelist, " no PV\n"); - } - - if (programStats.seen_stat) { - programStats.ok_to_send = 1; - } - - if (strchr(programStats.movelist, '(') != NULL) { - programStats.line_is_book = 1; - programStats.nr_moves = 0; - programStats.moves_left = 0; - } else { - programStats.line_is_book = 0; - } - - sprintf(thinkOutput, "[%d]%c%+.2f %s%s%s", - plylev, - (gameMode == TwoMachinesPlay ? - ToUpper(cps->twoMachinesColor[0]) : ' '), - ((double) curscore) / 100.0, - prefixHint ? lastHint : "", - prefixHint ? " " : "", programStats.movelist); - - if (currentMove == forwardMostMove || gameMode == AnalyzeMode - || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - DisplayAnalysis(); - } - return; - - } else if ((p=StrStr(message, "(only move)")) != NULL) { - /* crafty (9.25+) says "(only move) " - * if there is only 1 legal move - */ - sscanf(p, "(only move) %s", buf1); - sprintf(thinkOutput, "%s (only move)", buf1); - sprintf(programStats.movelist, "%s (only move)", buf1); - programStats.depth = 1; - programStats.nr_moves = 1; - programStats.moves_left = 1; - programStats.nodes = 1; - programStats.time = 1; - programStats.got_only_move = 1; - - /* Not really, but we also use this member to - mean "line isn't going to change" (Crafty - isn't searching, so stats won't change) */ - programStats.line_is_book = 1; - - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || - gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - DisplayAnalysis(); - } - return; - } else if (sscanf(message,"stat01: %d" u64Display "%d %d %d %s", - &time, &nodes, &plylev, &mvleft, - &mvtot, mvname) >= 5) { - /* The stat01: line is from Crafty (9.29+) in response - to the "." command */ - programStats.seen_stat = 1; - cps->maybeThinking = TRUE; - - if (programStats.got_only_move || !appData.periodicUpdates) - return; - - programStats.depth = plylev; - programStats.time = time; - programStats.nodes = nodes; - programStats.moves_left = mvleft; - programStats.nr_moves = mvtot; - strcpy(programStats.move_name, mvname); - programStats.ok_to_send = 1; - DisplayAnalysis(); - return; - - } else if (strncmp(message,"++",2) == 0) { - /* Crafty 9.29+ outputs this */ - programStats.got_fail = 2; - return; - - } else if (strncmp(message,"--",2) == 0) { - /* Crafty 9.29+ outputs this */ - programStats.got_fail = 1; - return; - - } else if (thinkOutput[0] != NULLCHAR && - strncmp(message, " ", 4) == 0) { - p = message; - while (*p && *p == ' ') p++; - strcat(thinkOutput, " "); - strcat(thinkOutput, p); - strcat(programStats.movelist, " "); - strcat(programStats.movelist, p); - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || - gameMode == AnalyzeFile || appData.icsEngineAnalyze) { - DisplayMove(currentMove - 1); - DisplayAnalysis(); - } - return; - } - } - } - } - - - /* Parse a game score from the character string "game", and - record it as the history of the current game. The game - score is NOT assumed to start from the standard position. - The display is not updated in any way. - */ - void - ParseGameHistory(game) - char *game; - { - ChessMove moveType; - int fromX, fromY, toX, toY, boardIndex; - char promoChar; - char *p, *q; - char buf[MSG_SIZ]; - - if (appData.debugMode) - fprintf(debugFP, "Parsing game history: %s\n", game); - - if (gameInfo.event == NULL) gameInfo.event = StrSave("ICS game"); - gameInfo.site = StrSave(appData.icsHost); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - - /* Parse out names of players */ - while (*game == ' ') game++; - p = buf; - while (*game != ' ') *p++ = *game++; - *p = NULLCHAR; - gameInfo.white = StrSave(buf); - while (*game == ' ') game++; - p = buf; - while (*game != ' ' && *game != '\n') *p++ = *game++; - *p = NULLCHAR; - gameInfo.black = StrSave(buf); - - /* Parse moves */ - boardIndex = blackPlaysFirst ? 1 : 0; - yynewstr(game); - for (;;) { - yyboardindex = boardIndex; - moveType = (ChessMove) yylex(); - switch (moveType) { - case WhitePromotionQueen: - case BlackPromotionQueen: - case WhitePromotionRook: - case BlackPromotionRook: - case WhitePromotionBishop: - case BlackPromotionBishop: - case WhitePromotionKnight: - case BlackPromotionKnight: - case WhitePromotionKing: - case BlackPromotionKing: - case NormalMove: - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - case IllegalMove: /* maybe suicide chess, etc. */ - fromX = currentMoveString[0] - 'a'; - fromY = currentMoveString[1] - '1'; - toX = currentMoveString[2] - 'a'; - toY = currentMoveString[3] - '1'; - promoChar = currentMoveString[4]; - break; - case WhiteDrop: - case BlackDrop: - fromX = moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - fromY = DROP_RANK; - toX = currentMoveString[2] - 'a'; - toY = currentMoveString[3] - '1'; - promoChar = NULLCHAR; - break; - case AmbiguousMove: - /* bug? */ - sprintf(buf, _("Ambiguous move in ICS output: \"%s\""), yy_text); - DisplayError(buf, 0); - return; - case ImpossibleMove: - /* bug? */ - sprintf(buf, _("Illegal move in ICS output: \"%s\""), yy_text); - DisplayError(buf, 0); - return; - case (ChessMove) 0: /* end of file */ - if (boardIndex < backwardMostMove) { - /* Oops, gap. How did that happen? */ - DisplayError(_("Gap in move list"), 0); - return; - } - backwardMostMove = blackPlaysFirst ? 1 : 0; - if (boardIndex > forwardMostMove) { - forwardMostMove = boardIndex; - } - return; - case ElapsedTime: - if (boardIndex > (blackPlaysFirst ? 1 : 0)) { - strcat(parseList[boardIndex-1], " "); - strcat(parseList[boardIndex-1], yy_text); - } - continue; - case Comment: - case PGNTag: - case NAG: - default: - /* ignore */ - continue; - case WhiteWins: - case BlackWins: - case GameIsDrawn: - case GameUnfinished: - if (gameMode == IcsExamining) { - if (boardIndex < backwardMostMove) { - /* Oops, gap. How did that happen? */ - return; - } - backwardMostMove = blackPlaysFirst ? 1 : 0; - return; - } - gameInfo.result = moveType; - p = strchr(yy_text, '{'); - if (p == NULL) p = strchr(yy_text, '('); - if (p == NULL) { - p = yy_text; - if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; - } else { - q = strchr(p, *p == '{' ? '}' : ')'); - if (q != NULL) *q = NULLCHAR; - p++; - } - gameInfo.resultDetails = StrSave(p); - continue; - } - if (boardIndex >= forwardMostMove && - !(gameMode == IcsObserving && ics_gamenum == -1)) { - backwardMostMove = blackPlaysFirst ? 1 : 0; - return; - } - (void) CoordsToAlgebraic(boards[boardIndex], PosFlags(boardIndex), - EP_UNKNOWN, fromY, fromX, toY, toX, promoChar, - parseList[boardIndex]); - CopyBoard(boards[boardIndex + 1], boards[boardIndex]); - /* currentMoveString is set as a side-effect of yylex */ - strcpy(moveList[boardIndex], currentMoveString); - strcat(moveList[boardIndex], "\n"); - boardIndex++; - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[boardIndex]); - switch (MateTest(boards[boardIndex], - PosFlags(boardIndex), EP_UNKNOWN)) { - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - strcat(parseList[boardIndex - 1], "+"); - break; - case MT_CHECKMATE: - strcat(parseList[boardIndex - 1], "#"); - break; - } - } - } - - - /* Apply a move to the given board */ - void - ApplyMove(fromX, fromY, toX, toY, promoChar, board) - int fromX, fromY, toX, toY; - int promoChar; - Board board; - { - ChessSquare captured = board[toY][toX]; - if (fromY == DROP_RANK) { - /* must be first */ - board[toY][toX] = (ChessSquare) fromX; - } else if (fromX == toX && fromY == toY) { - return; - } else if (fromY == 0 && fromX == 4 - && board[fromY][fromX] == WhiteKing - && toY == 0 && toX == 6) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhiteKing; - board[fromY][7] = EmptySquare; - board[toY][5] = WhiteRook; - } else if (fromY == 0 && fromX == 4 - && board[fromY][fromX] == WhiteKing - && toY == 0 && toX == 2) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhiteKing; - board[fromY][0] = EmptySquare; - board[toY][3] = WhiteRook; - } else if (fromY == 0 && fromX == 3 - && board[fromY][fromX] == WhiteKing - && toY == 0 && toX == 5) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhiteKing; - board[fromY][7] = EmptySquare; - board[toY][4] = WhiteRook; - } else if (fromY == 0 && fromX == 3 - && board[fromY][fromX] == WhiteKing - && toY == 0 && toX == 1) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhiteKing; - board[fromY][0] = EmptySquare; - board[toY][2] = WhiteRook; - } else if (board[fromY][fromX] == WhitePawn - && toY == 7) { - /* white pawn promotion */ - board[7][toX] = CharToPiece(ToUpper(promoChar)); - if (board[7][toX] == EmptySquare) { - board[7][toX] = WhiteQueen; - } - board[fromY][fromX] = EmptySquare; - } else if ((fromY == 4) - && (toX != fromX) - && (board[fromY][fromX] == WhitePawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = WhitePawn; - captured = board[toY - 1][toX]; - board[toY - 1][toX] = EmptySquare; - } else if (fromY == 7 && fromX == 4 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 6) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][7] = EmptySquare; - board[toY][5] = BlackRook; - } else if (fromY == 7 && fromX == 4 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 2) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][0] = EmptySquare; - board[toY][3] = BlackRook; - } else if (fromY == 7 && fromX == 3 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 5) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][7] = EmptySquare; - board[toY][4] = BlackRook; - } else if (fromY == 7 && fromX == 3 - && board[fromY][fromX] == BlackKing - && toY == 7 && toX == 1) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackKing; - board[fromY][0] = EmptySquare; - board[toY][2] = BlackRook; - } else if (board[fromY][fromX] == BlackPawn - && toY == 0) { - /* black pawn promotion */ - board[0][toX] = CharToPiece(ToLower(promoChar)); - if (board[0][toX] == EmptySquare) { - board[0][toX] = BlackQueen; - } - board[fromY][fromX] = EmptySquare; - } else if ((fromY == 3) - && (toX != fromX) - && (board[fromY][fromX] == BlackPawn) - && (board[toY][toX] == EmptySquare)) { - board[fromY][fromX] = EmptySquare; - board[toY][toX] = BlackPawn; - captured = board[toY + 1][toX]; - board[toY + 1][toX] = EmptySquare; - } else { - board[toY][toX] = board[fromY][fromX]; - board[fromY][fromX] = EmptySquare; - } - if (gameInfo.variant == VariantCrazyhouse) { - #if 0 - /* !!A lot more code needs to be written to support holdings */ - if (fromY == DROP_RANK) { - /* Delete from holdings */ - if (holdings[(int) fromX] > 0) holdings[(int) fromX]--; - } - if (captured != EmptySquare) { - /* Add to holdings */ - if (captured < BlackPawn) { - holdings[(int)captured - (int)BlackPawn + (int)WhitePawn]++; - } else { - holdings[(int)captured - (int)WhitePawn + (int)BlackPawn]++; - } - } - #endif - } else if (gameInfo.variant == VariantAtomic) { - if (captured != EmptySquare) { - int y, x; - for (y = toY-1; y <= toY+1; y++) { - for (x = toX-1; x <= toX+1; x++) { - if (y >= 0 && y <= 7 && x >= 0 && x <= 7 && - board[y][x] != WhitePawn && board[y][x] != BlackPawn) { - board[y][x] = EmptySquare; - } - } - } - board[toY][toX] = EmptySquare; - } - } - } - - /* Updates forwardMostMove */ - void - MakeMove(fromX, fromY, toX, toY, promoChar) - int fromX, fromY, toX, toY; - int promoChar; - { - forwardMostMove++; - if (forwardMostMove >= MAX_MOVES) { - DisplayFatalError(_("Game too long; increase MAX_MOVES and recompile"), - 0, 1); - return; - } - SwitchClocks(); - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - if (commentList[forwardMostMove] != NULL) { - free(commentList[forwardMostMove]); - commentList[forwardMostMove] = NULL; - } - CopyBoard(boards[forwardMostMove], boards[forwardMostMove - 1]); - ApplyMove(fromX, fromY, toX, toY, promoChar, boards[forwardMostMove]); - gameInfo.result = GameUnfinished; - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - } - CoordsToComputerAlgebraic(fromY, fromX, toY, toX, promoChar, - moveList[forwardMostMove - 1]); - (void) CoordsToAlgebraic(boards[forwardMostMove - 1], - PosFlags(forwardMostMove - 1), EP_UNKNOWN, - fromY, fromX, toY, toX, promoChar, - parseList[forwardMostMove - 1]); - switch (MateTest(boards[forwardMostMove], - PosFlags(forwardMostMove), EP_UNKNOWN)){ - case MT_NONE: - case MT_STALEMATE: - default: - break; - case MT_CHECK: - strcat(parseList[forwardMostMove - 1], "+"); - break; - case MT_CHECKMATE: - strcat(parseList[forwardMostMove - 1], "#"); - break; - } - } - - /* Updates currentMove if not pausing */ - void - ShowMove(fromX, fromY, toX, toY) - { - int instant = (gameMode == PlayFromGameFile) ? - (matchMode || (appData.timeDelay == 0 && !pausing)) : pausing; - if (!pausing || gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { - if (!instant) { - if (forwardMostMove == currentMove + 1) { - AnimateMove(boards[forwardMostMove - 1], - fromX, fromY, toX, toY); - } - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - currentMove = forwardMostMove; - } - - if (instant) return; - DisplayMove(currentMove - 1); - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); - } - - - void - InitChessProgram(cps) - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - if (appData.noChessProgram) return; - hintRequested = FALSE; - bookRequested = FALSE; - SendToProgram(cps->initString, cps); - if (gameInfo.variant != VariantNormal && - gameInfo.variant != VariantLoadable) { - char *v = VariantName(gameInfo.variant); - if (StrStr(cps->variants, v) == NULL) { - sprintf(buf, _("Variant %s not supported by %s"), v, cps->tidy); - DisplayFatalError(buf, 0, 1); - return; - } - sprintf(buf, "variant %s\n", VariantName(gameInfo.variant)); - SendToProgram(buf, cps); - } - if (cps->sendICS) { - sprintf(buf, "ics %s\n", appData.icsActive ? appData.icsHost : "-"); - SendToProgram(buf, cps); - } - cps->maybeThinking = FALSE; - cps->offeredDraw = 0; - if (!appData.icsActive) { - SendTimeControl(cps, movesPerSession, timeControl, - timeIncrement, appData.searchDepth, - searchTime); - } - if (appData.showThinking) { - SendToProgram("post\n", cps); - } - SendToProgram("hard\n", cps); - if (!appData.ponderNextMove) { - /* Warning: "easy" is a toggle in GNU Chess, so don't send - it without being sure what state we are in first. "hard" - is not a toggle, so that one is OK. - */ - SendToProgram("easy\n", cps); - } - if (cps->usePing) { - sprintf(buf, "ping %d\n", ++cps->lastPing); - SendToProgram(buf, cps); - } - cps->initDone = TRUE; - } - - - void - StartChessProgram(cps) - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - int err; - - if (appData.noChessProgram) return; - cps->initDone = FALSE; - - if (strcmp(cps->host, "localhost") == 0) { - err = StartChildProcess(cps->program, cps->dir, &cps->pr); - } else if (*appData.remoteShell == NULLCHAR) { - err = OpenRcmd(cps->host, appData.remoteUser, cps->program, &cps->pr); - } else { - if (*appData.remoteUser == NULLCHAR) { - sprintf(buf, "%s %s %s", appData.remoteShell, cps->host, - cps->program); - } else { - sprintf(buf, "%s %s -l %s %s", appData.remoteShell, - cps->host, appData.remoteUser, cps->program); - } - err = StartChildProcess(buf, "", &cps->pr); - } - - if (err != 0) { - sprintf(buf, "Startup failure on '%s'", cps->program); - DisplayFatalError(buf, err, 1); - cps->pr = NoProc; - cps->isr = NULL; - return; - } - - cps->isr = AddInputSource(cps->pr, TRUE, ReceiveFromProgram, cps); - if (cps->protocolVersion > 1) { - sprintf(buf, "xboard\nprotover %d\n", cps->protocolVersion); - SendToProgram(buf, cps); - } else { - SendToProgram("xboard\n", cps); - } - } - - - void - TwoMachinesEventIfReady P((void)) - { - if (first.lastPing != first.lastPong) { - DisplayMessage("", "Waiting for first chess program"); - ScheduleDelayedEvent(TwoMachinesEventIfReady, 1000); - return; - } - if (second.lastPing != second.lastPong) { - DisplayMessage("", "Waiting for second chess program"); - ScheduleDelayedEvent(TwoMachinesEventIfReady, 1000); - return; - } - ThawUI(); - TwoMachinesEvent(); - } - - void - NextMatchGame P((void)) - { - Reset(FALSE, TRUE); - if (*appData.loadGameFile != NULLCHAR) { - LoadGameFromFile(appData.loadGameFile, - appData.loadGameIndex, - appData.loadGameFile, FALSE); - } else if (*appData.loadPositionFile != NULLCHAR) { - LoadPositionFromFile(appData.loadPositionFile, - appData.loadPositionIndex, - appData.loadPositionFile); - } - TwoMachinesEventIfReady(); - } - - void - GameEnds(result, resultDetails, whosays) - ChessMove result; - char *resultDetails; - int whosays; - { - GameMode nextGameMode; - int isIcsGame; - - if (appData.debugMode) { - fprintf(debugFP, "GameEnds(%d, %s, %d)\n", - result, resultDetails ? resultDetails : "(null)", whosays); - } - - if (appData.icsActive && whosays == GE_ENGINE) { - /* If we are playing on ICS, the server decides when the - game is over, but the engine can offer to draw, claim - a draw, or resign. - */ - #if ZIPPY - if (appData.zippyPlay && first.initDone) { - if (result == GameIsDrawn) { - /* In case draw still needs to be claimed */ - SendToICS(ics_prefix); - SendToICS("draw\n"); - } else if (StrCaseStr(resultDetails, "resign")) { - SendToICS(ics_prefix); - SendToICS("resign\n"); - } - } - #endif - return; - } - - /* If we're loading the game from a file, stop */ - if (whosays == GE_FILE) { - (void) StopLoadGameTimer(); - gameFileFP = NULL; - } - - /* Cancel draw offers */ - first.offeredDraw = second.offeredDraw = 0; - - /* If this is an ICS game, only ICS can really say it's done; - if not, anyone can. */ - isIcsGame = (gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == IcsObserving || - gameMode == IcsExamining); - - if (!isIcsGame || whosays == GE_ICS) { - /* OK -- not an ICS game, or ICS said it was done */ - StopClocks(); - if (!isIcsGame && !appData.noChessProgram) - SetUserThinkingEnables(); - - if (resultDetails != NULL) { - gameInfo.result = result; - gameInfo.resultDetails = StrSave(resultDetails); - - /* Tell program how game ended in case it is learning */ - if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == BeginningOfGame) { - char buf[MSG_SIZ]; - sprintf(buf, "result %s {%s}\n", PGNResult(result), - resultDetails); - if (first.pr != NoProc) { - SendToProgram(buf, &first); - } - if (second.pr != NoProc && - gameMode == TwoMachinesPlay) { - SendToProgram(buf, &second); - } - } - - /* display last move only if game was not loaded from file */ - if ((whosays != GE_FILE) && (currentMove == forwardMostMove)) - DisplayMove(currentMove - 1); - - if (forwardMostMove != 0) { - if (gameMode != PlayFromGameFile && gameMode != EditGame) { - if (*appData.saveGameFile != NULLCHAR) { - SaveGameToFile(appData.saveGameFile, TRUE); - } else if (appData.autoSaveGames) { - AutoSaveGame(); - } - if (*appData.savePositionFile != NULLCHAR) { - SavePositionToFile(appData.savePositionFile); - } - } - } - } - - if (appData.icsActive) { - if (appData.quietPlay && - (gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack)) { - SendToICS(ics_prefix); - SendToICS("set shout 1\n"); - } - nextGameMode = IcsIdle; - ics_user_moved = FALSE; - /* clean up premove. It's ugly when the game has ended and the - * premove highlights are still on the board. - */ - if (gotPremove) { - gotPremove = FALSE; - ClearPremoveHighlights(); - DrawPosition(FALSE, boards[currentMove]); - } - if (whosays == GE_ICS) { - switch (result) { - case WhiteWins: - if (gameMode == IcsPlayingWhite) - PlayIcsWinSound(); - else if(gameMode == IcsPlayingBlack) - PlayIcsLossSound(); - break; - case BlackWins: - if (gameMode == IcsPlayingBlack) - PlayIcsWinSound(); - else if(gameMode == IcsPlayingWhite) - PlayIcsLossSound(); - break; - case GameIsDrawn: - PlayIcsDrawSound(); - break; - default: - PlayIcsUnfinishedSound(); - } - } - } else if (gameMode == EditGame || - gameMode == PlayFromGameFile || - gameMode == AnalyzeMode || - gameMode == AnalyzeFile) { - nextGameMode = gameMode; - } else { - nextGameMode = EndOfGame; - } - pausing = FALSE; - ModeHighlight(); - } else { - nextGameMode = gameMode; - } - - if (appData.noChessProgram) { - gameMode = nextGameMode; - ModeHighlight(); - return; - } - - if (first.reuse) { - /* Put first chess program into idle state */ - if (first.pr != NoProc && - (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == IcsPlayingWhite || - gameMode == IcsPlayingBlack || - gameMode == BeginningOfGame)) { - SendToProgram("force\n", &first); - if (first.usePing) { - char buf[MSG_SIZ]; - sprintf(buf, "ping %d\n", ++first.lastPing); - SendToProgram(buf, &first); - } - } - } else if (result != GameUnfinished || nextGameMode == IcsIdle) { - /* Kill off first chess program */ - if (first.isr != NULL) - RemoveInputSource(first.isr); - first.isr = NULL; - - if (first.pr != NoProc) { - ExitAnalyzeMode(); - SendToProgram("quit\n", &first); - DestroyChildProcess(first.pr, first.useSigterm); - } - first.pr = NoProc; - } - if (second.reuse) { - /* Put second chess program into idle state */ - if (second.pr != NoProc && - gameMode == TwoMachinesPlay) { - SendToProgram("force\n", &second); - if (second.usePing) { - char buf[MSG_SIZ]; - sprintf(buf, "ping %d\n", ++second.lastPing); - SendToProgram(buf, &second); - } - } - } else if (result != GameUnfinished || nextGameMode == IcsIdle) { - /* Kill off second chess program */ - if (second.isr != NULL) - RemoveInputSource(second.isr); - second.isr = NULL; - - if (second.pr != NoProc) { - SendToProgram("quit\n", &second); - DestroyChildProcess(second.pr, second.useSigterm); - } - second.pr = NoProc; - } - - if (matchMode && gameMode == TwoMachinesPlay) { - switch (result) { - case WhiteWins: - if (first.twoMachinesColor[0] == 'w') { - first.matchWins++; - } else { - second.matchWins++; - } - break; - case BlackWins: - if (first.twoMachinesColor[0] == 'b') { - first.matchWins++; - } else { - second.matchWins++; - } - break; - default: - break; - } - if (matchGame < appData.matchGames) { - char *tmp; - tmp = first.twoMachinesColor; - first.twoMachinesColor = second.twoMachinesColor; - second.twoMachinesColor = tmp; - gameMode = nextGameMode; - matchGame++; - ScheduleDelayedEvent(NextMatchGame, 10000); - return; - } else { - char buf[MSG_SIZ]; - gameMode = nextGameMode; - sprintf(buf, _("Match %s vs. %s: final score %d-%d-%d"), - first.tidy, second.tidy, - first.matchWins, second.matchWins, - appData.matchGames - (first.matchWins + second.matchWins)); - DisplayFatalError(buf, 0, 0); - } - } - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && - !(nextGameMode == AnalyzeMode || nextGameMode == AnalyzeFile)) - ExitAnalyzeMode(); - gameMode = nextGameMode; - ModeHighlight(); - } - - /* Assumes program was just initialized (initString sent). - Leaves program in force mode. */ - void - FeedMovesToProgram(cps, upto) - ChessProgramState *cps; - int upto; - { - int i; - - if (appData.debugMode) - fprintf(debugFP, "Feeding %smoves %d through %d to %s chess program\n", - startedFromSetupPosition ? "position and " : "", - backwardMostMove, upto, cps->which); - SendToProgram("force\n", cps); - if (startedFromSetupPosition) { - SendBoard(cps, backwardMostMove); - } - for (i = backwardMostMove; i < upto; i++) { - SendMoveToProgram(i, cps); - } - } - - - void - ResurrectChessProgram() - { - /* The chess program may have exited. - If so, restart it and feed it all the moves made so far. */ - - if (appData.noChessProgram || first.pr != NoProc) return; - - StartChessProgram(&first); - InitChessProgram(&first); - FeedMovesToProgram(&first, currentMove); - - if (!first.sendTime) { - /* can't tell gnuchess what its clock should read, - so we bow to its notion. */ - ResetClocks(); - timeRemaining[0][currentMove] = whiteTimeRemaining; - timeRemaining[1][currentMove] = blackTimeRemaining; - } - - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile || - appData.icsEngineAnalyze) && first.analysisSupport) { - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - } - } - - /* - * Button procedures - */ - void - Reset(redraw, init) - int redraw, init; - { - int i; - - if (appData.debugMode) { - fprintf(debugFP, "Reset(%d, %d) from gameMode %d\n", - redraw, init, gameMode); - } - - pausing = pauseExamInvalid = FALSE; - startedFromSetupPosition = blackPlaysFirst = FALSE; - firstMove = TRUE; - whiteFlag = blackFlag = FALSE; - userOfferedDraw = FALSE; - hintRequested = bookRequested = FALSE; - first.maybeThinking = FALSE; - second.maybeThinking = FALSE; - thinkOutput[0] = NULLCHAR; - lastHint[0] = NULLCHAR; - ClearGameInfo(&gameInfo); - gameInfo.variant = StringToVariant(appData.variant); - ics_user_moved = ics_clock_paused = FALSE; - ics_getting_history = H_FALSE; - ics_gamenum = -1; - white_holding[0] = black_holding[0] = NULLCHAR; - ClearProgramStats(); - - ResetFrontEnd(); - ClearHighlights(); - flipView = appData.flipView; - ClearPremoveHighlights(); - gotPremove = FALSE; - alarmSounded = FALSE; - - GameEnds((ChessMove) 0, NULL, GE_PLAYER); - ExitAnalyzeMode(); - gameMode = BeginningOfGame; - ModeHighlight(); - InitPosition(redraw); - for (i = 0; i < MAX_MOVES; i++) { - if (commentList[i] != NULL) { - free(commentList[i]); - commentList[i] = NULL; - } - } - ResetClocks(); - timeRemaining[0][0] = whiteTimeRemaining; - timeRemaining[1][0] = blackTimeRemaining; - if (first.pr == NULL) { - StartChessProgram(&first); - } - if (init) InitChessProgram(&first); - DisplayTitle(""); - DisplayMessage("", ""); - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - } - - void - AutoPlayGameLoop() - { - for (;;) { - if (!AutoPlayOneMove()) - return; - if (matchMode || appData.timeDelay == 0) - continue; - if (appData.timeDelay < 0 || gameMode == AnalyzeFile) - return; - StartLoadGameTimer((long)(1000.0 * appData.timeDelay)); - break; - } - } - - - int - AutoPlayOneMove() - { - int fromX, fromY, toX, toY; - - if (appData.debugMode) { - fprintf(debugFP, "AutoPlayOneMove(): current %d\n", currentMove); - } - - if (gameMode != PlayFromGameFile) - return FALSE; - - if (currentMove >= forwardMostMove) { - gameMode = EditGame; - ModeHighlight(); - return FALSE; - } - - toX = moveList[currentMove][2] - 'a'; - toY = moveList[currentMove][3] - '1'; - - if (moveList[currentMove][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[currentMove][0] - 'a'; - fromY = moveList[currentMove][1] - '1'; - AnimateMove(boards[currentMove], fromX, fromY, toX, toY); - - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - DisplayMove(currentMove); - SendMoveToProgram(currentMove++, &first); - DisplayBothClocks(); - DrawPosition(FALSE, boards[currentMove]); - if (commentList[currentMove] != NULL) { - DisplayComment(currentMove - 1, commentList[currentMove]); - } - return TRUE; - } - - - int - LoadGameOneMove(readAhead) - ChessMove readAhead; - { - int fromX = 0, fromY = 0, toX = 0, toY = 0, done; - char promoChar = NULLCHAR; - ChessMove moveType; - char move[MSG_SIZ]; - char *p, *q; - - if (gameMode != PlayFromGameFile && gameMode != AnalyzeFile && - gameMode != AnalyzeMode && gameMode != Training) { - gameFileFP = NULL; - return FALSE; - } - - yyboardindex = forwardMostMove; - if (readAhead != (ChessMove)0) { - moveType = readAhead; - } else { - if (gameFileFP == NULL) - return FALSE; - moveType = (ChessMove) yylex(); - } - - done = FALSE; - switch (moveType) { - case Comment: - if (appData.debugMode) - fprintf(debugFP, "Parsed Comment: %s\n", yy_text); - p = yy_text; - if (*p == '{' || *p == '[' || *p == '(') { - p[strlen(p) - 1] = NULLCHAR; - p++; - } - - /* append the comment but don't display it */ - while (*p == '\n') p++; - AppendComment(currentMove, p); - return TRUE; - - case WhiteCapturesEnPassant: - case BlackCapturesEnPassant: - case WhitePromotionQueen: - case BlackPromotionQueen: - case WhitePromotionRook: - case BlackPromotionRook: - case WhitePromotionBishop: - case BlackPromotionBishop: - case WhitePromotionKnight: - case BlackPromotionKnight: - case WhitePromotionKing: - case BlackPromotionKing: - case NormalMove: - case WhiteKingSideCastle: - case WhiteQueenSideCastle: - case BlackKingSideCastle: - case BlackQueenSideCastle: - case WhiteKingSideCastleWild: - case WhiteQueenSideCastleWild: - case BlackKingSideCastleWild: - case BlackQueenSideCastleWild: - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into %s\n", yy_text, currentMoveString); - fromX = currentMoveString[0] - 'a'; - fromY = currentMoveString[1] - '1'; - toX = currentMoveString[2] - 'a'; - toY = currentMoveString[3] - '1'; - promoChar = currentMoveString[4]; - break; - - case WhiteDrop: - case BlackDrop: - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into %s\n", yy_text, currentMoveString); - fromX = moveType == WhiteDrop ? - (int) CharToPiece(ToUpper(currentMoveString[0])) : - (int) CharToPiece(ToLower(currentMoveString[0])); - fromY = DROP_RANK; - toX = currentMoveString[2] - 'a'; - toY = currentMoveString[3] - '1'; - break; - - case WhiteWins: - case BlackWins: - case GameIsDrawn: - case GameUnfinished: - if (appData.debugMode) - fprintf(debugFP, "Parsed game end: %s\n", yy_text); - p = strchr(yy_text, '{'); - if (p == NULL) p = strchr(yy_text, '('); - if (p == NULL) { - p = yy_text; - if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; - } else { - q = strchr(p, *p == '{' ? '}' : ')'); - if (q != NULL) *q = NULLCHAR; - p++; - } - GameEnds(moveType, p, GE_FILE); - done = TRUE; - if (cmailMsgLoaded) { - ClearHighlights(); - flipView = WhiteOnMove(currentMove); - if (moveType == GameUnfinished) flipView = !flipView; - if (appData.debugMode) - fprintf(debugFP, "Setting flipView to %d\n", flipView) ; - } - break; - - case (ChessMove) 0: /* end of file */ - if (appData.debugMode) - fprintf(debugFP, "Parser hit end of file\n"); - switch (MateTest(boards[currentMove], PosFlags(currentMove), - EP_UNKNOWN)) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_FILE); - } else { - GameEnds(WhiteWins, "White mates", GE_FILE); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_FILE); - break; - } - done = TRUE; - break; - - case MoveNumberOne: - if (lastLoadGameStart == GNUChessGame) { - /* GNUChessGames have numbers, but they aren't move numbers */ - if (appData.debugMode) - fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", - yy_text, (int) moveType); - return LoadGameOneMove((ChessMove)0); /* tail recursion */ - } - /* else fall thru */ - - case XBoardGame: - case GNUChessGame: - case PGNTag: - /* Reached start of next game in file */ - if (appData.debugMode) - fprintf(debugFP, "Parsed start of next game: %s\n", yy_text); - switch (MateTest(boards[currentMove], PosFlags(currentMove), - EP_UNKNOWN)) { - case MT_NONE: - case MT_CHECK: - break; - case MT_CHECKMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_FILE); - } else { - GameEnds(WhiteWins, "White mates", GE_FILE); - } - break; - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_FILE); - break; - } - done = TRUE; - break; - - case PositionDiagram: /* should not happen; ignore */ - case ElapsedTime: /* ignore */ - case NAG: /* ignore */ - if (appData.debugMode) - fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", - yy_text, (int) moveType); - return LoadGameOneMove((ChessMove)0); /* tail recursion */ - - case IllegalMove: - if (appData.testLegality) { - if (appData.debugMode) - fprintf(debugFP, "Parsed IllegalMove: %s\n", yy_text); - sprintf(move, _("Illegal move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - } else { - if (appData.debugMode) - fprintf(debugFP, "Parsed %s into IllegalMove %s\n", - yy_text, currentMoveString); - fromX = currentMoveString[0] - 'a'; - fromY = currentMoveString[1] - '1'; - toX = currentMoveString[2] - 'a'; - toY = currentMoveString[3] - '1'; - promoChar = currentMoveString[4]; - } - break; - - case AmbiguousMove: - if (appData.debugMode) - fprintf(debugFP, "Parsed AmbiguousMove: %s\n", yy_text); - sprintf(move, _("Ambiguous move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - break; - - default: - case ImpossibleMove: - if (appData.debugMode) - fprintf(debugFP, "Parsed ImpossibleMove: %s\n", yy_text); - sprintf(move, _("Illegal move: %d.%s%s"), - (forwardMostMove / 2) + 1, - WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); - DisplayError(move, 0); - done = TRUE; - break; - } - - if (done) { - if (appData.matchMode || (appData.timeDelay == 0 && !pausing)) { - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - if (!appData.matchMode && commentList[currentMove] != NULL) - DisplayComment(currentMove - 1, commentList[currentMove]); - } - (void) StopLoadGameTimer(); - gameFileFP = NULL; - cmailOldMove = forwardMostMove; - return FALSE; - } else { - /* currentMoveString is set as a side-effect of yylex */ - strcat(currentMoveString, "\n"); - strcpy(moveList[forwardMostMove], currentMoveString); - - thinkOutput[0] = NULLCHAR; - MakeMove(fromX, fromY, toX, toY, promoChar); - currentMove = forwardMostMove; - return TRUE; - } - } - - /* Load the nth game from the given file */ - int - LoadGameFromFile(filename, n, title, useList) - char *filename; - int n; - char *title; - /*Boolean*/ int useList; - { - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - f = stdin; - title = "stdin"; - } else { - f = fopen(filename, "rb"); - if (f == NULL) { - sprintf(buf, _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } - } - if (fseek(f, 0, 0) == -1) { - /* f is not seekable; probably a pipe */ - useList = FALSE; - } - if (useList && n == 0) { - int error = GameListBuild(f); - if (error) { - DisplayError(_("Cannot build game list"), error); - } else if (!ListEmpty(&gameList) && - ((ListGame *) gameList.tailPred)->number > 1) { - GameListPopUp(f, title); - return TRUE; - } - GameListDestroy(); - n = 1; - } - if (n == 0) n = 1; - return LoadGame(f, n, title, FALSE); - } - - - void - MakeRegisteredMove() - { - int fromX, fromY, toX, toY; - char promoChar; - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - switch (cmailMoveType[lastLoadGameNumber - 1]) { - case CMAIL_MOVE: - case CMAIL_DRAW: - if (appData.debugMode) - fprintf(debugFP, "Restoring %s for game %d\n", - cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); - - thinkOutput[0] = NULLCHAR; - strcpy(moveList[currentMove], cmailMove[lastLoadGameNumber - 1]); - fromX = cmailMove[lastLoadGameNumber - 1][0] - 'a'; - fromY = cmailMove[lastLoadGameNumber - 1][1] - '1'; - toX = cmailMove[lastLoadGameNumber - 1][2] - 'a'; - toY = cmailMove[lastLoadGameNumber - 1][3] - '1'; - promoChar = cmailMove[lastLoadGameNumber - 1][4]; - MakeMove(fromX, fromY, toX, toY, promoChar); - ShowMove(fromX, fromY, toX, toY); - - switch (MateTest(boards[currentMove], PosFlags(currentMove), - EP_UNKNOWN)) { - case MT_NONE: - case MT_CHECK: - break; - - case MT_CHECKMATE: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "Black mates", GE_PLAYER); - } else { - GameEnds(WhiteWins, "White mates", GE_PLAYER); - } - break; - - case MT_STALEMATE: - GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); - break; - } - - break; - - case CMAIL_RESIGN: - if (WhiteOnMove(currentMove)) { - GameEnds(BlackWins, "White resigns", GE_PLAYER); - } else { - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - } - break; - - case CMAIL_ACCEPT: - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - break; - - default: - break; - } - } - - return; - } - - /* Wrapper around LoadGame for use when a Cmail message is loaded */ - int - CmailLoadGame(f, gameNumber, title, useList) - FILE *f; - int gameNumber; - char *title; - int useList; - { - int retVal; - - if (gameNumber > nCmailGames) { - DisplayError(_("No more games in this message"), 0); - return FALSE; - } - if (f == lastLoadGameFP) { - int offset = gameNumber - lastLoadGameNumber; - if (offset == 0) { - cmailMsg[0] = NULLCHAR; - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; - nCmailMovesRegistered--; - } - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - if (cmailResult[lastLoadGameNumber - 1] == CMAIL_NEW_RESULT) { - cmailResult[lastLoadGameNumber - 1] = CMAIL_NOT_RESULT; - } - } else { - if (! RegisterMove()) return FALSE; - } - } - - retVal = LoadGame(f, gameNumber, title, useList); - - /* Make move registered during previous look at this game, if any */ - MakeRegisteredMove(); - - if (cmailCommentList[lastLoadGameNumber - 1] != NULL) { - commentList[currentMove] - = StrSave(cmailCommentList[lastLoadGameNumber - 1]); - DisplayComment(currentMove - 1, commentList[currentMove]); - } - - return retVal; - } - - /* Support for LoadNextGame, LoadPreviousGame, ReloadSameGame */ - int - ReloadGame(offset) - int offset; - { - int gameNumber = lastLoadGameNumber + offset; - if (lastLoadGameFP == NULL) { - DisplayError(_("No game has been loaded yet"), 0); - return FALSE; - } - if (gameNumber <= 0) { - DisplayError(_("Can't back up any further"), 0); - return FALSE; - } - if (cmailMsgLoaded) { - return CmailLoadGame(lastLoadGameFP, gameNumber, - lastLoadGameTitle, lastLoadGameUseList); - } else { - return LoadGame(lastLoadGameFP, gameNumber, - lastLoadGameTitle, lastLoadGameUseList); - } - } - - - - /* Load the nth game from open file f */ - int - LoadGame(f, gameNumber, title, useList) - FILE *f; - int gameNumber; - char *title; - int useList; - { - ChessMove cm; - char buf[MSG_SIZ]; - int gn = gameNumber; - ListGame *lg = NULL; - int numPGNTags = 0; - int err; - GameMode oldGameMode; - - if (appData.debugMode) - fprintf(debugFP, "LoadGame(): on entry, gameMode %d\n", gameMode); - - if (gameMode == Training ) - SetTrainingModeOff(); - - oldGameMode = gameMode; - if (gameMode != BeginningOfGame) { - Reset(FALSE, TRUE); - } - - gameFileFP = f; - if (lastLoadGameFP != NULL && lastLoadGameFP != f) { - fclose(lastLoadGameFP); - } - - if (useList) { - lg = (ListGame *) ListElem(&gameList, gameNumber-1); - - if (lg) { - fseek(f, lg->offset, 0); - GameListHighlight(gameNumber); - gn = 1; - } - else { - DisplayError(_("Game number out of range"), 0); - return FALSE; - } - } else { - GameListDestroy(); - if (fseek(f, 0, 0) == -1) { - if (f == lastLoadGameFP ? - gameNumber == lastLoadGameNumber + 1 : - gameNumber == 1) { - gn = 1; - } else { - DisplayError(_("Can't seek on game file"), 0); - return FALSE; - } - } - } - lastLoadGameFP = f; - lastLoadGameNumber = gameNumber; - strcpy(lastLoadGameTitle, title); - lastLoadGameUseList = useList; - - yynewfile(f); - - - if (lg && lg->gameInfo.white && lg->gameInfo.black) { - sprintf(buf, "%s vs. %s", lg->gameInfo.white, - lg->gameInfo.black); - DisplayTitle(buf); - } else if (*title != NULLCHAR) { - if (gameNumber > 1) { - sprintf(buf, "%s %d", title, gameNumber); - DisplayTitle(buf); - } else { - DisplayTitle(title); - } - } - - if (gameMode != AnalyzeFile && gameMode != AnalyzeMode) { - gameMode = PlayFromGameFile; - ModeHighlight(); - } - - currentMove = forwardMostMove = backwardMostMove = 0; - CopyBoard(boards[0], initialPosition); - StopClocks(); - - /* - * Skip the first gn-1 games in the file. - * Also skip over anything that precedes an identifiable - * start of game marker, to avoid being confused by - * garbage at the start of the file. Currently - * recognized start of game markers are the move number "1", - * the pattern "gnuchess .* game", the pattern - * "^[#;%] [^ ]* game file", and a PGN tag block. - * A game that starts with one of the latter two patterns - * will also have a move number 1, possibly - * following a position diagram. - * 5-4-02: Let's try being more lenient and allowing a game to - * start with an unnumbered move. Does that break anything? - */ - cm = lastLoadGameStart = (ChessMove) 0; - while (gn > 0) { - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - switch (cm) { - case (ChessMove) 0: - if (cmailMsgLoaded) { - nCmailGames = CMAIL_MAX_GAMES - gn; - } else { - Reset(TRUE, TRUE); - DisplayError(_("Game not found in file"), 0); - } - return FALSE; - - case GNUChessGame: - case XBoardGame: - gn--; - lastLoadGameStart = cm; - break; - - case MoveNumberOne: - switch (lastLoadGameStart) { - case GNUChessGame: - case XBoardGame: - case PGNTag: - break; - case MoveNumberOne: - case (ChessMove) 0: - gn--; /* count this game */ - lastLoadGameStart = cm; - break; - default: - /* impossible */ - break; - } - break; - - case PGNTag: - switch (lastLoadGameStart) { - case GNUChessGame: - case PGNTag: - case MoveNumberOne: - case (ChessMove) 0: - gn--; /* count this game */ - lastLoadGameStart = cm; - break; - case XBoardGame: - lastLoadGameStart = cm; /* game counted already */ - break; - default: - /* impossible */ - break; - } - if (gn > 0) { - do { - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - } while (cm == PGNTag || cm == Comment); - } - break; - - case WhiteWins: - case BlackWins: - case GameIsDrawn: - if (cmailMsgLoaded && (CMAIL_MAX_GAMES == lastLoadGameNumber)) { - if ( cmailResult[CMAIL_MAX_GAMES - gn - 1] - != CMAIL_OLD_RESULT) { - nCmailResults ++ ; - cmailResult[ CMAIL_MAX_GAMES - - gn - 1] = CMAIL_OLD_RESULT; - } - } - break; - - case NormalMove: - /* Only a NormalMove can be at the start of a game - * without a position diagram. */ - if (lastLoadGameStart == (ChessMove) 0) { - gn--; - lastLoadGameStart = MoveNumberOne; - } - break; - - default: - break; - } - } - - if (appData.debugMode) - fprintf(debugFP, "Parsed game start '%s' (%d)\n", yy_text, (int) cm); - - if (cm == XBoardGame) { - /* Skip any header junk before position diagram and/or move 1 */ - for (;;) { - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - - if (cm == (ChessMove) 0 || - cm == GNUChessGame || cm == XBoardGame) { - /* Empty game; pretend end-of-file and handle later */ - cm = (ChessMove) 0; - break; - } - - if (cm == MoveNumberOne || cm == PositionDiagram || - cm == PGNTag || cm == Comment) - break; - } - } else if (cm == GNUChessGame) { - if (gameInfo.event != NULL) { - free(gameInfo.event); - } - gameInfo.event = StrSave(yy_text); - } - - startedFromSetupPosition = FALSE; - while (cm == PGNTag) { - if (appData.debugMode) - fprintf(debugFP, "Parsed PGNTag: %s\n", yy_text); - err = ParsePGNTag(yy_text, &gameInfo); - if (!err) numPGNTags++; - - if (gameInfo.fen != NULL) { - Board initial_position; - startedFromSetupPosition = TRUE; - if (!ParseFEN(initial_position, &blackPlaysFirst, gameInfo.fen)) { - Reset(TRUE, TRUE); - DisplayError(_("Bad FEN position in file"), 0); - return FALSE; - } - CopyBoard(boards[0], initial_position); - if (blackPlaysFirst) { - currentMove = forwardMostMove = backwardMostMove = 1; - CopyBoard(boards[1], initial_position); - strcpy(moveList[0], ""); - strcpy(parseList[0], ""); - timeRemaining[0][1] = whiteTimeRemaining; - timeRemaining[1][1] = blackTimeRemaining; - if (commentList[0] != NULL) { - commentList[1] = commentList[0]; - commentList[0] = NULL; - } - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - } - yyboardindex = forwardMostMove; - free(gameInfo.fen); - gameInfo.fen = NULL; - } - - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - - /* Handle comments interspersed among the tags */ - while (cm == Comment) { - char *p; - if (appData.debugMode) - fprintf(debugFP, "Parsed Comment: %s\n", yy_text); - p = yy_text; - if (*p == '{' || *p == '[' || *p == '(') { - p[strlen(p) - 1] = NULLCHAR; - p++; - } - while (*p == '\n') p++; - AppendComment(currentMove, p); - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - } - } - - /* don't rely on existence of Event tag since if game was - * pasted from clipboard the Event tag may not exist - */ - if (numPGNTags > 0){ - char *tags; - if (gameInfo.variant == VariantNormal) { - gameInfo.variant = StringToVariant(gameInfo.event); - } - if (!matchMode) { - tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - } else { - /* Make something up, but don't display it now */ - SetGameInfo(); - TagsPopDown(); - } - - if (cm == PositionDiagram) { - int i, j; - char *p; - Board initial_position; - - if (appData.debugMode) - fprintf(debugFP, "Parsed PositionDiagram: %s\n", yy_text); - - if (!startedFromSetupPosition) { - p = yy_text; - for (i = BOARD_SIZE - 1; i >= 0; i--) - for (j = 0; j < BOARD_SIZE; p++) - switch (*p) { - case '[': - case '-': - case ' ': - case '\t': - case '\n': - case '\r': - break; - default: - initial_position[i][j++] = CharToPiece(*p); - break; - } - while (*p == ' ' || *p == '\t' || - *p == '\n' || *p == '\r') p++; - - if (strncmp(p, "black", strlen("black"))==0) - blackPlaysFirst = TRUE; - else - blackPlaysFirst = FALSE; - startedFromSetupPosition = TRUE; - - CopyBoard(boards[0], initial_position); - if (blackPlaysFirst) { - currentMove = forwardMostMove = backwardMostMove = 1; - CopyBoard(boards[1], initial_position); - strcpy(moveList[0], ""); - strcpy(parseList[0], ""); - timeRemaining[0][1] = whiteTimeRemaining; - timeRemaining[1][1] = blackTimeRemaining; - if (commentList[0] != NULL) { - commentList[1] = commentList[0]; - commentList[0] = NULL; - } - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - } - } - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - } - - if (first.pr == NoProc) { - StartChessProgram(&first); - } - InitChessProgram(&first); - SendToProgram("force\n", &first); - if (startedFromSetupPosition) { - SendBoard(&first, forwardMostMove); - DisplayBothClocks(); - } - - while (cm == Comment) { - char *p; - if (appData.debugMode) - fprintf(debugFP, "Parsed Comment: %s\n", yy_text); - p = yy_text; - if (*p == '{' || *p == '[' || *p == '(') { - p[strlen(p) - 1] = NULLCHAR; - p++; - } - while (*p == '\n') p++; - AppendComment(currentMove, p); - yyboardindex = forwardMostMove; - cm = (ChessMove) yylex(); - } - - if ((cm == (ChessMove) 0 && lastLoadGameStart != (ChessMove) 0) || - cm == WhiteWins || cm == BlackWins || - cm == GameIsDrawn || cm == GameUnfinished) { - DisplayMessage("", _("No moves in game")); - if (cmailMsgLoaded) { - if (appData.debugMode) - fprintf(debugFP, "Setting flipView to %d.\n", FALSE); - ClearHighlights(); - flipView = FALSE; - } - DrawPosition(FALSE, boards[currentMove]); - DisplayBothClocks(); - gameMode = EditGame; - ModeHighlight(); - gameFileFP = NULL; - cmailOldMove = 0; - return TRUE; - } - - if (commentList[currentMove] != NULL) { - if (!matchMode && (pausing || appData.timeDelay != 0)) { - DisplayComment(currentMove - 1, commentList[currentMove]); - } - } - if (!matchMode && appData.timeDelay != 0) - DrawPosition(FALSE, boards[currentMove]); - - if (gameMode == AnalyzeFile || gameMode == AnalyzeMode) { - programStats.ok_to_send = 1; - } - - /* if the first token after the PGN tags is a move - * and not move number 1, retrieve it from the parser - */ - if (cm != MoveNumberOne) - LoadGameOneMove(cm); - - /* load the remaining moves from the file */ - while (LoadGameOneMove((ChessMove)0)) { - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - } - - /* rewind to the start of the game */ - currentMove = backwardMostMove; - - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - - if (oldGameMode == AnalyzeFile || - oldGameMode == AnalyzeMode) { - AnalyzeFileEvent(); - } - - if (matchMode || appData.timeDelay == 0) { - ToEndEvent(); - gameMode = EditGame; - ModeHighlight(); - } else if (appData.timeDelay > 0) { - AutoPlayGameLoop(); - } - - if (appData.debugMode) - fprintf(debugFP, "LoadGame(): on exit, gameMode %d\n", gameMode); - return TRUE; - } - - /* Support for LoadNextPosition, LoadPreviousPosition, ReloadSamePosition */ - int - ReloadPosition(offset) - int offset; - { - int positionNumber = lastLoadPositionNumber + offset; - if (lastLoadPositionFP == NULL) { - DisplayError(_("No position has been loaded yet"), 0); - return FALSE; - } - if (positionNumber <= 0) { - DisplayError(_("Can't back up any further"), 0); - return FALSE; - } - return LoadPosition(lastLoadPositionFP, positionNumber, - lastLoadPositionTitle); - } - - /* Load the nth position from the given file */ - int - LoadPositionFromFile(filename, n, title) - char *filename; - int n; - char *title; - { - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - return LoadPosition(stdin, n, "stdin"); - } else { - f = fopen(filename, "rb"); - if (f == NULL) { - sprintf(buf, _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - return LoadPosition(f, n, title); - } - } - } - - /* Load the nth position from the given open file, and close it */ - int - LoadPosition(f, positionNumber, title) - FILE *f; - int positionNumber; - char *title; - { - char *p, line[MSG_SIZ]; - Board initial_position; - int i, j, fenMode, pn; - - if (gameMode == Training ) - SetTrainingModeOff(); - - if (gameMode != BeginningOfGame) { - Reset(FALSE, TRUE); - } - if (lastLoadPositionFP != NULL && lastLoadPositionFP != f) { - fclose(lastLoadPositionFP); - } - if (positionNumber == 0) positionNumber = 1; - lastLoadPositionFP = f; - lastLoadPositionNumber = positionNumber; - strcpy(lastLoadPositionTitle, title); - if (first.pr == NoProc) { - StartChessProgram(&first); - InitChessProgram(&first); - } - pn = positionNumber; - if (positionNumber < 0) { - /* Negative position number means to seek to that byte offset */ - if (fseek(f, -positionNumber, 0) == -1) { - DisplayError(_("Can't seek on position file"), 0); - return FALSE; - }; - pn = 1; - } else { - if (fseek(f, 0, 0) == -1) { - if (f == lastLoadPositionFP ? - positionNumber == lastLoadPositionNumber + 1 : - positionNumber == 1) { - pn = 1; - } else { - DisplayError(_("Can't seek on position file"), 0); - return FALSE; - } - } - } - /* See if this file is FEN or old-style xboard */ - if (fgets(line, MSG_SIZ, f) == NULL) { - DisplayError(_("Position not found in file"), 0); - return FALSE; - } - switch (line[0]) { - case '#': case 'x': - default: - fenMode = FALSE; - break; - case 'p': case 'n': case 'b': case 'r': case 'q': case 'k': - case 'P': case 'N': case 'B': case 'R': case 'Q': case 'K': - case '1': case '2': case '3': case '4': case '5': case '6': - case '7': case '8': - fenMode = TRUE; - break; - } - - if (pn >= 2) { - if (fenMode || line[0] == '#') pn--; - while (pn > 0) { - /* skip postions before number pn */ - if (fgets(line, MSG_SIZ, f) == NULL) { - Reset(TRUE, TRUE); - DisplayError(_("Position not found in file"), 0); - return FALSE; - } - if (fenMode || line[0] == '#') pn--; - } - } - - if (fenMode) { - if (!ParseFEN(initial_position, &blackPlaysFirst, line)) { - DisplayError(_("Bad FEN position in file"), 0); - return FALSE; - } - } else { - (void) fgets(line, MSG_SIZ, f); - (void) fgets(line, MSG_SIZ, f); - - for (i = BOARD_SIZE - 1; i >= 0; i--) { - (void) fgets(line, MSG_SIZ, f); - for (p = line, j = 0; j < BOARD_SIZE; p++) { - if (*p == ' ') - continue; - initial_position[i][j++] = CharToPiece(*p); - } - } - - blackPlaysFirst = FALSE; - if (!feof(f)) { - (void) fgets(line, MSG_SIZ, f); - if (strncmp(line, "black", strlen("black"))==0) - blackPlaysFirst = TRUE; - } - } - startedFromSetupPosition = TRUE; - - SendToProgram("force\n", &first); - CopyBoard(boards[0], initial_position); - if (blackPlaysFirst) { - currentMove = forwardMostMove = backwardMostMove = 1; - strcpy(moveList[0], ""); - strcpy(parseList[0], ""); - CopyBoard(boards[1], initial_position); - DisplayMessage("", _("Black to play")); - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - DisplayMessage("", _("White to play")); - } - SendBoard(&first, forwardMostMove); - - if (positionNumber > 1) { - sprintf(line, "%s %d", title, positionNumber); - DisplayTitle(line); - } else { - DisplayTitle(title); - } - gameMode = EditGame; - ModeHighlight(); - ResetClocks(); - timeRemaining[0][1] = whiteTimeRemaining; - timeRemaining[1][1] = blackTimeRemaining; - DrawPosition(FALSE, boards[currentMove]); - - return TRUE; - } - - - void - CopyPlayerNameIntoFileName(dest, src) - char **dest, *src; - { - while (*src != NULLCHAR && *src != ',') { - if (*src == ' ') { - *(*dest)++ = '_'; - src++; - } else { - *(*dest)++ = *src++; - } - } - } - - char *DefaultFileName(ext) - char *ext; - { - static char def[MSG_SIZ]; - char *p; - - if (gameInfo.white != NULL && gameInfo.white[0] != '-') { - p = def; - CopyPlayerNameIntoFileName(&p, gameInfo.white); - *p++ = '-'; - CopyPlayerNameIntoFileName(&p, gameInfo.black); - *p++ = '.'; - strcpy(p, ext); - } else { - def[0] = NULLCHAR; - } - return def; - } - - /* Save the current game to the given file */ - int - SaveGameToFile(filename, append) - char *filename; - int append; - { - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - return SaveGame(stdout, 0, NULL); - } else { - f = fopen(filename, append ? "a" : "w"); - if (f == NULL) { - sprintf(buf, _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - return SaveGame(f, 0, NULL); - } - } - } - - char * - SavePart(str) - char *str; - { - static char buf[MSG_SIZ]; - char *p; - - p = strchr(str, ' '); - if (p == NULL) return str; - strncpy(buf, str, p - str); - buf[p - str] = NULLCHAR; - return buf; - } - - #define PGN_MAX_LINE 75 - - /* Save game in PGN style and close the file */ - int - SaveGamePGN(f) - FILE *f; - { - int i, offset, linelen, newblock; - time_t tm; - char *movetext; - char numtext[32]; - int movelen, numlen, blank; - - tm = time((time_t *) NULL); - - PrintPGNTags(f, &gameInfo); - - if (backwardMostMove > 0 || startedFromSetupPosition) { - char *fen = PositionToFEN(backwardMostMove); - fprintf(f, "[FEN \"%s\"]\n[SetUp \"1\"]\n", fen); - fprintf(f, "\n{--------------\n"); - PrintPosition(f, backwardMostMove); - fprintf(f, "--------------}\n"); - free(fen); - } else { - fprintf(f, "\n"); - } - - i = backwardMostMove; - offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - linelen = 0; - newblock = TRUE; - - while (i < forwardMostMove) { - /* Print comments preceding this move */ - if (commentList[i] != NULL) { - if (linelen > 0) fprintf(f, "\n"); - fprintf(f, "{\n%s}\n", commentList[i]); - linelen = 0; - newblock = TRUE; - } - - /* Format move number */ - if ((i % 2) == 0) { - sprintf(numtext, "%d.", (i - offset)/2 + 1); - } else { - if (newblock) { - sprintf(numtext, "%d...", (i - offset)/2 + 1); - } else { - numtext[0] = NULLCHAR; - } - } - numlen = strlen(numtext); - newblock = FALSE; - - /* Print move number */ - blank = linelen > 0 && numlen > 0; - if (linelen + (blank ? 1 : 0) + numlen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, numtext); - linelen += numlen; - - /* Get move */ - movetext = SavePart(parseList[i]); - movelen = strlen(movetext); - - /* Print move */ - blank = linelen > 0 && movelen > 0; - if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { - fprintf(f, "\n"); - linelen = 0; - blank = 0; - } - if (blank) { - fprintf(f, " "); - linelen++; - } - fprintf(f, movetext); - linelen += movelen; - - i++; - } - - /* Start a new line */ - if (linelen > 0) fprintf(f, "\n"); - - /* Print comments after last move */ - if (commentList[i] != NULL) { - fprintf(f, "{\n%s}\n", commentList[i]); - } - - /* Print result */ - if (gameInfo.resultDetails != NULL && - gameInfo.resultDetails[0] != NULLCHAR) { - fprintf(f, "{%s} %s\n\n", gameInfo.resultDetails, - PGNResult(gameInfo.result)); - } else { - fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); - } - - fclose(f); - return TRUE; - } - - /* Save game in old style and close the file */ - int - SaveGameOldStyle(f) - FILE *f; - { - int i, offset; - time_t tm; - - tm = time((time_t *) NULL); - - fprintf(f, "# %s game file -- %s", programName, ctime(&tm)); - PrintOpponents(f); - - if (backwardMostMove > 0 || startedFromSetupPosition) { - fprintf(f, "\n[--------------\n"); - PrintPosition(f, backwardMostMove); - fprintf(f, "--------------]\n"); - } else { - fprintf(f, "\n"); - } - - i = backwardMostMove; - offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ - - while (i < forwardMostMove) { - if (commentList[i] != NULL) { - fprintf(f, "[%s]\n", commentList[i]); - } - - if ((i % 2) == 1) { - fprintf(f, "%d. ... %s\n", (i - offset)/2 + 1, parseList[i]); - i++; - } else { - fprintf(f, "%d. %s ", (i - offset)/2 + 1, parseList[i]); - i++; - if (commentList[i] != NULL) { - fprintf(f, "\n"); - continue; - } - if (i >= forwardMostMove) { - fprintf(f, "\n"); - break; - } - fprintf(f, "%s\n", parseList[i]); - i++; - } - } - - if (commentList[i] != NULL) { - fprintf(f, "[%s]\n", commentList[i]); - } - - /* This isn't really the old style, but it's close enough */ - if (gameInfo.resultDetails != NULL && - gameInfo.resultDetails[0] != NULLCHAR) { - fprintf(f, "%s (%s)\n\n", PGNResult(gameInfo.result), - gameInfo.resultDetails); - } else { - fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); - } - - fclose(f); - return TRUE; - } - - /* Save the current game to open file f and close the file */ - int - SaveGame(f, dummy, dummy2) - FILE *f; - int dummy; - char *dummy2; - { - if (gameMode == EditPosition) EditPositionDone(); - if (appData.oldSaveStyle) - return SaveGameOldStyle(f); - else - return SaveGamePGN(f); - } - - /* Save the current position to the given file */ - int - SavePositionToFile(filename) - char *filename; - { - FILE *f; - char buf[MSG_SIZ]; - - if (strcmp(filename, "-") == 0) { - return SavePosition(stdout, 0, NULL); - } else { - f = fopen(filename, "a"); - if (f == NULL) { - sprintf(buf, _("Can't open \"%s\""), filename); - DisplayError(buf, errno); - return FALSE; - } else { - SavePosition(f, 0, NULL); - return TRUE; - } - } - } - - /* Save the current position to the given open file and close the file */ - int - SavePosition(f, dummy, dummy2) - FILE *f; - int dummy; - char *dummy2; - { - time_t tm; - char *fen; - - if (appData.oldSaveStyle) { - tm = time((time_t *) NULL); - - fprintf(f, "# %s position file -- %s", programName, ctime(&tm)); - PrintOpponents(f); - fprintf(f, "[--------------\n"); - PrintPosition(f, currentMove); - fprintf(f, "--------------]\n"); - } else { - fen = PositionToFEN(currentMove); - fprintf(f, "%s\n", fen); - free(fen); - } - fclose(f); - return TRUE; - } - - void - ReloadCmailMsgEvent(unregister) - int unregister; - { - #if !WIN32 - static char *inFilename = NULL; - static char *outFilename; - int i; - struct stat inbuf, outbuf; - int status; - - /* Any registered moves are unregistered if unregister is set, */ - /* i.e. invoked by the signal handler */ - if (unregister) { - for (i = 0; i < CMAIL_MAX_GAMES; i ++) { - cmailMoveRegistered[i] = FALSE; - if (cmailCommentList[i] != NULL) { - free(cmailCommentList[i]); - cmailCommentList[i] = NULL; - } - } - nCmailMovesRegistered = 0; - } - - for (i = 0; i < CMAIL_MAX_GAMES; i ++) { - cmailResult[i] = CMAIL_NOT_RESULT; - } - nCmailResults = 0; - - if (inFilename == NULL) { - /* Because the filenames are static they only get malloced once */ - /* and they never get freed */ - inFilename = (char *) malloc(strlen(appData.cmailGameName) + 9); - sprintf(inFilename, "%s.game.in", appData.cmailGameName); - - outFilename = (char *) malloc(strlen(appData.cmailGameName) + 5); - sprintf(outFilename, "%s.out", appData.cmailGameName); - } - - status = stat(outFilename, &outbuf); - if (status < 0) { - cmailMailedMove = FALSE; - } else { - status = stat(inFilename, &inbuf); - cmailMailedMove = (inbuf.st_mtime < outbuf.st_mtime); - } - - /* LoadGameFromFile(CMAIL_MAX_GAMES) with cmailMsgLoaded == TRUE - counts the games, notes how each one terminated, etc. - - It would be nice to remove this kludge and instead gather all - the information while building the game list. (And to keep it - in the game list nodes instead of having a bunch of fixed-size - parallel arrays.) Note this will require getting each game's - termination from the PGN tags, as the game list builder does - not process the game moves. --mann - */ - cmailMsgLoaded = TRUE; - LoadGameFromFile(inFilename, CMAIL_MAX_GAMES, "", FALSE); - - /* Load first game in the file or popup game menu */ - LoadGameFromFile(inFilename, 0, appData.cmailGameName, TRUE); - - #endif /* !WIN32 */ - return; - } - - int - RegisterMove() - { - FILE *f; - char string[MSG_SIZ]; - - if ( cmailMailedMove - || (cmailResult[lastLoadGameNumber - 1] == CMAIL_OLD_RESULT)) { - return TRUE; /* Allow free viewing */ - } - - /* Unregister move to ensure that we don't leave RegisterMove */ - /* with the move registered when the conditions for registering no */ - /* longer hold */ - if (cmailMoveRegistered[lastLoadGameNumber - 1]) { - cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; - nCmailMovesRegistered --; - - if (cmailCommentList[lastLoadGameNumber - 1] != NULL) - { - free(cmailCommentList[lastLoadGameNumber - 1]); - cmailCommentList[lastLoadGameNumber - 1] = NULL; - } - } - - if (cmailOldMove == -1) { - DisplayError(_("You have edited the game history.\nUse Reload Same Game and make your move again."), 0); - return FALSE; - } - - if (currentMove > cmailOldMove + 1) { - DisplayError(_("You have entered too many moves.\nBack up to the correct position and try again."), 0); - return FALSE; - } - - if (currentMove < cmailOldMove) { - DisplayError(_("Displayed position is not current.\nStep forward to the correct position and try again."), 0); - return FALSE; - } - - if (forwardMostMove > currentMove) { - /* Silently truncate extra moves */ - TruncateGame(); - } - - if ( (currentMove == cmailOldMove + 1) - || ( (currentMove == cmailOldMove) - && ( (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_ACCEPT) - || (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_RESIGN)))) { - if (gameInfo.result != GameUnfinished) { - cmailResult[lastLoadGameNumber - 1] = CMAIL_NEW_RESULT; - } - - if (commentList[currentMove] != NULL) { - cmailCommentList[lastLoadGameNumber - 1] - = StrSave(commentList[currentMove]); - } - strcpy(cmailMove[lastLoadGameNumber - 1], moveList[currentMove - 1]); - - if (appData.debugMode) - fprintf(debugFP, "Saving %s for game %d\n", - cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); - - sprintf(string, - "%s.game.out.%d", appData.cmailGameName, lastLoadGameNumber); - - f = fopen(string, "w"); - if (appData.oldSaveStyle) { - SaveGameOldStyle(f); /* also closes the file */ - - sprintf(string, "%s.pos.out", appData.cmailGameName); - f = fopen(string, "w"); - SavePosition(f, 0, NULL); /* also closes the file */ - } else { - fprintf(f, "{--------------\n"); - PrintPosition(f, currentMove); - fprintf(f, "--------------}\n\n"); - - SaveGame(f, 0, NULL); /* also closes the file*/ - } - - cmailMoveRegistered[lastLoadGameNumber - 1] = TRUE; - nCmailMovesRegistered ++; - } else if (nCmailGames == 1) { - DisplayError(_("You have not made a move yet"), 0); - return FALSE; - } - - return TRUE; - } - - void - MailMoveEvent() - { - #if !WIN32 - static char *partCommandString = "cmail -xv%s -remail -game %s 2>&1"; - FILE *commandOutput; - char buffer[MSG_SIZ], msg[MSG_SIZ], string[MSG_SIZ]; - int nBytes = 0; /* Suppress warnings on uninitialized variables */ - int nBuffers; - int i; - int archived; - char *arcDir; - - if (! cmailMsgLoaded) { - DisplayError(_("The cmail message is not loaded.\nUse Reload CMail Message and make your move again."), 0); - return; - } - - if (nCmailGames == nCmailResults) { - DisplayError(_("No unfinished games"), 0); - return; - } - - #if CMAIL_PROHIBIT_REMAIL - if (cmailMailedMove) { - sprintf(msg, _("You have already mailed a move.\nWait until a move arrives from your opponent.\nTo resend the same move, type\n\"cmail -remail -game %s\"\non the command line."), appData.cmailGameName); - DisplayError(msg, 0); - return; - } - #endif - - if (! (cmailMailedMove || RegisterMove())) return; - - if ( cmailMailedMove - || (nCmailMovesRegistered + nCmailResults == nCmailGames)) { - sprintf(string, partCommandString, - appData.debugMode ? " -v" : "", appData.cmailGameName); - commandOutput = popen(string, "r"); - - if (commandOutput == NULL) { - DisplayError(_("Failed to invoke cmail"), 0); - } else { - for (nBuffers = 0; (! feof(commandOutput)); nBuffers ++) { - nBytes = fread(buffer, 1, MSG_SIZ - 1, commandOutput); - } - if (nBuffers > 1) { - (void) memcpy(msg, buffer + nBytes, MSG_SIZ - nBytes - 1); - (void) memcpy(msg + MSG_SIZ - nBytes - 1, buffer, nBytes); - nBytes = MSG_SIZ - 1; - } else { - (void) memcpy(msg, buffer, nBytes); - } - *(msg + nBytes) = '\0'; /* \0 for end-of-string*/ - - if(StrStr(msg, "Mailed cmail message to ") != NULL) { - cmailMailedMove = TRUE; /* Prevent >1 moves */ - - archived = TRUE; - for (i = 0; i < nCmailGames; i ++) { - if (cmailResult[i] == CMAIL_NOT_RESULT) { - archived = FALSE; - } - } - if ( archived - && ( (arcDir = (char *) getenv("CMAIL_ARCDIR")) - != NULL)) { - sprintf(buffer, "%s/%s.%s.archive", - arcDir, - appData.cmailGameName, - gameInfo.date); - LoadGameFromFile(buffer, 1, buffer, FALSE); - cmailMsgLoaded = FALSE; - } - } - - DisplayInformation(msg); - pclose(commandOutput); - } - } else { - if ((*cmailMsg) != '\0') { - DisplayInformation(cmailMsg); - } - } - - return; - #endif /* !WIN32 */ - } - - char * - CmailMsg() - { - #if WIN32 - return NULL; - #else - int prependComma = 0; - char number[5]; - char string[MSG_SIZ]; /* Space for game-list */ - int i; - - if (!cmailMsgLoaded) return ""; - - if (cmailMailedMove) { - sprintf(cmailMsg, _("Waiting for reply from opponent\n")); - } else { - /* Create a list of games left */ - sprintf(string, "["); - for (i = 0; i < nCmailGames; i ++) { - if (! ( cmailMoveRegistered[i] - || (cmailResult[i] == CMAIL_OLD_RESULT))) { - if (prependComma) { - sprintf(number, ",%d", i + 1); - } else { - sprintf(number, "%d", i + 1); - prependComma = 1; - } - - strcat(string, number); - } - } - strcat(string, "]"); - - if (nCmailMovesRegistered + nCmailResults == 0) { - switch (nCmailGames) { - case 1: - sprintf(cmailMsg, - _("Still need to make move for game\n")); - break; - - case 2: - sprintf(cmailMsg, - _("Still need to make moves for both games\n")); - break; - - default: - sprintf(cmailMsg, - _("Still need to make moves for all %d games\n"), - nCmailGames); - break; - } - } else { - switch (nCmailGames - nCmailMovesRegistered - nCmailResults) { - case 1: - sprintf(cmailMsg, - _("Still need to make a move for game %s\n"), - string); - break; - - case 0: - if (nCmailResults == nCmailGames) { - sprintf(cmailMsg, _("No unfinished games\n")); - } else { - sprintf(cmailMsg, _("Ready to send mail\n")); - } - break; - - default: - sprintf(cmailMsg, - _("Still need to make moves for games %s\n"), - string); - } - } - } - return cmailMsg; - #endif /* WIN32 */ - } - - void - ResetGameEvent() - { - if (gameMode == Training) - SetTrainingModeOff(); - - Reset(TRUE, TRUE); - cmailMsgLoaded = FALSE; - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } - } - - static int exiting = 0; - - void - ExitEvent(status) - int status; - { - exiting++; - if (exiting > 2) { - /* Give up on clean exit */ - exit(status); - } - if (exiting > 1) { - /* Keep trying for clean exit */ - return; - } - - if (appData.icsActive && appData.colorize) Colorize(ColorNone, FALSE); - - if (telnetISR != NULL) { - RemoveInputSource(telnetISR); - } - if (icsPR != NoProc) { - DestroyChildProcess(icsPR, TRUE); - } - /* Save game if resource set and not already saved by GameEnds() */ - if (gameInfo.resultDetails == NULL && forwardMostMove > 0) { - if (*appData.saveGameFile != NULLCHAR) { - SaveGameToFile(appData.saveGameFile, TRUE); - } else if (appData.autoSaveGames) { - AutoSaveGame(); - } - if (*appData.savePositionFile != NULLCHAR) { - SavePositionToFile(appData.savePositionFile); - } - } - GameEnds((ChessMove) 0, NULL, GE_PLAYER); - - /* Kill off chess programs */ - if (first.pr != NoProc) { - ExitAnalyzeMode(); - SendToProgram("quit\n", &first); - DestroyChildProcess(first.pr, first.useSigterm); - } - if (second.pr != NoProc) { - SendToProgram("quit\n", &second); - DestroyChildProcess(second.pr, second.useSigterm); - } - if (first.isr != NULL) { - RemoveInputSource(first.isr); - } - if (second.isr != NULL) { - RemoveInputSource(second.isr); - } - - ShutDownFrontEnd(); - exit(status); - } - - void - PauseEvent() - { - if (appData.debugMode) - fprintf(debugFP, "PauseEvent(): pausing %d\n", pausing); - if (pausing) { - pausing = FALSE; - ModeHighlight(); - if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack) { - StartClocks(); - } else { - DisplayBothClocks(); - } - if (gameMode == PlayFromGameFile) { - if (appData.timeDelay >= 0) - AutoPlayGameLoop(); - } else if (gameMode == IcsExamining && pauseExamInvalid) { - Reset(FALSE, TRUE); - SendToICS(ics_prefix); - SendToICS("refresh\n"); - } else if (currentMove < forwardMostMove) { - ForwardInner(forwardMostMove); - } - pauseExamInvalid = FALSE; - } else { - switch (gameMode) { - default: - return; - case IcsExamining: - pauseExamForwardMostMove = forwardMostMove; - pauseExamInvalid = FALSE; - /* fall through */ - case IcsObserving: - case IcsPlayingWhite: - case IcsPlayingBlack: - pausing = TRUE; - ModeHighlight(); - return; - case PlayFromGameFile: - (void) StopLoadGameTimer(); - pausing = TRUE; - ModeHighlight(); - break; - case BeginningOfGame: - if (appData.icsActive) return; - /* else fall through */ - case MachinePlaysWhite: - case MachinePlaysBlack: - case TwoMachinesPlay: - if (forwardMostMove == 0) - return; /* don't pause if no one has moved */ - if ((gameMode == MachinePlaysWhite && - !WhiteOnMove(forwardMostMove)) || - (gameMode == MachinePlaysBlack && - WhiteOnMove(forwardMostMove))) { - StopClocks(); - } - pausing = TRUE; - ModeHighlight(); - break; - } - } - } - - void - EditCommentEvent() - { - char title[MSG_SIZ]; - - if (currentMove < 1 || parseList[currentMove - 1][0] == NULLCHAR) { - strcpy(title, _("Edit comment")); - } else { - sprintf(title, _("Edit comment on %d.%s%s"), (currentMove - 1) / 2 + 1, - WhiteOnMove(currentMove - 1) ? " " : ".. ", - parseList[currentMove - 1]); - } - - EditCommentPopUp(currentMove, title, commentList[currentMove]); - } - - - void - EditTagsEvent() - { - char *tags = PGNTags(&gameInfo); - EditTagsPopUp(tags); - free(tags); - } - - void - AnalyzeModeEvent() - { - if (appData.noChessProgram || gameMode == AnalyzeMode) - return; - - if (gameMode != AnalyzeFile) { - if (!appData.icsEngineAnalyze) { - EditGameEvent(); - if (gameMode != EditGame) return; - } - ResurrectChessProgram(); - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - AnalysisPopUp(_("Analysis"), - _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis.")); - } - if (!appData.icsEngineAnalyze) gameMode = AnalyzeMode; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - - StartAnalysisClock(); - GetTimeMark(&lastNodeCountTime); - lastNodeCount = 0; - } - - void - AnalyzeFileEvent() - { - if (appData.noChessProgram || gameMode == AnalyzeFile) - return; - - if (gameMode != AnalyzeMode) { - EditGameEvent(); - if (gameMode != EditGame) return; - ResurrectChessProgram(); - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - AnalysisPopUp(_("Analysis"), - _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis.")); - } - gameMode = AnalyzeFile; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - - StartAnalysisClock(); - GetTimeMark(&lastNodeCountTime); - lastNodeCount = 0; - } - - void - MachineWhiteEvent() - { - char buf[MSG_SIZ]; - - if (appData.noChessProgram || (gameMode == MachinePlaysWhite)) - return; - - - if (gameMode == PlayFromGameFile || - gameMode == TwoMachinesPlay || - gameMode == Training || - gameMode == AnalyzeMode || - gameMode == EndOfGame) - EditGameEvent(); - - if (gameMode == EditPosition) - EditPositionDone(); - - if (!WhiteOnMove(currentMove)) { - DisplayError(_("It is not White's turn"), 0); - return; - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) - ExitAnalyzeMode(); - - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == AnalyzeFile) - TruncateGame(); - - ResurrectChessProgram(); /* in case it isn't running */ - gameMode = MachinePlaysWhite; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - sprintf(buf, "name %s\n", gameInfo.black); - SendToProgram(buf, &first); - } - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); /*gnu kludge*/ - } - SendTimeRemaining(&first, TRUE); - } - if (first.useColors) { - SendToProgram("white\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - SetMachineThinkingEnables(); - first.maybeThinking = TRUE; - StartClocks(); - - if (appData.autoFlipView && !flipView) { - flipView = !flipView; - DrawPosition(FALSE, NULL); - } - } - - void - MachineBlackEvent() - { - char buf[MSG_SIZ]; - - if (appData.noChessProgram || (gameMode == MachinePlaysBlack)) - return; - - - if (gameMode == PlayFromGameFile || - gameMode == TwoMachinesPlay || - gameMode == Training || - gameMode == AnalyzeMode || - gameMode == EndOfGame) - EditGameEvent(); - - if (gameMode == EditPosition) - EditPositionDone(); - - if (WhiteOnMove(currentMove)) { - DisplayError(_("It is not Black's turn"), 0); - return; - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) - ExitAnalyzeMode(); - - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == AnalyzeFile) - TruncateGame(); - - ResurrectChessProgram(); /* in case it isn't running */ - gameMode = MachinePlaysBlack; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); - DisplayTitle(buf); - if (first.sendName) { - sprintf(buf, "name %s\n", gameInfo.white); - SendToProgram(buf, &first); - } - if (first.sendTime) { - if (first.useColors) { - SendToProgram("white\n", &first); /*gnu kludge*/ - } - SendTimeRemaining(&first, FALSE); - } - if (first.useColors) { - SendToProgram("black\ngo\n", &first); - } else { - SendToProgram("go\n", &first); - } - SetMachineThinkingEnables(); - first.maybeThinking = TRUE; - StartClocks(); - - if (appData.autoFlipView && flipView) { - flipView = !flipView; - DrawPosition(FALSE, NULL); - } - } - - - void - DisplayTwoMachinesTitle() - { - char buf[MSG_SIZ]; - if (appData.matchGames > 0) { - if (first.twoMachinesColor[0] == 'w') { - sprintf(buf, "%s vs. %s (%d-%d-%d)", - gameInfo.white, gameInfo.black, - first.matchWins, second.matchWins, - matchGame - 1 - (first.matchWins + second.matchWins)); - } else { - sprintf(buf, "%s vs. %s (%d-%d-%d)", - gameInfo.white, gameInfo.black, - second.matchWins, first.matchWins, - matchGame - 1 - (first.matchWins + second.matchWins)); - } - } else { - sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); - } - DisplayTitle(buf); - } - - void - TwoMachinesEvent P((void)) - { - int i; - char buf[MSG_SIZ]; - ChessProgramState *onmove; - - if (appData.noChessProgram) return; - - switch (gameMode) { - case TwoMachinesPlay: - return; - case MachinePlaysWhite: - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError(_("Wait until your turn,\nor select Move Now"), 0); - return; - } - /* fall through */ - case BeginningOfGame: - case PlayFromGameFile: - case EndOfGame: - EditGameEvent(); - if (gameMode != EditGame) return; - break; - case EditPosition: - EditPositionDone(); - break; - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - break; - case EditGame: - default: - break; - } - - forwardMostMove = currentMove; - ResurrectChessProgram(); /* in case first program isn't running */ - - if (second.pr == NULL) { - StartChessProgram(&second); - if (second.protocolVersion == 1) { - TwoMachinesEventIfReady(); - } else { - /* kludge: allow timeout for initial "feature" command */ - FreezeUI(); - DisplayMessage("", _("Starting second chess program")); - ScheduleDelayedEvent(TwoMachinesEventIfReady, FEATURE_TIMEOUT); - } - return; - } - DisplayMessage("", ""); - InitChessProgram(&second); - SendToProgram("force\n", &second); - if (startedFromSetupPosition) { - SendBoard(&second, backwardMostMove); - } - for (i = backwardMostMove; i < forwardMostMove; i++) { - SendMoveToProgram(i, &second); - } - - gameMode = TwoMachinesPlay; - pausing = FALSE; - ModeHighlight(); - SetGameInfo(); - DisplayTwoMachinesTitle(); - firstMove = TRUE; - if ((first.twoMachinesColor[0] == 'w') == WhiteOnMove(forwardMostMove)) { - onmove = &first; - } else { - onmove = &second; - } - - SendToProgram(first.computerString, &first); - if (first.sendName) { - sprintf(buf, "name %s\n", second.tidy); - SendToProgram(buf, &first); - } - SendToProgram(second.computerString, &second); - if (second.sendName) { - sprintf(buf, "name %s\n", first.tidy); - SendToProgram(buf, &second); - } - - if (!first.sendTime || !second.sendTime) { - ResetClocks(); - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - } - if (onmove->sendTime) { - if (onmove->useColors) { - SendToProgram(onmove->other->twoMachinesColor, onmove); /*gnu kludge*/ - } - SendTimeRemaining(onmove, WhiteOnMove(forwardMostMove)); - } - if (onmove->useColors) { - SendToProgram(onmove->twoMachinesColor, onmove); - } - SendToProgram("go\n", onmove); - onmove->maybeThinking = TRUE; - SetMachineThinkingEnables(); - - StartClocks(); - } - - void - TrainingEvent() - { - if (gameMode == Training) { - SetTrainingModeOff(); - gameMode = PlayFromGameFile; - DisplayMessage("", _("Training mode off")); - } else { - gameMode = Training; - animateTraining = appData.animate; - - /* make sure we are not already at the end of the game */ - if (currentMove < forwardMostMove) { - SetTrainingModeOn(); - DisplayMessage("", _("Training mode on")); - } else { - gameMode = PlayFromGameFile; - DisplayError(_("Already at end of game"), 0); - } - } - ModeHighlight(); - } - - void - IcsClientEvent() - { - if (!appData.icsActive) return; - switch (gameMode) { - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsIdle: - case BeginningOfGame: - case IcsExamining: - return; - - case EditGame: - break; - - case EditPosition: - EditPositionDone(); - break; - - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - break; - - default: - EditGameEvent(); - break; - } - - gameMode = IcsIdle; - ModeHighlight(); - return; - } - - - void - EditGameEvent() - { - int i; - - switch (gameMode) { - case Training: - SetTrainingModeOff(); - break; - case MachinePlaysWhite: - case MachinePlaysBlack: - case BeginningOfGame: - SendToProgram("force\n", &first); - SetUserThinkingEnables(); - break; - case PlayFromGameFile: - (void) StopLoadGameTimer(); - if (gameFileFP != NULL) { - gameFileFP = NULL; - } - break; - case EditPosition: - EditPositionDone(); - break; - case AnalyzeMode: - case AnalyzeFile: - ExitAnalyzeMode(); - SendToProgram("force\n", &first); - break; - case TwoMachinesPlay: - GameEnds((ChessMove) 0, NULL, GE_PLAYER); - ResurrectChessProgram(); - SetUserThinkingEnables(); - break; - case EndOfGame: - ResurrectChessProgram(); - break; - case IcsPlayingBlack: - case IcsPlayingWhite: - DisplayError(_("Warning: You are still playing a game"), 0); - break; - case IcsObserving: - DisplayError(_("Warning: You are still observing a game"), 0); - break; - case IcsExamining: - DisplayError(_("Warning: You are still examining a game"), 0); - break; - case IcsIdle: - break; - case EditGame: - default: - return; - } - - pausing = FALSE; - StopClocks(); - first.offeredDraw = second.offeredDraw = 0; - - if (gameMode == PlayFromGameFile) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayTitle(""); - } - - if (gameMode == MachinePlaysWhite || - gameMode == MachinePlaysBlack || - gameMode == TwoMachinesPlay || - gameMode == EndOfGame) { - i = forwardMostMove; - while (i > currentMove) { - SendToProgram("undo\n", &first); - i--; - } - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayBothClocks(); - if (whiteFlag || blackFlag) { - whiteFlag = blackFlag = 0; - } - DisplayTitle(""); - } - - gameMode = EditGame; - ModeHighlight(); - SetGameInfo(); - } - - - void - EditPositionEvent() - { - if (gameMode == EditPosition) { - EditGameEvent(); - return; - } - - EditGameEvent(); - if (gameMode != EditGame) return; - - gameMode = EditPosition; - ModeHighlight(); - SetGameInfo(); - if (currentMove > 0) - CopyBoard(boards[0], boards[currentMove]); - - blackPlaysFirst = !WhiteOnMove(currentMove); - ResetClocks(); - currentMove = forwardMostMove = backwardMostMove = 0; - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - DisplayMove(-1); - } - - void - ExitAnalyzeMode() - { - /* icsEngineAnalyze - possible call from other functions */ - if (appData.icsEngineAnalyze) { - appData.icsEngineAnalyze = FALSE; - DisplayMessage("","Close ICS engine analyze..."); - } - if (first.analysisSupport && first.analyzing) { - SendToProgram("exit\n", &first); - first.analyzing = FALSE; - } - AnalysisPopDown(); - thinkOutput[0] = NULLCHAR; - } - - void - EditPositionDone() - { - startedFromSetupPosition = TRUE; - InitChessProgram(&first); - SendToProgram("force\n", &first); - if (blackPlaysFirst) { - strcpy(moveList[0], ""); - strcpy(parseList[0], ""); - currentMove = forwardMostMove = backwardMostMove = 1; - CopyBoard(boards[1], boards[0]); - } else { - currentMove = forwardMostMove = backwardMostMove = 0; - } - SendBoard(&first, forwardMostMove); - DisplayTitle(""); - timeRemaining[0][forwardMostMove] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove] = blackTimeRemaining; - gameMode = EditGame; - ModeHighlight(); - HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); - } - - /* Pause for `ms' milliseconds */ - /* !! Ugh, this is a kludge. Fix it sometime. --tpm */ - void - TimeDelay(ms) - long ms; - { - TimeMark m1, m2; - - GetTimeMark(&m1); - do { - GetTimeMark(&m2); - } while (SubtractTimeMarks(&m2, &m1) < ms); - } - - /* !! Ugh, this is a kludge. Fix it sometime. --tpm */ - void - SendMultiLineToICS(buf) - char *buf; - { - char temp[MSG_SIZ+1], *p; - int len; - - len = strlen(buf); - if (len > MSG_SIZ) - len = MSG_SIZ; - - strncpy(temp, buf, len); - temp[len] = 0; - - p = temp; - while (*p) { - if (*p == '\n' || *p == '\r') - *p = ' '; - ++p; - } - - strcat(temp, "\n"); - SendToICS(temp); - SendToPlayer(temp, strlen(temp)); - } - - void - SetWhiteToPlayEvent() - { - if (gameMode == EditPosition) { - blackPlaysFirst = FALSE; - DisplayBothClocks(); /* works because currentMove is 0 */ - } else if (gameMode == IcsExamining) { - SendToICS(ics_prefix); - SendToICS("tomove white\n"); - } - } - - void - SetBlackToPlayEvent() - { - if (gameMode == EditPosition) { - blackPlaysFirst = TRUE; - currentMove = 1; /* kludge */ - DisplayBothClocks(); - currentMove = 0; - } else if (gameMode == IcsExamining) { - SendToICS(ics_prefix); - SendToICS("tomove black\n"); - } - } - - void - EditPositionMenuEvent(selection, x, y) - ChessSquare selection; - int x, y; - { - char buf[MSG_SIZ]; - - if (gameMode != EditPosition && gameMode != IcsExamining) return; - - switch (selection) { - case ClearBoard: - if (gameMode == IcsExamining && ics_type == ICS_FICS) { - SendToICS(ics_prefix); - SendToICS("bsetup clear\n"); - } else if (gameMode == IcsExamining && ics_type == ICS_ICC) { - SendToICS(ics_prefix); - SendToICS("clearboard\n"); - } else { - for (x = 0; x < BOARD_SIZE; x++) { - for (y = 0; y < BOARD_SIZE; y++) { - if (gameMode == IcsExamining) { - if (boards[currentMove][y][x] != EmptySquare) { - sprintf(buf, "%sx@%c%c\n", ics_prefix, - 'a' + x, '1' + y); - SendToICS(buf); - } - } else { - boards[0][y][x] = EmptySquare; - } - } - } - } - if (gameMode == EditPosition) { - DrawPosition(FALSE, boards[0]); - } - break; - - case WhitePlay: - SetWhiteToPlayEvent(); - break; - - case BlackPlay: - SetBlackToPlayEvent(); - break; - - case EmptySquare: - if (gameMode == IcsExamining) { - sprintf(buf, "%sx@%c%c\n", ics_prefix, 'a' + x, '1' + y); - SendToICS(buf); - } else { - boards[0][y][x] = EmptySquare; - DrawPosition(FALSE, boards[0]); - } - break; - - default: - if (gameMode == IcsExamining) { - sprintf(buf, "%s%c@%c%c\n", ics_prefix, - PieceToChar(selection), 'a' + x, '1' + y); - SendToICS(buf); - } else { - boards[0][y][x] = selection; - DrawPosition(FALSE, boards[0]); - } - break; - } - } - - - void - DropMenuEvent(selection, x, y) - ChessSquare selection; - int x, y; - { - ChessMove moveType; - - switch (gameMode) { - case IcsPlayingWhite: - case MachinePlaysBlack: - if (!WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is Black's turn")); - return; - } - moveType = WhiteDrop; - break; - case IcsPlayingBlack: - case MachinePlaysWhite: - if (WhiteOnMove(currentMove)) { - DisplayMoveError(_("It is White's turn")); - return; - } - moveType = BlackDrop; - break; - case EditGame: - moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; - break; - default: - return; - } - - if (moveType == BlackDrop && selection < BlackPawn) { - selection = (ChessSquare) ((int) selection - + (int) BlackPawn - (int) WhitePawn); - } - if (boards[currentMove][y][x] != EmptySquare) { - DisplayMoveError(_("That square is occupied")); - return; - } - - FinishMove(moveType, (int) selection, DROP_RANK, x, y, NULLCHAR); - } - - void - AcceptEvent() - { - /* Accept a pending offer of any kind from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("accept\n"); - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { - TruncateGame(); - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; - } else { - DisplayError(_("There is no pending offer on this move"), 0); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } else { - /* Not used for offers from chess program */ - } - } - - void - DeclineEvent() - { - /* Decline a pending offer of any kind from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("decline\n"); - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { - #ifdef NOTDEF - AppendComment(cmailOldMove, "Draw declined"); - DisplayComment(cmailOldMove - 1, "Draw declined"); - #endif /*NOTDEF*/ - } else { - DisplayError(_("There is no pending offer on this move"), 0); - } - } else { - /* Not used for offers from chess program */ - } - } - - void - RematchEvent() - { - /* Issue ICS rematch command */ - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("rematch\n"); - } - } - - void - CallFlagEvent() - { - /* Call your opponent's flag (claim a win on time) */ - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } else { - switch (gameMode) { - default: - return; - case MachinePlaysWhite: - if (whiteFlag) { - if (blackFlag) - GameEnds(GameIsDrawn, "Both players ran out of time", - GE_PLAYER); - else - GameEnds(BlackWins, "Black wins on time", GE_PLAYER); - } else { - DisplayError(_("Your opponent is not out of time"), 0); - } - break; - case MachinePlaysBlack: - if (blackFlag) { - if (whiteFlag) - GameEnds(GameIsDrawn, "Both players ran out of time", - GE_PLAYER); - else - GameEnds(WhiteWins, "White wins on time", GE_PLAYER); - } else { - DisplayError(_("Your opponent is not out of time"), 0); - } - break; - } - } - } - - void - DrawEvent() - { - /* Offer draw or accept pending draw offer from opponent */ - - if (appData.icsActive) { - /* Note: tournament rules require draw offers to be - made after you make your move but before you punch - your clock. Currently ICS doesn't let you do that; - instead, you immediately punch your clock after making - a move, but you can offer a draw at any time. */ - - SendToICS(ics_prefix); - SendToICS("draw\n"); - } else if (cmailMsgLoaded) { - if (currentMove == cmailOldMove && - commentList[cmailOldMove] != NULL && - StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? - "Black offers a draw" : "White offers a draw")) { - GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; - } else if (currentMove == cmailOldMove + 1) { - char *offer = WhiteOnMove(cmailOldMove) ? - "White offers a draw" : "Black offers a draw"; - AppendComment(currentMove, offer); - DisplayComment(currentMove - 1, offer); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_DRAW; - } else { - DisplayError(_("You must make your move before offering a draw"), 0); - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; - } - } else if (first.offeredDraw) { - GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); - } else { - if (first.sendDrawOffers) { - SendToProgram("draw\n", &first); - userOfferedDraw = TRUE; - } - } - } - - void - AdjournEvent() - { - /* Offer Adjourn or accept pending Adjourn offer from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("adjourn\n"); - } else { - /* Currently GNU Chess doesn't offer or accept Adjourns */ - } - } - - - void - AbortEvent() - { - /* Offer Abort or accept pending Abort offer from opponent */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("abort\n"); - } else { - GameEnds(GameUnfinished, "Game aborted", GE_PLAYER); - } - } - - void - ResignEvent() - { - /* Resign. You can do this even if it's not your turn. */ - - if (appData.icsActive) { - SendToICS(ics_prefix); - SendToICS("resign\n"); - } else { - switch (gameMode) { - case MachinePlaysWhite: - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - break; - case MachinePlaysBlack: - GameEnds(BlackWins, "White resigns", GE_PLAYER); - break; - case EditGame: - if (cmailMsgLoaded) { - TruncateGame(); - if (WhiteOnMove(cmailOldMove)) { - GameEnds(BlackWins, "White resigns", GE_PLAYER); - } else { - GameEnds(WhiteWins, "Black resigns", GE_PLAYER); - } - cmailMoveType[lastLoadGameNumber - 1] = CMAIL_RESIGN; - } - break; - default: - break; - } - } - } - - - void - StopObservingEvent() - { - /* Stop observing current games */ - SendToICS(ics_prefix); - SendToICS("unobserve\n"); - } - - void - StopExaminingEvent() - { - /* Stop observing current game */ - SendToICS(ics_prefix); - SendToICS("unexamine\n"); - } - - void - ForwardInner(target) - int target; - { - int limit; - - if (appData.debugMode) - fprintf(debugFP, "ForwardInner(%d), current %d, forward %d\n", - target, currentMove, forwardMostMove); - - if (gameMode == EditPosition) - return; - - if (gameMode == PlayFromGameFile && !pausing) - PauseEvent(); - - if (gameMode == IcsExamining && pausing) - limit = pauseExamForwardMostMove; - else - limit = forwardMostMove; - - if (target > limit) target = limit; - - if (target > 0 && moveList[target - 1][0]) { - int fromX, fromY, toX, toY; - toX = moveList[target - 1][2] - 'a'; - toY = moveList[target - 1][3] - '1'; - if (moveList[target - 1][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[target - 1][0] - 'a'; - fromY = moveList[target - 1][1] - '1'; - if (target == currentMove + 1) { - AnimateMove(boards[currentMove], fromX, fromY, toX, toY); - } - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - } - if (gameMode == EditGame || gameMode == AnalyzeMode || - gameMode == Training || gameMode == PlayFromGameFile || - gameMode == AnalyzeFile) { - while (currentMove < target) { - SendMoveToProgram(currentMove++, &first); - } - } else { - currentMove = target; - } - - if (gameMode == EditGame || gameMode == EndOfGame) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - } - DisplayBothClocks(); - DisplayMove(currentMove - 1); - DrawPosition(FALSE, boards[currentMove]); - HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); - if (commentList[currentMove] && !matchMode && gameMode != Training) { - DisplayComment(currentMove - 1, commentList[currentMove]); - } - } - - - void - ForwardEvent() - { - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("forward\n"); - } else { - ForwardInner(currentMove + 1); - } - } - - void - ToEndEvent() - { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* to optimze, we temporarily turn off analysis mode while we feed - * the remaining moves to the engine. Otherwise we get analysis output - * after each move. - */ - if (first.analysisSupport) { - SendToProgram("exit\nforce\n", &first); - first.analyzing = FALSE; - } - } - - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("forward 999999\n"); - } else { - ForwardInner(forwardMostMove); - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* we have fed all the moves, so reactivate analysis mode */ - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - } - } - - void - BackwardInner(target) - int target; - { - if (appData.debugMode) - fprintf(debugFP, "BackwardInner(%d), current %d, forward %d\n", - target, currentMove, forwardMostMove); - - if (gameMode == EditPosition) return; - if (currentMove <= backwardMostMove) { - ClearHighlights(); - DrawPosition(FALSE, boards[currentMove]); - return; - } - if (gameMode == PlayFromGameFile && !pausing) - PauseEvent(); - - if (moveList[target][0]) { - int fromX, fromY, toX, toY; - toX = moveList[target][2] - 'a'; - toY = moveList[target][3] - '1'; - if (moveList[target][1] == '@') { - if (appData.highlightLastMove) { - SetHighlights(-1, -1, toX, toY); - } - } else { - fromX = moveList[target][0] - 'a'; - fromY = moveList[target][1] - '1'; - if (target == currentMove - 1) { - AnimateMove(boards[currentMove], toX, toY, fromX, fromY); - } - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } - } - } - if (gameMode == EditGame || gameMode==AnalyzeMode || - gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { - while (currentMove > target) { - SendToProgram("undo\n", &first); - currentMove--; - } - } else { - currentMove = target; - } - - if (gameMode == EditGame || gameMode == EndOfGame) { - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - } - DisplayBothClocks(); - DisplayMove(currentMove - 1); - DrawPosition(FALSE, boards[currentMove]); - HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); - if (commentList[currentMove] != NULL) { - DisplayComment(currentMove - 1, commentList[currentMove]); - } - } - - void - BackwardEvent() - { - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("backward\n"); - } else { - BackwardInner(currentMove - 1); - } - } - - void - ToStartEvent() - { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* to optimze, we temporarily turn off analysis mode while we undo - * all the moves. Otherwise we get analysis output after each undo. - */ - if (first.analysisSupport) { - SendToProgram("exit\nforce\n", &first); - first.analyzing = FALSE; - } - } - - if (gameMode == IcsExamining && !pausing) { - SendToICS(ics_prefix); - SendToICS("backward 999999\n"); - } else { - BackwardInner(backwardMostMove); - } - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - /* we have fed all the moves, so reactivate analysis mode */ - SendToProgram("analyze\n", &first); - first.analyzing = TRUE; - /*first.maybeThinking = TRUE;*/ - first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - } - } - - void - ToNrEvent(int to) - { - if (gameMode == PlayFromGameFile && !pausing) PauseEvent(); - if (to >= forwardMostMove) to = forwardMostMove; - if (to <= backwardMostMove) to = backwardMostMove; - if (to < currentMove) { - BackwardInner(to); - } else { - ForwardInner(to); - } - } - - void - RevertEvent() - { - if (gameMode != IcsExamining) { - DisplayError(_("You are not examining a game"), 0); - return; - } - if (pausing) { - DisplayError(_("You can't revert while pausing"), 0); - return; - } - SendToICS(ics_prefix); - SendToICS("revert\n"); - } - - void - RetractMoveEvent() - { - switch (gameMode) { - case MachinePlaysWhite: - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError(_("Wait until your turn,\nor select Move Now"), 0); - return; - } - if (forwardMostMove < 2) return; - currentMove = forwardMostMove = forwardMostMove - 2; - whiteTimeRemaining = timeRemaining[0][currentMove]; - blackTimeRemaining = timeRemaining[1][currentMove]; - DisplayBothClocks(); - DisplayMove(currentMove - 1); - ClearHighlights();/*!! could figure this out*/ - DrawPosition(FALSE, boards[currentMove]); - SendToProgram("remove\n", &first); - /*first.maybeThinking = TRUE;*/ /* GNU Chess does not ponder here */ - break; - - case BeginningOfGame: - default: - break; - - case IcsPlayingWhite: - case IcsPlayingBlack: - if (WhiteOnMove(forwardMostMove) == (gameMode == IcsPlayingWhite)) { - SendToICS(ics_prefix); - SendToICS("takeback 2\n"); - } else { - SendToICS(ics_prefix); - SendToICS("takeback 1\n"); - } - break; - } - } - - void - MoveNowEvent() - { - ChessProgramState *cps; - - switch (gameMode) { - case MachinePlaysWhite: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("It is your turn"), 0); - return; - } - cps = &first; - break; - case MachinePlaysBlack: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("It is your turn"), 0); - return; - } - cps = &first; - break; - case TwoMachinesPlay: - if (WhiteOnMove(forwardMostMove) == - (first.twoMachinesColor[0] == 'w')) { - cps = &first; - } else { - cps = &second; - } - break; - case BeginningOfGame: - default: - return; - } - SendToProgram("?\n", cps); - } - - void - TruncateGameEvent() - { - EditGameEvent(); - if (gameMode != EditGame) return; - TruncateGame(); - } - - void - TruncateGame() - { - if (forwardMostMove > currentMove) { - if (gameInfo.resultDetails != NULL) { - free(gameInfo.resultDetails); - gameInfo.resultDetails = NULL; - gameInfo.result = GameUnfinished; - } - forwardMostMove = currentMove; - HistorySet(parseList, backwardMostMove, forwardMostMove, - currentMove-1); - } - } - - void - HintEvent() - { - if (appData.noChessProgram) return; - switch (gameMode) { - case MachinePlaysWhite: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn"), 0); - return; - } - break; - case BeginningOfGame: - case MachinePlaysBlack: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn"), 0); - return; - } - break; - default: - DisplayError(_("No hint available"), 0); - return; - } - SendToProgram("hint\n", &first); - hintRequested = TRUE; - } - - void - BookEvent() - { - if (appData.noChessProgram) return; - switch (gameMode) { - case MachinePlaysWhite: - if (WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn"), 0); - return; - } - break; - case BeginningOfGame: - case MachinePlaysBlack: - if (!WhiteOnMove(forwardMostMove)) { - DisplayError(_("Wait until your turn"), 0); - return; - } - break; - case EditPosition: - EditPositionDone(); - break; - case TwoMachinesPlay: - return; - default: - break; - } - SendToProgram("bk\n", &first); - bookOutput[0] = NULLCHAR; - bookRequested = TRUE; - } - - void - AboutGameEvent() - { - char *tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - - /* end button procedures */ - - void - PrintPosition(fp, move) - FILE *fp; - int move; - { - int i, j; - - for (i = BOARD_SIZE - 1; i >= 0; i--) { - for (j = 0; j < BOARD_SIZE; j++) { - char c = PieceToChar(boards[move][i][j]); - fputc(c == 'x' ? '.' : c, fp); - fputc(j == BOARD_SIZE - 1 ? '\n' : ' ', fp); - } - } - if ((gameMode == EditPosition) ? !blackPlaysFirst : (move % 2 == 0)) - fprintf(fp, "white to play\n"); - else - fprintf(fp, "black to play\n"); - } - - void - PrintOpponents(fp) - FILE *fp; - { - if (gameInfo.white != NULL) { - fprintf(fp, "\t%s vs. %s\n", gameInfo.white, gameInfo.black); - } else { - fprintf(fp, "\n"); - } - } - - /* Find last component of program's own name, using some heuristics */ - void - TidyProgramName(prog, host, buf) - char *prog, *host, buf[MSG_SIZ]; - { - char *p, *q; - int local = (strcmp(host, "localhost") == 0); - while (!local && (p = strchr(prog, ';')) != NULL) { - p++; - while (*p == ' ') p++; - prog = p; - } - if (*prog == '"' || *prog == '\'') { - q = strchr(prog + 1, *prog); - } else { - q = strchr(prog, ' '); - } - if (q == NULL) q = prog + strlen(prog); - p = q; - while (p >= prog && *p != '/' && *p != '\\') p--; - p++; - if (q - p >= 4 && StrCaseCmp(q - 4, ".exe") == 0) q -= 4; - memcpy(buf, p, q - p); - buf[q - p] = NULLCHAR; - if (!local) { - strcat(buf, "@"); - strcat(buf, host); - } - } - - char * - TimeControlTagValue() - { - char buf[MSG_SIZ]; - if (!appData.clockMode) { - strcpy(buf, "-"); - } else if (movesPerSession > 0) { - sprintf(buf, "%d/%ld", movesPerSession, timeControl/1000); - } else if (timeIncrement == 0) { - sprintf(buf, "%ld", timeControl/1000); - } else { - sprintf(buf, "%ld+%ld", timeControl/1000, timeIncrement/1000); - } - return StrSave(buf); - } - - void - SetGameInfo() - { - /* This routine is used only for certain modes */ - VariantClass v = gameInfo.variant; - ClearGameInfo(&gameInfo); - gameInfo.variant = v; - - switch (gameMode) { - case MachinePlaysWhite: - gameInfo.event = StrSave("Computer chess game"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(first.tidy); - gameInfo.black = StrSave(UserName()); - gameInfo.timeControl = TimeControlTagValue(); - break; - - case MachinePlaysBlack: - gameInfo.event = StrSave("Computer chess game"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave(UserName()); - gameInfo.black = StrSave(first.tidy); - gameInfo.timeControl = TimeControlTagValue(); - break; - - case TwoMachinesPlay: - gameInfo.event = StrSave("Computer chess game"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - if (matchGame > 0) { - char buf[MSG_SIZ]; - sprintf(buf, "%d", matchGame); - gameInfo.round = StrSave(buf); - } else { - gameInfo.round = StrSave("-"); - } - if (first.twoMachinesColor[0] == 'w') { - gameInfo.white = StrSave(first.tidy); - gameInfo.black = StrSave(second.tidy); - } else { - gameInfo.white = StrSave(second.tidy); - gameInfo.black = StrSave(first.tidy); - } - gameInfo.timeControl = TimeControlTagValue(); - break; - - case EditGame: - gameInfo.event = StrSave("Edited game"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("-"); - gameInfo.black = StrSave("-"); - break; - - case EditPosition: - gameInfo.event = StrSave("Edited position"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("-"); - gameInfo.black = StrSave("-"); - break; - - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsExamining: - break; - - case PlayFromGameFile: - gameInfo.event = StrSave("Game from non-PGN file"); - gameInfo.site = StrSave(HostName()); - gameInfo.date = PGNDate(); - gameInfo.round = StrSave("-"); - gameInfo.white = StrSave("?"); - gameInfo.black = StrSave("?"); - break; - - default: - break; - } - } - - void - ReplaceComment(index, text) - int index; - char *text; - { - int len; - - while (*text == '\n') text++; - len = strlen(text); - while (len > 0 && text[len - 1] == '\n') len--; - - if (commentList[index] != NULL) - free(commentList[index]); - - if (len == 0) { - commentList[index] = NULL; - return; - } - commentList[index] = (char *) malloc(len + 2); - strncpy(commentList[index], text, len); - commentList[index][len] = '\n'; - commentList[index][len + 1] = NULLCHAR; - } - - void - CrushCRs(text) - char *text; - { - char *p = text; - char *q = text; - char ch; - - do { - ch = *p++; - if (ch == '\r') continue; - *q++ = ch; - } while (ch != '\0'); - } - - void - AppendComment(index, text) - int index; - char *text; - { - int oldlen, len; - char *old; - - CrushCRs(text); - while (*text == '\n') text++; - len = strlen(text); - while (len > 0 && text[len - 1] == '\n') len--; - - if (len == 0) return; - - if (commentList[index] != NULL) { - old = commentList[index]; - oldlen = strlen(old); - commentList[index] = (char *) malloc(oldlen + len + 2); - strcpy(commentList[index], old); - free(old); - strncpy(&commentList[index][oldlen], text, len); - commentList[index][oldlen + len] = '\n'; - commentList[index][oldlen + len + 1] = NULLCHAR; - } else { - commentList[index] = (char *) malloc(len + 2); - strncpy(commentList[index], text, len); - commentList[index][len] = '\n'; - commentList[index][len + 1] = NULLCHAR; - } - } - - void - SendToProgram(message, cps) - char *message; - ChessProgramState *cps; - { - int count, outCount, error; - char buf[MSG_SIZ]; - - if (cps->pr == NULL) return; - Attention(cps); - - if (appData.debugMode) { - TimeMark now; - GetTimeMark(&now); - fprintf(debugFP, "%ld >%-6s: %s", - SubtractTimeMarks(&now, &programStartTime), - cps->which, message); - } - - count = strlen(message); - outCount = OutputToProcess(cps->pr, message, count, &error); - if (outCount < count && !exiting) { - sprintf(buf, _("Error writing to %s chess program"), cps->which); - DisplayFatalError(buf, error, 1); - } - } - - void - ReceiveFromProgram(isr, closure, message, count, error) - InputSourceRef isr; - VOIDSTAR closure; - char *message; - int count; - int error; - { - char *end_str; - char buf[MSG_SIZ]; - ChessProgramState *cps = (ChessProgramState *)closure; - - if (isr != cps->isr) return; /* Killed intentionally */ - if (count <= 0) { - if (count == 0) { - sprintf(buf, - _("Error: %s chess program (%s) exited unexpectedly"), - cps->which, cps->program); - RemoveInputSource(cps->isr); - DisplayFatalError(buf, 0, 1); - } else { - sprintf(buf, - _("Error reading from %s chess program (%s)"), - cps->which, cps->program); - RemoveInputSource(cps->isr); - DisplayFatalError(buf, error, 1); - } - GameEnds((ChessMove) 0, NULL, GE_PLAYER); - return; - } - - if ((end_str = strchr(message, '\r')) != NULL) - *end_str = NULLCHAR; - if ((end_str = strchr(message, '\n')) != NULL) - *end_str = NULLCHAR; - - if (appData.debugMode) { - TimeMark now; - GetTimeMark(&now); - fprintf(debugFP, "%ld <%-6s: %s\n", - SubtractTimeMarks(&now, &programStartTime), - cps->which, message); - } - /* if icsEngineAnalyze is active we block all - whisper and kibitz output, because nobody want - see this - */ - if (appData.icsEngineAnalyze) { - if (strstr(message, "whisper") != NULL || - strstr(message, "kibitz") != NULL || - strstr(message, "tellics") != NULL) return; - HandleMachineMove(message, cps); - } else { - HandleMachineMove(message, cps); - } - } - - - void - SendTimeControl(cps, mps, tc, inc, sd, st) - ChessProgramState *cps; - int mps, inc, sd, st; - long tc; - { - char buf[MSG_SIZ]; - int seconds = (tc / 1000) % 60; - - if (st > 0) { - /* Set exact time per move, normally using st command */ - if (cps->stKludge) { - /* GNU Chess 4 has no st command; uses level in a nonstandard way */ - seconds = st % 60; - if (seconds == 0) { - sprintf(buf, "level 1 %d\n", st/60); - } else { - sprintf(buf, "level 1 %d:%02d\n", st/60, seconds); - } - } else { - sprintf(buf, "st %d\n", st); - } - } else { - /* Set conventional or incremental time control, using level command */ - if (seconds == 0) { - /* Note old gnuchess bug -- minutes:seconds used to not work. - Fixed in later versions, but still avoid :seconds - when seconds is 0. */ - sprintf(buf, "level %d %ld %d\n", mps, tc/60000, inc/1000); - } else { - sprintf(buf, "level %d %ld:%02d %d\n", mps, tc/60000, - seconds, inc/1000); - } - } - SendToProgram(buf, cps); - - /* Orthoganally (except for GNU Chess 4), limit time to st seconds */ - /* Orthogonally, limit search to given depth */ - if (sd > 0) { - if (cps->sdKludge) { - sprintf(buf, "depth\n%d\n", sd); - } else { - sprintf(buf, "sd %d\n", sd); - } - SendToProgram(buf, cps); - } - } - - void - SendTimeRemaining(cps, machineWhite) - ChessProgramState *cps; - int /*boolean*/ machineWhite; - { - char message[MSG_SIZ]; - long time, otime; - - /* Note: this routine must be called when the clocks are stopped - or when they have *just* been set or switched; otherwise - it will be off by the time since the current tick started. - */ - if (machineWhite) { - time = whiteTimeRemaining / 10; - otime = blackTimeRemaining / 10; - } else { - time = blackTimeRemaining / 10; - otime = whiteTimeRemaining / 10; - } - if (time <= 0) time = 1; - if (otime <= 0) otime = 1; - - sprintf(message, "time %ld\notim %ld\n", time, otime); - SendToProgram(message, cps); - } - - int - BoolFeature(p, name, loc, cps) - char **p; - char *name; - int *loc; - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - int len = strlen(name); - int val; - if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { - (*p) += len + 1; - sscanf(*p, "%d", &val); - *loc = (val != 0); - while (**p && **p != ' ') (*p)++; - sprintf(buf, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; - } - - int - IntFeature(p, name, loc, cps) - char **p; - char *name; - int *loc; - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - int len = strlen(name); - if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { - (*p) += len + 1; - sscanf(*p, "%d", loc); - while (**p && **p != ' ') (*p)++; - sprintf(buf, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; - } - - int - StringFeature(p, name, loc, cps) - char **p; - char *name; - char loc[]; - ChessProgramState *cps; - { - char buf[MSG_SIZ]; - int len = strlen(name); - if (strncmp((*p), name, len) == 0 - && (*p)[len] == '=' && (*p)[len+1] == '\"') { - (*p) += len + 2; - sscanf(*p, "%[^\"]", loc); - while (**p && **p != '\"') (*p)++; - if (**p == '\"') (*p)++; - sprintf(buf, "accepted %s\n", name); - SendToProgram(buf, cps); - return TRUE; - } - return FALSE; - } - - void - FeatureDone(cps, val) - ChessProgramState* cps; - int val; - { - DelayedEventCallback cb = GetDelayedEvent(); - if ((cb == InitBackEnd3 && cps == &first) || - (cb == TwoMachinesEventIfReady && cps == &second)) { - CancelDelayedEvent(); - ScheduleDelayedEvent(cb, val ? 1 : 3600000); - } - cps->initDone = val; - } - - /* Parse feature command from engine */ - void - ParseFeatures(args, cps) - char* args; - ChessProgramState *cps; - { - char *p = args; - char *q; - int val; - char buf[MSG_SIZ]; - - for (;;) { - while (*p == ' ') p++; - if (*p == NULLCHAR) return; - - if (BoolFeature(&p, "setboard", &cps->useSetboard, cps)) continue; - if (BoolFeature(&p, "time", &cps->sendTime, cps)) continue; - if (BoolFeature(&p, "draw", &cps->sendDrawOffers, cps)) continue; - if (BoolFeature(&p, "sigint", &cps->useSigint, cps)) continue; - if (BoolFeature(&p, "sigterm", &cps->useSigterm, cps)) continue; - if (BoolFeature(&p, "reuse", &val, cps)) { - /* Engine can disable reuse, but can't enable it if user said no */ - if (!val) cps->reuse = FALSE; - continue; - } - if (BoolFeature(&p, "analyze", &cps->analysisSupport, cps)) continue; - if (StringFeature(&p, "myname", &cps->tidy, cps)) { - if (gameMode == TwoMachinesPlay) { - DisplayTwoMachinesTitle(); - } else { - DisplayTitle(""); - } - continue; - } - if (StringFeature(&p, "variants", &cps->variants, cps)) continue; - if (BoolFeature(&p, "san", &cps->useSAN, cps)) continue; - if (BoolFeature(&p, "ping", &cps->usePing, cps)) continue; - if (BoolFeature(&p, "playother", &cps->usePlayother, cps)) continue; - if (BoolFeature(&p, "colors", &cps->useColors, cps)) continue; - if (BoolFeature(&p, "usermove", &cps->useUsermove, cps)) continue; - if (BoolFeature(&p, "ics", &cps->sendICS, cps)) continue; - if (BoolFeature(&p, "name", &cps->sendName, cps)) continue; - if (BoolFeature(&p, "pause", &val, cps)) continue; /* unused at present */ - if (IntFeature(&p, "done", &val, cps)) { - FeatureDone(cps, val); - continue; - } - - /* unknown feature: complain and skip */ - q = p; - while (*q && *q != '=') q++; - sprintf(buf, "rejected %.*s\n", q-p, p); - SendToProgram(buf, cps); - p = q; - if (*p == '=') { - p++; - if (*p == '\"') { - p++; - while (*p && *p != '\"') p++; - if (*p == '\"') p++; - } else { - while (*p && *p != ' ') p++; - } - } - } - - } - - void - PeriodicUpdatesEvent(newState) - int newState; - { - if (newState == appData.periodicUpdates) - return; - - appData.periodicUpdates=newState; - - /* Display type changes, so update it now */ - DisplayAnalysis(); - - /* Get the ball rolling again... */ - if (newState) { - AnalysisPeriodicEvent(1); - StartAnalysisClock(); - } - } - - void - PonderNextMoveEvent(newState) - int newState; - { - if (newState == appData.ponderNextMove) return; - if (gameMode == EditPosition) EditPositionDone(); - if (newState) { - SendToProgram("hard\n", &first); - if (gameMode == TwoMachinesPlay) { - SendToProgram("hard\n", &second); - } - } else { - SendToProgram("easy\n", &first); - thinkOutput[0] = NULLCHAR; - if (gameMode == TwoMachinesPlay) { - SendToProgram("easy\n", &second); - } - } - appData.ponderNextMove = newState; - } - - void - ShowThinkingEvent(newState) - int newState; - { - if (newState == appData.showThinking) return; - if (gameMode == EditPosition) EditPositionDone(); - if (newState) { - SendToProgram("post\n", &first); - if (gameMode == TwoMachinesPlay) { - SendToProgram("post\n", &second); - } - } else { - SendToProgram("nopost\n", &first); - thinkOutput[0] = NULLCHAR; - if (gameMode == TwoMachinesPlay) { - SendToProgram("nopost\n", &second); - } - } - appData.showThinking = newState; - } - - void - AskQuestionEvent(title, question, replyPrefix, which) - char *title; char *question; char *replyPrefix; char *which; - { - ProcRef pr = (which[0] == '1') ? first.pr : second.pr; - if (pr == NoProc) return; - AskQuestion(title, question, replyPrefix, pr); - } - - void - DisplayMove(moveNumber) - int moveNumber; - { - char message[MSG_SIZ]; - char res[MSG_SIZ]; - char cpThinkOutput[MSG_SIZ]; - - if (moveNumber == forwardMostMove - 1 || - gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - - strcpy(cpThinkOutput, thinkOutput); - if (strchr(cpThinkOutput, '\n')) - *strchr(cpThinkOutput, '\n') = NULLCHAR; - } else { - *cpThinkOutput = NULLCHAR; - } - - if (moveNumber == forwardMostMove - 1 && - gameInfo.resultDetails != NULL) { - if (gameInfo.resultDetails[0] == NULLCHAR) { - sprintf(res, " %s", PGNResult(gameInfo.result)); - } else { - sprintf(res, " {%s} %s", - gameInfo.resultDetails, PGNResult(gameInfo.result)); - } - } else { - res[0] = NULLCHAR; - } - - if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { - DisplayMessage(res, cpThinkOutput); - } else { - sprintf(message, "%d.%s%s%s", moveNumber / 2 + 1, - WhiteOnMove(moveNumber) ? " " : ".. ", - parseList[moveNumber], res); - DisplayMessage(message, cpThinkOutput); - } - } - - void - DisplayAnalysisText(text) - char *text; - { - char buf[MSG_SIZ]; - - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile - || appData.icsEngineAnalyze) { - sprintf(buf, "Analysis (%s)", first.tidy); - AnalysisPopUp(buf, text); - } - } - - static int - only_one_move(str) - char *str; - { - while (*str && isspace(*str)) ++str; - while (*str && !isspace(*str)) ++str; - if (!*str) return 1; - while (*str && isspace(*str)) ++str; - if (!*str) return 1; - return 0; - } - - void - DisplayAnalysis() - { - char buf[MSG_SIZ]; - double nps; - static char *xtra[] = { "", " (--)", " (++)" }; - int h, m, s, cs; - - if (programStats.time == 0) { - programStats.time = 1; - } - - if (programStats.got_only_move) { - strcpy(buf, programStats.movelist); - } else { - nps = (u64ToDouble(programStats.nodes) / - ((double)programStats.time /100.0)); - - cs = programStats.time % 100; - s = programStats.time / 100; - h = (s / (60*60)); - s = s - h*60*60; - m = (s/60); - s = s - m*60; - - if (programStats.moves_left > 0 && appData.periodicUpdates) { - if (programStats.move_name[0] != NULLCHAR) { - sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: "u64Display" NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, programStats.move_name, - ((float)programStats.score)/100.0, programStats.movelist, - only_one_move(programStats.movelist)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } else { - sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: "u64Display" NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, ((float)programStats.score)/100.0, - programStats.movelist, - only_one_move(programStats.movelist)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } else { - sprintf(buf, "depth=%d %+.2f %s%s\nNodes: "u64Display" NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - ((float)programStats.score)/100.0, - programStats.movelist, - only_one_move(programStats.movelist)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } - DisplayAnalysisText(buf); - } - - void - DisplayComment(moveNumber, text) - int moveNumber; - char *text; - { - char title[MSG_SIZ]; - - if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { - strcpy(title, "Comment"); - } else { - sprintf(title, "Comment on %d.%s%s", moveNumber / 2 + 1, - WhiteOnMove(moveNumber) ? " " : ".. ", - parseList[moveNumber]); - } - - CommentPopUp(title, text); - } - - /* This routine sends a ^C interrupt to gnuchess, to awaken it if it - * might be busy thinking or pondering. It can be omitted if your - * gnuchess is configured to stop thinking immediately on any user - * input. However, that gnuchess feature depends on the FIONREAD - * ioctl, which does not work properly on some flavors of Unix. - */ - void - Attention(cps) - ChessProgramState *cps; - { - #if ATTENTION - if (!cps->useSigint) return; - if (appData.noChessProgram || (cps->pr == NoProc)) return; - switch (gameMode) { - case MachinePlaysWhite: - case MachinePlaysBlack: - case TwoMachinesPlay: - case IcsPlayingWhite: - case IcsPlayingBlack: - case AnalyzeMode: - case AnalyzeFile: - /* Skip if we know it isn't thinking */ - if (!cps->maybeThinking) return; - if (appData.debugMode) - fprintf(debugFP, "Interrupting %s\n", cps->which); - InterruptChildProcess(cps->pr); - cps->maybeThinking = FALSE; - break; - default: - break; - } - #endif /*ATTENTION*/ - } - - int - CheckFlags() - { - if (whiteTimeRemaining <= 0) { - if (!whiteFlag) { - whiteFlag = TRUE; - if (appData.icsActive) { - if (appData.autoCallFlag && - gameMode == IcsPlayingBlack && !blackFlag) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } - } else { - if (blackFlag) { - DisplayTitle(_("Both flags fell")); - } else { - DisplayTitle(_("White's flag fell")); - if (appData.autoCallFlag) { - GameEnds(BlackWins, "Black wins on time", GE_XBOARD); - return TRUE; - } - } - } - } - } - if (blackTimeRemaining <= 0) { - if (!blackFlag) { - blackFlag = TRUE; - if (appData.icsActive) { - if (appData.autoCallFlag && - gameMode == IcsPlayingWhite && !whiteFlag) { - SendToICS(ics_prefix); - SendToICS("flag\n"); - } - } else { - if (whiteFlag) { - DisplayTitle(_("Both flags fell")); - } else { - DisplayTitle(_("Black's flag fell")); - if (appData.autoCallFlag) { - GameEnds(WhiteWins, "White wins on time", GE_XBOARD); - return TRUE; - } - } - } - } - } - return FALSE; - } - - void - CheckTimeControl() - { - if (!appData.clockMode || appData.icsActive || - gameMode == PlayFromGameFile || forwardMostMove == 0) return; - - if (timeIncrement >= 0) { - if (WhiteOnMove(forwardMostMove)) { - blackTimeRemaining += timeIncrement; - } else { - whiteTimeRemaining += timeIncrement; - } - } - /* - * add time to clocks when time control is achieved - */ - if (movesPerSession) { - switch ((forwardMostMove + 1) % (movesPerSession * 2)) { - case 0: - /* White made time control */ - whiteTimeRemaining += timeControl; - break; - case 1: - /* Black made time control */ - blackTimeRemaining += timeControl; - break; - default: - break; - } - } - } - - void - DisplayBothClocks() - { - int wom = gameMode == EditPosition ? - !blackPlaysFirst : WhiteOnMove(currentMove); - DisplayWhiteClock(whiteTimeRemaining, wom); - DisplayBlackClock(blackTimeRemaining, !wom); - } - - - /* Timekeeping seems to be a portability nightmare. I think everyone - has ftime(), but I'm really not sure, so I'm including some ifdefs - to use other calls if you don't. Clocks will be less accurate if - you have neither ftime nor gettimeofday. - */ - - /* Get the current time as a TimeMark */ - void - GetTimeMark(tm) - TimeMark *tm; - { - #if HAVE_GETTIMEOFDAY - - struct timeval timeVal; - struct timezone timeZone; - - gettimeofday(&timeVal, &timeZone); - tm->sec = (long) timeVal.tv_sec; - tm->ms = (int) (timeVal.tv_usec / 1000L); - - #else /*!HAVE_GETTIMEOFDAY*/ - #if HAVE_FTIME - - #include - struct timeb timeB; - - ftime(&timeB); - tm->sec = (long) timeB.time; - tm->ms = (int) timeB.millitm; - - #else /*!HAVE_FTIME && !HAVE_GETTIMEOFDAY*/ - tm->sec = (long) time(NULL); - tm->ms = 0; - #endif - #endif - } - - /* Return the difference in milliseconds between two - time marks. We assume the difference will fit in a long! - */ - long - SubtractTimeMarks(tm2, tm1) - TimeMark *tm2, *tm1; - { - return 1000L*(tm2->sec - tm1->sec) + - (long) (tm2->ms - tm1->ms); - } - - - /* - * Code to manage the game clocks. - * - * In tournament play, black starts the clock and then white makes a move. - * We give the human user a slight advantage if he is playing white---the - * clocks don't run until he makes his first move, so it takes zero time. - * Also, we don't account for network lag, so we could get out of sync - * with GNU Chess's clock -- but then, referees are always right. - */ - - static TimeMark tickStartTM; - static long intendedTickLength; - - long - NextTickLength(timeRemaining) - long timeRemaining; - { - long nominalTickLength, nextTickLength; - - if (timeRemaining > 0L && timeRemaining <= 10000L) - nominalTickLength = 100L; - else - nominalTickLength = 1000L; - nextTickLength = timeRemaining % nominalTickLength; - if (nextTickLength <= 0) nextTickLength += nominalTickLength; - - return nextTickLength; - } - - /* Stop clocks and reset to a fresh time control */ - void - ResetClocks() - { - (void) StopClockTimer(); - if (appData.icsActive) { - whiteTimeRemaining = blackTimeRemaining = 0; - } else { - whiteTimeRemaining = blackTimeRemaining = timeControl; - } - if (whiteFlag || blackFlag) { - DisplayTitle(""); - whiteFlag = blackFlag = FALSE; - } - DisplayBothClocks(); - } - - #define FUDGE 25 /* 25ms = 1/40 sec; should be plenty even for 50 Hz clocks */ - - /* Decrement running clock by amount of time that has passed */ - void - DecrementClocks() - { - long timeRemaining; - long lastTickLength, fudge; - TimeMark now; - - if (!appData.clockMode) return; - if (gameMode==AnalyzeMode || gameMode == AnalyzeFile) return; - - GetTimeMark(&now); - - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - - /* Fudge if we woke up a little too soon */ - fudge = intendedTickLength - lastTickLength; - if (fudge < 0 || fudge > FUDGE) fudge = 0; - - if (WhiteOnMove(forwardMostMove)) { - timeRemaining = whiteTimeRemaining -= lastTickLength; - DisplayWhiteClock(whiteTimeRemaining - fudge, - WhiteOnMove(currentMove)); - } else { - timeRemaining = blackTimeRemaining -= lastTickLength; - DisplayBlackClock(blackTimeRemaining - fudge, - !WhiteOnMove(currentMove)); - } - - if (CheckFlags()) return; - - tickStartTM = now; - intendedTickLength = NextTickLength(timeRemaining - fudge) + fudge; - StartClockTimer(intendedTickLength); - - /* if the time remaining has fallen below the alarm threshold, sound the - * alarm. if the alarm has sounded and (due to a takeback or time control - * with increment) the time remaining has increased to a level above the - * threshold, reset the alarm so it can sound again. - */ - - if (appData.icsActive && appData.icsAlarm) { - - /* make sure we are dealing with the user's clock */ - if (!( ((gameMode == IcsPlayingWhite) && WhiteOnMove(currentMove)) || - ((gameMode == IcsPlayingBlack) && !WhiteOnMove(currentMove)) - )) return; - - if (alarmSounded && (timeRemaining > appData.icsAlarmTime)) { - alarmSounded = FALSE; - } else if (!alarmSounded && (timeRemaining <= appData.icsAlarmTime)) { - PlayAlarmSound(); - alarmSounded = TRUE; - } - } - } - - - /* A player has just moved, so stop the previously running - clock and (if in clock mode) start the other one. - We redisplay both clocks in case we're in ICS mode, because - ICS gives us an update to both clocks after every move. - Note that this routine is called *after* forwardMostMove - is updated, so the last fractional tick must be subtracted - from the color that is *not* on move now. - */ - void - SwitchClocks() - { - long lastTickLength; - TimeMark now; - int flagged = FALSE; - - GetTimeMark(&now); - - if (StopClockTimer() && appData.clockMode) { - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - if (WhiteOnMove(forwardMostMove)) { - blackTimeRemaining -= lastTickLength; - } else { - whiteTimeRemaining -= lastTickLength; - } - flagged = CheckFlags(); - } - CheckTimeControl(); - - if (flagged || !appData.clockMode) return; - - switch (gameMode) { - case MachinePlaysBlack: - case MachinePlaysWhite: - case BeginningOfGame: - if (pausing) return; - break; - - case EditGame: - case PlayFromGameFile: - case IcsExamining: - return; - - default: - break; - } - - tickStartTM = now; - intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? - whiteTimeRemaining : blackTimeRemaining); - StartClockTimer(intendedTickLength); - } - - - /* Stop both clocks */ - void - StopClocks() - { - long lastTickLength; - TimeMark now; - - if (!StopClockTimer()) return; - if (!appData.clockMode) return; - - GetTimeMark(&now); - - lastTickLength = SubtractTimeMarks(&now, &tickStartTM); - if (WhiteOnMove(forwardMostMove)) { - whiteTimeRemaining -= lastTickLength; - DisplayWhiteClock(whiteTimeRemaining, WhiteOnMove(currentMove)); - } else { - blackTimeRemaining -= lastTickLength; - DisplayBlackClock(blackTimeRemaining, !WhiteOnMove(currentMove)); - } - CheckFlags(); - } - - /* Start clock of player on move. Time may have been reset, so - if clock is already running, stop and restart it. */ - void - StartClocks() - { - (void) StopClockTimer(); /* in case it was running already */ - DisplayBothClocks(); - if (CheckFlags()) return; - - if (!appData.clockMode) return; - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) return; - - GetTimeMark(&tickStartTM); - intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? - whiteTimeRemaining : blackTimeRemaining); - StartClockTimer(intendedTickLength); - } - - char * - TimeString(ms) - long ms; - { - long second, minute, hour, day; - char *sign = ""; - static char buf[32]; - - if (ms > 0 && ms <= 9900) { - /* convert milliseconds to tenths, rounding up */ - double tenths = floor( ((double)(ms + 99L)) / 100.00 ); - - sprintf(buf, " %03.1f ", tenths/10.0); - return buf; - } - - /* convert milliseconds to seconds, rounding up */ - /* use floating point to avoid strangeness of integer division - with negative dividends on many machines */ - second = (long) floor(((double) (ms + 999L)) / 1000.0); - - if (second < 0) { - sign = "-"; - second = -second; - } - - day = second / (60 * 60 * 24); - second = second % (60 * 60 * 24); - hour = second / (60 * 60); - second = second % (60 * 60); - minute = second / 60; - second = second % 60; - - if (day > 0) - sprintf(buf, " %s%ld:%02ld:%02ld:%02ld ", - sign, day, hour, minute, second); - else if (hour > 0) - sprintf(buf, " %s%ld:%02ld:%02ld ", sign, hour, minute, second); - else - sprintf(buf, " %s%2ld:%02ld ", sign, minute, second); - - return buf; - } - - - /* - * This is necessary because some C libraries aren't ANSI C compliant yet. - */ - char * - StrStr(string, match) - char *string, *match; - { - int i, length; - - length = strlen(match); - - for (i = strlen(string) - length; i >= 0; i--, string++) - if (!strncmp(match, string, length)) - return string; - - return NULL; - } - - char * - StrCaseStr(string, match) - char *string, *match; - { - int i, j, length; - - length = strlen(match); - - for (i = strlen(string) - length; i >= 0; i--, string++) { - for (j = 0; j < length; j++) { - if (ToLower(match[j]) != ToLower(string[j])) - break; - } - if (j == length) return string; - } - - return NULL; - } - - #ifndef _amigados - int - StrCaseCmp(s1, s2) - char *s1, *s2; - { - char c1, c2; - - for (;;) { - c1 = ToLower(*s1++); - c2 = ToLower(*s2++); - if (c1 > c2) return 1; - if (c1 < c2) return -1; - if (c1 == NULLCHAR) return 0; - } - } - - - int - ToLower(c) - int c; - { - return isupper(c) ? tolower(c) : c; - } - - - int - ToUpper(c) - int c; - { - return islower(c) ? toupper(c) : c; - } - #endif /* !_amigados */ - - char * - StrSave(s) - char *s; - { - char *ret; - - if ((ret = (char *) malloc(strlen(s) + 1))) { - strcpy(ret, s); - } - return ret; - } - - char * - StrSavePtr(s, savePtr) - char *s, **savePtr; - { - if (*savePtr) { - free(*savePtr); - } - if ((*savePtr = (char *) malloc(strlen(s) + 1))) { - strcpy(*savePtr, s); - } - return(*savePtr); - } - - char * - PGNDate() - { - time_t clock; - struct tm *tm; - char buf[MSG_SIZ]; - - clock = time((time_t *)NULL); - tm = localtime(&clock); - sprintf(buf, "%04d.%02d.%02d", - tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); - return StrSave(buf); - } - - - char * - PositionToFEN(move) - int move; - { - int i, j, fromX, fromY, toX, toY; - int whiteToPlay; - char buf[128]; - char *p, *q; - int emptycount; - - whiteToPlay = (gameMode == EditPosition) ? - !blackPlaysFirst : (move % 2 == 0); - p = buf; - - /* Piece placement data */ - for (i = BOARD_SIZE - 1; i >= 0; i--) { - emptycount = 0; - for (j = 0; j < BOARD_SIZE; j++) { - if (boards[move][i][j] == EmptySquare) { - emptycount++; - } else { - if (emptycount > 0) { - *p++ = '0' + emptycount; - emptycount = 0; - } - *p++ = PieceToChar(boards[move][i][j]); - } - } - if (emptycount > 0) { - *p++ = '0' + emptycount; - emptycount = 0; - } - *p++ = '/'; - } - *(p - 1) = ' '; - - /* Active color */ - *p++ = whiteToPlay ? 'w' : 'b'; - *p++ = ' '; - - /* !!We don't keep track of castling availability, so fake it */ - q = p; - if (boards[move][0][4] == WhiteKing) { - if (boards[move][0][7] == WhiteRook) *p++ = 'K'; - if (boards[move][0][0] == WhiteRook) *p++ = 'Q'; - } - if (boards[move][7][4] == BlackKing) { - if (boards[move][7][7] == BlackRook) *p++ = 'k'; - if (boards[move][7][0] == BlackRook) *p++ = 'q'; - } - if (q == p) *p++ = '-'; - *p++ = ' '; - - /* En passant target square */ - if (move > backwardMostMove) { - fromX = moveList[move - 1][0] - 'a'; - fromY = moveList[move - 1][1] - '1'; - toX = moveList[move - 1][2] - 'a'; - toY = moveList[move - 1][3] - '1'; - if (fromY == (whiteToPlay ? 6 : 1) && - toY == (whiteToPlay ? 4 : 3) && - boards[move][toY][toX] == (whiteToPlay ? BlackPawn : WhitePawn) && - fromX == toX) { - /* 2-square pawn move just happened */ - *p++ = toX + 'a'; - *p++ = whiteToPlay ? '6' : '3'; - } else { - *p++ = '-'; - } - } else { - *p++ = '-'; - } - - /* !!We don't keep track of halfmove clock for 50-move rule */ - strcpy(p, " 0 "); - p += 3; - - /* Fullmove number */ - sprintf(p, "%d", (move / 2) + 1); - - return StrSave(buf); - } - - Boolean - ParseFEN(board, blackPlaysFirst, fen) - Board board; - int *blackPlaysFirst; - char *fen; - { - int i, j; - char *p; - int emptycount; - - p = fen; - - /* Piece placement data */ - for (i = BOARD_SIZE - 1; i >= 0; i--) { - j = 0; - for (;;) { - if (*p == '/' || *p == ' ') { - if (*p == '/') p++; - emptycount = BOARD_SIZE - j; - while (emptycount--) board[i][j++] = EmptySquare; - break; - } else if (isdigit(*p)) { - emptycount = *p++ - '0'; - if (j + emptycount > BOARD_SIZE) return FALSE; - while (emptycount--) board[i][j++] = EmptySquare; - } else if (isalpha(*p)) { - if (j >= BOARD_SIZE) return FALSE; - board[i][j++] = CharToPiece(*p++); - } else { - return FALSE; - } - } - } - while (*p == '/' || *p == ' ') p++; - - /* Active color */ - switch (*p) { - case 'w': - *blackPlaysFirst = FALSE; - break; - case 'b': - *blackPlaysFirst = TRUE; - break; - default: - return FALSE; - } - /* !!We ignore the rest of the FEN notation */ - return TRUE; - } - - void - EditPositionPasteFEN(char *fen) - { - if (fen != NULL) { - Board initial_position; - - if (!ParseFEN(initial_position, &blackPlaysFirst, fen)) { - DisplayError(_("Bad FEN position in clipboard"), 0); - return ; - } else { - int savedBlackPlaysFirst = blackPlaysFirst; - EditPositionEvent(); - blackPlaysFirst = savedBlackPlaysFirst; - CopyBoard(boards[0], initial_position); - EditPositionDone(); - DisplayBothClocks(); - DrawPosition(FALSE, boards[currentMove]); - } - } - } + /* + * backend.c -- Common back end for X and Windows NT versions of + * XBoard $Id: backend.c,v 2.6 2003/11/28 09:37:36 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + * + * See the file ChangeLog for a revision history. */ + + /* [AS] Also useful here for debugging */ + #ifdef WIN32 + #include + + #define DoSleep( n ) if( (n) != 0 ) Sleep( (n) ); + + #else + + #define DoSleep( n ) if( (n) >= 0) sleep(n) + + #endif + + #include "config.h" + + #include + #include + #include + #include + #include + #include + #include + + #if STDC_HEADERS + # include + # include + #else /* not STDC_HEADERS */ + # if HAVE_STRING_H + # include + # else /* not HAVE_STRING_H */ + # include + # endif /* not HAVE_STRING_H */ + #endif /* not STDC_HEADERS */ + + #if HAVE_SYS_FCNTL_H + # include + #else /* not HAVE_SYS_FCNTL_H */ + # if HAVE_FCNTL_H + # include + # endif /* HAVE_FCNTL_H */ + #endif /* not HAVE_SYS_FCNTL_H */ + + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + #if defined(_amigados) && !defined(__GNUC__) + struct timezone { + int tz_minuteswest; + int tz_dsttime; + }; + extern int gettimeofday(struct timeval *, struct timezone *); + #endif + + #if HAVE_UNISTD_H + # include + #endif + + #include "common.h" + #include "frontend.h" + #include "backend.h" + #include "parser.h" + #include "moves.h" + #if ZIPPY + # include "zippy.h" + #endif + #include "backendz.h" ++#include "gettext.h" ++ ++#ifdef ENABLE_NLS ++# define _(s) gettext (s) ++# define N_(s) gettext_noop (s) ++#else ++# define _(s) (s) ++# define N_(s) s ++#endif ++ + + /* A point in time */ + typedef struct { + long sec; /* Assuming this is >= 32 bits */ + int ms; /* Assuming this is >= 16 bits */ + } TimeMark; + + int establish P((void)); + void read_from_player P((InputSourceRef isr, VOIDSTAR closure, + char *buf, int count, int error)); + void read_from_ics P((InputSourceRef isr, VOIDSTAR closure, + char *buf, int count, int error)); + void SendToICS P((char *s)); + void SendToICSDelayed P((char *s, long msdelay)); + void SendMoveToICS P((ChessMove moveType, int fromX, int fromY, + int toX, int toY)); + void InitPosition P((int redraw)); + void HandleMachineMove P((char *message, ChessProgramState *cps)); + int AutoPlayOneMove P((void)); + int LoadGameOneMove P((ChessMove readAhead)); + int LoadGameFromFile P((char *filename, int n, char *title, int useList)); + int LoadPositionFromFile P((char *filename, int n, char *title)); + int SavePositionToFile P((char *filename)); + void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, + Board board)); + void MakeMove P((int fromX, int fromY, int toX, int toY, int promoChar)); + void ShowMove P((int fromX, int fromY, int toX, int toY)); + int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY, + /*char*/int promoChar)); + void BackwardInner P((int target)); + void ForwardInner P((int target)); + void GameEnds P((ChessMove result, char *resultDetails, int whosays)); + void EditPositionDone P((void)); + void PrintOpponents P((FILE *fp)); + void PrintPosition P((FILE *fp, int move)); + void StartChessProgram P((ChessProgramState *cps)); + void SendToProgram P((char *message, ChessProgramState *cps)); + void SendMoveToProgram P((int moveNum, ChessProgramState *cps)); + void ReceiveFromProgram P((InputSourceRef isr, VOIDSTAR closure, + char *buf, int count, int error)); + void SendTimeControl P((ChessProgramState *cps, + int mps, long tc, int inc, int sd, int st)); + char *TimeControlTagValue P((void)); + void Attention P((ChessProgramState *cps)); + void FeedMovesToProgram P((ChessProgramState *cps, int upto)); + void ResurrectChessProgram P((void)); + void DisplayComment P((int moveNumber, char *text)); + void DisplayMove P((int moveNumber)); + void DisplayAnalysis P((void)); + + void ParseGameHistory P((char *game)); + void ParseBoard12 P((char *string)); + void StartClocks P((void)); + void SwitchClocks P((void)); + void StopClocks P((void)); + void ResetClocks P((void)); + char *PGNDate P((void)); + void SetGameInfo P((void)); + Boolean ParseFEN P((Board board, int *blackPlaysFirst, char *fen)); + int RegisterMove P((void)); + void MakeRegisteredMove P((void)); + void TruncateGame P((void)); + int looking_at P((char *, int *, char *)); + void CopyPlayerNameIntoFileName P((char **, char *)); + char *SavePart P((char *)); + int SaveGameOldStyle P((FILE *)); + int SaveGamePGN P((FILE *)); + void GetTimeMark P((TimeMark *)); + long SubtractTimeMarks P((TimeMark *, TimeMark *)); + int CheckFlags P((void)); + long NextTickLength P((long)); + void CheckTimeControl P((void)); + void show_bytes P((FILE *, char *, int)); + int string_to_rating P((char *str)); + void ParseFeatures P((char* args, ChessProgramState *cps)); + void InitBackEnd3 P((void)); + void FeatureDone P((ChessProgramState* cps, int val)); + void InitChessProgram P((ChessProgramState *cps, int setup)); ++ ++#ifdef WIN32 ++ extern void ConsoleCreate(); ++#endif ++ + ChessProgramState *WhitePlayer(); + void InsertIntoMemo P((int which, char *text)); // [HGM] kibitz: in engineo.c + int VerifyDisplayMode P(()); + + char *GetInfoFromComment( int, char * ); // [HGM] PV time: returns stripped comment + void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); // [HGM] moved here from winboard.c + char *ProbeBook P((int moveNr, char *book)); // [HGM] book: returns a book move + char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book + extern char installDir[MSG_SIZ]; + + extern int tinyLayout, smallLayout; + ChessProgramStats programStats; + static int exiting = 0; /* [HGM] moved to top */ + static int setboardSpoiledMachineBlack = 0, errorExitFlag = 0; + extern int startedFromPositionFile; + int startedFromPositionFile = FALSE; Board filePosition; /* [HGM] loadPos */ + char endingGame = 0; /* [HGM] crash: flag to prevent recursion of GameEnds() */ + int whiteNPS, blackNPS; /* [HGM] nps: for easily making clocks aware of NPS */ + VariantClass currentlyInitializedVariant; /* [HGM] variantswitch */ + int lastIndex = 0; /* [HGM] autoinc: last game/position used in match mode */ + int opponentKibitzes; + + /* States for ics_getting_history */ + #define H_FALSE 0 + #define H_REQUESTED 1 + #define H_GOT_REQ_HEADER 2 + #define H_GOT_UNREQ_HEADER 3 + #define H_GETTING_MOVES 4 + #define H_GOT_UNWANTED_HEADER 5 + + /* whosays values for GameEnds */ + #define GE_ICS 0 + #define GE_ENGINE 1 + #define GE_PLAYER 2 + #define GE_FILE 3 + #define GE_XBOARD 4 + #define GE_ENGINE1 5 + #define GE_ENGINE2 6 + + /* Maximum number of games in a cmail message */ + #define CMAIL_MAX_GAMES 20 + + /* Different types of move when calling RegisterMove */ + #define CMAIL_MOVE 0 + #define CMAIL_RESIGN 1 + #define CMAIL_DRAW 2 + #define CMAIL_ACCEPT 3 + + /* Different types of result to remember for each game */ + #define CMAIL_NOT_RESULT 0 + #define CMAIL_OLD_RESULT 1 + #define CMAIL_NEW_RESULT 2 + + /* Telnet protocol constants */ + #define TN_WILL 0373 + #define TN_WONT 0374 + #define TN_DO 0375 + #define TN_DONT 0376 + #define TN_IAC 0377 + #define TN_ECHO 0001 + #define TN_SGA 0003 + #define TN_PORT 23 + + /* [AS] */ + static char * safeStrCpy( char * dst, const char * src, size_t count ) + { + assert( dst != NULL ); + assert( src != NULL ); + assert( count > 0 ); + + strncpy( dst, src, count ); + dst[ count-1 ] = '\0'; + return dst; + } + + static char * safeStrCat( char * dst, const char * src, size_t count ) + { + size_t dst_len; + + assert( dst != NULL ); + assert( src != NULL ); + assert( count > 0 ); + + dst_len = strlen(dst); + + assert( count > dst_len ); /* Buffer size must be greater than current length */ + + safeStrCpy( dst + dst_len, src, count - dst_len ); + + return dst; + } + ++/* Some compiler can't cast u64 to double ++ * This function do the job for us: ++ ++ * We use the highest bit for cast, this only ++ * works if the highest bit is not ++ * in use (This should not happen) ++ * ++ * We used this for all compiler ++ */ ++double ++u64ToDouble(u64 value) ++{ ++ double r; ++ u64 tmp = value & u64Const(0x7fffffffffffffff); ++ r = (double)(s64)tmp; ++ if (value & u64Const(0x8000000000000000)) ++ r += 9.2233720368547758080e18; /* 2^63 */ ++ return r; ++} ++ + /* Fake up flags for now, as we aren't keeping track of castling + availability yet. [HGM] Change of logic: the flag now only + indicates the type of castlings allowed by the rule of the game. + The actual rights themselves are maintained in the array + castlingRights, as part of the game history, and are not probed + by this function. + */ + int + PosFlags(index) + { + int flags = F_ALL_CASTLE_OK; + if ((index % 2) == 0) flags |= F_WHITE_ON_MOVE; + switch (gameInfo.variant) { + case VariantSuicide: + flags &= ~F_ALL_CASTLE_OK; + case VariantGiveaway: // [HGM] moved this case label one down: seems Giveaway does have castling on ICC! + flags |= F_IGNORE_CHECK; + break; + case VariantAtomic: + flags |= F_IGNORE_CHECK | F_ATOMIC_CAPTURE; + break; + case VariantKriegspiel: + flags |= F_KRIEGSPIEL_CAPTURE; + break; + case VariantCapaRandom: + case VariantFischeRandom: + flags |= F_FRC_TYPE_CASTLING; /* [HGM] enable this through flag */ + case VariantNoCastle: + case VariantShatranj: + case VariantCourier: + flags &= ~F_ALL_CASTLE_OK; + break; + default: + break; + } + return flags; + } + + FILE *gameFileFP, *debugFP; + + /* + [AS] Note: sometimes, the sscanf() function is used to parse the input + into a fixed-size buffer. Because of this, we must be prepared to + receive strings as long as the size of the input buffer, which is currently + set to 4K for Windows and 8K for the rest. + So, we must either allocate sufficiently large buffers here, or + reduce the size of the input buffer in the input reading part. + */ + + char cmailMove[CMAIL_MAX_GAMES][MOVE_LEN], cmailMsg[MSG_SIZ]; + char bookOutput[MSG_SIZ*10], thinkOutput[MSG_SIZ*10], lastHint[MSG_SIZ]; + char thinkOutput1[MSG_SIZ*10]; + + ChessProgramState first, second; + + /* premove variables */ + int premoveToX = 0; + int premoveToY = 0; + int premoveFromX = 0; + int premoveFromY = 0; + int premovePromoChar = 0; + int gotPremove = 0; + Boolean alarmSounded; + /* end premove variables */ + -#define ICS_GENERIC 0 -#define ICS_ICC 1 -#define ICS_FICS 2 -#define ICS_CHESSNET 3 /* not really supported */ -int ics_type = ICS_GENERIC; + char *ics_prefix = "$"; ++int ics_type = ICS_GENERIC; + + int currentMove = 0, forwardMostMove = 0, backwardMostMove = 0; + int pauseExamForwardMostMove = 0; + int nCmailGames = 0, nCmailResults = 0, nCmailMovesRegistered = 0; + int cmailMoveRegistered[CMAIL_MAX_GAMES], cmailResult[CMAIL_MAX_GAMES]; + int cmailMsgLoaded = FALSE, cmailMailedMove = FALSE; + int cmailOldMove = -1, firstMove = TRUE, flipView = FALSE; + int blackPlaysFirst = FALSE, startedFromSetupPosition = FALSE; + int searchTime = 0, pausing = FALSE, pauseExamInvalid = FALSE; + int whiteFlag = FALSE, blackFlag = FALSE; + int userOfferedDraw = FALSE; + int ics_user_moved = 0, ics_gamenum = -1, ics_getting_history = H_FALSE; + int matchMode = FALSE, hintRequested = FALSE, bookRequested = FALSE; + int cmailMoveType[CMAIL_MAX_GAMES]; + long ics_clock_paused = 0; + ProcRef icsPR = NoProc, cmailPR = NoProc; + InputSourceRef telnetISR = NULL, fromUserISR = NULL, cmailISR = NULL; + GameMode gameMode = BeginningOfGame; + char moveList[MAX_MOVES][MOVE_LEN], parseList[MAX_MOVES][MOVE_LEN * 2]; + char *commentList[MAX_MOVES], *cmailCommentList[CMAIL_MAX_GAMES]; + ChessProgramStats_Move pvInfoList[MAX_MOVES]; /* [AS] Info about engine thinking */ + int hiddenThinkOutputState = 0; /* [AS] */ + int adjudicateLossThreshold = 0; /* [AS] Automatic adjudication */ + int adjudicateLossPlies = 6; + char white_holding[64], black_holding[64]; + TimeMark lastNodeCountTime; + long lastNodeCount=0; + int have_sent_ICS_logon = 0; + int movesPerSession; + long whiteTimeRemaining, blackTimeRemaining, timeControl, timeIncrement; + long timeControl_2; /* [AS] Allow separate time controls */ + char *fullTimeControlString = NULL; /* [HGM] secondary TC: merge of MPS, TC and inc */ + long timeRemaining[2][MAX_MOVES]; + int matchGame = 0; + TimeMark programStartTime; + char ics_handle[MSG_SIZ]; + int have_set_title = 0; + + /* animateTraining preserves the state of appData.animate + * when Training mode is activated. This allows the + * response to be animated when appData.animate == TRUE and + * appData.animateDragging == TRUE. + */ + Boolean animateTraining; + + GameInfo gameInfo; + + AppData appData; + + Board boards[MAX_MOVES]; + /* [HGM] Following 7 needed for accurate legality tests: */ + char epStatus[MAX_MOVES]; + char castlingRights[MAX_MOVES][BOARD_SIZE]; // stores files for pieces with castling rights or -1 + char castlingRank[BOARD_SIZE]; // and corresponding ranks + char initialRights[BOARD_SIZE], FENcastlingRights[BOARD_SIZE], fileRights[BOARD_SIZE]; + int nrCastlingRights; // For TwoKings, or to implement castling-unknown status + int initialRulePlies, FENrulePlies; + char FENepStatus; + FILE *serverMoves = NULL; // next two for broadcasting (/serverMoves option) + int loadFlag = 0; + int shuffleOpenings; + + ChessSquare FIDEArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, + WhiteKing, WhiteBishop, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackBishop, BlackQueen, + BlackKing, BlackBishop, BlackKnight, BlackRook } + }; + + ChessSquare twoKingsArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, + WhiteKing, WhiteKing, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackBishop, BlackQueen, + BlackKing, BlackKing, BlackKnight, BlackRook } + }; + + ChessSquare KnightmateArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteMan, WhiteBishop, WhiteQueen, + WhiteUnicorn, WhiteBishop, WhiteMan, WhiteRook }, + { BlackRook, BlackMan, BlackBishop, BlackQueen, + BlackUnicorn, BlackBishop, BlackMan, BlackRook } + }; + + ChessSquare fairyArray[2][BOARD_SIZE] = { /* [HGM] Queen side differs from King side */ + { WhiteCannon, WhiteNightrider, WhiteAlfil, WhiteQueen, + WhiteKing, WhiteBishop, WhiteKnight, WhiteRook }, + { BlackCannon, BlackNightrider, BlackAlfil, BlackQueen, + BlackKing, BlackBishop, BlackKnight, BlackRook } + }; + + ChessSquare ShatranjArray[2][BOARD_SIZE] = { /* [HGM] (movGen knows about Shatranj Q and P) */ + { WhiteRook, WhiteKnight, WhiteAlfil, WhiteKing, + WhiteFerz, WhiteAlfil, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackAlfil, BlackKing, + BlackFerz, BlackAlfil, BlackKnight, BlackRook } + }; + + + #if (BOARD_SIZE>=10) + ChessSquare ShogiArray[2][BOARD_SIZE] = { + { WhiteQueen, WhiteKnight, WhiteFerz, WhiteWazir, + WhiteKing, WhiteWazir, WhiteFerz, WhiteKnight, WhiteQueen }, + { BlackQueen, BlackKnight, BlackFerz, BlackWazir, + BlackKing, BlackWazir, BlackFerz, BlackKnight, BlackQueen } + }; + + ChessSquare XiangqiArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteAlfil, WhiteFerz, + WhiteWazir, WhiteFerz, WhiteAlfil, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackAlfil, BlackFerz, + BlackWazir, BlackFerz, BlackAlfil, BlackKnight, BlackRook } + }; + + ChessSquare CapablancaArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteAngel, WhiteBishop, WhiteQueen, + WhiteKing, WhiteBishop, WhiteMarshall, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackAngel, BlackBishop, BlackQueen, + BlackKing, BlackBishop, BlackMarshall, BlackKnight, BlackRook } + }; + + ChessSquare GreatArray[2][BOARD_SIZE] = { + { WhiteDragon, WhiteKnight, WhiteAlfil, WhiteGrasshopper, WhiteKing, + WhiteSilver, WhiteCardinal, WhiteAlfil, WhiteKnight, WhiteDragon }, + { BlackDragon, BlackKnight, BlackAlfil, BlackGrasshopper, BlackKing, + BlackSilver, BlackCardinal, BlackAlfil, BlackKnight, BlackDragon }, + }; + + ChessSquare JanusArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteAngel, WhiteKnight, WhiteBishop, WhiteKing, + WhiteQueen, WhiteBishop, WhiteKnight, WhiteAngel, WhiteRook }, + { BlackRook, BlackAngel, BlackKnight, BlackBishop, BlackKing, + BlackQueen, BlackBishop, BlackKnight, BlackAngel, BlackRook } + }; + + #ifdef GOTHIC + ChessSquare GothicArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, WhiteMarshall, + WhiteKing, WhiteAngel, WhiteBishop, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackBishop, BlackQueen, BlackMarshall, + BlackKing, BlackAngel, BlackBishop, BlackKnight, BlackRook } + }; + #else // !GOTHIC + #define GothicArray CapablancaArray + #endif // !GOTHIC + + #ifdef FALCON + ChessSquare FalconArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteBishop, WhiteLance, WhiteQueen, + WhiteKing, WhiteLance, WhiteBishop, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackBishop, BlackLance, BlackQueen, + BlackKing, BlackLance, BlackBishop, BlackKnight, BlackRook } + }; + #else // !FALCON + #define FalconArray CapablancaArray + #endif // !FALCON + + #else // !(BOARD_SIZE>=10) + #define XiangqiPosition FIDEArray + #define CapablancaArray FIDEArray + #define GothicArray FIDEArray + #define GreatArray FIDEArray + #endif // !(BOARD_SIZE>=10) + + #if (BOARD_SIZE>=12) + ChessSquare CourierArray[2][BOARD_SIZE] = { + { WhiteRook, WhiteKnight, WhiteAlfil, WhiteBishop, WhiteMan, WhiteKing, + WhiteFerz, WhiteWazir, WhiteBishop, WhiteAlfil, WhiteKnight, WhiteRook }, + { BlackRook, BlackKnight, BlackAlfil, BlackBishop, BlackMan, BlackKing, + BlackFerz, BlackWazir, BlackBishop, BlackAlfil, BlackKnight, BlackRook } + }; + #else // !(BOARD_SIZE>=12) + #define CourierArray CapablancaArray + #endif // !(BOARD_SIZE>=12) + + + Board initialPosition; + + + /* Convert str to a rating. Checks for special cases of "----", + + "++++", etc. Also strips ()'s */ + int + string_to_rating(str) + char *str; + { + while(*str && !isdigit(*str)) ++str; + if (!*str) + return 0; /* One of the special "no rating" cases */ + else + return atoi(str); + } + + void + ClearProgramStats() + { + /* Init programStats */ + programStats.movelist[0] = 0; + programStats.depth = 0; + programStats.nr_moves = 0; + programStats.moves_left = 0; + programStats.nodes = 0; + programStats.time = -1; // [HGM] PGNtime: make invalid to recognize engine output + programStats.score = 0; + programStats.got_only_move = 0; + programStats.got_fail = 0; + programStats.line_is_book = 0; + } + + void + InitBackEnd1() + { + int matched, min, sec; + + ShowThinkingEvent(); // [HGM] thinking: make sure post/nopost state is set according to options + + GetTimeMark(&programStartTime); + + ClearProgramStats(); + programStats.ok_to_send = 1; + programStats.seen_stat = 0; + + /* + * Initialize game list + */ + ListNew(&gameList); + + + /* + * Internet chess server status + */ + if (appData.icsActive) { + appData.matchMode = FALSE; + appData.matchGames = 0; + #if ZIPPY + appData.noChessProgram = !appData.zippyPlay; + #else + appData.zippyPlay = FALSE; + appData.zippyTalk = FALSE; + appData.noChessProgram = TRUE; + #endif + if (*appData.icsHelper != NULLCHAR) { + appData.useTelnet = TRUE; + appData.telnetProgram = appData.icsHelper; + } + } else { + appData.zippyTalk = appData.zippyPlay = FALSE; + } + + /* [AS] Initialize pv info list [HGM] and game state */ + { + int i, j; + + for( i=0; i second.timeOdds) norm = second.timeOdds; + } + first.timeOdds /= norm; + second.timeOdds /= norm; + } + + /* [HGM] secondary TC: how to handle sessions that do not fit in 'level'*/ + first.accumulateTC = appData.firstAccumulateTC; + second.accumulateTC = appData.secondAccumulateTC; + first.maxNrOfSessions = second.maxNrOfSessions = 1; + + /* [HGM] debug */ + first.debug = second.debug = FALSE; + first.supportsNPS = second.supportsNPS = UNKNOWN; + + first.scoreIsAbsolute = appData.firstScoreIsAbsolute; /* [AS] */ + second.scoreIsAbsolute = appData.secondScoreIsAbsolute; /* [AS] */ + first.isUCI = appData.firstIsUCI; /* [AS] */ + second.isUCI = appData.secondIsUCI; /* [AS] */ + first.hasOwnBookUCI = appData.firstHasOwnBookUCI; /* [AS] */ + second.hasOwnBookUCI = appData.secondHasOwnBookUCI; /* [AS] */ + + if (appData.firstProtocolVersion > PROTOVER || + appData.firstProtocolVersion < 1) { + char buf[MSG_SIZ]; - sprintf(buf, "protocol version %d not supported", ++ sprintf(buf, _("protocol version %d not supported"), + appData.firstProtocolVersion); + DisplayFatalError(buf, 0, 2); + } else { + first.protocolVersion = appData.firstProtocolVersion; + } + + if (appData.secondProtocolVersion > PROTOVER || + appData.secondProtocolVersion < 1) { + char buf[MSG_SIZ]; - sprintf(buf, "protocol version %d not supported", ++ sprintf(buf, _("protocol version %d not supported"), + appData.secondProtocolVersion); + DisplayFatalError(buf, 0, 2); + } else { + second.protocolVersion = appData.secondProtocolVersion; + } + + if (appData.icsActive) { + appData.clockMode = TRUE; /* changes dynamically in ICS mode */ + } else if (*appData.searchTime != NULLCHAR || appData.noChessProgram) { + appData.clockMode = FALSE; + first.sendTime = second.sendTime = 0; + } + + #if ZIPPY + /* Override some settings from environment variables, for backward + compatibility. Unfortunately it's not feasible to have the env + vars just set defaults, at least in xboard. Ugh. + */ + if (appData.icsActive && (appData.zippyPlay || appData.zippyTalk)) { + ZippyInit(); + } + #endif + + if (appData.noChessProgram) { + programVersion = (char*) malloc(5 + strlen(PRODUCT) + strlen(VERSION) + + strlen(PATCHLEVEL)); + sprintf(programVersion, "%s %s.%s", PRODUCT, VERSION, PATCHLEVEL); + } else { + #if 0 + char *p, *q; + q = first.program; + while (*q != ' ' && *q != NULLCHAR) q++; + p = q; + while (p > first.program && *(p-1) != '/' && *(p-1) != '\\') p--; /* [HGM] bckslash added */ + programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) + + strlen(PATCHLEVEL) + (q - p)); + sprintf(programVersion, "%s %s.%s + ", PRODUCT, VERSION, PATCHLEVEL); + strncat(programVersion, p, q - p); + #else + /* [HGM] tidy: use tidy name, in stead of full pathname (which was probably a bug due to / vs \ ) */ + programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) + + strlen(PATCHLEVEL) + strlen(first.tidy)); + sprintf(programVersion, "%s %s.%s + %s", PRODUCT, VERSION, PATCHLEVEL, first.tidy); + #endif + } + + if (!appData.icsActive) { + char buf[MSG_SIZ]; + /* Check for variants that are supported only in ICS mode, + or not at all. Some that are accepted here nevertheless + have bugs; see comments below. + */ + VariantClass variant = StringToVariant(appData.variant); + switch (variant) { + case VariantBughouse: /* need four players and two boards */ + case VariantKriegspiel: /* need to hide pieces and move details */ + /* case VariantFischeRandom: (Fabien: moved below) */ - sprintf(buf, "Variant %s supported only in ICS mode", appData.variant); ++ sprintf(buf, _("Variant %s supported only in ICS mode"), appData.variant); + DisplayFatalError(buf, 0, 2); + return; + + case VariantUnknown: + case VariantLoadable: + case Variant29: + case Variant30: + case Variant31: + case Variant32: + case Variant33: + case Variant34: + case Variant35: + case Variant36: + default: - sprintf(buf, "Unknown variant name %s", appData.variant); ++ sprintf(buf, _("Unknown variant name %s"), appData.variant); + DisplayFatalError(buf, 0, 2); + return; + + case VariantXiangqi: /* [HGM] repetition rules not implemented */ + case VariantFairy: /* [HGM] TestLegality definitely off! */ + case VariantGothic: /* [HGM] should work */ + case VariantCapablanca: /* [HGM] should work */ + case VariantCourier: /* [HGM] initial forced moves not implemented */ + case VariantShogi: /* [HGM] drops not tested for legality */ + case VariantKnightmate: /* [HGM] should work */ + case VariantCylinder: /* [HGM] untested */ + case VariantFalcon: /* [HGM] untested */ + case VariantCrazyhouse: /* holdings not shown, ([HGM] fixed that!) + offboard interposition not understood */ + case VariantNormal: /* definitely works! */ + case VariantWildCastle: /* pieces not automatically shuffled */ + case VariantNoCastle: /* pieces not automatically shuffled */ + case VariantFischeRandom: /* [HGM] works and shuffles pieces */ + case VariantLosers: /* should work except for win condition, + and doesn't know captures are mandatory */ + case VariantSuicide: /* should work except for win condition, + and doesn't know captures are mandatory */ + case VariantGiveaway: /* should work except for win condition, + and doesn't know captures are mandatory */ + case VariantTwoKings: /* should work */ + case VariantAtomic: /* should work except for win condition */ + case Variant3Check: /* should work except for win condition */ + case VariantShatranj: /* should work except for all win conditions */ + case VariantBerolina: /* might work if TestLegality is off */ + case VariantCapaRandom: /* should work */ + case VariantJanus: /* should work */ + case VariantSuper: /* experimental */ + case VariantGreat: /* experimental, requires legality testing to be off */ + break; + } + } + + InitEngineUCI( installDir, &first ); // [HGM] moved here from winboard.c, to make available in xboard + InitEngineUCI( installDir, &second ); + } + + int NextIntegerFromString( char ** str, long * value ) + { + int result = -1; + char * s = *str; + + while( *s == ' ' || *s == '\t' ) { + s++; + } + + *value = 0; + + if( *s >= '0' && *s <= '9' ) { + while( *s >= '0' && *s <= '9' ) { + *value = *value * 10 + (*s - '0'); + s++; + } + + result = 0; + } + + *str = s; + + return result; + } + + int NextTimeControlFromString( char ** str, long * value ) + { + long temp; + int result = NextIntegerFromString( str, &temp ); + + if( result == 0 ) { + *value = temp * 60; /* Minutes */ + if( **str == ':' ) { + (*str)++; + result = NextIntegerFromString( str, &temp ); + *value += temp; /* Seconds */ + } + } + + return result; + } + + int NextSessionFromString( char ** str, int *moves, long * tc, long *inc) + { /* [HGM] routine added to read '+moves/time' for secondary time control */ + int result = -1; long temp, temp2; + + if(**str != '+') return -1; // old params remain in force! + (*str)++; + if( NextTimeControlFromString( str, &temp ) ) return -1; + + if(**str != '/') { + /* time only: incremental or sudden-death time control */ + if(**str == '+') { /* increment follows; read it */ + (*str)++; + if(result = NextIntegerFromString( str, &temp2)) return -1; + *inc = temp2 * 1000; + } else *inc = 0; + *moves = 0; *tc = temp * 1000; + return 0; + } else if(temp % 60 != 0) return -1; /* moves was given as min:sec */ + + (*str)++; /* classical time control */ + result = NextTimeControlFromString( str, &temp2); + if(result == 0) { + *moves = temp/60; + *tc = temp2 * 1000; + *inc = 0; + } + return result; + } + + int GetTimeQuota(int movenr) + { /* [HGM] get time to add from the multi-session time-control string */ + int moves=1; /* kludge to force reading of first session */ + long time, increment; + char *s = fullTimeControlString; + + if(appData.debugMode) fprintf(debugFP, "TC string = '%s'\n", fullTimeControlString); + do { + if(moves) NextSessionFromString(&s, &moves, &time, &increment); + if(appData.debugMode) fprintf(debugFP, "mps=%d tc=%d inc=%d\n", moves, (int) time, (int) increment); + if(movenr == -1) return time; /* last move before new session */ + if(!moves) return increment; /* current session is incremental */ + if(movenr >= 0) movenr -= moves; /* we already finished this session */ + } while(movenr >= -1); /* try again for next session */ + + return 0; // no new time quota on this move + } + + int + ParseTimeControl(tc, ti, mps) + char *tc; + int ti; + int mps; + { + #if 0 + int matched, min, sec; + + matched = sscanf(tc, "%d:%d", &min, &sec); + if (matched == 1) { + timeControl = min * 60 * 1000; + } else if (matched == 2) { + timeControl = (min * 60 + sec) * 1000; + } else { + return FALSE; + } + #else + long tc1; + long tc2; + char buf[MSG_SIZ]; + + if(ti >= 0 && !strchr(tc, '+') && !strchr(tc, '/') ) mps = 0; + if(ti > 0) { + if(mps) + sprintf(buf, "+%d/%s+%d", mps, tc, ti); + else sprintf(buf, "+%s+%d", tc, ti); + } else { + if(mps) + sprintf(buf, "+%d/%s", mps, tc); + else sprintf(buf, "+%s", tc); + } + fullTimeControlString = StrSave(buf); + + if( NextTimeControlFromString( &tc, &tc1 ) != 0 ) { + return FALSE; + } + + if( *tc == '/' ) { + /* Parse second time control */ + tc++; + + if( NextTimeControlFromString( &tc, &tc2 ) != 0 ) { + return FALSE; + } + + if( tc2 == 0 ) { + return FALSE; + } + + timeControl_2 = tc2 * 1000; + } + else { + timeControl_2 = 0; + } + + if( tc1 == 0 ) { + return FALSE; + } + + timeControl = tc1 * 1000; + #endif + + if (ti >= 0) { + timeIncrement = ti * 1000; /* convert to ms */ + movesPerSession = 0; + } else { + timeIncrement = 0; + movesPerSession = mps; + } + return TRUE; + } + + void + InitBackEnd2() + { + if (appData.debugMode) { + fprintf(debugFP, "%s\n", programVersion); + } + + if (appData.matchGames > 0) { + appData.matchMode = TRUE; + } else if (appData.matchMode) { + appData.matchGames = 1; + } + if(appData.matchMode && appData.sameColorGames > 0) /* [HGM] alternate: overrule matchGames */ + appData.matchGames = appData.sameColorGames; + if(appData.rewindIndex > 1) { /* [HGM] autoinc: rewind implies auto-increment and overrules given index */ + if(appData.loadPositionIndex >= 0) appData.loadPositionIndex = -1; + if(appData.loadGameIndex >= 0) appData.loadGameIndex = -1; + } + Reset(TRUE, FALSE); + if (appData.noChessProgram || first.protocolVersion == 1) { + InitBackEnd3(); + } else { + /* kludge: allow timeout for initial "feature" commands */ + FreezeUI(); - DisplayMessage("", "Starting chess program"); ++ DisplayMessage("", _("Starting chess program")); + ScheduleDelayedEvent(InitBackEnd3, FEATURE_TIMEOUT); + } + } + + void + InitBackEnd3 P((void)) + { + GameMode initialMode; + char buf[MSG_SIZ]; + int err; + + InitChessProgram(&first, startedFromSetupPosition); + ++ + if (appData.icsActive) { ++#ifdef WIN32 ++ /* [DM] Make a console window if needed [HGM] merged ifs */ ++ ConsoleCreate(); ++#endif + err = establish(); + if (err != 0) { + if (*appData.icsCommPort != NULLCHAR) { - sprintf(buf, "Could not open comm port %s", ++ sprintf(buf, _("Could not open comm port %s"), + appData.icsCommPort); + } else { - sprintf(buf, "Could not connect to host %s, port %s", ++ sprintf(buf, _("Could not connect to host %s, port %s"), + appData.icsHost, appData.icsPort); + } + DisplayFatalError(buf, err, 1); + return; + } + SetICSMode(); + telnetISR = + AddInputSource(icsPR, FALSE, read_from_ics, &telnetISR); + fromUserISR = + AddInputSource(NoProc, FALSE, read_from_player, &fromUserISR); + } else if (appData.noChessProgram) { + SetNCPMode(); + } else { + SetGNUMode(); + } + + if (*appData.cmailGameName != NULLCHAR) { + SetCmailMode(); + OpenLoopback(&cmailPR); + cmailISR = + AddInputSource(cmailPR, FALSE, CmailSigHandlerCallBack, &cmailISR); + } + + ThawUI(); + DisplayMessage("", ""); + if (StrCaseCmp(appData.initialMode, "") == 0) { + initialMode = BeginningOfGame; + } else if (StrCaseCmp(appData.initialMode, "TwoMachines") == 0) { + initialMode = TwoMachinesPlay; + } else if (StrCaseCmp(appData.initialMode, "AnalyzeFile") == 0) { + initialMode = AnalyzeFile; + } else if (StrCaseCmp(appData.initialMode, "Analysis") == 0) { + initialMode = AnalyzeMode; + } else if (StrCaseCmp(appData.initialMode, "MachineWhite") == 0) { + initialMode = MachinePlaysWhite; + } else if (StrCaseCmp(appData.initialMode, "MachineBlack") == 0) { + initialMode = MachinePlaysBlack; + } else if (StrCaseCmp(appData.initialMode, "EditGame") == 0) { + initialMode = EditGame; + } else if (StrCaseCmp(appData.initialMode, "EditPosition") == 0) { + initialMode = EditPosition; + } else if (StrCaseCmp(appData.initialMode, "Training") == 0) { + initialMode = Training; + } else { - sprintf(buf, "Unknown initialMode %s", appData.initialMode); ++ sprintf(buf, _("Unknown initialMode %s"), appData.initialMode); + DisplayFatalError(buf, 0, 2); + return; + } + + if (appData.matchMode) { + /* Set up machine vs. machine match */ + if (appData.noChessProgram) { - DisplayFatalError("Can't have a match with no chess programs", ++ DisplayFatalError(_("Can't have a match with no chess programs"), + 0, 2); + return; + } + matchMode = TRUE; + matchGame = 1; + if (*appData.loadGameFile != NULLCHAR) { + int index = appData.loadGameIndex; // [HGM] autoinc + if(index<0) lastIndex = index = 1; + if (!LoadGameFromFile(appData.loadGameFile, + index, + appData.loadGameFile, FALSE)) { - DisplayFatalError("Bad game file", 0, 1); ++ DisplayFatalError(_("Bad game file"), 0, 1); + return; + } + } else if (*appData.loadPositionFile != NULLCHAR) { + int index = appData.loadPositionIndex; // [HGM] autoinc + if(index<0) lastIndex = index = 1; + if (!LoadPositionFromFile(appData.loadPositionFile, + index, + appData.loadPositionFile)) { - DisplayFatalError("Bad position file", 0, 1); ++ DisplayFatalError(_("Bad position file"), 0, 1); + return; + } + } + TwoMachinesEvent(); + } else if (*appData.cmailGameName != NULLCHAR) { + /* Set up cmail mode */ + ReloadCmailMsgEvent(TRUE); + } else { + /* Set up other modes */ + if (initialMode == AnalyzeFile) { + if (*appData.loadGameFile == NULLCHAR) { - DisplayFatalError("AnalyzeFile mode requires a game file", 0, 1); ++ DisplayFatalError(_("AnalyzeFile mode requires a game file"), 0, 1); + return; + } + } + if (*appData.loadGameFile != NULLCHAR) { + (void) LoadGameFromFile(appData.loadGameFile, + appData.loadGameIndex, + appData.loadGameFile, TRUE); + } else if (*appData.loadPositionFile != NULLCHAR) { + (void) LoadPositionFromFile(appData.loadPositionFile, + appData.loadPositionIndex, + appData.loadPositionFile); + /* [HGM] try to make self-starting even after FEN load */ + /* to allow automatic setup of fairy variants with wtm */ + if(initialMode == BeginningOfGame && !blackPlaysFirst) { + gameMode = BeginningOfGame; + setboardSpoiledMachineBlack = 1; + } + /* [HGM] loadPos: make that every new game uses the setup */ + /* from file as long as we do not switch variant */ + if(!blackPlaysFirst) { int i; + startedFromPositionFile = TRUE; + CopyBoard(filePosition, boards[0]); + for(i=0; i 0177) { + fprintf(fp, "\\%03o", *buf & 0xff); + } else { + putc(*buf, fp); + } + buf++; + } + fflush(fp); + } + + /* Returns an errno value */ + int + OutputMaybeTelnet(pr, message, count, outError) + ProcRef pr; + char *message; + int count; + int *outError; + { + char buf[8192], *p, *q, *buflim; + int left, newcount, outcount; + + if (*appData.icsCommPort != NULLCHAR || appData.useTelnet || + *appData.gateway != NULLCHAR) { + if (appData.debugMode) { + fprintf(debugFP, ">ICS: "); + show_bytes(debugFP, message, count); + fprintf(debugFP, "\n"); + } + return OutputToProcess(pr, message, count, outError); + } + + buflim = &buf[sizeof(buf)-1]; /* allow 1 byte for expanding last char */ + p = message; + q = buf; + left = count; + newcount = 0; + while (left) { + if (q >= buflim) { + if (appData.debugMode) { + fprintf(debugFP, ">ICS: "); + show_bytes(debugFP, buf, newcount); + fprintf(debugFP, "\n"); + } + outcount = OutputToProcess(pr, buf, newcount, outError); + if (outcount < newcount) return -1; /* to be sure */ + q = buf; + newcount = 0; + } + if (*p == '\n') { + *q++ = '\r'; + newcount++; + } else if (((unsigned char) *p) == TN_IAC) { + *q++ = (char) TN_IAC; + newcount ++; + } + *q++ = *p++; + newcount++; + left--; + } + if (appData.debugMode) { + fprintf(debugFP, ">ICS: "); + show_bytes(debugFP, buf, newcount); + fprintf(debugFP, "\n"); + } + outcount = OutputToProcess(pr, buf, newcount, outError); + if (outcount < newcount) return -1; /* to be sure */ + return count; + } + + void + read_from_player(isr, closure, message, count, error) + InputSourceRef isr; + VOIDSTAR closure; + char *message; + int count; + int error; + { + int outError, outCount; + static int gotEof = 0; + + /* Pass data read from player on to ICS */ + if (count > 0) { + gotEof = 0; + outCount = OutputMaybeTelnet(icsPR, message, count, &outError); + if (outCount < count) { - DisplayFatalError("Error writing to ICS", outError, 1); ++ DisplayFatalError(_("Error writing to ICS"), outError, 1); + } + } else if (count < 0) { + RemoveInputSource(isr); - DisplayFatalError("Error reading from keyboard", error, 1); ++ DisplayFatalError(_("Error reading from keyboard"), error, 1); + } else if (gotEof++ > 0) { + RemoveInputSource(isr); - DisplayFatalError("Got end of file from keyboard", 0, 0); ++ DisplayFatalError(_("Got end of file from keyboard"), 0, 0); + } + } + + void + SendToICS(s) + char *s; + { + int count, outCount, outError; + + if (icsPR == NULL) return; + + count = strlen(s); + outCount = OutputMaybeTelnet(icsPR, s, count, &outError); + if (outCount < count) { - DisplayFatalError("Error writing to ICS", outError, 1); ++ DisplayFatalError(_("Error writing to ICS"), outError, 1); + } + } + + /* This is used for sending logon scripts to the ICS. Sending + without a delay causes problems when using timestamp on ICC + (at least on my machine). */ + void + SendToICSDelayed(s,msdelay) + char *s; + long msdelay; + { + int count, outCount, outError; + + if (icsPR == NULL) return; + + count = strlen(s); + if (appData.debugMode) { + fprintf(debugFP, ">ICS: "); + show_bytes(debugFP, s, count); + fprintf(debugFP, "\n"); + } + outCount = OutputToProcessDelayed(icsPR, s, count, &outError, + msdelay); + if (outCount < count) { - DisplayFatalError("Error writing to ICS", outError, 1); ++ DisplayFatalError(_("Error writing to ICS"), outError, 1); + } + } + + + /* Remove all highlighting escape sequences in s + Also deletes any suffix starting with '(' + */ + char * + StripHighlightAndTitle(s) + char *s; + { + static char retbuf[MSG_SIZ]; + char *p = retbuf; + + while (*s != NULLCHAR) { + while (*s == '\033') { + while (*s != NULLCHAR && !isalpha(*s)) s++; + if (*s != NULLCHAR) s++; + } + while (*s != NULLCHAR && *s != '\033') { + if (*s == '(' || *s == '[') { + *p = NULLCHAR; + return retbuf; + } + *p++ = *s++; + } + } + *p = NULLCHAR; + return retbuf; + } + + /* Remove all highlighting escape sequences in s */ + char * + StripHighlight(s) + char *s; + { + static char retbuf[MSG_SIZ]; + char *p = retbuf; + + while (*s != NULLCHAR) { + while (*s == '\033') { + while (*s != NULLCHAR && !isalpha(*s)) s++; + if (*s != NULLCHAR) s++; + } + while (*s != NULLCHAR && *s != '\033') { + *p++ = *s++; + } + } + *p = NULLCHAR; + return retbuf; + } + + char *variantNames[] = VARIANT_NAMES; + char * + VariantName(v) + VariantClass v; + { + return variantNames[v]; + } + + + /* Identify a variant from the strings the chess servers use or the + PGN Variant tag names we use. */ + VariantClass + StringToVariant(e) + char *e; + { + char *p; + int wnum = -1; + VariantClass v = VariantNormal; + int i, found = FALSE; + char buf[MSG_SIZ]; + + if (!e) return v; + + /* [HGM] skip over optional board-size prefixes */ + if( sscanf(e, "%dx%d_", &i, &i) == 2 || + sscanf(e, "%dx%d+%d_", &i, &i, &i) == 3 ) { + while( *e++ != '_'); + } + + for (i=0; i%s %s ", ddwwStr, optionStr); + } + msg[0] = TN_IAC; + msg[1] = ddww; + msg[2] = option; + outCount = OutputToProcess(icsPR, (char *)msg, 3, &outError); + if (outCount < 3) { - DisplayFatalError("Error writing to ICS", outError, 1); ++ DisplayFatalError(_("Error writing to ICS"), outError, 1); + } + } + + void + DoEcho() + { + if (!appData.icsActive) return; + TelnetRequest(TN_DO, TN_ECHO); + } + + void + DontEcho() + { + if (!appData.icsActive) return; + TelnetRequest(TN_DONT, TN_ECHO); + } + + void + CopyHoldings(Board board, char *holdings, ChessSquare lowestPiece) + { + /* put the holdings sent to us by the server on the board holdings area */ + int i, j, holdingsColumn, holdingsStartRow, direction, countsColumn; + char p; + ChessSquare piece; + + if(gameInfo.holdingsWidth < 2) return; + + if( (int)lowestPiece >= BlackPawn ) { + holdingsColumn = 0; + countsColumn = 1; + holdingsStartRow = BOARD_HEIGHT-1; + direction = -1; + } else { + holdingsColumn = BOARD_WIDTH-1; + countsColumn = BOARD_WIDTH-2; + holdingsStartRow = 0; + direction = 1; + } + + for(i=0; i= gameInfo.holdingsSize) continue; /* ignore pieces that do not fit */ + if(j < 0) continue; /* should not happen */ + piece = (ChessSquare) ( (int)piece + (int)lowestPiece ); + board[holdingsStartRow+j*direction][holdingsColumn] = piece; + board[holdingsStartRow+j*direction][countsColumn]++; + } + + } + + + void + VariantSwitch(Board board, VariantClass newVariant) + { + int newHoldingsWidth, newWidth = 8, newHeight = 8, i, j; + int oldCurrentMove = currentMove, oldForwardMostMove = forwardMostMove, oldBackwardMostMove = backwardMostMove; + Board tempBoard; int saveCastling[BOARD_SIZE], saveEP; + + startedFromPositionFile = FALSE; + if(gameInfo.variant == newVariant) return; + + /* [HGM] This routine is called each time an assignment is made to + * gameInfo.variant during a game, to make sure the board sizes + * are set to match the new variant. If that means adding or deleting + * holdings, we shift the playing board accordingly + * This kludge is needed because in ICS observe mode, we get boards + * of an ongoing game without knowing the variant, and learn about the + * latter only later. This can be because of the move list we requested, + * in which case the game history is refilled from the beginning anyway, + * but also when receiving holdings of a crazyhouse game. In the latter + * case we want to add those holdings to the already received position. + */ + + + if (appData.debugMode) { + fprintf(debugFP, "Switch board from %s to %s\n", + VariantName(gameInfo.variant), VariantName(newVariant)); + setbuf(debugFP, NULL); + } + shuffleOpenings = 0; /* [HGM] shuffle */ + gameInfo.holdingsSize = 5; /* [HGM] prepare holdings */ + switch(newVariant) { + case VariantShogi: + newWidth = 9; newHeight = 9; + gameInfo.holdingsSize = 7; + case VariantBughouse: + case VariantCrazyhouse: + newHoldingsWidth = 2; break; + default: + newHoldingsWidth = gameInfo.holdingsSize = 0; + } + + if(newWidth != gameInfo.boardWidth || + newHeight != gameInfo.boardHeight || + newHoldingsWidth != gameInfo.holdingsWidth ) { + + /* shift position to new playing area, if needed */ + if(newHoldingsWidth > gameInfo.holdingsWidth) { + for(i=0; i=BOARD_LEFT; j--) + board[i][j+newHoldingsWidth-gameInfo.holdingsWidth] = + board[i][j]; + for(i=0; i 0) { + /* If last read ended with a partial line that we couldn't parse, + prepend it to the new read and try again. */ + if (leftover_len > 0) { + for (i=0; i= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && + buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') + buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous + } + + buf[buf_len] = NULLCHAR; + next_out = leftover_len; + leftover_start = 0; + + i = 0; + while (i < buf_len) { + /* Deal with part of the TELNET option negotiation + protocol. We refuse to do anything beyond the + defaults, except that we allow the WILL ECHO option, + which ICS uses to turn off password echoing when we are + directly connected to it. We reject this option + if localLineEditing mode is on (always on in xboard) + and we are talking to port 23, which might be a real + telnet server that will try to keep WILL ECHO on permanently. + */ + if (buf_len - i >= 3 && (unsigned char) buf[i] == TN_IAC) { + static int remoteEchoOption = FALSE; /* telnet ECHO option */ + unsigned char option; + oldi = i; + switch ((unsigned char) buf[++i]) { + case TN_WILL: + if (appData.debugMode) + fprintf(debugFP, "\n next_out) + SendToPlayer(&buf[next_out], oldi - next_out); + if (++i > next_out) + next_out = i; + continue; + } + + /* OK, this at least will *usually* work */ + if (!loggedOn && looking_at(buf, &i, "ics%")) { + loggedOn = TRUE; + } + + if (loggedOn && !intfSet) { + if (ics_type == ICS_ICC) { + sprintf(str, + "/set-quietly interface %s\n/set-quietly style 12\n", + programVersion); + + } else if (ics_type == ICS_CHESSNET) { + sprintf(str, "/style 12\n"); + } else { + strcpy(str, "alias $ @\n$set interface "); + strcat(str, programVersion); + strcat(str, "\n$iset startpos 1\n$iset ms 1\n"); + #ifdef WIN32 + strcat(str, "$iset nohighlight 1\n"); + #endif + strcat(str, "$iset lock 1\n$style 12\n"); + } + SendToICS(str); + intfSet = TRUE; + } + + if (started == STARTED_COMMENT) { + /* Accumulate characters in comment */ + parse[parse_pos++] = buf[i]; + if (buf[i] == '\n') { + parse[parse_pos] = NULLCHAR; + if(!suppressKibitz) // [HGM] kibitz + AppendComment(forwardMostMove, StripHighlight(parse)); + else { // [HGM kibitz: divert memorized engine kibitz to engine-output window + int nrDigit = 0, nrAlph = 0, i; + if(parse_pos > MSG_SIZ - 30) // defuse unreasonably long input + { parse_pos = MSG_SIZ-30; parse[parse_pos - 1] = '\n'; } + parse[parse_pos] = NULLCHAR; + // try to be smart: if it does not look like search info, it should go to + // ICS interaction window after all, not to engine-output window. + for(i=0; i= '0' && parse[i] <= '9'); + nrAlph += (parse[i] >= 'a' && parse[i] <= 'z'); + nrAlph += (parse[i] >= 'A' && parse[i] <= 'Z'); + } + if(nrAlph < 9*nrDigit) { // if more than 10% digit we assume search info + OutputKibitz(suppressKibitz, parse); + } else { + char tmp[MSG_SIZ]; - sprintf(tmp, "your opponent kibitzes: %s", parse); ++ sprintf(tmp, _("your opponent kibitzes: %s"), parse); + SendToPlayer(tmp, strlen(tmp)); + } + } + started = STARTED_NONE; + } else { + /* Don't match patterns against characters in chatter */ + i++; + continue; + } + } + if (started == STARTED_CHATTER) { + if (buf[i] != '\n') { + /* Don't match patterns against characters in chatter */ + i++; + continue; + } + started = STARTED_NONE; + } + + /* Kludge to deal with rcmd protocol */ + if (firstTime && looking_at(buf, &i, "\001*")) { + DisplayFatalError(&buf[1], 0, 1); + continue; + } else { + firstTime = FALSE; + } + + if (!loggedOn && looking_at(buf, &i, "chessclub.com")) { + ics_type = ICS_ICC; + ics_prefix = "/"; + if (appData.debugMode) + fprintf(debugFP, "ics_type %d\n", ics_type); + continue; + } + if (!loggedOn && looking_at(buf, &i, "freechess.org")) { + ics_type = ICS_FICS; + ics_prefix = "$"; + if (appData.debugMode) + fprintf(debugFP, "ics_type %d\n", ics_type); + continue; + } + if (!loggedOn && looking_at(buf, &i, "chess.net")) { + ics_type = ICS_CHESSNET; + ics_prefix = "/"; + if (appData.debugMode) + fprintf(debugFP, "ics_type %d\n", ics_type); + continue; + } + + if (!loggedOn && + (looking_at(buf, &i, "\"*\" is *a registered name") || + looking_at(buf, &i, "Logging you in as \"*\"") || + looking_at(buf, &i, "will be \"*\""))) { + strcpy(ics_handle, star_match[0]); + continue; + } + + if (loggedOn && !have_set_title && ics_handle[0] != NULLCHAR) { + char buf[MSG_SIZ]; + sprintf(buf, "%s@%s", ics_handle, appData.icsHost); + DisplayIcsInteractionTitle(buf); + have_set_title = TRUE; + } + + /* skip finger notes */ + if (started == STARTED_NONE && + ((buf[i] == ' ' && isdigit(buf[i+1])) || + (buf[i] == '1' && buf[i+1] == '0')) && + buf[i+2] == ':' && buf[i+3] == ' ') { + started = STARTED_CHATTER; + i += 3; + continue; + } + + /* skip formula vars */ + if (started == STARTED_NONE && + buf[i] == 'f' && isdigit(buf[i+1]) && buf[i+2] == ':') { + started = STARTED_CHATTER; + i += 3; + continue; + } + + oldi = i; + // [HGM] kibitz: try to recognize opponent engine-score kibitzes, to divert them to engine-output window + if (appData.autoKibitz && started == STARTED_NONE && ++ !appData.icsEngineAnalyze && // [HGM] [DM] ICS analyze + (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || gameMode == IcsObserving)) { + if(looking_at(buf, &i, "* kibitzes: ") && + (StrStr(star_match[0], gameInfo.white) == star_match[0] || + StrStr(star_match[0], gameInfo.black) == star_match[0] )) { // kibitz of self or opponent + suppressKibitz = TRUE; + if((StrStr(star_match[0], gameInfo.white) == star_match[0]) + && (gameMode == IcsPlayingWhite) || + (StrStr(star_match[0], gameInfo.black) == star_match[0]) + && (gameMode == IcsPlayingBlack) ) // opponent kibitz + started = STARTED_CHATTER; // own kibitz we simply discard + else { + started = STARTED_COMMENT; // make sure it will be collected in parse[] + parse_pos = 0; parse[0] = NULLCHAR; + savingComment = TRUE; + suppressKibitz = gameMode != IcsObserving ? 2 : + (StrStr(star_match[0], gameInfo.white) == NULL) + 1; + } + continue; + } else + if(looking_at(buf, &i, "kibitzed to")) { // suppress the acknowledgements of our own autoKibitz + started = STARTED_CHATTER; + suppressKibitz = TRUE; + } + } // [HGM] kibitz: end of patch + + if (appData.zippyTalk || appData.zippyPlay) { ++ /* [DM] Backup address for color zippy lines */ ++ backup = i; + #if ZIPPY - if (ZippyControl(buf, &i) || - ZippyConverse(buf, &i) || - (appData.zippyPlay && ZippyMatch(buf, &i))) { - loggedOn = TRUE; - continue; ++ #ifdef WIN32 ++ if (loggedOn == TRUE) ++ if (ZippyControl(buf, &backup) || ZippyConverse(buf, &backup) || ++ (appData.zippyPlay && ZippyMatch(buf, &backup))); ++ #else ++ if (ZippyControl(buf, &i) || ++ ZippyConverse(buf, &i) || ++ (appData.zippyPlay && ZippyMatch(buf, &i))) { ++ loggedOn = TRUE; ++ if (!appData.colorize) continue; + } ++ #endif + #endif - } else { - if (/* Don't color "message" or "messages" output */ ++ } // [DM] 'else { ' deleted ++ if (/* Don't color "message" or "messages" output */ + (tkind = 5, looking_at(buf, &i, "*. * (*:*): ")) || + looking_at(buf, &i, "*. * at *:*: ") || + looking_at(buf, &i, "--* (*:*): ") || + /* Regular tells and says */ + (tkind = 1, looking_at(buf, &i, "* tells you: ")) || + looking_at(buf, &i, "* (your partner) tells you: ") || + looking_at(buf, &i, "* says: ") || + /* Message notifications (same color as tells) */ + looking_at(buf, &i, "* has left a message ") || + looking_at(buf, &i, "* just sent you a message:\n") || + /* Whispers and kibitzes */ + (tkind = 2, looking_at(buf, &i, "* whispers: ")) || + looking_at(buf, &i, "* kibitzes: ") || + /* Channel tells */ + (tkind = 3, looking_at(buf, &i, "*(*: "))) { + + if (tkind == 1 && strchr(star_match[0], ':')) { + /* Avoid "tells you:" spoofs in channels */ + tkind = 3; + } + if (star_match[0][0] == NULLCHAR || + strchr(star_match[0], ' ') || + (tkind == 3 && strchr(star_match[1], ' '))) { + /* Reject bogus matches */ + i = oldi; + } else { + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + switch (tkind) { + case 1: + Colorize(ColorTell, FALSE); + curColor = ColorTell; + break; + case 2: + Colorize(ColorKibitz, FALSE); + curColor = ColorKibitz; + break; + case 3: + p = strrchr(star_match[1], '('); + if (p == NULL) { + p = star_match[1]; + } else { + p++; + } + if (atoi(p) == 1) { + Colorize(ColorChannel1, FALSE); + curColor = ColorChannel1; + } else { + Colorize(ColorChannel, FALSE); + curColor = ColorChannel; + } + break; + case 5: + curColor = ColorNormal; + break; + } + } + if (started == STARTED_NONE && appData.autoComment && + (gameMode == IcsObserving || + gameMode == IcsPlayingWhite || + gameMode == IcsPlayingBlack)) { + parse_pos = i - oldi; + memcpy(parse, &buf[oldi], parse_pos); + parse[parse_pos] = NULLCHAR; + started = STARTED_COMMENT; + savingComment = TRUE; + } else { + started = STARTED_CHATTER; + savingComment = FALSE; + } + loggedOn = TRUE; + continue; + } + } + + if (looking_at(buf, &i, "* s-shouts: ") || + looking_at(buf, &i, "* c-shouts: ")) { + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorSShout, FALSE); + curColor = ColorSShout; + } + loggedOn = TRUE; + started = STARTED_CHATTER; + continue; + } + + if (looking_at(buf, &i, "--->")) { + loggedOn = TRUE; + continue; + } + + if (looking_at(buf, &i, "* shouts: ") || + looking_at(buf, &i, "--> ")) { + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorShout, FALSE); + curColor = ColorShout; + } + loggedOn = TRUE; + started = STARTED_CHATTER; + continue; + } + + if (looking_at( buf, &i, "Challenge:")) { + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorChallenge, FALSE); + curColor = ColorChallenge; + } + loggedOn = TRUE; + continue; + } + + if (looking_at(buf, &i, "* offers you") || + looking_at(buf, &i, "* offers to be") || + looking_at(buf, &i, "* would like to") || + looking_at(buf, &i, "* requests to") || + looking_at(buf, &i, "Your opponent offers") || + looking_at(buf, &i, "Your opponent requests")) { + + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorRequest, FALSE); + curColor = ColorRequest; + } + continue; + } + + if (looking_at(buf, &i, "* (*) seeking")) { + if (appData.colorize) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorSeek, FALSE); + curColor = ColorSeek; + } + continue; - } + } + + if (looking_at(buf, &i, "\\ ")) { + if (prevColor != ColorNormal) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(prevColor, TRUE); + curColor = prevColor; + } + if (savingComment) { + parse_pos = i - oldi; + memcpy(parse, &buf[oldi], parse_pos); + parse[parse_pos] = NULLCHAR; + started = STARTED_COMMENT; + } else { + started = STARTED_CHATTER; + } + continue; + } + + if (looking_at(buf, &i, "Black Strength :") || + looking_at(buf, &i, "<<< style 10 board >>>") || + looking_at(buf, &i, "<10>") || + looking_at(buf, &i, "#@#")) { + /* Wrong board style */ + loggedOn = TRUE; + SendToICS(ics_prefix); + SendToICS("set style 12\n"); + SendToICS(ics_prefix); + SendToICS("refresh\n"); + continue; + } + + if (!have_sent_ICS_logon && looking_at(buf, &i, "login:")) { + ICSInitScript(); + have_sent_ICS_logon = 1; + continue; + } + + if (ics_getting_history != H_GETTING_MOVES /*smpos kludge*/ && + (looking_at(buf, &i, "\n<12> ") || + looking_at(buf, &i, "<12> "))) { + loggedOn = TRUE; + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + } + next_out = i; + started = STARTED_BOARD; + parse_pos = 0; + continue; + } + + if ((started == STARTED_NONE && looking_at(buf, &i, "\n ")) || + looking_at(buf, &i, " ")) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + } + next_out = i; + started = STARTED_HOLDINGS; + parse_pos = 0; + continue; + } + + if (looking_at(buf, &i, "* *vs. * *--- *")) { + loggedOn = TRUE; + /* Header for a move list -- first line */ + + switch (ics_getting_history) { + case H_FALSE: + switch (gameMode) { + case IcsIdle: + case BeginningOfGame: + /* User typed "moves" or "oldmoves" while we + were idle. Pretend we asked for these + moves and soak them up so user can step + through them and/or save them. + */ + Reset(FALSE, TRUE); + gameMode = IcsObserving; + ModeHighlight(); + ics_gamenum = -1; + ics_getting_history = H_GOT_UNREQ_HEADER; + break; + case EditGame: /*?*/ + case EditPosition: /*?*/ + /* Should above feature work in these modes too? */ + /* For now it doesn't */ + ics_getting_history = H_GOT_UNWANTED_HEADER; + break; + default: + ics_getting_history = H_GOT_UNWANTED_HEADER; + break; + } + break; + case H_REQUESTED: + /* Is this the right one? */ + if (gameInfo.white && gameInfo.black && + strcmp(gameInfo.white, star_match[0]) == 0 && + strcmp(gameInfo.black, star_match[2]) == 0) { + /* All is well */ + ics_getting_history = H_GOT_REQ_HEADER; + } + break; + case H_GOT_REQ_HEADER: + case H_GOT_UNREQ_HEADER: + case H_GOT_UNWANTED_HEADER: + case H_GETTING_MOVES: + /* Should not happen */ - DisplayError("Error gathering move list: two headers", 0); ++ DisplayError(_("Error gathering move list: two headers"), 0); + ics_getting_history = H_FALSE; + break; + } + + /* Save player ratings into gameInfo if needed */ + if ((ics_getting_history == H_GOT_REQ_HEADER || + ics_getting_history == H_GOT_UNREQ_HEADER) && + (gameInfo.whiteRating == -1 || + gameInfo.blackRating == -1)) { + + gameInfo.whiteRating = string_to_rating(star_match[1]); + gameInfo.blackRating = string_to_rating(star_match[3]); + if (appData.debugMode) - fprintf(debugFP, "Ratings from header: W %d, B %d\n", ++ fprintf(debugFP, _("Ratings from header: W %d, B %d\n"), + gameInfo.whiteRating, gameInfo.blackRating); + } + continue; + } + + if (looking_at(buf, &i, + "* * match, initial time: * minute*, increment: * second")) { + /* Header for a move list -- second line */ + /* Initial board will follow if this is a wild game */ + if (gameInfo.event != NULL) free(gameInfo.event); + sprintf(str, "ICS %s %s match", star_match[0], star_match[1]); + gameInfo.event = StrSave(str); + /* [HGM] we switched variant. Translate boards if needed. */ + VariantSwitch(boards[currentMove], StringToVariant(gameInfo.event)); + continue; + } + + if (looking_at(buf, &i, "Move ")) { + /* Beginning of a move list */ + switch (ics_getting_history) { + case H_FALSE: + /* Normally should not happen */ + /* Maybe user hit reset while we were parsing */ + break; + case H_REQUESTED: + /* Happens if we are ignoring a move list that is not + * the one we just requested. Common if the user + * tries to observe two games without turning off + * getMoveList */ + break; + case H_GETTING_MOVES: + /* Should not happen */ - DisplayError("Error gathering move list: nested", 0); ++ DisplayError(_("Error gathering move list: nested"), 0); + ics_getting_history = H_FALSE; + break; + case H_GOT_REQ_HEADER: + ics_getting_history = H_GETTING_MOVES; + started = STARTED_MOVES; + parse_pos = 0; + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + } + break; + case H_GOT_UNREQ_HEADER: + ics_getting_history = H_GETTING_MOVES; + started = STARTED_MOVES_NOHIDE; + parse_pos = 0; + break; + case H_GOT_UNWANTED_HEADER: + ics_getting_history = H_FALSE; + break; + } + continue; + } + + if (looking_at(buf, &i, "% ") || + ((started == STARTED_MOVES || started == STARTED_MOVES_NOHIDE) + && looking_at(buf, &i, "}*"))) { char *bookHit = NULL; // [HGM] book + savingComment = FALSE; + switch (started) { + case STARTED_MOVES: + case STARTED_MOVES_NOHIDE: + memcpy(&parse[parse_pos], &buf[oldi], i - oldi); + parse[parse_pos + i - oldi] = NULLCHAR; + ParseGameHistory(parse); + #if ZIPPY + if (appData.zippyPlay && first.initDone) { + FeedMovesToProgram(&first, forwardMostMove); + if (gameMode == IcsPlayingWhite) { + if (WhiteOnMove(forwardMostMove)) { + if (first.sendTime) { + if (first.useColors) { + SendToProgram("black\n", &first); + } + SendTimeRemaining(&first, TRUE); + } + #if 0 + if (first.useColors) { + SendToProgram("white\ngo\n", &first); + } else { + SendToProgram("go\n", &first); + } + #else + if (first.useColors) { + SendToProgram("white\n", &first); // [HGM] book: made sending of "go\n" book dependent + } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: probe book for initial pos + #endif + first.maybeThinking = TRUE; + } else { + if (first.usePlayother) { + if (first.sendTime) { + SendTimeRemaining(&first, TRUE); + } + SendToProgram("playother\n", &first); + firstMove = FALSE; + } else { + firstMove = TRUE; + } + } + } else if (gameMode == IcsPlayingBlack) { + if (!WhiteOnMove(forwardMostMove)) { + if (first.sendTime) { + if (first.useColors) { + SendToProgram("white\n", &first); + } + SendTimeRemaining(&first, FALSE); + } + #if 0 + if (first.useColors) { + SendToProgram("black\ngo\n", &first); + } else { + SendToProgram("go\n", &first); + } + #else + if (first.useColors) { + SendToProgram("black\n", &first); + } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); + #endif + first.maybeThinking = TRUE; + } else { + if (first.usePlayother) { + if (first.sendTime) { + SendTimeRemaining(&first, FALSE); + } + SendToProgram("playother\n", &first); + firstMove = FALSE; + } else { + firstMove = TRUE; + } + } + } + } + #endif + if (gameMode == IcsObserving && ics_gamenum == -1) { + /* Moves came from oldmoves or moves command + while we weren't doing anything else. + */ + currentMove = forwardMostMove; + ClearHighlights();/*!!could figure this out*/ + flipView = appData.flipView; + DrawPosition(FALSE, boards[currentMove]); + DisplayBothClocks(); + sprintf(str, "%s vs. %s", + gameInfo.white, gameInfo.black); + DisplayTitle(str); + gameMode = IcsIdle; + } else { + /* Moves were history of an active game */ + if (gameInfo.resultDetails != NULL) { + free(gameInfo.resultDetails); + gameInfo.resultDetails = NULL; + } + } + HistorySet(parseList, backwardMostMove, + forwardMostMove, currentMove-1); + DisplayMove(currentMove - 1); + if (started == STARTED_MOVES) next_out = i; + started = STARTED_NONE; + ics_getting_history = H_FALSE; + break; + + case STARTED_OBSERVE: + started = STARTED_NONE; + SendToICS(ics_prefix); + SendToICS("refresh\n"); + break; + + default: + break; + } + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + continue; + } + + if ((started == STARTED_MOVES || started == STARTED_BOARD || + started == STARTED_HOLDINGS || + started == STARTED_MOVES_NOHIDE) && i >= leftover_len) { + /* Accumulate characters in move list or board */ + parse[parse_pos++] = buf[i]; + } + + /* Start of game messages. Mostly we detect start of game + when the first board image arrives. On some versions + of the ICS, though, we need to do a "refresh" after starting + to observe in order to get the current board right away. */ + if (looking_at(buf, &i, "Adding game * to observation list")) { + started = STARTED_OBSERVE; + continue; + } + + /* Handle auto-observe */ + if (appData.autoObserve && + (gameMode == IcsIdle || gameMode == BeginningOfGame) && + looking_at(buf, &i, "Game notification: * (*) vs. * (*)")) { + char *player; + /* Choose the player that was highlighted, if any. */ + if (star_match[0][0] == '\033' || + star_match[1][0] != '\033') { + player = star_match[0]; + } else { + player = star_match[2]; + } + sprintf(str, "%sobserve %s\n", + ics_prefix, StripHighlightAndTitle(player)); + SendToICS(str); + + /* Save ratings from notify string */ + strcpy(player1Name, star_match[0]); + player1Rating = string_to_rating(star_match[1]); + strcpy(player2Name, star_match[2]); + player2Rating = string_to_rating(star_match[3]); + + if (appData.debugMode) + fprintf(debugFP, + "Ratings from 'Game notification:' %s %d, %s %d\n", + player1Name, player1Rating, + player2Name, player2Rating); + + continue; + } + + /* Deal with automatic examine mode after a game, + and with IcsObserving -> IcsExamining transition */ + if (looking_at(buf, &i, "Entering examine mode for game *") || + looking_at(buf, &i, "has made you an examiner of game *")) { + + int gamenum = atoi(star_match[0]); + if ((gameMode == IcsIdle || gameMode == IcsObserving) && + gamenum == ics_gamenum) { + /* We were already playing or observing this game; + no need to refetch history */ + gameMode = IcsExamining; + if (pausing) { + pauseExamForwardMostMove = forwardMostMove; + } else if (currentMove < forwardMostMove) { + ForwardInner(forwardMostMove); + } + } else { + /* I don't think this case really can happen */ + SendToICS(ics_prefix); + SendToICS("refresh\n"); + } + continue; + } + + /* Error messages */ + if (ics_user_moved) { + if (looking_at(buf, &i, "Illegal move") || + looking_at(buf, &i, "Not a legal move") || + looking_at(buf, &i, "Your king is in check") || + looking_at(buf, &i, "It isn't your turn") || + looking_at(buf, &i, "It is not your move")) { + /* Illegal move */ + ics_user_moved = 0; + if (forwardMostMove > backwardMostMove) { + currentMove = --forwardMostMove; + DisplayMove(currentMove - 1); /* before DMError */ - DisplayMoveError("Illegal move (rejected by ICS)"); ++ DisplayMoveError(_("Illegal move (rejected by ICS)")); + DrawPosition(FALSE, boards[currentMove]); + SwitchClocks(); + DisplayBothClocks(); + } + continue; + } + } + + if (looking_at(buf, &i, "still have time") || + looking_at(buf, &i, "not out of time") || + looking_at(buf, &i, "either player is out of time") || + looking_at(buf, &i, "has timeseal; checking")) { + /* We must have called his flag a little too soon */ + whiteFlag = blackFlag = FALSE; + continue; + } + + if (looking_at(buf, &i, "added * seconds to") || + looking_at(buf, &i, "seconds were added to")) { + /* Update the clocks */ + SendToICS(ics_prefix); + SendToICS("refresh\n"); + continue; + } + + if (!ics_clock_paused && looking_at(buf, &i, "clock paused")) { + ics_clock_paused = TRUE; + StopClocks(); + continue; + } + + if (ics_clock_paused && looking_at(buf, &i, "clock resumed")) { + ics_clock_paused = FALSE; + StartClocks(); + continue; + } + + /* Grab player ratings from the Creating: message. + Note we have to check for the special case when + the ICS inserts things like [white] or [black]. */ + if (looking_at(buf, &i, "Creating: * (*)* * (*)") || + looking_at(buf, &i, "Creating: * (*) [*] * (*)")) { + /* star_matches: + 0 player 1 name (not necessarily white) + 1 player 1 rating + 2 empty, white, or black (IGNORED) + 3 player 2 name (not necessarily black) + 4 player 2 rating + + The names/ratings are sorted out when the game + actually starts (below). + */ + strcpy(player1Name, StripHighlightAndTitle(star_match[0])); + player1Rating = string_to_rating(star_match[1]); + strcpy(player2Name, StripHighlightAndTitle(star_match[3])); + player2Rating = string_to_rating(star_match[4]); + + if (appData.debugMode) + fprintf(debugFP, + "Ratings from 'Creating:' %s %d, %s %d\n", + player1Name, player1Rating, + player2Name, player2Rating); + + continue; + } + + /* Improved generic start/end-of-game messages */ + if ((tkind=0, looking_at(buf, &i, "{Game * (* vs. *) *}*")) || + (tkind=1, looking_at(buf, &i, "{Game * (*(*) vs. *(*)) *}*"))){ + /* If tkind == 0: */ + /* star_match[0] is the game number */ + /* [1] is the white player's name */ + /* [2] is the black player's name */ + /* For end-of-game: */ + /* [3] is the reason for the game end */ + /* [4] is a PGN end game-token, preceded by " " */ + /* For start-of-game: */ + /* [3] begins with "Creating" or "Continuing" */ + /* [4] is " *" or empty (don't care). */ + int gamenum = atoi(star_match[0]); + char *whitename, *blackname, *why, *endtoken; + ChessMove endtype = (ChessMove) 0; + + if (tkind == 0) { + whitename = star_match[1]; + blackname = star_match[2]; + why = star_match[3]; + endtoken = star_match[4]; + } else { + whitename = star_match[1]; + blackname = star_match[3]; + why = star_match[5]; + endtoken = star_match[6]; + } + + /* Game start messages */ + if (strncmp(why, "Creating ", 9) == 0 || + strncmp(why, "Continuing ", 11) == 0) { + gs_gamenum = gamenum; + strcpy(gs_kind, strchr(why, ' ') + 1); + #if ZIPPY + if (appData.zippyPlay) { + ZippyGameStart(whitename, blackname); + } + #endif /*ZIPPY*/ + continue; + } + + /* Game end messages */ + if (gameMode == IcsIdle || gameMode == BeginningOfGame || + ics_gamenum != gamenum) { + continue; + } + while (endtoken[0] == ' ') endtoken++; + switch (endtoken[0]) { + case '*': + default: + endtype = GameUnfinished; + break; + case '0': + endtype = BlackWins; + break; + case '1': + if (endtoken[1] == '/') + endtype = GameIsDrawn; + else + endtype = WhiteWins; + break; + } + GameEnds(endtype, why, GE_ICS); + #if ZIPPY + if (appData.zippyPlay && first.initDone) { + ZippyGameEnd(endtype, why); + if (first.pr == NULL) { + /* Start the next process early so that we'll + be ready for the next challenge */ + StartChessProgram(&first); + } + /* Send "new" early, in case this command takes + a long time to finish, so that we'll be ready + for the next challenge. */ + gameInfo.variant = VariantNormal; // [HGM] variantswitch: suppress sending of 'variant' + Reset(TRUE, TRUE); + } + #endif /*ZIPPY*/ + continue; + } + + if (looking_at(buf, &i, "Removing game * from observation") || + looking_at(buf, &i, "no longer observing game *") || + looking_at(buf, &i, "Game * (*) has no examiners")) { + if (gameMode == IcsObserving && + atoi(star_match[0]) == ics_gamenum) + { ++ /* icsEngineAnalyze */ ++ if (appData.icsEngineAnalyze) { ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ } + StopClocks(); + gameMode = IcsIdle; + ics_gamenum = -1; + ics_user_moved = FALSE; + } + continue; + } + + if (looking_at(buf, &i, "no longer examining game *")) { + if (gameMode == IcsExamining && + atoi(star_match[0]) == ics_gamenum) + { + gameMode = IcsIdle; + ics_gamenum = -1; + ics_user_moved = FALSE; + } + continue; + } + + /* Advance leftover_start past any newlines we find, + so only partial lines can get reparsed */ + if (looking_at(buf, &i, "\n")) { + prevColor = curColor; + if (curColor != ColorNormal) { + if (oldi > next_out) { + SendToPlayer(&buf[next_out], oldi - next_out); + next_out = oldi; + } + Colorize(ColorNormal, FALSE); + curColor = ColorNormal; + } + if (started == STARTED_BOARD) { + started = STARTED_NONE; + parse[parse_pos] = NULLCHAR; + ParseBoard12(parse); + ics_user_moved = 0; + + /* Send premove here */ + if (appData.premove) { + char str[MSG_SIZ]; + if (currentMove == 0 && + gameMode == IcsPlayingWhite && + appData.premoveWhite) { + sprintf(str, "%s%s\n", ics_prefix, + appData.premoveWhiteText); + if (appData.debugMode) + fprintf(debugFP, "Sending premove:\n"); + SendToICS(str); + } else if (currentMove == 1 && + gameMode == IcsPlayingBlack && + appData.premoveBlack) { + sprintf(str, "%s%s\n", ics_prefix, + appData.premoveBlackText); + if (appData.debugMode) + fprintf(debugFP, "Sending premove:\n"); + SendToICS(str); + } else if (gotPremove) { + gotPremove = 0; + ClearPremoveHighlights(); + if (appData.debugMode) + fprintf(debugFP, "Sending premove:\n"); + UserMoveEvent(premoveFromX, premoveFromY, + premoveToX, premoveToY, + premovePromoChar); + } + } + + /* Usually suppress following prompt */ + if (!(forwardMostMove == 0 && gameMode == IcsExamining)) { + if (looking_at(buf, &i, "*% ")) { + savingComment = FALSE; + } + } + next_out = i; + } else if (started == STARTED_HOLDINGS) { + int gamenum; + char new_piece[MSG_SIZ]; + started = STARTED_NONE; + parse[parse_pos] = NULLCHAR; + if (appData.debugMode) + fprintf(debugFP, "Parsing holdings: %s, currentMove = %d\n", + parse, currentMove); + if (sscanf(parse, " game %d", &gamenum) == 1 && + gamenum == ics_gamenum) { + if (gameInfo.variant == VariantNormal) { + /* [HGM] We seem to switch variant during a game! + * Presumably no holdings were displayed, so we have + * to move the position two files to the right to + * create room for them! + */ + VariantSwitch(boards[currentMove], VariantCrazyhouse); /* temp guess */ + /* Get a move list just to see the header, which + will tell us whether this is really bug or zh */ + if (ics_getting_history == H_FALSE) { + ics_getting_history = H_REQUESTED; + sprintf(str, "%smoves %d\n", ics_prefix, gamenum); + SendToICS(str); + } + } + new_piece[0] = NULLCHAR; + sscanf(parse, "game %d white [%s black [%s <- %s", + &gamenum, white_holding, black_holding, + new_piece); + white_holding[strlen(white_holding)-1] = NULLCHAR; + black_holding[strlen(black_holding)-1] = NULLCHAR; + /* [HGM] copy holdings to board holdings area */ + CopyHoldings(boards[currentMove], white_holding, WhitePawn); + CopyHoldings(boards[currentMove], black_holding, BlackPawn); + #if ZIPPY + if (appData.zippyPlay && first.initDone) { + ZippyHoldings(white_holding, black_holding, + new_piece); + } + #endif /*ZIPPY*/ + if (tinyLayout || smallLayout) { + char wh[16], bh[16]; + PackHolding(wh, white_holding); + PackHolding(bh, black_holding); + sprintf(str, "[%s-%s] %s-%s", wh, bh, + gameInfo.white, gameInfo.black); + } else { + sprintf(str, "%s [%s] vs. %s [%s]", + gameInfo.white, white_holding, + gameInfo.black, black_holding); + } + + DrawPosition(FALSE, boards[currentMove]); + DisplayTitle(str); + } + /* Suppress following prompt */ + if (looking_at(buf, &i, "*% ")) { + savingComment = FALSE; + } + next_out = i; + } + continue; + } + + i++; /* skip unparsed character and loop back */ + } + + if (started != STARTED_MOVES && started != STARTED_BOARD && !suppressKibitz && // [HGM] kibitz suppress printing in ICS interaction window + started != STARTED_HOLDINGS && i > next_out) { + SendToPlayer(&buf[next_out], i - next_out); + next_out = i; + } + suppressKibitz = FALSE; // [HGM] kibitz: has done its duty in if-statement above + + leftover_len = buf_len - leftover_start; + /* if buffer ends with something we couldn't parse, + reparse it after appending the next read */ + + } else if (count == 0) { + RemoveInputSource(isr); - DisplayFatalError("Connection closed by ICS", 0, 0); ++ DisplayFatalError(_("Connection closed by ICS"), 0, 0); + } else { - DisplayFatalError("Error reading from ICS", error, 1); ++ DisplayFatalError(_("Error reading from ICS"), error, 1); + } + } + + + /* Board style 12 looks like this: + + <12> r-b---k- pp----pp ---bP--- ---p---- q------- ------P- P--Q--BP -----R-K W -1 0 0 0 0 0 0 paf MaxII 0 2 12 21 25 234 174 24 Q/d7-a4 (0:06) Qxa4 0 0 + + * The "<12> " is stripped before it gets to this routine. The two + * trailing 0's (flip state and clock ticking) are later addition, and + * some chess servers may not have them, or may have only the first. + * Additional trailing fields may be added in the future. + */ + + #define PATTERN "%c%d%d%d%d%d%d%d%s%s%d%d%d%d%d%d%d%d%s%s%s%d%d" + + #define RELATION_OBSERVING_PLAYED 0 + #define RELATION_OBSERVING_STATIC -2 /* examined, oldmoves, or smoves */ + #define RELATION_PLAYING_MYMOVE 1 + #define RELATION_PLAYING_NOTMYMOVE -1 + #define RELATION_EXAMINING 2 + #define RELATION_ISOLATED_BOARD -3 + #define RELATION_STARTING_POSITION -4 /* FICS only */ + + void + ParseBoard12(string) + char *string; + { + GameMode newGameMode; - int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0; - int j, k, n, moveNum, white_stren, black_stren, white_time, black_time; ++ int gamenum, newGame, newMove, relation, basetime, increment, ics_flip = 0, i; ++ int j, k, n, moveNum, white_stren, black_stren, white_time, black_time, takeback; + int double_push, castle_ws, castle_wl, castle_bs, castle_bl, irrev_count; + char to_play, board_chars[200]; + char move_str[500], str[500], elapsed_time[500]; + char black[32], white[32]; + Board board; + int prevMove = currentMove; + int ticking = 2; + ChessMove moveType; + int fromX, fromY, toX, toY; + char promoChar; + int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ + char *bookHit = NULL; // [HGM] book + + fromX = fromY = toX = toY = -1; + + newGame = FALSE; + + if (appData.debugMode) - fprintf(debugFP, "Parsing board: %s\n", string); ++ fprintf(debugFP, _("Parsing board: %s\n"), string); + + move_str[0] = NULLCHAR; + elapsed_time[0] = NULLCHAR; + { /* [HGM] figure out how many ranks and files the board has, for ICS extension used by Capablanca server */ + int i = 0, j; + while(i < 199 && (string[i] != ' ' || string[i+2] != ' ')) { + if(string[i] == ' ') { ranks++; files = 0; } + else files++; + i++; + } + for(j = 0; j = MAX_MOVES) { - DisplayFatalError("Game too long; increase MAX_MOVES and recompile", ++ DisplayFatalError(_("Game too long; increase MAX_MOVES and recompile"), + 0, 1); + return; + } + + switch (relation) { + case RELATION_OBSERVING_PLAYED: + case RELATION_OBSERVING_STATIC: + if (gamenum == -1) { + /* Old ICC buglet */ + relation = RELATION_OBSERVING_STATIC; + } + newGameMode = IcsObserving; + break; + case RELATION_PLAYING_MYMOVE: + case RELATION_PLAYING_NOTMYMOVE: + newGameMode = + ((relation == RELATION_PLAYING_MYMOVE) == (to_play == 'W')) ? + IcsPlayingWhite : IcsPlayingBlack; + break; + case RELATION_EXAMINING: + newGameMode = IcsExamining; + break; + case RELATION_ISOLATED_BOARD: + default: + /* Just display this board. If user was doing something else, + we will forget about it until the next board comes. */ + newGameMode = IcsIdle; + break; + case RELATION_STARTING_POSITION: + newGameMode = gameMode; + break; + } + + /* Modify behavior for initial board display on move listing + of wild games. + */ + switch (ics_getting_history) { + case H_FALSE: + case H_REQUESTED: + break; + case H_GOT_REQ_HEADER: + case H_GOT_UNREQ_HEADER: + /* This is the initial position of the current game */ + gamenum = ics_gamenum; + moveNum = 0; /* old ICS bug workaround */ + if (to_play == 'B') { + startedFromSetupPosition = TRUE; + blackPlaysFirst = TRUE; + moveNum = 1; + if (forwardMostMove == 0) forwardMostMove = 1; + if (backwardMostMove == 0) backwardMostMove = 1; + if (currentMove == 0) currentMove = 1; + } + newGameMode = gameMode; + relation = RELATION_STARTING_POSITION; /* ICC needs this */ + break; + case H_GOT_UNWANTED_HEADER: + /* This is an initial board that we don't want */ + return; + case H_GETTING_MOVES: + /* Should not happen */ - DisplayError("Error gathering move list: extra board", 0); ++ DisplayError(_("Error gathering move list: extra board"), 0); + ics_getting_history = H_FALSE; + return; + } + + /* Take action if this is the first board of a new game, or of a + different game than is currently being displayed. */ + if (gamenum != ics_gamenum || newGameMode != gameMode || + relation == RELATION_ISOLATED_BOARD) { + + /* Forget the old game and get the history (if any) of the new one */ + if (gameMode != BeginningOfGame) { + Reset(FALSE, TRUE); + } + newGame = TRUE; + if (appData.autoRaiseBoard) BoardToTop(); + prevMove = -3; + if (gamenum == -1) { + newGameMode = IcsIdle; + } else if (moveNum > 0 && newGameMode != IcsIdle && + appData.getMoveList) { + /* Need to get game history */ + ics_getting_history = H_REQUESTED; + sprintf(str, "%smoves %d\n", ics_prefix, gamenum); + SendToICS(str); + } + + /* Initially flip the board to have black on the bottom if playing + black or if the ICS flip flag is set, but let the user change + it with the Flip View button. */ + flipView = appData.autoFlipView ? + (newGameMode == IcsPlayingBlack) || ics_flip : + appData.flipView; + + /* Done with values from previous mode; copy in new ones */ + gameMode = newGameMode; + ModeHighlight(); + ics_gamenum = gamenum; + if (gamenum == gs_gamenum) { + int klen = strlen(gs_kind); + if (gs_kind[klen - 1] == '.') gs_kind[klen - 1] = NULLCHAR; + sprintf(str, "ICS %s", gs_kind); + gameInfo.event = StrSave(str); + } else { + gameInfo.event = StrSave("ICS game"); + } + gameInfo.site = StrSave(appData.icsHost); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave(white); + gameInfo.black = StrSave(black); + timeControl = basetime * 60 * 1000; + timeControl_2 = 0; + timeIncrement = increment * 1000; + movesPerSession = 0; + gameInfo.timeControl = TimeControlTagValue(); + VariantSwitch(board, StringToVariant(gameInfo.event) ); + if (appData.debugMode) { + fprintf(debugFP, "ParseBoard says variant = '%s'\n", gameInfo.event); + fprintf(debugFP, "recognized as %s\n", VariantName(gameInfo.variant)); + setbuf(debugFP, NULL); + } + + gameInfo.outOfBook = NULL; + + /* Do we have the ratings? */ + if (strcmp(player1Name, white) == 0 && + strcmp(player2Name, black) == 0) { + if (appData.debugMode) + fprintf(debugFP, "Remembered ratings: W %d, B %d\n", + player1Rating, player2Rating); + gameInfo.whiteRating = player1Rating; + gameInfo.blackRating = player2Rating; + } else if (strcmp(player2Name, white) == 0 && + strcmp(player1Name, black) == 0) { + if (appData.debugMode) + fprintf(debugFP, "Remembered ratings: W %d, B %d\n", + player2Rating, player1Rating); + gameInfo.whiteRating = player2Rating; + gameInfo.blackRating = player1Rating; + } + player1Name[0] = player2Name[0] = NULLCHAR; + + /* Silence shouts if requested */ + if (appData.quietPlay && + (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack)) { + SendToICS(ics_prefix); + SendToICS("set shout 0\n"); + } + } + + /* Deal with midgame name changes */ + if (!newGame) { + if (!gameInfo.white || strcmp(gameInfo.white, white) != 0) { + if (gameInfo.white) free(gameInfo.white); + gameInfo.white = StrSave(white); + } + if (!gameInfo.black || strcmp(gameInfo.black, black) != 0) { + if (gameInfo.black) free(gameInfo.black); + gameInfo.black = StrSave(black); + } + } + + /* Throw away game result if anything actually changes in examine mode */ + if (gameMode == IcsExamining && !newGame) { + gameInfo.result = GameUnfinished; + if (gameInfo.resultDetails != NULL) { + free(gameInfo.resultDetails); + gameInfo.resultDetails = NULL; + } + } + + /* In pausing && IcsExamining mode, we ignore boards coming + in if they are in a different variation than we are. */ + if (pauseExamInvalid) return; + if (pausing && gameMode == IcsExamining) { + if (moveNum <= pauseExamForwardMostMove) { + pauseExamInvalid = TRUE; + forwardMostMove = pauseExamForwardMostMove; + return; + } + } + + if (appData.debugMode) { + fprintf(debugFP, "load %dx%d board\n", files, ranks); + } + /* Parse the board */ + for (k = 0; k < ranks; k++) { + for (j = 0; j < files; j++) + board[k][j+gameInfo.holdingsWidth] = CharToPiece(board_chars[(ranks-1-k)*(files+1) + j]); + if(gameInfo.holdingsWidth > 1) { + board[k][0] = board[k][BOARD_WIDTH-1] = EmptySquare; + board[k][1] = board[k][BOARD_WIDTH-2] = (ChessSquare) 0;; + } + } + CopyBoard(boards[moveNum], board); + if (moveNum == 0) { + startedFromSetupPosition = + !CompareBoards(board, initialPosition); + if(startedFromSetupPosition) + initialRulePlies = irrev_count; /* [HGM] 50-move counter offset */ + } + + /* [HGM] Set castling rights. Take the outermost Rooks, + to make it also work for FRC opening positions. Note that board12 + is really defective for later FRC positions, as it has no way to + indicate which Rook can castle if they are on the same side of King. + For the initial position we grant rights to the outermost Rooks, + and remember thos rights, and we then copy them on positions + later in an FRC game. This means WB might not recognize castlings with + Rooks that have moved back to their original position as illegal, + but in ICS mode that is not its job anyway. + */ + if(moveNum == 0 || gameInfo.variant != VariantFischeRandom) + { int i, j; ChessSquare wKing = WhiteKing, bKing = BlackKing; + + for(i=BOARD_LEFT, j= -1; i=BOARD_LEFT; i--) + if(board[0][i] == WhiteRook) j = i; + initialRights[1] = castlingRights[moveNum][1] = (castle_wl == 0 && gameInfo.variant != VariantFischeRandom ? -1 : j); + for(i=BOARD_LEFT, j= -1; i=BOARD_LEFT; i--) + if(board[BOARD_HEIGHT-1][i] == BlackRook) j = i; + initialRights[4] = castlingRights[moveNum][4] = (castle_bl == 0 && gameInfo.variant != VariantFischeRandom ? -1 : j); + + if(gameInfo.variant == VariantKnightmate) { wKing = WhiteUnicorn; bKing = BlackUnicorn; } + for(k=BOARD_LEFT; k forwardMostMove; ++ ++ /* [DM] If we found takebacks during icsEngineAnalyze try send to engine */ ++ if (!newGame && appData.icsEngineAnalyze && moveNum < forwardMostMove) { ++ takeback = forwardMostMove - moveNum; ++ for (i = 0; i < takeback; i++) { ++ if (appData.debugMode) fprintf(debugFP, "take back move\n"); ++ SendToProgram("undo\n", &first); ++ } ++ } ++ + if (newGame) { + forwardMostMove = backwardMostMove = currentMove = moveNum; + if (gameMode == IcsExamining && moveNum == 0) { + /* Workaround for ICS limitation: we are not told the wild + type when starting to examine a game. But if we ask for + the move list, the move list header will tell us */ + ics_getting_history = H_REQUESTED; + sprintf(str, "%smoves %d\n", ics_prefix, gamenum); + SendToICS(str); + } + } else if (moveNum == forwardMostMove + 1 || moveNum == forwardMostMove + || (moveNum < forwardMostMove && moveNum >= backwardMostMove)) { + forwardMostMove = moveNum; + if (!pausing || currentMove > forwardMostMove) + currentMove = forwardMostMove; + } else { + /* New part of history that is not contiguous with old part */ + if (pausing && gameMode == IcsExamining) { + pauseExamInvalid = TRUE; + forwardMostMove = pauseExamForwardMostMove; + return; + } + forwardMostMove = backwardMostMove = currentMove = moveNum; + if (gameMode == IcsExamining && moveNum > 0 && appData.getMoveList) { + ics_getting_history = H_REQUESTED; + sprintf(str, "%smoves %d\n", ics_prefix, gamenum); + SendToICS(str); + } + } + + /* Update the clocks */ + if (strchr(elapsed_time, '.')) { + /* Time is in ms */ + timeRemaining[0][moveNum] = whiteTimeRemaining = white_time; + timeRemaining[1][moveNum] = blackTimeRemaining = black_time; + } else { + /* Time is in seconds */ + timeRemaining[0][moveNum] = whiteTimeRemaining = white_time * 1000; + timeRemaining[1][moveNum] = blackTimeRemaining = black_time * 1000; + } + + + #if ZIPPY + if (appData.zippyPlay && newGame && + gameMode != IcsObserving && gameMode != IcsIdle && + gameMode != IcsExamining) + ZippyFirstBoard(moveNum, basetime, increment); + #endif + + /* Put the move on the move list, first converting + to canonical algebraic form. */ + if (moveNum > 0) { + if (appData.debugMode) { + if (appData.debugMode) { int f = forwardMostMove; + fprintf(debugFP, "parseboard %d, castling = %d %d %d %d %d %d\n", f, + castlingRights[f][0],castlingRights[f][1],castlingRights[f][2],castlingRights[f][3],castlingRights[f][4],castlingRights[f][5]); + } + fprintf(debugFP, "accepted move %s from ICS, parse it.\n", move_str); + fprintf(debugFP, "moveNum = %d\n", moveNum); + fprintf(debugFP, "board = %d-%d x %d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT); + setbuf(debugFP, NULL); + } + if (moveNum <= backwardMostMove) { + /* We don't know what the board looked like before + this move. Punt. */ + strcpy(parseList[moveNum - 1], move_str); + strcat(parseList[moveNum - 1], " "); + strcat(parseList[moveNum - 1], elapsed_time); + moveList[moveNum - 1][0] = NULLCHAR; + } else if (strcmp(move_str, "none") == 0) { + // [HGM] long SAN: swapped order; test for 'none' before parsing move + /* Again, we don't know what the board looked like; + this is really the start of the game. */ + parseList[moveNum - 1][0] = NULLCHAR; + moveList[moveNum - 1][0] = NULLCHAR; + backwardMostMove = moveNum; + startedFromSetupPosition = TRUE; + fromX = fromY = toX = toY = -1; + } else { + // [HGM] long SAN: if legality-testing is off, disambiguation might not work or give wrong move. + // So we parse the long-algebraic move string in stead of the SAN move + int valid; char buf[MSG_SIZ], *prom; + + // str looks something like "Q/a1-a2"; kill the slash + if(str[1] == '/') + sprintf(buf, "%c%s", str[0], str+2); + else strcpy(buf, str); // might be castling + if((prom = strstr(move_str, "=")) && !strstr(buf, "=")) + strcat(buf, prom); // long move lacks promo specification! + if(!appData.testLegality) { + if(appData.debugMode) + fprintf(debugFP, "replaced ICS move '%s' by '%s'\n", move_str, buf); + strcpy(move_str, buf); + } + valid = ParseOneMove(move_str, moveNum - 1, &moveType, + &fromX, &fromY, &toX, &toY, &promoChar) + || ParseOneMove(buf, moveNum - 1, &moveType, + &fromX, &fromY, &toX, &toY, &promoChar); + // end of long SAN patch + if (valid) { + (void) CoordsToAlgebraic(boards[moveNum - 1], + PosFlags(moveNum - 1), EP_UNKNOWN, + fromY, fromX, toY, toX, promoChar, + parseList[moveNum-1]); + switch (MateTest(boards[moveNum], PosFlags(moveNum), EP_UNKNOWN, + castlingRights[moveNum]) ) { + case MT_NONE: + case MT_STALEMATE: + default: + break; + case MT_CHECK: + if(gameInfo.variant != VariantShogi) + strcat(parseList[moveNum - 1], "+"); + break; + case MT_CHECKMATE: + strcat(parseList[moveNum - 1], "#"); + break; + } + strcat(parseList[moveNum - 1], " "); + strcat(parseList[moveNum - 1], elapsed_time); + /* currentMoveString is set as a side-effect of ParseOneMove */ + strcpy(moveList[moveNum - 1], currentMoveString); + strcat(moveList[moveNum - 1], "\n"); + } else { + /* Move from ICS was illegal!? Punt. */ + if (appData.debugMode) { + fprintf(debugFP, "Illegal move from ICS '%s'\n", move_str); + fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); + } + #if 0 + if (appData.testLegality && appData.debugMode) { + sprintf(str, "Illegal move \"%s\" from ICS", move_str); + DisplayError(str, 0); + } + #endif + strcpy(parseList[moveNum - 1], move_str); + strcat(parseList[moveNum - 1], " "); + strcat(parseList[moveNum - 1], elapsed_time); + moveList[moveNum - 1][0] = NULLCHAR; + fromX = fromY = toX = toY = -1; + } + } + if (appData.debugMode) { + fprintf(debugFP, "Move parsed to '%s'\n", parseList[moveNum - 1]); + setbuf(debugFP, NULL); + } + + #if ZIPPY + /* Send move to chess program (BEFORE animating it). */ + if (appData.zippyPlay && !newGame && newMove && + (!appData.getMoveList || backwardMostMove == 0) && first.initDone) { + + if ((gameMode == IcsPlayingWhite && WhiteOnMove(moveNum)) || + (gameMode == IcsPlayingBlack && !WhiteOnMove(moveNum))) { + if (moveList[moveNum - 1][0] == NULLCHAR) { - sprintf(str, "Couldn't parse move \"%s\" from ICS", ++ sprintf(str, _("Couldn't parse move \"%s\" from ICS"), + move_str); + DisplayError(str, 0); + } else { + if (first.sendTime) { + SendTimeRemaining(&first, gameMode == IcsPlayingWhite); + } + bookHit = SendMoveToBookUser(moveNum - 1, &first, FALSE); // [HGM] book + if (firstMove && !bookHit) { + firstMove = FALSE; + if (first.useColors) { + SendToProgram(gameMode == IcsPlayingWhite ? + "white\ngo\n" : + "black\ngo\n", &first); + } else { + SendToProgram("go\n", &first); + } + first.maybeThinking = TRUE; + } + } + } else if (gameMode == IcsObserving || gameMode == IcsExamining) { + if (moveList[moveNum - 1][0] == NULLCHAR) { - sprintf(str, "Couldn't parse move \"%s\" from ICS", move_str); ++ sprintf(str, _("Couldn't parse move \"%s\" from ICS"), move_str); + DisplayError(str, 0); + } else { + if(gameInfo.variant == currentlyInitializedVariant) // [HGM] refrain sending moves engine can't understand! + SendMoveToProgram(moveNum - 1, &first); + } + } + } + #endif + } + + if (moveNum > 0 && !gotPremove) { + /* If move comes from a remote source, animate it. If it + isn't remote, it will have already been animated. */ + if (!pausing && !ics_user_moved && prevMove == moveNum - 1) { + AnimateMove(boards[moveNum - 1], fromX, fromY, toX, toY); + } + if (!pausing && appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } + } + + /* Start the clocks */ + whiteFlag = blackFlag = FALSE; + appData.clockMode = !(basetime == 0 && increment == 0); + if (ticking == 0) { + ics_clock_paused = TRUE; + StopClocks(); + } else if (ticking == 1) { + ics_clock_paused = FALSE; + } + if (gameMode == IcsIdle || + relation == RELATION_OBSERVING_STATIC || + relation == RELATION_EXAMINING || + ics_clock_paused) + DisplayBothClocks(); + else + StartClocks(); + + /* Display opponents and material strengths */ + if (gameInfo.variant != VariantBughouse && + gameInfo.variant != VariantCrazyhouse) { + if (tinyLayout || smallLayout) { + if(gameInfo.variant == VariantNormal) + sprintf(str, "%s(%d) %s(%d) {%d %d}", + gameInfo.white, white_stren, gameInfo.black, black_stren, + basetime, increment); + else + sprintf(str, "%s(%d) %s(%d) {%d %d w%d}", + gameInfo.white, white_stren, gameInfo.black, black_stren, + basetime, increment, (int) gameInfo.variant); + } else { + if(gameInfo.variant == VariantNormal) + sprintf(str, "%s (%d) vs. %s (%d) {%d %d}", + gameInfo.white, white_stren, gameInfo.black, black_stren, + basetime, increment); + else + sprintf(str, "%s (%d) vs. %s (%d) {%d %d %s}", + gameInfo.white, white_stren, gameInfo.black, black_stren, + basetime, increment, VariantName(gameInfo.variant)); + } + DisplayTitle(str); + if (appData.debugMode) { + fprintf(debugFP, "Display title '%s, gameInfo.variant = %d'\n", str, gameInfo.variant); + } + } + + + /* Display the board */ + if (!pausing) { + + if (appData.premove) + if (!gotPremove || + ((gameMode == IcsPlayingWhite) && (WhiteOnMove(currentMove))) || + ((gameMode == IcsPlayingBlack) && (!WhiteOnMove(currentMove)))) + ClearPremoveHighlights(); + + DrawPosition(FALSE, boards[currentMove]); + DisplayMove(moveNum - 1); + if (appData.ringBellAfterMoves && !ics_user_moved) + RingBell(); + } + + HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); + #if ZIPPY + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + #endif + } + + void + GetMoveListEvent() + { + char buf[MSG_SIZ]; + if (appData.icsActive && gameMode != IcsIdle && ics_gamenum > 0) { + ics_getting_history = H_REQUESTED; + sprintf(buf, "%smoves %d\n", ics_prefix, ics_gamenum); + SendToICS(buf); + } + } + + void + AnalysisPeriodicEvent(force) + int force; + { + if (((programStats.ok_to_send == 0 || programStats.line_is_book) + && !force) || !appData.periodicUpdates) + return; + + /* Send . command to Crafty to collect stats */ + SendToProgram(".\n", &first); + + /* Don't send another until we get a response (this makes + us stop sending to old Crafty's which don't understand + the "." command (sending illegal cmds resets node count & time, + which looks bad)) */ + programStats.ok_to_send = 0; + } + + void + SendMoveToProgram(moveNum, cps) + int moveNum; + ChessProgramState *cps; + { + char buf[MSG_SIZ]; + + if (cps->useUsermove) { + SendToProgram("usermove ", cps); + } + if (cps->useSAN) { + char *space; + if ((space = strchr(parseList[moveNum], ' ')) != NULL) { + int len = space - parseList[moveNum]; + memcpy(buf, parseList[moveNum], len); + buf[len++] = '\n'; + buf[len] = NULLCHAR; + } else { + sprintf(buf, "%s\n", parseList[moveNum]); + } + SendToProgram(buf, cps); + } else { + if(cps->alphaRank) { /* [HGM] shogi: temporarily convert to shogi coordinates before sending */ + AlphaRank(moveList[moveNum], 4); + SendToProgram(moveList[moveNum], cps); + AlphaRank(moveList[moveNum], 4); // and back + } else + /* Added by Tord: Send castle moves in "O-O" in FRC games if required by + * the engine. It would be nice to have a better way to identify castle + * moves here. */ + if((gameInfo.variant == VariantFischeRandom || gameInfo.variant == VariantCapaRandom) + && cps->useOOCastle) { + int fromX = moveList[moveNum][0] - AAA; + int fromY = moveList[moveNum][1] - ONE; + int toX = moveList[moveNum][2] - AAA; + int toY = moveList[moveNum][3] - ONE; + if((boards[moveNum][fromY][fromX] == WhiteKing + && boards[moveNum][toY][toX] == WhiteRook) + || (boards[moveNum][fromY][fromX] == BlackKing + && boards[moveNum][toY][toX] == BlackRook)) { + if(toX > fromX) SendToProgram("O-O\n", cps); + else SendToProgram("O-O-O\n", cps); + } + else SendToProgram(moveList[moveNum], cps); + } + else SendToProgram(moveList[moveNum], cps); + /* End of additions by Tord */ + } + + /* [HGM] setting up the opening has brought engine in force mode! */ + /* Send 'go' if we are in a mode where machine should play. */ + if( (moveNum == 0 && setboardSpoiledMachineBlack && cps == &first) && + (gameMode == TwoMachinesPlay || + #ifdef ZIPPY + gameMode == IcsPlayingBlack || gameMode == IcsPlayingWhite || + #endif + gameMode == MachinePlaysBlack || gameMode == MachinePlaysWhite) ) { + SendToProgram("go\n", cps); + if (appData.debugMode) { + fprintf(debugFP, "(extra)\n"); + } + } + setboardSpoiledMachineBlack = 0; + } + + void + SendMoveToICS(moveType, fromX, fromY, toX, toY) + ChessMove moveType; + int fromX, fromY, toX, toY; + { + char user_move[MSG_SIZ]; + + switch (moveType) { + default: - sprintf(user_move, "say Internal error; bad moveType %d (%d,%d-%d,%d)", ++ sprintf(user_move, _("say Internal error; bad moveType %d (%d,%d-%d,%d)"), + (int)moveType, fromX, fromY, toX, toY); + DisplayError(user_move + strlen("say "), 0); + break; + case WhiteKingSideCastle: + case BlackKingSideCastle: + case WhiteQueenSideCastleWild: + case BlackQueenSideCastleWild: + /* PUSH Fabien */ + case WhiteHSideCastleFR: + case BlackHSideCastleFR: + /* POP Fabien */ + sprintf(user_move, "o-o\n"); + break; + case WhiteQueenSideCastle: + case BlackQueenSideCastle: + case WhiteKingSideCastleWild: + case BlackKingSideCastleWild: + /* PUSH Fabien */ + case WhiteASideCastleFR: + case BlackASideCastleFR: + /* POP Fabien */ + sprintf(user_move, "o-o-o\n"); + break; + case WhitePromotionQueen: + case BlackPromotionQueen: + case WhitePromotionRook: + case BlackPromotionRook: + case WhitePromotionBishop: + case BlackPromotionBishop: + case WhitePromotionKnight: + case BlackPromotionKnight: + case WhitePromotionKing: + case BlackPromotionKing: + case WhitePromotionChancellor: + case BlackPromotionChancellor: + case WhitePromotionArchbishop: + case BlackPromotionArchbishop: + if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) + sprintf(user_move, "%c%c%c%c=%c\n", + AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, + PieceToChar(WhiteFerz)); + else if(gameInfo.variant == VariantGreat) + sprintf(user_move, "%c%c%c%c=%c\n", + AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, + PieceToChar(WhiteMan)); + else + sprintf(user_move, "%c%c%c%c=%c\n", + AAA + fromX, ONE + fromY, AAA + toX, ONE + toY, + PieceToChar(PromoPiece(moveType))); + break; + case WhiteDrop: + case BlackDrop: + sprintf(user_move, "%c@%c%c\n", + ToUpper(PieceToChar((ChessSquare) fromX)), + AAA + toX, ONE + toY); + break; + case NormalMove: + case WhiteCapturesEnPassant: + case BlackCapturesEnPassant: + case IllegalMove: /* could be a variant we don't quite understand */ + sprintf(user_move, "%c%c%c%c\n", + AAA + fromX, ONE + fromY, AAA + toX, ONE + toY); + break; + } + SendToICS(user_move); + } + + void + CoordsToComputerAlgebraic(rf, ff, rt, ft, promoChar, move) + int rf, ff, rt, ft; + char promoChar; + char move[7]; + { + if (rf == DROP_RANK) { + sprintf(move, "%c@%c%c\n", + ToUpper(PieceToChar((ChessSquare) ff)), AAA + ft, ONE + rt); + } else { + if (promoChar == 'x' || promoChar == NULLCHAR) { + sprintf(move, "%c%c%c%c\n", + AAA + ff, ONE + rf, AAA + ft, ONE + rt); + } else { + sprintf(move, "%c%c%c%c%c\n", + AAA + ff, ONE + rf, AAA + ft, ONE + rt, promoChar); + } + } + } + + void + ProcessICSInitScript(f) + FILE *f; + { + char buf[MSG_SIZ]; + + while (fgets(buf, MSG_SIZ, f)) { + SendToICSDelayed(buf,(long)appData.msLoginDelay); + } + + fclose(f); + } + + + /* [HGM] Shogi move preprocessor: swap digits for letters, vice versa */ + void + AlphaRank(char *move, int n) + { + char *p = move, c; int x, y; + + if (appData.debugMode) { + fprintf(debugFP, "alphaRank(%s,%d)\n", move, n); + } + + if(move[1]=='*' && + move[2]>='0' && move[2]<='9' && + move[3]>='a' && move[3]<='x' ) { + move[1] = '@'; + move[2] = BOARD_RGHT -1 - (move[2]-'1') + AAA; + move[3] = BOARD_HEIGHT-1 - (move[3]-'a') + ONE; + } else + if(move[0]>='0' && move[0]<='9' && + move[1]>='a' && move[1]<='x' && + move[2]>='0' && move[2]<='9' && + move[3]>='a' && move[3]<='x' ) { + /* input move, Shogi -> normal */ + move[0] = BOARD_RGHT -1 - (move[0]-'1') + AAA; + move[1] = BOARD_HEIGHT-1 - (move[1]-'a') + ONE; + move[2] = BOARD_RGHT -1 - (move[2]-'1') + AAA; + move[3] = BOARD_HEIGHT-1 - (move[3]-'a') + ONE; + } else + if(move[1]=='@' && + move[3]>='0' && move[3]<='9' && + move[2]>='a' && move[2]<='x' ) { + move[1] = '*'; + move[2] = BOARD_RGHT - 1 - (move[2]-AAA) + '1'; + move[3] = BOARD_HEIGHT-1 - (move[3]-ONE) + 'a'; + } else + if( + move[0]>='a' && move[0]<='x' && + move[3]>='0' && move[3]<='9' && + move[2]>='a' && move[2]<='x' ) { + /* output move, normal -> Shogi */ + move[0] = BOARD_RGHT - 1 - (move[0]-AAA) + '1'; + move[1] = BOARD_HEIGHT-1 - (move[1]-ONE) + 'a'; + move[2] = BOARD_RGHT - 1 - (move[2]-AAA) + '1'; + move[3] = BOARD_HEIGHT-1 - (move[3]-ONE) + 'a'; + if(move[4] == PieceToChar(BlackQueen)) move[4] = '+'; + } + if (appData.debugMode) { + fprintf(debugFP, " out = '%s'\n", move); + } + } + + /* Parser for moves from gnuchess, ICS, or user typein box */ + Boolean + ParseOneMove(move, moveNum, moveType, fromX, fromY, toX, toY, promoChar) + char *move; + int moveNum; + ChessMove *moveType; + int *fromX, *fromY, *toX, *toY; + char *promoChar; + { + if (appData.debugMode) { + fprintf(debugFP, "move to parse: %s\n", move); + } + *moveType = yylexstr(moveNum, move); + + switch (*moveType) { + case WhitePromotionChancellor: + case BlackPromotionChancellor: + case WhitePromotionArchbishop: + case BlackPromotionArchbishop: + case WhitePromotionQueen: + case BlackPromotionQueen: + case WhitePromotionRook: + case BlackPromotionRook: + case WhitePromotionBishop: + case BlackPromotionBishop: + case WhitePromotionKnight: + case BlackPromotionKnight: + case WhitePromotionKing: + case BlackPromotionKing: + case NormalMove: + case WhiteCapturesEnPassant: + case BlackCapturesEnPassant: + case WhiteKingSideCastle: + case WhiteQueenSideCastle: + case BlackKingSideCastle: + case BlackQueenSideCastle: + case WhiteKingSideCastleWild: + case WhiteQueenSideCastleWild: + case BlackKingSideCastleWild: + case BlackQueenSideCastleWild: + /* Code added by Tord: */ + case WhiteHSideCastleFR: + case WhiteASideCastleFR: + case BlackHSideCastleFR: + case BlackASideCastleFR: + /* End of code added by Tord */ + case IllegalMove: /* bug or odd chess variant */ + *fromX = currentMoveString[0] - AAA; + *fromY = currentMoveString[1] - ONE; + *toX = currentMoveString[2] - AAA; + *toY = currentMoveString[3] - ONE; + *promoChar = currentMoveString[4]; + if (*fromX < BOARD_LEFT || *fromX >= BOARD_RGHT || *fromY < 0 || *fromY >= BOARD_HEIGHT || + *toX < BOARD_LEFT || *toX >= BOARD_RGHT || *toY < 0 || *toY >= BOARD_HEIGHT) { + if (appData.debugMode) { + fprintf(debugFP, "Off-board move (%d,%d)-(%d,%d)%c, type = %d\n", *fromX, *fromY, *toX, *toY, *promoChar, *moveType); + } + *fromX = *fromY = *toX = *toY = 0; + return FALSE; + } + if (appData.testLegality) { + return (*moveType != IllegalMove); + } else { + return !(fromX == fromY && toX == toY); + } + + case WhiteDrop: + case BlackDrop: + *fromX = *moveType == WhiteDrop ? + (int) CharToPiece(ToUpper(currentMoveString[0])) : + (int) CharToPiece(ToLower(currentMoveString[0])); + *fromY = DROP_RANK; + *toX = currentMoveString[2] - AAA; + *toY = currentMoveString[3] - ONE; + *promoChar = NULLCHAR; + return TRUE; + + case AmbiguousMove: + case ImpossibleMove: + case (ChessMove) 0: /* end of file */ + case ElapsedTime: + case Comment: + case PGNTag: + case NAG: + case WhiteWins: + case BlackWins: + case GameIsDrawn: + default: + if (appData.debugMode) { + fprintf(debugFP, "Impossible move %s, type = %d\n", currentMoveString, *moveType); + } + /* bug? */ + *fromX = *fromY = *toX = *toY = 0; + *promoChar = NULLCHAR; + return FALSE; + } + } + + /* [AS] FRC game initialization */ + static int FindEmptySquare( Board board, int n ) + { + int i = 0; + + while( 1 ) { + while( board[0][i] != EmptySquare ) i++; + if( n == 0 ) + break; + n--; + i++; + } + + return i; + } + + #if 0 + static void ShuffleFRC( Board board ) + { + int i; + + srand( time(0) ); + + for( i=0; i<8; i++ ) { + board[0][i] = EmptySquare; + } + + board[0][(rand() % 4)*2 ] = WhiteBishop; /* On dark square */ + board[0][(rand() % 4)*2+1] = WhiteBishop; /* On lite square */ + board[0][FindEmptySquare(board, rand() % 6)] = WhiteQueen; + board[0][FindEmptySquare(board, rand() % 5)] = WhiteKnight; + board[0][FindEmptySquare(board, rand() % 4)] = WhiteKnight; + board[0][ i=FindEmptySquare(board, 0) ] = WhiteRook; + initialRights[1] = initialRights[4] = + castlingRights[0][1] = castlingRights[0][4] = i; + board[0][ i=FindEmptySquare(board, 0) ] = WhiteKing; + initialRights[2] = initialRights[5] = + castlingRights[0][2] = castlingRights[0][5] = i; + board[0][ i=FindEmptySquare(board, 0) ] = WhiteRook; + initialRights[0] = initialRights[3] = + castlingRights[0][0] = castlingRights[0][3] = i; + + for( i=BOARD_LEFT; i> 8 ^ random() << 8; + if(seed<0) seed = -seed; + } + } + + int put(Board board, int pieceType, int rank, int n, int shade) + // put the piece on the (n-1)-th empty squares of the given shade + { + int i; + + for(i=BOARD_LEFT; i= j) i -= j--; + j = n - 1 - j; i += j; + put(board, pieceType, rank, j, ANY); + put(board, pieceType, rank, i, ANY); + } + + void SetUpShuffle(Board board, int number) + { + int i, p, first=1; + + GetPositionNumber(); nrOfShuffles = 1; + + squaresLeft[DARK] = (BOARD_RGHT - BOARD_LEFT + 1)/2; + squaresLeft[ANY] = BOARD_RGHT - BOARD_LEFT; + squaresLeft[LITE] = squaresLeft[ANY] - squaresLeft[DARK]; + + for(p = 0; p<=(int)WhiteKing; p++) piecesLeft[p] = 0; + + for(i=BOARD_LEFT; i (int) WhitePawn; p--) { + if(p != (int) WhiteBishop && p != (int) WhiteFerz && p != (int) WhiteAlfil) continue; + while(piecesLeft[p] >= 2) { + AddOnePiece(board, p, 0, LITE); + AddOnePiece(board, p, 0, DARK); + } + // Odd color-bound pieces are shuffled with the rest (to not run out of paired squares) + } + + for(p = (int) WhiteKing - 2; p > (int) WhitePawn; p--) { + // Remaining pieces (non-colorbound, or odd color bound) can be put anywhere + // but we leave King and Rooks for last, to possibly obey FRC restriction + if(p == (int)WhiteRook) continue; + while(piecesLeft[p] >= 2) AddTwoPieces(board, p, 0); // add in pairs, for not counting permutations + if(piecesLeft[p]) AddOnePiece(board, p, 0, ANY); // add the odd piece + } + + // now everything is placed, except perhaps King (Unicorn) and Rooks + + if(PosFlags(0) & F_FRC_TYPE_CASTLING) { + // Last King gets castling rights + while(piecesLeft[(int)WhiteUnicorn]) { + i = put(board, WhiteUnicorn, 0, piecesLeft[(int)WhiteRook]/2, ANY); + initialRights[2] = initialRights[5] = castlingRights[0][2] = castlingRights[0][5] = i; + } + + while(piecesLeft[(int)WhiteKing]) { + i = put(board, WhiteKing, 0, piecesLeft[(int)WhiteRook]/2, ANY); + initialRights[2] = initialRights[5] = castlingRights[0][2] = castlingRights[0][5] = i; + } + + + } else { + while(piecesLeft[(int)WhiteKing]) AddOnePiece(board, WhiteKing, 0, ANY); + while(piecesLeft[(int)WhiteUnicorn]) AddOnePiece(board, WhiteUnicorn, 0, ANY); + } + + // Only Rooks can be left; simply place them all + while(piecesLeft[(int)WhiteRook]) { + i = put(board, WhiteRook, 0, 0, ANY); + if(PosFlags(0) & F_FRC_TYPE_CASTLING) { // first and last Rook get FRC castling rights + if(first) { + first=0; + initialRights[1] = initialRights[4] = castlingRights[0][1] = castlingRights[0][4] = i; + } + initialRights[0] = initialRights[3] = castlingRights[0][0] = castlingRights[0][3] = i; + } + } + for(i=BOARD_LEFT; i= 0) appData.defaultFrcPosition %= nrOfShuffles; // normalize + } + + #endif + + int SetCharTable( char *table, const char * map ) + /* [HGM] moved here from winboard.c because of its general usefulness */ + /* Basically a safe strcpy that uses the last character as King */ + { + int result = FALSE; int NrPieces; + + if( map != NULL && (NrPieces=strlen(map)) <= (int) EmptySquare + && NrPieces >= 12 && !(NrPieces&1)) { + int i; /* [HGM] Accept even length from 12 to 34 */ + + for( i=0; i<(int) EmptySquare; i++ ) table[i] = '.'; + for( i=0; i= j); seed /= 3; + p = board[0][BOARD_LEFT+j]; board[0][BOARD_LEFT+j] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%3; seed /= 3; + p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%2 + (seed%2 >= j); seed /= 2; + p = board[0][BOARD_LEFT+j+5]; board[0][BOARD_LEFT+j+5] = EmptySquare; k = PieceToNumber(p); + board[k][BOARD_WIDTH-1] = p; board[k][BOARD_WIDTH-2]++; + board[BOARD_HEIGHT-1-k][0] = WHITE_TO_BLACK p; board[BOARD_HEIGHT-1-k][1]++; + j = seed%4; seed /= 4; put(board, exoPieces[3], 0, j, ANY); + j = seed%3; seed /= 3; put(board, exoPieces[2], 0, j, ANY); + j = seed%2; seed /= 2; put(board, exoPieces[1], 0, j, ANY); + put(board, exoPieces[0], 0, 0, ANY); + for(i=BOARD_LEFT; i>1; + castlingRights[0][3] = initialRights[3] = BOARD_RGHT-1; + castlingRights[0][4] = initialRights[4] = BOARD_LEFT; + castlingRights[0][5] = initialRights[5] = BOARD_WIDTH-1>>1; + break; + case VariantFalcon: + pieces = FalconArray; + gameInfo.boardWidth = 10; + SetCharTable(pieceToChar, "PNBRQ.............FKpnbrq.............fk"); + break; + case VariantXiangqi: + pieces = XiangqiArray; + gameInfo.boardWidth = 9; + gameInfo.boardHeight = 10; + nrCastlingRights = 0; + SetCharTable(pieceToChar, "PH.R.AE..K.C.ph.r.ae..k.c."); + break; + case VariantShogi: + pieces = ShogiArray; + gameInfo.boardWidth = 9; + gameInfo.boardHeight = 9; + gameInfo.holdingsSize = 7; + nrCastlingRights = 0; + SetCharTable(pieceToChar, "PNBRLS...G.++++++Kpnbrls...g.++++++k"); + break; + case VariantCourier: + pieces = CourierArray; + gameInfo.boardWidth = 12; + nrCastlingRights = 0; + SetCharTable(pieceToChar, "PNBR.FE..WMKpnbr.fe..wmk"); + for(i=0; i= 0) { + if(gameInfo.boardWidth != appData.NrFiles) overrule++; + gameInfo.boardWidth = appData.NrFiles; + } + if(appData.NrRanks >= 0) { + gameInfo.boardHeight = appData.NrRanks; + } + if(appData.holdingsSize >= 0) { + i = appData.holdingsSize; + if(i > gameInfo.boardHeight) i = gameInfo.boardHeight; + gameInfo.holdingsSize = i; + } + if(gameInfo.holdingsSize) gameInfo.holdingsWidth = 2; + if(BOARD_HEIGHT > BOARD_SIZE || BOARD_WIDTH > BOARD_SIZE) - DisplayFatalError("Recompile to support this BOARD_SIZE!", 0, 2); ++ DisplayFatalError(_("Recompile to support this BOARD_SIZE!"), 0, 2); + + pawnRow = gameInfo.boardHeight - 7; /* seems to work in all common variants */ + if(pawnRow < 1) pawnRow = 1; + + /* User pieceToChar list overrules defaults */ + if(appData.pieceToCharTable != NULL) + SetCharTable(pieceToChar, appData.pieceToCharTable); + + for( j=0; j= BOARD_RGHT || overrule) continue; + initialPosition[0][j] = pieces[0][j-gameInfo.holdingsWidth]; + initialPosition[pawnRow][j] = WhitePawn; + initialPosition[BOARD_HEIGHT-pawnRow-1][j] = BlackPawn; + if(gameInfo.variant == VariantXiangqi) { + if(j&1) { + initialPosition[pawnRow][j] = + initialPosition[BOARD_HEIGHT-pawnRow-1][j] = EmptySquare; + if(j==BOARD_LEFT+1 || j>=BOARD_RGHT-2) { + initialPosition[2][j] = WhiteCannon; + initialPosition[BOARD_HEIGHT-3][j] = BlackCannon; + } + } + } + initialPosition[BOARD_HEIGHT-1][j] = pieces[1][j-gameInfo.holdingsWidth]; + } + if( (gameInfo.variant == VariantShogi) && !overrule ) { + + j=BOARD_LEFT+1; + initialPosition[1][j] = WhiteBishop; + initialPosition[BOARD_HEIGHT-2][j] = BlackRook; + j=BOARD_RGHT-2; + initialPosition[1][j] = WhiteRook; + initialPosition[BOARD_HEIGHT-2][j] = BlackBishop; + } + + if( nrCastlingRights == -1) { + /* [HGM] Build normal castling rights (must be done after board sizing!) */ + /* This sets default castling rights from none to normal corners */ + /* Variants with other castling rights must set them themselves above */ + nrCastlingRights = 6; + + castlingRights[0][0] = initialRights[0] = BOARD_RGHT-1; + castlingRights[0][1] = initialRights[1] = BOARD_LEFT; + castlingRights[0][2] = initialRights[2] = BOARD_WIDTH>>1; + castlingRights[0][3] = initialRights[3] = BOARD_RGHT-1; + castlingRights[0][4] = initialRights[4] = BOARD_LEFT; + castlingRights[0][5] = initialRights[5] = BOARD_WIDTH>>1; + } + + if(gameInfo.variant == VariantSuper) Prelude(initialPosition); + if(gameInfo.variant == VariantGreat) { // promotion commoners + initialPosition[PieceToNumber(WhiteMan)][BOARD_RGHT-1] = WhiteMan; + initialPosition[PieceToNumber(WhiteMan)][BOARD_RGHT-2] = 9; + initialPosition[BOARD_HEIGHT-1-PieceToNumber(WhiteMan)][0] = BlackMan; + initialPosition[BOARD_HEIGHT-1-PieceToNumber(WhiteMan)][1] = 9; + } + #if 0 + if(gameInfo.variant == VariantFischeRandom) { + if( appData.defaultFrcPosition < 0 ) { + ShuffleFRC( initialPosition ); + } + else { + SetupFRC( initialPosition, appData.defaultFrcPosition ); + } + startedFromSetupPosition = TRUE; + } else + #else + if (appData.debugMode) { + fprintf(debugFP, "shuffleOpenings = %d\n", shuffleOpenings); + } + if(shuffleOpenings) { + SetUpShuffle(initialPosition, appData.defaultFrcPosition); + startedFromSetupPosition = TRUE; + } + #endif + if(startedFromPositionFile) { + /* [HGM] loadPos: use PositionFile for every new game */ + CopyBoard(initialPosition, filePosition); + for(i=0; iuseSetboard) { + char* fen = PositionToFEN(moveNum, cps->useFEN960); + sprintf(message, "setboard %s\n", fen); + SendToProgram(message, cps); + free(fen); + + } else { + ChessSquare *bp; + int i, j; + /* Kludge to set black to move, avoiding the troublesome and now + * deprecated "black" command. + */ + if (!WhiteOnMove(moveNum)) SendToProgram("a2a3\n", cps); + + SendToProgram("edit\n", cps); + SendToProgram("#\n", cps); + for (i = BOARD_HEIGHT - 1; i >= 0; i--) { + bp = &boards[moveNum][i][BOARD_LEFT]; + for (j = BOARD_LEFT; j < BOARD_RGHT; j++, bp++) { + if ((int) *bp < (int) BlackPawn) { + sprintf(message, "%c%c%c\n", PieceToChar(*bp), + AAA + j, ONE + i); + if(message[0] == '+' || message[0] == '~') { + sprintf(message, "%c%c%c+\n", + PieceToChar((ChessSquare)(DEMOTED *bp)), + AAA + j, ONE + i); + } + if(cps->alphaRank) { /* [HGM] shogi: translate coords */ + message[1] = BOARD_RGHT - 1 - j + '1'; + message[2] = BOARD_HEIGHT - 1 - i + 'a'; + } + SendToProgram(message, cps); + } + } + } + + SendToProgram("c\n", cps); + for (i = BOARD_HEIGHT - 1; i >= 0; i--) { + bp = &boards[moveNum][i][BOARD_LEFT]; + for (j = BOARD_LEFT; j < BOARD_RGHT; j++, bp++) { + if (((int) *bp != (int) EmptySquare) + && ((int) *bp >= (int) BlackPawn)) { + sprintf(message, "%c%c%c\n", ToUpper(PieceToChar(*bp)), + AAA + j, ONE + i); + if(message[0] == '+' || message[0] == '~') { + sprintf(message, "%c%c%c+\n", + PieceToChar((ChessSquare)(DEMOTED *bp)), + AAA + j, ONE + i); + } + if(cps->alphaRank) { /* [HGM] shogi: translate coords */ + message[1] = BOARD_RGHT - 1 - j + '1'; + message[2] = BOARD_HEIGHT - 1 - i + 'a'; + } + SendToProgram(message, cps); + } + } + } + + SendToProgram(".\n", cps); + } + setboardSpoiledMachineBlack = 0; /* [HGM] assume WB 4.2.7 already solves this after sending setboard */ + } + + int + IsPromotion(fromX, fromY, toX, toY) + int fromX, fromY, toX, toY; + { + /* [HGM] add Shogi promotions */ + int promotionZoneSize=1, highestPromotingPiece = (int)WhitePawn; + ChessSquare piece; + + if(gameMode == EditPosition || gameInfo.variant == VariantXiangqi || + !(fromX >=0 && fromY >= 0 && toX >= 0 && toY >= 0) ) return FALSE; + /* [HGM] Note to self: line above also weeds out drops */ + piece = boards[currentMove][fromY][fromX]; + if(gameInfo.variant == VariantShogi) { + promotionZoneSize = 3; + highestPromotingPiece = (int)WhiteKing; + /* [HGM] Should be Silver = Ferz, really, but legality testing is off, + and if in normal chess we then allow promotion to King, why not + allow promotion of other piece in Shogi? */ + } + if((int)piece >= BlackPawn) { + if(toY >= promotionZoneSize && fromY >= promotionZoneSize) + return FALSE; + highestPromotingPiece = WHITE_TO_BLACK highestPromotingPiece; + } else { + if( toY < BOARD_HEIGHT - promotionZoneSize && + fromY < BOARD_HEIGHT - promotionZoneSize) return FALSE; + } + return ( (int)piece <= highestPromotingPiece ); + } + + int + InPalace(row, column) + int row, column; + { /* [HGM] for Xiangqi */ + if( (row < 3 || row > BOARD_HEIGHT-4) && + column < (BOARD_WIDTH + 4)/2 && + column > (BOARD_WIDTH - 5)/2 ) return TRUE; + return FALSE; + } + + int + PieceForSquare (x, y) + int x; + int y; + { + if (x < 0 || x >= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) + return -1; + else + return boards[currentMove][y][x]; + } + + int + OKToStartUserMove(x, y) + int x, y; + { + ChessSquare from_piece; + int white_piece; + + if (matchMode) return FALSE; + if (gameMode == EditPosition) return TRUE; + + if (x >= 0 && y >= 0) + from_piece = boards[currentMove][y][x]; + else + from_piece = EmptySquare; + + if (from_piece == EmptySquare) return FALSE; + + white_piece = (int)from_piece >= (int)WhitePawn && + (int)from_piece < (int)BlackPawn; /* [HGM] can be > King! */ + + switch (gameMode) { + case PlayFromGameFile: + case AnalyzeFile: + case TwoMachinesPlay: + case EndOfGame: + return FALSE; + + case IcsObserving: + case IcsIdle: + return FALSE; + + case MachinePlaysWhite: + case IcsPlayingBlack: + if (appData.zippyPlay) return FALSE; + if (white_piece) { - DisplayMoveError("You are playing Black"); ++ DisplayMoveError(_("You are playing Black")); + return FALSE; + } + break; + + case MachinePlaysBlack: + case IcsPlayingWhite: + if (appData.zippyPlay) return FALSE; + if (!white_piece) { - DisplayMoveError("You are playing White"); ++ DisplayMoveError(_("You are playing White")); + return FALSE; + } + break; + + case EditGame: + if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + return FALSE; + } + if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + return FALSE; + } + if (cmailMsgLoaded && (currentMove < cmailOldMove)) { + /* Editing correspondence game history */ + /* Could disallow this or prompt for confirmation */ + cmailOldMove = -1; + } + if (currentMove < forwardMostMove) { + /* Discarding moves */ + /* Could prompt for confirmation here, + but I don't think that's such a good idea */ + forwardMostMove = currentMove; + } + break; + + case BeginningOfGame: + if (appData.icsActive) return FALSE; + if (!appData.noChessProgram) { + if (!white_piece) { - DisplayMoveError("You are playing White"); ++ DisplayMoveError(_("You are playing White")); + return FALSE; + } + } + break; + + case Training: + if (!white_piece && WhiteOnMove(currentMove)) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + return FALSE; + } + if (white_piece && !WhiteOnMove(currentMove)) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + return FALSE; + } + break; + + default: + case IcsExamining: + break; + } + if (currentMove != forwardMostMove && gameMode != AnalyzeMode + && gameMode != AnalyzeFile && gameMode != Training) { - DisplayMoveError("Displayed position is not current"); ++ DisplayMoveError(_("Displayed position is not current")); + return FALSE; + } + return TRUE; + } + + FILE *lastLoadGameFP = NULL, *lastLoadPositionFP = NULL; + int lastLoadGameNumber = 0, lastLoadPositionNumber = 0; + int lastLoadGameUseList = FALSE; + char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ]; + ChessMove lastLoadGameStart = (ChessMove) 0; + + + ChessMove + UserMoveTest(fromX, fromY, toX, toY, promoChar) + int fromX, fromY, toX, toY; + int promoChar; + { + ChessMove moveType; + ChessSquare pdown, pup; + + if (fromX < 0 || fromY < 0) return ImpossibleMove; + if ((fromX == toX) && (fromY == toY)) { + return ImpossibleMove; + } + + /* [HGM] suppress all moves into holdings area and guard band */ + if( toX < BOARD_LEFT || toX >= BOARD_RGHT || toY < 0 ) + return ImpossibleMove; + + /* [HGM] moved to here from winboard.c */ + /* note: this code seems to exist for filtering out some obviously illegal premoves */ + pdown = boards[currentMove][fromY][fromX]; + pup = boards[currentMove][toY][toX]; + if ( gameMode != EditPosition && + (WhitePawn <= pdown && pdown < BlackPawn && + WhitePawn <= pup && pup < BlackPawn || + BlackPawn <= pdown && pdown < EmptySquare && + BlackPawn <= pup && pup < EmptySquare + ) && !((gameInfo.variant == VariantFischeRandom || gameInfo.variant == VariantCapaRandom) && + (pup == WhiteRook && pdown == WhiteKing && fromY == 0 && toY == 0|| + pup == BlackRook && pdown == BlackKing && fromY == BOARD_HEIGHT-1 && toY == BOARD_HEIGHT-1 ) + ) ) + return ImpossibleMove; + + /* Check if the user is playing in turn. This is complicated because we + let the user "pick up" a piece before it is his turn. So the piece he + tried to pick up may have been captured by the time he puts it down! + Therefore we use the color the user is supposed to be playing in this + test, not the color of the piece that is currently on the starting + square---except in EditGame mode, where the user is playing both + sides; fortunately there the capture race can't happen. (It can + now happen in IcsExamining mode, but that's just too bad. The user + will get a somewhat confusing message in that case.) + */ + + switch (gameMode) { + case PlayFromGameFile: + case AnalyzeFile: + case TwoMachinesPlay: + case EndOfGame: + case IcsObserving: + case IcsIdle: + /* We switched into a game mode where moves are not accepted, + perhaps while the mouse button was down. */ + return ImpossibleMove; + + case MachinePlaysWhite: + /* User is moving for Black */ + if (WhiteOnMove(currentMove)) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + return ImpossibleMove; + } + break; + + case MachinePlaysBlack: + /* User is moving for White */ + if (!WhiteOnMove(currentMove)) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + return ImpossibleMove; + } + break; + + case EditGame: + case IcsExamining: + case BeginningOfGame: + case AnalyzeMode: + case Training: + if ((int) boards[currentMove][fromY][fromX] >= (int) BlackPawn && + (int) boards[currentMove][fromY][fromX] < (int) EmptySquare) { + /* User is moving for Black */ + if (WhiteOnMove(currentMove)) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + return ImpossibleMove; + } + } else { + /* User is moving for White */ + if (!WhiteOnMove(currentMove)) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + return ImpossibleMove; + } + } + break; + + case IcsPlayingBlack: + /* User is moving for Black */ + if (WhiteOnMove(currentMove)) { + if (!appData.premove) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + } else if (toX >= 0 && toY >= 0) { + premoveToX = toX; + premoveToY = toY; + premoveFromX = fromX; + premoveFromY = fromY; + premovePromoChar = promoChar; + gotPremove = 1; + if (appData.debugMode) + fprintf(debugFP, "Got premove: fromX %d," + "fromY %d, toX %d, toY %d\n", + fromX, fromY, toX, toY); + } + return ImpossibleMove; + } + break; + + case IcsPlayingWhite: + /* User is moving for White */ + if (!WhiteOnMove(currentMove)) { + if (!appData.premove) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + } else if (toX >= 0 && toY >= 0) { + premoveToX = toX; + premoveToY = toY; + premoveFromX = fromX; + premoveFromY = fromY; + premovePromoChar = promoChar; + gotPremove = 1; + if (appData.debugMode) + fprintf(debugFP, "Got premove: fromX %d," + "fromY %d, toX %d, toY %d\n", + fromX, fromY, toX, toY); + } + return ImpossibleMove; + } + break; + + default: + break; + + case EditPosition: + /* EditPosition, empty square, or different color piece; + click-click move is possible */ + if (toX == -2 || toY == -2) { + boards[0][fromY][fromX] = EmptySquare; + return AmbiguousMove; + } else if (toX >= 0 && toY >= 0) { + boards[0][toY][toX] = boards[0][fromY][fromX]; + boards[0][fromY][fromX] = EmptySquare; + return AmbiguousMove; + } + return ImpossibleMove; + } + + /* [HGM] If move started in holdings, it means a drop */ + if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) { + if( pup != EmptySquare ) return ImpossibleMove; + if(appData.testLegality) { + /* it would be more logical if LegalityTest() also figured out + * which drops are legal. For now we forbid pawns on back rank. + * Shogi is on its own here... + */ + if( (pdown == WhitePawn || pdown == BlackPawn) && + (toY == 0 || toY == BOARD_HEIGHT -1 ) ) + return(ImpossibleMove); /* no pawn drops on 1st/8th */ + } + return WhiteDrop; /* Not needed to specify white or black yet */ + } + + userOfferedDraw = FALSE; + + /* [HGM] always test for legality, to get promotion info */ + moveType = LegalityTest(boards[currentMove], PosFlags(currentMove), + epStatus[currentMove], castlingRights[currentMove], + fromY, fromX, toY, toX, promoChar); + + /* [HGM] but possibly ignore an IllegalMove result */ + if (appData.testLegality) { + if (moveType == IllegalMove || moveType == ImpossibleMove) { - DisplayMoveError("Illegal move"); ++ DisplayMoveError(_("Illegal move")); + return ImpossibleMove; + } + } + if(appData.debugMode) fprintf(debugFP, "moveType 3 = %d, promochar = %x\n", moveType, promoChar); + return moveType; + /* [HGM] in stead of calling FinishMove directly, this + function is made into one that returns an OK move type if FinishMove + should be called. This to give the calling driver routine the + opportunity to finish the userMove input with a promotion popup, + without bothering the user with this for invalid or illegal moves */ + + /* FinishMove(moveType, fromX, fromY, toX, toY, promoChar); */ + } + + /* Common tail of UserMoveEvent and DropMenuEvent */ + int + FinishMove(moveType, fromX, fromY, toX, toY, promoChar) + ChessMove moveType; + int fromX, fromY, toX, toY; + /*char*/int promoChar; + { + char *bookHit = 0; + if(appData.debugMode) fprintf(debugFP, "moveType 5 = %d, promochar = %x\n", moveType, promoChar); + if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) && promoChar != NULLCHAR) { + // [HGM] superchess: suppress promotions to non-available piece + int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); + if(WhiteOnMove(currentMove)) { + if(!boards[currentMove][k][BOARD_WIDTH-2]) return 0; + } else { + if(!boards[currentMove][BOARD_HEIGHT-1-k][1]) return 0; + } + } + + /* [HGM] kludge to avoid having to know the exact promotion + move type in caller when we know the move is a legal promotion */ + if(moveType == NormalMove && promoChar) + moveType = PromoCharToMoveType(WhiteOnMove(currentMove), promoChar); + if(appData.debugMode) fprintf(debugFP, "moveType 1 = %d, promochar = %x\n", moveType, promoChar); + /* [HGM] convert drag-and-drop piece drops to standard form */ + if( fromX == BOARD_LEFT-2 || fromX == BOARD_RGHT+1) { + moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; + fromX = boards[currentMove][fromY][fromX]; + fromY = DROP_RANK; + } + + /* [HGM] The following if has been moved here from + UserMoveEvent(). Because it seemed to belon here (why not allow + piece drops in training games?), and because it can only be + performed after it is known to what we promote. */ + if (gameMode == Training) { + /* compare the move played on the board to the next move in the + * game. If they match, display the move and the opponent's response. + * If they don't match, display an error message. + */ + int saveAnimate; + Board testBoard; + CopyBoard(testBoard, boards[currentMove]); + ApplyMove(fromX, fromY, toX, toY, promoChar, testBoard); + + if (CompareBoards(testBoard, boards[currentMove+1])) { + ForwardInner(currentMove+1); + + /* Autoplay the opponent's response. + * if appData.animate was TRUE when Training mode was entered, + * the response will be animated. + */ + saveAnimate = appData.animate; + appData.animate = animateTraining; + ForwardInner(currentMove+1); + appData.animate = saveAnimate; + + /* check for the end of the game */ + if (currentMove >= forwardMostMove) { + gameMode = PlayFromGameFile; + ModeHighlight(); + SetTrainingModeOff(); - DisplayInformation("End of game"); ++ DisplayInformation(_("End of game")); + } + } else { - DisplayError("Incorrect move", 0); ++ DisplayError(_("Incorrect move"), 0); + } + return 1; + } + + /* Ok, now we know that the move is good, so we can kill + the previous line in Analysis Mode */ + if (gameMode == AnalyzeMode && currentMove < forwardMostMove) { + forwardMostMove = currentMove; + } + + /* If we need the chess program but it's dead, restart it */ + ResurrectChessProgram(); + + /* A user move restarts a paused game*/ + if (pausing) + PauseEvent(); + + thinkOutput[0] = NULLCHAR; + + MakeMove(fromX, fromY, toX, toY, promoChar); /*updates forwardMostMove*/ + + if((gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) + && promoChar != NULLCHAR && gameInfo.holdingsSize) { + // [HGM] superchess: take promotion piece out of holdings + int k = PieceToNumber(CharToPiece(ToUpper(promoChar))); + if(WhiteOnMove(forwardMostMove-1)) { + if(!--boards[forwardMostMove][k][BOARD_WIDTH-2]) + boards[forwardMostMove][k][BOARD_WIDTH-1] = EmptySquare; + } else { + if(!--boards[forwardMostMove][BOARD_HEIGHT-1-k][1]) + boards[forwardMostMove][BOARD_HEIGHT-1-k][0] = EmptySquare; + } + } + + if (gameMode == BeginningOfGame) { + if (appData.noChessProgram) { + gameMode = EditGame; + SetGameInfo(); + } else { + char buf[MSG_SIZ]; + gameMode = MachinePlaysBlack; + StartClocks(); + SetGameInfo(); + sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); + DisplayTitle(buf); + if (first.sendName) { + sprintf(buf, "name %s\n", gameInfo.white); + SendToProgram(buf, &first); + } + StartClocks(); + } + ModeHighlight(); + } + if(appData.debugMode) fprintf(debugFP, "moveType 2 = %d, promochar = %x\n", moveType, promoChar); + /* Relay move to ICS or chess engine */ + if (appData.icsActive) { + if (gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || + gameMode == IcsExamining) { + SendMoveToICS(moveType, fromX, fromY, toX, toY); + ics_user_moved = 1; + } + } else { + if (first.sendTime && (gameMode == BeginningOfGame || + gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack)) { + SendTimeRemaining(&first, gameMode != MachinePlaysBlack); + } + if (gameMode != EditGame && gameMode != PlayFromGameFile) { + // [HGM] book: if program might be playing, let it use book + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, FALSE); + first.maybeThinking = TRUE; + } else SendMoveToProgram(forwardMostMove-1, &first); + if (currentMove == cmailOldMove + 1) { + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; + } + } + + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + + switch (gameMode) { + case EditGame: + switch (MateTest(boards[currentMove], PosFlags(currentMove), + EP_UNKNOWN, castlingRights[currentMove]) ) { + case MT_NONE: + case MT_CHECK: + break; + case MT_CHECKMATE: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "Black mates", GE_PLAYER); + } else { + GameEnds(WhiteWins, "White mates", GE_PLAYER); + } + break; + case MT_STALEMATE: + GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); + break; + } + break; + + case MachinePlaysBlack: + case MachinePlaysWhite: + /* disable certain menu options while machine is thinking */ + SetMachineThinkingEnables(); + break; + + default: + break; + } + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + return 1; + } + + void + UserMoveEvent(fromX, fromY, toX, toY, promoChar) + int fromX, fromY, toX, toY; + int promoChar; + { + /* [HGM] This routine was added to allow calling of its two logical + parts from other modules in the old way. Before, UserMoveEvent() + automatically called FinishMove() if the move was OK, and returned + otherwise. I separated the two, in order to make it possible to + slip a promotion popup in between. But that it always needs two + calls, to the first part, (now called UserMoveTest() ), and to + FinishMove if the first part succeeded. Calls that do not need + to do anything in between, can call this routine the old way. + */ + ChessMove moveType = UserMoveTest(fromX, fromY, toX, toY, promoChar); + if(appData.debugMode) fprintf(debugFP, "moveType 4 = %d, promochar = %x\n", moveType, promoChar); + if(moveType != ImpossibleMove) + FinishMove(moveType, fromX, fromY, toX, toY, promoChar); + } + + void SendProgramStatsToFrontend( ChessProgramState * cps, ChessProgramStats * cpstats ) + { + char * hint = lastHint; + FrontEndProgramStats stats; + + stats.which = cps == &first ? 0 : 1; + stats.depth = cpstats->depth; + stats.nodes = cpstats->nodes; + stats.score = cpstats->score; + stats.time = cpstats->time; + stats.pv = cpstats->movelist; + stats.hint = lastHint; + stats.an_move_index = 0; + stats.an_move_count = 0; + + if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { + stats.hint = cpstats->move_name; + stats.an_move_index = cpstats->nr_moves - cpstats->moves_left; + stats.an_move_count = cpstats->nr_moves; + } + + SetProgramStats( &stats ); + } + + char *SendMoveToBookUser(int moveNr, ChessProgramState *cps, int initial) + { // [HGM] book: this routine intercepts moves to simulate book replies + char *bookHit = NULL; + + //first determine if the incoming move brings opponent into his book + if(appData.usePolyglotBook && (cps == &first ? !appData.firstHasOwnBookUCI : !appData.secondHasOwnBookUCI)) + bookHit = ProbeBook(moveNr+1, appData.polyglotBook); // returns move + if(appData.debugMode) fprintf(debugFP, "book hit = %s\n", bookHit ? bookHit : "(NULL)"); + if(bookHit != NULL && !cps->bookSuspend) { + // make sure opponent is not going to reply after receiving move to book position + SendToProgram("force\n", cps); + cps->bookSuspend = TRUE; // flag indicating it has to be restarted + } + if(!initial) SendMoveToProgram(moveNr, cps); // with hit on initial position there is no move + // now arrange restart after book miss + if(bookHit) { + // after a book hit we never send 'go', and the code after the call to this routine + // has '&& !bookHit' added to suppress potential sending there (based on 'firstMove'). + char buf[MSG_SIZ]; + if (cps->useUsermove) sprintf(buf, "usermove "); // sorry, no SAN yet :( + sprintf(buf, "%s\n", bookHit); // force book move into program supposed to play it + SendToProgram(buf, cps); + if(!initial) firstMove = FALSE; // normally we would clear the firstMove condition after return & sending 'go' + } else if(initial) { // 'go' was needed irrespective of firstMove, and it has to be done in this routine + SendToProgram("go\n", cps); + cps->bookSuspend = FALSE; // after a 'go' we are never suspended + } else { // 'go' might be sent based on 'firstMove' after this routine returns + if(cps->bookSuspend && !firstMove) // 'go' needed, and it will not be done after we return + SendToProgram("go\n", cps); + cps->bookSuspend = FALSE; // anyhow, we will not be suspended after a miss + } + return bookHit; // notify caller of hit, so it can take action to send move to opponent + } + + char *savedMessage; + ChessProgramState *savedState; + void DeferredBookMove(void) + { + if(savedState->lastPing != savedState->lastPong) + ScheduleDelayedEvent(DeferredBookMove, 10); + else + HandleMachineMove(savedMessage, savedState); + } + + void + HandleMachineMove(message, cps) + char *message; + ChessProgramState *cps; + { + char machineMove[MSG_SIZ], buf1[MSG_SIZ*10], buf2[MSG_SIZ]; + char realname[MSG_SIZ]; + int fromX, fromY, toX, toY; + ChessMove moveType; + char promoChar; + char *p; + int machineWhite; + char *bookHit; + + FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book hit + /* + * Kludge to ignore BEL characters + */ + while (*message == '\007') message++; + + /* + * [HGM] engine debug message: ignore lines starting with '#' character + */ + if(cps->debug && *message == '#') return; + + /* + * Look for book output + */ + if (cps == &first && bookRequested) { + if (message[0] == '\t' || message[0] == ' ') { + /* Part of the book output is here; append it */ + strcat(bookOutput, message); + strcat(bookOutput, " \n"); + return; + } else if (bookOutput[0] != NULLCHAR) { + /* All of book output has arrived; display it */ + char *p = bookOutput; + while (*p != NULLCHAR) { + if (*p == '\t') *p = ' '; + p++; + } + DisplayInformation(bookOutput); + bookRequested = FALSE; + /* Fall through to parse the current output */ + } + } + + /* + * Look for machine move. + */ + if ((sscanf(message, "%s %s %s", buf1, buf2, machineMove) == 3 && strcmp(buf2, "...") == 0) || + (sscanf(message, "%s %s", buf1, machineMove) == 2 && strcmp(buf1, "move") == 0)) + { + /* This method is only useful on engines that support ping */ + if (cps->lastPing != cps->lastPong) { + if (gameMode == BeginningOfGame) { + /* Extra move from before last new; ignore */ + if (appData.debugMode) { + fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); + } + } else { + if (appData.debugMode) { + fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", + cps->which, gameMode); + } + + SendToProgram("undo\n", cps); + } + return; + } + + switch (gameMode) { + case BeginningOfGame: + /* Extra move from before last reset; ignore */ + if (appData.debugMode) { + fprintf(debugFP, "Ignoring extra move from %s\n", cps->which); + } + return; + + case EndOfGame: + case IcsIdle: + default: + /* Extra move after we tried to stop. The mode test is + not a reliable way of detecting this problem, but it's + the best we can do on engines that don't support ping. + */ + if (appData.debugMode) { + fprintf(debugFP, "Undoing extra move from %s, gameMode %d\n", + cps->which, gameMode); + } + SendToProgram("undo\n", cps); + return; + + case MachinePlaysWhite: + case IcsPlayingWhite: + machineWhite = TRUE; + break; + + case MachinePlaysBlack: + case IcsPlayingBlack: + machineWhite = FALSE; + break; + + case TwoMachinesPlay: + machineWhite = (cps->twoMachinesColor[0] == 'w'); + break; + } + if (WhiteOnMove(forwardMostMove) != machineWhite) { + if (appData.debugMode) { + fprintf(debugFP, + "Ignoring move out of turn by %s, gameMode %d" + ", forwardMost %d\n", + cps->which, gameMode, forwardMostMove); + } + return; + } + + if (appData.debugMode) { int f = forwardMostMove; + fprintf(debugFP, "machine move %d, castling = %d %d %d %d %d %d\n", f, + castlingRights[f][0],castlingRights[f][1],castlingRights[f][2],castlingRights[f][3],castlingRights[f][4],castlingRights[f][5]); + } + if(cps->alphaRank) AlphaRank(machineMove, 4); + if (!ParseOneMove(machineMove, forwardMostMove, &moveType, + &fromX, &fromY, &toX, &toY, &promoChar)) { + /* Machine move could not be parsed; ignore it. */ - sprintf(buf1, "Illegal move \"%s\" from %s machine", ++ sprintf(buf1, _("Illegal move \"%s\" from %s machine"), + machineMove, cps->which); + DisplayError(buf1, 0); + sprintf(buf1, "Xboard: Forfeit due to invalid move: %s (%c%c%c%c) res=%d%c", + machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, 0); + if (gameMode == TwoMachinesPlay) { + GameEnds(machineWhite ? BlackWins : WhiteWins, + buf1, GE_XBOARD); + } + return; + } + + /* [HGM] Apparently legal, but so far only tested with EP_UNKOWN */ + /* So we have to redo legality test with true e.p. status here, */ + /* to make sure an illegal e.p. capture does not slip through, */ + /* to cause a forfeit on a justified illegal-move complaint */ + /* of the opponent. */ + if( gameMode==TwoMachinesPlay && appData.testLegality + && fromY != DROP_RANK /* [HGM] temporary; should still add legality test for drops */ + ) { + ChessMove moveType; + moveType = LegalityTest(boards[forwardMostMove], PosFlags(forwardMostMove), + epStatus[forwardMostMove], castlingRights[forwardMostMove], + fromY, fromX, toY, toX, promoChar); + if (appData.debugMode) { + int i; + for(i=0; i< nrCastlingRights; i++) fprintf(debugFP, "(%d,%d) ", + castlingRights[forwardMostMove][i], castlingRank[i]); + fprintf(debugFP, "castling rights\n"); + } + if(moveType == IllegalMove) { + sprintf(buf1, "Xboard: Forfeit due to illegal move: %s (%c%c%c%c)%c", + machineMove, fromX+AAA, fromY+ONE, toX+AAA, toY+ONE, 0); + GameEnds(machineWhite ? BlackWins : WhiteWins, + buf1, GE_XBOARD); + } else if(gameInfo.variant != VariantFischeRandom && gameInfo.variant != VariantCapaRandom) + /* [HGM] Kludge to handle engines that send FRC-style castling + when they shouldn't (like TSCP-Gothic) */ + switch(moveType) { + case WhiteASideCastleFR: + case BlackASideCastleFR: + toX+=2; + currentMoveString[2]++; + break; + case WhiteHSideCastleFR: + case BlackHSideCastleFR: + toX--; + currentMoveString[2]--; + break; + } + } + hintRequested = FALSE; + lastHint[0] = NULLCHAR; + bookRequested = FALSE; + /* Program may be pondering now */ + cps->maybeThinking = TRUE; + if (cps->sendTime == 2) cps->sendTime = 1; + if (cps->offeredDraw) cps->offeredDraw--; + + #if ZIPPY + if ((gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack) && + first.initDone) { + SendMoveToICS(moveType, fromX, fromY, toX, toY); + ics_user_moved = 1; - if(appData.autoKibitz) { /* [HGM] kibitz: send most-recent PV info to ICS */ ++ if(appData.autoKibitz && !appData.icsEngineAnalyze ) { /* [HGM] kibitz: send most-recent PV info to ICS */ + char buf[3*MSG_SIZ]; + + sprintf(buf, "kibitz %d/%+.2f (%.2f sec, %.0f nodes, %1.0f knps) PV = %s\n", + programStats.depth, + programStats.score / 100., + programStats.time / 100., + (double) programStats.nodes, + programStats.nodes / (10*abs(programStats.time) + 1.), + programStats.movelist); + SendToICS(buf); + } + } + #endif + /* currentMoveString is set as a side-effect of ParseOneMove */ + strcpy(machineMove, currentMoveString); + strcat(machineMove, "\n"); + strcpy(moveList[forwardMostMove], machineMove); + + /* [AS] Save move info and clear stats for next move */ + pvInfoList[ forwardMostMove ].score = programStats.score; + pvInfoList[ forwardMostMove ].depth = programStats.depth; + pvInfoList[ forwardMostMove ].time = programStats.time; // [HGM] PGNtime: take time from engine stats + ClearProgramStats(); + thinkOutput[0] = NULLCHAR; + hiddenThinkOutputState = 0; + + MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/ + + /* [AS] Adjudicate game if needed (note: remember that forwardMostMove now points past the last move) */ + if( gameMode == TwoMachinesPlay && adjudicateLossThreshold != 0 && forwardMostMove >= adjudicateLossPlies ) { + int count = 0; + + while( count < adjudicateLossPlies ) { + int score = pvInfoList[ forwardMostMove - count - 1 ].score; + + if( count & 1 ) { + score = -score; /* Flip score for winning side */ + } + + if( score > adjudicateLossThreshold ) { + break; + } + + count++; + } + + if( count >= adjudicateLossPlies ) { + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + + GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins, + "Xboard adjudication", + GE_XBOARD ); + + return; + } + } + + if( gameMode == TwoMachinesPlay ) { + // [HGM] some adjudications useful with buggy engines + int k, count = 0, epFile = epStatus[forwardMostMove]; static int bare = 1; + if(gameInfo.holdingsSize == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) { + + if(appData.testLegality) + // don't wait for engine to announce game end if we can judge ourselves + switch (MateTest(boards[forwardMostMove], + PosFlags(forwardMostMove), epFile, + castlingRights[forwardMostMove]) ) { + case MT_NONE: + case MT_CHECK: + default: + break; + case MT_STALEMATE: + epStatus[forwardMostMove] = EP_STALEMATE; + if(appData.checkMates) { + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( GameIsDrawn, "Xboard adjudication: Stalemate", + GE_XBOARD ); + } + break; + case MT_CHECKMATE: + epStatus[forwardMostMove] = EP_CHECKMATE; + if(appData.checkMates) { + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( WhiteOnMove(forwardMostMove) ? BlackWins : WhiteWins, + "Xboard adjudication: Checkmate", + GE_XBOARD ); + } + break; + } + + if( appData.testLegality ) + { /* [HGM] Some more adjudications for obstinate engines */ + int NrWN=0, NrBN=0, NrWB=0, NrBB=0, NrWR=0, NrBR=0, + NrWQ=0, NrBQ=0, NrW=0, bishopsColor = 0, + NrPieces=0, NrPawns=0, PawnAdvance=0, i, j, k; + static int moveCount = 6; + + /* First absolutely insufficient mating material. Count what is on board. */ + for(i=0; iother); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see last move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( GameIsDrawn, "Xboard adjudication: Insufficient mating material", GE_XBOARD ); + return; + } + } + + /* Shatranj baring rule */ + if( gameInfo.variant == VariantShatranj && (NrW == 1 || NrPieces - NrW == 1) ) + { /* bare King */ + + if(--bare < 0 && appData.checkMates) { + /* but only adjudicate them if adjudication enabled */ + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( NrW > 1 ? WhiteWins : NrPieces - NrW > 1 ? BlackWins : GameIsDrawn, + "Xboard adjudication: Bare king", GE_XBOARD ); + return; + } + } else bare = 1; + + /* Then some trivial draws (only adjudicate, cannot be claimed) */ + if(NrPieces == 4 && + ( NrWR == 1 && NrBR == 1 /* KRKR */ + || NrWQ==1 && NrBQ==1 /* KQKQ */ + || NrWN==2 || NrBN==2 /* KNNK */ + || NrWN+NrWB == 1 && NrBN+NrBB == 1 /* KBKN, KBKB, KNKN */ + ) ) { + if(--moveCount < 0 && appData.trivialDraws) + { /* if the first 3 moves do not show a tactical win, declare draw */ + SendToProgram("force\n", cps->other); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( GameIsDrawn, "Xboard adjudication: Trivial draw", GE_XBOARD ); + return; + } + } else moveCount = 6; + } + } + #if 1 + if (appData.debugMode) { int i; + fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n", + forwardMostMove, backwardMostMove, epStatus[backwardMostMove], + appData.drawRepeats); + for( i=forwardMostMove; i>=backwardMostMove; i-- ) + fprintf(debugFP, "%d ep=%d\n", i, epStatus[i]); + + } + #endif + /* Check for rep-draws */ + count = 0; + for(k = forwardMostMove-2; + k>=backwardMostMove && k>=forwardMostMove-100 && + epStatus[k] < EP_UNKNOWN && + epStatus[k+2] <= EP_NONE && epStatus[k+1] <= EP_NONE; + k-=2) + { int rights=0; + #if 0 + if (appData.debugMode) { + fprintf(debugFP, " loop\n"); + } + #endif + if(CompareBoards(boards[k], boards[forwardMostMove])) { + #if 0 + if (appData.debugMode) { + fprintf(debugFP, "match\n"); + } + #endif + /* compare castling rights */ + if( castlingRights[forwardMostMove][2] != castlingRights[k][2] && + (castlingRights[k][0] >= 0 || castlingRights[k][1] >= 0) ) + rights++; /* King lost rights, while rook still had them */ + if( castlingRights[forwardMostMove][2] >= 0 ) { /* king has rights */ + if( castlingRights[forwardMostMove][0] != castlingRights[k][0] || + castlingRights[forwardMostMove][1] != castlingRights[k][1] ) + rights++; /* but at least one rook lost them */ + } + if( castlingRights[forwardMostMove][5] != castlingRights[k][5] && + (castlingRights[k][3] >= 0 || castlingRights[k][4] >= 0) ) + rights++; + if( castlingRights[forwardMostMove][5] >= 0 ) { + if( castlingRights[forwardMostMove][3] != castlingRights[k][3] || + castlingRights[forwardMostMove][4] != castlingRights[k][4] ) + rights++; + } + #if 0 + if (appData.debugMode) { + for(i=0; i appData.drawRepeats-2 + && appData.drawRepeats > 1) { + /* adjudicate after user-specified nr of repeats */ + SendToProgram("force\n", cps->other); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + if(gameInfo.variant == VariantXiangqi && appData.testLegality) { + // [HGM] xiangqi: check for forbidden perpetuals + int m, ourPerpetual = 1, hisPerpetual = 1; + for(m=forwardMostMove; m>k; m-=2) { + if(MateTest(boards[m], PosFlags(m), + EP_NONE, castlingRights[m]) != MT_CHECK) + ourPerpetual = 0; // the current mover did not always check + if(MateTest(boards[m-1], PosFlags(m-1), + EP_NONE, castlingRights[m-1]) != MT_CHECK) + hisPerpetual = 0; // the opponent did not always check + } + if(ourPerpetual && !hisPerpetual) { // we are actively checking him: forfeit + GameEnds( WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins, + "Xboard adjudication: perpetual checking", GE_XBOARD ); + return; + } + if(hisPerpetual && !ourPerpetual) // he is checking us, but did not repeat yet + break; // (or we would have caught him before). Abort repetition-checking loop. + // if neither of us is checking all the time, or both are, it is draw + // (illegal-chase forfeits not implemented yet!) + } + GameEnds( GameIsDrawn, "Xboard adjudication: repetition draw", GE_XBOARD ); + return; + } + if( rights == 0 && count > 1 ) /* occurred 2 or more times before */ + epStatus[forwardMostMove] = EP_REP_DRAW; + } + } + + /* Now we test for 50-move draws. Determine ply count */ + count = forwardMostMove; + /* look for last irreversble move */ + while( epStatus[count] <= EP_NONE && count > backwardMostMove ) + count--; + /* if we hit starting position, add initial plies */ + if( count == backwardMostMove ) + count -= initialRulePlies; + count = forwardMostMove - count; + if( count >= 100) + epStatus[forwardMostMove] = EP_RULE_DRAW; + /* this is used to judge if draw claims are legal */ + if(appData.ruleMoves > 0 && count >= 2*appData.ruleMoves) { + SendToProgram("force\n", cps->other); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + GameEnds( GameIsDrawn, "Xboard adjudication: 50-move rule", GE_XBOARD ); + return; + } + + /* if draw offer is pending, treat it as a draw claim + * when draw condition present, to allow engines a way to + * claim draws before making their move to avoid a race + * condition occurring after their move + */ + if( cps->other->offeredDraw || cps->offeredDraw ) { + char *p = NULL; + if(epStatus[forwardMostMove] == EP_RULE_DRAW) + p = "Draw claim: 50-move rule"; + if(epStatus[forwardMostMove] == EP_REP_DRAW) + p = "Draw claim: 3-fold repetition"; + if(epStatus[forwardMostMove] == EP_INSUF_DRAW) + p = "Draw claim: insufficient mating material"; + if( p != NULL ) { + SendToProgram("force\n", cps->other); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + GameEnds( GameIsDrawn, p, GE_XBOARD ); + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + return; + } + } + + + if( appData.adjudicateDrawMoves > 0 && forwardMostMove > (2*appData.adjudicateDrawMoves) ) { + SendToProgram("force\n", cps->other); // suppress reply + SendMoveToProgram(forwardMostMove-1, cps->other); /* make sure opponent gets to see move */ + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + + GameEnds( GameIsDrawn, "Xboard adjudication: long game", GE_XBOARD ); + + return; + } + } + + bookHit = NULL; + if (gameMode == TwoMachinesPlay) { + /* [HGM] relaying draw offers moved to after reception of move */ + /* and interpreting offer as claim if it brings draw condition */ + if (cps->offeredDraw == 1 && cps->other->sendDrawOffers) { + SendToProgram("draw\n", cps->other); + } + if (cps->other->sendTime) { + SendTimeRemaining(cps->other, + cps->other->twoMachinesColor[0] == 'w'); + } + bookHit = SendMoveToBookUser(forwardMostMove-1, cps->other, FALSE); + if (firstMove && !bookHit) { + firstMove = FALSE; + if (cps->other->useColors) { + SendToProgram(cps->other->twoMachinesColor, cps->other); + } + SendToProgram("go\n", cps->other); + } + cps->other->maybeThinking = TRUE; + } + + ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/ + + if (!pausing && appData.ringBellAfterMoves) { + RingBell(); + } + + /* + * Reenable menu items that were disabled while + * machine was thinking + */ + if (gameMode != TwoMachinesPlay) + SetUserThinkingEnables(); + + // [HGM] book: after book hit opponent has received move and is now in force mode + // force the book reply into it, and then fake that it outputted this move by jumping + // back to the beginning of HandleMachineMove, with cps toggled and message set to this move + if(bookHit) { + static char bookMove[MSG_SIZ]; // a bit generous? + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + message = bookMove; + cps = cps->other; + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + if(cps->lastPing != cps->lastPong) { + savedMessage = message; // args for deferred call + savedState = cps; + ScheduleDelayedEvent(DeferredBookMove, 10); + return; + } + goto FakeBookMove; + } + + return; + } + + /* Set special modes for chess engines. Later something general + * could be added here; for now there is just one kludge feature, + * needed because Crafty 15.10 and earlier don't ignore SIGINT + * when "xboard" is given as an interactive command. + */ + if (strncmp(message, "kibitz Hello from Crafty", 24) == 0) { + cps->useSigint = FALSE; + cps->useSigterm = FALSE; + } + + /* [HGM] Allow engine to set up a position. Don't ask me why one would + * want this, I was asked to put it in, and obliged. + */ + if (!strncmp(message, "setboard ", 9)) { + Board initial_position; int i; + + GameEnds(GameUnfinished, "Engine aborts game", GE_XBOARD); + + if (!ParseFEN(initial_position, &blackPlaysFirst, message + 9)) { - DisplayError("Bad FEN received from engine", 0); ++ DisplayError(_("Bad FEN received from engine"), 0); + return ; + } else { + Reset(FALSE, FALSE); + CopyBoard(boards[0], initial_position); + initialRulePlies = FENrulePlies; + epStatus[0] = FENepStatus; + for( i=0; itidy); + strcat(realname, " query"); + AskQuestion(realname, buf2, buf1, cps->pr); + return; + } + /* Commands from the engine directly to ICS. We don't allow these to be + * sent until we are logged on. Crafty kibitzes have been known to + * interfere with the login process. + */ + if (loggedOn) { + if (!strncmp(message, "tellics ", 8)) { + SendToICS(message + 8); + SendToICS("\n"); + return; + } + if (!strncmp(message, "tellicsnoalias ", 15)) { + SendToICS(ics_prefix); + SendToICS(message + 15); + SendToICS("\n"); + return; + } + /* The following are for backward compatibility only */ + if (!strncmp(message,"whisper",7) || !strncmp(message,"kibitz",6) || + !strncmp(message,"draw",4) || !strncmp(message,"tell",3)) { + SendToICS(ics_prefix); + SendToICS(message); + SendToICS("\n"); + return; + } + } + if (strncmp(message, "feature ", 8) == 0) { + ParseFeatures(message+8, cps); + } + if (sscanf(message, "pong %d", &cps->lastPong) == 1) { + return; + } + /* + * If the move is illegal, cancel it and redraw the board. + * Also deal with other error cases. Matching is rather loose + * here to accommodate engines written before the spec. + */ + if (strncmp(message + 1, "llegal move", 11) == 0 || + strncmp(message, "Error", 5) == 0) { + if (StrStr(message, "name") || + StrStr(message, "rating") || StrStr(message, "?") || + StrStr(message, "result") || StrStr(message, "board") || + StrStr(message, "bk") || StrStr(message, "computer") || + StrStr(message, "variant") || StrStr(message, "hint") || + StrStr(message, "random") || StrStr(message, "depth") || + StrStr(message, "accepted")) { + return; + } + if (StrStr(message, "protover")) { + /* Program is responding to input, so it's apparently done + initializing, and this error message indicates it is + protocol version 1. So we don't need to wait any longer + for it to initialize and send feature commands. */ + FeatureDone(cps, 1); + cps->protocolVersion = 1; + return; + } + cps->maybeThinking = FALSE; + + if (StrStr(message, "draw")) { + /* Program doesn't have "draw" command */ + cps->sendDrawOffers = 0; + return; + } + if (cps->sendTime != 1 && + (StrStr(message, "time") || StrStr(message, "otim"))) { + /* Program apparently doesn't have "time" or "otim" command */ + cps->sendTime = 0; + return; + } + if (StrStr(message, "analyze")) { + cps->analysisSupport = FALSE; + cps->analyzing = FALSE; + Reset(FALSE, TRUE); - sprintf(buf2, "%s does not support analysis", cps->tidy); ++ sprintf(buf2, _("%s does not support analysis"), cps->tidy); + DisplayError(buf2, 0); + return; + } + if (StrStr(message, "(no matching move)st")) { + /* Special kludge for GNU Chess 4 only */ + cps->stKludge = TRUE; + SendTimeControl(cps, movesPerSession, timeControl, + timeIncrement, appData.searchDepth, + searchTime); + return; + } + if (StrStr(message, "(no matching move)sd")) { + /* Special kludge for GNU Chess 4 only */ + cps->sdKludge = TRUE; + SendTimeControl(cps, movesPerSession, timeControl, + timeIncrement, appData.searchDepth, + searchTime); + return; + } + if (!StrStr(message, "llegal")) { + return; + } + if (gameMode == BeginningOfGame || gameMode == EndOfGame || + gameMode == IcsIdle) return; + if (forwardMostMove <= backwardMostMove) return; + #if 0 + /* Following removed: it caused a bug where a real illegal move + message in analyze mored would be ignored. */ + if (cps == &first && programStats.ok_to_send == 0) { + /* Bogus message from Crafty responding to "." This filtering + can miss some of the bad messages, but fortunately the bug + is fixed in current Crafty versions, so it doesn't matter. */ + return; + } + #endif + if (pausing) PauseEvent(); + if (gameMode == PlayFromGameFile) { + /* Stop reading this game file */ + gameMode = EditGame; + ModeHighlight(); + } + currentMove = --forwardMostMove; + DisplayMove(currentMove-1); /* before DisplayMoveError */ + SwitchClocks(); + DisplayBothClocks(); - sprintf(buf1, "Illegal move \"%s\" (rejected by %s chess program)", ++ sprintf(buf1, _("Illegal move \"%s\" (rejected by %s chess program)"), + parseList[currentMove], cps->which); + DisplayMoveError(buf1); + DrawPosition(FALSE, boards[currentMove]); + + /* [HGM] illegal-move claim should forfeit game when Xboard */ + /* only passes fully legal moves */ + if( appData.testLegality && gameMode == TwoMachinesPlay ) { + GameEnds( cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, + "False illegal-move claim", GE_XBOARD ); + } + return; + } + if (strncmp(message, "time", 4) == 0 && StrStr(message, "Illegal")) { + /* Program has a broken "time" command that + outputs a string not ending in newline. + Don't use it. */ + cps->sendTime = 0; + } + + /* + * If chess program startup fails, exit with an error message. + * Attempts to recover here are futile. + */ + if ((StrStr(message, "unknown host") != NULL) + || (StrStr(message, "No remote directory") != NULL) + || (StrStr(message, "not found") != NULL) + || (StrStr(message, "No such file") != NULL) + || (StrStr(message, "can't alloc") != NULL) + || (StrStr(message, "Permission denied") != NULL)) { + + cps->maybeThinking = FALSE; - sprintf(buf1, "Failed to start %s chess program %s on %s: %s\n", ++ sprintf(buf1, _("Failed to start %s chess program %s on %s: %s\n"), + cps->which, cps->program, cps->host, message); + RemoveInputSource(cps->isr); + DisplayFatalError(buf1, 0, 1); + return; + } + + /* + * Look for hint output + */ + if (sscanf(message, "Hint: %s", buf1) == 1) { + if (cps == &first && hintRequested) { + hintRequested = FALSE; + if (ParseOneMove(buf1, forwardMostMove, &moveType, + &fromX, &fromY, &toX, &toY, &promoChar)) { + (void) CoordsToAlgebraic(boards[forwardMostMove], + PosFlags(forwardMostMove), EP_UNKNOWN, + fromY, fromX, toY, toX, promoChar, buf1); - sprintf(buf2, "Hint: %s", buf1); ++ sprintf(buf2, _("Hint: %s"), buf1); + DisplayInformation(buf2); + } else { + /* Hint move could not be parsed!? */ + sprintf(buf2, - "Illegal hint move \"%s\"\nfrom %s chess program", ++ _("Illegal hint move \"%s\"\nfrom %s chess program"), + buf1, cps->which); + DisplayError(buf2, 0); + } + } else { + strcpy(lastHint, buf1); + } + return; + } + + /* + * Ignore other messages if game is not in progress + */ + if (gameMode == BeginningOfGame || gameMode == EndOfGame || + gameMode == IcsIdle || cps->lastPing != cps->lastPong) return; + + /* + * look for win, lose, draw, or draw offer + */ + if (strncmp(message, "1-0", 3) == 0) { + char *p, *q, *r = ""; + p = strchr(message, '{'); + if (p) { + q = strchr(p, '}'); + if (q) { + *q = NULLCHAR; + r = p + 1; + } + } + GameEnds(WhiteWins, r, GE_ENGINE1 + (cps != &first)); /* [HGM] pass claimer indication for claim test */ + return; + } else if (strncmp(message, "0-1", 3) == 0) { + char *p, *q, *r = ""; + p = strchr(message, '{'); + if (p) { + q = strchr(p, '}'); + if (q) { + *q = NULLCHAR; + r = p + 1; + } + } + /* Kludge for Arasan 4.1 bug */ + if (strcmp(r, "Black resigns") == 0) { + GameEnds(WhiteWins, r, GE_ENGINE1 + (cps != &first)); + return; + } + GameEnds(BlackWins, r, GE_ENGINE1 + (cps != &first)); + return; + } else if (strncmp(message, "1/2", 3) == 0) { + char *p, *q, *r = ""; + p = strchr(message, '{'); + if (p) { + q = strchr(p, '}'); + if (q) { + *q = NULLCHAR; + r = p + 1; + } + } + + GameEnds(GameIsDrawn, r, GE_ENGINE1 + (cps != &first)); + return; + + } else if (strncmp(message, "White resign", 12) == 0) { + GameEnds(BlackWins, "White resigns", GE_ENGINE1 + (cps != &first)); + return; + } else if (strncmp(message, "Black resign", 12) == 0) { + GameEnds(WhiteWins, "Black resigns", GE_ENGINE1 + (cps != &first)); + return; + } else if (strncmp(message, "White matches", 13) == 0 || + strncmp(message, "Black matches", 13) == 0 ) { + /* [HGM] ignore GNUShogi noises */ + return; + } else if (strncmp(message, "White", 5) == 0 && + message[5] != '(' && + StrStr(message, "Black") == NULL) { + GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); + return; + } else if (strncmp(message, "Black", 5) == 0 && + message[5] != '(') { + GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); + return; + } else if (strcmp(message, "resign") == 0 || + strcmp(message, "computer resigns") == 0) { + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + GameEnds(WhiteWins, "Black resigns", GE_ENGINE); + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + GameEnds(BlackWins, "White resigns", GE_ENGINE); + break; + case TwoMachinesPlay: + if (cps->twoMachinesColor[0] == 'w') + GameEnds(BlackWins, "White resigns", GE_ENGINE1 + (cps != &first)); + else + GameEnds(WhiteWins, "Black resigns", GE_ENGINE1 + (cps != &first)); + break; + default: + /* can't happen */ + break; + } + return; + } else if (strncmp(message, "opponent mates", 14) == 0) { + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + GameEnds(WhiteWins, "White mates", GE_ENGINE); + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + GameEnds(BlackWins, "Black mates", GE_ENGINE); + break; + case TwoMachinesPlay: + if (cps->twoMachinesColor[0] == 'w') + GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); + else + GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); + break; + default: + /* can't happen */ + break; + } + return; + } else if (strncmp(message, "computer mates", 14) == 0) { + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + GameEnds(BlackWins, "Black mates", GE_ENGINE1); + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + GameEnds(WhiteWins, "White mates", GE_ENGINE); + break; + case TwoMachinesPlay: + if (cps->twoMachinesColor[0] == 'w') + GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); + else + GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); + break; + default: + /* can't happen */ + break; + } + return; + } else if (strncmp(message, "checkmate", 9) == 0) { + if (WhiteOnMove(forwardMostMove)) { + GameEnds(BlackWins, "Black mates", GE_ENGINE1 + (cps != &first)); + } else { + GameEnds(WhiteWins, "White mates", GE_ENGINE1 + (cps != &first)); + } + return; + } else if (strstr(message, "Draw") != NULL || + strstr(message, "game is a draw") != NULL) { + GameEnds(GameIsDrawn, "Draw", GE_ENGINE1 + (cps != &first)); + return; + } else if (strstr(message, "offer") != NULL && + strstr(message, "draw") != NULL) { + #if ZIPPY + if (appData.zippyPlay && first.initDone) { + /* Relay offer to ICS */ + SendToICS(ics_prefix); + SendToICS("draw\n"); + } + #endif + cps->offeredDraw = 2; /* valid until this engine moves twice */ + if (gameMode == TwoMachinesPlay) { + if (cps->other->offeredDraw) { + GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); + /* [HGM] in two-machine mode we delay relaying draw offer */ + /* until after we also have move, to see if it is really claim */ + } + #if 0 + else { + if (cps->other->sendDrawOffers) { + SendToProgram("draw\n", cps->other); + } + } + #endif + } else if (gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack) { + if (userOfferedDraw) { - DisplayInformation("Machine accepts your draw offer"); ++ DisplayInformation(_("Machine accepts your draw offer")); + GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); + } else { - DisplayInformation("Machine offers a draw\nSelect Action / Draw to agree"); ++ DisplayInformation(_("Machine offers a draw\nSelect Action / Draw to agree")); + } + } + } + + + /* + * Look for thinking output + */ + if ( appData.showThinking // [HGM] thinking: test all options that cause this output + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() + ) { + int plylev, mvleft, mvtot, curscore, time; + char mvname[MOVE_LEN]; - unsigned long nodes; ++ u64 nodes; // [DM] + char plyext; + int ignore = FALSE; + int prefixHint = FALSE; + mvname[0] = NULLCHAR; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + if (WhiteOnMove(forwardMostMove)) prefixHint = TRUE; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + if (!WhiteOnMove(forwardMostMove)) prefixHint = TRUE; + break; + case AnalyzeMode: + case AnalyzeFile: ++ break; ++ case IcsObserving: /* [DM] icsEngineAnalyze */ ++ if (!appData.icsEngineAnalyze) ignore = TRUE; + break; + case TwoMachinesPlay: + if ((cps->twoMachinesColor[0] == 'w') != WhiteOnMove(forwardMostMove)) { + ignore = TRUE; + } + break; + default: + ignore = TRUE; + break; + } + + if (!ignore) { + buf1[0] = NULLCHAR; - if (sscanf(message, "%d%c %d %d %lu %[^\n]\n", ++ if (sscanf(message, "%d%c %d %d " u64Display " %[^\n]\n", + &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) { + + if (plyext != ' ' && plyext != '\t') { + time *= 100; + } + + /* [AS] Negate score if machine is playing black and reporting absolute scores */ + if( cps->scoreIsAbsolute && + ((gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) ) + { + curscore = -curscore; + } + + + programStats.depth = plylev; + programStats.nodes = nodes; + programStats.time = time; + programStats.score = curscore; + programStats.got_only_move = 0; + + if(cps->nps >= 0) { /* [HGM] nps: use engine nodes or time to decrement clock */ + int ticklen; + + if(cps->nps == 0) ticklen = 10*time; // use engine reported time + else ticklen = (1000. * nodes) / cps->nps; // convert node count to time + if(WhiteOnMove(forwardMostMove)) + whiteTimeRemaining = timeRemaining[0][forwardMostMove] - ticklen; + else blackTimeRemaining = timeRemaining[1][forwardMostMove] - ticklen; + } + + /* Buffer overflow protection */ + if (buf1[0] != NULLCHAR) { + if (strlen(buf1) >= sizeof(programStats.movelist) + && appData.debugMode) { + fprintf(debugFP, + "PV is too long; using the first %d bytes.\n", + sizeof(programStats.movelist) - 1); + } + + safeStrCpy( programStats.movelist, buf1, sizeof(programStats.movelist) ); + } else { + sprintf(programStats.movelist, " no PV\n"); + } + + if (programStats.seen_stat) { + programStats.ok_to_send = 1; + } + + if (strchr(programStats.movelist, '(') != NULL) { + programStats.line_is_book = 1; + programStats.nr_moves = 0; + programStats.moves_left = 0; + } else { + programStats.line_is_book = 0; + } + + SendProgramStatsToFrontend( cps, &programStats ); + + /* + [AS] Protect the thinkOutput buffer from overflow... this + is only useful if buf1 hasn't overflowed first! + */ + sprintf(thinkOutput, "[%d]%c%+.2f %s%s", + plylev, + (gameMode == TwoMachinesPlay ? + ToUpper(cps->twoMachinesColor[0]) : ' '), + ((double) curscore) / 100.0, + prefixHint ? lastHint : "", + prefixHint ? " " : "" ); + + if( buf1[0] != NULLCHAR ) { + unsigned max_len = sizeof(thinkOutput) - strlen(thinkOutput) - 1; + + if( strlen(buf1) > max_len ) { + if( appData.debugMode) { + fprintf(debugFP,"PV is too long for thinkOutput, truncating.\n"); + } + buf1[max_len+1] = '\0'; + } + + strcat( thinkOutput, buf1 ); + } + - if (currentMove == forwardMostMove || gameMode == AnalyzeMode || gameMode == AnalyzeFile) { ++ if (currentMove == forwardMostMove || gameMode == AnalyzeMode ++ || gameMode == AnalyzeFile || appData.icsEngineAnalyze) { + DisplayMove(currentMove - 1); + DisplayAnalysis(); + } + return; + + } else if ((p=StrStr(message, "(only move)")) != NULL) { + /* crafty (9.25+) says "(only move) " + * if there is only 1 legal move + */ + sscanf(p, "(only move) %s", buf1); + sprintf(thinkOutput, "%s (only move)", buf1); + sprintf(programStats.movelist, "%s (only move)", buf1); + programStats.depth = 1; + programStats.nr_moves = 1; + programStats.moves_left = 1; + programStats.nodes = 1; + programStats.time = 1; + programStats.got_only_move = 1; + + /* Not really, but we also use this member to + mean "line isn't going to change" (Crafty + isn't searching, so stats won't change) */ + programStats.line_is_book = 1; + + SendProgramStatsToFrontend( cps, &programStats ); + - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || gameMode == AnalyzeFile) { ++ if (currentMove == forwardMostMove || gameMode==AnalyzeMode || ++ gameMode == AnalyzeFile || appData.icsEngineAnalyze) { + DisplayMove(currentMove - 1); + DisplayAnalysis(); + } + return; - } else if (sscanf(message,"stat01: %d %lu %d %d %d %s", ++ } else if (sscanf(message,"stat01: %d " u64Display " %d %d %d %s", + &time, &nodes, &plylev, &mvleft, + &mvtot, mvname) >= 5) { + /* The stat01: line is from Crafty (9.29+) in response + to the "." command */ + programStats.seen_stat = 1; + cps->maybeThinking = TRUE; + + if (programStats.got_only_move || !appData.periodicUpdates) + return; + + programStats.depth = plylev; + programStats.time = time; + programStats.nodes = nodes; + programStats.moves_left = mvleft; + programStats.nr_moves = mvtot; + strcpy(programStats.move_name, mvname); + programStats.ok_to_send = 1; + programStats.movelist[0] = '\0'; + + SendProgramStatsToFrontend( cps, &programStats ); + + DisplayAnalysis(); + return; + + } else if (strncmp(message,"++",2) == 0) { + /* Crafty 9.29+ outputs this */ + programStats.got_fail = 2; + return; + + } else if (strncmp(message,"--",2) == 0) { + /* Crafty 9.29+ outputs this */ + programStats.got_fail = 1; + return; + + } else if (thinkOutput[0] != NULLCHAR && + strncmp(message, " ", 4) == 0) { + unsigned message_len; + + p = message; + while (*p && *p == ' ') p++; + + message_len = strlen( p ); + + /* [AS] Avoid buffer overflow */ + if( sizeof(thinkOutput) - strlen(thinkOutput) - 1 > message_len ) { + strcat(thinkOutput, " "); + strcat(thinkOutput, p); + } + + if( sizeof(programStats.movelist) - strlen(programStats.movelist) - 1 > message_len ) { + strcat(programStats.movelist, " "); + strcat(programStats.movelist, p); + } + - if (currentMove == forwardMostMove || gameMode==AnalyzeMode || gameMode == AnalyzeFile) { ++ if (currentMove == forwardMostMove || gameMode==AnalyzeMode || ++ gameMode == AnalyzeFile || appData.icsEngineAnalyze) { + DisplayMove(currentMove - 1); + DisplayAnalysis(); + } + return; + } + } + else { + buf1[0] = NULLCHAR; + + if (sscanf(message, "%d%c %d %d %lu %[^\n]\n", + &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) + { + ChessProgramStats cpstats; + + if (plyext != ' ' && plyext != '\t') { + time *= 100; + } + + /* [AS] Negate score if machine is playing black and reporting absolute scores */ + if( cps->scoreIsAbsolute && ((gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) ) { + curscore = -curscore; + } + + cpstats.depth = plylev; + cpstats.nodes = nodes; + cpstats.time = time; + cpstats.score = curscore; + cpstats.got_only_move = 0; + cpstats.movelist[0] = '\0'; + + if (buf1[0] != NULLCHAR) { + safeStrCpy( cpstats.movelist, buf1, sizeof(cpstats.movelist) ); + } + + cpstats.ok_to_send = 0; + cpstats.line_is_book = 0; + cpstats.nr_moves = 0; + cpstats.moves_left = 0; + + SendProgramStatsToFrontend( cps, &cpstats ); + } + } + } + } + + + /* Parse a game score from the character string "game", and + record it as the history of the current game. The game + score is NOT assumed to start from the standard position. + The display is not updated in any way. + */ + void + ParseGameHistory(game) + char *game; + { + ChessMove moveType; + int fromX, fromY, toX, toY, boardIndex; + char promoChar; + char *p, *q; + char buf[MSG_SIZ]; + + if (appData.debugMode) + fprintf(debugFP, "Parsing game history: %s\n", game); + + if (gameInfo.event == NULL) gameInfo.event = StrSave("ICS game"); + gameInfo.site = StrSave(appData.icsHost); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + + /* Parse out names of players */ + while (*game == ' ') game++; + p = buf; + while (*game != ' ') *p++ = *game++; + *p = NULLCHAR; + gameInfo.white = StrSave(buf); + while (*game == ' ') game++; + p = buf; + while (*game != ' ' && *game != '\n') *p++ = *game++; + *p = NULLCHAR; + gameInfo.black = StrSave(buf); + + /* Parse moves */ + boardIndex = blackPlaysFirst ? 1 : 0; + yynewstr(game); + for (;;) { + yyboardindex = boardIndex; + moveType = (ChessMove) yylex(); + switch (moveType) { + case IllegalMove: /* maybe suicide chess, etc. */ + if (appData.debugMode) { + fprintf(debugFP, "Illegal move from ICS: '%s'\n", yy_text); + fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); + setbuf(debugFP, NULL); + } + case WhitePromotionChancellor: + case BlackPromotionChancellor: + case WhitePromotionArchbishop: + case BlackPromotionArchbishop: + case WhitePromotionQueen: + case BlackPromotionQueen: + case WhitePromotionRook: + case BlackPromotionRook: + case WhitePromotionBishop: + case BlackPromotionBishop: + case WhitePromotionKnight: + case BlackPromotionKnight: + case WhitePromotionKing: + case BlackPromotionKing: + case NormalMove: + case WhiteCapturesEnPassant: + case BlackCapturesEnPassant: + case WhiteKingSideCastle: + case WhiteQueenSideCastle: + case BlackKingSideCastle: + case BlackQueenSideCastle: + case WhiteKingSideCastleWild: + case WhiteQueenSideCastleWild: + case BlackKingSideCastleWild: + case BlackQueenSideCastleWild: + /* PUSH Fabien */ + case WhiteHSideCastleFR: + case WhiteASideCastleFR: + case BlackHSideCastleFR: + case BlackASideCastleFR: + /* POP Fabien */ + fromX = currentMoveString[0] - AAA; + fromY = currentMoveString[1] - ONE; + toX = currentMoveString[2] - AAA; + toY = currentMoveString[3] - ONE; + promoChar = currentMoveString[4]; + break; + case WhiteDrop: + case BlackDrop: + fromX = moveType == WhiteDrop ? + (int) CharToPiece(ToUpper(currentMoveString[0])) : + (int) CharToPiece(ToLower(currentMoveString[0])); + fromY = DROP_RANK; + toX = currentMoveString[2] - AAA; + toY = currentMoveString[3] - ONE; + promoChar = NULLCHAR; + break; + case AmbiguousMove: + /* bug? */ - sprintf(buf, "Ambiguous move in ICS output: \"%s\"", yy_text); ++ sprintf(buf, _("Ambiguous move in ICS output: \"%s\""), yy_text); + if (appData.debugMode) { + fprintf(debugFP, "Ambiguous move from ICS: '%s'\n", yy_text); + fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); + setbuf(debugFP, NULL); + } + DisplayError(buf, 0); + return; + case ImpossibleMove: + /* bug? */ - sprintf(buf, "Illegal move in ICS output: \"%s\"", yy_text); ++ sprintf(buf, _("Illegal move in ICS output: \"%s\""), yy_text); + if (appData.debugMode) { + fprintf(debugFP, "Impossible move from ICS: '%s'\n", yy_text); + fprintf(debugFP, "board L=%d, R=%d, H=%d, holdings=%d\n", BOARD_LEFT, BOARD_RGHT, BOARD_HEIGHT, gameInfo.holdingsWidth); + setbuf(debugFP, NULL); + } + DisplayError(buf, 0); + return; + case (ChessMove) 0: /* end of file */ + if (boardIndex < backwardMostMove) { + /* Oops, gap. How did that happen? */ - DisplayError("Gap in move list", 0); ++ DisplayError(_("Gap in move list"), 0); + return; + } + backwardMostMove = blackPlaysFirst ? 1 : 0; + if (boardIndex > forwardMostMove) { + forwardMostMove = boardIndex; + } + return; + case ElapsedTime: + if (boardIndex > (blackPlaysFirst ? 1 : 0)) { + strcat(parseList[boardIndex-1], " "); + strcat(parseList[boardIndex-1], yy_text); + } + continue; + case Comment: + case PGNTag: + case NAG: + default: + /* ignore */ + continue; + case WhiteWins: + case BlackWins: + case GameIsDrawn: + case GameUnfinished: + if (gameMode == IcsExamining) { + if (boardIndex < backwardMostMove) { + /* Oops, gap. How did that happen? */ + return; + } + backwardMostMove = blackPlaysFirst ? 1 : 0; + return; + } + gameInfo.result = moveType; + p = strchr(yy_text, '{'); + if (p == NULL) p = strchr(yy_text, '('); + if (p == NULL) { + p = yy_text; + if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; + } else { + q = strchr(p, *p == '{' ? '}' : ')'); + if (q != NULL) *q = NULLCHAR; + p++; + } + gameInfo.resultDetails = StrSave(p); + continue; + } + if (boardIndex >= forwardMostMove && + !(gameMode == IcsObserving && ics_gamenum == -1)) { + backwardMostMove = blackPlaysFirst ? 1 : 0; + return; + } + (void) CoordsToAlgebraic(boards[boardIndex], PosFlags(boardIndex), + EP_UNKNOWN, fromY, fromX, toY, toX, promoChar, + parseList[boardIndex]); + CopyBoard(boards[boardIndex + 1], boards[boardIndex]); + /* currentMoveString is set as a side-effect of yylex */ + strcpy(moveList[boardIndex], currentMoveString); + strcat(moveList[boardIndex], "\n"); + boardIndex++; + ApplyMove(fromX, fromY, toX, toY, promoChar, boards[boardIndex]); + switch (MateTest(boards[boardIndex], PosFlags(boardIndex), + EP_UNKNOWN, castlingRights[boardIndex]) ) { + case MT_NONE: + case MT_STALEMATE: + default: + break; + case MT_CHECK: + if(gameInfo.variant != VariantShogi) + strcat(parseList[boardIndex - 1], "+"); + break; + case MT_CHECKMATE: + strcat(parseList[boardIndex - 1], "#"); + break; + } + } + } + + + /* Apply a move to the given board */ + void + ApplyMove(fromX, fromY, toX, toY, promoChar, board) + int fromX, fromY, toX, toY; + int promoChar; + Board board; + { + ChessSquare captured = board[toY][toX], piece, king; int p, oldEP = EP_NONE, berolina = 0; + + /* [HGM] compute & store e.p. status and castling rights for new position */ + /* if we are updating a board for which those exist (i.e. in boards[]) */ + if((p = ((int)board - (int)boards[0])/((int)boards[1]-(int)boards[0])) < MAX_MOVES && p > 0) + { int i, j; + + if(gameInfo.variant == VariantBerolina) berolina = EP_BEROLIN_A; + oldEP = epStatus[p-1]; + epStatus[p] = EP_NONE; + + if( board[toY][toX] != EmptySquare ) + epStatus[p] = EP_CAPTURE; + + if( board[fromY][fromX] == WhitePawn ) { + if(fromY != toY) // [HGM] Xiangqi sideway Pawn moves should not count as 50-move breakers + epStatus[p] = EP_PAWN_MOVE; + if( toY-fromY==2) { + if(toX>BOARD_LEFT && board[toY][toX-1] == BlackPawn && + gameInfo.variant != VariantBerolina || toX < fromX) + epStatus[p] = toX | berolina; + if(toX fromX) + epStatus[p] = toX; + } + } else + if( board[fromY][fromX] == BlackPawn ) { + if(fromY != toY) // [HGM] Xiangqi sideway Pawn moves should not count as 50-move breakers + epStatus[p] = EP_PAWN_MOVE; + if( toY-fromY== -2) { + if(toX>BOARD_LEFT && board[toY][toX-1] == WhitePawn && + gameInfo.variant != VariantBerolina || toX < fromX) + epStatus[p] = toX | berolina; + if(toX fromX) + epStatus[p] = toX; + } + } + + for(i=0; i fromX) { + board[0][BOARD_RGHT-2] = WhiteKing; board[0][BOARD_RGHT-3] = WhiteRook; + } else { + board[0][BOARD_LEFT+2] = WhiteKing; board[0][BOARD_LEFT+3] = WhiteRook; + } + } else if (board[fromY][fromX] == BlackKing && + board[toY][toX] == BlackRook) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = EmptySquare; + if(toX > fromX) { + board[BOARD_HEIGHT-1][BOARD_RGHT-2] = BlackKing; board[BOARD_HEIGHT-1][BOARD_RGHT-3] = BlackRook; + } else { + board[BOARD_HEIGHT-1][BOARD_LEFT+2] = BlackKing; board[BOARD_HEIGHT-1][BOARD_LEFT+3] = BlackRook; + } + /* End of code added by Tord */ + + } else if (board[fromY][fromX] == king + && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ + && toY == fromY && toX > fromX+1) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = king; + board[toY][toX-1] = board[fromY][BOARD_RGHT-1]; + board[fromY][BOARD_RGHT-1] = EmptySquare; + } else if (board[fromY][fromX] == king + && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ + && toY == fromY && toX < fromX-1) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = king; + board[toY][toX+1] = board[fromY][BOARD_LEFT]; + board[fromY][BOARD_LEFT] = EmptySquare; + } else if (board[fromY][fromX] == WhitePawn + && toY == BOARD_HEIGHT-1 + && gameInfo.variant != VariantXiangqi + ) { + /* white pawn promotion */ + board[toY][toX] = CharToPiece(ToUpper(promoChar)); + if (board[toY][toX] == EmptySquare) { + board[toY][toX] = WhiteQueen; + } + if(gameInfo.variant==VariantBughouse || + gameInfo.variant==VariantCrazyhouse) /* [HGM] use shadow piece */ + board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); + board[fromY][fromX] = EmptySquare; + } else if ((fromY == BOARD_HEIGHT-4) + && (toX != fromX) + && gameInfo.variant != VariantXiangqi + && gameInfo.variant != VariantBerolina + && (board[fromY][fromX] == WhitePawn) + && (board[toY][toX] == EmptySquare)) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = WhitePawn; + captured = board[toY - 1][toX]; + board[toY - 1][toX] = EmptySquare; + } else if ((fromY == BOARD_HEIGHT-4) + && (toX == fromX) + && gameInfo.variant == VariantBerolina + && (board[fromY][fromX] == WhitePawn) + && (board[toY][toX] == EmptySquare)) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = WhitePawn; + if(oldEP & EP_BEROLIN_A) { + captured = board[fromY][fromX-1]; + board[fromY][fromX-1] = EmptySquare; + }else{ captured = board[fromY][fromX+1]; + board[fromY][fromX+1] = EmptySquare; + } + } else if (board[fromY][fromX] == king + && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ + && toY == fromY && toX > fromX+1) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = king; + board[toY][toX-1] = board[fromY][BOARD_RGHT-1]; + board[fromY][BOARD_RGHT-1] = EmptySquare; + } else if (board[fromY][fromX] == king + && fromX != BOARD_LEFT && fromX != BOARD_RGHT-1 // [HGM] cylinder */ + && toY == fromY && toX < fromX-1) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = king; + board[toY][toX+1] = board[fromY][BOARD_LEFT]; + board[fromY][BOARD_LEFT] = EmptySquare; + } else if (fromY == 7 && fromX == 3 + && board[fromY][fromX] == BlackKing + && toY == 7 && toX == 5) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = BlackKing; + board[fromY][7] = EmptySquare; + board[toY][4] = BlackRook; + } else if (fromY == 7 && fromX == 3 + && board[fromY][fromX] == BlackKing + && toY == 7 && toX == 1) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = BlackKing; + board[fromY][0] = EmptySquare; + board[toY][2] = BlackRook; + } else if (board[fromY][fromX] == BlackPawn + && toY == 0 + && gameInfo.variant != VariantXiangqi + ) { + /* black pawn promotion */ + board[0][toX] = CharToPiece(ToLower(promoChar)); + if (board[0][toX] == EmptySquare) { + board[0][toX] = BlackQueen; + } + if(gameInfo.variant==VariantBughouse || + gameInfo.variant==VariantCrazyhouse) /* [HGM] use shadow piece */ + board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); + board[fromY][fromX] = EmptySquare; + } else if ((fromY == 3) + && (toX != fromX) + && gameInfo.variant != VariantXiangqi + && gameInfo.variant != VariantBerolina + && (board[fromY][fromX] == BlackPawn) + && (board[toY][toX] == EmptySquare)) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = BlackPawn; + captured = board[toY + 1][toX]; + board[toY + 1][toX] = EmptySquare; + } else if ((fromY == 3) + && (toX == fromX) + && gameInfo.variant == VariantBerolina + && (board[fromY][fromX] == BlackPawn) + && (board[toY][toX] == EmptySquare)) { + board[fromY][fromX] = EmptySquare; + board[toY][toX] = BlackPawn; + if(oldEP & EP_BEROLIN_A) { + captured = board[fromY][fromX-1]; + board[fromY][fromX-1] = EmptySquare; + }else{ captured = board[fromY][fromX+1]; + board[fromY][fromX+1] = EmptySquare; + } + } else { + board[toY][toX] = board[fromY][fromX]; + board[fromY][fromX] = EmptySquare; + } + + /* [HGM] now we promote for Shogi, if needed */ + if(gameInfo.variant == VariantShogi && promoChar == 'q') + board[toY][toX] = (ChessSquare) (PROMOTED piece); + } + + if (gameInfo.holdingsWidth != 0) { + + /* !!A lot more code needs to be written to support holdings */ + /* [HGM] OK, so I have written it. Holdings are stored in the */ + /* penultimate board files, so they are automaticlly stored */ + /* in the game history. */ + if (fromY == DROP_RANK) { + /* Delete from holdings, by decreasing count */ + /* and erasing image if necessary */ + p = (int) fromX; + if(p < (int) BlackPawn) { /* white drop */ + p -= (int)WhitePawn; + if(p >= gameInfo.holdingsSize) p = 0; + if(--board[p][BOARD_WIDTH-2] == 0) + board[p][BOARD_WIDTH-1] = EmptySquare; + } else { /* black drop */ + p -= (int)BlackPawn; + if(p >= gameInfo.holdingsSize) p = 0; + if(--board[BOARD_HEIGHT-1-p][1] == 0) + board[BOARD_HEIGHT-1-p][0] = EmptySquare; + } + } + if (captured != EmptySquare && gameInfo.holdingsSize > 0 + && gameInfo.variant != VariantBughouse ) { + /* [HGM] holdings: Add to holdings, if holdings exist */ + if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) { + // [HGM] superchess: suppress flipping color of captured pieces by reverse pre-flip + captured = (int) captured >= (int) BlackPawn ? BLACK_TO_WHITE captured : WHITE_TO_BLACK captured; + } + p = (int) captured; + if (p >= (int) BlackPawn) { + p -= (int)BlackPawn; + if(gameInfo.variant == VariantShogi && DEMOTED p >= 0) { + /* in Shogi restore piece to its original first */ + captured = (ChessSquare) (DEMOTED captured); + p = DEMOTED p; + } + p = PieceToNumber((ChessSquare)p); + if(p >= gameInfo.holdingsSize) { p = 0; captured = BlackPawn; } + board[p][BOARD_WIDTH-2]++; + board[p][BOARD_WIDTH-1] = BLACK_TO_WHITE captured; + } else { + p -= (int)WhitePawn; + if(gameInfo.variant == VariantShogi && DEMOTED p >= 0) { + captured = (ChessSquare) (DEMOTED captured); + p = DEMOTED p; + } + p = PieceToNumber((ChessSquare)p); + if(p >= gameInfo.holdingsSize) { p = 0; captured = WhitePawn; } + board[BOARD_HEIGHT-1-p][1]++; + board[BOARD_HEIGHT-1-p][0] = WHITE_TO_BLACK captured; + } + } + + } else if (gameInfo.variant == VariantAtomic) { + if (captured != EmptySquare) { + int y, x; + for (y = toY-1; y <= toY+1; y++) { + for (x = toX-1; x <= toX+1; x++) { + if (y >= 0 && y < BOARD_HEIGHT && x >= BOARD_LEFT && x < BOARD_RGHT && + board[y][x] != WhitePawn && board[y][x] != BlackPawn) { + board[y][x] = EmptySquare; + } + } + } + board[toY][toX] = EmptySquare; + } + } + if(gameInfo.variant == VariantShogi && promoChar != NULLCHAR && promoChar != '=') { + /* [HGM] Shogi promotions */ + board[toY][toX] = (ChessSquare) (PROMOTED piece); + } + + } + + /* Updates forwardMostMove */ + void + MakeMove(fromX, fromY, toX, toY, promoChar) + int fromX, fromY, toX, toY; + int promoChar; + { + forwardMostMove++; + + if(serverMoves != NULL) { /* [HGM] write moves on file for broadcasting */ + int timeLeft; static int lastLoadFlag=0; int king, piece; + piece = boards[forwardMostMove-1][fromY][fromX]; + king = piece < (int) BlackPawn ? WhiteKing : BlackKing; + if(gameInfo.variant == VariantKnightmate) + king += (int) WhiteUnicorn - (int) WhiteKing; + if(forwardMostMove == 1) { + if(blackPlaysFirst) + fprintf(serverMoves, "%s;", second.tidy); + fprintf(serverMoves, "%s;", first.tidy); + if(!blackPlaysFirst) + fprintf(serverMoves, "%s;", second.tidy); + } else fprintf(serverMoves, loadFlag|lastLoadFlag ? ":" : ";"); + lastLoadFlag = loadFlag; + // print base move + fprintf(serverMoves, "%c%c:%c%c", AAA+fromX, ONE+fromY, AAA+toX, ONE+toY); + // print castling suffix + if( toY == fromY && piece == king ) { + if(toX-fromX > 1) + fprintf(serverMoves, ":%c%c:%c%c", AAA+BOARD_RGHT-1, ONE+fromY, AAA+toX-1,ONE+toY); + if(fromX-toX >1) + fprintf(serverMoves, ":%c%c:%c%c", AAA+BOARD_LEFT, ONE+fromY, AAA+toX+1,ONE+toY); + } + // e.p. suffix + if( (boards[forwardMostMove-1][fromY][fromX] == WhitePawn || + boards[forwardMostMove-1][fromY][fromX] == BlackPawn ) && + boards[forwardMostMove-1][toY][toX] == EmptySquare + && fromX != toX ) + fprintf(serverMoves, ":%c%c:%c%c", AAA+fromX, ONE+fromY, AAA+toX, ONE+fromY); + // promotion suffix + if(promoChar != NULLCHAR) + fprintf(serverMoves, ":%c:%c%c", promoChar, AAA+toX, ONE+toY); + if(!loadFlag) { + fprintf(serverMoves, "/%d/%d", + pvInfoList[forwardMostMove-1].depth, pvInfoList[forwardMostMove-1].score); + if(forwardMostMove & 1) timeLeft = whiteTimeRemaining/1000; + else timeLeft = blackTimeRemaining/1000; + fprintf(serverMoves, "/%d", timeLeft); + } + fflush(serverMoves); + } + + if (forwardMostMove >= MAX_MOVES) { - DisplayFatalError("Game too long; increase MAX_MOVES and recompile", ++ DisplayFatalError(_("Game too long; increase MAX_MOVES and recompile"), + 0, 1); + return; + } + SwitchClocks(); + timeRemaining[0][forwardMostMove] = whiteTimeRemaining; + timeRemaining[1][forwardMostMove] = blackTimeRemaining; + if (commentList[forwardMostMove] != NULL) { + free(commentList[forwardMostMove]); + commentList[forwardMostMove] = NULL; + } + CopyBoard(boards[forwardMostMove], boards[forwardMostMove - 1]); + ApplyMove(fromX, fromY, toX, toY, promoChar, boards[forwardMostMove]); + gameInfo.result = GameUnfinished; + if (gameInfo.resultDetails != NULL) { + free(gameInfo.resultDetails); + gameInfo.resultDetails = NULL; + } + CoordsToComputerAlgebraic(fromY, fromX, toY, toX, promoChar, + moveList[forwardMostMove - 1]); + (void) CoordsToAlgebraic(boards[forwardMostMove - 1], + PosFlags(forwardMostMove - 1), EP_UNKNOWN, + fromY, fromX, toY, toX, promoChar, + parseList[forwardMostMove - 1]); + switch (MateTest(boards[forwardMostMove], PosFlags(forwardMostMove), + epStatus[forwardMostMove], /* [HGM] use true e.p. */ + castlingRights[forwardMostMove]) ) { + case MT_NONE: + case MT_STALEMATE: + default: + break; + case MT_CHECK: + if(gameInfo.variant != VariantShogi) + strcat(parseList[forwardMostMove - 1], "+"); + break; + case MT_CHECKMATE: + strcat(parseList[forwardMostMove - 1], "#"); + break; + } + if (appData.debugMode) { + fprintf(debugFP, "move: %s, parse: %s (%c)\n", moveList[forwardMostMove-1], parseList[forwardMostMove-1], moveList[forwardMostMove-1][4]); + } + + } + + /* Updates currentMove if not pausing */ + void + ShowMove(fromX, fromY, toX, toY) + { + int instant = (gameMode == PlayFromGameFile) ? + (matchMode || (appData.timeDelay == 0 && !pausing)) : pausing; ++ if(appData.noGUI) return; + if (!pausing || gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { + if (!instant) { + if (forwardMostMove == currentMove + 1) { + AnimateMove(boards[forwardMostMove - 1], + fromX, fromY, toX, toY); + } + if (appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } + } + currentMove = forwardMostMove; + } + + if (instant) return; + + DisplayMove(currentMove - 1); + DrawPosition(FALSE, boards[currentMove]); + DisplayBothClocks(); + HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); + } + + void SendEgtPath(ChessProgramState *cps) + { /* [HGM] EGT: match formats given in feature with those given by user, and send info for each match */ + char buf[MSG_SIZ], name[MSG_SIZ], *p; + + if((p = cps->egtFormats) == NULL || appData.egtFormats == NULL) return; + + while(*p) { + char c, *q = name+1, *r, *s; + + name[0] = ','; // extract next format name from feature and copy with prefixed ',' + while(*p && *p != ',') *q++ = *p++; + *q++ = ':'; *q = 0; + if( appData.defaultPathEGTB && appData.defaultPathEGTB[0] && + strcmp(name, ",nalimov:") == 0 ) { + // take nalimov path from the menu-changeable option first, if it is defined + sprintf(buf, "egtpath nalimov %s\n", appData.defaultPathEGTB); + SendToProgram(buf,cps); // send egtbpath command for nalimov + } else + if( (s = StrStr(appData.egtFormats, name+1)) == appData.egtFormats || + (s = StrStr(appData.egtFormats, name)) != NULL) { + // format name occurs amongst user-supplied formats, at beginning or immediately after comma + s = r = StrStr(s, ":") + 1; // beginning of path info + while(*r && *r != ',') r++; // path info is everything upto next ';' or end of string + c = *r; *r = 0; // temporarily null-terminate path info + *--q = 0; // strip of trailig ':' from name + sprintf(buf, "egtbpath %s %s\n", name+1, s); + *r = c; + SendToProgram(buf,cps); // send egtbpath command for this format + } + if(*p == ',') p++; // read away comma to position for next format name + } + } + + void + InitChessProgram(cps, setup) + ChessProgramState *cps; + int setup; /* [HGM] needed to setup FRC opening position */ + { + char buf[MSG_SIZ], b[MSG_SIZ]; int overruled; + if (appData.noChessProgram) return; + hintRequested = FALSE; + bookRequested = FALSE; + + /* [HGM] some new WB protocol commands to configure engine are sent now, if engine supports them */ + /* moved to before sending initstring in 4.3.15, so Polyglot can delay UCI 'isready' to recepton of 'new' */ + if(cps->memSize) { /* [HGM] memory */ + sprintf(buf, "memory %d\n", appData.defaultHashSize + appData.defaultCacheSizeEGTB); + SendToProgram(buf, cps); + } + SendEgtPath(cps); /* [HGM] EGT */ + if(cps->maxCores) { /* [HGM] SMP: (protocol specified must be last settings command before new!) */ + sprintf(buf, "cores %d\n", appData.smpCores); + SendToProgram(buf, cps); + } + + SendToProgram(cps->initString, cps); + if (gameInfo.variant != VariantNormal && + gameInfo.variant != VariantLoadable + /* [HGM] also send variant if board size non-standard */ + || gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0 + ) { + char *v = VariantName(gameInfo.variant); + if (cps->protocolVersion != 1 && StrStr(cps->variants, v) == NULL) { + /* [HGM] in protocol 1 we have to assume all variants valid */ - sprintf(buf, "Variant %s not supported by %s", v, cps->tidy); ++ sprintf(buf, _("Variant %s not supported by %s"), v, cps->tidy); + DisplayFatalError(buf, 0, 1); + return; + } + + /* [HGM] make prefix for non-standard board size. Awkward testing... */ + overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantXiangqi ) + overruled = gameInfo.boardWidth != 9 || gameInfo.boardHeight != 10 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantShogi ) + overruled = gameInfo.boardWidth != 9 || gameInfo.boardHeight != 9 || gameInfo.holdingsSize != 7; + if( gameInfo.variant == VariantBughouse || gameInfo.variant == VariantCrazyhouse ) + overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 5; + if( gameInfo.variant == VariantCapablanca || gameInfo.variant == VariantCapaRandom || + gameInfo.variant == VariantGothic || gameInfo.variant == VariantFalcon ) + overruled = gameInfo.boardWidth != 10 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantCourier ) + overruled = gameInfo.boardWidth != 12 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 0; + if( gameInfo.variant == VariantSuper ) + overruled = gameInfo.boardWidth != 8 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 8; + if( gameInfo.variant == VariantGreat ) + overruled = gameInfo.boardWidth != 10 || gameInfo.boardHeight != 8 || gameInfo.holdingsSize != 8; + + if(overruled) { + sprintf(b, "%dx%d+%d_%s", gameInfo.boardWidth, gameInfo.boardHeight, + gameInfo.holdingsSize, VariantName(gameInfo.variant)); // cook up sized variant name + /* [HGM] varsize: try first if this defiant size variant is specifically known */ + if(StrStr(cps->variants, b) == NULL) { + // specific sized variant not known, check if general sizing allowed + if (cps->protocolVersion != 1) { // for protocol 1 we cannot check and hope for the best + if(StrStr(cps->variants, "boardsize") == NULL) { + sprintf(buf, "Board size %dx%d+%d not supported by %s", + gameInfo.boardWidth, gameInfo.boardHeight, gameInfo.holdingsSize, cps->tidy); + DisplayFatalError(buf, 0, 1); + return; + } + /* [HGM] here we really should compare with the maximum supported board size */ + } + } + } else sprintf(b, "%s", VariantName(gameInfo.variant)); + sprintf(buf, "variant %s\n", b); + SendToProgram(buf, cps); + } + currentlyInitializedVariant = gameInfo.variant; + + /* [HGM] send opening position in FRC to first engine */ + if(setup) { + SendToProgram("force\n", cps); + SendBoard(cps, 0); + /* engine is now in force mode! Set flag to wake it up after first move. */ + setboardSpoiledMachineBlack = 1; + } + + if (cps->sendICS) { + sprintf(buf, "ics %s\n", appData.icsActive ? appData.icsHost : "-"); + SendToProgram(buf, cps); + } + cps->maybeThinking = FALSE; + cps->offeredDraw = 0; + if (!appData.icsActive) { + SendTimeControl(cps, movesPerSession, timeControl, + timeIncrement, appData.searchDepth, + searchTime); + } + if (appData.showThinking + // [HGM] thinking: four options require thinking output to be sent + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp() + ) { + SendToProgram("post\n", cps); + } + SendToProgram("hard\n", cps); + if (!appData.ponderNextMove) { + /* Warning: "easy" is a toggle in GNU Chess, so don't send + it without being sure what state we are in first. "hard" + is not a toggle, so that one is OK. + */ + SendToProgram("easy\n", cps); + } + if (cps->usePing) { + sprintf(buf, "ping %d\n", ++cps->lastPing); + SendToProgram(buf, cps); + } + cps->initDone = TRUE; + } + + + void + StartChessProgram(cps) + ChessProgramState *cps; + { + char buf[MSG_SIZ]; + int err; + + if (appData.noChessProgram) return; + cps->initDone = FALSE; + + if (strcmp(cps->host, "localhost") == 0) { + err = StartChildProcess(cps->program, cps->dir, &cps->pr); + } else if (*appData.remoteShell == NULLCHAR) { + err = OpenRcmd(cps->host, appData.remoteUser, cps->program, &cps->pr); + } else { + if (*appData.remoteUser == NULLCHAR) { + sprintf(buf, "%s %s %s", appData.remoteShell, cps->host, + cps->program); + } else { + sprintf(buf, "%s %s -l %s %s", appData.remoteShell, + cps->host, appData.remoteUser, cps->program); + } + err = StartChildProcess(buf, "", &cps->pr); + } + + if (err != 0) { - sprintf(buf, "Startup failure on '%s'", cps->program); ++ sprintf(buf, _("Startup failure on '%s'"), cps->program); + DisplayFatalError(buf, err, 1); + cps->pr = NoProc; + cps->isr = NULL; + return; + } + + cps->isr = AddInputSource(cps->pr, TRUE, ReceiveFromProgram, cps); + if (cps->protocolVersion > 1) { + sprintf(buf, "xboard\nprotover %d\n", cps->protocolVersion); + cps->nrOptions = 0; // [HGM] options: clear all engine-specific options + cps->comboCnt = 0; // and values of combo boxes + SendToProgram(buf, cps); + } else { + SendToProgram("xboard\n", cps); + } + } + + + void + TwoMachinesEventIfReady P((void)) + { + if (first.lastPing != first.lastPong) { - DisplayMessage("", "Waiting for first chess program"); - ScheduleDelayedEvent(TwoMachinesEventIfReady, 1000); ++ DisplayMessage("", _("Waiting for first chess program")); ++ ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); // [HGM] fast: lowered from 1000 + return; + } + if (second.lastPing != second.lastPong) { - DisplayMessage("", "Waiting for second chess program"); - ScheduleDelayedEvent(TwoMachinesEventIfReady, 1000); ++ DisplayMessage("", _("Waiting for second chess program")); ++ ScheduleDelayedEvent(TwoMachinesEventIfReady, 10); // [HGM] fast: lowered from 1000 + return; + } + ThawUI(); + TwoMachinesEvent(); + } + + void + NextMatchGame P((void)) + { + int index; /* [HGM] autoinc: step lod index during match */ + Reset(FALSE, TRUE); + if (*appData.loadGameFile != NULLCHAR) { + index = appData.loadGameIndex; + if(index < 0) { // [HGM] autoinc + lastIndex = index = (index == -2 && first.twoMachinesColor[0] == 'b') ? lastIndex : lastIndex+1; + if(appData.rewindIndex > 0 && index > appData.rewindIndex) lastIndex = index = 1; + } + LoadGameFromFile(appData.loadGameFile, + index, + appData.loadGameFile, FALSE); + } else if (*appData.loadPositionFile != NULLCHAR) { + index = appData.loadPositionIndex; + if(index < 0) { // [HGM] autoinc + lastIndex = index = (index == -2 && first.twoMachinesColor[0] == 'b') ? lastIndex : lastIndex+1; + if(appData.rewindIndex > 0 && index > appData.rewindIndex) lastIndex = index = 1; + } + LoadPositionFromFile(appData.loadPositionFile, + index, + appData.loadPositionFile); + } + TwoMachinesEventIfReady(); + } + + void UserAdjudicationEvent( int result ) + { + ChessMove gameResult = GameIsDrawn; + + if( result > 0 ) { + gameResult = WhiteWins; + } + else if( result < 0 ) { + gameResult = BlackWins; + } + + if( gameMode == TwoMachinesPlay ) { + GameEnds( gameResult, "User adjudication", GE_XBOARD ); + } + } + + + void + GameEnds(result, resultDetails, whosays) + ChessMove result; + char *resultDetails; + int whosays; + { + GameMode nextGameMode; + int isIcsGame; + char buf[MSG_SIZ]; + + if(endingGame) return; /* [HGM] crash: forbid recursion */ + endingGame = 1; + + if (appData.debugMode) { + fprintf(debugFP, "GameEnds(%d, %s, %d)\n", + result, resultDetails ? resultDetails : "(null)", whosays); + } + + if (appData.icsActive && (whosays == GE_ENGINE || whosays >= GE_ENGINE1)) { + /* If we are playing on ICS, the server decides when the + game is over, but the engine can offer to draw, claim + a draw, or resign. + */ + #if ZIPPY + if (appData.zippyPlay && first.initDone) { + if (result == GameIsDrawn) { + /* In case draw still needs to be claimed */ + SendToICS(ics_prefix); + SendToICS("draw\n"); + } else if (StrCaseStr(resultDetails, "resign")) { + SendToICS(ics_prefix); + SendToICS("resign\n"); + } + } + #endif + endingGame = 0; /* [HGM] crash */ + return; + } + + /* If we're loading the game from a file, stop */ + if (whosays == GE_FILE) { + (void) StopLoadGameTimer(); + gameFileFP = NULL; + } + + /* Cancel draw offers */ + first.offeredDraw = second.offeredDraw = 0; + + /* If this is an ICS game, only ICS can really say it's done; + if not, anyone can. */ + isIcsGame = (gameMode == IcsPlayingWhite || + gameMode == IcsPlayingBlack || + gameMode == IcsObserving || + gameMode == IcsExamining); + + if (!isIcsGame || whosays == GE_ICS) { + /* OK -- not an ICS game, or ICS said it was done */ + StopClocks(); + if (!isIcsGame && !appData.noChessProgram) + SetUserThinkingEnables(); + + /* [HGM] if a machine claims the game end we verify this claim */ + if(gameMode == TwoMachinesPlay && appData.testClaims) { + if(appData.testLegality && whosays >= GE_ENGINE1 ) { + char claimer; + + claimer = whosays == GE_ENGINE1 ? /* color of claimer */ + first.twoMachinesColor[0] : + second.twoMachinesColor[0] ; + if( (gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) && + (result == WhiteWins && claimer == 'w' || + result == BlackWins && claimer == 'b' ) ) { + if (appData.debugMode) { + fprintf(debugFP, "result=%d sp=%d move=%d\n", + result, epStatus[forwardMostMove], forwardMostMove); + } + /* [HGM] verify: engine mate claims accepted if they were flagged */ + if(epStatus[forwardMostMove] != EP_CHECKMATE && + result != (WhiteOnMove(forwardMostMove) ? WhiteWins : BlackWins)) { + sprintf(buf, "False win claim: '%s'", resultDetails); + result = claimer == 'w' ? BlackWins : WhiteWins; + resultDetails = buf; + } + } else + if( result == GameIsDrawn && epStatus[forwardMostMove] > EP_DRAWS + && (forwardMostMove <= backwardMostMove || + epStatus[forwardMostMove-1] > EP_DRAWS || + (claimer=='b')==(forwardMostMove&1)) + ) { + /* [HGM] verify: draws that were not flagged are false claims */ + sprintf(buf, "False draw claim: '%s'", resultDetails); + result = claimer == 'w' ? BlackWins : WhiteWins; + resultDetails = buf; + } + /* (Claiming a loss is accepted no questions asked!) */ + } + /* [HGM] bare: don't allow bare King to win */ + if((gameInfo.holdingsWidth == 0 || gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) + && result != GameIsDrawn) + { int i, j, k=0, color = (result==WhiteWins ? (int)WhitePawn : (int)BlackPawn); + for(j=BOARD_LEFT; j= 0 && p <= (int)WhiteKing) k++; + } + if (appData.debugMode) { + fprintf(debugFP, "GE(%d, %s, %d) bare king k=%d color=%d\n", + result, resultDetails ? resultDetails : "(null)", whosays, k, color); + } + if(k <= 1) { + result = GameIsDrawn; + sprintf(buf, "%s but bare king", resultDetails); + resultDetails = buf; + } + } + } + + + if(serverMoves != NULL && !loadFlag) { char c = '='; + if(result==WhiteWins) c = '+'; + if(result==BlackWins) c = '-'; + if(resultDetails != NULL) + fprintf(serverMoves, ";%c;%s\n", c, resultDetails); + } + if (resultDetails != NULL) { + gameInfo.result = result; + gameInfo.resultDetails = StrSave(resultDetails); + + /* display last move only if game was not loaded from file */ + if ((whosays != GE_FILE) && (currentMove == forwardMostMove)) + DisplayMove(currentMove - 1); + + if (forwardMostMove != 0) { + if (gameMode != PlayFromGameFile && gameMode != EditGame) { + if (*appData.saveGameFile != NULLCHAR) { + SaveGameToFile(appData.saveGameFile, TRUE); + } else if (appData.autoSaveGames) { + AutoSaveGame(); + } + if (*appData.savePositionFile != NULLCHAR) { + SavePositionToFile(appData.savePositionFile); + } + } + } + + /* Tell program how game ended in case it is learning */ + /* [HGM] Moved this to after saving the PGN, just in case */ + /* engine died and we got here through time loss. In that */ + /* case we will get a fatal error writing the pipe, which */ + /* would otherwise lose us the PGN. */ + /* [HGM] crash: not needed anymore, but doesn't hurt; */ + /* output during GameEnds should never be fatal anymore */ + if (gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack || + gameMode == TwoMachinesPlay || + gameMode == IcsPlayingWhite || + gameMode == IcsPlayingBlack || + gameMode == BeginningOfGame) { + char buf[MSG_SIZ]; + sprintf(buf, "result %s {%s}\n", PGNResult(result), + resultDetails); + if (first.pr != NoProc) { + SendToProgram(buf, &first); + } + if (second.pr != NoProc && + gameMode == TwoMachinesPlay) { + SendToProgram(buf, &second); + } + } + } + + if (appData.icsActive) { + if (appData.quietPlay && + (gameMode == IcsPlayingWhite || + gameMode == IcsPlayingBlack)) { + SendToICS(ics_prefix); + SendToICS("set shout 1\n"); + } + nextGameMode = IcsIdle; + ics_user_moved = FALSE; + /* clean up premove. It's ugly when the game has ended and the + * premove highlights are still on the board. + */ + if (gotPremove) { + gotPremove = FALSE; + ClearPremoveHighlights(); + DrawPosition(FALSE, boards[currentMove]); + } + if (whosays == GE_ICS) { + switch (result) { + case WhiteWins: + if (gameMode == IcsPlayingWhite) + PlayIcsWinSound(); + else if(gameMode == IcsPlayingBlack) + PlayIcsLossSound(); + break; + case BlackWins: + if (gameMode == IcsPlayingBlack) + PlayIcsWinSound(); + else if(gameMode == IcsPlayingWhite) + PlayIcsLossSound(); + break; + case GameIsDrawn: + PlayIcsDrawSound(); + break; + default: + PlayIcsUnfinishedSound(); + } + } + } else if (gameMode == EditGame || + gameMode == PlayFromGameFile || + gameMode == AnalyzeMode || + gameMode == AnalyzeFile) { + nextGameMode = gameMode; + } else { + nextGameMode = EndOfGame; + } + pausing = FALSE; + ModeHighlight(); + } else { + nextGameMode = gameMode; + } + + if (appData.noChessProgram) { + gameMode = nextGameMode; + ModeHighlight(); + endingGame = 0; /* [HGM] crash */ + return; + } + + if (first.reuse) { + /* Put first chess program into idle state */ + if (first.pr != NoProc && + (gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack || + gameMode == TwoMachinesPlay || + gameMode == IcsPlayingWhite || + gameMode == IcsPlayingBlack || + gameMode == BeginningOfGame)) { + SendToProgram("force\n", &first); + if (first.usePing) { + char buf[MSG_SIZ]; + sprintf(buf, "ping %d\n", ++first.lastPing); + SendToProgram(buf, &first); + } + } + } else if (result != GameUnfinished || nextGameMode == IcsIdle) { + /* Kill off first chess program */ + if (first.isr != NULL) + RemoveInputSource(first.isr); + first.isr = NULL; + + if (first.pr != NoProc) { + ExitAnalyzeMode(); + DoSleep( appData.delayBeforeQuit ); + SendToProgram("quit\n", &first); + DoSleep( appData.delayAfterQuit ); + DestroyChildProcess(first.pr, first.useSigterm); + } + first.pr = NoProc; + } + if (second.reuse) { + /* Put second chess program into idle state */ + if (second.pr != NoProc && + gameMode == TwoMachinesPlay) { + SendToProgram("force\n", &second); + if (second.usePing) { + char buf[MSG_SIZ]; + sprintf(buf, "ping %d\n", ++second.lastPing); + SendToProgram(buf, &second); + } + } + } else if (result != GameUnfinished || nextGameMode == IcsIdle) { + /* Kill off second chess program */ + if (second.isr != NULL) + RemoveInputSource(second.isr); + second.isr = NULL; + + if (second.pr != NoProc) { + DoSleep( appData.delayBeforeQuit ); + SendToProgram("quit\n", &second); + DoSleep( appData.delayAfterQuit ); + DestroyChildProcess(second.pr, second.useSigterm); + } + second.pr = NoProc; + } + + if (matchMode && gameMode == TwoMachinesPlay) { + switch (result) { + case WhiteWins: + if (first.twoMachinesColor[0] == 'w') { + first.matchWins++; + } else { + second.matchWins++; + } + break; + case BlackWins: + if (first.twoMachinesColor[0] == 'b') { + first.matchWins++; + } else { + second.matchWins++; + } + break; + default: + break; + } + if (matchGame < appData.matchGames) { + char *tmp; + if(appData.sameColorGames <= 1) { /* [HGM] alternate: suppress color swap */ + tmp = first.twoMachinesColor; + first.twoMachinesColor = second.twoMachinesColor; + second.twoMachinesColor = tmp; + } + gameMode = nextGameMode; + matchGame++; + if(appData.matchPause>10000 || appData.matchPause<10) + appData.matchPause = 10000; /* [HGM] make pause adjustable */ + ScheduleDelayedEvent(NextMatchGame, appData.matchPause); + endingGame = 0; /* [HGM] crash */ + return; + } else { + char buf[MSG_SIZ]; + gameMode = nextGameMode; - sprintf(buf, "Match %s vs. %s: final score %d-%d-%d", ++ sprintf(buf, _("Match %s vs. %s: final score %d-%d-%d"), + first.tidy, second.tidy, + first.matchWins, second.matchWins, + appData.matchGames - (first.matchWins + second.matchWins)); + DisplayFatalError(buf, 0, 0); + } + } + if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && + !(nextGameMode == AnalyzeMode || nextGameMode == AnalyzeFile)) + ExitAnalyzeMode(); + gameMode = nextGameMode; + ModeHighlight(); + endingGame = 0; /* [HGM] crash */ + } + + /* Assumes program was just initialized (initString sent). + Leaves program in force mode. */ + void + FeedMovesToProgram(cps, upto) + ChessProgramState *cps; + int upto; + { + int i; + + if (appData.debugMode) + fprintf(debugFP, "Feeding %smoves %d through %d to %s chess program\n", + startedFromSetupPosition ? "position and " : "", + backwardMostMove, upto, cps->which); + if(currentlyInitializedVariant != gameInfo.variant) { char buf[MSG_SIZ]; + // [HGM] variantswitch: make engine aware of new variant + if(cps->protocolVersion > 1 && StrStr(cps->variants, VariantName(gameInfo.variant)) == NULL) + return; // [HGM] refrain from feeding moves altogether if variant is unsupported! + sprintf(buf, "variant %s\n", VariantName(gameInfo.variant)); + SendToProgram(buf, cps); + currentlyInitializedVariant = gameInfo.variant; + } + SendToProgram("force\n", cps); + if (startedFromSetupPosition) { + SendBoard(cps, backwardMostMove); + if (appData.debugMode) { + fprintf(debugFP, "feedMoves\n"); + } + } + for (i = backwardMostMove; i < upto; i++) { + SendMoveToProgram(i, cps); + } + } + + + void + ResurrectChessProgram() + { + /* The chess program may have exited. + If so, restart it and feed it all the moves made so far. */ + + if (appData.noChessProgram || first.pr != NoProc) return; + + StartChessProgram(&first); + InitChessProgram(&first, FALSE); + FeedMovesToProgram(&first, currentMove); + + if (!first.sendTime) { + /* can't tell gnuchess what its clock should read, + so we bow to its notion. */ + ResetClocks(); + timeRemaining[0][currentMove] = whiteTimeRemaining; + timeRemaining[1][currentMove] = blackTimeRemaining; + } + - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && - first.analysisSupport) { ++ if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile || ++ appData.icsEngineAnalyze) && first.analysisSupport) { + SendToProgram("analyze\n", &first); + first.analyzing = TRUE; + } + } + + /* + * Button procedures + */ + void + Reset(redraw, init) + int redraw, init; + { + int i; + + if (appData.debugMode) { + fprintf(debugFP, "Reset(%d, %d) from gameMode %d\n", + redraw, init, gameMode); + } + pausing = pauseExamInvalid = FALSE; + startedFromSetupPosition = blackPlaysFirst = FALSE; + firstMove = TRUE; + whiteFlag = blackFlag = FALSE; + userOfferedDraw = FALSE; + hintRequested = bookRequested = FALSE; + first.maybeThinking = FALSE; + second.maybeThinking = FALSE; + first.bookSuspend = FALSE; // [HGM] book + second.bookSuspend = FALSE; + thinkOutput[0] = NULLCHAR; + lastHint[0] = NULLCHAR; + ClearGameInfo(&gameInfo); + gameInfo.variant = StringToVariant(appData.variant); + ics_user_moved = ics_clock_paused = FALSE; + ics_getting_history = H_FALSE; + ics_gamenum = -1; + white_holding[0] = black_holding[0] = NULLCHAR; + ClearProgramStats(); + opponentKibitzes = FALSE; // [HGM] kibitz: do not reserve space in engine-output window in zippy mode + + ResetFrontEnd(); + ClearHighlights(); + flipView = appData.flipView; + ClearPremoveHighlights(); + gotPremove = FALSE; + alarmSounded = FALSE; + + GameEnds((ChessMove) 0, NULL, GE_PLAYER); + if(appData.serverMovesName != NULL) { + /* [HGM] prepare to make moves file for broadcasting */ + clock_t t = clock(); + if(serverMoves != NULL) fclose(serverMoves); + serverMoves = fopen(appData.serverMovesName, "r"); + if(serverMoves != NULL) { + fclose(serverMoves); + /* delay 15 sec before overwriting, so all clients can see end */ + while(clock()-t < appData.serverPause*CLOCKS_PER_SEC); + } + serverMoves = fopen(appData.serverMovesName, "w"); + } + + ExitAnalyzeMode(); + gameMode = BeginningOfGame; + ModeHighlight(); + if(appData.icsActive) gameInfo.variant = VariantNormal; + InitPosition(redraw); + for (i = 0; i < MAX_MOVES; i++) { + if (commentList[i] != NULL) { + free(commentList[i]); + commentList[i] = NULL; + } + } + ResetClocks(); + timeRemaining[0][0] = whiteTimeRemaining; + timeRemaining[1][0] = blackTimeRemaining; + if (first.pr == NULL) { + StartChessProgram(&first); + } + if (init) { + InitChessProgram(&first, startedFromSetupPosition); + } + DisplayTitle(""); + DisplayMessage("", ""); + HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); + } + + void + AutoPlayGameLoop() + { + for (;;) { + if (!AutoPlayOneMove()) + return; + if (matchMode || appData.timeDelay == 0) + continue; + if (appData.timeDelay < 0 || gameMode == AnalyzeFile) + return; + StartLoadGameTimer((long)(1000.0 * appData.timeDelay)); + break; + } + } + + + int + AutoPlayOneMove() + { + int fromX, fromY, toX, toY; + + if (appData.debugMode) { + fprintf(debugFP, "AutoPlayOneMove(): current %d\n", currentMove); + } + + if (gameMode != PlayFromGameFile) + return FALSE; + + if (currentMove >= forwardMostMove) { + gameMode = EditGame; + ModeHighlight(); + + /* [AS] Clear current move marker at the end of a game */ + /* HistorySet(parseList, backwardMostMove, forwardMostMove, -1); */ + + return FALSE; + } + + toX = moveList[currentMove][2] - AAA; + toY = moveList[currentMove][3] - ONE; + + if (moveList[currentMove][1] == '@') { + if (appData.highlightLastMove) { + SetHighlights(-1, -1, toX, toY); + } + } else { + fromX = moveList[currentMove][0] - AAA; + fromY = moveList[currentMove][1] - ONE; + + HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove); /* [AS] */ + + AnimateMove(boards[currentMove], fromX, fromY, toX, toY); + + if (appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } + } + DisplayMove(currentMove); + SendMoveToProgram(currentMove++, &first); + DisplayBothClocks(); + DrawPosition(FALSE, boards[currentMove]); + // [HGM] PV info: always display, routine tests if empty + DisplayComment(currentMove - 1, commentList[currentMove]); + return TRUE; + } + + + int + LoadGameOneMove(readAhead) + ChessMove readAhead; + { + int fromX = 0, fromY = 0, toX = 0, toY = 0, done; + char promoChar = NULLCHAR; + ChessMove moveType; + char move[MSG_SIZ]; + char *p, *q; + + if (gameMode != PlayFromGameFile && gameMode != AnalyzeFile && + gameMode != AnalyzeMode && gameMode != Training) { + gameFileFP = NULL; + return FALSE; + } + + yyboardindex = forwardMostMove; + if (readAhead != (ChessMove)0) { + moveType = readAhead; + } else { + if (gameFileFP == NULL) + return FALSE; + moveType = (ChessMove) yylex(); + } + + done = FALSE; + switch (moveType) { + case Comment: + if (appData.debugMode) + fprintf(debugFP, "Parsed Comment: %s\n", yy_text); + p = yy_text; + if (*p == '{' || *p == '[' || *p == '(') { + p[strlen(p) - 1] = NULLCHAR; + p++; + } + + /* append the comment but don't display it */ + while (*p == '\n') p++; + AppendComment(currentMove, p); + return TRUE; + + case WhiteCapturesEnPassant: + case BlackCapturesEnPassant: + case WhitePromotionChancellor: + case BlackPromotionChancellor: + case WhitePromotionArchbishop: + case BlackPromotionArchbishop: + case WhitePromotionCentaur: + case BlackPromotionCentaur: + case WhitePromotionQueen: + case BlackPromotionQueen: + case WhitePromotionRook: + case BlackPromotionRook: + case WhitePromotionBishop: + case BlackPromotionBishop: + case WhitePromotionKnight: + case BlackPromotionKnight: + case WhitePromotionKing: + case BlackPromotionKing: + case NormalMove: + case WhiteKingSideCastle: + case WhiteQueenSideCastle: + case BlackKingSideCastle: + case BlackQueenSideCastle: + case WhiteKingSideCastleWild: + case WhiteQueenSideCastleWild: + case BlackKingSideCastleWild: + case BlackQueenSideCastleWild: + /* PUSH Fabien */ + case WhiteHSideCastleFR: + case WhiteASideCastleFR: + case BlackHSideCastleFR: + case BlackASideCastleFR: + /* POP Fabien */ + if (appData.debugMode) + fprintf(debugFP, "Parsed %s into %s\n", yy_text, currentMoveString); + fromX = currentMoveString[0] - AAA; + fromY = currentMoveString[1] - ONE; + toX = currentMoveString[2] - AAA; + toY = currentMoveString[3] - ONE; + promoChar = currentMoveString[4]; + break; + + case WhiteDrop: + case BlackDrop: + if (appData.debugMode) + fprintf(debugFP, "Parsed %s into %s\n", yy_text, currentMoveString); + fromX = moveType == WhiteDrop ? + (int) CharToPiece(ToUpper(currentMoveString[0])) : + (int) CharToPiece(ToLower(currentMoveString[0])); + fromY = DROP_RANK; + toX = currentMoveString[2] - AAA; + toY = currentMoveString[3] - ONE; + break; + + case WhiteWins: + case BlackWins: + case GameIsDrawn: + case GameUnfinished: + if (appData.debugMode) + fprintf(debugFP, "Parsed game end: %s\n", yy_text); + p = strchr(yy_text, '{'); + if (p == NULL) p = strchr(yy_text, '('); + if (p == NULL) { + p = yy_text; + if (p[0] == '0' || p[0] == '1' || p[0] == '*') p = ""; + } else { + q = strchr(p, *p == '{' ? '}' : ')'); + if (q != NULL) *q = NULLCHAR; + p++; + } + GameEnds(moveType, p, GE_FILE); + done = TRUE; + if (cmailMsgLoaded) { + ClearHighlights(); + flipView = WhiteOnMove(currentMove); + if (moveType == GameUnfinished) flipView = !flipView; + if (appData.debugMode) + fprintf(debugFP, "Setting flipView to %d\n", flipView) ; + } + break; + + case (ChessMove) 0: /* end of file */ + if (appData.debugMode) + fprintf(debugFP, "Parser hit end of file\n"); + switch (MateTest(boards[currentMove], PosFlags(currentMove), + EP_UNKNOWN, castlingRights[currentMove]) ) { + case MT_NONE: + case MT_CHECK: + break; + case MT_CHECKMATE: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "Black mates", GE_FILE); + } else { + GameEnds(WhiteWins, "White mates", GE_FILE); + } + break; + case MT_STALEMATE: + GameEnds(GameIsDrawn, "Stalemate", GE_FILE); + break; + } + done = TRUE; + break; + + case MoveNumberOne: + if (lastLoadGameStart == GNUChessGame) { + /* GNUChessGames have numbers, but they aren't move numbers */ + if (appData.debugMode) + fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", + yy_text, (int) moveType); + return LoadGameOneMove((ChessMove)0); /* tail recursion */ + } + /* else fall thru */ + + case XBoardGame: + case GNUChessGame: + case PGNTag: + /* Reached start of next game in file */ + if (appData.debugMode) + fprintf(debugFP, "Parsed start of next game: %s\n", yy_text); + switch (MateTest(boards[currentMove], PosFlags(currentMove), + EP_UNKNOWN, castlingRights[currentMove]) ) { + case MT_NONE: + case MT_CHECK: + break; + case MT_CHECKMATE: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "Black mates", GE_FILE); + } else { + GameEnds(WhiteWins, "White mates", GE_FILE); + } + break; + case MT_STALEMATE: + GameEnds(GameIsDrawn, "Stalemate", GE_FILE); + break; + } + done = TRUE; + break; + + case PositionDiagram: /* should not happen; ignore */ + case ElapsedTime: /* ignore */ + case NAG: /* ignore */ + if (appData.debugMode) + fprintf(debugFP, "Parser ignoring: '%s' (%d)\n", + yy_text, (int) moveType); + return LoadGameOneMove((ChessMove)0); /* tail recursion */ + + case IllegalMove: + if (appData.testLegality) { + if (appData.debugMode) + fprintf(debugFP, "Parsed IllegalMove: %s\n", yy_text); - sprintf(move, "Illegal move: %d.%s%s", ++ sprintf(move, _("Illegal move: %d.%s%s"), + (forwardMostMove / 2) + 1, + WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); + DisplayError(move, 0); + done = TRUE; + } else { + if (appData.debugMode) + fprintf(debugFP, "Parsed %s into IllegalMove %s\n", + yy_text, currentMoveString); + fromX = currentMoveString[0] - AAA; + fromY = currentMoveString[1] - ONE; + toX = currentMoveString[2] - AAA; + toY = currentMoveString[3] - ONE; + promoChar = currentMoveString[4]; + } + break; + + case AmbiguousMove: + if (appData.debugMode) + fprintf(debugFP, "Parsed AmbiguousMove: %s\n", yy_text); - sprintf(move, "Ambiguous move: %d.%s%s", ++ sprintf(move, _("Ambiguous move: %d.%s%s"), + (forwardMostMove / 2) + 1, + WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); + DisplayError(move, 0); + done = TRUE; + break; + + default: + case ImpossibleMove: + if (appData.debugMode) + fprintf(debugFP, "Parsed ImpossibleMove (type = %d): %s\n", moveType, yy_text); - sprintf(move, "Illegal move: %d.%s%s", ++ sprintf(move, _("Illegal move: %d.%s%s"), + (forwardMostMove / 2) + 1, + WhiteOnMove(forwardMostMove) ? " " : ".. ", yy_text); + DisplayError(move, 0); + done = TRUE; + break; + } + + if (done) { + if (appData.matchMode || (appData.timeDelay == 0 && !pausing)) { + DrawPosition(FALSE, boards[currentMove]); + DisplayBothClocks(); + if (!appData.matchMode) // [HGM] PV info: routine tests if empty + DisplayComment(currentMove - 1, commentList[currentMove]); + } + (void) StopLoadGameTimer(); + gameFileFP = NULL; + cmailOldMove = forwardMostMove; + return FALSE; + } else { + /* currentMoveString is set as a side-effect of yylex */ + strcat(currentMoveString, "\n"); + strcpy(moveList[forwardMostMove], currentMoveString); + + thinkOutput[0] = NULLCHAR; + MakeMove(fromX, fromY, toX, toY, promoChar); + currentMove = forwardMostMove; + return TRUE; + } + } + + /* Load the nth game from the given file */ + int + LoadGameFromFile(filename, n, title, useList) + char *filename; + int n; + char *title; + /*Boolean*/ int useList; + { + FILE *f; + char buf[MSG_SIZ]; + + if (strcmp(filename, "-") == 0) { + f = stdin; + title = "stdin"; + } else { + f = fopen(filename, "rb"); + if (f == NULL) { - sprintf(buf, "Can't open \"%s\"", filename); ++ sprintf(buf, _("Can't open \"%s\""), filename); + DisplayError(buf, errno); + return FALSE; + } + } + if (fseek(f, 0, 0) == -1) { + /* f is not seekable; probably a pipe */ + useList = FALSE; + } + if (useList && n == 0) { + int error = GameListBuild(f); + if (error) { - DisplayError("Cannot build game list", error); ++ DisplayError(_("Cannot build game list"), error); + } else if (!ListEmpty(&gameList) && + ((ListGame *) gameList.tailPred)->number > 1) { + GameListPopUp(f, title); + return TRUE; + } + GameListDestroy(); + n = 1; + } + if (n == 0) n = 1; + return LoadGame(f, n, title, FALSE); + } + + + void + MakeRegisteredMove() + { + int fromX, fromY, toX, toY; + char promoChar; + if (cmailMoveRegistered[lastLoadGameNumber - 1]) { + switch (cmailMoveType[lastLoadGameNumber - 1]) { + case CMAIL_MOVE: + case CMAIL_DRAW: + if (appData.debugMode) + fprintf(debugFP, "Restoring %s for game %d\n", + cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); + + thinkOutput[0] = NULLCHAR; + strcpy(moveList[currentMove], cmailMove[lastLoadGameNumber - 1]); + fromX = cmailMove[lastLoadGameNumber - 1][0] - AAA; + fromY = cmailMove[lastLoadGameNumber - 1][1] - ONE; + toX = cmailMove[lastLoadGameNumber - 1][2] - AAA; + toY = cmailMove[lastLoadGameNumber - 1][3] - ONE; + promoChar = cmailMove[lastLoadGameNumber - 1][4]; + MakeMove(fromX, fromY, toX, toY, promoChar); + ShowMove(fromX, fromY, toX, toY); + + switch (MateTest(boards[currentMove], PosFlags(currentMove), + EP_UNKNOWN, castlingRights[currentMove]) ) { + case MT_NONE: + case MT_CHECK: + break; + + case MT_CHECKMATE: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "Black mates", GE_PLAYER); + } else { + GameEnds(WhiteWins, "White mates", GE_PLAYER); + } + break; + + case MT_STALEMATE: + GameEnds(GameIsDrawn, "Stalemate", GE_PLAYER); + break; + } + + break; + + case CMAIL_RESIGN: + if (WhiteOnMove(currentMove)) { + GameEnds(BlackWins, "White resigns", GE_PLAYER); + } else { + GameEnds(WhiteWins, "Black resigns", GE_PLAYER); + } + break; + + case CMAIL_ACCEPT: + GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); + break; + + default: + break; + } + } + + return; + } + + /* Wrapper around LoadGame for use when a Cmail message is loaded */ + int + CmailLoadGame(f, gameNumber, title, useList) + FILE *f; + int gameNumber; + char *title; + int useList; + { + int retVal; + + if (gameNumber > nCmailGames) { - DisplayError("No more games in this message", 0); ++ DisplayError(_("No more games in this message"), 0); + return FALSE; + } + if (f == lastLoadGameFP) { + int offset = gameNumber - lastLoadGameNumber; + if (offset == 0) { + cmailMsg[0] = NULLCHAR; + if (cmailMoveRegistered[lastLoadGameNumber - 1]) { + cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; + nCmailMovesRegistered--; + } + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; + if (cmailResult[lastLoadGameNumber - 1] == CMAIL_NEW_RESULT) { + cmailResult[lastLoadGameNumber - 1] = CMAIL_NOT_RESULT; + } + } else { + if (! RegisterMove()) return FALSE; + } + } + + retVal = LoadGame(f, gameNumber, title, useList); + + /* Make move registered during previous look at this game, if any */ + MakeRegisteredMove(); + + if (cmailCommentList[lastLoadGameNumber - 1] != NULL) { + commentList[currentMove] + = StrSave(cmailCommentList[lastLoadGameNumber - 1]); + DisplayComment(currentMove - 1, commentList[currentMove]); + } + + return retVal; + } + + /* Support for LoadNextGame, LoadPreviousGame, ReloadSameGame */ + int + ReloadGame(offset) + int offset; + { + int gameNumber = lastLoadGameNumber + offset; + if (lastLoadGameFP == NULL) { - DisplayError("No game has been loaded yet", 0); ++ DisplayError(_("No game has been loaded yet"), 0); + return FALSE; + } + if (gameNumber <= 0) { - DisplayError("Can't back up any further", 0); ++ DisplayError(_("Can't back up any further"), 0); + return FALSE; + } + if (cmailMsgLoaded) { + return CmailLoadGame(lastLoadGameFP, gameNumber, + lastLoadGameTitle, lastLoadGameUseList); + } else { + return LoadGame(lastLoadGameFP, gameNumber, + lastLoadGameTitle, lastLoadGameUseList); + } + } + + + + /* Load the nth game from open file f */ + int + LoadGame(f, gameNumber, title, useList) + FILE *f; + int gameNumber; + char *title; + int useList; + { + ChessMove cm; + char buf[MSG_SIZ]; + int gn = gameNumber; + ListGame *lg = NULL; + int numPGNTags = 0; + int err; + GameMode oldGameMode; + VariantClass oldVariant = gameInfo.variant; /* [HGM] PGNvariant */ + + if (appData.debugMode) + fprintf(debugFP, "LoadGame(): on entry, gameMode %d\n", gameMode); + + if (gameMode == Training ) + SetTrainingModeOff(); + + oldGameMode = gameMode; + if (gameMode != BeginningOfGame) { + Reset(FALSE, TRUE); + } + + gameFileFP = f; + if (lastLoadGameFP != NULL && lastLoadGameFP != f) { + fclose(lastLoadGameFP); + } + + if (useList) { + lg = (ListGame *) ListElem(&gameList, gameNumber-1); + + if (lg) { + fseek(f, lg->offset, 0); + GameListHighlight(gameNumber); + gn = 1; + } + else { - DisplayError("Game number out of range", 0); ++ DisplayError(_("Game number out of range"), 0); + return FALSE; + } + } else { + GameListDestroy(); + if (fseek(f, 0, 0) == -1) { + if (f == lastLoadGameFP ? + gameNumber == lastLoadGameNumber + 1 : + gameNumber == 1) { + gn = 1; + } else { - DisplayError("Can't seek on game file", 0); ++ DisplayError(_("Can't seek on game file"), 0); + return FALSE; + } + } + } + lastLoadGameFP = f; + lastLoadGameNumber = gameNumber; + strcpy(lastLoadGameTitle, title); + lastLoadGameUseList = useList; + + yynewfile(f); + + if (lg && lg->gameInfo.white && lg->gameInfo.black) { + sprintf(buf, "%s vs. %s", lg->gameInfo.white, + lg->gameInfo.black); + DisplayTitle(buf); + } else if (*title != NULLCHAR) { + if (gameNumber > 1) { + sprintf(buf, "%s %d", title, gameNumber); + DisplayTitle(buf); + } else { + DisplayTitle(title); + } + } + + if (gameMode != AnalyzeFile && gameMode != AnalyzeMode) { + gameMode = PlayFromGameFile; + ModeHighlight(); + } + + currentMove = forwardMostMove = backwardMostMove = 0; + CopyBoard(boards[0], initialPosition); + StopClocks(); + + /* + * Skip the first gn-1 games in the file. + * Also skip over anything that precedes an identifiable + * start of game marker, to avoid being confused by + * garbage at the start of the file. Currently + * recognized start of game markers are the move number "1", + * the pattern "gnuchess .* game", the pattern + * "^[#;%] [^ ]* game file", and a PGN tag block. + * A game that starts with one of the latter two patterns + * will also have a move number 1, possibly + * following a position diagram. + * 5-4-02: Let's try being more lenient and allowing a game to + * start with an unnumbered move. Does that break anything? + */ + cm = lastLoadGameStart = (ChessMove) 0; + while (gn > 0) { + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + switch (cm) { + case (ChessMove) 0: + if (cmailMsgLoaded) { + nCmailGames = CMAIL_MAX_GAMES - gn; + } else { + Reset(TRUE, TRUE); - DisplayError("Game not found in file", 0); ++ DisplayError(_("Game not found in file"), 0); + } + return FALSE; + + case GNUChessGame: + case XBoardGame: + gn--; + lastLoadGameStart = cm; + break; + + case MoveNumberOne: + switch (lastLoadGameStart) { + case GNUChessGame: + case XBoardGame: + case PGNTag: + break; + case MoveNumberOne: + case (ChessMove) 0: + gn--; /* count this game */ + lastLoadGameStart = cm; + break; + default: + /* impossible */ + break; + } + break; + + case PGNTag: + switch (lastLoadGameStart) { + case GNUChessGame: + case PGNTag: + case MoveNumberOne: + case (ChessMove) 0: + gn--; /* count this game */ + lastLoadGameStart = cm; + break; + case XBoardGame: + lastLoadGameStart = cm; /* game counted already */ + break; + default: + /* impossible */ + break; + } + if (gn > 0) { + do { + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + } while (cm == PGNTag || cm == Comment); + } + break; + + case WhiteWins: + case BlackWins: + case GameIsDrawn: + if (cmailMsgLoaded && (CMAIL_MAX_GAMES == lastLoadGameNumber)) { + if ( cmailResult[CMAIL_MAX_GAMES - gn - 1] + != CMAIL_OLD_RESULT) { + nCmailResults ++ ; + cmailResult[ CMAIL_MAX_GAMES + - gn - 1] = CMAIL_OLD_RESULT; + } + } + break; + + case NormalMove: + /* Only a NormalMove can be at the start of a game + * without a position diagram. */ + if (lastLoadGameStart == (ChessMove) 0) { + gn--; + lastLoadGameStart = MoveNumberOne; + } + break; + + default: + break; + } + } + + if (appData.debugMode) + fprintf(debugFP, "Parsed game start '%s' (%d)\n", yy_text, (int) cm); + + if (cm == XBoardGame) { + /* Skip any header junk before position diagram and/or move 1 */ + for (;;) { + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + + if (cm == (ChessMove) 0 || + cm == GNUChessGame || cm == XBoardGame) { + /* Empty game; pretend end-of-file and handle later */ + cm = (ChessMove) 0; + break; + } + + if (cm == MoveNumberOne || cm == PositionDiagram || + cm == PGNTag || cm == Comment) + break; + } + } else if (cm == GNUChessGame) { + if (gameInfo.event != NULL) { + free(gameInfo.event); + } + gameInfo.event = StrSave(yy_text); + } + + startedFromSetupPosition = FALSE; + while (cm == PGNTag) { + if (appData.debugMode) + fprintf(debugFP, "Parsed PGNTag: %s\n", yy_text); + err = ParsePGNTag(yy_text, &gameInfo); + if (!err) numPGNTags++; + + /* [HGM] PGNvariant: automatically switch to variant given in PGN tag */ + if(gameInfo.variant != oldVariant) { + startedFromPositionFile = FALSE; /* [HGM] loadPos: variant switch likely makes position invalid */ + InitPosition(TRUE); + oldVariant = gameInfo.variant; + if (appData.debugMode) + fprintf(debugFP, "New variant %d\n", (int) oldVariant); + } + + + if (gameInfo.fen != NULL) { + Board initial_position; + startedFromSetupPosition = TRUE; + if (!ParseFEN(initial_position, &blackPlaysFirst, gameInfo.fen)) { + Reset(TRUE, TRUE); - DisplayError("Bad FEN position in file", 0); ++ DisplayError(_("Bad FEN position in file"), 0); + return FALSE; + } + CopyBoard(boards[0], initial_position); + if (blackPlaysFirst) { + currentMove = forwardMostMove = backwardMostMove = 1; + CopyBoard(boards[1], initial_position); + strcpy(moveList[0], ""); + strcpy(parseList[0], ""); + timeRemaining[0][1] = whiteTimeRemaining; + timeRemaining[1][1] = blackTimeRemaining; + if (commentList[0] != NULL) { + commentList[1] = commentList[0]; + commentList[0] = NULL; + } + } else { + currentMove = forwardMostMove = backwardMostMove = 0; + } + /* [HGM] copy FEN attributes as well. Bugfix 4.3.14m and 4.3.15e: moved to after 'blackPlaysFirst' */ + { int i; + initialRulePlies = FENrulePlies; + epStatus[forwardMostMove] = FENepStatus; + for( i=0; i< nrCastlingRights; i++ ) + initialRights[i] = castlingRights[forwardMostMove][i] = FENcastlingRights[i]; + } + yyboardindex = forwardMostMove; + free(gameInfo.fen); + gameInfo.fen = NULL; + } + + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + + /* Handle comments interspersed among the tags */ + while (cm == Comment) { + char *p; + if (appData.debugMode) + fprintf(debugFP, "Parsed Comment: %s\n", yy_text); + p = yy_text; + if (*p == '{' || *p == '[' || *p == '(') { + p[strlen(p) - 1] = NULLCHAR; + p++; + } + while (*p == '\n') p++; + AppendComment(currentMove, p); + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + } + } + + /* don't rely on existence of Event tag since if game was + * pasted from clipboard the Event tag may not exist + */ + if (numPGNTags > 0){ + char *tags; + if (gameInfo.variant == VariantNormal) { + gameInfo.variant = StringToVariant(gameInfo.event); + } + if (!matchMode) { + if( appData.autoDisplayTags ) { + tags = PGNTags(&gameInfo); + TagsPopUp(tags, CmailMsg()); + free(tags); + } + } + } else { + /* Make something up, but don't display it now */ + SetGameInfo(); + TagsPopDown(); + } + + if (cm == PositionDiagram) { + int i, j; + char *p; + Board initial_position; + + if (appData.debugMode) + fprintf(debugFP, "Parsed PositionDiagram: %s\n", yy_text); + + if (!startedFromSetupPosition) { + p = yy_text; + for (i = BOARD_HEIGHT - 1; i >= 0; i--) + for (j = BOARD_LEFT; j < BOARD_RGHT; p++) + switch (*p) { + case '[': + case '-': + case ' ': + case '\t': + case '\n': + case '\r': + break; + default: + initial_position[i][j++] = CharToPiece(*p); + break; + } + while (*p == ' ' || *p == '\t' || + *p == '\n' || *p == '\r') p++; + + if (strncmp(p, "black", strlen("black"))==0) + blackPlaysFirst = TRUE; + else + blackPlaysFirst = FALSE; + startedFromSetupPosition = TRUE; + + CopyBoard(boards[0], initial_position); + if (blackPlaysFirst) { + currentMove = forwardMostMove = backwardMostMove = 1; + CopyBoard(boards[1], initial_position); + strcpy(moveList[0], ""); + strcpy(parseList[0], ""); + timeRemaining[0][1] = whiteTimeRemaining; + timeRemaining[1][1] = blackTimeRemaining; + if (commentList[0] != NULL) { + commentList[1] = commentList[0]; + commentList[0] = NULL; + } + } else { + currentMove = forwardMostMove = backwardMostMove = 0; + } + } + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + } + + if (first.pr == NoProc) { + StartChessProgram(&first); + } + InitChessProgram(&first, FALSE); + SendToProgram("force\n", &first); + if (startedFromSetupPosition) { + SendBoard(&first, forwardMostMove); + if (appData.debugMode) { + fprintf(debugFP, "Load Game\n"); + } + DisplayBothClocks(); + } + + /* [HGM] server: flag to write setup moves in broadcast file as one */ + loadFlag = appData.suppressLoadMoves; + + while (cm == Comment) { + char *p; + if (appData.debugMode) + fprintf(debugFP, "Parsed Comment: %s\n", yy_text); + p = yy_text; + if (*p == '{' || *p == '[' || *p == '(') { + p[strlen(p) - 1] = NULLCHAR; + p++; + } + while (*p == '\n') p++; + AppendComment(currentMove, p); + yyboardindex = forwardMostMove; + cm = (ChessMove) yylex(); + } + + if ((cm == (ChessMove) 0 && lastLoadGameStart != (ChessMove) 0) || + cm == WhiteWins || cm == BlackWins || + cm == GameIsDrawn || cm == GameUnfinished) { - DisplayMessage("", "No moves in game"); ++ DisplayMessage("", _("No moves in game")); + if (cmailMsgLoaded) { + if (appData.debugMode) + fprintf(debugFP, "Setting flipView to %d.\n", FALSE); + ClearHighlights(); + flipView = FALSE; + } + DrawPosition(FALSE, boards[currentMove]); + DisplayBothClocks(); + gameMode = EditGame; + ModeHighlight(); + gameFileFP = NULL; + cmailOldMove = 0; + return TRUE; + } + + // [HGM] PV info: routine tests if comment empty + if (!matchMode && (pausing || appData.timeDelay != 0)) { + DisplayComment(currentMove - 1, commentList[currentMove]); + } + if (!matchMode && appData.timeDelay != 0) + DrawPosition(FALSE, boards[currentMove]); + + if (gameMode == AnalyzeFile || gameMode == AnalyzeMode) { + programStats.ok_to_send = 1; + } + + /* if the first token after the PGN tags is a move + * and not move number 1, retrieve it from the parser + */ + if (cm != MoveNumberOne) + LoadGameOneMove(cm); + + /* load the remaining moves from the file */ + while (LoadGameOneMove((ChessMove)0)) { + timeRemaining[0][forwardMostMove] = whiteTimeRemaining; + timeRemaining[1][forwardMostMove] = blackTimeRemaining; + } + + /* rewind to the start of the game */ + currentMove = backwardMostMove; + + HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); + + if (oldGameMode == AnalyzeFile || + oldGameMode == AnalyzeMode) { + AnalyzeFileEvent(); + } + + if (matchMode || appData.timeDelay == 0) { + ToEndEvent(); + gameMode = EditGame; + ModeHighlight(); + } else if (appData.timeDelay > 0) { + AutoPlayGameLoop(); + } + + if (appData.debugMode) + fprintf(debugFP, "LoadGame(): on exit, gameMode %d\n", gameMode); + + loadFlag = 0; /* [HGM] true game starts */ + return TRUE; + } + + /* Support for LoadNextPosition, LoadPreviousPosition, ReloadSamePosition */ + int + ReloadPosition(offset) + int offset; + { + int positionNumber = lastLoadPositionNumber + offset; + if (lastLoadPositionFP == NULL) { - DisplayError("No position has been loaded yet", 0); ++ DisplayError(_("No position has been loaded yet"), 0); + return FALSE; + } + if (positionNumber <= 0) { - DisplayError("Can't back up any further", 0); ++ DisplayError(_("Can't back up any further"), 0); + return FALSE; + } + return LoadPosition(lastLoadPositionFP, positionNumber, + lastLoadPositionTitle); + } + + /* Load the nth position from the given file */ + int + LoadPositionFromFile(filename, n, title) + char *filename; + int n; + char *title; + { + FILE *f; + char buf[MSG_SIZ]; + + if (strcmp(filename, "-") == 0) { + return LoadPosition(stdin, n, "stdin"); + } else { + f = fopen(filename, "rb"); + if (f == NULL) { - sprintf(buf, "Can't open \"%s\"", filename); ++ sprintf(buf, _("Can't open \"%s\""), filename); + DisplayError(buf, errno); + return FALSE; + } else { + return LoadPosition(f, n, title); + } + } + } + + /* Load the nth position from the given open file, and close it */ + int + LoadPosition(f, positionNumber, title) + FILE *f; + int positionNumber; + char *title; + { + char *p, line[MSG_SIZ]; + Board initial_position; + int i, j, fenMode, pn; + + if (gameMode == Training ) + SetTrainingModeOff(); + + if (gameMode != BeginningOfGame) { + Reset(FALSE, TRUE); + } + if (lastLoadPositionFP != NULL && lastLoadPositionFP != f) { + fclose(lastLoadPositionFP); + } + if (positionNumber == 0) positionNumber = 1; + lastLoadPositionFP = f; + lastLoadPositionNumber = positionNumber; + strcpy(lastLoadPositionTitle, title); + if (first.pr == NoProc) { + StartChessProgram(&first); + InitChessProgram(&first, FALSE); + } + pn = positionNumber; + if (positionNumber < 0) { + /* Negative position number means to seek to that byte offset */ + if (fseek(f, -positionNumber, 0) == -1) { - DisplayError("Can't seek on position file", 0); ++ DisplayError(_("Can't seek on position file"), 0); + return FALSE; + }; + pn = 1; + } else { + if (fseek(f, 0, 0) == -1) { + if (f == lastLoadPositionFP ? + positionNumber == lastLoadPositionNumber + 1 : + positionNumber == 1) { + pn = 1; + } else { - DisplayError("Can't seek on position file", 0); ++ DisplayError(_("Can't seek on position file"), 0); + return FALSE; + } + } + } + /* See if this file is FEN or old-style xboard */ + if (fgets(line, MSG_SIZ, f) == NULL) { - DisplayError("Position not found in file", 0); ++ DisplayError(_("Position not found in file"), 0); + return FALSE; + } + #if 0 + switch (line[0]) { + case '#': case 'x': + default: + fenMode = FALSE; + break; + case 'p': case 'n': case 'b': case 'r': case 'q': case 'k': + case 'P': case 'N': case 'B': case 'R': case 'Q': case 'K': + case '1': case '2': case '3': case '4': case '5': case '6': + case '7': case '8': case '9': + case 'H': case 'A': case 'M': case 'h': case 'a': case 'm': + case 'E': case 'F': case 'G': case 'e': case 'f': case 'g': + case 'C': case 'W': case 'c': case 'w': + fenMode = TRUE; + break; + } + #else + // [HGM] FEN can begin with digit, any piece letter valid in this variant, or a + for Shogi promoted pieces + fenMode = line[0] >= '0' && line[0] <= '9' || line[0] == '+' || CharToPiece(line[0]) != EmptySquare; + #endif + + if (pn >= 2) { + if (fenMode || line[0] == '#') pn--; + while (pn > 0) { + /* skip positions before number pn */ + if (fgets(line, MSG_SIZ, f) == NULL) { + Reset(TRUE, TRUE); - DisplayError("Position not found in file", 0); ++ DisplayError(_("Position not found in file"), 0); + return FALSE; + } + if (fenMode || line[0] == '#') pn--; + } + } + + if (fenMode) { + if (!ParseFEN(initial_position, &blackPlaysFirst, line)) { - DisplayError("Bad FEN position in file", 0); ++ DisplayError(_("Bad FEN position in file"), 0); + return FALSE; + } + } else { + (void) fgets(line, MSG_SIZ, f); + (void) fgets(line, MSG_SIZ, f); + + for (i = BOARD_HEIGHT - 1; i >= 0; i--) { + (void) fgets(line, MSG_SIZ, f); + for (p = line, j = BOARD_LEFT; j < BOARD_RGHT; p++) { + if (*p == ' ') + continue; + initial_position[i][j++] = CharToPiece(*p); + } + } + + blackPlaysFirst = FALSE; + if (!feof(f)) { + (void) fgets(line, MSG_SIZ, f); + if (strncmp(line, "black", strlen("black"))==0) + blackPlaysFirst = TRUE; + } + } + startedFromSetupPosition = TRUE; + + SendToProgram("force\n", &first); + CopyBoard(boards[0], initial_position); + if (blackPlaysFirst) { + currentMove = forwardMostMove = backwardMostMove = 1; + strcpy(moveList[0], ""); + strcpy(parseList[0], ""); + CopyBoard(boards[1], initial_position); - DisplayMessage("", "Black to play"); ++ DisplayMessage("", _("Black to play")); + } else { + currentMove = forwardMostMove = backwardMostMove = 0; - DisplayMessage("", "White to play"); ++ DisplayMessage("", _("White to play")); + } + /* [HGM] copy FEN attributes as well */ + { int i; + initialRulePlies = FENrulePlies; + epStatus[forwardMostMove] = FENepStatus; + for( i=0; i< nrCastlingRights; i++ ) + castlingRights[forwardMostMove][i] = FENcastlingRights[i]; + } + SendBoard(&first, forwardMostMove); + if (appData.debugMode) { + int i, j; + for(i=0;i<2;i++){for(j=0;j<6;j++)fprintf(debugFP, " %d", castlingRights[i][j]);fprintf(debugFP,"\n");} + for(j=0;j<6;j++)fprintf(debugFP, " %d", initialRights[j]);fprintf(debugFP,"\n"); + fprintf(debugFP, "Load Position\n"); + } + + if (positionNumber > 1) { + sprintf(line, "%s %d", title, positionNumber); + DisplayTitle(line); + } else { + DisplayTitle(title); + } + gameMode = EditGame; + ModeHighlight(); + ResetClocks(); + timeRemaining[0][1] = whiteTimeRemaining; + timeRemaining[1][1] = blackTimeRemaining; + DrawPosition(FALSE, boards[currentMove]); + + return TRUE; + } + + + void + CopyPlayerNameIntoFileName(dest, src) + char **dest, *src; + { + while (*src != NULLCHAR && *src != ',') { + if (*src == ' ') { + *(*dest)++ = '_'; + src++; + } else { + *(*dest)++ = *src++; + } + } + } + + char *DefaultFileName(ext) + char *ext; + { + static char def[MSG_SIZ]; + char *p; + + if (gameInfo.white != NULL && gameInfo.white[0] != '-') { + p = def; + CopyPlayerNameIntoFileName(&p, gameInfo.white); + *p++ = '-'; + CopyPlayerNameIntoFileName(&p, gameInfo.black); + *p++ = '.'; + strcpy(p, ext); + } else { + def[0] = NULLCHAR; + } + return def; + } + + /* Save the current game to the given file */ + int + SaveGameToFile(filename, append) + char *filename; + int append; + { + FILE *f; + char buf[MSG_SIZ]; + + if (strcmp(filename, "-") == 0) { + return SaveGame(stdout, 0, NULL); + } else { + f = fopen(filename, append ? "a" : "w"); + if (f == NULL) { - sprintf(buf, "Can't open \"%s\"", filename); ++ sprintf(buf, _("Can't open \"%s\""), filename); + DisplayError(buf, errno); + return FALSE; + } else { + return SaveGame(f, 0, NULL); + } + } + } + + char * + SavePart(str) + char *str; + { + static char buf[MSG_SIZ]; + char *p; + + p = strchr(str, ' '); + if (p == NULL) return str; + strncpy(buf, str, p - str); + buf[p - str] = NULLCHAR; + return buf; + } + + #define PGN_MAX_LINE 75 + + #define PGN_SIDE_WHITE 0 + #define PGN_SIDE_BLACK 1 + + /* [AS] */ + static int FindFirstMoveOutOfBook( int side ) + { + int result = -1; + + if( backwardMostMove == 0 && ! startedFromSetupPosition) { + int index = backwardMostMove; + int has_book_hit = 0; + + if( (index % 2) != side ) { + index++; + } + + while( index < forwardMostMove ) { + /* Check to see if engine is in book */ + int depth = pvInfoList[index].depth; + int score = pvInfoList[index].score; + int in_book = 0; + + if( depth <= 2 ) { + in_book = 1; + } + else if( score == 0 && depth == 63 ) { + in_book = 1; /* Zappa */ + } + else if( score == 2 && depth == 99 ) { + in_book = 1; /* Abrok */ + } + + has_book_hit += in_book; + + if( ! in_book ) { + result = index; + + break; + } + + index += 2; + } + } + + return result; + } + + /* [AS] */ + void GetOutOfBookInfo( char * buf ) + { + int oob[2]; + int i; + int offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ + + oob[0] = FindFirstMoveOutOfBook( PGN_SIDE_WHITE ); + oob[1] = FindFirstMoveOutOfBook( PGN_SIDE_BLACK ); + + *buf = '\0'; + + if( oob[0] >= 0 || oob[1] >= 0 ) { + for( i=0; i<2; i++ ) { + int idx = oob[i]; + + if( idx >= 0 ) { + if( i > 0 && oob[0] >= 0 ) { + strcat( buf, " " ); + } + + sprintf( buf+strlen(buf), "%d%s. ", (idx - offset)/2 + 1, idx & 1 ? ".." : "" ); + sprintf( buf+strlen(buf), "%s%.2f", + pvInfoList[idx].score >= 0 ? "+" : "", + pvInfoList[idx].score / 100.0 ); + } + } + } + } + + /* Save game in PGN style and close the file */ + int + SaveGamePGN(f) + FILE *f; + { + int i, offset, linelen, newblock; + time_t tm; + char *movetext; + char numtext[32]; + int movelen, numlen, blank; + char move_buffer[100]; /* [AS] Buffer for move+PV info */ + + offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ + + tm = time((time_t *) NULL); + + PrintPGNTags(f, &gameInfo); + + if (backwardMostMove > 0 || startedFromSetupPosition) { + char *fen = PositionToFEN(backwardMostMove, 1); + fprintf(f, "[FEN \"%s\"]\n[SetUp \"1\"]\n", fen); + fprintf(f, "\n{--------------\n"); + PrintPosition(f, backwardMostMove); + fprintf(f, "--------------}\n"); + free(fen); + } + else { + /* [AS] Out of book annotation */ + if( appData.saveOutOfBookInfo ) { + char buf[64]; + + GetOutOfBookInfo( buf ); + + if( buf[0] != '\0' ) { + fprintf( f, "[%s \"%s\"]\n", PGN_OUT_OF_BOOK, buf ); + } + } + + fprintf(f, "\n"); + } + + i = backwardMostMove; + linelen = 0; + newblock = TRUE; + + while (i < forwardMostMove) { + /* Print comments preceding this move */ + if (commentList[i] != NULL) { + if (linelen > 0) fprintf(f, "\n"); + fprintf(f, "{\n%s}\n", commentList[i]); + linelen = 0; + newblock = TRUE; + } + + /* Format move number */ + if ((i % 2) == 0) { + sprintf(numtext, "%d.", (i - offset)/2 + 1); + } else { + if (newblock) { + sprintf(numtext, "%d...", (i - offset)/2 + 1); + } else { + numtext[0] = NULLCHAR; + } + } + numlen = strlen(numtext); + newblock = FALSE; + + /* Print move number */ + blank = linelen > 0 && numlen > 0; + if (linelen + (blank ? 1 : 0) + numlen > PGN_MAX_LINE) { + fprintf(f, "\n"); + linelen = 0; + blank = 0; + } + if (blank) { + fprintf(f, " "); + linelen++; + } + fprintf(f, numtext); + linelen += numlen; + + /* Get move */ + movelen = strlen(parseList[i]); /* [HGM] pgn: line-break point before move */ + + /* Print move */ + blank = linelen > 0 && movelen > 0; + if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { + fprintf(f, "\n"); + linelen = 0; + blank = 0; + } + if (blank) { + fprintf(f, " "); + linelen++; + } + fprintf(f, parseList[i]); + linelen += movelen; + + /* [AS] Add PV info if present */ + if( i >= 0 && appData.saveExtendedInfoInPGN && pvInfoList[i].depth > 0 ) { + /* [HGM] add time */ + char buf[MSG_SIZ]; int seconds = 0; + + #if 0 + if(i >= backwardMostMove) { + if(WhiteOnMove(i)) + seconds = timeRemaining[0][i] - timeRemaining[0][i+1] + + GetTimeQuota(i/2) / WhitePlayer()->timeOdds; + else + seconds = timeRemaining[1][i] - timeRemaining[1][i+1] + + GetTimeQuota(i/2) / WhitePlayer()->other->timeOdds; + } + seconds = (seconds+50)/100; // deci-seconds, rounded to nearest + #else + seconds = (pvInfoList[i].time + 5)/10; // [HGM] PVtime: use engine time + #endif + if (appData.debugMode,0) { + fprintf(debugFP, "times = %d %d %d %d, seconds=%d\n", + timeRemaining[0][i+1], timeRemaining[0][i], + timeRemaining[1][i+1], timeRemaining[1][i], seconds + ); + } + + if( seconds <= 0) buf[0] = 0; else + if( seconds < 30 ) sprintf(buf, " %3.1f%c", seconds/10., 0); else { + seconds = (seconds + 4)/10; // round to full seconds + if( seconds < 60 ) sprintf(buf, " %d%c", seconds, 0); else + sprintf(buf, " %d:%02d%c", seconds/60, seconds%60, 0); + } + + sprintf( move_buffer, "{%s%.2f/%d%s}", + pvInfoList[i].score >= 0 ? "+" : "", + pvInfoList[i].score / 100.0, + pvInfoList[i].depth, + buf ); + + movelen = strlen(move_buffer); /* [HGM] pgn: line-break point after move */ + + /* Print score/depth */ + blank = linelen > 0 && movelen > 0; + if (linelen + (blank ? 1 : 0) + movelen > PGN_MAX_LINE) { + fprintf(f, "\n"); + linelen = 0; + blank = 0; + } + if (blank) { + fprintf(f, " "); + linelen++; + } + fprintf(f, move_buffer); + linelen += movelen; + } + + i++; + } + + /* Start a new line */ + if (linelen > 0) fprintf(f, "\n"); + + /* Print comments after last move */ + if (commentList[i] != NULL) { + fprintf(f, "{\n%s}\n", commentList[i]); + } + + /* Print result */ + if (gameInfo.resultDetails != NULL && + gameInfo.resultDetails[0] != NULLCHAR) { + fprintf(f, "{%s} %s\n\n", gameInfo.resultDetails, + PGNResult(gameInfo.result)); + } else { + fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); + } + + fclose(f); + return TRUE; + } + + /* Save game in old style and close the file */ + int + SaveGameOldStyle(f) + FILE *f; + { + int i, offset; + time_t tm; + + tm = time((time_t *) NULL); + + fprintf(f, "# %s game file -- %s", programName, ctime(&tm)); + PrintOpponents(f); + + if (backwardMostMove > 0 || startedFromSetupPosition) { + fprintf(f, "\n[--------------\n"); + PrintPosition(f, backwardMostMove); + fprintf(f, "--------------]\n"); + } else { + fprintf(f, "\n"); + } + + i = backwardMostMove; + offset = backwardMostMove & (~1L); /* output move numbers start at 1 */ + + while (i < forwardMostMove) { + if (commentList[i] != NULL) { + fprintf(f, "[%s]\n", commentList[i]); + } + + if ((i % 2) == 1) { + fprintf(f, "%d. ... %s\n", (i - offset)/2 + 1, parseList[i]); + i++; + } else { + fprintf(f, "%d. %s ", (i - offset)/2 + 1, parseList[i]); + i++; + if (commentList[i] != NULL) { + fprintf(f, "\n"); + continue; + } + if (i >= forwardMostMove) { + fprintf(f, "\n"); + break; + } + fprintf(f, "%s\n", parseList[i]); + i++; + } + } + + if (commentList[i] != NULL) { + fprintf(f, "[%s]\n", commentList[i]); + } + + /* This isn't really the old style, but it's close enough */ + if (gameInfo.resultDetails != NULL && + gameInfo.resultDetails[0] != NULLCHAR) { + fprintf(f, "%s (%s)\n\n", PGNResult(gameInfo.result), + gameInfo.resultDetails); + } else { + fprintf(f, "%s\n\n", PGNResult(gameInfo.result)); + } + + fclose(f); + return TRUE; + } + + /* Save the current game to open file f and close the file */ + int + SaveGame(f, dummy, dummy2) + FILE *f; + int dummy; + char *dummy2; + { + if (gameMode == EditPosition) EditPositionDone(); + if (appData.oldSaveStyle) + return SaveGameOldStyle(f); + else + return SaveGamePGN(f); + } + + /* Save the current position to the given file */ + int + SavePositionToFile(filename) + char *filename; + { + FILE *f; + char buf[MSG_SIZ]; + + if (strcmp(filename, "-") == 0) { + return SavePosition(stdout, 0, NULL); + } else { + f = fopen(filename, "a"); + if (f == NULL) { - sprintf(buf, "Can't open \"%s\"", filename); ++ sprintf(buf, _("Can't open \"%s\""), filename); + DisplayError(buf, errno); + return FALSE; + } else { + SavePosition(f, 0, NULL); + return TRUE; + } + } + } + + /* Save the current position to the given open file and close the file */ + int + SavePosition(f, dummy, dummy2) + FILE *f; + int dummy; + char *dummy2; + { + time_t tm; + char *fen; + + if (appData.oldSaveStyle) { + tm = time((time_t *) NULL); + + fprintf(f, "# %s position file -- %s", programName, ctime(&tm)); + PrintOpponents(f); + fprintf(f, "[--------------\n"); + PrintPosition(f, currentMove); + fprintf(f, "--------------]\n"); + } else { + fen = PositionToFEN(currentMove, 1); + fprintf(f, "%s\n", fen); + free(fen); + } + fclose(f); + return TRUE; + } + + void + ReloadCmailMsgEvent(unregister) + int unregister; + { + #if !WIN32 + static char *inFilename = NULL; + static char *outFilename; + int i; + struct stat inbuf, outbuf; + int status; + + /* Any registered moves are unregistered if unregister is set, */ + /* i.e. invoked by the signal handler */ + if (unregister) { + for (i = 0; i < CMAIL_MAX_GAMES; i ++) { + cmailMoveRegistered[i] = FALSE; + if (cmailCommentList[i] != NULL) { + free(cmailCommentList[i]); + cmailCommentList[i] = NULL; + } + } + nCmailMovesRegistered = 0; + } + + for (i = 0; i < CMAIL_MAX_GAMES; i ++) { + cmailResult[i] = CMAIL_NOT_RESULT; + } + nCmailResults = 0; + + if (inFilename == NULL) { + /* Because the filenames are static they only get malloced once */ + /* and they never get freed */ + inFilename = (char *) malloc(strlen(appData.cmailGameName) + 9); + sprintf(inFilename, "%s.game.in", appData.cmailGameName); + + outFilename = (char *) malloc(strlen(appData.cmailGameName) + 5); + sprintf(outFilename, "%s.out", appData.cmailGameName); + } + + status = stat(outFilename, &outbuf); + if (status < 0) { + cmailMailedMove = FALSE; + } else { + status = stat(inFilename, &inbuf); + cmailMailedMove = (inbuf.st_mtime < outbuf.st_mtime); + } + + /* LoadGameFromFile(CMAIL_MAX_GAMES) with cmailMsgLoaded == TRUE + counts the games, notes how each one terminated, etc. + + It would be nice to remove this kludge and instead gather all + the information while building the game list. (And to keep it + in the game list nodes instead of having a bunch of fixed-size + parallel arrays.) Note this will require getting each game's + termination from the PGN tags, as the game list builder does + not process the game moves. --mann + */ + cmailMsgLoaded = TRUE; + LoadGameFromFile(inFilename, CMAIL_MAX_GAMES, "", FALSE); + + /* Load first game in the file or popup game menu */ + LoadGameFromFile(inFilename, 0, appData.cmailGameName, TRUE); + + #endif /* !WIN32 */ + return; + } + + int + RegisterMove() + { + FILE *f; + char string[MSG_SIZ]; + + if ( cmailMailedMove + || (cmailResult[lastLoadGameNumber - 1] == CMAIL_OLD_RESULT)) { + return TRUE; /* Allow free viewing */ + } + + /* Unregister move to ensure that we don't leave RegisterMove */ + /* with the move registered when the conditions for registering no */ + /* longer hold */ + if (cmailMoveRegistered[lastLoadGameNumber - 1]) { + cmailMoveRegistered[lastLoadGameNumber - 1] = FALSE; + nCmailMovesRegistered --; + + if (cmailCommentList[lastLoadGameNumber - 1] != NULL) + { + free(cmailCommentList[lastLoadGameNumber - 1]); + cmailCommentList[lastLoadGameNumber - 1] = NULL; + } + } + + if (cmailOldMove == -1) { - DisplayError("You have edited the game history.\nUse Reload Same Game and make your move again.", 0); ++ DisplayError(_("You have edited the game history.\nUse Reload Same Game and make your move again."), 0); + return FALSE; + } + + if (currentMove > cmailOldMove + 1) { - DisplayError("You have entered too many moves.\nBack up to the correct position and try again.", 0); ++ DisplayError(_("You have entered too many moves.\nBack up to the correct position and try again."), 0); + return FALSE; + } + + if (currentMove < cmailOldMove) { - DisplayError("Displayed position is not current.\nStep forward to the correct position and try again.", 0); ++ DisplayError(_("Displayed position is not current.\nStep forward to the correct position and try again."), 0); + return FALSE; + } + + if (forwardMostMove > currentMove) { + /* Silently truncate extra moves */ + TruncateGame(); + } + + if ( (currentMove == cmailOldMove + 1) + || ( (currentMove == cmailOldMove) + && ( (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_ACCEPT) + || (cmailMoveType[lastLoadGameNumber - 1] == CMAIL_RESIGN)))) { + if (gameInfo.result != GameUnfinished) { + cmailResult[lastLoadGameNumber - 1] = CMAIL_NEW_RESULT; + } + + if (commentList[currentMove] != NULL) { + cmailCommentList[lastLoadGameNumber - 1] + = StrSave(commentList[currentMove]); + } + strcpy(cmailMove[lastLoadGameNumber - 1], moveList[currentMove - 1]); + + if (appData.debugMode) + fprintf(debugFP, "Saving %s for game %d\n", + cmailMove[lastLoadGameNumber - 1], lastLoadGameNumber); + + sprintf(string, + "%s.game.out.%d", appData.cmailGameName, lastLoadGameNumber); + + f = fopen(string, "w"); + if (appData.oldSaveStyle) { + SaveGameOldStyle(f); /* also closes the file */ + + sprintf(string, "%s.pos.out", appData.cmailGameName); + f = fopen(string, "w"); + SavePosition(f, 0, NULL); /* also closes the file */ + } else { + fprintf(f, "{--------------\n"); + PrintPosition(f, currentMove); + fprintf(f, "--------------}\n\n"); + + SaveGame(f, 0, NULL); /* also closes the file*/ + } + + cmailMoveRegistered[lastLoadGameNumber - 1] = TRUE; + nCmailMovesRegistered ++; + } else if (nCmailGames == 1) { - DisplayError("You have not made a move yet", 0); ++ DisplayError(_("You have not made a move yet"), 0); + return FALSE; + } + + return TRUE; + } + + void + MailMoveEvent() + { + #if !WIN32 + static char *partCommandString = "cmail -xv%s -remail -game %s 2>&1"; + FILE *commandOutput; + char buffer[MSG_SIZ], msg[MSG_SIZ], string[MSG_SIZ]; + int nBytes = 0; /* Suppress warnings on uninitialized variables */ + int nBuffers; + int i; + int archived; + char *arcDir; + + if (! cmailMsgLoaded) { - DisplayError("The cmail message is not loaded.\nUse Reload CMail Message and make your move again.", 0); ++ DisplayError(_("The cmail message is not loaded.\nUse Reload CMail Message and make your move again."), 0); + return; + } + + if (nCmailGames == nCmailResults) { - DisplayError("No unfinished games", 0); ++ DisplayError(_("No unfinished games"), 0); + return; + } + + #if CMAIL_PROHIBIT_REMAIL + if (cmailMailedMove) { - sprintf(msg, "You have already mailed a move.\nWait until a move arrives from your opponent.\nTo resend the same move, type\n\"cmail -remail -game %s\"\non the command line.", appData.cmailGameName); ++ sprintf(msg, _("You have already mailed a move.\nWait until a move arrives from your opponent.\nTo resend the same move, type\n\"cmail -remail -game %s\"\non the command line."), appData.cmailGameName); + DisplayError(msg, 0); + return; + } + #endif + + if (! (cmailMailedMove || RegisterMove())) return; + + if ( cmailMailedMove + || (nCmailMovesRegistered + nCmailResults == nCmailGames)) { + sprintf(string, partCommandString, + appData.debugMode ? " -v" : "", appData.cmailGameName); - commandOutput = popen(string, "rb"); ++ commandOutput = popen(string, "r"); + + if (commandOutput == NULL) { - DisplayError("Failed to invoke cmail", 0); ++ DisplayError(_("Failed to invoke cmail"), 0); + } else { + for (nBuffers = 0; (! feof(commandOutput)); nBuffers ++) { + nBytes = fread(buffer, 1, MSG_SIZ - 1, commandOutput); + } + if (nBuffers > 1) { + (void) memcpy(msg, buffer + nBytes, MSG_SIZ - nBytes - 1); + (void) memcpy(msg + MSG_SIZ - nBytes - 1, buffer, nBytes); + nBytes = MSG_SIZ - 1; + } else { + (void) memcpy(msg, buffer, nBytes); + } + *(msg + nBytes) = '\0'; /* \0 for end-of-string*/ + + if(StrStr(msg, "Mailed cmail message to ") != NULL) { + cmailMailedMove = TRUE; /* Prevent >1 moves */ + + archived = TRUE; + for (i = 0; i < nCmailGames; i ++) { + if (cmailResult[i] == CMAIL_NOT_RESULT) { + archived = FALSE; + } + } + if ( archived + && ( (arcDir = (char *) getenv("CMAIL_ARCDIR")) + != NULL)) { + sprintf(buffer, "%s/%s.%s.archive", + arcDir, + appData.cmailGameName, + gameInfo.date); + LoadGameFromFile(buffer, 1, buffer, FALSE); + cmailMsgLoaded = FALSE; + } + } + + DisplayInformation(msg); + pclose(commandOutput); + } + } else { + if ((*cmailMsg) != '\0') { + DisplayInformation(cmailMsg); + } + } + + return; + #endif /* !WIN32 */ + } + + char * + CmailMsg() + { + #if WIN32 + return NULL; + #else + int prependComma = 0; + char number[5]; + char string[MSG_SIZ]; /* Space for game-list */ + int i; + + if (!cmailMsgLoaded) return ""; + + if (cmailMailedMove) { - sprintf(cmailMsg, "Waiting for reply from opponent\n"); ++ sprintf(cmailMsg, _("Waiting for reply from opponent\n")); + } else { + /* Create a list of games left */ + sprintf(string, "["); + for (i = 0; i < nCmailGames; i ++) { + if (! ( cmailMoveRegistered[i] + || (cmailResult[i] == CMAIL_OLD_RESULT))) { + if (prependComma) { + sprintf(number, ",%d", i + 1); + } else { + sprintf(number, "%d", i + 1); + prependComma = 1; + } + + strcat(string, number); + } + } + strcat(string, "]"); + + if (nCmailMovesRegistered + nCmailResults == 0) { + switch (nCmailGames) { + case 1: + sprintf(cmailMsg, - "Still need to make move for game\n"); ++ _("Still need to make move for game\n")); + break; + + case 2: + sprintf(cmailMsg, - "Still need to make moves for both games\n"); ++ _("Still need to make moves for both games\n")); + break; + + default: + sprintf(cmailMsg, - "Still need to make moves for all %d games\n", ++ _("Still need to make moves for all %d games\n"), + nCmailGames); + break; + } + } else { + switch (nCmailGames - nCmailMovesRegistered - nCmailResults) { + case 1: + sprintf(cmailMsg, - "Still need to make a move for game %s\n", ++ _("Still need to make a move for game %s\n"), + string); + break; + + case 0: + if (nCmailResults == nCmailGames) { - sprintf(cmailMsg, "No unfinished games\n"); ++ sprintf(cmailMsg, _("No unfinished games\n")); + } else { - sprintf(cmailMsg, "Ready to send mail\n"); ++ sprintf(cmailMsg, _("Ready to send mail\n")); + } + break; + + default: + sprintf(cmailMsg, - "Still need to make moves for games %s\n", ++ _("Still need to make moves for games %s\n"), + string); + } + } + } + return cmailMsg; + #endif /* WIN32 */ + } + + void + ResetGameEvent() + { + if (gameMode == Training) + SetTrainingModeOff(); + + Reset(TRUE, TRUE); + cmailMsgLoaded = FALSE; + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("refresh\n"); + } + } + + void + ExitEvent(status) + int status; + { + exiting++; + if (exiting > 2) { + /* Give up on clean exit */ + exit(status); + } + if (exiting > 1) { + /* Keep trying for clean exit */ + return; + } + + if (appData.icsActive && appData.colorize) Colorize(ColorNone, FALSE); + + if (telnetISR != NULL) { + RemoveInputSource(telnetISR); + } + if (icsPR != NoProc) { + DestroyChildProcess(icsPR, TRUE); + } + #if 0 + /* Save game if resource set and not already saved by GameEnds() */ + if ((gameInfo.resultDetails == NULL || errorExitFlag ) + && forwardMostMove > 0) { + if (*appData.saveGameFile != NULLCHAR) { + SaveGameToFile(appData.saveGameFile, TRUE); + } else if (appData.autoSaveGames) { + AutoSaveGame(); + } + if (*appData.savePositionFile != NULLCHAR) { + SavePositionToFile(appData.savePositionFile); + } + } + GameEnds((ChessMove) 0, NULL, GE_PLAYER); + #else + /* [HGM] crash: leave writing PGN and position entirely to GameEnds() */ + GameEnds(gameInfo.result, gameInfo.resultDetails==NULL ? "xboard exit" : gameInfo.resultDetails, GE_PLAYER); + #endif + /* [HGM] crash: the above GameEnds() is a dud if another one was running */ + /* make sure this other one finishes before killing it! */ + if(endingGame) { int count = 0; + if(appData.debugMode) fprintf(debugFP, "ExitEvent() during GameEnds(), wait\n"); + while(endingGame && count++ < 10) DoSleep(1); + if(appData.debugMode && endingGame) fprintf(debugFP, "GameEnds() seems stuck, proceed exiting\n"); + } + + /* Kill off chess programs */ + if (first.pr != NoProc) { + ExitAnalyzeMode(); + + DoSleep( appData.delayBeforeQuit ); + SendToProgram("quit\n", &first); + DoSleep( appData.delayAfterQuit ); + DestroyChildProcess(first.pr, 10 /* [AS] first.useSigterm */ ); + } + if (second.pr != NoProc) { + DoSleep( appData.delayBeforeQuit ); + SendToProgram("quit\n", &second); + DoSleep( appData.delayAfterQuit ); + DestroyChildProcess(second.pr, 10 /* [AS] second.useSigterm */ ); + } + if (first.isr != NULL) { + RemoveInputSource(first.isr); + } + if (second.isr != NULL) { + RemoveInputSource(second.isr); + } + + ShutDownFrontEnd(); + exit(status); + } + + void + PauseEvent() + { + if (appData.debugMode) + fprintf(debugFP, "PauseEvent(): pausing %d\n", pausing); + if (pausing) { + pausing = FALSE; + ModeHighlight(); + if (gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack) { + StartClocks(); + } else { + DisplayBothClocks(); + } + if (gameMode == PlayFromGameFile) { + if (appData.timeDelay >= 0) + AutoPlayGameLoop(); + } else if (gameMode == IcsExamining && pauseExamInvalid) { + Reset(FALSE, TRUE); + SendToICS(ics_prefix); + SendToICS("refresh\n"); + } else if (currentMove < forwardMostMove) { + ForwardInner(forwardMostMove); + } + pauseExamInvalid = FALSE; + } else { + switch (gameMode) { + default: + return; + case IcsExamining: + pauseExamForwardMostMove = forwardMostMove; + pauseExamInvalid = FALSE; + /* fall through */ + case IcsObserving: + case IcsPlayingWhite: + case IcsPlayingBlack: + pausing = TRUE; + ModeHighlight(); + return; + case PlayFromGameFile: + (void) StopLoadGameTimer(); + pausing = TRUE; + ModeHighlight(); + break; + case BeginningOfGame: + if (appData.icsActive) return; + /* else fall through */ + case MachinePlaysWhite: + case MachinePlaysBlack: + case TwoMachinesPlay: + if (forwardMostMove == 0) + return; /* don't pause if no one has moved */ + if ((gameMode == MachinePlaysWhite && + !WhiteOnMove(forwardMostMove)) || + (gameMode == MachinePlaysBlack && + WhiteOnMove(forwardMostMove))) { + StopClocks(); + } + pausing = TRUE; + ModeHighlight(); + break; + } + } + } + + void + EditCommentEvent() + { + char title[MSG_SIZ]; + + if (currentMove < 1 || parseList[currentMove - 1][0] == NULLCHAR) { - strcpy(title, "Edit comment"); ++ strcpy(title, _("Edit comment")); + } else { - sprintf(title, "Edit comment on %d.%s%s", (currentMove - 1) / 2 + 1, ++ sprintf(title, _("Edit comment on %d.%s%s"), (currentMove - 1) / 2 + 1, + WhiteOnMove(currentMove - 1) ? " " : ".. ", + parseList[currentMove - 1]); + } + + EditCommentPopUp(currentMove, title, commentList[currentMove]); + } + + + void + EditTagsEvent() + { + char *tags = PGNTags(&gameInfo); + EditTagsPopUp(tags); + free(tags); + } + + void + AnalyzeModeEvent() + { + if (appData.noChessProgram || gameMode == AnalyzeMode) + return; + + if (gameMode != AnalyzeFile) { - EditGameEvent(); - if (gameMode != EditGame) return; ++ if (!appData.icsEngineAnalyze) { ++ EditGameEvent(); ++ if (gameMode != EditGame) return; ++ } + ResurrectChessProgram(); + SendToProgram("analyze\n", &first); + first.analyzing = TRUE; + /*first.maybeThinking = TRUE;*/ + first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - AnalysisPopUp("Analysis", - "Starting analysis mode...\nIf this message stays up, your chess program does not support analysis."); ++ AnalysisPopUp(_("Analysis"), ++ _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis.")); + } - gameMode = AnalyzeMode; ++ if (!appData.icsEngineAnalyze) gameMode = AnalyzeMode; + pausing = FALSE; + ModeHighlight(); + SetGameInfo(); + + StartAnalysisClock(); + GetTimeMark(&lastNodeCountTime); + lastNodeCount = 0; + } + + void + AnalyzeFileEvent() + { + if (appData.noChessProgram || gameMode == AnalyzeFile) + return; + + if (gameMode != AnalyzeMode) { + EditGameEvent(); + if (gameMode != EditGame) return; + ResurrectChessProgram(); + SendToProgram("analyze\n", &first); + first.analyzing = TRUE; + /*first.maybeThinking = TRUE;*/ + first.maybeThinking = FALSE; /* avoid killing GNU Chess */ - AnalysisPopUp("Analysis", - "Starting analysis mode...\nIf this message stays up, your chess program does not support analysis."); ++ AnalysisPopUp(_("Analysis"), ++ _("Starting analysis mode...\nIf this message stays up, your chess program does not support analysis.")); + } + gameMode = AnalyzeFile; + pausing = FALSE; + ModeHighlight(); + SetGameInfo(); + + StartAnalysisClock(); + GetTimeMark(&lastNodeCountTime); + lastNodeCount = 0; + } + + void + MachineWhiteEvent() + { + char buf[MSG_SIZ]; + char *bookHit = NULL; + + if (appData.noChessProgram || (gameMode == MachinePlaysWhite)) + return; + + + if (gameMode == PlayFromGameFile || + gameMode == TwoMachinesPlay || + gameMode == Training || + gameMode == AnalyzeMode || + gameMode == EndOfGame) + EditGameEvent(); + + if (gameMode == EditPosition) + EditPositionDone(); + + if (!WhiteOnMove(currentMove)) { - DisplayError("It is not White's turn", 0); ++ DisplayError(_("It is not White's turn"), 0); + return; + } + + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) + ExitAnalyzeMode(); + + if (gameMode == EditGame || gameMode == AnalyzeMode || + gameMode == AnalyzeFile) + TruncateGame(); + + ResurrectChessProgram(); /* in case it isn't running */ + if(gameMode == BeginningOfGame) { /* [HGM] time odds: to get right odds in human mode */ + gameMode = MachinePlaysWhite; + ResetClocks(); + } else + gameMode = MachinePlaysWhite; + pausing = FALSE; + ModeHighlight(); + SetGameInfo(); + sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); + DisplayTitle(buf); + if (first.sendName) { + sprintf(buf, "name %s\n", gameInfo.black); + SendToProgram(buf, &first); + } + if (first.sendTime) { + if (first.useColors) { + SendToProgram("black\n", &first); /*gnu kludge*/ + } + SendTimeRemaining(&first, TRUE); + } + if (first.useColors) { + SendToProgram("white\n", &first); // [HGM] book: send 'go' separately + } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move + SetMachineThinkingEnables(); + first.maybeThinking = TRUE; + StartClocks(); + + if (appData.autoFlipView && !flipView) { + flipView = !flipView; + DrawPosition(FALSE, NULL); + DisplayBothClocks(); // [HGM] logo: clocks might have to be exchanged; + } + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + } + + void + MachineBlackEvent() + { + char buf[MSG_SIZ]; + char *bookHit = NULL; + + if (appData.noChessProgram || (gameMode == MachinePlaysBlack)) + return; + + + if (gameMode == PlayFromGameFile || + gameMode == TwoMachinesPlay || + gameMode == Training || + gameMode == AnalyzeMode || + gameMode == EndOfGame) + EditGameEvent(); + + if (gameMode == EditPosition) + EditPositionDone(); + + if (WhiteOnMove(currentMove)) { - DisplayError("It is not Black's turn", 0); ++ DisplayError(_("It is not Black's turn"), 0); + return; + } + + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) + ExitAnalyzeMode(); + + if (gameMode == EditGame || gameMode == AnalyzeMode || + gameMode == AnalyzeFile) + TruncateGame(); + + ResurrectChessProgram(); /* in case it isn't running */ + gameMode = MachinePlaysBlack; + pausing = FALSE; + ModeHighlight(); + SetGameInfo(); + sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); + DisplayTitle(buf); + if (first.sendName) { + sprintf(buf, "name %s\n", gameInfo.white); + SendToProgram(buf, &first); + } + if (first.sendTime) { + if (first.useColors) { + SendToProgram("white\n", &first); /*gnu kludge*/ + } + SendTimeRemaining(&first, FALSE); + } + if (first.useColors) { + SendToProgram("black\n", &first); // [HGM] book: 'go' sent separately + } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move + SetMachineThinkingEnables(); + first.maybeThinking = TRUE; + StartClocks(); + + if (appData.autoFlipView && flipView) { + flipView = !flipView; + DrawPosition(FALSE, NULL); + DisplayBothClocks(); // [HGM] logo: clocks might have to be exchanged; + } + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + } + + + void + DisplayTwoMachinesTitle() + { + char buf[MSG_SIZ]; + if (appData.matchGames > 0) { + if (first.twoMachinesColor[0] == 'w') { + sprintf(buf, "%s vs. %s (%d-%d-%d)", + gameInfo.white, gameInfo.black, + first.matchWins, second.matchWins, + matchGame - 1 - (first.matchWins + second.matchWins)); + } else { + sprintf(buf, "%s vs. %s (%d-%d-%d)", + gameInfo.white, gameInfo.black, + second.matchWins, first.matchWins, + matchGame - 1 - (first.matchWins + second.matchWins)); + } + } else { + sprintf(buf, "%s vs. %s", gameInfo.white, gameInfo.black); + } + DisplayTitle(buf); + } + + void + TwoMachinesEvent P((void)) + { + int i; + char buf[MSG_SIZ]; + ChessProgramState *onmove; + char *bookHit = NULL; + + if (appData.noChessProgram) return; + + switch (gameMode) { + case TwoMachinesPlay: + return; + case MachinePlaysWhite: + case MachinePlaysBlack: + if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError("Wait until your turn,\nor select Move Now", 0); ++ DisplayError(_("Wait until your turn,\nor select Move Now"), 0); + return; + } + /* fall through */ + case BeginningOfGame: + case PlayFromGameFile: + case EndOfGame: + EditGameEvent(); + if (gameMode != EditGame) return; + break; + case EditPosition: + EditPositionDone(); + break; + case AnalyzeMode: + case AnalyzeFile: + ExitAnalyzeMode(); + break; + case EditGame: + default: + break; + } + + forwardMostMove = currentMove; + ResurrectChessProgram(); /* in case first program isn't running */ + + if (second.pr == NULL) { + StartChessProgram(&second); + if (second.protocolVersion == 1) { + TwoMachinesEventIfReady(); + } else { + /* kludge: allow timeout for initial "feature" command */ + FreezeUI(); - DisplayMessage("", "Starting second chess program"); ++ DisplayMessage("", _("Starting second chess program")); + ScheduleDelayedEvent(TwoMachinesEventIfReady, FEATURE_TIMEOUT); + } + return; + } + DisplayMessage("", ""); + InitChessProgram(&second, FALSE); + SendToProgram("force\n", &second); + if (startedFromSetupPosition) { + SendBoard(&second, backwardMostMove); + if (appData.debugMode) { + fprintf(debugFP, "Two Machines\n"); + } + } + for (i = backwardMostMove; i < forwardMostMove; i++) { + SendMoveToProgram(i, &second); + } + + gameMode = TwoMachinesPlay; + pausing = FALSE; + ModeHighlight(); + SetGameInfo(); + DisplayTwoMachinesTitle(); + firstMove = TRUE; + if ((first.twoMachinesColor[0] == 'w') == WhiteOnMove(forwardMostMove)) { + onmove = &first; + } else { + onmove = &second; + } + + SendToProgram(first.computerString, &first); + if (first.sendName) { + sprintf(buf, "name %s\n", second.tidy); + SendToProgram(buf, &first); + } + SendToProgram(second.computerString, &second); + if (second.sendName) { + sprintf(buf, "name %s\n", first.tidy); + SendToProgram(buf, &second); + } + + ResetClocks(); + if (!first.sendTime || !second.sendTime) { + timeRemaining[0][forwardMostMove] = whiteTimeRemaining; + timeRemaining[1][forwardMostMove] = blackTimeRemaining; + } + if (onmove->sendTime) { + if (onmove->useColors) { + SendToProgram(onmove->other->twoMachinesColor, onmove); /*gnu kludge*/ + } + SendTimeRemaining(onmove, WhiteOnMove(forwardMostMove)); + } + if (onmove->useColors) { + SendToProgram(onmove->twoMachinesColor, onmove); + } + bookHit = SendMoveToBookUser(forwardMostMove-1, onmove, TRUE); // [HGM] book: send go or retrieve book move + // SendToProgram("go\n", onmove); + onmove->maybeThinking = TRUE; + SetMachineThinkingEnables(); + + StartClocks(); + + if(bookHit) { // [HGM] book: simulate book reply + static char bookMove[MSG_SIZ]; // a bit generous? + + programStats.depth = programStats.nodes = programStats.time = + programStats.score = programStats.got_only_move = 0; + sprintf(programStats.movelist, "%s (xbook)", bookHit); + + strcpy(bookMove, "move "); + strcat(bookMove, bookHit); + HandleMachineMove(bookMove, &first); + } + } + + void + TrainingEvent() + { + if (gameMode == Training) { + SetTrainingModeOff(); + gameMode = PlayFromGameFile; - DisplayMessage("", "Training mode off"); ++ DisplayMessage("", _("Training mode off")); + } else { + gameMode = Training; + animateTraining = appData.animate; + + /* make sure we are not already at the end of the game */ + if (currentMove < forwardMostMove) { + SetTrainingModeOn(); - DisplayMessage("", "Training mode on"); ++ DisplayMessage("", _("Training mode on")); + } else { + gameMode = PlayFromGameFile; - DisplayError("Already at end of game", 0); ++ DisplayError(_("Already at end of game"), 0); + } + } + ModeHighlight(); + } + + void + IcsClientEvent() + { + if (!appData.icsActive) return; + switch (gameMode) { + case IcsPlayingWhite: + case IcsPlayingBlack: + case IcsObserving: + case IcsIdle: + case BeginningOfGame: + case IcsExamining: + return; + + case EditGame: + break; + + case EditPosition: + EditPositionDone(); + break; + + case AnalyzeMode: + case AnalyzeFile: + ExitAnalyzeMode(); + break; + + default: + EditGameEvent(); + break; + } + + gameMode = IcsIdle; + ModeHighlight(); + return; + } + + + void + EditGameEvent() + { + int i; + + switch (gameMode) { + case Training: + SetTrainingModeOff(); + break; + case MachinePlaysWhite: + case MachinePlaysBlack: + case BeginningOfGame: + SendToProgram("force\n", &first); + SetUserThinkingEnables(); + break; + case PlayFromGameFile: + (void) StopLoadGameTimer(); + if (gameFileFP != NULL) { + gameFileFP = NULL; + } + break; + case EditPosition: + EditPositionDone(); + break; + case AnalyzeMode: + case AnalyzeFile: + ExitAnalyzeMode(); + SendToProgram("force\n", &first); + break; + case TwoMachinesPlay: + GameEnds((ChessMove) 0, NULL, GE_PLAYER); + ResurrectChessProgram(); + SetUserThinkingEnables(); + break; + case EndOfGame: + ResurrectChessProgram(); + break; + case IcsPlayingBlack: + case IcsPlayingWhite: - DisplayError("Warning: You are still playing a game", 0); ++ DisplayError(_("Warning: You are still playing a game"), 0); + break; + case IcsObserving: - DisplayError("Warning: You are still observing a game", 0); ++ DisplayError(_("Warning: You are still observing a game"), 0); + break; + case IcsExamining: - DisplayError("Warning: You are still examining a game", 0); ++ DisplayError(_("Warning: You are still examining a game"), 0); + break; + case IcsIdle: + break; + case EditGame: + default: + return; + } + + pausing = FALSE; + StopClocks(); + first.offeredDraw = second.offeredDraw = 0; + + if (gameMode == PlayFromGameFile) { + whiteTimeRemaining = timeRemaining[0][currentMove]; + blackTimeRemaining = timeRemaining[1][currentMove]; + DisplayTitle(""); + } + + if (gameMode == MachinePlaysWhite || + gameMode == MachinePlaysBlack || + gameMode == TwoMachinesPlay || + gameMode == EndOfGame) { + i = forwardMostMove; + while (i > currentMove) { + SendToProgram("undo\n", &first); + i--; + } + whiteTimeRemaining = timeRemaining[0][currentMove]; + blackTimeRemaining = timeRemaining[1][currentMove]; + DisplayBothClocks(); + if (whiteFlag || blackFlag) { + whiteFlag = blackFlag = 0; + } + DisplayTitle(""); + } + + gameMode = EditGame; + ModeHighlight(); + SetGameInfo(); + } + + + void + EditPositionEvent() + { + if (gameMode == EditPosition) { + EditGameEvent(); + return; + } + + EditGameEvent(); + if (gameMode != EditGame) return; + + gameMode = EditPosition; + ModeHighlight(); + SetGameInfo(); + if (currentMove > 0) + CopyBoard(boards[0], boards[currentMove]); + + blackPlaysFirst = !WhiteOnMove(currentMove); + ResetClocks(); + currentMove = forwardMostMove = backwardMostMove = 0; + HistorySet(parseList, backwardMostMove, forwardMostMove, currentMove-1); + DisplayMove(-1); + } + + void + ExitAnalyzeMode() + { ++ /* [DM] icsEngineAnalyze - possible call from other functions */ ++ if (appData.icsEngineAnalyze) { ++ appData.icsEngineAnalyze = FALSE; ++ ++ DisplayMessage("",_("Close ICS engine analyze...")); ++ } + if (first.analysisSupport && first.analyzing) { + SendToProgram("exit\n", &first); + first.analyzing = FALSE; + } + AnalysisPopDown(); + thinkOutput[0] = NULLCHAR; + } + + void + EditPositionDone() + { + startedFromSetupPosition = TRUE; + InitChessProgram(&first, FALSE); + SendToProgram("force\n", &first); + if (blackPlaysFirst) { + strcpy(moveList[0], ""); + strcpy(parseList[0], ""); + currentMove = forwardMostMove = backwardMostMove = 1; + CopyBoard(boards[1], boards[0]); + /* [HGM] copy rights as well, as this code is also used after pasting a FEN */ + { int i; + epStatus[1] = epStatus[0]; + for(i=0; i MSG_SIZ) + len = MSG_SIZ; + + strncpy(temp, buf, len); + temp[len] = 0; + + p = temp; + while (*p) { + if (*p == '\n' || *p == '\r') + *p = ' '; + ++p; + } + + strcat(temp, "\n"); + SendToICS(temp); + SendToPlayer(temp, strlen(temp)); + } + + void + SetWhiteToPlayEvent() + { + if (gameMode == EditPosition) { + blackPlaysFirst = FALSE; + DisplayBothClocks(); /* works because currentMove is 0 */ + } else if (gameMode == IcsExamining) { + SendToICS(ics_prefix); + SendToICS("tomove white\n"); + } + } + + void + SetBlackToPlayEvent() + { + if (gameMode == EditPosition) { + blackPlaysFirst = TRUE; + currentMove = 1; /* kludge */ + DisplayBothClocks(); + currentMove = 0; + } else if (gameMode == IcsExamining) { + SendToICS(ics_prefix); + SendToICS("tomove black\n"); + } + } + + void + EditPositionMenuEvent(selection, x, y) + ChessSquare selection; + int x, y; + { + char buf[MSG_SIZ]; + ChessSquare piece = boards[0][y][x]; + + if (gameMode != EditPosition && gameMode != IcsExamining) return; + + switch (selection) { + case ClearBoard: + if (gameMode == IcsExamining && ics_type == ICS_FICS) { + SendToICS(ics_prefix); + SendToICS("bsetup clear\n"); + } else if (gameMode == IcsExamining && ics_type == ICS_ICC) { + SendToICS(ics_prefix); + SendToICS("clearboard\n"); + } else { + for (x = 0; x < BOARD_WIDTH; x++) { ChessSquare p = EmptySquare; + if(x == BOARD_LEFT-1 || x == BOARD_RGHT) p = (ChessSquare) 0; /* [HGM] holdings */ + for (y = 0; y < BOARD_HEIGHT; y++) { + if (gameMode == IcsExamining) { + if (boards[currentMove][y][x] != EmptySquare) { + sprintf(buf, "%sx@%c%c\n", ics_prefix, + AAA + x, ONE + y); + SendToICS(buf); + } + } else { + boards[0][y][x] = p; + } + } + } + } + if (gameMode == EditPosition) { + DrawPosition(FALSE, boards[0]); + } + break; + + case WhitePlay: + SetWhiteToPlayEvent(); + break; + + case BlackPlay: + SetBlackToPlayEvent(); + break; + + case EmptySquare: + if (gameMode == IcsExamining) { + sprintf(buf, "%sx@%c%c\n", ics_prefix, AAA + x, ONE + y); + SendToICS(buf); + } else { + boards[0][y][x] = EmptySquare; + DrawPosition(FALSE, boards[0]); + } + break; + + case PromotePiece: + if(piece >= (int)WhitePawn && piece < (int)WhiteMan || + piece >= (int)BlackPawn && piece < (int)BlackMan ) { + selection = (ChessSquare) (PROMOTED piece); + } else if(piece == EmptySquare) selection = WhiteSilver; + else selection = (ChessSquare)((int)piece - 1); + goto defaultlabel; + + case DemotePiece: + if(piece > (int)WhiteMan && piece <= (int)WhiteKing || + piece > (int)BlackMan && piece <= (int)BlackKing ) { + selection = (ChessSquare) (DEMOTED piece); + } else if(piece == EmptySquare) selection = BlackSilver; + else selection = (ChessSquare)((int)piece + 1); + goto defaultlabel; + + case WhiteQueen: + case BlackQueen: + if(gameInfo.variant == VariantShatranj || + gameInfo.variant == VariantXiangqi || + gameInfo.variant == VariantCourier ) + selection = (ChessSquare)((int)selection - (int)WhiteQueen + (int)WhiteFerz); + goto defaultlabel; + + case WhiteKing: + case BlackKing: + if(gameInfo.variant == VariantXiangqi) + selection = (ChessSquare)((int)selection - (int)WhiteKing + (int)WhiteWazir); + if(gameInfo.variant == VariantKnightmate) + selection = (ChessSquare)((int)selection - (int)WhiteKing + (int)WhiteUnicorn); + default: + defaultlabel: + if (gameMode == IcsExamining) { + sprintf(buf, "%s%c@%c%c\n", ics_prefix, + PieceToChar(selection), AAA + x, ONE + y); + SendToICS(buf); + } else { + boards[0][y][x] = selection; + DrawPosition(FALSE, boards[0]); + } + break; + } + } + + + void + DropMenuEvent(selection, x, y) + ChessSquare selection; + int x, y; + { + ChessMove moveType; + + switch (gameMode) { + case IcsPlayingWhite: + case MachinePlaysBlack: + if (!WhiteOnMove(currentMove)) { - DisplayMoveError("It is Black's turn"); ++ DisplayMoveError(_("It is Black's turn")); + return; + } + moveType = WhiteDrop; + break; + case IcsPlayingBlack: + case MachinePlaysWhite: + if (WhiteOnMove(currentMove)) { - DisplayMoveError("It is White's turn"); ++ DisplayMoveError(_("It is White's turn")); + return; + } + moveType = BlackDrop; + break; + case EditGame: + moveType = WhiteOnMove(currentMove) ? WhiteDrop : BlackDrop; + break; + default: + return; + } + + if (moveType == BlackDrop && selection < BlackPawn) { + selection = (ChessSquare) ((int) selection + + (int) BlackPawn - (int) WhitePawn); + } + if (boards[currentMove][y][x] != EmptySquare) { - DisplayMoveError("That square is occupied"); ++ DisplayMoveError(_("That square is occupied")); + return; + } + + FinishMove(moveType, (int) selection, DROP_RANK, x, y, NULLCHAR); + } + + void + AcceptEvent() + { + /* Accept a pending offer of any kind from opponent */ + + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("accept\n"); + } else if (cmailMsgLoaded) { + if (currentMove == cmailOldMove && + commentList[cmailOldMove] != NULL && + StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? + "Black offers a draw" : "White offers a draw")) { + TruncateGame(); + GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; + } else { - DisplayError("There is no pending offer on this move", 0); ++ DisplayError(_("There is no pending offer on this move"), 0); + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; + } + } else { + /* Not used for offers from chess program */ + } + } + + void + DeclineEvent() + { + /* Decline a pending offer of any kind from opponent */ + + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("decline\n"); + } else if (cmailMsgLoaded) { + if (currentMove == cmailOldMove && + commentList[cmailOldMove] != NULL && + StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? + "Black offers a draw" : "White offers a draw")) { + #ifdef NOTDEF + AppendComment(cmailOldMove, "Draw declined"); + DisplayComment(cmailOldMove - 1, "Draw declined"); + #endif /*NOTDEF*/ + } else { - DisplayError("There is no pending offer on this move", 0); ++ DisplayError(_("There is no pending offer on this move"), 0); + } + } else { + /* Not used for offers from chess program */ + } + } + + void + RematchEvent() + { + /* Issue ICS rematch command */ + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("rematch\n"); + } + } + + void + CallFlagEvent() + { + /* Call your opponent's flag (claim a win on time) */ + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("flag\n"); + } else { + switch (gameMode) { + default: + return; + case MachinePlaysWhite: + if (whiteFlag) { + if (blackFlag) + GameEnds(GameIsDrawn, "Both players ran out of time", + GE_PLAYER); + else + GameEnds(BlackWins, "Black wins on time", GE_PLAYER); + } else { - DisplayError("Your opponent is not out of time", 0); ++ DisplayError(_("Your opponent is not out of time"), 0); + } + break; + case MachinePlaysBlack: + if (blackFlag) { + if (whiteFlag) + GameEnds(GameIsDrawn, "Both players ran out of time", + GE_PLAYER); + else + GameEnds(WhiteWins, "White wins on time", GE_PLAYER); + } else { - DisplayError("Your opponent is not out of time", 0); ++ DisplayError(_("Your opponent is not out of time"), 0); + } + break; + } + } + } + + void + DrawEvent() + { + /* Offer draw or accept pending draw offer from opponent */ + + if (appData.icsActive) { + /* Note: tournament rules require draw offers to be + made after you make your move but before you punch + your clock. Currently ICS doesn't let you do that; + instead, you immediately punch your clock after making + a move, but you can offer a draw at any time. */ + + SendToICS(ics_prefix); + SendToICS("draw\n"); + } else if (cmailMsgLoaded) { + if (currentMove == cmailOldMove && + commentList[cmailOldMove] != NULL && + StrStr(commentList[cmailOldMove], WhiteOnMove(cmailOldMove) ? + "Black offers a draw" : "White offers a draw")) { + GameEnds(GameIsDrawn, "Draw agreed", GE_PLAYER); + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_ACCEPT; + } else if (currentMove == cmailOldMove + 1) { + char *offer = WhiteOnMove(cmailOldMove) ? + "White offers a draw" : "Black offers a draw"; + AppendComment(currentMove, offer); + DisplayComment(currentMove - 1, offer); + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_DRAW; + } else { - DisplayError("You must make your move before offering a draw", 0); ++ DisplayError(_("You must make your move before offering a draw"), 0); + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_MOVE; + } + } else if (first.offeredDraw) { + GameEnds(GameIsDrawn, "Draw agreed", GE_XBOARD); + } else { + if (first.sendDrawOffers) { + SendToProgram("draw\n", &first); + userOfferedDraw = TRUE; + } + } + } + + void + AdjournEvent() + { + /* Offer Adjourn or accept pending Adjourn offer from opponent */ + + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("adjourn\n"); + } else { + /* Currently GNU Chess doesn't offer or accept Adjourns */ + } + } + + + void + AbortEvent() + { + /* Offer Abort or accept pending Abort offer from opponent */ + + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("abort\n"); + } else { + GameEnds(GameUnfinished, "Game aborted", GE_PLAYER); + } + } + + void + ResignEvent() + { + /* Resign. You can do this even if it's not your turn. */ + + if (appData.icsActive) { + SendToICS(ics_prefix); + SendToICS("resign\n"); + } else { + switch (gameMode) { + case MachinePlaysWhite: + GameEnds(WhiteWins, "Black resigns", GE_PLAYER); + break; + case MachinePlaysBlack: + GameEnds(BlackWins, "White resigns", GE_PLAYER); + break; + case EditGame: + if (cmailMsgLoaded) { + TruncateGame(); + if (WhiteOnMove(cmailOldMove)) { + GameEnds(BlackWins, "White resigns", GE_PLAYER); + } else { + GameEnds(WhiteWins, "Black resigns", GE_PLAYER); + } + cmailMoveType[lastLoadGameNumber - 1] = CMAIL_RESIGN; + } + break; + default: + break; + } + } + } + + + void + StopObservingEvent() + { + /* Stop observing current games */ + SendToICS(ics_prefix); + SendToICS("unobserve\n"); + } + + void + StopExaminingEvent() + { + /* Stop observing current game */ + SendToICS(ics_prefix); + SendToICS("unexamine\n"); + } + + void + ForwardInner(target) + int target; + { + int limit; + + if (appData.debugMode) + fprintf(debugFP, "ForwardInner(%d), current %d, forward %d\n", + target, currentMove, forwardMostMove); + + if (gameMode == EditPosition) + return; + + if (gameMode == PlayFromGameFile && !pausing) + PauseEvent(); + + if (gameMode == IcsExamining && pausing) + limit = pauseExamForwardMostMove; + else + limit = forwardMostMove; + + if (target > limit) target = limit; + + if (target > 0 && moveList[target - 1][0]) { + int fromX, fromY, toX, toY; + toX = moveList[target - 1][2] - AAA; + toY = moveList[target - 1][3] - ONE; + if (moveList[target - 1][1] == '@') { + if (appData.highlightLastMove) { + SetHighlights(-1, -1, toX, toY); + } + } else { + fromX = moveList[target - 1][0] - AAA; + fromY = moveList[target - 1][1] - ONE; + if (target == currentMove + 1) { + AnimateMove(boards[currentMove], fromX, fromY, toX, toY); + } + if (appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } + } + } + if (gameMode == EditGame || gameMode == AnalyzeMode || + gameMode == Training || gameMode == PlayFromGameFile || + gameMode == AnalyzeFile) { + while (currentMove < target) { + SendMoveToProgram(currentMove++, &first); + } + } else { + currentMove = target; + } + + if (gameMode == EditGame || gameMode == EndOfGame) { + whiteTimeRemaining = timeRemaining[0][currentMove]; + blackTimeRemaining = timeRemaining[1][currentMove]; + } + DisplayBothClocks(); + DisplayMove(currentMove - 1); + DrawPosition(FALSE, boards[currentMove]); + HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); + if ( !matchMode && gameMode != Training) { // [HGM] PV info: routine tests if empty + DisplayComment(currentMove - 1, commentList[currentMove]); + } + } + + + void + ForwardEvent() + { + if (gameMode == IcsExamining && !pausing) { + SendToICS(ics_prefix); + SendToICS("forward\n"); + } else { + ForwardInner(currentMove + 1); + } + } + + void + ToEndEvent() + { + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + /* to optimze, we temporarily turn off analysis mode while we feed + * the remaining moves to the engine. Otherwise we get analysis output + * after each move. + */ + if (first.analysisSupport) { + SendToProgram("exit\nforce\n", &first); + first.analyzing = FALSE; + } + } + + if (gameMode == IcsExamining && !pausing) { + SendToICS(ics_prefix); + SendToICS("forward 999999\n"); + } else { + ForwardInner(forwardMostMove); + } + + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + /* we have fed all the moves, so reactivate analysis mode */ + SendToProgram("analyze\n", &first); + first.analyzing = TRUE; + /*first.maybeThinking = TRUE;*/ + first.maybeThinking = FALSE; /* avoid killing GNU Chess */ + } + } + + void + BackwardInner(target) + int target; + { + int full_redraw = TRUE; /* [AS] Was FALSE, had to change it! */ + + if (appData.debugMode) + fprintf(debugFP, "BackwardInner(%d), current %d, forward %d\n", + target, currentMove, forwardMostMove); + + if (gameMode == EditPosition) return; + if (currentMove <= backwardMostMove) { + ClearHighlights(); + DrawPosition(full_redraw, boards[currentMove]); + return; + } + if (gameMode == PlayFromGameFile && !pausing) + PauseEvent(); + + if (moveList[target][0]) { + int fromX, fromY, toX, toY; + toX = moveList[target][2] - AAA; + toY = moveList[target][3] - ONE; + if (moveList[target][1] == '@') { + if (appData.highlightLastMove) { + SetHighlights(-1, -1, toX, toY); + } + } else { + fromX = moveList[target][0] - AAA; + fromY = moveList[target][1] - ONE; + if (target == currentMove - 1) { + AnimateMove(boards[currentMove], toX, toY, fromX, fromY); + } + if (appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } + } + } + if (gameMode == EditGame || gameMode==AnalyzeMode || + gameMode == PlayFromGameFile || gameMode == AnalyzeFile) { + while (currentMove > target) { + SendToProgram("undo\n", &first); + currentMove--; + } + } else { + currentMove = target; + } + + if (gameMode == EditGame || gameMode == EndOfGame) { + whiteTimeRemaining = timeRemaining[0][currentMove]; + blackTimeRemaining = timeRemaining[1][currentMove]; + } + DisplayBothClocks(); + DisplayMove(currentMove - 1); + DrawPosition(full_redraw, boards[currentMove]); + HistorySet(parseList,backwardMostMove,forwardMostMove,currentMove-1); + // [HGM] PV info: routine tests if comment empty + DisplayComment(currentMove - 1, commentList[currentMove]); + } + + void + BackwardEvent() + { + if (gameMode == IcsExamining && !pausing) { + SendToICS(ics_prefix); + SendToICS("backward\n"); + } else { + BackwardInner(currentMove - 1); + } + } + + void + ToStartEvent() + { + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + /* to optimze, we temporarily turn off analysis mode while we undo + * all the moves. Otherwise we get analysis output after each undo. + */ + if (first.analysisSupport) { + SendToProgram("exit\nforce\n", &first); + first.analyzing = FALSE; + } + } + + if (gameMode == IcsExamining && !pausing) { + SendToICS(ics_prefix); + SendToICS("backward 999999\n"); + } else { + BackwardInner(backwardMostMove); + } + + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + /* we have fed all the moves, so reactivate analysis mode */ + SendToProgram("analyze\n", &first); + first.analyzing = TRUE; + /*first.maybeThinking = TRUE;*/ + first.maybeThinking = FALSE; /* avoid killing GNU Chess */ + } + } + + void + ToNrEvent(int to) + { + if (gameMode == PlayFromGameFile && !pausing) PauseEvent(); + if (to >= forwardMostMove) to = forwardMostMove; + if (to <= backwardMostMove) to = backwardMostMove; + if (to < currentMove) { + BackwardInner(to); + } else { + ForwardInner(to); + } + } + + void + RevertEvent() + { + if (gameMode != IcsExamining) { - DisplayError("You are not examining a game", 0); ++ DisplayError(_("You are not examining a game"), 0); + return; + } + if (pausing) { - DisplayError("You can't revert while pausing", 0); ++ DisplayError(_("You can't revert while pausing"), 0); + return; + } + SendToICS(ics_prefix); + SendToICS("revert\n"); + } + + void + RetractMoveEvent() + { + switch (gameMode) { + case MachinePlaysWhite: + case MachinePlaysBlack: + if (WhiteOnMove(forwardMostMove) == (gameMode == MachinePlaysWhite)) { - DisplayError("Wait until your turn,\nor select Move Now", 0); ++ DisplayError(_("Wait until your turn,\nor select Move Now"), 0); + return; + } + if (forwardMostMove < 2) return; + currentMove = forwardMostMove = forwardMostMove - 2; + whiteTimeRemaining = timeRemaining[0][currentMove]; + blackTimeRemaining = timeRemaining[1][currentMove]; + DisplayBothClocks(); + DisplayMove(currentMove - 1); + ClearHighlights();/*!! could figure this out*/ + DrawPosition(TRUE, boards[currentMove]); /* [AS] Changed to full redraw! */ + SendToProgram("remove\n", &first); + /*first.maybeThinking = TRUE;*/ /* GNU Chess does not ponder here */ + break; + + case BeginningOfGame: + default: + break; + + case IcsPlayingWhite: + case IcsPlayingBlack: + if (WhiteOnMove(forwardMostMove) == (gameMode == IcsPlayingWhite)) { + SendToICS(ics_prefix); + SendToICS("takeback 2\n"); + } else { + SendToICS(ics_prefix); + SendToICS("takeback 1\n"); + } + break; + } + } + + void + MoveNowEvent() + { + ChessProgramState *cps; + + switch (gameMode) { + case MachinePlaysWhite: + if (!WhiteOnMove(forwardMostMove)) { - DisplayError("It is your turn", 0); ++ DisplayError(_("It is your turn"), 0); + return; + } + cps = &first; + break; + case MachinePlaysBlack: + if (WhiteOnMove(forwardMostMove)) { - DisplayError("It is your turn", 0); ++ DisplayError(_("It is your turn"), 0); + return; + } + cps = &first; + break; + case TwoMachinesPlay: + if (WhiteOnMove(forwardMostMove) == + (first.twoMachinesColor[0] == 'w')) { + cps = &first; + } else { + cps = &second; + } + break; + case BeginningOfGame: + default: + return; + } + SendToProgram("?\n", cps); + } + + void + TruncateGameEvent() + { + EditGameEvent(); + if (gameMode != EditGame) return; + TruncateGame(); + } + + void + TruncateGame() + { + if (forwardMostMove > currentMove) { + if (gameInfo.resultDetails != NULL) { + free(gameInfo.resultDetails); + gameInfo.resultDetails = NULL; + gameInfo.result = GameUnfinished; + } + forwardMostMove = currentMove; + HistorySet(parseList, backwardMostMove, forwardMostMove, + currentMove-1); + } + } + + void + HintEvent() + { + if (appData.noChessProgram) return; + switch (gameMode) { + case MachinePlaysWhite: + if (WhiteOnMove(forwardMostMove)) { - DisplayError("Wait until your turn", 0); ++ DisplayError(_("Wait until your turn"), 0); + return; + } + break; + case BeginningOfGame: + case MachinePlaysBlack: + if (!WhiteOnMove(forwardMostMove)) { - DisplayError("Wait until your turn", 0); ++ DisplayError(_("Wait until your turn"), 0); + return; + } + break; + default: - DisplayError("No hint available", 0); ++ DisplayError(_("No hint available"), 0); + return; + } + SendToProgram("hint\n", &first); + hintRequested = TRUE; + } + + void + BookEvent() + { + if (appData.noChessProgram) return; + switch (gameMode) { + case MachinePlaysWhite: + if (WhiteOnMove(forwardMostMove)) { - DisplayError("Wait until your turn", 0); ++ DisplayError(_("Wait until your turn"), 0); + return; + } + break; + case BeginningOfGame: + case MachinePlaysBlack: + if (!WhiteOnMove(forwardMostMove)) { - DisplayError("Wait until your turn", 0); ++ DisplayError(_("Wait until your turn"), 0); + return; + } + break; + case EditPosition: + EditPositionDone(); + break; + case TwoMachinesPlay: + return; + default: + break; + } + SendToProgram("bk\n", &first); + bookOutput[0] = NULLCHAR; + bookRequested = TRUE; + } + + void + AboutGameEvent() + { + char *tags = PGNTags(&gameInfo); + TagsPopUp(tags, CmailMsg()); + free(tags); + } + + /* end button procedures */ + + void + PrintPosition(fp, move) + FILE *fp; + int move; + { + int i, j; + + for (i = BOARD_HEIGHT - 1; i >= 0; i--) { + for (j = BOARD_LEFT; j < BOARD_RGHT; j++) { + char c = PieceToChar(boards[move][i][j]); + fputc(c == 'x' ? '.' : c, fp); + fputc(j == BOARD_RGHT - 1 ? '\n' : ' ', fp); + } + } + if ((gameMode == EditPosition) ? !blackPlaysFirst : (move % 2 == 0)) + fprintf(fp, "white to play\n"); + else + fprintf(fp, "black to play\n"); + } + + void + PrintOpponents(fp) + FILE *fp; + { + if (gameInfo.white != NULL) { + fprintf(fp, "\t%s vs. %s\n", gameInfo.white, gameInfo.black); + } else { + fprintf(fp, "\n"); + } + } + + /* Find last component of program's own name, using some heuristics */ + void + TidyProgramName(prog, host, buf) + char *prog, *host, buf[MSG_SIZ]; + { + char *p, *q; + int local = (strcmp(host, "localhost") == 0); + while (!local && (p = strchr(prog, ';')) != NULL) { + p++; + while (*p == ' ') p++; + prog = p; + } + if (*prog == '"' || *prog == '\'') { + q = strchr(prog + 1, *prog); + } else { + q = strchr(prog, ' '); + } + if (q == NULL) q = prog + strlen(prog); + p = q; + while (p >= prog && *p != '/' && *p != '\\') p--; + p++; + if(p == prog && *p == '"') p++; + if (q - p >= 4 && StrCaseCmp(q - 4, ".exe") == 0) q -= 4; + memcpy(buf, p, q - p); + buf[q - p] = NULLCHAR; + if (!local) { + strcat(buf, "@"); + strcat(buf, host); + } + } + + char * + TimeControlTagValue() + { + char buf[MSG_SIZ]; + if (!appData.clockMode) { + strcpy(buf, "-"); + } else if (movesPerSession > 0) { + sprintf(buf, "%d/%ld", movesPerSession, timeControl/1000); + } else if (timeIncrement == 0) { + sprintf(buf, "%ld", timeControl/1000); + } else { + sprintf(buf, "%ld+%ld", timeControl/1000, timeIncrement/1000); + } + return StrSave(buf); + } + + void + SetGameInfo() + { + /* This routine is used only for certain modes */ + VariantClass v = gameInfo.variant; + ClearGameInfo(&gameInfo); + gameInfo.variant = v; + + switch (gameMode) { + case MachinePlaysWhite: + gameInfo.event = StrSave( appData.pgnEventHeader ); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave(first.tidy); + gameInfo.black = StrSave(UserName()); + gameInfo.timeControl = TimeControlTagValue(); + break; + + case MachinePlaysBlack: + gameInfo.event = StrSave( appData.pgnEventHeader ); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave(UserName()); + gameInfo.black = StrSave(first.tidy); + gameInfo.timeControl = TimeControlTagValue(); + break; + + case TwoMachinesPlay: + gameInfo.event = StrSave( appData.pgnEventHeader ); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + if (matchGame > 0) { + char buf[MSG_SIZ]; + sprintf(buf, "%d", matchGame); + gameInfo.round = StrSave(buf); + } else { + gameInfo.round = StrSave("-"); + } + if (first.twoMachinesColor[0] == 'w') { + gameInfo.white = StrSave(first.tidy); + gameInfo.black = StrSave(second.tidy); + } else { + gameInfo.white = StrSave(second.tidy); + gameInfo.black = StrSave(first.tidy); + } + gameInfo.timeControl = TimeControlTagValue(); + break; + + case EditGame: + gameInfo.event = StrSave("Edited game"); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave("-"); + gameInfo.black = StrSave("-"); + break; + + case EditPosition: + gameInfo.event = StrSave("Edited position"); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave("-"); + gameInfo.black = StrSave("-"); + break; + + case IcsPlayingWhite: + case IcsPlayingBlack: + case IcsObserving: + case IcsExamining: + break; + + case PlayFromGameFile: + gameInfo.event = StrSave("Game from non-PGN file"); + gameInfo.site = StrSave(HostName()); + gameInfo.date = PGNDate(); + gameInfo.round = StrSave("-"); + gameInfo.white = StrSave("?"); + gameInfo.black = StrSave("?"); + break; + + default: + break; + } + } + + void + ReplaceComment(index, text) + int index; + char *text; + { + int len; + + while (*text == '\n') text++; + len = strlen(text); + while (len > 0 && text[len - 1] == '\n') len--; + + if (commentList[index] != NULL) + free(commentList[index]); + + if (len == 0) { + commentList[index] = NULL; + return; + } + commentList[index] = (char *) malloc(len + 2); + strncpy(commentList[index], text, len); + commentList[index][len] = '\n'; + commentList[index][len + 1] = NULLCHAR; + } + + void + CrushCRs(text) + char *text; + { + char *p = text; + char *q = text; + char ch; + + do { + ch = *p++; + if (ch == '\r') continue; + *q++ = ch; + } while (ch != '\0'); + } + + void + AppendComment(index, text) + int index; + char *text; + { + int oldlen, len; + char *old; + + text = GetInfoFromComment( index, text ); /* [HGM] PV time: strip PV info from comment */ + + CrushCRs(text); + while (*text == '\n') text++; + len = strlen(text); + while (len > 0 && text[len - 1] == '\n') len--; + + if (len == 0) return; + + if (commentList[index] != NULL) { + old = commentList[index]; + oldlen = strlen(old); + commentList[index] = (char *) malloc(oldlen + len + 2); + strcpy(commentList[index], old); + free(old); + strncpy(&commentList[index][oldlen], text, len); + commentList[index][oldlen + len] = '\n'; + commentList[index][oldlen + len + 1] = NULLCHAR; + } else { + commentList[index] = (char *) malloc(len + 2); + strncpy(commentList[index], text, len); + commentList[index][len] = '\n'; + commentList[index][len + 1] = NULLCHAR; + } + } + + static char * FindStr( char * text, char * sub_text ) + { + char * result = strstr( text, sub_text ); + + if( result != NULL ) { + result += strlen( sub_text ); + } + + return result; + } + + /* [AS] Try to extract PV info from PGN comment */ + /* [HGM] PV time: and then remove it, to prevent it appearing twice */ + char *GetInfoFromComment( int index, char * text ) + { + char * sep = text; + + if( text != NULL && index > 0 ) { + int score = 0; + int depth = 0; + int time = -1, sec = 0, deci; + char * s_eval = FindStr( text, "[%eval " ); + char * s_emt = FindStr( text, "[%emt " ); + + if( s_eval != NULL || s_emt != NULL ) { + /* New style */ + char delim; + + if( s_eval != NULL ) { + if( sscanf( s_eval, "%d,%d%c", &score, &depth, &delim ) != 3 ) { + return text; + } + + if( delim != ']' ) { + return text; + } + } + + if( s_emt != NULL ) { + } + } + else { + /* We expect something like: [+|-]nnn.nn/dd */ + int score_lo = 0; + + sep = strchr( text, '/' ); + if( sep == NULL || sep < (text+4) ) { + return text; + } + + time = -1; sec = -1; deci = -1; + if( sscanf( text, "%d.%d/%d %d:%d", &score, &score_lo, &depth, &time, &sec ) != 5 && + sscanf( text, "%d.%d/%d %d.%d", &score, &score_lo, &depth, &time, &deci ) != 5 && + sscanf( text, "%d.%d/%d %d", &score, &score_lo, &depth, &time ) != 4 && + sscanf( text, "%d.%d/%d", &score, &score_lo, &depth ) != 3 ) { + return text; + } + + if( score_lo < 0 || score_lo >= 100 ) { + return text; + } + + if(sec >= 0) time = 600*time + 10*sec; else + if(deci >= 0) time = 10*time + deci; else time *= 10; // deci-sec + + score = score >= 0 ? score*100 + score_lo : score*100 - score_lo; + + /* [HGM] PV time: now locate end of PV info */ + while( *++sep >= '0' && *sep <= '9'); // strip depth + if(time >= 0) + while( *++sep >= '0' && *sep <= '9'); // strip time + if(sec >= 0) + while( *++sep >= '0' && *sep <= '9'); // strip seconds + if(deci >= 0) + while( *++sep >= '0' && *sep <= '9'); // strip fractional seconds + while(*sep == ' ') sep++; + } + + if( depth <= 0 ) { + return text; + } + + if( time < 0 ) { + time = -1; + } + + pvInfoList[index-1].depth = depth; + pvInfoList[index-1].score = score; + pvInfoList[index-1].time = 10*time; // centi-sec + } + return sep; + } + + void + SendToProgram(message, cps) + char *message; + ChessProgramState *cps; + { + int count, outCount, error; + char buf[MSG_SIZ]; + + if (cps->pr == NULL) return; + Attention(cps); + + if (appData.debugMode) { + TimeMark now; + GetTimeMark(&now); + fprintf(debugFP, "%ld >%-6s: %s", + SubtractTimeMarks(&now, &programStartTime), + cps->which, message); + } + + count = strlen(message); + outCount = OutputToProcess(cps->pr, message, count, &error); + if (outCount < count && !exiting + && !endingGame) { /* [HGM] crash: to not hang GameEnds() writing to deceased engines */ - sprintf(buf, "Error writing to %s chess program", cps->which); ++ sprintf(buf, _("Error writing to %s chess program"), cps->which); + if(gameInfo.resultDetails==NULL) { /* [HGM] crash: if game in progress, give reason for abort */ + if(epStatus[forwardMostMove] <= EP_DRAWS) { + gameInfo.result = GameIsDrawn; /* [HGM] accept exit as draw claim */ + sprintf(buf, "%s program exits in draw position (%s)", cps->which, cps->program); + } else { + gameInfo.result = cps->twoMachinesColor[0]=='w' ? BlackWins : WhiteWins; + } + gameInfo.resultDetails = buf; + } + DisplayFatalError(buf, error, 1); + } + } + + void + ReceiveFromProgram(isr, closure, message, count, error) + InputSourceRef isr; + VOIDSTAR closure; + char *message; + int count; + int error; + { + char *end_str; + char buf[MSG_SIZ]; + ChessProgramState *cps = (ChessProgramState *)closure; + + if (isr != cps->isr) return; /* Killed intentionally */ + if (count <= 0) { + if (count == 0) { + sprintf(buf, - "Error: %s chess program (%s) exited unexpectedly", ++ _("Error: %s chess program (%s) exited unexpectedly"), + cps->which, cps->program); + if(gameInfo.resultDetails==NULL) { /* [HGM] crash: if game in progress, give reason for abort */ + if(epStatus[forwardMostMove] <= EP_DRAWS) { + gameInfo.result = GameIsDrawn; /* [HGM] accept exit as draw claim */ - sprintf(buf, "%s program exits in draw position (%s)", cps->which, cps->program); ++ sprintf(buf, _("%s program exits in draw position (%s)"), cps->which, cps->program); + } else { + gameInfo.result = cps->twoMachinesColor[0]=='w' ? BlackWins : WhiteWins; + } + gameInfo.resultDetails = buf; + } + RemoveInputSource(cps->isr); + DisplayFatalError(buf, 0, 1); + } else { + sprintf(buf, - "Error reading from %s chess program (%s)", ++ _("Error reading from %s chess program (%s)"), + cps->which, cps->program); + RemoveInputSource(cps->isr); + + /* [AS] Program is misbehaving badly... kill it */ + if( count == -2 ) { + DestroyChildProcess( cps->pr, 9 ); + cps->pr = NoProc; + } + + DisplayFatalError(buf, error, 1); + } + return; + } + + if ((end_str = strchr(message, '\r')) != NULL) + *end_str = NULLCHAR; + if ((end_str = strchr(message, '\n')) != NULL) + *end_str = NULLCHAR; + + if (appData.debugMode) { + TimeMark now; int print = 1; + char *quote = ""; char c; int i; + + if(appData.engineComments != 1) { /* [HGM] debug: decide if protocol-violating output is written */ + char start = message[0]; + if(start >='A' && start <= 'Z') start += 'a' - 'A'; // be tolerant to capitalizing + if(sscanf(message, "%d%c%d%d%d", &i, &c, &i, &i, &i) != 5 && + sscanf(message, "move %c", &c)!=1 && sscanf(message, "offer%c", &c)!=1 && + sscanf(message, "resign%c", &c)!=1 && sscanf(message, "feature %c", &c)!=1 && + sscanf(message, "error %c", &c)!=1 && sscanf(message, "illegal %c", &c)!=1 && + sscanf(message, "tell%c", &c)!=1 && sscanf(message, "0-1 %c", &c)!=1 && + sscanf(message, "1-0 %c", &c)!=1 && sscanf(message, "1/2-1/2 %c", &c)!=1 && start != '#') + { quote = "# "; print = (appData.engineComments == 2); } + message[0] = start; // restore original message + } + if(print) { + GetTimeMark(&now); + fprintf(debugFP, "%ld <%-6s: %s%s\n", + SubtractTimeMarks(&now, &programStartTime), cps->which, + quote, + message); + } + } ++ ++ /* [DM] if icsEngineAnalyze is active we block all whisper and kibitz output, because nobody want to see this */ ++ if (appData.icsEngineAnalyze) { ++ if (strstr(message, "whisper") != NULL || ++ strstr(message, "kibitz") != NULL || ++ strstr(message, "tellics") != NULL) return; ++ } ++ + HandleMachineMove(message, cps); + } + + + void + SendTimeControl(cps, mps, tc, inc, sd, st) + ChessProgramState *cps; + int mps, inc, sd, st; + long tc; + { + char buf[MSG_SIZ]; + int seconds; + + if( timeControl_2 > 0 ) { + if( (gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b') ) { + tc = timeControl_2; + } + } + tc /= cps->timeOdds; /* [HGM] time odds: apply before telling engine */ + inc /= cps->timeOdds; + st /= cps->timeOdds; + + seconds = (tc / 1000) % 60; /* [HGM] displaced to after applying odds */ + + if (st > 0) { + /* Set exact time per move, normally using st command */ + if (cps->stKludge) { + /* GNU Chess 4 has no st command; uses level in a nonstandard way */ + seconds = st % 60; + if (seconds == 0) { + sprintf(buf, "level 1 %d\n", st/60); + } else { + sprintf(buf, "level 1 %d:%02d\n", st/60, seconds); + } + } else { + sprintf(buf, "st %d\n", st); + } + } else { + /* Set conventional or incremental time control, using level command */ + if (seconds == 0) { + /* Note old gnuchess bug -- minutes:seconds used to not work. + Fixed in later versions, but still avoid :seconds + when seconds is 0. */ + sprintf(buf, "level %d %ld %d\n", mps, tc/60000, inc/1000); + } else { + sprintf(buf, "level %d %ld:%02d %d\n", mps, tc/60000, + seconds, inc/1000); + } + } + SendToProgram(buf, cps); + + /* Orthoganally (except for GNU Chess 4), limit time to st seconds */ + /* Orthogonally, limit search to given depth */ + if (sd > 0) { + if (cps->sdKludge) { + sprintf(buf, "depth\n%d\n", sd); + } else { + sprintf(buf, "sd %d\n", sd); + } + SendToProgram(buf, cps); + } + + if(cps->nps > 0) { /* [HGM] nps */ + if(cps->supportsNPS == FALSE) cps->nps = -1; // don't use if engine explicitly says not supported! + else { + sprintf(buf, "nps %d\n", cps->nps); + SendToProgram(buf, cps); + } + } + } + + ChessProgramState *WhitePlayer() + /* [HGM] return pointer to 'first' or 'second', depending on who plays white */ + { + if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b' || + gameMode == BeginningOfGame || gameMode == MachinePlaysBlack) + return &second; + return &first; + } + + void + SendTimeRemaining(cps, machineWhite) + ChessProgramState *cps; + int /*boolean*/ machineWhite; + { + char message[MSG_SIZ]; + long time, otime; + + /* Note: this routine must be called when the clocks are stopped + or when they have *just* been set or switched; otherwise + it will be off by the time since the current tick started. + */ + if (machineWhite) { + time = whiteTimeRemaining / 10; + otime = blackTimeRemaining / 10; + } else { + time = blackTimeRemaining / 10; + otime = whiteTimeRemaining / 10; + } + /* [HGM] translate opponent's time by time-odds factor */ + otime = (otime * cps->other->timeOdds) / cps->timeOdds; + if (appData.debugMode) { + fprintf(debugFP, "time odds: %d %d \n", cps->timeOdds, cps->other->timeOdds); + } + + if (time <= 0) time = 1; + if (otime <= 0) otime = 1; + + sprintf(message, "time %ld\n", time); + SendToProgram(message, cps); + + sprintf(message, "otim %ld\n", otime); + SendToProgram(message, cps); + } + + int + BoolFeature(p, name, loc, cps) + char **p; + char *name; + int *loc; + ChessProgramState *cps; + { + char buf[MSG_SIZ]; + int len = strlen(name); + int val; + if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { + (*p) += len + 1; + sscanf(*p, "%d", &val); + *loc = (val != 0); + while (**p && **p != ' ') (*p)++; + sprintf(buf, "accepted %s\n", name); + SendToProgram(buf, cps); + return TRUE; + } + return FALSE; + } + + int + IntFeature(p, name, loc, cps) + char **p; + char *name; + int *loc; + ChessProgramState *cps; + { + char buf[MSG_SIZ]; + int len = strlen(name); + if (strncmp((*p), name, len) == 0 && (*p)[len] == '=') { + (*p) += len + 1; + sscanf(*p, "%d", loc); + while (**p && **p != ' ') (*p)++; + sprintf(buf, "accepted %s\n", name); + SendToProgram(buf, cps); + return TRUE; + } + return FALSE; + } + + int + StringFeature(p, name, loc, cps) + char **p; + char *name; + char loc[]; + ChessProgramState *cps; + { + char buf[MSG_SIZ]; + int len = strlen(name); + if (strncmp((*p), name, len) == 0 + && (*p)[len] == '=' && (*p)[len+1] == '\"') { + (*p) += len + 2; + sscanf(*p, "%[^\"]", loc); + while (**p && **p != '\"') (*p)++; + if (**p == '\"') (*p)++; + sprintf(buf, "accepted %s\n", name); + SendToProgram(buf, cps); + return TRUE; + } + return FALSE; + } + + int + ParseOption(Option *opt, ChessProgramState *cps) + // [HGM] options: process the string that defines an engine option, and determine + // name, type, default value, and allowed value range + { + char *p, *q, buf[MSG_SIZ]; + int n, min = (-1)<<31, max = 1<<31, def; + + if(p = strstr(opt->name, " -spin ")) { + if((n = sscanf(p, " -spin %d %d %d", &def, &min, &max)) < 3 ) return FALSE; + if(max < min) max = min; // enforce consistency + if(def < min) def = min; + if(def > max) def = max; + opt->value = def; + opt->min = min; + opt->max = max; + opt->type = Spin; + } else if(p = strstr(opt->name, " -string ")) { + opt->textValue = p+9; + opt->type = TextBox; + } else if(p = strstr(opt->name, " -check ")) { + if(sscanf(p, " -check %d", &def) < 1) return FALSE; + opt->value = (def != 0); + opt->type = CheckBox; + } else if(p = strstr(opt->name, " -combo ")) { + opt->textValue = (char*) (&cps->comboList[cps->comboCnt]); // cheat with pointer type + cps->comboList[cps->comboCnt++] = q = p+8; // holds possible choices + opt->value = n = 0; + while(q = StrStr(q, " /// ")) { + n++; *q = 0; // count choices, and null-terminate each of them + q += 5; + if(*q == '*') { // remember default, which is marked with * prefix + q++; + opt->value = n; + } + cps->comboList[cps->comboCnt++] = q; + } + cps->comboList[cps->comboCnt++] = NULL; + opt->max = n + 1; + opt->type = ComboBox; + } else if(p = strstr(opt->name, " -button")) { + opt->type = Button; + } else if(p = strstr(opt->name, " -save")) { + opt->type = SaveButton; + } else return FALSE; + *p = 0; // terminate option name + return TRUE; + } + + void + FeatureDone(cps, val) + ChessProgramState* cps; + int val; + { + DelayedEventCallback cb = GetDelayedEvent(); + if ((cb == InitBackEnd3 && cps == &first) || + (cb == TwoMachinesEventIfReady && cps == &second)) { + CancelDelayedEvent(); + ScheduleDelayedEvent(cb, val ? 1 : 3600000); + } + cps->initDone = val; + } + + /* Parse feature command from engine */ + void + ParseFeatures(args, cps) + char* args; + ChessProgramState *cps; + { + char *p = args; + char *q; + int val; + char buf[MSG_SIZ]; + + for (;;) { + while (*p == ' ') p++; + if (*p == NULLCHAR) return; + + if (BoolFeature(&p, "setboard", &cps->useSetboard, cps)) continue; + if (BoolFeature(&p, "time", &cps->sendTime, cps)) continue; + if (BoolFeature(&p, "draw", &cps->sendDrawOffers, cps)) continue; + if (BoolFeature(&p, "sigint", &cps->useSigint, cps)) continue; + if (BoolFeature(&p, "sigterm", &cps->useSigterm, cps)) continue; + if (BoolFeature(&p, "reuse", &val, cps)) { + /* Engine can disable reuse, but can't enable it if user said no */ + if (!val) cps->reuse = FALSE; + continue; + } + if (BoolFeature(&p, "analyze", &cps->analysisSupport, cps)) continue; + if (StringFeature(&p, "myname", &cps->tidy, cps)) { + if (gameMode == TwoMachinesPlay) { + DisplayTwoMachinesTitle(); + } else { + DisplayTitle(""); + } + continue; + } + if (StringFeature(&p, "variants", &cps->variants, cps)) continue; + if (BoolFeature(&p, "san", &cps->useSAN, cps)) continue; + if (BoolFeature(&p, "ping", &cps->usePing, cps)) continue; + if (BoolFeature(&p, "playother", &cps->usePlayother, cps)) continue; + if (BoolFeature(&p, "colors", &cps->useColors, cps)) continue; + if (BoolFeature(&p, "usermove", &cps->useUsermove, cps)) continue; + if (BoolFeature(&p, "ics", &cps->sendICS, cps)) continue; + if (BoolFeature(&p, "name", &cps->sendName, cps)) continue; + if (BoolFeature(&p, "pause", &val, cps)) continue; /* unused at present */ + if (IntFeature(&p, "done", &val, cps)) { + FeatureDone(cps, val); + continue; + } + /* Added by Tord: */ + if (BoolFeature(&p, "fen960", &cps->useFEN960, cps)) continue; + if (BoolFeature(&p, "oocastle", &cps->useOOCastle, cps)) continue; + /* End of additions by Tord */ + + /* [HGM] added features: */ + if (BoolFeature(&p, "debug", &cps->debug, cps)) continue; + if (BoolFeature(&p, "nps", &cps->supportsNPS, cps)) continue; + if (IntFeature(&p, "level", &cps->maxNrOfSessions, cps)) continue; + if (BoolFeature(&p, "memory", &cps->memSize, cps)) continue; + if (BoolFeature(&p, "smp", &cps->maxCores, cps)) continue; + if (StringFeature(&p, "egt", &cps->egtFormats, cps)) continue; + if (StringFeature(&p, "option", &(cps->option[cps->nrOptions].name), cps)) { + ParseOption(&(cps->option[cps->nrOptions++]), cps); // [HGM] options: add option feature + if(cps->nrOptions >= MAX_OPTIONS) { + cps->nrOptions--; + sprintf(buf, "%s engine has too many options\n", cps->which); + DisplayError(buf, 0); + } + continue; + } + if (BoolFeature(&p, "smp", &cps->maxCores, cps)) continue; + /* End of additions by HGM */ + + /* unknown feature: complain and skip */ + q = p; + while (*q && *q != '=') q++; + sprintf(buf, "rejected %.*s\n", q-p, p); + SendToProgram(buf, cps); + p = q; + if (*p == '=') { + p++; + if (*p == '\"') { + p++; + while (*p && *p != '\"') p++; + if (*p == '\"') p++; + } else { + while (*p && *p != ' ') p++; + } + } + } + + } + + void + PeriodicUpdatesEvent(newState) + int newState; + { + if (newState == appData.periodicUpdates) + return; + + appData.periodicUpdates=newState; + + /* Display type changes, so update it now */ + DisplayAnalysis(); + + /* Get the ball rolling again... */ + if (newState) { + AnalysisPeriodicEvent(1); + StartAnalysisClock(); + } + } + + void + PonderNextMoveEvent(newState) + int newState; + { + if (newState == appData.ponderNextMove) return; + if (gameMode == EditPosition) EditPositionDone(); + if (newState) { + SendToProgram("hard\n", &first); + if (gameMode == TwoMachinesPlay) { + SendToProgram("hard\n", &second); + } + } else { + SendToProgram("easy\n", &first); + thinkOutput[0] = NULLCHAR; + if (gameMode == TwoMachinesPlay) { + SendToProgram("easy\n", &second); + } + } + appData.ponderNextMove = newState; + } + + void + NewSettingEvent(option, command, value) + char *command; + int option, value; + { + char buf[MSG_SIZ]; + + if (gameMode == EditPosition) EditPositionDone(); + sprintf(buf, "%s%s %d\n", (option ? "option ": ""), command, value); + SendToProgram(buf, &first); + if (gameMode == TwoMachinesPlay) { + SendToProgram(buf, &second); + } + } + + void + ShowThinkingEvent() + // [HGM] thinking: this routine is now also called from "Options -> Engine..." popup + { + static int oldState = 2; // kludge alert! Neither true nor fals, so first time oldState is always updated + int newState = appData.showThinking + // [HGM] thinking: other features now need thinking output as well + || !appData.hideThinkingFromHuman || appData.adjudicateLossThreshold != 0 || EngineOutputIsUp(); + + if (oldState == newState) return; + oldState = newState; + if (gameMode == EditPosition) EditPositionDone(); + if (oldState) { + SendToProgram("post\n", &first); + if (gameMode == TwoMachinesPlay) { + SendToProgram("post\n", &second); + } + } else { + SendToProgram("nopost\n", &first); + thinkOutput[0] = NULLCHAR; + if (gameMode == TwoMachinesPlay) { + SendToProgram("nopost\n", &second); + } + } + // appData.showThinking = newState; // [HGM] thinking: responsible option should already have be changed when calling this routine! + } + + void + AskQuestionEvent(title, question, replyPrefix, which) + char *title; char *question; char *replyPrefix; char *which; + { + ProcRef pr = (which[0] == '1') ? first.pr : second.pr; + if (pr == NoProc) return; + AskQuestion(title, question, replyPrefix, pr); + } + + void + DisplayMove(moveNumber) + int moveNumber; + { + char message[MSG_SIZ]; + char res[MSG_SIZ]; + char cpThinkOutput[MSG_SIZ]; + + if (moveNumber == forwardMostMove - 1 || + gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + + safeStrCpy(cpThinkOutput, thinkOutput, sizeof(cpThinkOutput)); + + if (strchr(cpThinkOutput, '\n')) { + *strchr(cpThinkOutput, '\n') = NULLCHAR; + } + } else { + *cpThinkOutput = NULLCHAR; + } + + /* [AS] Hide thinking from human user */ + if( appData.hideThinkingFromHuman && gameMode != TwoMachinesPlay ) { + *cpThinkOutput = NULLCHAR; + if( thinkOutput[0] != NULLCHAR ) { + int i; + + for( i=0; i<=hiddenThinkOutputState; i++ ) { + cpThinkOutput[i] = '.'; + } + cpThinkOutput[i] = NULLCHAR; + hiddenThinkOutputState = (hiddenThinkOutputState + 1) % 3; + } + } + + if (moveNumber == forwardMostMove - 1 && + gameInfo.resultDetails != NULL) { + if (gameInfo.resultDetails[0] == NULLCHAR) { + sprintf(res, " %s", PGNResult(gameInfo.result)); + } else { + sprintf(res, " {%s} %s", + gameInfo.resultDetails, PGNResult(gameInfo.result)); + } + } else { + res[0] = NULLCHAR; + } + + if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { + DisplayMessage(res, cpThinkOutput); + } else { + sprintf(message, "%d.%s%s%s", moveNumber / 2 + 1, + WhiteOnMove(moveNumber) ? " " : ".. ", + parseList[moveNumber], res); + DisplayMessage(message, cpThinkOutput); + } + } + + void + DisplayAnalysisText(text) + char *text; + { + char buf[MSG_SIZ]; + - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { ++ if (gameMode == AnalyzeMode || gameMode == AnalyzeFile ++ || appData.icsEngineAnalyze) { + sprintf(buf, "Analysis (%s)", first.tidy); + AnalysisPopUp(buf, text); + } + } + + static int + only_one_move(str) + char *str; + { + while (*str && isspace(*str)) ++str; + while (*str && !isspace(*str)) ++str; + if (!*str) return 1; + while (*str && isspace(*str)) ++str; + if (!*str) return 1; + return 0; + } + + void + DisplayAnalysis() + { + char buf[MSG_SIZ]; + char lst[MSG_SIZ / 2]; + double nps; + static char *xtra[] = { "", " (--)", " (++)" }; + int h, m, s, cs; + + if (programStats.time == 0) { + programStats.time = 1; + } + + if (programStats.got_only_move) { + safeStrCpy(buf, programStats.movelist, sizeof(buf)); + } else { + safeStrCpy( lst, programStats.movelist, sizeof(lst)); + - nps = (((double)programStats.nodes) / - (((double)programStats.time)/100.0)); ++ nps = (u64ToDouble(programStats.nodes) / ++ ((double)programStats.time /100.0)); + + cs = programStats.time % 100; + s = programStats.time / 100; + h = (s / (60*60)); + s = s - h*60*60; + m = (s/60); + s = s - m*60; + + if (programStats.moves_left > 0 && appData.periodicUpdates) { + if (programStats.move_name[0] != NULLCHAR) { - sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: %lu NPS: %d\nTime: %02d:%02d:%02d.%02d", ++ sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", + programStats.depth, + programStats.nr_moves-programStats.moves_left, + programStats.nr_moves, programStats.move_name, + ((float)programStats.score)/100.0, lst, + only_one_move(lst)? + xtra[programStats.got_fail] : "", - programStats.nodes, (int)nps, h, m, s, cs); ++ (u64)programStats.nodes, (int)nps, h, m, s, cs); + } else { - sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: %lu NPS: %d\nTime: %02d:%02d:%02d.%02d", ++ sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", + programStats.depth, + programStats.nr_moves-programStats.moves_left, + programStats.nr_moves, ((float)programStats.score)/100.0, + lst, + only_one_move(lst)? + xtra[programStats.got_fail] : "", - programStats.nodes, (int)nps, h, m, s, cs); ++ (u64)programStats.nodes, (int)nps, h, m, s, cs); + } + } else { - sprintf(buf, "depth=%d %+.2f %s%s\nNodes: %lu NPS: %d\nTime: %02d:%02d:%02d.%02d", ++ sprintf(buf, "depth=%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", + programStats.depth, + ((float)programStats.score)/100.0, + lst, + only_one_move(lst)? + xtra[programStats.got_fail] : "", - programStats.nodes, (int)nps, h, m, s, cs); ++ (u64)programStats.nodes, (int)nps, h, m, s, cs); + } + } + DisplayAnalysisText(buf); + } + + void + DisplayComment(moveNumber, text) + int moveNumber; + char *text; + { + char title[MSG_SIZ]; + char buf[8000]; // comment can be long! + int score, depth; + + if( appData.autoDisplayComment ) { + if (moveNumber < 0 || parseList[moveNumber][0] == NULLCHAR) { + strcpy(title, "Comment"); + } else { + sprintf(title, "Comment on %d.%s%s", moveNumber / 2 + 1, + WhiteOnMove(moveNumber) ? " " : ".. ", + parseList[moveNumber]); + } + } else title[0] = 0; + + // [HGM] PV info: display PV info together with (or as) comment + if(moveNumber >= 0 && (depth = pvInfoList[moveNumber].depth) > 0) { + if(text == NULL) text = ""; + score = pvInfoList[moveNumber].score; + sprintf(buf, "%s%.2f/%d %d\n%s", score>0 ? "+" : "", score/100., + depth, (pvInfoList[moveNumber].time+50)/100, text); + CommentPopUp(title, buf); + } else + if (text != NULL) + CommentPopUp(title, text); + } + + /* This routine sends a ^C interrupt to gnuchess, to awaken it if it + * might be busy thinking or pondering. It can be omitted if your + * gnuchess is configured to stop thinking immediately on any user + * input. However, that gnuchess feature depends on the FIONREAD + * ioctl, which does not work properly on some flavors of Unix. + */ + void + Attention(cps) + ChessProgramState *cps; + { + #if ATTENTION + if (!cps->useSigint) return; + if (appData.noChessProgram || (cps->pr == NoProc)) return; + switch (gameMode) { + case MachinePlaysWhite: + case MachinePlaysBlack: + case TwoMachinesPlay: + case IcsPlayingWhite: + case IcsPlayingBlack: + case AnalyzeMode: + case AnalyzeFile: + /* Skip if we know it isn't thinking */ + if (!cps->maybeThinking) return; + if (appData.debugMode) + fprintf(debugFP, "Interrupting %s\n", cps->which); + InterruptChildProcess(cps->pr); + cps->maybeThinking = FALSE; + break; + default: + break; + } + #endif /*ATTENTION*/ + } + + int + CheckFlags() + { + if (whiteTimeRemaining <= 0) { + if (!whiteFlag) { + whiteFlag = TRUE; + if (appData.icsActive) { + if (appData.autoCallFlag && + gameMode == IcsPlayingBlack && !blackFlag) { + SendToICS(ics_prefix); + SendToICS("flag\n"); + } + } else { + if (blackFlag) { - if(gameMode != TwoMachinesPlay) DisplayTitle("Both flags fell"); ++ if(gameMode != TwoMachinesPlay) DisplayTitle(_("Both flags fell")); + } else { - if(gameMode != TwoMachinesPlay) DisplayTitle("White's flag fell"); ++ if(gameMode != TwoMachinesPlay) DisplayTitle(_("White's flag fell")); + if (appData.autoCallFlag) { + GameEnds(BlackWins, "Black wins on time", GE_XBOARD); + return TRUE; + } + } + } + } + } + if (blackTimeRemaining <= 0) { + if (!blackFlag) { + blackFlag = TRUE; + if (appData.icsActive) { + if (appData.autoCallFlag && + gameMode == IcsPlayingWhite && !whiteFlag) { + SendToICS(ics_prefix); + SendToICS("flag\n"); + } + } else { + if (whiteFlag) { - if(gameMode != TwoMachinesPlay) DisplayTitle("Both flags fell"); ++ if(gameMode != TwoMachinesPlay) DisplayTitle(_("Both flags fell")); + } else { - if(gameMode != TwoMachinesPlay) DisplayTitle("Black's flag fell"); ++ if(gameMode != TwoMachinesPlay) DisplayTitle(_("Black's flag fell")); + if (appData.autoCallFlag) { + GameEnds(WhiteWins, "White wins on time", GE_XBOARD); + return TRUE; + } + } + } + } + } + return FALSE; + } + + void + CheckTimeControl() + { + if (!appData.clockMode || appData.icsActive || + gameMode == PlayFromGameFile || forwardMostMove == 0) return; + + /* + * add time to clocks when time control is achieved ([HGM] now also used for increment) + */ + if ( !WhiteOnMove(forwardMostMove) ) + /* White made time control */ + whiteTimeRemaining += GetTimeQuota((forwardMostMove-1)/2) + /* [HGM] time odds: correct new time quota for time odds! */ + / WhitePlayer()->timeOdds; + else + /* Black made time control */ + blackTimeRemaining += GetTimeQuota((forwardMostMove-1)/2) + / WhitePlayer()->other->timeOdds; + } + + void + DisplayBothClocks() + { + int wom = gameMode == EditPosition ? + !blackPlaysFirst : WhiteOnMove(currentMove); + DisplayWhiteClock(whiteTimeRemaining, wom); + DisplayBlackClock(blackTimeRemaining, !wom); + } + + + /* Timekeeping seems to be a portability nightmare. I think everyone + has ftime(), but I'm really not sure, so I'm including some ifdefs + to use other calls if you don't. Clocks will be less accurate if + you have neither ftime nor gettimeofday. + */ + + /* Get the current time as a TimeMark */ + void + GetTimeMark(tm) + TimeMark *tm; + { + #if HAVE_GETTIMEOFDAY + + struct timeval timeVal; + struct timezone timeZone; + + gettimeofday(&timeVal, &timeZone); + tm->sec = (long) timeVal.tv_sec; + tm->ms = (int) (timeVal.tv_usec / 1000L); + + #else /*!HAVE_GETTIMEOFDAY*/ + #if HAVE_FTIME + + #include + struct timeb timeB; + + ftime(&timeB); + tm->sec = (long) timeB.time; + tm->ms = (int) timeB.millitm; + + #else /*!HAVE_FTIME && !HAVE_GETTIMEOFDAY*/ + tm->sec = (long) time(NULL); + tm->ms = 0; + #endif + #endif + } + + /* Return the difference in milliseconds between two + time marks. We assume the difference will fit in a long! + */ + long + SubtractTimeMarks(tm2, tm1) + TimeMark *tm2, *tm1; + { + return 1000L*(tm2->sec - tm1->sec) + + (long) (tm2->ms - tm1->ms); + } + + + /* + * Code to manage the game clocks. + * + * In tournament play, black starts the clock and then white makes a move. + * We give the human user a slight advantage if he is playing white---the + * clocks don't run until he makes his first move, so it takes zero time. + * Also, we don't account for network lag, so we could get out of sync + * with GNU Chess's clock -- but then, referees are always right. + */ + + static TimeMark tickStartTM; + static long intendedTickLength; + + long + NextTickLength(timeRemaining) + long timeRemaining; + { + long nominalTickLength, nextTickLength; + + if (timeRemaining > 0L && timeRemaining <= 10000L) + nominalTickLength = 100L; + else + nominalTickLength = 1000L; + nextTickLength = timeRemaining % nominalTickLength; + if (nextTickLength <= 0) nextTickLength += nominalTickLength; + + return nextTickLength; + } + + /* Adjust clock one minute up or down */ + void + AdjustClock(Boolean which, int dir) + { + if(which) blackTimeRemaining += 60000*dir; + else whiteTimeRemaining += 60000*dir; + DisplayBothClocks(); + } + + /* Stop clocks and reset to a fresh time control */ + void + ResetClocks() + { + (void) StopClockTimer(); + if (appData.icsActive) { + whiteTimeRemaining = blackTimeRemaining = 0; + } else { /* [HGM] correct new time quote for time odds */ + whiteTimeRemaining = GetTimeQuota(-1) / WhitePlayer()->timeOdds; + blackTimeRemaining = GetTimeQuota(-1) / WhitePlayer()->other->timeOdds; + } + if (whiteFlag || blackFlag) { + DisplayTitle(""); + whiteFlag = blackFlag = FALSE; + } + DisplayBothClocks(); + } + + #define FUDGE 25 /* 25ms = 1/40 sec; should be plenty even for 50 Hz clocks */ + + /* Decrement running clock by amount of time that has passed */ + void + DecrementClocks() + { + long timeRemaining; + long lastTickLength, fudge; + TimeMark now; + + if (!appData.clockMode) return; + if (gameMode==AnalyzeMode || gameMode == AnalyzeFile) return; + + GetTimeMark(&now); + + lastTickLength = SubtractTimeMarks(&now, &tickStartTM); + + /* Fudge if we woke up a little too soon */ + fudge = intendedTickLength - lastTickLength; + if (fudge < 0 || fudge > FUDGE) fudge = 0; + + if (WhiteOnMove(forwardMostMove)) { + if(whiteNPS >= 0) lastTickLength = 0; + timeRemaining = whiteTimeRemaining -= lastTickLength; + DisplayWhiteClock(whiteTimeRemaining - fudge, + WhiteOnMove(currentMove)); + } else { + if(blackNPS >= 0) lastTickLength = 0; + timeRemaining = blackTimeRemaining -= lastTickLength; + DisplayBlackClock(blackTimeRemaining - fudge, + !WhiteOnMove(currentMove)); + } + + if (CheckFlags()) return; + + tickStartTM = now; + intendedTickLength = NextTickLength(timeRemaining - fudge) + fudge; + StartClockTimer(intendedTickLength); + + /* if the time remaining has fallen below the alarm threshold, sound the + * alarm. if the alarm has sounded and (due to a takeback or time control + * with increment) the time remaining has increased to a level above the + * threshold, reset the alarm so it can sound again. + */ + + if (appData.icsActive && appData.icsAlarm) { + + /* make sure we are dealing with the user's clock */ + if (!( ((gameMode == IcsPlayingWhite) && WhiteOnMove(currentMove)) || + ((gameMode == IcsPlayingBlack) && !WhiteOnMove(currentMove)) + )) return; + + if (alarmSounded && (timeRemaining > appData.icsAlarmTime)) { + alarmSounded = FALSE; + } else if (!alarmSounded && (timeRemaining <= appData.icsAlarmTime)) { + PlayAlarmSound(); + alarmSounded = TRUE; + } + } + } + + + /* A player has just moved, so stop the previously running + clock and (if in clock mode) start the other one. + We redisplay both clocks in case we're in ICS mode, because + ICS gives us an update to both clocks after every move. + Note that this routine is called *after* forwardMostMove + is updated, so the last fractional tick must be subtracted + from the color that is *not* on move now. + */ + void + SwitchClocks() + { + long lastTickLength; + TimeMark now; + int flagged = FALSE; + + GetTimeMark(&now); + + if (StopClockTimer() && appData.clockMode) { + lastTickLength = SubtractTimeMarks(&now, &tickStartTM); + if (WhiteOnMove(forwardMostMove)) { + if(blackNPS >= 0) lastTickLength = 0; + blackTimeRemaining -= lastTickLength; + /* [HGM] PGNtime: save time for PGN file if engine did not give it */ + // if(pvInfoList[forwardMostMove-1].time == -1) + pvInfoList[forwardMostMove-1].time = // use GUI time + (timeRemaining[1][forwardMostMove-1] - blackTimeRemaining)/10; + } else { + if(whiteNPS >= 0) lastTickLength = 0; + whiteTimeRemaining -= lastTickLength; + /* [HGM] PGNtime: save time for PGN file if engine did not give it */ + // if(pvInfoList[forwardMostMove-1].time == -1) + pvInfoList[forwardMostMove-1].time = + (timeRemaining[0][forwardMostMove-1] - whiteTimeRemaining)/10; + } + flagged = CheckFlags(); + } + CheckTimeControl(); + + if (flagged || !appData.clockMode) return; + + switch (gameMode) { + case MachinePlaysBlack: + case MachinePlaysWhite: + case BeginningOfGame: + if (pausing) return; + break; + + case EditGame: + case PlayFromGameFile: + case IcsExamining: + return; + + default: + break; + } + + tickStartTM = now; + intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? + whiteTimeRemaining : blackTimeRemaining); + StartClockTimer(intendedTickLength); + } + + + /* Stop both clocks */ + void + StopClocks() + { + long lastTickLength; + TimeMark now; + + if (!StopClockTimer()) return; + if (!appData.clockMode) return; + + GetTimeMark(&now); + + lastTickLength = SubtractTimeMarks(&now, &tickStartTM); + if (WhiteOnMove(forwardMostMove)) { + if(whiteNPS >= 0) lastTickLength = 0; + whiteTimeRemaining -= lastTickLength; + DisplayWhiteClock(whiteTimeRemaining, WhiteOnMove(currentMove)); + } else { + if(blackNPS >= 0) lastTickLength = 0; + blackTimeRemaining -= lastTickLength; + DisplayBlackClock(blackTimeRemaining, !WhiteOnMove(currentMove)); + } + CheckFlags(); + } + + /* Start clock of player on move. Time may have been reset, so + if clock is already running, stop and restart it. */ + void + StartClocks() + { + (void) StopClockTimer(); /* in case it was running already */ + DisplayBothClocks(); + if (CheckFlags()) return; + + if (!appData.clockMode) return; + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) return; + + GetTimeMark(&tickStartTM); + intendedTickLength = NextTickLength(WhiteOnMove(forwardMostMove) ? + whiteTimeRemaining : blackTimeRemaining); + + /* [HGM] nps: figure out nps factors, by determining which engine plays white and/or black once and for all */ + whiteNPS = blackNPS = -1; + if(gameMode == MachinePlaysWhite || gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'w' + || appData.zippyPlay && gameMode == IcsPlayingBlack) // first (perhaps only) engine has white + whiteNPS = first.nps; + if(gameMode == MachinePlaysBlack || gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b' + || appData.zippyPlay && gameMode == IcsPlayingWhite) // first (perhaps only) engine has black + blackNPS = first.nps; + if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'b') // second only used in Two-Machines mode + whiteNPS = second.nps; + if(gameMode == TwoMachinesPlay && first.twoMachinesColor[0] == 'w') + blackNPS = second.nps; + if(appData.debugMode) fprintf(debugFP, "nps: w=%d, b=%d\n", whiteNPS, blackNPS); + + StartClockTimer(intendedTickLength); + } + + char * + TimeString(ms) + long ms; + { + long second, minute, hour, day; + char *sign = ""; + static char buf[32]; + + if (ms > 0 && ms <= 9900) { + /* convert milliseconds to tenths, rounding up */ + double tenths = floor( ((double)(ms + 99L)) / 100.00 ); + + sprintf(buf, " %03.1f ", tenths/10.0); + return buf; + } + + /* convert milliseconds to seconds, rounding up */ + /* use floating point to avoid strangeness of integer division + with negative dividends on many machines */ + second = (long) floor(((double) (ms + 999L)) / 1000.0); + + if (second < 0) { + sign = "-"; + second = -second; + } + + day = second / (60 * 60 * 24); + second = second % (60 * 60 * 24); + hour = second / (60 * 60); + second = second % (60 * 60); + minute = second / 60; + second = second % 60; + + if (day > 0) + sprintf(buf, " %s%ld:%02ld:%02ld:%02ld ", + sign, day, hour, minute, second); + else if (hour > 0) + sprintf(buf, " %s%ld:%02ld:%02ld ", sign, hour, minute, second); + else + sprintf(buf, " %s%2ld:%02ld ", sign, minute, second); + + return buf; + } + + + /* + * This is necessary because some C libraries aren't ANSI C compliant yet. + */ + char * + StrStr(string, match) + char *string, *match; + { + int i, length; + + length = strlen(match); + + for (i = strlen(string) - length; i >= 0; i--, string++) + if (!strncmp(match, string, length)) + return string; + + return NULL; + } + + char * + StrCaseStr(string, match) + char *string, *match; + { + int i, j, length; + + length = strlen(match); + + for (i = strlen(string) - length; i >= 0; i--, string++) { + for (j = 0; j < length; j++) { + if (ToLower(match[j]) != ToLower(string[j])) + break; + } + if (j == length) return string; + } + + return NULL; + } + + #ifndef _amigados + int + StrCaseCmp(s1, s2) + char *s1, *s2; + { + char c1, c2; + + for (;;) { + c1 = ToLower(*s1++); + c2 = ToLower(*s2++); + if (c1 > c2) return 1; + if (c1 < c2) return -1; + if (c1 == NULLCHAR) return 0; + } + } + + + int + ToLower(c) + int c; + { + return isupper(c) ? tolower(c) : c; + } + + + int + ToUpper(c) + int c; + { + return islower(c) ? toupper(c) : c; + } + #endif /* !_amigados */ + + char * + StrSave(s) + char *s; + { + char *ret; + + if ((ret = (char *) malloc(strlen(s) + 1))) { + strcpy(ret, s); + } + return ret; + } + + char * + StrSavePtr(s, savePtr) + char *s, **savePtr; + { + if (*savePtr) { + free(*savePtr); + } + if ((*savePtr = (char *) malloc(strlen(s) + 1))) { + strcpy(*savePtr, s); + } + return(*savePtr); + } + + char * + PGNDate() + { + time_t clock; + struct tm *tm; + char buf[MSG_SIZ]; + + clock = time((time_t *)NULL); + tm = localtime(&clock); + sprintf(buf, "%04d.%02d.%02d", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); + return StrSave(buf); + } + + + char * + PositionToFEN(move, useFEN960) + int move; + int useFEN960; + { + int i, j, fromX, fromY, toX, toY; + int whiteToPlay; + char buf[128]; + char *p, *q; + int emptycount; + ChessSquare piece; + + whiteToPlay = (gameMode == EditPosition) ? + !blackPlaysFirst : (move % 2 == 0); + p = buf; + + /* Piece placement data */ + for (i = BOARD_HEIGHT - 1; i >= 0; i--) { + emptycount = 0; + for (j = BOARD_LEFT; j < BOARD_RGHT; j++) { + if (boards[move][i][j] == EmptySquare) { + emptycount++; + } else { ChessSquare piece = boards[move][i][j]; + if (emptycount > 0) { + if(emptycount<10) /* [HGM] can be >= 10 */ + *p++ = '0' + emptycount; + else { *p++ = '0' + emptycount/10; *p++ = '0' + emptycount%10; } + emptycount = 0; + } + if(PieceToChar(piece) == '+') { + /* [HGM] write promoted pieces as '+' (Shogi) */ + *p++ = '+'; + piece = (ChessSquare)(DEMOTED piece); + } + *p++ = PieceToChar(piece); + if(p[-1] == '~') { + /* [HGM] flag promoted pieces as '~' (Crazyhouse) */ + p[-1] = PieceToChar((ChessSquare)(DEMOTED piece)); + *p++ = '~'; + } + } + } + if (emptycount > 0) { + if(emptycount<10) /* [HGM] can be >= 10 */ + *p++ = '0' + emptycount; + else { *p++ = '0' + emptycount/10; *p++ = '0' + emptycount%10; } + emptycount = 0; + } + *p++ = '/'; + } + *(p - 1) = ' '; + + /* [HGM] print Crazyhouse or Shogi holdings */ + if( gameInfo.holdingsWidth ) { + *(p-1) = '['; /* if we wanted to support BFEN, this could be '/' */ + q = p; + for(i=0; i= 0 && + castlingRights[move][0] >= 0 ) + *p++ = castlingRights[move][0] + AAA + 'A' - 'a'; + if(castlingRights[move][2] >= 0 && + castlingRights[move][1] >= 0 ) + *p++ = castlingRights[move][1] + AAA + 'A' - 'a'; + if(castlingRights[move][5] >= 0 && + castlingRights[move][3] >= 0 ) + *p++ = castlingRights[move][3] + AAA; + if(castlingRights[move][5] >= 0 && + castlingRights[move][4] >= 0 ) + *p++ = castlingRights[move][4] + AAA; + } else { + + /* [HGM] write true castling rights */ + if( nrCastlingRights == 6 ) { + if(castlingRights[move][0] == BOARD_RGHT-1 && + castlingRights[move][2] >= 0 ) *p++ = 'K'; + if(castlingRights[move][1] == BOARD_LEFT && + castlingRights[move][2] >= 0 ) *p++ = 'Q'; + if(castlingRights[move][3] == BOARD_RGHT-1 && + castlingRights[move][5] >= 0 ) *p++ = 'k'; + if(castlingRights[move][4] == BOARD_LEFT && + castlingRights[move][5] >= 0 ) *p++ = 'q'; + } + } + if (q == p) *p++ = '-'; /* No castling rights */ + *p++ = ' '; + } + + if(gameInfo.variant != VariantShogi && gameInfo.variant != VariantXiangqi && + gameInfo.variant != VariantShatranj && gameInfo.variant != VariantCourier ) { + /* En passant target square */ + if (move > backwardMostMove) { + fromX = moveList[move - 1][0] - AAA; + fromY = moveList[move - 1][1] - ONE; + toX = moveList[move - 1][2] - AAA; + toY = moveList[move - 1][3] - ONE; + if (fromY == (whiteToPlay ? BOARD_HEIGHT-2 : 1) && + toY == (whiteToPlay ? BOARD_HEIGHT-4 : 3) && + boards[move][toY][toX] == (whiteToPlay ? BlackPawn : WhitePawn) && + fromX == toX) { + /* 2-square pawn move just happened */ + *p++ = toX + AAA; + *p++ = whiteToPlay ? '6'+BOARD_HEIGHT-8 : '3'; + } else { + *p++ = '-'; + } + } else { + *p++ = '-'; + } + *p++ = ' '; + } + + /* [HGM] find reversible plies */ + { int i = 0, j=move; + + if (appData.debugMode) { int k; + fprintf(debugFP, "write FEN 50-move: %d %d %d\n", initialRulePlies, forwardMostMove, backwardMostMove); + for(k=backwardMostMove; k<=forwardMostMove; k++) + fprintf(debugFP, "e%d. p=%d\n", k, epStatus[k]); + + } + + while(j > backwardMostMove && epStatus[j] <= EP_NONE) j--,i++; + if( j == backwardMostMove ) i += initialRulePlies; + sprintf(p, "%d ", i); + p += i>=100 ? 4 : i >= 10 ? 3 : 2; + } + /* Fullmove number */ + sprintf(p, "%d", (move / 2) + 1); + + return StrSave(buf); + } + + Boolean + ParseFEN(board, blackPlaysFirst, fen) + Board board; + int *blackPlaysFirst; + char *fen; + { + int i, j; + char *p; + int emptycount; + ChessSquare piece; + + p = fen; + + /* [HGM] by default clear Crazyhouse holdings, if present */ + if(gameInfo.holdingsWidth) { + for(i=0; i= 0; i--) { + j = 0; + for (;;) { + if (*p == '/' || *p == ' ' || (*p == '[' && i == 0) ) { + if (*p == '/') p++; + emptycount = gameInfo.boardWidth - j; + while (emptycount--) + board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; + break; + #if(BOARD_SIZE >= 10) + } else if(*p=='x' || *p=='X') { /* [HGM] X means 10 */ + p++; emptycount=10; + if (j + emptycount > gameInfo.boardWidth) return FALSE; + while (emptycount--) + board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; + #endif + } else if (isdigit(*p)) { + emptycount = *p++ - '0'; + while(isdigit(*p)) emptycount = 10*emptycount + *p++ - '0'; /* [HGM] allow > 9 */ + if (j + emptycount > gameInfo.boardWidth) return FALSE; + while (emptycount--) + board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; + } else if (*p == '+' || isalpha(*p)) { + if (j >= gameInfo.boardWidth) return FALSE; + if(*p=='+') { + piece = CharToPiece(*++p); + if(piece == EmptySquare) return FALSE; /* unknown piece */ + piece = (ChessSquare) (PROMOTED piece ); p++; + if(PieceToChar(piece) != '+') return FALSE; /* unpromotable piece */ + } else piece = CharToPiece(*p++); + + if(piece==EmptySquare) return FALSE; /* unknown piece */ + if(*p == '~') { /* [HGM] make it a promoted piece for Crazyhouse */ + piece = (ChessSquare) (PROMOTED piece); + if(PieceToChar(piece) != '~') return FALSE; /* cannot be a promoted piece */ + p++; + } + board[i][(j++)+gameInfo.holdingsWidth] = piece; + } else { + return FALSE; + } + } + } + while (*p == '/' || *p == ' ') p++; + + /* [HGM] look for Crazyhouse holdings here */ + while(*p==' ') p++; + if( gameInfo.holdingsWidth && p[-1] == '/' || *p == '[') { + if(*p == '[') p++; + if(*p == '-' ) *p++; /* empty holdings */ else { + if( !gameInfo.holdingsWidth ) return FALSE; /* no room to put holdings! */ + /* if we would allow FEN reading to set board size, we would */ + /* have to add holdings and shift the board read so far here */ + while( (piece = CharToPiece(*p) ) != EmptySquare ) { + *p++; + if((int) piece >= (int) BlackPawn ) { + i = (int)piece - (int)BlackPawn; + i = PieceToNumber((ChessSquare)i); + if( i >= gameInfo.holdingsSize ) return FALSE; + board[BOARD_HEIGHT-1-i][0] = piece; /* black holdings */ + board[BOARD_HEIGHT-1-i][1]++; /* black counts */ + } else { + i = (int)piece - (int)WhitePawn; + i = PieceToNumber((ChessSquare)i); + if( i >= gameInfo.holdingsSize ) return FALSE; + board[i][BOARD_WIDTH-1] = piece; /* white holdings */ + board[i][BOARD_WIDTH-2]++; /* black holdings */ + } + } + } + if(*p == ']') *p++; + } + + while(*p == ' ') p++; + + /* Active color */ + switch (*p++) { + case 'w': + *blackPlaysFirst = FALSE; + break; + case 'b': + *blackPlaysFirst = TRUE; + break; + default: + return FALSE; + } + + /* [HGM] We NO LONGER ignore the rest of the FEN notation */ + /* return the extra info in global variiables */ + + /* set defaults in case FEN is incomplete */ + FENepStatus = EP_UNKNOWN; + for(i=0; i=0 && board[castlingRank[0]][initialRights[0]] != WhiteRook) FENcastlingRights[0] = -1; + if(initialRights[1]>=0 && board[castlingRank[1]][initialRights[1]] != WhiteRook) FENcastlingRights[1] = -1; + if(initialRights[2]>=0 && board[castlingRank[2]][initialRights[2]] != WhiteKing) FENcastlingRights[2] = -1; + if(initialRights[3]>=0 && board[castlingRank[3]][initialRights[3]] != BlackRook) FENcastlingRights[3] = -1; + if(initialRights[4]>=0 && board[castlingRank[4]][initialRights[4]] != BlackRook) FENcastlingRights[4] = -1; + if(initialRights[5]>=0 && board[castlingRank[5]][initialRights[5]] != BlackKing) FENcastlingRights[5] = -1; + FENrulePlies = 0; + + while(*p==' ') p++; + if(nrCastlingRights) { + if(*p=='K' || *p=='Q' || *p=='k' || *p=='q' || *p=='-') { + /* castling indicator present, so default becomes no castlings */ + for(i=0; i= 'a' && *p < 'a' + gameInfo.boardWidth) || + ( *p >= 'A' && *p < 'A' + gameInfo.boardWidth) ) { + char c = *p++; int whiteKingFile=-1, blackKingFile=-1; + + for(i=BOARD_LEFT; iwhiteKingFile; i--); + FENcastlingRights[0] = i != whiteKingFile ? i : -1; + FENcastlingRights[2] = whiteKingFile; + break; + case'Q': + for(i=BOARD_LEFT; board[0][i]!=WhiteRook && iblackKingFile; i--); + FENcastlingRights[3] = i != blackKingFile ? i : -1; + FENcastlingRights[5] = blackKingFile; + break; + case'q': + for(i=BOARD_LEFT; board[BOARD_HEIGHT-1][i]!=BlackRook && i= 'a') { /* black rights */ + for(i=BOARD_LEFT; i= BlackKing ) break; + if(c > i) + FENcastlingRights[3] = c; + else + FENcastlingRights[4] = c; + } else { /* white rights */ + for(i=BOARD_LEFT; i= WhiteKing) break; + if(c > i) + FENcastlingRights[0] = c; + else + FENcastlingRights[1] = c; + } + } + } + if (appData.debugMode) { + fprintf(debugFP, "FEN castling rights:"); + for(i=0; i= BOARD_RGHT) return TRUE; + if(*p >= '0' && *p <='9') *p++; + FENepStatus = c; + } + } + + + if(sscanf(p, "%d", &i) == 1) { + FENrulePlies = i; /* 50-move ply counter */ + /* (The move number is still ignored) */ + } + + return TRUE; + } + + void + EditPositionPasteFEN(char *fen) + { + if (fen != NULL) { + Board initial_position; + + if (!ParseFEN(initial_position, &blackPlaysFirst, fen)) { - DisplayError("Bad FEN position in clipboard", 0); ++ DisplayError(_("Bad FEN position in clipboard"), 0); + return ; + } else { + int savedBlackPlaysFirst = blackPlaysFirst; + EditPositionEvent(); + blackPlaysFirst = savedBlackPlaysFirst; + CopyBoard(boards[0], initial_position); + /* [HGM] copy FEN attributes as well */ + { int i; + initialRulePlies = FENrulePlies; + epStatus[0] = FENepStatus; + for( i=0; i - #endif - - extern GameInfo gameInfo; - - /* ICS vars used with backend.c and zippy.c */ - #define ICS_GENERIC 0 - #define ICS_ICC 1 - #define ICS_FICS 2 - #define ICS_CHESSNET 3 /* not really supported */ - int ics_type; - - /* unsigned int 64 for engine nodes work and display */ - #ifdef WIN32 - /* I don't know the name for this type of other compiler - * If it not work, just modify here - * This is for MS Visual Studio - */ - #ifdef _MSC_VER - #define u64 unsigned __int64 - #define s64 signed __int64 - #define u64Display "%I64u" - #define s64Display "%I64d" - #define u64Const(c) (c ## UI64) - #define s64Const(c) (c ## I64) - #else - /* place holder - * or dummy types for other compiler - */ - #define u64 unsigned long long - #define s64 signed long long - #define u64Display "%I64u" - #define s64Display "%I64d" - #define u64Const(c) (c ## ull) - #define s64Const(c) (c ## ll) - #endif - #else - /* GNU gcc */ - #define u64 unsigned long long - #define s64 signed long long - #define u64Display "%llu" - #define s64Display "%lld" - #define u64Const(c) (c ## ull) - #define s64Const(c) (c ## ll) - #endif - - - /* pgntags.c prototypes - */ - char *PGNTags P((GameInfo *)); - void PrintPGNTags P((FILE *f, GameInfo *)); - int ParsePGNTag P((char *, GameInfo *)); - char *PGNResult P((ChessMove result)); - - - /* gamelist.c prototypes - */ - /* A game node in the double linked list of games. - */ - typedef struct _ListGame { - ListNode node; - int number; - unsigned long offset; /* Byte offset of game within file. */ - GameInfo gameInfo; /* Note that some entries may be NULL. */ - } ListGame; - - extern List gameList; - void ClearGameInfo P((GameInfo *)); - int GameListBuild P((FILE *)); - void GameListInitGameInfo P((GameInfo *)); - char *GameListLine P((int, GameInfo *)); - - extern char* StripHighlight P((char *)); /* returns static data */ - extern char* StripHighlightAndTitle P((char *)); /* returns static data */ - - - typedef struct _CPS { - char *which; - int maybeThinking; - ProcRef pr; - InputSourceRef isr; - char *twoMachinesColor; /* "white\n" or "black\n" */ - char *program; - char *host; - char *dir; - struct _CPS *other; - char *initString; - char *computerString; - int sendTime; /* 0=don't, 1=do, 2=test */ - int sendDrawOffers; - int useSigint; - int useSigterm; - int offeredDraw; /* countdown */ - int reuse; - int useSetboard; /* 0=use "edit"; 1=use "setboard" */ - int useSAN; /* 0=use coordinate notation; 1=use SAN */ - int usePing; /* 0=not OK to use ping; 1=OK */ - int lastPing; - int lastPong; - int usePlayother;/* 0=not OK to use playother; 1=OK */ - int useColors; /* 0=avoid obsolete white/black commands; 1=use them */ - int useUsermove; /* 0=just send move; 1=send "usermove move" */ - int sendICS; /* 0=don't use "ics" command; 1=do */ - int sendName; /* 0=don't use "name" command; 1=do */ - int sdKludge; /* 0=use "sd DEPTH" command; 1=use "depth\nDEPTH" */ - int stKludge; /* 0=use "st TIME" command; 1=use "level 1 TIME" */ - char tidy[MSG_SIZ]; - int matchWins; - char variants[MSG_SIZ]; - int analysisSupport; - int analyzing; - int protocolVersion; - int initDone; - } ChessProgramState; - - extern ChessProgramState first, second; - - #endif /* _BACKEND */ + /* + * backend.h -- Interface exported by XBoard back end + * $Id: backend.h,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + #ifndef _BACKEND + #define _BACKEND + ++/* unsigned int 64 for engine nodes work and display */ ++#ifdef WIN32 ++ /* I don't know the name for this type of other compiler ++ * If it not work, just modify here ++ * This is for MS Visual Studio ++ */ ++ #ifdef _MSC_VER ++ #define u64 unsigned __int64 ++ #define s64 signed __int64 ++ #define u64Display "%I64u" ++ #define s64Display "%I64d" ++ #define u64Const(c) (c ## UI64) ++ #define s64Const(c) (c ## I64) ++ #else ++ /* place holder ++ * or dummy types for other compiler ++ */ ++ #define u64 unsigned long long ++ #define s64 signed long long ++ #define u64Display "%llu" ++ #define s64Display "%lld" ++ #define u64Const(c) (c ## ULL) ++ #define s64Const(c) (c ## LL) ++ #endif ++#else ++ /* GNU gcc */ ++ #define u64 unsigned long long ++ #define s64 signed long long ++ #define u64Display "%llu" ++ #define s64Display "%lld" ++ #define u64Const(c) (c ## ull) ++ #define s64Const(c) (c ## ll) ++#endif ++ + #include "lists.h" + #include "frontend.h" + + extern int gotPremove; + extern GameMode gameMode; + extern int pausing, cmailMsgLoaded, flipView; + extern char white_holding[], black_holding[]; + extern int currentMove, backwardMostMove, forwardMostMove; + extern int blackPlaysFirst; + extern FILE *debugFP; + extern char* programVersion; + extern ProcRef firstProgramPR, secondProgramPR; + extern Board boards[]; + + char *CmailMsg P((void)); + /* Tord: Added the useFEN960 parameter in PositionToFEN() below */ + char *PositionToFEN P((int move, int useFEN960)); + void AlphaRank P((char *s, int n)); /* [HGM] Shogi move preprocessor */ + void EditPositionPasteFEN P((char *fen)); + void TimeDelay P((long ms)); + void SendMultiLineToICS P(( char *text )); + void AnalysisPeriodicEvent P((int force)); + void SetWhiteToPlayEvent P((void)); + void SetBlackToPlayEvent P((void)); + void InitBackEnd1 P((void)); + void InitBackEnd2 P((void)); + int IsPromotion P((int fromX, int fromY, int toX, int toY)); + int InPalace P((int row, int column)); + int PieceForSquare P((int x, int y)); + int OKToStartUserMove P((int x, int y)); + void Reset P((int redraw, int init)); + void ResetGameEvent P((void)); + int LoadGame P((FILE *f, int n, char *title, int useList)); + int LoadGameFromFile P((char *filename, int n, char *title, int useList)); + int CmailLoadGame P((FILE *f, int n, char *title, int useList)); + int ReloadGame P((int offset)); + int SaveGame P((FILE *f, int dummy, char *dummy2)); + int SaveGameToFile P((char *filename, int append)); + int LoadPosition P((FILE *f, int n, char *title)); + int ReloadPosition P((int offset)); + int SavePosition P((FILE *f, int dummy, char *dummy2)); + void EditPositionEvent P((void)); + void FlipViewEvent P((void)); + void MachineWhiteEvent P((void)); + void MachineBlackEvent P((void)); + void TwoMachinesEvent P((void)); + void EditGameEvent P((void)); + void TrainingEvent P((void)); + void IcsClientEvent P((void)); + void ForwardEvent P((void)); + void BackwardEvent P((void)); + void ToEndEvent P((void)); + void ToStartEvent P((void)); + void ToNrEvent P((int to)); + void RevertEvent P((void)); + void RetractMoveEvent P((void)); + void MoveNowEvent P((void)); + void TruncateGameEvent P((void)); + void PauseEvent P((void)); + void CallFlagEvent P((void)); + void AcceptEvent P((void)); + void DeclineEvent P((void)); + void RematchEvent P((void)); + void DrawEvent P((void)); + void AbortEvent P((void)); + void AdjournEvent P((void)); + void ResignEvent P((void)); + void UserAdjudicationEvent P((int result)); + void StopObservingEvent P((void)); + void StopExaminingEvent P((void)); + void PonderNextMoveEvent P((int newState)); + void NewSettingeEvent P((int option, char *command, int value)); + void ShowThinkingEvent P(()); + void PeriodicUpdatesEvent P((int newState)); + void HintEvent P((void)); + void BookEvent P((void)); + void AboutGameEvent P((void)); + void ExitEvent P((int status)); + char *DefaultFileName P((char *)); + ChessMove UserMoveTest P((int fromX, int fromY, int toX, int toY, int promoChar)); + void UserMoveEvent P((int fromX, int fromY, int toX, int toY, int promoChar)); + void DecrementClocks P((void)); + char *TimeString P((long millisec)); + void AutoPlayGameLoop P((void)); + void AdjustClock P((Boolean which, int dir)); + void DisplayBothClocks P((void)); + void EditPositionMenuEvent P((ChessSquare selection, int x, int y)); + void DropMenuEvent P((ChessSquare selection, int x, int y)); + int ParseTimeControl P((char *tc, int ti, int mps)); + void ProcessICSInitScript P((FILE * f)); + void EditCommentEvent P((void)); + void ReplaceComment P((int index, char *text)); + int ReplaceTags P((char *tags, GameInfo *gi));/* returns nonzero on error */ + void AppendComment P((int index, char *text)); + void ReloadCmailMsgEvent P((int unregister)); + void MailMoveEvent P((void)); + void EditTagsEvent P((void)); + void GetMoveListEvent P((void)); + void ExitAnalyzeMode P((void)); + void AnalyzeModeEvent P((void)); + void AnalyzeFileEvent P((void)); + void DoEcho P((void)); + void DontEcho P((void)); + void TidyProgramName P((char *prog, char *host, char *buf)); + void AskQuestionEvent P((char *title, char *question, + char *replyPrefix, char *which)); + Boolean ParseOneMove P((char *move, int moveNum, + ChessMove *moveType, int *fromX, int *fromY, + int *toX, int *toY, char *promoChar)); + char *VariantName P((VariantClass v)); + VariantClass StringToVariant P((char *e)); ++double u64ToDouble P((u64 value)); + + char *StrStr P((char *string, char *match)); + char *StrCaseStr P((char *string, char *match)); + char *StrSave P((char *s)); + char *StrSavePtr P((char *s, char **savePtr)); + + #ifndef _amigados + int StrCaseCmp P((char *s1, char *s2)); + int ToLower P((int c)); + int ToUpper P((int c)); + #else + #define StrCaseCmp Stricmp /* Use utility.library functions */ + #include + #endif + + extern GameInfo gameInfo; + ++/* ICS vars used with backend.c and zippy.c */ ++#define ICS_GENERIC 0 ++#define ICS_ICC 1 ++#define ICS_FICS 2 ++#define ICS_CHESSNET 3 /* not really supported */ ++int ics_type; ++ ++ + + /* pgntags.c prototypes + */ + char *PGNTags P((GameInfo *)); + void PrintPGNTags P((FILE *f, GameInfo *)); + int ParsePGNTag P((char *, GameInfo *)); + char *PGNResult P((ChessMove result)); + + + /* gamelist.c prototypes + */ + /* A game node in the double linked list of games. + */ + typedef struct _ListGame { + ListNode node; + int number; + unsigned long offset; /* Byte offset of game within file. */ + GameInfo gameInfo; /* Note that some entries may be NULL. */ + } ListGame; + + extern List gameList; + void ClearGameInfo P((GameInfo *)); + int GameListBuild P((FILE *)); + void GameListInitGameInfo P((GameInfo *)); + char *GameListLine P((int, GameInfo *)); + char * GameListLineFull P(( int, GameInfo *)); + + extern char* StripHighlight P((char *)); /* returns static data */ + extern char* StripHighlightAndTitle P((char *)); /* returns static data */ + + typedef enum { CheckBox, ComboBox, TextBox, Button, Spin, SaveButton } Control; + + typedef struct _OPT { // [HGM] options: descriptor of UCI-style option + int value; // current setting, starts as default + int min; + int max; + void *handle; // for use by front end + char *textValue; // points to beginning of text value in name field + char **choice; // points to array of combo choices in cps->combo + Control type; + char name[MSG_SIZ]; // holds both option name and text value + } Option; + + typedef struct _CPS { + char *which; + int maybeThinking; + ProcRef pr; + InputSourceRef isr; + char *twoMachinesColor; /* "white\n" or "black\n" */ + char *program; + char *host; + char *dir; + struct _CPS *other; + char *initString; + char *computerString; + int sendTime; /* 0=don't, 1=do, 2=test */ + int sendDrawOffers; + int useSigint; + int useSigterm; + int offeredDraw; /* countdown */ + int reuse; + int useSetboard; /* 0=use "edit"; 1=use "setboard" */ + int useSAN; /* 0=use coordinate notation; 1=use SAN */ + int usePing; /* 0=not OK to use ping; 1=OK */ + int lastPing; + int lastPong; + int usePlayother;/* 0=not OK to use playother; 1=OK */ + int useColors; /* 0=avoid obsolete white/black commands; 1=use them */ + int useUsermove; /* 0=just send move; 1=send "usermove move" */ + int sendICS; /* 0=don't use "ics" command; 1=do */ + int sendName; /* 0=don't use "name" command; 1=do */ + int sdKludge; /* 0=use "sd DEPTH" command; 1=use "depth\nDEPTH" */ + int stKludge; /* 0=use "st TIME" command; 1=use "level 1 TIME" */ + char tidy[MSG_SIZ]; + int matchWins; + char variants[MSG_SIZ]; + int analysisSupport; + int analyzing; + int protocolVersion; + int initDone; + + /* Added by Tord: */ + int useFEN960; /* 0=use "KQkq" style FENs, 1=use "HAha" style FENs */ + int useOOCastle; /* 0="O-O" notation for castling, 1="king capture rook" notation */ + /* End of additions by Tord */ + + int scoreIsAbsolute; /* [AS] 0=don't know (standard), 1=score is always from white side */ + int isUCI; /* [AS] 0=no (Winboard), 1=UCI (requires Polyglot) */ + int hasOwnBookUCI; /* [AS] 0=use GUI or Polyglot book, 1=has own book */ + + /* [HGM] time odds */ + int timeOdds; /* factor through which we divide time for this engine */ + int debug; /* [HGM] ignore engine debug lines starting with '#' */ + int maxNrOfSessions; /* [HGM] secondary TC: max args in 'level' command */ + int accumulateTC; /* [HGM] secondary TC: how to handle extra sessions */ + int nps; /* [HGM] nps: factor for node count to replace time */ + int supportsNPS; + int alphaRank; /* [HGM] shogi: engine uses shogi-type coordinates */ + int maxCores; /* [HGM] SMP: engine understands cores command */ + int memSize; /* [HGM] memsize: engine understands memory command */ + char egtFormats[MSG_SIZ]; /* [HGM] EGT: supported tablebase formats */ + int bookSuspend; /* [HGM] book: go was deferred because of book hit */ + int nrOptions; /* [HGM] options: remembered option="..." features */ + #define MAX_OPTIONS 50 + Option option[MAX_OPTIONS]; + int comboCnt; + char *comboList[10*MAX_OPTIONS]; + void *programLogo; /* [HGM] logo: bitmap of the logo */ + } ChessProgramState; + + extern ChessProgramState first, second; + + /* [AS] Search stats from chessprogram, for the played move */ + typedef struct { + int score; /* Centipawns */ + int depth; /* Plies */ + int time; /* Milliseconds */ + } ChessProgramStats_Move; + + /* Search stats from chessprogram */ + typedef struct { + char movelist[2*MSG_SIZ]; /* Last PV we were sent */ + int depth; /* Current search depth */ + int nr_moves; /* Total nr of root moves */ + int moves_left; /* Moves remaining to be searched */ + char move_name[MOVE_LEN]; /* Current move being searched, if provided */ - unsigned long nodes; /* # of nodes searched */ ++ u64 nodes; /* # of nodes searched */ + int time; /* Search time (centiseconds) */ + int score; /* Score (centipawns) */ + int got_only_move; /* If last msg was "(only move)" */ + int got_fail; /* 0 - nothing, 1 - got "--", 2 - got "++" */ + int ok_to_send; /* handshaking between send & recv */ + int line_is_book; /* 1 if movelist is book moves */ + int seen_stat; /* 1 if we've seen the stat01: line */ + } ChessProgramStats; + + extern ChessProgramStats_Move pvInfoList[MAX_MOVES]; + extern shuffleOpenings; + extern ChessProgramStats programStats; + + #endif /* _BACKEND */ diff --cc bitmaps/convert.c index 0000000,c56cf4e..e1d080a mode 000000,100644..100644 --- a/bitmaps/convert.c +++ b/bitmaps/convert.c @@@ -1,0 -1,73 +1,73 @@@ + #include + + // [HGM] This program converts a WinBoard monochrome .bmp piece-symbol bitmap file + // to a .bm C-source file suitable for inclusion in xboard as buit-in bitmap. + // You will have to convert the bitmaps one by one, and re-direct the output to the desired file! + + main(int argc, char **argv) + { + int i, j, k, d, cnt; char c, h, w, *p, data[10000], *name; + FILE *f; + + if(argc<2) { printf("usage is: convert \n"); exit(0); } + f = fopen(argv[1], "rb"); + if(f == NULL) { printf("file %s not found\n", argv[1]); exit(0); } + + if(fscanf(f, "BM%c", &i) != 1) { printf("%s does not have bitmap format\n"); exit(0); } + for(i=0; i<15; i++) fgetc(f); fscanf(f, "%c%c%c%c%c", &h, &i, &i, &i, &w); + for(i=0; i<39; i++) fgetc(f); + + // printf("h=%d, w=%d\n", h, w); + + p = data; + for(i=0; i>1) | (c&0x80); + c <<= 1; + } + *p++ = d; + c = fgetc(f); + for(k=0; k<8; k++) { + d = (d>>1) | (c&0x80); + c <<= 1; + } + *p++ = d; + c = fgetc(f); + for(k=0; k<8; k++) { + d = (d>>1) | (c&0x80); + c <<= 1; + } + *p++ = d; + c = fgetc(f); + for(k=0; k<8; k++) { + d = (d>>1) | (c&0x80); + c <<= 1; + } + *p++ = d; + } + } + + name = argv[1]; + for(i=0; argv[1][i]; i++) if(argv[1][i] == '\\') name = argv[1]+i+1; + for(i=0; name[i]; i++) if(name[i] == '.') name[i] = 0; + printf("#define %s_width %d\n", name, w); + printf("#define %s_height %d\n", name, h); - printf("static char %s_bits[] = {\n", name); ++ printf("static unsigned char %s_bits[] = {\n", name); + cnt = 0; + for(i=h-1; i>=0; i--) { + for(j=0; j>(8+j-w); + // for(k=0; k<8; k++) { + // printf("%c", c&1 ? 'X' : '.'); + // c >>= 1; + // } + if(cnt!=0) printf(","); + printf("0x%02x", c&255); + if(++cnt % 15 == 0) { printf("\n"); } + } + } + printf("\n};\n"); + } diff --cc common.h index 4a8c502,8263d63..7883184 --- a/common.h +++ b/common.h @@@ -1,453 -1,636 +1,638 @@@ - /* - * common.h -- Common definitions for X and Windows NT versions of XBoard - * $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-95 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ - - #ifndef _COMMON - #define _COMMON - - /* Begin compatibility grunge */ - - #if defined(__STDC__) || defined(WIN32) || defined(_amigados) - #define P(args) args - typedef void *VOIDSTAR; - #else - #define P(args) () - typedef char *VOIDSTAR; - #endif - - #ifdef WIN32 - typedef char Boolean; - typedef char *String; - #define popen _popen - #define pclose _pclose - - #else - #ifdef _amigados /* It is important, that these types have */ - typedef int Boolean; /* a length of 4 bytes each, as we are */ - typedef char *String; /* using ReadArgs() for argument parsing. */ - #ifdef _DCC - FILE *popen(const char *, const char *); - int pclose(FILE *); - #endif - - #else - #include - #endif - #endif - - - #ifndef TRUE - #define TRUE 1 - #define FALSE 0 - #endif - - #if !HAVE_RANDOM - # if HAVE_RAND48 - # define srandom srand48 - # define random lrand48 - # else /* not HAVE_RAND48 */ - # define srandom srand - # define random rand - # endif /* not HAVE_RAND48 */ - #endif /* !HAVE_RANDOM */ - - /* End compatibility grunge */ - + /* + * common.h -- Common definitions for X and Windows NT versions of XBoard + * $Id: common.h,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + + #ifndef _COMMON + #define _COMMON + + + /* Begin compatibility grunge */ + + #if defined(__STDC__) || defined(WIN32) || defined(_amigados) + #define P(args) args + typedef void *VOIDSTAR; + #else + #define P(args) () + typedef char *VOIDSTAR; + #endif + + #ifdef WIN32 + typedef char Boolean; + typedef char *String; + #define popen _popen + #define pclose _pclose + + #else + #ifdef _amigados /* It is important, that these types have */ + typedef int Boolean; /* a length of 4 bytes each, as we are */ + typedef char *String; /* using ReadArgs() for argument parsing. */ + #ifdef _DCC + FILE *popen(const char *, const char *); + int pclose(FILE *); + #endif + + #else + #include + #endif + #endif + + + #ifndef TRUE + #define TRUE 1 + #define FALSE 0 + #endif + + #define UNKNOWN -1 /* [HGM] nps */ + + #if !HAVE_RANDOM + # if HAVE_RAND48 + # define srandom srand48 + # define random lrand48 + # else /* not HAVE_RAND48 */ + # define srandom srand + # define random rand + # endif /* not HAVE_RAND48 */ + #endif /* !HAVE_RANDOM */ + + /* End compatibility grunge */ + #define PROTOVER 2 /* engine protocol version */ - #define BOARD_SIZE 8 - #define DROP_RANK -3 - #define MAX_MOVES 1000 - #define MSG_SIZ 512 - #define DIALOG_SIZE 256 - #define STAR_MATCH_N 16 - #define MOVE_LEN 32 - #define TIME_CONTROL "5" /* in minutes */ - #define TIME_DELAY_QUOTE "1.0" /* seconds between moves */ - #define TIME_DELAY ((float) 1.0) - #define MOVES_PER_SESSION 40 /* moves per TIME_CONTROL */ - #define TIME_INCREMENT -1 /* if >= 0, MOVES_PER_SESSION unused */ - #define WhiteOnMove(move) (((move) % 2) == 0) - #define ICS_HOST "chessclub.com" - #define ICS_PORT "5000" - #define ICS_COMM_PORT "" - #define FIRST_HOST "localhost" - #define SECOND_HOST "localhost" - #define TELNET_PROGRAM "telnet" - #define MATCH_MODE "False" - #define INIT_STRING "new\nrandom\n" - #define WHITE_STRING "white\ngo\n" - #define BLACK_STRING "black\ngo\n" - #define COMPUTER_STRING "computer\n" - #define REUSE_CHESS_PROGRAMS 1 - #define WHITE_PIECE_COLOR "#FFFFCC" - #define BLACK_PIECE_COLOR "#202020" - #define LIGHT_SQUARE_COLOR "#C8C365" - #define DARK_SQUARE_COLOR "#77A26D" - #define JAIL_SQUARE_COLOR "#808080" - #define HIGHLIGHT_SQUARE_COLOR "#FFFF00" - #define PREMOVE_HIGHLIGHT_COLOR "#FF0000" - #define BELLCHAR '\007' - #define NULLCHAR '\000' - #define FEATURE_TIMEOUT 10000 /*ms*/ - - /* Zippy defaults */ - #define ZIPPY_TALK FALSE - #define ZIPPY_PLAY FALSE - #define ZIPPY_LINES "yow.lines" - #define ZIPPY_PINHEAD "" - #define ZIPPY_PASSWORD "" - #define ZIPPY_PASSWORD2 "" - #define ZIPPY_WRONG_PASSWORD "" - #define ZIPPY_ACCEPT_ONLY "" - #define ZIPPY_USE_I TRUE - #define ZIPPY_BUGHOUSE 0 - #define ZIPPY_NOPLAY_CRAFTY FALSE - #define ZIPPY_GAME_END "gameend\n" - #define ZIPPY_GAME_START "" - #define ZIPPY_ADJOURN FALSE - #define ZIPPY_ABORT FALSE - #define ZIPPY_VARIANTS "normal" - #define ZIPPY_MAX_GAMES 0 - #define ZIPPY_REPLAY_TIMEOUT 120 - - typedef enum { - BeginningOfGame, MachinePlaysWhite, MachinePlaysBlack, - AnalyzeMode, AnalyzeFile, TwoMachinesPlay, - EditGame, PlayFromGameFile, EndOfGame, EditPosition, Training, - IcsIdle, IcsPlayingWhite, IcsPlayingBlack, IcsObserving, - IcsExamining - } GameMode; - - typedef enum { - WhitePawn, WhiteKnight, WhiteBishop, WhiteRook, WhiteQueen, WhiteKing, - BlackPawn, BlackKnight, BlackBishop, BlackRook, BlackQueen, BlackKing, - EmptySquare, - ClearBoard, WhitePlay, BlackPlay /*for use on EditPosition menus*/ - } ChessSquare; - - typedef ChessSquare Board[BOARD_SIZE][BOARD_SIZE]; - - typedef enum { - WhiteKingSideCastle = 1, WhiteQueenSideCastle, - WhiteKingSideCastleWild, WhiteQueenSideCastleWild, - WhiteHSideCastleFR, WhiteASideCastleFR, - BlackKingSideCastle, BlackQueenSideCastle, - BlackKingSideCastleWild, BlackQueenSideCastleWild, - BlackHSideCastleFR, BlackASideCastleFR, - WhitePromotionKnight, WhitePromotionBishop, - WhitePromotionRook, WhitePromotionQueen, WhitePromotionKing, - BlackPromotionKnight, BlackPromotionBishop, - BlackPromotionRook, BlackPromotionQueen, BlackPromotionKing, - WhiteCapturesEnPassant, BlackCapturesEnPassant, - WhiteDrop, BlackDrop, - NormalMove, AmbiguousMove, IllegalMove, ImpossibleMove, - WhiteWins, BlackWins, GameIsDrawn, GameUnfinished, - GNUChessGame, XBoardGame, MoveNumberOne, - Comment, PositionDiagram, ElapsedTime, PGNTag, NAG - } ChessMove; - - typedef enum { - ColorShout, ColorSShout, ColorChannel1, ColorChannel, ColorKibitz, - ColorTell, ColorChallenge, ColorRequest, ColorSeek, ColorNormal, - ColorNone, NColorClasses - } ColorClass; - - typedef enum { - SoundMove, SoundBell, SoundAlarm, SoundIcsWin, SoundIcsLoss, - SoundIcsDraw, SoundIcsUnfinished, NSoundClasses - } SoundClass; - - /* Names for chess variants, not necessarily supported */ - typedef enum { - VariantNormal, /* Normal chess */ - VariantLoadable, /* "loadgame" command allowed (not really a variant)*/ - VariantWildCastle, /* Shuffle chess where king can castle from d file */ - VariantNoCastle, /* Shuffle chess with no castling at all */ - VariantFischeRandom, /* FischeRandom */ - VariantBughouse, /* Bughouse, ICC/FICS rules */ - VariantCrazyhouse, /* Crazyhouse, ICC/FICS rules */ - VariantLosers, /* Try to lose all pieces or get mated (ICC wild 17)*/ - VariantSuicide, /* Try to lose all pieces incl. king (FICS) */ - VariantGiveaway, /* Try to have no legal moves left (ICC wild 26) */ - VariantTwoKings, /* Weird ICC wild 9 */ - VariantKriegspiel, /* Kriegspiel; pawns can capture invisible pieces */ - VariantAtomic, /* Capturing piece explodes (ICC wild 27) */ - Variant3Check, /* Win by giving check 3 times (ICC wild 25) */ - VariantShatranj, /* Unsupported (ICC wild 28) */ - Variant29, /* Temporary name for possible future ICC wild 29 */ - Variant30, /* Temporary name for possible future ICC wild 30 */ - Variant31, /* Temporary name for possible future ICC wild 31 */ - Variant32, /* Temporary name for possible future ICC wild 32 */ - Variant33, /* Temporary name for possible future ICC wild 33 */ - Variant34, /* Temporary name for possible future ICC wild 34 */ - Variant35, /* Temporary name for possible future ICC wild 35 */ - Variant36, /* Temporary name for possible future ICC wild 36 */ - VariantUnknown /* Catchall for other unknown variants */ - } VariantClass; - - #define VARIANT_NAMES { \ - "normal", \ - "normal", \ - "wildcastle", \ - "nocastle", \ - "fischerandom", \ - "bughouse", \ - "crazyhouse", \ - "losers", \ - "suicide", \ - "giveaway", \ - "twokings", \ - "kriegspiel", \ - "atomic", \ - "3check", \ - "shatranj", \ - "wild29", \ - "wild30", \ - "wild31", \ - "wild32", \ - "wild33", \ - "wild34", \ - "wild35", \ - "wild36", \ - "unknown" \ - } - - typedef struct { - #if !defined(_amigados) - char *whitePieceColor; - char *blackPieceColor; - char *lightSquareColor; - char *darkSquareColor; - char *jailSquareColor; - char *highlightSquareColor; - char *premoveHighlightColor; - #else - int whitePieceColor; - int blackPieceColor; - int lightSquareColor; - int darkSquareColor; - int jailSquareColor; - int highlightSquareColor; - int premoveHighlightColor; - #endif - int movesPerSession; - int timeIncrement; - char *initString; - char *secondInitString; - char *firstComputerString; - char *secondComputerString; - char *firstChessProgram; - char *secondChessProgram; - char *firstDirectory; - char *secondDirectory; - Boolean firstPlaysBlack; - Boolean noChessProgram; - char *firstHost; - char *secondHost; - char *bitmapDirectory; - char *remoteShell; - char *remoteUser; - float timeDelay; - char *timeControl; - Boolean icsActive; - char *icsHost; - char *icsPort; - char *icsCommPort; /* if set, use serial port instead of tcp host/port */ - char *icsLogon; /* Hack to permit variable logon scripts. */ - char *icsHelper; - Boolean icsInputBox; - Boolean useTelnet; - char *telnetProgram; - char *gateway; - char *loadGameFile; - int loadGameIndex; /* game # within file */ - char *saveGameFile; - Boolean autoSaveGames; - char *loadPositionFile; - int loadPositionIndex; /* position # within file */ - char *savePositionFile; - Boolean matchMode; - int matchGames; - Boolean monoMode; - Boolean debugMode; - Boolean clockMode; - char *boardSize; - Boolean Iconic; - char *searchTime; - int searchDepth; - Boolean showCoords; - char *clockFont; - char *messageFont; /* WinBoard only */ - char *coordFont; - char *font; /* xboard only: all other fonts */ - char *tagsFont; /* WinBoard only */ - char *commentFont; /* WinBoard only */ - char *icsFont; /* WinBoard only */ - Boolean ringBellAfterMoves; - Boolean autoCallFlag; - Boolean flipView; - Boolean autoFlipView; - char *cmailGameName; /* xboard only */ - Boolean alwaysPromoteToQueen; - Boolean oldSaveStyle; - Boolean quietPlay; - Boolean showThinking; - Boolean ponderNextMove; - Boolean periodicUpdates; - Boolean autoObserve; - Boolean autoComment; - Boolean getMoveList; - Boolean testLegality; - int borderXoffset; /* xboard only */ - int borderYoffset; /* xboard only */ - Boolean titleInWindow; /* xboard only */ - Boolean localLineEditing; /* WinBoard only */ - Boolean zippyTalk; - Boolean zippyPlay; - int flashCount; /* Number of times to flash (xboard only) */ - int flashRate; /* Flashes per second (xboard only) */ - char *pixmapDirectory; /* Path to XPM/XIM files to use (xboard only) */ - int msLoginDelay; /* Delay per character (in msec) while sending - ICS logon script (xboard only) */ - Boolean colorize; /* If True, use the following colors to color text */ - /* Strings for colors, as "fg, bg, bold" (strings used in xboard only) */ - char *colorShout; - char *colorSShout; - char *colorChannel1; - char *colorChannel; - char *colorKibitz; - char *colorTell; - char *colorChallenge; - char *colorRequest; - char *colorSeek; - char *colorNormal; - char *soundProgram; /* sound-playing program */ - char *soundShout; - char *soundSShout; - char *soundChannel1; - char *soundChannel; - char *soundKibitz; - char *soundTell; - char *soundChallenge; - char *soundRequest; - char *soundSeek; - char *soundMove; - char *soundIcsWin; - char *soundIcsLoss; - char *soundIcsDraw; - char *soundIcsUnfinished; - char *soundIcsAlarm; - Boolean reuseFirst; - Boolean reuseSecond; - Boolean animateDragging; /* If True, animate mouse dragging of pieces */ - Boolean animate; /* If True, animate non-mouse moves */ - int animSpeed; /* Delay in milliseconds between animation frames */ - Boolean popupMoveErrors; - Boolean popupExitMessage; - int showJail; - Boolean highlightLastMove; - Boolean highlightDragging; - Boolean blindfold; /* if true, no pieces are drawn */ - Boolean premove; /* true if premove feature enabled */ - Boolean premoveWhite; /* true if premoving White first move */ - char *premoveWhiteText; /* text of White premove 1 */ - Boolean premoveBlack; /* true if premoving Black first move */ - char *premoveBlackText; /* text of Black premove 1 */ - Boolean icsAlarm; /* true if sounding alarm at a certain time */ - int icsAlarmTime; /* time to sound alarm, in milliseconds */ - Boolean autoRaiseBoard; - int fontSizeTolerance; /* xboard only */ - char *initialMode; - char *variant; - int firstProtocolVersion; - int secondProtocolVersion; - Boolean showButtonBar; - Boolean icsEngineAnalyze; - #if ZIPPY - char *zippyLines; - char *zippyPinhead; - char *zippyPassword; - char *zippyPassword2; - char *zippyWrongPassword; - char *zippyAcceptOnly; - int zippyUseI; - int zippyBughouse; - int zippyNoplayCrafty; - char *zippyGameEnd; - char *zippyGameStart; - int zippyAdjourn; - int zippyAbort; - char *zippyVariants; - int zippyMaxGames; - int zippyReplayTimeout; /*seconds*/ - #endif - } AppData, *AppDataPtr; - - extern AppData appData; - - typedef struct { - /* PGN 7-tag info */ - char *event; - char *site; - char *date; - char *round; - char *white; - char *black; - ChessMove result; - /* Additional info */ - char *fen; /* NULL or FEN for starting position; input only */ - char *resultDetails; - char *timeControl; - char *extraTags; /* NULL or "[Tag \"Value\"]\n", etc. */ - int whiteRating; /* -1 if unknown */ - int blackRating; /* -1 if unknown */ - VariantClass variant; - } GameInfo; - - - #endif + // [HGM] license: Messages that engines must print to satisfy their license requirements for patented variants + #define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice" + #define NOFALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke" + + /* [HGM] Some notes about board sizes: + In games that allow piece drops, the holdings are considered part of the + board, in the leftmost and rightmost two files. This way they are + automatically part of the game-history states, and enjoy all display + functions (including drag-drop and click-click moves to the regular part + of the board). The drawback of this is that the internal numbering of + files starts at 2 for the a-file if holdings are displayed. To ensure + consistency, this shifted numbering system is used _everywhere_ in the + code, and conversion to the 'normal' system only takes place when the + file number is converted to or from ASCII (by redefining the character + constant 'a'). This works because Winboard only communicates with the + outside world in ASCII. In a similar way, the different rank numbering + systems (starting at rank 0 or 1) are implemented by redefining '1'. + */ + #define BOARD_SIZE 16 /* [HGM] for in declarations */ + #define BOARD_HEIGHT (gameInfo.boardHeight) // [HGM] made user adjustable + #define BOARD_WIDTH (gameInfo.boardWidth + 2*gameInfo.holdingsWidth) + #define BOARD_LEFT (gameInfo.holdingsWidth) // [HGM] play-board edges + #define BOARD_RGHT (gameInfo.boardWidth + gameInfo.holdingsWidth) + #define ONE ('1'-(BOARD_HEIGHT>9)) // [HGM] foremost board rank + #define AAA ('a'-BOARD_LEFT) // [HGM] leftmost board file + #define DROP_RANK -3 + #define MAX_MOVES 1000 + #define MSG_SIZ 512 + #define DIALOG_SIZE 256 + #define STAR_MATCH_N 16 + #define MOVE_LEN 32 + #define TIME_CONTROL "5" /* in minutes */ + #define TIME_DELAY_QUOTE "1.0" /* seconds between moves */ + #define TIME_DELAY ((float) 1.0) + #define MOVES_PER_SESSION 40 /* moves per TIME_CONTROL */ + #define TIME_INCREMENT -1 /* if >= 0, MOVES_PER_SESSION unused */ + #define WhiteOnMove(move) (((move) % 2) == 0) + #define ICS_HOST "chessclub.com" + #define ICS_PORT "5000" + #define ICS_COMM_PORT "" + #define FIRST_HOST "localhost" + #define SECOND_HOST "localhost" + #define TELNET_PROGRAM "telnet" + #define MATCH_MODE "False" + #define INIT_STRING "new\nrandom\n" + #define WHITE_STRING "white\ngo\n" + #define BLACK_STRING "black\ngo\n" + #define COMPUTER_STRING "computer\n" + #define REUSE_CHESS_PROGRAMS 1 + #define WHITE_PIECE_COLOR "#FFFFCC" + #define BLACK_PIECE_COLOR "#202020" + #define LIGHT_SQUARE_COLOR "#C8C365" + #define DARK_SQUARE_COLOR "#77A26D" + #define JAIL_SQUARE_COLOR "#808080" + #define HIGHLIGHT_SQUARE_COLOR "#FFFF00" + #define PREMOVE_HIGHLIGHT_COLOR "#FF0000" + #define BELLCHAR '\007' + #define NULLCHAR '\000' + #define FEATURE_TIMEOUT 10000 /*ms*/ + + /* Zippy defaults */ + #define ZIPPY_TALK FALSE + #define ZIPPY_PLAY FALSE + #define ZIPPY_LINES "yow.lines" + #define ZIPPY_PINHEAD "" + #define ZIPPY_PASSWORD "" + #define ZIPPY_PASSWORD2 "" + #define ZIPPY_WRONG_PASSWORD "" + #define ZIPPY_ACCEPT_ONLY "" + #define ZIPPY_USE_I TRUE + #define ZIPPY_BUGHOUSE 0 + #define ZIPPY_NOPLAY_CRAFTY FALSE + #define ZIPPY_GAME_END "gameend\n" + #define ZIPPY_GAME_START "" + #define ZIPPY_ADJOURN FALSE + #define ZIPPY_ABORT FALSE + #define ZIPPY_VARIANTS "normal,fischerandom,crazyhouse,losers,suicide,3checks,twokings,bughouse,shatranj" + #define ZIPPY_MAX_GAMES 0 + #define ZIPPY_REPLAY_TIMEOUT 120 + + typedef enum { + BeginningOfGame, MachinePlaysWhite, MachinePlaysBlack, + AnalyzeMode, AnalyzeFile, TwoMachinesPlay, + EditGame, PlayFromGameFile, EndOfGame, EditPosition, Training, + IcsIdle, IcsPlayingWhite, IcsPlayingBlack, IcsObserving, + IcsExamining + } GameMode; + + typedef enum { + /* [HGM] the order here is crucial for Crazyhouse & Shogi: */ + /* only the first N pieces can go into the holdings, and */ + /* promotions in those variants shift P-W to U-S */ + WhitePawn, WhiteKnight, WhiteBishop, WhiteRook, WhiteQueen, + WhiteFerz, WhiteAlfil, WhiteAngel, WhiteMarshall, WhiteWazir, WhiteMan, + WhiteCannon, WhiteNightrider, WhiteCardinal, WhiteDragon, WhiteGrasshopper, + WhiteSilver, WhiteFalcon, WhiteLance, WhiteCobra, WhiteUnicorn, WhiteKing, + BlackPawn, BlackKnight, BlackBishop, BlackRook, BlackQueen, + BlackFerz, BlackAlfil, BlackAngel, BlackMarshall, BlackWazir, BlackMan, + BlackCannon, BlackNightrider, BlackCardinal, BlackDragon, BlackGrasshopper, + BlackSilver, BlackFalcon, BlackLance, BlackCobra, BlackUnicorn, BlackKing, + EmptySquare, + ClearBoard, WhitePlay, BlackPlay, PromotePiece, DemotePiece /*for use on EditPosition menus*/ + } ChessSquare; + + /* [HGM] some macros that can be used as prefixes to convert piece types */ + #define WHITE_TO_BLACK (int)BlackPawn - (int)WhitePawn + (int) + #define BLACK_TO_WHITE (int)WhitePawn - (int)BlackPawn + (int) + #define PROMOTED (int)WhiteDragon - (int)WhiteRook + (int) + #define DEMOTED (int)WhiteRook - (int)WhiteDragon + (int) + #define SHOGI (int)EmptySquare + (int) + + + typedef ChessSquare Board[BOARD_SIZE][BOARD_SIZE]; + + typedef enum { + WhiteKingSideCastle = 1, WhiteQueenSideCastle, + WhiteKingSideCastleWild, WhiteQueenSideCastleWild, + WhiteHSideCastleFR, WhiteASideCastleFR, + BlackKingSideCastle, BlackQueenSideCastle, + BlackKingSideCastleWild, BlackQueenSideCastleWild, + BlackHSideCastleFR, BlackASideCastleFR, + WhitePromotionKnight, WhitePromotionBishop, + WhitePromotionRook, WhitePromotionQueen, WhitePromotionKing, + WhitePromotionChancellor, WhitePromotionArchbishop, WhitePromotionCentaur, + BlackPromotionKnight, BlackPromotionBishop, + BlackPromotionRook, BlackPromotionQueen, BlackPromotionKing, + BlackPromotionChancellor, BlackPromotionArchbishop, BlackPromotionCentaur, + WhiteCapturesEnPassant, BlackCapturesEnPassant, + WhiteDrop, BlackDrop, + NormalMove, AmbiguousMove, IllegalMove, ImpossibleMove, + WhiteWins, BlackWins, GameIsDrawn, GameUnfinished, + GNUChessGame, XBoardGame, MoveNumberOne, + Comment, PositionDiagram, ElapsedTime, PGNTag, NAG + } ChessMove; + + typedef enum { + ColorShout, ColorSShout, ColorChannel1, ColorChannel, ColorKibitz, + ColorTell, ColorChallenge, ColorRequest, ColorSeek, ColorNormal, + ColorNone, NColorClasses + } ColorClass; + + typedef enum { + SoundMove, SoundBell, SoundAlarm, SoundIcsWin, SoundIcsLoss, + SoundIcsDraw, SoundIcsUnfinished, NSoundClasses + } SoundClass; + + /* Names for chess variants, not necessarily supported */ + typedef enum { + VariantNormal, /* Normal chess */ + VariantLoadable, /* "loadgame" command allowed (not really a variant)*/ + VariantWildCastle, /* Shuffle chess where king can castle from d file */ + VariantNoCastle, /* Shuffle chess with no castling at all */ + VariantFischeRandom, /* FischeRandom */ + VariantBughouse, /* Bughouse, ICC/FICS rules */ + VariantCrazyhouse, /* Crazyhouse, ICC/FICS rules */ + VariantLosers, /* Try to lose all pieces or get mated (ICC wild 17)*/ + VariantSuicide, /* Try to lose all pieces incl. king (FICS) */ + VariantGiveaway, /* Try to have no legal moves left (ICC wild 26) */ + VariantTwoKings, /* Weird ICC wild 9 */ + VariantKriegspiel, /* Kriegspiel; pawns can capture invisible pieces */ + VariantAtomic, /* Capturing piece explodes (ICC wild 27) */ + Variant3Check, /* Win by giving check 3 times (ICC wild 25) */ + VariantShatranj, /* Unsupported (ICC wild 28) */ + Variant29, /* Temporary name for possible future ICC wild 29 */ + Variant30, /* Temporary name for possible future ICC wild 30 */ + Variant31, /* Temporary name for possible future ICC wild 31 */ + Variant32, /* Temporary name for possible future ICC wild 32 */ + Variant33, /* Temporary name for possible future ICC wild 33 */ + Variant34, /* Temporary name for possible future ICC wild 34 */ + Variant35, /* Temporary name for possible future ICC wild 35 */ + Variant36, /* Temporary name for possible future ICC wild 36 */ + VariantShogi, /* [HGM] added variants */ + VariantXiangqi, + VariantCourier, + VariantGothic, + VariantCapablanca, + VariantKnightmate, + VariantFairy, + VariantCylinder, + VariantFalcon, + VariantCapaRandom, + VariantBerolina, + VariantJanus, + VariantSuper, + VariantGreat, + VariantUnknown /* Catchall for other unknown variants */ + } VariantClass; + + #define VARIANT_NAMES { \ + "normal", \ + "normal", \ + "wildcastle", \ + "nocastle", \ + "fischerandom", \ + "bughouse", \ + "crazyhouse", \ + "losers", \ + "suicide", \ + "giveaway", \ + "twokings", \ + "kriegspiel", \ + "atomic", \ + "3check", \ + "shatranj", \ + "wild29", \ + "wild30", \ + "wild31", \ + "wild32", \ + "wild33", \ + "wild34", \ + "wild35", \ + "wild36", \ + "shogi", \ + "xiangqi", \ + "courier", \ + "gothic", \ + "capablanca", \ + "knightmate", \ + "fairy", \ + "cylinder", \ + "falcon",\ + "caparandom",\ + "berolina",\ + "janus",\ + "super",\ + "great",\ + "unknown" \ + } + + typedef struct { + #if !defined(_amigados) + char *whitePieceColor; + char *blackPieceColor; + char *lightSquareColor; + char *darkSquareColor; + char *jailSquareColor; + char *highlightSquareColor; + char *premoveHighlightColor; + #else + int whitePieceColor; + int blackPieceColor; + int lightSquareColor; + int darkSquareColor; + int jailSquareColor; + int highlightSquareColor; + int premoveHighlightColor; + #endif + int movesPerSession; + int timeIncrement; + char *initString; + char *secondInitString; + char *firstComputerString; + char *secondComputerString; + char *firstChessProgram; + char *secondChessProgram; + char *firstDirectory; + char *secondDirectory; + Boolean firstPlaysBlack; + Boolean noChessProgram; + char *firstHost; + char *secondHost; + char *bitmapDirectory; + char *remoteShell; + char *remoteUser; + float timeDelay; + char *timeControl; + Boolean icsActive; + char *icsHost; + char *icsPort; + char *icsCommPort; /* if set, use serial port instead of tcp host/port */ + char *icsLogon; /* Hack to permit variable logon scripts. */ + char *icsHelper; + Boolean icsInputBox; + Boolean useTelnet; + char *telnetProgram; + char *gateway; + char *loadGameFile; + int loadGameIndex; /* game # within file */ + char *saveGameFile; + Boolean autoSaveGames; + char *loadPositionFile; + int loadPositionIndex; /* position # within file */ + char *savePositionFile; + Boolean matchMode; + int matchGames; + Boolean monoMode; + Boolean debugMode; + Boolean clockMode; + char *boardSize; + Boolean Iconic; + char *searchTime; + int searchDepth; + Boolean showCoords; + char *clockFont; + char *messageFont; /* WinBoard only */ + char *coordFont; + char *font; /* xboard only: all other fonts */ + char *tagsFont; /* WinBoard only */ + char *commentFont; /* WinBoard only */ + char *icsFont; /* WinBoard only */ + Boolean ringBellAfterMoves; + Boolean autoCallFlag; + Boolean flipView; + Boolean autoFlipView; + char *cmailGameName; /* xboard only */ + Boolean alwaysPromoteToQueen; + Boolean oldSaveStyle; + Boolean quietPlay; + Boolean showThinking; + Boolean ponderNextMove; + Boolean periodicUpdates; + Boolean autoObserve; + Boolean autoComment; + Boolean getMoveList; + Boolean testLegality; + int borderXoffset; /* xboard only */ + int borderYoffset; /* xboard only */ + Boolean titleInWindow; /* xboard only */ + Boolean localLineEditing; /* WinBoard only */ + Boolean zippyTalk; + Boolean zippyPlay; + int flashCount; /* Number of times to flash (xboard only) */ + int flashRate; /* Flashes per second (xboard only) */ + char *pixmapDirectory; /* Path to XPM/XIM files to use (xboard only) */ + int msLoginDelay; /* Delay per character (in msec) while sending + ICS logon script (xboard only) */ + Boolean colorize; /* If True, use the following colors to color text */ + /* Strings for colors, as "fg, bg, bold" (strings used in xboard only) */ + char *colorShout; + char *colorSShout; + char *colorChannel1; + char *colorChannel; + char *colorKibitz; + char *colorTell; + char *colorChallenge; + char *colorRequest; + char *colorSeek; + char *colorNormal; + char *soundProgram; /* sound-playing program */ + char *soundShout; + char *soundSShout; + char *soundChannel1; + char *soundChannel; + char *soundKibitz; + char *soundTell; + char *soundChallenge; + char *soundRequest; + char *soundSeek; + char *soundMove; + char *soundIcsWin; + char *soundIcsLoss; + char *soundIcsDraw; + char *soundIcsUnfinished; + char *soundIcsAlarm; + Boolean reuseFirst; + Boolean reuseSecond; + Boolean animateDragging; /* If True, animate mouse dragging of pieces */ + Boolean animate; /* If True, animate non-mouse moves */ + int animSpeed; /* Delay in milliseconds between animation frames */ + Boolean popupMoveErrors; + Boolean popupExitMessage; + int showJail; + Boolean highlightLastMove; + Boolean highlightDragging; + Boolean blindfold; /* if true, no pieces are drawn */ + Boolean premove; /* true if premove feature enabled */ + Boolean premoveWhite; /* true if premoving White first move */ + char *premoveWhiteText; /* text of White premove 1 */ + Boolean premoveBlack; /* true if premoving Black first move */ + char *premoveBlackText; /* text of Black premove 1 */ + Boolean icsAlarm; /* true if sounding alarm at a certain time */ + int icsAlarmTime; /* time to sound alarm, in milliseconds */ + Boolean autoRaiseBoard; + int fontSizeTolerance; /* xboard only */ + char *initialMode; + char *variant; + int firstProtocolVersion; + int secondProtocolVersion; + Boolean showButtonBar; ++ Boolean icsEngineAnalyze; + + /* [AS] New properties (down to the "ZIPPY" part) */ + Boolean firstScoreIsAbsolute; /* If true, engine score is always from white side */ + Boolean secondScoreIsAbsolute; /* If true, engine score is always from white side */ + Boolean saveExtendedInfoInPGN; /* If true, saved PGN games contain extended info */ + Boolean hideThinkingFromHuman; /* If true, program thinking is generated but not displayed in human/computer matches */ + char * liteBackTextureFile; /* Name of texture bitmap for lite squares */ + char * darkBackTextureFile; /* Name of texture bitmap for dark squares */ + int liteBackTextureMode; + int darkBackTextureMode; + char * renderPiecesWithFont; /* Name of font for rendering chess pieces */ + char * fontToPieceTable; /* Map to translate font character to chess pieces */ + int fontBackColorWhite; + int fontForeColorWhite; + int fontBackColorBlack; + int fontForeColorBlack; + int fontPieceSize; /* Size of font relative to square (percentage) */ + int overrideLineGap; /* If >= 0 overrides the lineGap value of the board size properties */ + int adjudicateLossThreshold; /* Adjudicate a two-machine game if both engines agree the score is below this for 6 plies */ + int delayBeforeQuit; + int delayAfterQuit; + char * nameOfDebugFile; + char * pgnEventHeader; + int defaultFrcPosition; + char * gameListTags; + Boolean saveOutOfBookInfo; + Boolean showEvalInMoveHistory; + int evalHistColorWhite; + int evalHistColorBlack; + Boolean highlightMoveWithArrow; + int highlightArrowColor; + Boolean useStickyWindows; + int adjudicateDrawMoves; + Boolean autoDisplayComment; + Boolean autoDisplayTags; + Boolean firstIsUCI; + Boolean secondIsUCI; + Boolean firstHasOwnBookUCI; + Boolean secondHasOwnBookUCI; + char * polyglotDir; + Boolean usePolyglotBook; + char * polyglotBook; + int defaultHashSize; + int defaultCacheSizeEGTB; + char * defaultPathEGTB; + + /* [HGM] Board size */ + int NrFiles; + int NrRanks; + int holdingsSize; + int matchPause; + char * pieceToCharTable; + Boolean allWhite; + Boolean upsideDown; + Boolean alphaRank; + Boolean testClaims; + Boolean checkMates; + Boolean materialDraws; + Boolean trivialDraws; + int ruleMoves; + int drawRepeats; + + #if ZIPPY + char *zippyLines; + char *zippyPinhead; + char *zippyPassword; + char *zippyPassword2; + char *zippyWrongPassword; + char *zippyAcceptOnly; + int zippyUseI; + int zippyBughouse; + int zippyNoplayCrafty; + char *zippyGameEnd; + char *zippyGameStart; + int zippyAdjourn; + int zippyAbort; + char *zippyVariants; + int zippyMaxGames; + int zippyReplayTimeout; /*seconds*/ + #endif + + char *serverMovesName; + Boolean suppressLoadMoves; + int serverPause; + int firstTimeOdds; + int secondTimeOdds; + int timeOddsMode; + int firstAccumulateTC; + int secondAccumulateTC; + int firstNPS; + int secondNPS; + Boolean autoKibitz; + int engineComments; + char *userName; + int rewindIndex; /* [HGM] autoinc */ + int sameColorGames; /* [HGM] alternate */ + int smpCores; /* [HGM] SMP */ + char *egtFormats; + int niceEngines; /* [HGM] nice */ + char *firstLogo; /* [HGM] logo */ + char *secondLogo; + Boolean autoLogo; ++ Boolean noGUI; /* [HGM] fast: suppress all display updates */ + } AppData, *AppDataPtr; + + /* [AS] PGN tags (for showing in the game list) */ + #define GLT_EVENT 'e' + #define GLT_SITE 's' + #define GLT_DATE 'd' + #define GLT_ROUND 'o' + #define GLT_PLAYERS 'p' /* I.e. white "-" black */ + #define GLT_RESULT 'r' + #define GLT_WHITE_ELO 'w' + #define GLT_BLACK_ELO 'b' + #define GLT_TIME_CONTROL 't' + #define GLT_VARIANT 'v' + #define GLT_OUT_OF_BOOK 'a' + + #define GLT_DEFAULT_TAGS "eprd" /* Event, players, result, date */ + + #define GLT_ALL_TAGS "esdoprwbtva" + + #define PGN_OUT_OF_BOOK "Annotator" + + extern AppData appData; + + typedef struct { + /* PGN 7-tag info */ + char *event; + char *site; + char *date; + char *round; + char *white; + char *black; + ChessMove result; + /* Additional info */ + char *fen; /* NULL or FEN for starting position; input only */ + char *resultDetails; + char *timeControl; + char *extraTags; /* NULL or "[Tag \"Value\"]\n", etc. */ + int whiteRating; /* -1 if unknown */ + int blackRating; /* -1 if unknown */ + VariantClass variant; + char *outOfBook; /* [AS] Move and score when engine went out of book */ + int boardWidth; /* [HGM] adjustable board size */ + int boardHeight; + /* [HGM] For Shogi and Crazyhouse: */ + int holdingsSize; /* number of different piece types in holdings */ + int holdingsWidth; /* number of files left and right of board, 0 or 2 */ + } GameInfo; + + + #endif + diff --cc config.h index 0000000,f0e09d3..ba3a502 mode 000000,100644..100644 --- a/config.h +++ b/config.h @@@ -1,0 -1,142 +1,204 @@@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* [HGM] Defining ADJUDICATE switches on rep-draw and insuf-material draws */ -#define ADJUDICATE - -/* [HGM] Defining FAIRY allows different K- & Q-side piece symbols */ -#define FAIRY - -#define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice" -#define FALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke" - -/* Define if you have that is POSIX.1 compatible. */ -/*#undef HAVE_SYS_WAIT_H*/ - -/* Define if you need to in order for stat and other things to work. */ -/*#undef _POSIX_SOURCE*/ - -/* Define as the return type of signal handlers (int or void). */ -/*#undef RETSIGTYPE*/ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/*#undef TIME_WITH_SYS_TIME*/ - -/* Define if lex declares yytext as a char * by default, not a char[]. */ -/*#undef YYTEXT_POINTER*/ - -/*#define FIRST_PTY_LETTER 'p'*/ - -#define HAVE_FCNTL_H 1 - -#define HAVE_GETHOSTNAME 0 - -#define HAVE_GETTIMEOFDAY 0 - -/* Use our own random() defined in winboard.c. */ -#define HAVE_RANDOM 1 -#define random myrandom -#define srandom mysrandom - -#define HAVE_SYS_SOCKET_H 0 - -/*#undef IBMRTAIX*/ - -#define LAST_PTY_LETTER 'q' - -#define PATCHLEVEL "13c" - -#define PRODUCT "WinBoard" - -#define PTY_ITERATION - -#define PTY_NAME_SPRINTF - -#define PTY_TTY_NAME_SPRINTF - -#define REMOTE_SHELL "" - -/*#undef RTU*/ - -/*#undef UNIPLUS*/ - -#define USE_PTYS 0 - -#define VERSION "4.3" - -/*#undef X_WCHAR*/ - -#ifndef __BORLANDC__ -#define WIN32 1 -#else -#define WIN32 -#endif - -#define ZIPPY 1 - -/* Define if you have the _getpty function. */ -/*#undef HAVE__GETPTY*/ - -/* Define if you have the ftime function. */ -#define HAVE_FTIME 1 - -/* Define if you have the grantpt function. */ -/*#undef HAVE_GRANTPT*/ - -/* Define if you have the rand48 function. */ -/*#undef HAVE_RAND48*/ - -/* Define if you have the sysinfo function. */ -/*#undef HAVE_SYSINFO*/ - -/* Define if you have the header file. */ -/*#undef HAVE_LAN_SOCKET_H*/ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/*#undef HAVE_STROPTS_H*/ - -/* Define if you have the header file. */ -#define HAVE_SYS_FCNTL_H 0 - -/* Define if you have the header file. */ -/*#undef HAVE_SYS_SYSTEMINFO_H*/ - -/* Define if you have the header file. */ -/*#undef HAVE_SYS_TIME_H*/ - -/* Define if you have the header file. */ -/*#undef HAVE_UNISTD_H*/ - -/* Define if you have the i library (-li). */ -/*#undef HAVE_LIBI*/ - -/* Define if you have the seq library (-lseq). */ -/*#undef HAVE_LIBSEQ*/ - -/* - Options - -DEMULATE_RSH -DREMOTE_SHELL=\"\" is necessary on Windows 95, because it - does not have its own rsh command. It works better this way on NT too, - because the NT rsh does not propagate signals to the remote process. - -DATTENTION is included even though I haven't been able to send signals to - child processes on Windows, because at least I can send them over rsh to - Unix programs. On Windows I send a newline instead, which wakes up the - chess program if it's polling. On my GNU Chess port the newline actually - works even for Move Now. -*/ -#define EMULATE_RSH 1 -#define ATTENTION 1 - -#ifdef __BORLANDC__ -#define _strdup(x) strdup(x) -#define STRICT -#define _winmajor 3 /* windows 95 */ -#define SCF_DEFAULT 0x0000 -#define SCF_ALL 0x0004 -#endif - ++/* config.h. Generated from config.h.in by configure. */ ++/* config.h.in. Generated from configure.ac by autoheader. */ ++ ++/* template */ ++#define ATTENTION 1 ++ ++/* template */ ++/* #undef DEFINED_SYS_ERRLIST */ ++ ++/* template */ ++/* #undef FIRST_PTY_LETTER */ ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++#define HAVE_DIRENT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_FCNTL_H 1 ++ ++/* Define to 1 if you have the `ftime' function. */ ++/* #undef HAVE_FTIME */ ++ ++/* Define to 1 if you have the `gethostname' function. */ ++#define HAVE_GETHOSTNAME 1 ++ ++/* Define to 1 if you have the `gettimeofday' function. */ ++#define HAVE_GETTIMEOFDAY 1 ++ ++/* Define to 1 if you have the `grantpt' function. */ ++#define HAVE_GRANTPT 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_INTTYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++/* #undef HAVE_LAN_SOCKET_H */ ++ ++/* Define to 1 if you have the `i' library (-li). */ ++/* #undef HAVE_LIBI */ ++ ++/* Define to 1 if you have the `seq' library (-lseq). */ ++/* #undef HAVE_LIBSEQ */ ++ ++/* template */ ++#define HAVE_LIBXPM 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_MEMORY_H 1 ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. */ ++/* #undef HAVE_NDIR_H */ ++ ++/* Define to 1 if you have the `rand48' function. */ ++/* #undef HAVE_RAND48 */ ++ ++/* Define to 1 if you have the `random' function. */ ++#define HAVE_RANDOM 1 ++ ++/* Define to 1 if you have the `setitimer' function. */ ++#define HAVE_SETITIMER 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDINT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDLIB_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRINGS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRING_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STROPTS_H 1 ++ ++/* Define to 1 if you have the `sysinfo' function. */ ++/* #undef HAVE_SYSINFO */ ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++/* #undef HAVE_SYS_DIR_H */ ++ ++/* Define to 1 if you have the header file. */ ++/* #undef HAVE_SYS_FCNTL_H */ ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++/* #undef HAVE_SYS_NDIR_H */ ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_SOCKET_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_STAT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++/* #undef HAVE_SYS_SYSTEMINFO_H */ ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_TIME_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_TYPES_H 1 ++ ++/* Define to 1 if you have that is POSIX.1 compatible. */ ++#define HAVE_SYS_WAIT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_UNISTD_H 1 ++ ++/* Define to 1 if you have the `usleep' function. */ ++#define HAVE_USLEEP 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_X11_XPM_H 1 ++ ++/* Define to 1 if you have the `_getpty' function. */ ++/* #undef HAVE__GETPTY */ ++ ++/* template */ ++/* #undef IBMRTAIX */ ++ ++/* template */ ++/* #undef LAST_PTY_LETTER */ ++ ++/* Name of package */ ++#define PACKAGE "xboard" ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#define PACKAGE_BUGREPORT "bug-xboard@gnu.org" ++ ++/* Define to the full name of this package. */ ++#define PACKAGE_NAME "xboard" ++ ++/* Define to the full name and version of this package. */ ++#define PACKAGE_STRING "xboard 4.4.0e" ++ ++/* Define to the one symbol short name of this package. */ ++#define PACKAGE_TARNAME "xboard" ++ ++/* Define to the version of this package. */ ++#define PACKAGE_VERSION "4.4.0e" ++ ++/* template */ ++#define PATCHLEVEL "" ++ ++/* template */ ++#define PRODUCT "" ++ ++/* template */ ++/* #undef PTY_ITERATION */ ++ ++/* template */ ++/* #undef PTY_NAME_SPRINTF */ ++ ++/* template */ ++/* #undef PTY_OPEN */ ++ ++/* template */ ++/* #undef PTY_TTY_NAME_SPRINTF */ ++ ++/* template */ ++#define REMOTE_SHELL "rsh" ++ ++/* Define as the return type of signal handlers (`int' or `void'). */ ++#define RETSIGTYPE void ++ ++/* template */ ++/* #undef RTU */ ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#define STDC_HEADERS 1 ++ ++/* Define to 1 if you can safely include both and . */ ++#define TIME_WITH_SYS_TIME 1 ++ ++/* template */ ++/* #undef UNIPLUS */ ++ ++/* template */ ++#define USE_PTYS 0 ++ ++/* template */ ++/* #undef USE_XAW3D */ ++ ++/* template */ ++#define VERSION "4.4.0e" ++ ++/* Define to 1 if the X Window System is missing or not being used. */ ++/* #undef X_DISPLAY_MISSING */ ++ ++/* template */ ++/* #undef X_LOCALE */ ++ ++/* template */ ++/* #undef X_WCHAR */ ++ ++/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a ++ `char[]'. */ ++#define YYTEXT_POINTER 1 ++ ++/* should zippy be enabled */ ++#define ZIPPY 1 diff --cc configure index 34426c9,335b730..42bec05 --- a/configure +++ b/configure @@@ -1,10881 -1,12297 +1,12297 @@@ --#! /bin/sh --# Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.63. - # - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - # 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 - - - - - # PATH needs CR - # 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_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 - if (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 - - # Support unset when possible. - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - 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. - 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); exit 1; } - fi - - # Work around bugs in pre-3.0 UWIN ksh. - for as_var in ENV MAIL MAILPATH - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - PS1='$ ' - PS2='> ' - PS4='+ ' - - # NLS nuisances. - LC_ALL=C - export LC_ALL - LANGUAGE=C - export LANGUAGE - - # Required to use basename. - 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 - - - # Name of the executable. - 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'` - - # CDPATH. - $as_unset CDPATH - - - if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes - else - as_have_required=no - fi - - if test $as_have_required = yes && (eval ": - (as_func_return () { - (exit \$1) - } - as_func_success () { - as_func_return 0 - } - as_func_failure () { - as_func_return 1 - } - as_func_ret_success () { - return 0 - } - as_func_ret_failure () { - return 1 - } - - exitcode=0 - if as_func_success; then - : - else - exitcode=1 - echo as_func_success failed. - fi - - if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. - fi - - if as_func_ret_success; then - : - else - exitcode=1 - echo as_func_ret_success failed. - fi - - if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. - fi - - if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : - else - exitcode=1 - echo positional parameters were not saved. - fi - - test \$exitcode = 0) || { (exit 1); exit 1; } - - ( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } - ") 2> /dev/null; then - : - else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac - done - IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF - 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 - - - : - _ASEOF - }; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF - 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_func_return () { - (exit $1) - } - as_func_success () { - as_func_return 0 - } - as_func_failure () { - as_func_return 1 - } - as_func_ret_success () { - return 0 - } - as_func_ret_failure () { - return 1 - } - - exitcode=0 - if as_func_success; then - : - else - exitcode=1 - echo as_func_success failed. - fi - - if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. - fi - - if as_func_ret_success; then - : - else - exitcode=1 - echo as_func_ret_success failed. - fi - - if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. - fi - - if ( set x; as_func_ret_success y && test x = "$1" ); then - : - else - exitcode=1 - echo positional parameters were not saved. - fi - - test $exitcode = 0) || { (exit 1); exit 1; } - - ( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - - _ASEOF - }; then - break - fi - - fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} - fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } - fi - - - fi - - fi - - - - (eval "as_func_return () { - (exit \$1) - } - as_func_success () { - as_func_return 0 - } - as_func_failure () { - as_func_return 1 - } - as_func_ret_success () { - return 0 - } - as_func_ret_failure () { - return 1 - } - - exitcode=0 - if as_func_success; then - : - else - exitcode=1 - echo as_func_success failed. - fi - - if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. - fi - - if as_func_ret_success; then - : - else - exitcode=1 - echo as_func_ret_success failed. - fi - - if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. - fi - - if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : - else - exitcode=1 - echo positional parameters were not saved. - fi - - test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. - } - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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 - { (exit 1); exit 1; }; } - - # 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 - } - - - if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname - else - as_dirname=false - fi - - ECHO_C= ECHO_N= ECHO_T= - case `echo -n x` in - -n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; - *) - ECHO_N='-n';; - esac - if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr - else - as_expr=false - fi - - 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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi - else - as_ln_s='cp -p' - 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=: - else - test -d ./-p && rmdir ./-p - as_mkdir_p=false - fi - - if test -x / >/dev/null 2>&1; then - as_test_x='test -x' - else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' - fi - as_executable_p=$as_test_x - - # 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 7<&0 &1 - - # Name of the host. - # hostname on some systems (SVR3.2, 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= - SHELL=${CONFIG_SHELL-/bin/sh} - - # Identity of this package. - PACKAGE_NAME= - PACKAGE_TARNAME= - PACKAGE_VERSION= - PACKAGE_STRING= - PACKAGE_BUGREPORT= - - ac_unique_file="xboard.c" - # 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" - - ac_subst_vars='LTLIBOBJS - LIBOBJS - PATCHLEVEL - VERSION - PRODUCT - ZIPPY_H - ZIPPY_O - CONF_LDFLAGS - CONF_CFLAGS - POST_XMULIB - PRE_XMULIB - POSUB - LTLIBINTL - LIBINTL - INTLLIBS - LTLIBICONV - LIBICONV - MSGMERGE - XGETTEXT - GMSGFMT - MSGFMT - USE_NLS - MKINSTALLDIRS - SET_MAKE - host_os - host_vendor - host_cpu - host - build_os - build_vendor - build_cpu - build - X_EXTRA_LIBS - X_LIBS - X_PRE_LIBS - X_CFLAGS - XMKMF - EGREP - GREP - XAW_LIBS - PERLPATH - AWKPATH - NROFFFLAGS - NROFF - RSH - LEXLIB - LEX_OUTPUT_ROOT - LEX - INSTALL_DATA - INSTALL_SCRIPT - INSTALL_PROGRAM - CPP - OBJEXT - EXEEXT - ac_ct_CC - CPPFLAGS - LDFLAGS - CFLAGS - CC - 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_BUGREPORT - PACKAGE_STRING - PACKAGE_VERSION - PACKAGE_TARNAME - PACKAGE_NAME - PATH_SEPARATOR - SHELL' - ac_subst_files='' - ac_user_opts=' - enable_option_checking - with_Xaw3d - with_x - enable_nls - with_gnu_ld - enable_rpath - with_libiconv_prefix - with_libintl_prefix - enable_xpm - enable_ptys - enable_zippy - enable_sigint - ' - ac_precious_vars='build_alias - host_alias - target_alias - CC - CFLAGS - LDFLAGS - LIBS - CPPFLAGS - CPP - XMKMF' - - - # 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}' - 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=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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - 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_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - 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_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - 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_echo "$as_me: error: unrecognized option: $ac_option - Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - 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_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } - fi - - if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $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_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } - 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 - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - 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_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } - test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - - # 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_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi - ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" - ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - 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 this package 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/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] - _ACEOF - - cat <<\_ACEOF - - X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - - 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 - - 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] - --disable-nls do not use Native Language Support - --disable-rpath do not hardcode runtime library paths - --enable-xpm libXpm will be used if found (default) - --disable-xpm libXpm will not be used - --enable-ptys force use of pseudo-ttys with child processes - --disable-ptys force use of pipes with child processes - --enable-zippy support interfacing a chess program to ICS (default) - --disable-zippy do not support interfacing a chess program to ICS - --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) - --disable-sigint typing a command wakes up GNU Chess - - Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-Xaw3d use Xaw3d instead of Xaw - --with-x use the X Window System - --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 - - 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 C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System - - Use these variables to override the choices made by `configure' or to help - it to find libraries and programs with nonstandard names/locations. - - _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 - configure - generated by GNU Autoconf 2.63 - - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 - 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 $as_me, which was - generated by GNU Autoconf 2.63. 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) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done - done - $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } - $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 - - cat <<\_ASBOX - ## ---------------- ## - ## Cache variables. ## - ## ---------------- ## - _ASBOX - 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:$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= ;; #( - *) $as_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 - - cat <<\_ASBOX - ## ----------------- ## - ## Output variables. ## - ## ----------------- ## - _ASBOX - 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 - cat <<\_ASBOX - ## ------------------- ## - ## File substitutions. ## - ## ------------------- ## - _ASBOX - 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 - cat <<\_ASBOX - ## ----------- ## - ## confdefs.h. ## - ## ----------- ## - _ASBOX - 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'; { (exit 1); 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 - - # 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 - - - # 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 - ac_site_file1=$CONFIG_SITE - 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 -r "$ac_site_file"; then - { $as_echo "$as_me:$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" - 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. - if test -f "$cache_file"; then - { $as_echo "$as_me:$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:$LINENO: creating cache $cache_file" >&5 - $as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file - fi - - # 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:$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:$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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5 - $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi - done - if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 - $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } - 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_config_headers="$ac_config_headers config.h" - - - PRODUCT=xboard - VERSION=4.2 - PATCHLEVEL=pre8 - - if test -z "$CFLAGS" ; then - CFLAGS=" " - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 - $as_echo "$CC" >&6; } - else - { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 - $as_echo "$ac_ct_CC" >&6; } - else - { $as_echo "$as_me:$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:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 - $as_echo "$CC" >&6; } - else - { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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:$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:$LINENO: result: $CC" >&5 - $as_echo "$CC" >&6; } - else - { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$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:$LINENO: result: $CC" >&5 - $as_echo "$CC" >&6; } - else - { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_ac_ct_CC+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$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:$LINENO: result: $ac_ct_CC" >&5 - $as_echo "$ac_ct_CC" >&6; } - else - { $as_echo "$as_me:$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:$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:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: no acceptable C compiler found in \$PATH - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - - # Provide some information about the compiler. - $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 - set X $ac_compile - ac_compiler=$2 - { (ac_try="$ac_compiler --version >&5" - case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; - esac - eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (ac_try="$ac_compiler -v >&5" - case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; - esac - eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (ac_try="$ac_compiler -V >&5" - case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; - esac - eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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:$LINENO: checking for C compiler default output file name" >&5 - $as_echo_n "checking for C compiler default output file name... " >&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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 - - { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 - $as_echo "$ac_file" >&6; } - if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: C compiler cannot create executables - See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - fi - - ac_exeext=$ac_cv_exeext - - # Check that the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 - $as_echo_n "checking whether the C compiler works... " >&6; } - # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 - # If not cross compiling, check that we can run a simple program. - if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; - esac - eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. - If you meant to cross compile, use \`--host'. - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: cannot run C compiled programs. - If you meant to cross compile, use \`--host'. - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi - fi - { $as_echo "$as_me:$LINENO: result: yes" >&5 - $as_echo "yes" >&6; } - - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out - ac_clean_files=$ac_clean_files_save - # Check that the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 - $as_echo_n "checking whether we are cross compiling... " >&6; } - { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 - $as_echo "$cross_compiling" >&6; } - - { $as_echo "$as_me:$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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - - rm -f conftest$ac_cv_exeext - { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 - $as_echo "$ac_cv_exeext" >&6; } - - rm -f conftest.$ac_ext - EXEEXT=$ac_cv_exeext - ac_exeext=$EXEEXT - { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 - $as_echo_n "checking for suffix of object files... " >&6; } - if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - - rm -f conftest.$ac_cv_objext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 - $as_echo "$ac_cv_objext" >&6; } - OBJEXT=$ac_cv_objext - ac_objext=$OBJEXT - { $as_echo "$as_me:$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 test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - #ifndef __GNUC__ - choke me - #endif - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - 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:$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:$LINENO: checking whether $CC accepts -g" >&5 - $as_echo_n "checking whether $CC accepts -g... " >&6; } - if test "${ac_cv_prog_cc_g+set}" = set; 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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - 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:$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:$LINENO: checking for $CC option to accept ISO C89" >&5 - $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } - if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_cv_prog_cc_c89=no - ac_save_CC=$CC - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - #include - #include - /* 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" - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - 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:$LINENO: result: none needed" >&5 - $as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 - $as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 - $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; - 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 - - 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:$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 test "${ac_cv_prog_CPP+set}" = set; 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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #ifdef __STDC__ - # include - #else - # include - #endif - Syntax error - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. - continue - fi - - rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. - continue - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. - ac_preproc_ok=: - break - fi - - rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. - rm -f 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:$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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #ifdef __STDC__ - # include - #else - # include - #endif - Syntax error - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. - continue - fi - - rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. - continue - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. - ac_preproc_ok=: - break - fi - - rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. - rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then - : - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check - See \`config.log' for more details." >&5 - $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - 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:$LINENO: checking for library containing strerror" >&5 - $as_echo_n "checking for library containing strerror... " >&6; } - if test "${ac_cv_search_strerror+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 strerror (); - int - main () - { - return strerror (); - ; - return 0; - } - _ACEOF - for ac_lib in '' cposix; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_strerror=$ac_res - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then - break - fi - done - if test "${ac_cv_search_strerror+set}" = set; then - : - else - ac_cv_search_strerror=no - fi - rm conftest.$ac_ext - LIBS=$ac_func_search_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 - $as_echo "$ac_cv_search_strerror" >&6; } - ac_res=$ac_cv_search_strerror - if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - fi - - 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_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 - $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } - 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:$LINENO: checking for a BSD-compatible install" >&5 - $as_echo_n "checking for a BSD-compatible install... " >&6; } - if test -z "$INSTALL"; then - if test "${ac_cv_path_install+set}" = set; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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:$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' - - for ac_prog in lex flex - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_LEX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LEX="$ac_prog" - $as_echo "$as_me:$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:$LINENO: result: $LEX" >&5 - $as_echo "$LEX" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - test -n "$LEX" && break - done - test -n "$LEX" || LEX="lex_not_found" - - if test "$LEX" != lex_not_found ; then - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_LEX+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LEX="$ac_prog" - $as_echo "$as_me:$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:$LINENO: result: $LEX" >&5 - $as_echo "$LEX" >&6; } - else - { $as_echo "$as_me:$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 { 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$LEX conftest.l") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { $as_echo "$as_me:$LINENO: checking lex output file root" >&5 - $as_echo_n "checking lex output file root... " >&6; } - if test "${ac_cv_prog_lex_root+set}" = set; 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_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 - $as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } - fi - fi - { $as_echo "$as_me:$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:$LINENO: checking lex library" >&5 - $as_echo_n "checking lex library... " >&6; } - if test "${ac_cv_lib_lex+set}" = set; 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 >conftest.$ac_ext <<_ACEOF - `cat $LEX_OUTPUT_ROOT.c` - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_lex=$ac_lib - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break - done - LIBS=$ac_save_LIBS - - fi - { $as_echo "$as_me:$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:$LINENO: checking whether yytext is a pointer" >&5 - $as_echo_n "checking whether yytext is a pointer... " >&6; } - if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; 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 >conftest.$ac_ext <<_ACEOF - #define YYTEXT_POINTER 1 - `cat $LEX_OUTPUT_ROOT.c` - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_prog_lex_yytext_pointer=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_save_LIBS - - fi - { $as_echo "$as_me:$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 - - cat >>confdefs.h <<\_ACEOF - #define YYTEXT_POINTER 1 - _ACEOF - - fi - rm -f conftest.l $LEX_OUTPUT_ROOT.c - - fi - fi - for ac_prog in remsh rsh - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_RSH+set}" = set; then - $as_echo_n "(cached) " >&6 - else - if test -n "$RSH"; then - ac_cv_prog_RSH="$RSH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RSH="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - IFS=$as_save_IFS - - fi - fi - RSH=$ac_cv_prog_RSH - if test -n "$RSH"; then - { $as_echo "$as_me:$LINENO: result: $RSH" >&5 - $as_echo "$RSH" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - test -n "$RSH" && break - done - test -n "$RSH" || RSH="rsh" - - cat >>confdefs.h <<_ACEOF - #define REMOTE_SHELL "$RSH" - _ACEOF - - # Extract the first word of "nroff", so it can be a program name with args. - set dummy nroff; ac_word=$2 - { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_prog_NROFF+set}" = set; then - $as_echo_n "(cached) " >&6 - else - if test -n "$NROFF"; then - ac_cv_prog_NROFF="$NROFF" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NROFF="nroff -man" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - IFS=$as_save_IFS - - test -z "$ac_cv_prog_NROFF" && ac_cv_prog_NROFF="cat" - fi - fi - NROFF=$ac_cv_prog_NROFF - if test -n "$NROFF"; then - { $as_echo "$as_me:$LINENO: result: $NROFF" >&5 - $as_echo "$NROFF" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - - for ac_prog in awk mawk gawk nawk - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_AWKPATH+set}" = set; then - $as_echo_n "(cached) " >&6 - else - case $AWKPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_AWKPATH="$AWKPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_AWKPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - IFS=$as_save_IFS - - ;; - esac - fi - AWKPATH=$ac_cv_path_AWKPATH - if test -n "$AWKPATH"; then - { $as_echo "$as_me:$LINENO: result: $AWKPATH" >&5 - $as_echo "$AWKPATH" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - test -n "$AWKPATH" && break - done - - for ac_prog in perl - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_PERLPATH+set}" = set; then - $as_echo_n "(cached) " >&6 - else - case $PERLPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERLPATH="$PERLPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERLPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - IFS=$as_save_IFS - - ;; - esac - fi - PERLPATH=$ac_cv_path_PERLPATH - if test -n "$PERLPATH"; then - { $as_echo "$as_me:$LINENO: result: $PERLPATH" >&5 - $as_echo "$PERLPATH" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - test -n "$PERLPATH" && break - done - - - - # Check whether --with-Xaw3d was given. - if test "${with_Xaw3d+set}" = set; then - withval=$with_Xaw3d; cat >>confdefs.h <<\_ACEOF - #define USE_XAW3D 1 - _ACEOF - - XAW_LIBS="-lXaw3d" - else - XAW_LIBS="-lXaw" - fi - - - - - { $as_echo "$as_me:$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 test "${ac_cv_path_GREP+set}" = set; 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" - { test -f "$ac_path_GREP" && $as_test_x "$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 - ac_count=`expr $ac_count + 1` - 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_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 - $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi - else - ac_cv_path_GREP=$GREP - fi - - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 - $as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - - { $as_echo "$as_me:$LINENO: checking for egrep" >&5 - $as_echo_n "checking for egrep... " >&6; } - if test "${ac_cv_path_EGREP+set}" = set; 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" - { test -f "$ac_path_EGREP" && $as_test_x "$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 - ac_count=`expr $ac_count + 1` - 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 - $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi - else - ac_cv_path_EGREP=$EGREP - fi - - fi - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 - $as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 - $as_echo_n "checking for ANSI C header files... " >&6; } - if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - #include - #include - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 - rm -f 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - 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 - - ( exit $ac_status ) - ac_cv_header_stdc=no - fi - rm -rf conftest.dSYM - rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - - - fi - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 - $as_echo "$ac_cv_header_stdc" >&6; } - if test $ac_cv_header_stdc = yes; then - - cat >>confdefs.h <<\_ACEOF - #define STDC_HEADERS 1 - _ACEOF - - fi - - { $as_echo "$as_me:$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 test "${ac_cv_header_time+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - #include - - int - main () - { - if ((struct tm *) 0) - return 0; - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 - $as_echo "$ac_cv_header_time" >&6; } - if test $ac_cv_header_time = yes; then - - cat >>confdefs.h <<\_ACEOF - #define TIME_WITH_SYS_TIME 1 - _ACEOF - - fi - - { $as_echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 - $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } - if test "${ac_cv_header_sys_wait_h+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - #ifndef WEXITSTATUS - # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) - #endif - #ifndef WIFEXITED - # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) - #endif - - int - main () - { - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_sys_wait_h=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_wait_h=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 - $as_echo "$ac_cv_header_sys_wait_h" >&6; } - if test $ac_cv_header_sys_wait_h = yes; then - - cat >>confdefs.h <<\_ACEOF - #define HAVE_SYS_WAIT_H 1 - _ACEOF - - fi - - - - - - - ac_header_dirent=no - for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 - $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include <$ac_hdr> - - int - main () - { - if ((DIR *) 0) - return 0; - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 - _ACEOF - - ac_header_dirent=$ac_hdr; break - fi - - done - # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. - if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 - $as_echo_n "checking for library containing opendir... " >&6; } - if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 opendir (); - int - main () - { - return opendir (); - ; - return 0; - } - _ACEOF - for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break - fi - done - if test "${ac_cv_search_opendir+set}" = set; then - : - else - ac_cv_search_opendir=no - fi - rm conftest.$ac_ext - LIBS=$ac_func_search_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 - $as_echo "$ac_cv_search_opendir" >&6; } - ac_res=$ac_cv_search_opendir - if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - fi - - else - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 - $as_echo_n "checking for library containing opendir... " >&6; } - if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 opendir (); - int - main () - { - return opendir (); - ; - return 0; - } - _ACEOF - for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_opendir=$ac_res - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break - fi - done - if test "${ac_cv_search_opendir+set}" = set; then - : - else - ac_cv_search_opendir=no - fi - rm conftest.$ac_ext - LIBS=$ac_func_search_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 - $as_echo "$ac_cv_search_opendir" >&6; } - ac_res=$ac_cv_search_opendir - if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - fi - - fi - - { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 - $as_echo_n "checking return type of signal handlers... " >&6; } - if test "${ac_cv_type_signal+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - - int - main () - { - return *(signal (0, 0)) (0) == 1; - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_signal=int - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_signal=void - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - { $as_echo "$as_me:$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 - - - # 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` - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - - - - - - - - for ac_header in stropts.h sys/time.h string.h unistd.h sys/systeminfo.h - do - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - else - # Is the header compilable? - { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 - $as_echo_n "checking $ac_header usability... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - $as_echo "$ac_header_compiler" >&6; } - - # Is the header present? - { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 - $as_echo_n "checking $ac_header presence... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - - rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 - $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 - $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 - $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 - $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; - esac - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - eval "$as_ac_Header=\$ac_header_preproc" - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - - fi - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - - - - for ac_header in fcntl.h sys/fcntl.h - do - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - else - # Is the header compilable? - { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 - $as_echo_n "checking $ac_header usability... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - $as_echo "$ac_header_compiler" >&6; } - - # Is the header present? - { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 - $as_echo_n "checking $ac_header presence... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - - rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 - $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 - $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 - $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 - $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; - esac - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - eval "$as_ac_Header=\$ac_header_preproc" - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - - fi - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - break - fi - - done - - - - for ac_header in sys/socket.h lan/socket.h - do - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - else - # Is the header compilable? - { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 - $as_echo_n "checking $ac_header usability... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - $as_echo "$ac_header_compiler" >&6; } - - # Is the header present? - { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 - $as_echo_n "checking $ac_header presence... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - - rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 - $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 - $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 - $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 - $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; - esac - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - eval "$as_ac_Header=\$ac_header_preproc" - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - - fi - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - break - fi - - done - - if test "${ac_cv_header_stddef_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for stddef.h" >&5 - $as_echo_n "checking for stddef.h... " >&6; } - if test "${ac_cv_header_stddef_h+set}" = set; then - $as_echo_n "(cached) " >&6 - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 - $as_echo "$ac_cv_header_stddef_h" >&6; } - else - # Is the header compilable? - { $as_echo "$as_me:$LINENO: checking stddef.h usability" >&5 - $as_echo_n "checking stddef.h usability... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - $as_echo "$ac_header_compiler" >&6; } - - # Is the header present? - { $as_echo "$as_me:$LINENO: checking stddef.h presence" >&5 - $as_echo_n "checking stddef.h presence... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - - rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:$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:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5 - $as_echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5 - $as_echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 - $as_echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5 - $as_echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&5 - $as_echo "$as_me: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 - $as_echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5 - $as_echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;} - - ;; - esac - { $as_echo "$as_me:$LINENO: checking for stddef.h" >&5 - $as_echo_n "checking for stddef.h... " >&6; } - if test "${ac_cv_header_stddef_h+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_cv_header_stddef_h=$ac_header_preproc - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 - $as_echo "$ac_cv_header_stddef_h" >&6; } - - fi - if test "x$ac_cv_header_stddef_h" = x""yes; then - : - else - cat >>confdefs.h <<\_ACEOF - #define X_WCHAR 1 - _ACEOF - - fi - - - - - - - - for ac_func in _getpty grantpt setitimer usleep - do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 - $as_echo_n "checking for $ac_func... " >&6; } - if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ - #define $ac_func innocuous_$ac_func - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef $ac_func - - /* 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 $ac_func (); - /* 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_$ac_func || defined __stub___$ac_func - choke me - #endif - - int - main () - { - return $ac_func (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF - - fi - done - - - - for ac_func in gettimeofday ftime - do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 - $as_echo_n "checking for $ac_func... " >&6; } - if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ - #define $ac_func innocuous_$ac_func - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef $ac_func - - /* 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 $ac_func (); - /* 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_$ac_func || defined __stub___$ac_func - choke me - #endif - - int - main () - { - return $ac_func (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF - break - fi - done - - - - for ac_func in random rand48 - do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 - $as_echo_n "checking for $ac_func... " >&6; } - if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ - #define $ac_func innocuous_$ac_func - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef $ac_func - - /* 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 $ac_func (); - /* 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_$ac_func || defined __stub___$ac_func - choke me - #endif - - int - main () - { - return $ac_func (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF - break - fi - done - - - - for ac_func in gethostname sysinfo - do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 - $as_echo_n "checking for $ac_func... " >&6; } - if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ - #define $ac_func innocuous_$ac_func - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef $ac_func - - /* 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 $ac_func (); - /* 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_$ac_func || defined __stub___$ac_func - choke me - #endif - - int - main () - { - return $ac_func (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF - break - fi - done - - { $as_echo "$as_me:$LINENO: checking for setlocale" >&5 - $as_echo_n "checking for setlocale... " >&6; } - if test "${ac_cv_func_setlocale+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define setlocale to an innocuous variant, in case declares setlocale. - For example, HP-UX 11i declares gettimeofday. */ - #define setlocale innocuous_setlocale - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setlocale (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef setlocale - - /* 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 setlocale (); - /* 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_setlocale || defined __stub___setlocale - choke me - #endif - - int - main () - { - return setlocale (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_setlocale=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_setlocale=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_func_setlocale" >&5 - $as_echo "$ac_cv_func_setlocale" >&6; } - if test "x$ac_cv_func_setlocale" = x""yes; then - : - else - - { $as_echo "$as_me:$LINENO: checking for setlocale in -li" >&5 - $as_echo_n "checking for setlocale in -li... " >&6; } - if test "${ac_cv_lib_i_setlocale+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-li $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 setlocale (); - int - main () - { - return setlocale (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_i_setlocale=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_i_setlocale=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_i_setlocale" >&5 - $as_echo "$ac_cv_lib_i_setlocale" >&6; } - if test "x$ac_cv_lib_i_setlocale" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBI 1 - _ACEOF - - LIBS="-li $LIBS" - - else - cat >>confdefs.h <<\_ACEOF - #define X_LOCALE 1 - _ACEOF - - fi - - fi - - - - { $as_echo "$as_me:$LINENO: checking for getpseudotty in -lseq" >&5 - $as_echo_n "checking for getpseudotty in -lseq... " >&6; } - if test "${ac_cv_lib_seq_getpseudotty+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lseq $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 getpseudotty (); - int - main () - { - return getpseudotty (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_seq_getpseudotty=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_seq_getpseudotty=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getpseudotty" >&5 - $as_echo "$ac_cv_lib_seq_getpseudotty" >&6; } - if test "x$ac_cv_lib_seq_getpseudotty" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBSEQ 1 - _ACEOF - - LIBS="-lseq $LIBS" - - fi - - - { $as_echo "$as_me:$LINENO: checking for X" >&5 - $as_echo_n "checking for X... " >&6; } - - - # Check whether --with-x was given. - if test "${with_x+set}" = set; then - withval=$with_x; - fi - - # $have_x is `yes', `no', `disabled', or empty when we do not yet know. - if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled - else - case $x_includes,$x_libraries in #( - *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5 - $as_echo "$as_me: error: cannot use X directory names containing '" >&2;} - { (exit 1); exit 1; }; };; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then - $as_echo_n "(cached) " >&6 - else - # One or both of the vars are not set, and there is no cached value. - ac_x_includes=no ac_x_libraries=no - rm -f -r conftest.dir - if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' - incroot: - @echo incroot='${INCROOT}' - usrlibdir: - @echo usrlibdir='${USRLIBDIR}' - libdir: - @echo libdir='${LIBDIR}' - _ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir - fi - - # Standard set of common directories for X headers. - # Check X11 before X11Rn because it is often a symlink to the current release. - ac_x_header_dirs=' - /usr/X11/include - /usr/X11R6/include - /usr/X11R5/include - /usr/X11R4/include - - /usr/include/X11 - /usr/include/X11R6 - /usr/include/X11R5 - /usr/include/X11R4 - - /usr/local/X11/include - /usr/local/X11R6/include - /usr/local/X11R5/include - /usr/local/X11R4/include - - /usr/local/include/X11 - /usr/local/include/X11R6 - /usr/local/include/X11R5 - /usr/local/include/X11R4 - - /usr/X386/include - /usr/x386/include - /usr/XFree86/include/X11 - - /usr/include - /usr/local/include - /usr/unsupported/include - /usr/athena/include - /usr/local/x11r5/include - /usr/lpp/Xamples/include - - /usr/openwin/include - /usr/openwin/share/include' - - if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # We can compile using X headers with no special include directory. - ac_x_includes= - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi - done - fi - - rm -f conftest.err conftest.$ac_ext - fi # $ac_x_includes = no - - if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - int - main () - { - XrmInitialize () - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - LIBS=$ac_save_LIBS - # We can link X programs with no special library path. - ac_x_libraries= - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - LIBS=$ac_save_LIBS - for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` - do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done - done - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi # $ac_x_libraries = no - - case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" - esac - fi - ;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" - fi # $with_x != no - - if test "$have_x" != yes; then - { $as_echo "$as_me:$LINENO: result: $have_x" >&5 - $as_echo "$have_x" >&6; } - no_x=yes - else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 - $as_echo "libraries $x_libraries, headers $x_includes" >&6; } - fi - - if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - - cat >>confdefs.h <<\_ACEOF - #define X_DISPLAY_MISSING 1 - _ACEOF - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= - else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 - $as_echo_n "checking whether -R must be followed by a space... " >&6; } - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - ac_xsave_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - X_LIBS="$X_LIBS -R$x_libraries" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - int - main () - { - - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 - $as_echo "yes" >&6; } - X_LIBS="$X_LIBS -R $x_libraries" - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: result: neither works" >&5 - $as_echo "neither works" >&6; } - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - ac_c_werror_flag=$ac_xsave_c_werror_flag - LIBS=$ac_xsave_LIBS - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 XOpenDisplay (); - int - main () - { - return XOpenDisplay (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - : - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 - $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } - if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-ldnet $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 dnet_ntoa (); - int - main () - { - return dnet_ntoa (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dnet_dnet_ntoa=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dnet_dnet_ntoa=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 - $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } - if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" - fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 - $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } - if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-ldnet_stub $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 dnet_ntoa (); - int - main () - { - return dnet_ntoa (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dnet_stub_dnet_ntoa=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 - $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } - if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" - fi - - fi - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to T.E. Dickey. - # The functions gethostbyname, getservbyname, and inet_addr are - # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 - $as_echo_n "checking for gethostbyname... " >&6; } - if test "${ac_cv_func_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ - #define gethostbyname innocuous_gethostbyname - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef gethostbyname - - /* 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 gethostbyname (); - /* 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_gethostbyname || defined __stub___gethostbyname - choke me - #endif - - int - main () - { - return gethostbyname (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_gethostbyname=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_gethostbyname=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 - $as_echo "$ac_cv_func_gethostbyname" >&6; } - - if test $ac_cv_func_gethostbyname = no; then - { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 - $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } - if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lnsl $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 gethostbyname (); - int - main () - { - return gethostbyname (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_nsl_gethostbyname=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_nsl_gethostbyname=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 - $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } - if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" - fi - - if test $ac_cv_lib_nsl_gethostbyname = no; then - { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 - $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } - if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lbsd $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 gethostbyname (); - int - main () - { - return gethostbyname (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_bsd_gethostbyname=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_bsd_gethostbyname=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 - $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } - if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" - fi - - fi - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # variants that don't use the name server (or something). -lsocket - # must be given before -lnsl if both are needed. We assume that - # if connect needs -lnsl, so does gethostbyname. - { $as_echo "$as_me:$LINENO: checking for connect" >&5 - $as_echo_n "checking for connect... " >&6; } - if test "${ac_cv_func_connect+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ - #define connect innocuous_connect - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef connect - - /* 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 connect (); - /* 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_connect || defined __stub___connect - choke me - #endif - - int - main () - { - return connect (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_connect=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_connect=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 - $as_echo "$ac_cv_func_connect" >&6; } - - if test $ac_cv_func_connect = no; then - { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 - $as_echo_n "checking for connect in -lsocket... " >&6; } - if test "${ac_cv_lib_socket_connect+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lsocket $X_EXTRA_LIBS $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 connect (); - int - main () - { - return connect (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_socket_connect=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_socket_connect=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 - $as_echo "$ac_cv_lib_socket_connect" >&6; } - if test "x$ac_cv_lib_socket_connect" = x""yes; then - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" - fi - - fi - - # Guillermo Gomez says -lposix is necessary on A/UX. - { $as_echo "$as_me:$LINENO: checking for remove" >&5 - $as_echo_n "checking for remove... " >&6; } - if test "${ac_cv_func_remove+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define remove to an innocuous variant, in case declares remove. - For example, HP-UX 11i declares gettimeofday. */ - #define remove innocuous_remove - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef remove - - /* 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 remove (); - /* 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_remove || defined __stub___remove - choke me - #endif - - int - main () - { - return remove (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_remove=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_remove=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 - $as_echo "$ac_cv_func_remove" >&6; } - - if test $ac_cv_func_remove = no; then - { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5 - $as_echo_n "checking for remove in -lposix... " >&6; } - if test "${ac_cv_lib_posix_remove+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lposix $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 remove (); - int - main () - { - return remove (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_posix_remove=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_posix_remove=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 - $as_echo "$ac_cv_lib_posix_remove" >&6; } - if test "x$ac_cv_lib_posix_remove" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" - fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - { $as_echo "$as_me:$LINENO: checking for shmat" >&5 - $as_echo_n "checking for shmat... " >&6; } - if test "${ac_cv_func_shmat+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - /* Define shmat to an innocuous variant, in case declares shmat. - For example, HP-UX 11i declares gettimeofday. */ - #define shmat innocuous_shmat - - /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - - #ifdef __STDC__ - # include - #else - # include - #endif - - #undef shmat - - /* 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 shmat (); - /* 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_shmat || defined __stub___shmat - choke me - #endif - - int - main () - { - return shmat (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_func_shmat=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shmat=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 - $as_echo "$ac_cv_func_shmat" >&6; } - - if test $ac_cv_func_shmat = no; then - { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 - $as_echo_n "checking for shmat in -lipc... " >&6; } - if test "${ac_cv_lib_ipc_shmat+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lipc $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 shmat (); - int - main () - { - return shmat (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_ipc_shmat=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ipc_shmat=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 - $as_echo "$ac_cv_lib_ipc_shmat" >&6; } - if test "x$ac_cv_lib_ipc_shmat" = x""yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" - fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # John Interrante, Karl Berry - { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 - $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } - if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lICE $X_EXTRA_LIBS $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 IceConnectionNumber (); - int - main () - { - return IceConnectionNumber (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_ICE_IceConnectionNumber=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ICE_IceConnectionNumber=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 - $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } - if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" - fi - - LDFLAGS=$ac_save_LDFLAGS - - fi - - if test -n "$no_x" ; then - echo $PRODUCT requires the X Window System header files and libraries! - echo They were not found on your system. See FAQ topic C.2. - echo configure failed - exit 1 - fi - - # Make sure we can run config.sub. - $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 - $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - - { $as_echo "$as_me:$LINENO: checking build system type" >&5 - $as_echo_n "checking build system type... " >&6; } - if test "${ac_cv_build+set}" = set; 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_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 - $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } - ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 - $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 - $as_echo "$ac_cv_build" >&6; } - case $ac_cv_build in - *-*-*) ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 - $as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; - 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:$LINENO: checking host system type" >&5 - $as_echo_n "checking host system type... " >&6; } - if test "${ac_cv_host+set}" = set; 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_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 - $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } - fi - - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 - $as_echo "$ac_cv_host" >&6; } - case $ac_cv_host in - *-*-*) ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 - $as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; - 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 - - - - { $as_echo "$as_me:$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 { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; 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:$LINENO: result: yes" >&5 - $as_echo "yes" >&6; } - SET_MAKE= - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" - fi - - - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - case "$ac_aux_dir" in - /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; - *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; - esac - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - - - - { $as_echo "$as_me:$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:$LINENO: result: $USE_NLS" >&5 - $as_echo "$USE_NLS" >&6; } - - - - - - - # Prepare PATH_SEPARATOR. - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_MSGFMT+set}" = set; 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 - if $ac_dir/$ac_word --statistics /dev/null >/dev/null 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:$LINENO: result: $MSGFMT" >&5 - $as_echo "$MSGFMT" >&6; } - else - { $as_echo "$as_me:$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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_GMSGFMT+set}" = set; 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$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:$LINENO: result: $GMSGFMT" >&5 - $as_echo "$GMSGFMT" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - - - # Prepare PATH_SEPARATOR. - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_XGETTEXT+set}" = set; 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 - if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 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:$LINENO: result: $XGETTEXT" >&5 - $as_echo "$XGETTEXT" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - rm -f messages.po - - - # Prepare PATH_SEPARATOR. - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh - 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:$LINENO: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if test "${ac_cv_path_MSGMERGE+set}" = set; 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 - if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 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:$LINENO: result: $MSGMERGE" >&5 - $as_echo "$MSGMERGE" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - - - if test "$GMSGFMT" != ":"; then - if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && - (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - { $as_echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 - $as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } - GMSGFMT=":" - fi - fi - - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --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 - : ; - else - { $as_echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 - $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } - XGETTEXT=":" - fi - rm -f messages.po - fi - - ac_config_commands="$ac_config_commands default-1" - - - - 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 - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh - fi - ac_prog=ld - if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 - $as_echo_n "checking for ld used by GCC... " >&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. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path 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:$LINENO: checking for GNU ld" >&5 - $as_echo_n "checking for GNU ld... " >&6; } - else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 - $as_echo_n "checking for non-GNU ld... " >&6; } - fi - if test "${acl_cv_path_LD+set}" = set; then - $as_echo_n "(cached) " >&6 - else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - 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 GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" - else - acl_cv_path_LD="$LD" # Let the user override the test with a path. - fi - fi - - LD="$acl_cv_path_LD" - if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 - $as_echo "$LD" >&6; } - else - { $as_echo "$as_me:$LINENO: result: no" >&5 - $as_echo "no" >&6; } - fi - test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 - $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } - { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 - $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } - if test "${acl_cv_prog_gnu_ld+set}" = set; then - $as_echo_n "(cached) " >&6 - else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. - if $LD -v 2>&1 &5; then - acl_cv_prog_gnu_ld=yes - else - acl_cv_prog_gnu_ld=no - fi - fi - { $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 - $as_echo "$acl_cv_prog_gnu_ld" >&6; } - with_gnu_ld=$acl_cv_prog_gnu_ld - - - - { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 - $as_echo_n "checking for shared library run path origin... " >&6; } - if test "${acl_cv_rpath+set}" = set; 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:$LINENO: result: $acl_cv_rpath" >&5 - $as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - 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 - - - - - - - - - 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/lib" - fi - fi - - fi - - LIBICONV= - LTLIBICONV= - INCICONV= - 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= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - 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 "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - 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/lib"; 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 "$hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$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 "$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 - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - 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*) 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/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) 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 "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$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=\"$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:$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:$LINENO: result: $USE_NLS" >&5 - $as_echo "$USE_NLS" >&6; } - - - - - LIBINTL= - LTLIBINTL= - POSUB= - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - - - - - - { $as_echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 - $as_echo_n "checking for GNU gettext in libc... " >&6; } - if test "${gt_cv_func_gnugettext1_libc+set}" = set; then - $as_echo_n "(cached) " >&6 - else - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern int *_nl_domain_bindings; - int - main () - { - bindtextdomain ("", ""); - return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gt_cv_func_gnugettext1_libc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_func_gnugettext1_libc=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - { $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 - $as_echo "$gt_cv_func_gnugettext1_libc" >&6; } - - if test "$gt_cv_func_gnugettext1_libc" != "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:$LINENO: checking for iconv" >&5 - $as_echo_n "checking for iconv... " >&6; } - if test "${am_cv_func_iconv+set}" = set; then - $as_echo_n "(cached) " >&6 - else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - int - main () - { - iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - am_cv_func_iconv=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - int - main () - { - iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - am_cv_lib_iconv=yes - am_cv_func_iconv=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - - fi - { $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 - $as_echo "$am_cv_func_iconv" >&6; } - if test "$am_cv_func_iconv" = yes; then - - cat >>confdefs.h <<\_ACEOF - #define HAVE_ICONV 1 - _ACEOF - - fi - if test "$am_cv_lib_iconv" = yes; then - { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 - $as_echo_n "checking how to link with libiconv... " >&6; } - { $as_echo "$as_me:$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/lib" - fi - fi - - fi - - LIBINTL= - LTLIBINTL= - INCINTL= - 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= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - 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 "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - 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/lib"; 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 "$hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$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 "$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 - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - 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*) 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/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) 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 "$hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$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=\"$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:$LINENO: checking for GNU gettext in libintl" >&5 - $as_echo_n "checking for GNU gettext in libintl... " >&6; } - if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then - $as_echo_n "(cached) " >&6 - else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern - #ifdef __cplusplus - "C" - #endif - const char *_nl_expand_alias (); - int - main () - { - bindtextdomain ("", ""); - return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - gt_cv_func_gnugettext1_libintl=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - gt_cv_func_gnugettext1_libintl=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - extern int _nl_msg_cat_cntr; - extern - #ifdef __cplusplus - "C" - #endif - const char *_nl_expand_alias (); - int - main () - { - bindtextdomain ("", ""); - return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0) - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - gt_cv_func_gnugettext1_libintl=yes - - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" - fi - { $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 - $as_echo "$gt_cv_func_gnugettext1_libintl" >&6; } - fi - - if test "$gt_cv_func_gnugettext1_libc" = "yes" \ - || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - - cat >>confdefs.h <<\_ACEOF - #define ENABLE_NLS 1 - _ACEOF - - else - USE_NLS=no - fi - fi - - { $as_echo "$as_me:$LINENO: checking whether to use NLS" >&5 - $as_echo_n "checking whether to use NLS... " >&6; } - { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 - $as_echo "$USE_NLS" >&6; } - if test "$USE_NLS" = "yes"; then - { $as_echo "$as_me:$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 test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - gt_source="external libintl" - else - gt_source="libc" - fi - else - gt_source="included intl directory" - fi - { $as_echo "$as_me:$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 test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - { $as_echo "$as_me:$LINENO: checking how to link with libintl" >&5 - $as_echo_n "checking how to link with libintl... " >&6; } - { $as_echo "$as_me:$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 - - - cat >>confdefs.h <<\_ACEOF - #define HAVE_GETTEXT 1 - _ACEOF - - - cat >>confdefs.h <<\_ACEOF - #define HAVE_DCGETTEXT 1 - _ACEOF - - fi - - POSUB=po - fi - - - - INTLLIBS="$LIBINTL" - - - - - - - - - - USE_PTYS=0 - case "$host" in - *-*-hpux* ) - cat >>confdefs.h <<\_ACEOF - #define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty/tty%c%x", c, i); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptym/pty%c%x", c, i); - _ACEOF - - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - else - - - CONF_CFLAGS="-Aa -D_HPUX_SOURCE" - fi - - - if test -d /opt/hppd/include/X11; then - X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" - X_LIBS="$X_LIBS -L/opt/hppd/lib" - elif test -d /usr/contrib/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" - elif test -d /usr/contrib/mitX11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" - elif test -d /MIT/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" - X_LIBS="$X_LIBS -L/MIT/X11R5/lib" - elif test -d /usr/local/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" - X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" - fi - if test -d /usr/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" - X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" - elif test -d /usr/include/X11R4; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" - X_LIBS="$X_LIBS -L/usr/lib/X11R4" - fi - ;; - - romp-ibm-aix* ) - cat >>confdefs.h <<\_ACEOF - #define IBMRTAIX 1 - _ACEOF - - ;; - - i386-ibm-aix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - - *-*-aix3* | *-*-bosx* ) - cat >>confdefs.h <<\_ACEOF - #define PTY_ITERATION for (c = 0; !c; c++) - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); - _ACEOF - - ;; - - *-*-cxux* ) - cat >>confdefs.h <<\_ACEOF - #define FIRST_PTY_LETTER 'A' - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define LAST_PTY_LETTER 'P' - _ACEOF - - ;; - - *-*-uniplus* ) - cat >>confdefs.h <<\_ACEOF - #define UNIPLUS 1 - _ACEOF - - ;; - - *-*-rtu* ) - cat >>confdefs.h <<\_ACEOF - #define FIRST_PTY_LETTER 'z' - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%x", i); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty%x", i); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define RTU 1 - _ACEOF - - ;; - - *-*-iris* | *-*-irix3* ) - cat >>confdefs.h <<\_ACEOF - #define PTY_ITERATION for (c = 0; !c; c++) - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev)); - _ACEOF - - ;; - - *-*-irix* ) - ;; - - *-*-sunos4* | *-*-solaris1* ) - - - if test "$GCC" = yes; then - PRE_XMULIB="-static" - POST_XMULIB="-dynamic" - else - PRE_XMULIB="-Bstatic" - POST_XMULIB="-Bdynamic" - fi - ;; - - *-*-sunos5* | *-*-solaris2* ) - - - X_LIBS="$X_LIBS -lelf" - ;; - - *-*-sco* ) - cat >>confdefs.h <<\_ACEOF - #define PTY_ITERATION for (i = 0; ; i++) - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptyp%d", i); - _ACEOF - - cat >>confdefs.h <<\_ACEOF - #define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%d", i); - _ACEOF - - ;; - - *-*-dynix* | *-*-ptx* ) - ;; - - *-*-esix* ) - ;; - - *-*-usg5-4* | *-*-sysvr4* ) - ;; - - *-*-usg* | *-*-sysv* | *-*-aix* ) - ;; - - vax-*-ultrix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - esac - - # Check whether --enable-xpm was given. - if test "${enable_xpm+set}" = set; then - enableval=$enable_xpm; enable_xpm="$enableval" - else - enable_xpm="yes" - fi - - - if test "$enable_xpm" = "yes"; then - save_cflags="$CFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - - for ac_header in X11/xpm.h - do - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - else - # Is the header compilable? - { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 - $as_echo_n "checking $ac_header usability... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - $as_echo "$ac_header_compiler" >&6; } - - # Is the header present? - { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 - $as_echo_n "checking $ac_header presence... " >&6; } - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include <$ac_header> - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - - rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:$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:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 - $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 - $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 - $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 - $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; - esac - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 - $as_echo_n "checking for $ac_header... " >&6; } - if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 - else - eval "$as_ac_Header=\$ac_header_preproc" - fi - ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } - - fi - as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - - CFLAGS="$save_cflags" - if test "$ac_cv_header_X11_xpm_h" = "yes"; then - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS" - { $as_echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 - $as_echo_n "checking for XpmReadFileToPixmap in -lXpm... " >&6; } - if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lXpm $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* 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 XpmReadFileToPixmap (); - int - main () - { - return XpmReadFileToPixmap (); - ; - return 0; - } - _ACEOF - 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:$LINENO: $ac_try_echo\"" - $as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_lib_Xpm_XpmReadFileToPixmap=yes - else - $as_echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xpm_XpmReadFileToPixmap=no - fi - - rm -rf conftest.dSYM - rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 - $as_echo "$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } - if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = x""yes; then - X_PRE_LIBS="-lXpm $X_PRE_LIBS"; cat >>confdefs.h <<\_ACEOF - #define HAVE_LIBXPM 1 - _ACEOF - - fi - - LDFLAGS="$save_ldflags" - fi - fi - - - - - - - { $as_echo "$as_me:$LINENO: checking whether ptys or pipes should be used" >&5 - $as_echo_n "checking whether ptys or pipes should be used... " >&6; } - # Check whether --enable-ptys was given. - if test "${enable_ptys+set}" = set; then - enableval=$enable_ptys; if test "$enableval" = yes; then - USE_PTYS=1 - { $as_echo "$as_me:$LINENO: result: ptys (user override)" >&5 - $as_echo "ptys (user override)" >&6; } - fi - if test "$enableval" = no; then - USE_PTYS=0 - { $as_echo "$as_me:$LINENO: result: pipes (user override)" >&5 - $as_echo "pipes (user override)" >&6; } - fi - else - if test "$USE_PTYS" = 1; then - { $as_echo "$as_me:$LINENO: result: ptys" >&5 - $as_echo "ptys" >&6; } - else - { $as_echo "$as_me:$LINENO: result: pipes" >&5 - $as_echo "pipes" >&6; } - fi - fi - - cat >>confdefs.h <<_ACEOF - #define USE_PTYS $USE_PTYS - _ACEOF - - - # Check whether --enable-zippy was given. - if test "${enable_zippy+set}" = set; then - enableval=$enable_zippy; enable_zippy="$enableval" - else - enable_zippy="yes" - fi - - if test "$enable_zippy" = yes; then - cat >>confdefs.h <<\_ACEOF - #define ZIPPY 1 - _ACEOF - - ZIPPY_O=zippy.o - ZIPPY_H=zippy.h - fi - - - - # Check whether --enable-sigint was given. - if test "${enable_sigint+set}" = set; then - enableval=$enable_sigint; if test "$enableval" = yes; then - cat >>confdefs.h <<\_ACEOF - #define ATTENTION 1 - _ACEOF - - fi - else - cat >>confdefs.h <<\_ACEOF - #define ATTENTION 1 - _ACEOF - - fi - - - cat >>confdefs.h <<_ACEOF - #define PRODUCT "$PRODUCT" - _ACEOF - - cat >>confdefs.h <<_ACEOF - #define VERSION "$VERSION" - _ACEOF - - cat >>confdefs.h <<_ACEOF - #define PATCHLEVEL "$PATCHLEVEL" - _ACEOF - - - - - - ac_config_files="$ac_config_files Makefile cmail xboard.texinfo po/Makefile.in" - - ac_config_commands="$ac_config_commands default" - - 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:$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= ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 - $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:$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= - 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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' - done - LIBOBJS=$ac_libobjs - - LTLIBOBJS=$ac_ltlibobjs - - - - : ${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:$LINENO: creating $CONFIG_STATUS" >&5 - $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} - cat >$CONFIG_STATUS <<_ACEOF || ac_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} - _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF || ac_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 - - - - - # PATH needs CR - # 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_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 - if (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 - - # Support unset when possible. - if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - 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. - 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); exit 1; } - fi - - # Work around bugs in pre-3.0 UWIN ksh. - for as_var in ENV MAIL MAILPATH - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - PS1='$ ' - PS2='> ' - PS4='+ ' - - # NLS nuisances. - LC_ALL=C - export LC_ALL - LANGUAGE=C - export LANGUAGE - - # Required to use basename. - 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 - - - # Name of the executable. - 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'` - - # CDPATH. - $as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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 - { (exit 1); exit 1; }; } - - # 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 - } - - - if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname - else - as_dirname=false - fi - - ECHO_C= ECHO_N= ECHO_T= - case `echo -n x` in - -n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; - *) - ECHO_N='-n';; - esac - if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr - else - as_expr=false - fi - - 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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi - else - as_ln_s='cp -p' - 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=: - else - test -d ./-p && rmdir ./-p - as_mkdir_p=false - fi - - if test -x / >/dev/null 2>&1; then - as_test_x='test -x' - else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' - fi - as_executable_p=$as_test_x - - # 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 - - # 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 $as_me, which was - generated by GNU Autoconf 2.63. 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 from templates according to the - current configuration. - - Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, 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 ." - - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_version="\\ - config.status - configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - - Copyright (C) 2008 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' - 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=$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 ;; - --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"` ;; - esac - CONFIG_FILES="$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 - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 - Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --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_echo "$as_me: error: unrecognized option: $1 - Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 - # - # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it - # from automake. - 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 - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "cmail") CONFIG_FILES="$CONFIG_FILES cmail" ;; - "xboard.texinfo") CONFIG_FILES="$CONFIG_FILES xboard.texinfo" ;; - "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 - $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status - ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 - } - # Create a (secure) tmp directory for tmp files. - - { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" - } || - { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") - } || - { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } - } - - # 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=' ' - 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 {' >"$tmp/subs1.awk" && - _ACEOF - - - { - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" - } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 - $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 - $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - 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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 - $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - 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 >>"\$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 >>"\$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 < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 - $as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } - _ACEOF - - # VPATH may cause trouble with some makes, so we remove $(srcdir), - # ${srcdir} and @srcdir@ 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[ ]*=/{ - s/:*\$(srcdir):*/:/ - s/:*\${srcdir}:*/:/ - s/:*@srcdir@:*/:/ - s/^\([^=]*=[ ]*\):*/\1/ - s/:*$// - 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 >"$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_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 - $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - 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_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 - $as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } - 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_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 - $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[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="$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_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 - $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$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:$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 >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 - $as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - 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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - 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_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 - $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - 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 - _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:$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 - $ac_datarootdir_hack - " - eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 - $as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - - test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$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 "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 - $as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 - $as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 - $as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 - $as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 - $as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } - fi - ;; - - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 - $as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "default-1":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 - 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" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES 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" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - GMOFILES= - UPDATEPOFILES= - DUMMYPOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - 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|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|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 ;; - "default":C) test -z "$CONFIG_HEADERS" || date > stamp-h - chmod 755 cmail - ;; - - esac - done # for ac_tag - - - { (exit 0); exit 0; } - _ACEOF - chmod +x $CONFIG_STATUS - ac_clean_files=$ac_clean_files_save - - test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 - $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - - # 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 || { (exit 1); exit 1; } - fi - if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 - $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} - fi - -# Generated by GNU Autoconf 2.61 for xboard 4.3. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 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=: - # Zsh 3.x and 4.x performs 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs 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 - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs 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_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, 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= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='xboard' -PACKAGE_TARNAME='xboard' -PACKAGE_VERSION='4.3' -PACKAGE_STRING='xboard 4.3' -PACKAGE_BUGREPORT='' - -# 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" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -LIBOBJS -LTLIBOBJS -CPP -LEX -LEX_OUTPUT_ROOT -LEXLIB -RSH -MINFO -NROFF -NROFFFLAGS -AWKPATH -PERLPATH -GREP -EGREP -XMKMF -X_CFLAGS -X_PRE_LIBS -X_LIBS -X_EXTRA_LIBS -XAW_LIBS -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -PRE_XMULIB -POST_XMULIB -CONF_CFLAGS -CONF_LDFLAGS -ZIPPY_O -ZIPPY_H -PRODUCT -PATCHLEVEL' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -XMKMF' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=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 ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - 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'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -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 - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -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 - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - 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 .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - 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 .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - 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 xboard 4.3 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/xboard] - --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 - -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - -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 xboard 4.3:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-xpm libXpm will be used if found (default) - --disable-xpm libXpm will not be used - --enable-ptys force use of pseudo-ttys with child processes - --disable-ptys force use of pipes with child processes - --enable-zippy support interfacing a chess program to ICS (default) - --disable-zippy do not support interfacing a chess program to ICS - --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) - --disable-sigint typing a command wakes up GNU Chess - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-x use the X Window System - --with-Xaw3d use Xaw3d instead of Xaw - -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 C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_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" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 - 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 -xboard configure 4.3 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 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 -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 xboard $as_me 4.3, which was -generated by GNU Autoconf 2.61. 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=. - 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - 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'; { (exit 1); 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 - -# 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 - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - 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. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# 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,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -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 - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -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 - - -am__api_version='1.10' - -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 - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -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 -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$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' - -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# 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 ( - 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 - rm -f conftest.file - 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". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -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 $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } -if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - - 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. - test -d ./--version && rmdir ./--version - MKDIR_P="$ac_install_sh -d" - fi -fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 - -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 - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } - 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='xboard' - VERSION='4.3' - - -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"} - -install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} - -# 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out 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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.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 - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_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='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -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= -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=`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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## 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=: - # Zsh 3.x and 4.x performs 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 - -# 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 xboard $as_me 4.3, which was -generated by GNU Autoconf 2.61. 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 - -cat >>$CONFIG_STATUS <<_ACEOF -# 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_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet 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 ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xboard config.status 4.3 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 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' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$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 ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - 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. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[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="$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 || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - 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 || -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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 -# 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= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - 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 - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;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 -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -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 "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then 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. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" -# 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 || -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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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 || -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"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 || -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 - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - -PRODUCT=xboard -#VERSION=4.3 # version is already defined -PATCHLEVEL=16 - - -if test -z "$CFLAGS" ; then - CFLAGS=" " -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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=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 -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f 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 -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 strerror (); -int -main () -{ -return strerror (); - ; - return 0; -} -_ACEOF -for ac_lib in '' cposix; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_strerror=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then - break -fi -done -if test "${ac_cv_search_strerror+set}" = set; then - : -else - ac_cv_search_strerror=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6; } -ac_res=$ac_cv_search_strerror -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -# 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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -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 -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$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' - -for ac_prog in lex flex -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LEX="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$LEX" && break -done -test -n "$LEX" || LEX="lex_not_found" - -if test "$LEX" != lex_not_found ; then - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LEX="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 { 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$LEX conftest.l") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } -if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} - { (exit 1); exit 1; }; } -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -if test -z "${LEXLIB+set}"; then - { echo "$as_me:$LINENO: checking lex library" >&5 -echo $ECHO_N "checking lex library... $ECHO_C" >&6; } -if test "${ac_cv_lib_lex+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lex=$ac_lib -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - test "$ac_cv_lib_lex" != 'none needed' && break - done - LIBS=$ac_save_LIBS - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 -echo "${ECHO_T}$ac_cv_lib_lex" >&6; } - test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex -fi - - -{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -#define YYTEXT_POINTER 1 -`cat $LEX_OUTPUT_ROOT.c` -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_prog_lex_yytext_pointer=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_save_LIBS - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } -if test $ac_cv_prog_lex_yytext_pointer = yes; then - -cat >>confdefs.h <<\_ACEOF -#define YYTEXT_POINTER 1 -_ACEOF - -fi -rm -f conftest.l $LEX_OUTPUT_ROOT.c - -fi -fi -for ac_prog in remsh rsh -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RSH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RSH"; then - ac_cv_prog_RSH="$RSH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RSH="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RSH=$ac_cv_prog_RSH -if test -n "$RSH"; then - { echo "$as_me:$LINENO: result: $RSH" >&5 -echo "${ECHO_T}$RSH" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$RSH" && break -done -test -n "$RSH" || RSH="rsh" - -for ac_prog in makeinfo -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_MINFO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$MINFO"; then - ac_cv_prog_MINFO="$MINFO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MINFO="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -MINFO=$ac_cv_prog_MINFO -if test -n "$MINFO"; then - { echo "$as_me:$LINENO: result: $MINFO" >&5 -echo "${ECHO_T}$MINFO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$MINFO" && break -done -test -n "$MINFO" || MINFO="makeinfo_not_found" - -if test "$MINFO" == makeinfo_not_found ; then - echo Please install \"makeinfo\" - exit 1 -fi -cat >>confdefs.h <<_ACEOF -#define REMOTE_SHELL "$RSH" -_ACEOF - -# Extract the first word of "nroff", so it can be a program name with args. -set dummy nroff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NROFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NROFF"; then - ac_cv_prog_NROFF="$NROFF" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NROFF="nroff -man" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_NROFF" && ac_cv_prog_NROFF="cat" -fi -fi -NROFF=$ac_cv_prog_NROFF -if test -n "$NROFF"; then - { echo "$as_me:$LINENO: result: $NROFF" >&5 -echo "${ECHO_T}$NROFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -for ac_prog in awk mawk gawk nawk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_AWKPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $AWKPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_AWKPATH="$AWKPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_AWKPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -AWKPATH=$ac_cv_path_AWKPATH -if test -n "$AWKPATH"; then - { echo "$as_me:$LINENO: result: $AWKPATH" >&5 -echo "${ECHO_T}$AWKPATH" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWKPATH" && break -done - -for ac_prog in perl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PERLPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PERLPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERLPATH="$PERLPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERLPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -PERLPATH=$ac_cv_path_PERLPATH -if test -n "$PERLPATH"; then - { echo "$as_me:$LINENO: result: $PERLPATH" >&5 -echo "${ECHO_T}$PERLPATH" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$PERLPATH" && break -done - - - - - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_GREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_EGREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_sys_wait_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_wait_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_WAIT_H 1 -_ACEOF - -fi - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } -if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_signal=int -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_signal=void -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -# 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - -for ac_header in stropts.h sys/time.h string.h unistd.h sys/systeminfo.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in fcntl.h sys/fcntl.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - break -fi - -done - - - -for ac_header in sys/socket.h lan/socket.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - break -fi - -done - -if test "${ac_cv_header_stddef_h+set}" = set; then - { echo "$as_me:$LINENO: checking for stddef.h" >&5 -echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } -if test "${ac_cv_header_stddef_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 -echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking stddef.h usability" >&5 -echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking stddef.h presence" >&5 -echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for stddef.h" >&5 -echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } -if test "${ac_cv_header_stddef_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_stddef_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 -echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } - -fi -if test $ac_cv_header_stddef_h = yes; then - : -else - cat >>confdefs.h <<\_ACEOF -#define X_WCHAR 1 -_ACEOF - -fi - - - - - - - -for ac_func in _getpty grantpt setitimer usleep -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -for ac_func in gettimeofday ftime -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in random rand48 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in gethostname sysinfo -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - -{ echo "$as_me:$LINENO: checking for setlocale" >&5 -echo $ECHO_N "checking for setlocale... $ECHO_C" >&6; } -if test "${ac_cv_func_setlocale+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define setlocale to an innocuous variant, in case declares setlocale. - For example, HP-UX 11i declares gettimeofday. */ -#define setlocale innocuous_setlocale - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char setlocale (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef setlocale - -/* 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 setlocale (); -/* 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_setlocale || defined __stub___setlocale -choke me -#endif - -int -main () -{ -return setlocale (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_setlocale=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_setlocale=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_setlocale" >&5 -echo "${ECHO_T}$ac_cv_func_setlocale" >&6; } -if test $ac_cv_func_setlocale = yes; then - : -else - -{ echo "$as_me:$LINENO: checking for setlocale in -li" >&5 -echo $ECHO_N "checking for setlocale in -li... $ECHO_C" >&6; } -if test "${ac_cv_lib_i_setlocale+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-li $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 setlocale (); -int -main () -{ -return setlocale (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_i_setlocale=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_i_setlocale=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_i_setlocale" >&5 -echo "${ECHO_T}$ac_cv_lib_i_setlocale" >&6; } -if test $ac_cv_lib_i_setlocale = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBI 1 -_ACEOF - - LIBS="-li $LIBS" - -else - cat >>confdefs.h <<\_ACEOF -#define X_LOCALE 1 -_ACEOF - -fi - -fi - - - -{ echo "$as_me:$LINENO: checking for getpseudotty in -lseq" >&5 -echo $ECHO_N "checking for getpseudotty in -lseq... $ECHO_C" >&6; } -if test "${ac_cv_lib_seq_getpseudotty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lseq $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 getpseudotty (); -int -main () -{ -return getpseudotty (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_seq_getpseudotty=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_seq_getpseudotty=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getpseudotty" >&5 -echo "${ECHO_T}$ac_cv_lib_seq_getpseudotty" >&6; } -if test $ac_cv_lib_seq_getpseudotty = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSEQ 1 -_ACEOF - - LIBS="-lseq $LIBS" - -fi - - -{ echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6; } - - -# Check whether --with-x was given. -if test "${with_x+set}" = set; then - withval=$with_x; -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 -echo "$as_me: error: Cannot use X directory names containing '" >&2;} - { (exit 1); exit 1; }; };; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir -fi - -# Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # We can compile using X headers with no special include directory. -ac_x_includes= -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi -done -fi - -rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac -fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - { echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - -cat >>confdefs.h <<\_ACEOF -#define X_DISPLAY_MISSING 1 -_ACEOF - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 -echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - ac_xsave_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - X_LIBS="$X_LIBS -R$x_libraries" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - X_LIBS="$X_LIBS -R $x_libraries" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6; } -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - ac_c_werror_flag=$ac_xsave_c_werror_flag - LIBS=$ac_xsave_LIBS - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 XOpenDisplay (); -int -main () -{ -return XOpenDisplay (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 dnet_ntoa (); -int -main () -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_dnet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dnet_dnet_ntoa=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test $ac_cv_lib_dnet_dnet_ntoa = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -fi - - if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 dnet_ntoa (); -int -main () -{ -return dnet_ntoa (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dnet_stub_dnet_ntoa=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -fi - - fi -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to T.E. Dickey. - # The functions gethostbyname, getservbyname, and inet_addr are - # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - { echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* 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 gethostbyname (); -/* 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_gethostbyname || defined __stub___gethostbyname -choke me -#endif - -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_gethostbyname=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } - - if test $ac_cv_func_gethostbyname = no; then - { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_nsl_gethostbyname=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } -if test $ac_cv_lib_nsl_gethostbyname = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -fi - - if test $ac_cv_lib_nsl_gethostbyname = no; then - { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 -echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 gethostbyname (); -int -main () -{ -return gethostbyname (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_bsd_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_bsd_gethostbyname=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } -if test $ac_cv_lib_bsd_gethostbyname = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" -fi - - fi - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # variants that don't use the name server (or something). -lsocket - # must be given before -lnsl if both are needed. We assume that - # if connect needs -lnsl, so does gethostbyname. - { echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6; } -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* 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 connect (); -/* 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_connect || defined __stub___connect -choke me -#endif - -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_connect=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6; } - - if test $ac_cv_func_connect = no; then - { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 -echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } -if test "${ac_cv_lib_socket_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 connect (); -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_socket_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_socket_connect=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } -if test $ac_cv_lib_socket_connect = yes; then - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -fi - - fi - - # Guillermo Gomez says -lposix is necessary on A/UX. - { echo "$as_me:$LINENO: checking for remove" >&5 -echo $ECHO_N "checking for remove... $ECHO_C" >&6; } -if test "${ac_cv_func_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define remove to an innocuous variant, in case declares remove. - For example, HP-UX 11i declares gettimeofday. */ -#define remove innocuous_remove - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef remove - -/* 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 remove (); -/* 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_remove || defined __stub___remove -choke me -#endif - -int -main () -{ -return remove (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_remove=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_remove=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 -echo "${ECHO_T}$ac_cv_func_remove" >&6; } - - if test $ac_cv_func_remove = no; then - { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 -echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } -if test "${ac_cv_lib_posix_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 remove (); -int -main () -{ -return remove (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_posix_remove=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_posix_remove=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 -echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } -if test $ac_cv_lib_posix_remove = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - { echo "$as_me:$LINENO: checking for shmat" >&5 -echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } -if test "${ac_cv_func_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shmat to an innocuous variant, in case declares shmat. - For example, HP-UX 11i declares gettimeofday. */ -#define shmat innocuous_shmat - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shmat - -/* 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 shmat (); -/* 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_shmat || defined __stub___shmat -choke me -#endif - -int -main () -{ -return shmat (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shmat=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shmat=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 -echo "${ECHO_T}$ac_cv_func_shmat" >&6; } - - if test $ac_cv_func_shmat = no; then - { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 -echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } -if test "${ac_cv_lib_ipc_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 shmat (); -int -main () -{ -return shmat (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_ipc_shmat=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ipc_shmat=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 -echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } -if test $ac_cv_lib_ipc_shmat = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # libraries we check for below, so use a different variable. - # John Interrante, Karl Berry - { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 -echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 IceConnectionNumber (); -int -main () -{ -return IceConnectionNumber (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_ICE_IceConnectionNumber=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ICE_IceConnectionNumber=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -fi - - LDFLAGS=$ac_save_LDFLAGS - -fi - -if test -n "$no_x" ; then - echo $PRODUCT requires the X Window System header files and libraries! - echo They were not found on your system. See FAQ topic C.2. - echo configure failed - exit 1 -fi - -if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then - { echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 -echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking X11/Intrinsic.h usability" >&5 -echo $ECHO_N "checking X11/Intrinsic.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking X11/Intrinsic.h presence" >&5 -echo $ECHO_N "checking X11/Intrinsic.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 -echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_Intrinsic_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } - -fi -if test $ac_cv_header_X11_Intrinsic_h = yes; then - xt="yes" -else - xt="no" -fi - - - -if test "$xt" == "no" ; then - echo Xt headers not found - exit 1 -fi - - -# Check whether --with-Xaw3d was given. -if test "${with_Xaw3d+set}" = set; then - withval=$with_Xaw3d; with_xaw3d="yes" -else - with_xaw3d="no" -fi - - - -xaw_headers="no" -if test "$with_xaw3d" == "yes" ; then - XAW_LIBS="-lXaw3d" - { echo "$as_me:$LINENO: checking for XawTextReplace in -lXaw3d" >&5 -echo $ECHO_N "checking for XawTextReplace in -lXaw3d... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xaw3d_XawTextReplace+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXaw3d $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 XawTextReplace (); -int -main () -{ -return XawTextReplace (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xaw3d_XawTextReplace=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xaw3d_XawTextReplace=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawTextReplace" >&5 -echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawTextReplace" >&6; } -if test $ac_cv_lib_Xaw3d_XawTextReplace = yes; then - xaw3d_lib="yes" -else - xaw3d_lib="no" -fi - - if test "$xaw3d_lib" == "no" ; then - echo Xaw3d libraries not found - exit 1 - else - if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then - { echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h usability" >&5 -echo $ECHO_N "checking X11/Xaw3d/Dialog.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h presence" >&5 -echo $ECHO_N "checking X11/Xaw3d/Dialog.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_Xaw3d_Dialog_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } - -fi -if test $ac_cv_header_X11_Xaw3d_Dialog_h = yes; then - xaw3d_headers="yes" -else - xaw3d_headers="no" -fi - - - if test "$xaw3d_headers" == "yes" ; then - cat >>confdefs.h <<\_ACEOF -#define USE_XAW3D 1 -_ACEOF - - xaw_headers="yes" - else - if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 -echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 -echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } - -fi -if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then - xaw_headers="yes" -fi - - - fi - fi -else - XAW_LIBS="-lXaw" - if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 -echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 -echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 -echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } - -fi -if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then - xaw_headers="yes" -fi - - -fi - - - - - -if test "$xaw_headers" == "no" ; then - echo Xaw headers not found - exit 1 - -fi - - - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -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 - - - - - -USE_PTYS=0 -case "$host" in - *-*-hpux* ) - cat >>confdefs.h <<\_ACEOF -#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty/tty%c%x", c, i); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptym/pty%c%x", c, i); -_ACEOF - - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - else - - - CONF_CFLAGS="-Aa -D_HPUX_SOURCE" - fi - - - if test -d /opt/hppd/include/X11; then - X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" - X_LIBS="$X_LIBS -L/opt/hppd/lib" - elif test -d /usr/contrib/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" - elif test -d /usr/contrib/mitX11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" - elif test -d /MIT/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" - X_LIBS="$X_LIBS -L/MIT/X11R5/lib" - elif test -d /usr/local/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" - X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" - fi - if test -d /usr/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" - X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" - elif test -d /usr/include/X11R4; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" - X_LIBS="$X_LIBS -L/usr/lib/X11R4" - fi - ;; - - romp-ibm-aix* ) - cat >>confdefs.h <<\_ACEOF -#define IBMRTAIX 1 -_ACEOF - - ;; - - i386-ibm-aix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - - *-*-aix3* | *-*-bosx* ) - cat >>confdefs.h <<\_ACEOF -#define PTY_ITERATION for (c = 0; !c; c++) -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); -_ACEOF - - ;; - - *-*-cxux* ) - cat >>confdefs.h <<\_ACEOF -#define FIRST_PTY_LETTER 'A' -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define LAST_PTY_LETTER 'P' -_ACEOF - - ;; - - *-*-uniplus* ) - cat >>confdefs.h <<\_ACEOF -#define UNIPLUS 1 -_ACEOF - - ;; - - *-*-rtu* ) - cat >>confdefs.h <<\_ACEOF -#define FIRST_PTY_LETTER 'z' -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%x", i); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty%x", i); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define RTU 1 -_ACEOF - - ;; - - *-*-iris* | *-*-irix3* ) - cat >>confdefs.h <<\_ACEOF -#define PTY_ITERATION for (c = 0; !c; c++) -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev)); -_ACEOF - - ;; - - *-*-irix* ) - ;; - - *-*-sunos4* | *-*-solaris1* ) - - - if test "$GCC" = yes; then - PRE_XMULIB="-static" - POST_XMULIB="-dynamic" - else - PRE_XMULIB="-Bstatic" - POST_XMULIB="-Bdynamic" - fi - ;; - - *-*-sunos5* | *-*-solaris2* ) - - - X_LIBS="$X_LIBS -lelf" - ;; - - *-*-sco* ) - cat >>confdefs.h <<\_ACEOF -#define PTY_ITERATION for (i = 0; ; i++) -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptyp%d", i); -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%d", i); -_ACEOF - - ;; - - *-*-dynix* | *-*-ptx* ) - ;; - - *-*-esix* ) - ;; - - *-*-usg5-4* | *-*-sysvr4* ) - ;; - - *-*-usg* | *-*-sysv* | *-*-aix* ) - ;; - - vax-*-ultrix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; -esac - -# Check whether --enable-xpm was given. -if test "${enable_xpm+set}" = set; then - enableval=$enable_xpm; enable_xpm="$enableval" -else - enable_xpm="yes" -fi - - -if test "$enable_xpm" = "yes"; then - save_cflags="$CFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - -for ac_header in X11/xpm.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - CFLAGS="$save_cflags" - if test "$ac_cv_header_X11_xpm_h" = "yes"; then - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS" - { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 -echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXpm $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 XpmReadFileToPixmap (); -int -main () -{ -return XpmReadFileToPixmap (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xpm_XpmReadFileToPixmap=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xpm_XpmReadFileToPixmap=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 -echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } -if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then - X_PRE_LIBS="-lXpm $X_PRE_LIBS"; cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBXPM 1 -_ACEOF - -fi - - LDFLAGS="$save_ldflags" - fi -fi - - - - - - -{ echo "$as_me:$LINENO: checking whether ptys or pipes should be used" >&5 -echo $ECHO_N "checking whether ptys or pipes should be used... $ECHO_C" >&6; } -# Check whether --enable-ptys was given. -if test "${enable_ptys+set}" = set; then - enableval=$enable_ptys; if test "$enableval" = yes; then - USE_PTYS=1 - { echo "$as_me:$LINENO: result: ptys (user override)" >&5 -echo "${ECHO_T}ptys (user override)" >&6; } -fi -if test "$enableval" = no; then - USE_PTYS=0 - { echo "$as_me:$LINENO: result: pipes (user override)" >&5 -echo "${ECHO_T}pipes (user override)" >&6; } -fi -else - if test "$USE_PTYS" = 1; then - { echo "$as_me:$LINENO: result: ptys" >&5 -echo "${ECHO_T}ptys" >&6; } -else - { echo "$as_me:$LINENO: result: pipes" >&5 -echo "${ECHO_T}pipes" >&6; } -fi -fi - -cat >>confdefs.h <<_ACEOF -#define USE_PTYS $USE_PTYS -_ACEOF - - -# Check whether --enable-zippy was given. -if test "${enable_zippy+set}" = set; then - enableval=$enable_zippy; enable_zippy="$enableval" -else - enable_zippy="yes" -fi - -if test "$enable_zippy" = yes; then - cat >>confdefs.h <<\_ACEOF -#define ZIPPY 1 -_ACEOF - - ZIPPY_O=zippy.o - ZIPPY_H=zippy.h -fi - - - -# Check whether --enable-sigint was given. -if test "${enable_sigint+set}" = set; then - enableval=$enable_sigint; if test "$enableval" = yes; then - cat >>confdefs.h <<\_ACEOF -#define ATTENTION 1 -_ACEOF - -fi -else - cat >>confdefs.h <<\_ACEOF -#define ATTENTION 1 -_ACEOF - -fi - - -cat >>confdefs.h <<_ACEOF -#define PRODUCT "$PRODUCT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PATCHLEVEL "$PATCHLEVEL" -_ACEOF - - - - - -ac_config_files="$ac_config_files cmail xboard.texinfo" - -ac_config_commands="$ac_config_commands default" - -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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -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= -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=`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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## 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=: - # Zsh 3.x and 4.x performs 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 - -# 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 xboard $as_me 4.3, which was -generated by GNU Autoconf 2.61. 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 - -cat >>$CONFIG_STATUS <<_ACEOF -# 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_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet 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 ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -xboard config.status 4.3 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 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' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$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 ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - 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. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "cmail") CONFIG_FILES="$CONFIG_FILES cmail" ;; - "xboard.texinfo") CONFIG_FILES="$CONFIG_FILES xboard.texinfo" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -CPP!$CPP$ac_delim -LEX!$LEX$ac_delim -LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim -LEXLIB!$LEXLIB$ac_delim -RSH!$RSH$ac_delim -MINFO!$MINFO$ac_delim -NROFF!$NROFF$ac_delim -NROFFFLAGS!$NROFFFLAGS$ac_delim -AWKPATH!$AWKPATH$ac_delim -PERLPATH!$PERLPATH$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -XMKMF!$XMKMF$ac_delim -X_CFLAGS!$X_CFLAGS$ac_delim -X_PRE_LIBS!$X_PRE_LIBS$ac_delim -X_LIBS!$X_LIBS$ac_delim -X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim -XAW_LIBS!$XAW_LIBS$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -PRE_XMULIB!$PRE_XMULIB$ac_delim -POST_XMULIB!$POST_XMULIB$ac_delim -CONF_CFLAGS!$CONF_CFLAGS$ac_delim -CONF_LDFLAGS!$CONF_LDFLAGS$ac_delim -ZIPPY_O!$ZIPPY_O$ac_delim -ZIPPY_H!$ZIPPY_H$ac_delim -PRODUCT!$PRODUCT$ac_delim -PATCHLEVEL!$PATCHLEVEL$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[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="$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 || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - 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 || -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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 -# 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= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - 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 - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;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 -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -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 "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then 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. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" -# 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 || -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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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 || -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"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 || -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 - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - "default":C) test -z "$CONFIG_HEADERS" || date > stamp-h -chmod 755 cmail - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - ++#! /bin/sh ++# Guess values for system-dependent variables and create Makefiles. ++# Generated by GNU Autoconf 2.61 for xboard 4.3. ++# ++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, ++# 2002, 2003, 2004, 2005, 2006 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=: ++ # Zsh 3.x and 4.x performs 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 ++ ++ ++ ++ ++# PATH needs CR ++# 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 ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ echo "#! /bin/sh" >conf$$.sh ++ echo "exit 0" >>conf$$.sh ++ chmod +x conf$$.sh ++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then ++ PATH_SEPARATOR=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++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.) ++as_nl=' ++' ++IFS=" "" $as_nl" ++ ++# Find who we are. Look in the path if we contain no directory separator. ++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 ++ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ { (exit 1); exit 1; } ++fi ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++for as_var in ENV MAIL MAILPATH ++do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++done ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++ fi ++done ++ ++# Required to use basename. ++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 ++ ++ ++# Name of the executable. ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ ++# CDPATH. ++$as_unset CDPATH ++ ++ ++if test "x$CONFIG_SHELL" = x; then ++ if (eval ":") 2>/dev/null; then ++ as_have_required=yes ++else ++ as_have_required=no ++fi ++ ++ if test $as_have_required = yes && (eval ": ++(as_func_return () { ++ (exit \$1) ++} ++as_func_success () { ++ as_func_return 0 ++} ++as_func_failure () { ++ as_func_return 1 ++} ++as_func_ret_success () { ++ return 0 ++} ++as_func_ret_failure () { ++ return 1 ++} ++ ++exitcode=0 ++if as_func_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_success failed. ++fi ++ ++if as_func_failure; then ++ exitcode=1 ++ echo as_func_failure succeeded. ++fi ++ ++if as_func_ret_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_ret_success failed. ++fi ++ ++if as_func_ret_failure; then ++ exitcode=1 ++ echo as_func_ret_failure succeeded. ++fi ++ ++if ( set x; as_func_ret_success y && test x = \"\$1\" ); then ++ : ++else ++ exitcode=1 ++ echo positional parameters were not saved. ++fi ++ ++test \$exitcode = 0) || { (exit 1); exit 1; } ++ ++( ++ as_lineno_1=\$LINENO ++ as_lineno_2=\$LINENO ++ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && ++ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ++") 2> /dev/null; then ++ : ++else ++ as_candidate_shells= ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ case $as_dir in ++ /*) ++ for as_base in sh bash ksh sh5; do ++ as_candidate_shells="$as_candidate_shells $as_dir/$as_base" ++ done;; ++ esac ++done ++IFS=$as_save_IFS ++ ++ ++ for as_shell in $as_candidate_shells $SHELL; do ++ # Try only shells that exist, to save several forks. ++ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && ++ { ("$as_shell") 2> /dev/null <<\_ASEOF ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # Zsh 3.x and 4.x performs 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 ++ ++ ++: ++_ASEOF ++}; then ++ CONFIG_SHELL=$as_shell ++ as_have_required=yes ++ if { "$as_shell" 2> /dev/null <<\_ASEOF ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # Zsh 3.x and 4.x performs 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_func_return () { ++ (exit $1) ++} ++as_func_success () { ++ as_func_return 0 ++} ++as_func_failure () { ++ as_func_return 1 ++} ++as_func_ret_success () { ++ return 0 ++} ++as_func_ret_failure () { ++ return 1 ++} ++ ++exitcode=0 ++if as_func_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_success failed. ++fi ++ ++if as_func_failure; then ++ exitcode=1 ++ echo as_func_failure succeeded. ++fi ++ ++if as_func_ret_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_ret_success failed. ++fi ++ ++if as_func_ret_failure; then ++ exitcode=1 ++ echo as_func_ret_failure succeeded. ++fi ++ ++if ( set x; as_func_ret_success y && test x = "$1" ); then ++ : ++else ++ exitcode=1 ++ echo positional parameters were not saved. ++fi ++ ++test $exitcode = 0) || { (exit 1); exit 1; } ++ ++( ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } ++ ++_ASEOF ++}; then ++ break ++fi ++ ++fi ++ ++ done ++ ++ if test "x$CONFIG_SHELL" != x; then ++ for as_var in BASH_ENV ENV ++ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++ done ++ export CONFIG_SHELL ++ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} ++fi ++ ++ ++ if test $as_have_required = no; then ++ echo This script requires a shell more modern than all the ++ echo shells that I found on your system. Please install a ++ echo modern shell, or manually run the script under such a ++ echo shell if you do have one. ++ { (exit 1); exit 1; } ++fi ++ ++ ++fi ++ ++fi ++ ++ ++ ++(eval "as_func_return () { ++ (exit \$1) ++} ++as_func_success () { ++ as_func_return 0 ++} ++as_func_failure () { ++ as_func_return 1 ++} ++as_func_ret_success () { ++ return 0 ++} ++as_func_ret_failure () { ++ return 1 ++} ++ ++exitcode=0 ++if as_func_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_success failed. ++fi ++ ++if as_func_failure; then ++ exitcode=1 ++ echo as_func_failure succeeded. ++fi ++ ++if as_func_ret_success; then ++ : ++else ++ exitcode=1 ++ echo as_func_ret_success failed. ++fi ++ ++if as_func_ret_failure; then ++ exitcode=1 ++ echo as_func_ret_failure succeeded. ++fi ++ ++if ( set x; as_func_ret_success y && test x = \"\$1\" ); then ++ : ++else ++ exitcode=1 ++ echo positional parameters were not saved. ++fi ++ ++test \$exitcode = 0") || { ++ echo No shell found that supports shell functions. ++ echo Please tell autoconf@gnu.org about your system, ++ echo including any error possibly output before this ++ echo message ++} ++ ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line after each line using $LINENO; the second 'sed' ++ # does the real work. The second script uses 'N' to pair each ++ # line-number line with the line containing $LINENO, and appends ++ # trailing '-' during substitution so that $LINENO is not a special ++ # case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # scripts with optimization help from Paolo Bonzini. 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" || ++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 ++ { (exit 1); exit 1; }; } ++ ++ # 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 ++} ++ ++ ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi ++ ++ECHO_C= ECHO_N= ECHO_T= ++case `echo -n x` in ++-n*) ++ case `echo 'x\c'` in ++ *c*) ECHO_T=' ';; # ECHO_T is single tab character. ++ *) ECHO_C='\c';; ++ esac;; ++*) ++ ECHO_N='-n';; ++esac ++ ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++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 ++fi ++echo >conf$$.file ++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 -p'. ++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || ++ as_ln_s='cp -p' ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++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=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x ++ ++# 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 7<&0 &1 ++ ++# Name of the host. ++# hostname on some systems (SVR3.2, 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= ++SHELL=${CONFIG_SHELL-/bin/sh} ++ ++# Identity of this package. ++PACKAGE_NAME='xboard' ++PACKAGE_TARNAME='xboard' ++PACKAGE_VERSION='4.4' ++PACKAGE_STRING='xboard 4.4' ++PACKAGE_BUGREPORT='' ++ ++# 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" ++ ++ac_subst_vars='SHELL ++PATH_SEPARATOR ++PACKAGE_NAME ++PACKAGE_TARNAME ++PACKAGE_VERSION ++PACKAGE_STRING ++PACKAGE_BUGREPORT ++exec_prefix ++prefix ++program_transform_name ++bindir ++sbindir ++libexecdir ++datarootdir ++datadir ++sysconfdir ++sharedstatedir ++localstatedir ++includedir ++oldincludedir ++docdir ++infodir ++htmldir ++dvidir ++pdfdir ++psdir ++libdir ++localedir ++mandir ++DEFS ++ECHO_C ++ECHO_N ++ECHO_T ++LIBS ++build_alias ++host_alias ++target_alias ++INSTALL_PROGRAM ++INSTALL_SCRIPT ++INSTALL_DATA ++am__isrc ++CYGPATH_W ++PACKAGE ++VERSION ++ACLOCAL ++AUTOCONF ++AUTOMAKE ++AUTOHEADER ++MAKEINFO ++install_sh ++STRIP ++INSTALL_STRIP_PROGRAM ++mkdir_p ++AWK ++SET_MAKE ++am__leading_dot ++AMTAR ++am__tar ++am__untar ++CC ++CFLAGS ++LDFLAGS ++CPPFLAGS ++ac_ct_CC ++EXEEXT ++OBJEXT ++DEPDIR ++am__include ++am__quote ++AMDEP_TRUE ++AMDEP_FALSE ++AMDEPBACKSLASH ++CCDEPMODE ++am__fastdepCC_TRUE ++am__fastdepCC_FALSE ++LIBOBJS ++LTLIBOBJS ++CPP ++LEX ++LEX_OUTPUT_ROOT ++LEXLIB ++RSH ++MINFO ++NROFF ++NROFFFLAGS ++AWKPATH ++PERLPATH ++GREP ++EGREP ++XMKMF ++X_CFLAGS ++X_PRE_LIBS ++X_LIBS ++X_EXTRA_LIBS ++XAW_LIBS ++build ++build_cpu ++build_vendor ++build_os ++host ++host_cpu ++host_vendor ++host_os ++PRE_XMULIB ++POST_XMULIB ++CONF_CFLAGS ++CONF_LDFLAGS ++ZIPPY_O ++ZIPPY_H ++PRODUCT ++PATCHLEVEL' ++ac_subst_files='' ++ ac_precious_vars='build_alias ++host_alias ++target_alias ++CC ++CFLAGS ++LDFLAGS ++LIBS ++CPPFLAGS ++CPP ++XMKMF' ++ ++ ++# Initialize some variables set by options. ++ac_init_help= ++ac_init_version=false ++# 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 ++ { (exit 1); exit 1; }; } ++ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` ++ eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 ++ { (exit 1); exit 1; }; } ++ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` ++ eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid package name: $ac_package" >&2 ++ { (exit 1); exit 1; }; } ++ ac_package=`echo $ac_package | sed 's/[-.]/_/g'` ++ eval with_$ac_package=\$ac_optarg ;; ++ ++ -without-* | --without-*) ++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid package name: $ac_package" >&2 ++ { (exit 1); exit 1; }; } ++ ac_package=`echo $ac_package | sed 's/[-.]/_/g'` ++ eval with_$ac_package=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 ;; ++ ++ -*) { echo "$as_me: error: unrecognized option: $ac_option ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; } ++ ;; ++ ++ *=*) ++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && ++ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 ++ { (exit 1); exit 1; }; } ++ eval $ac_envvar=\$ac_optarg ++ export $ac_envvar ;; ++ ++ *) ++ # FIXME: should be removed in autoconf 3.0. ++ echo "$as_me: WARNING: you should use --build, --host, --target" >&2 ++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ 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'` ++ { echo "$as_me: error: missing argument to $ac_option" >&2 ++ { (exit 1); exit 1; }; } ++fi ++ ++# Be sure to have absolute directory names. ++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 ++ case $ac_val in ++ [\\/$]* | ?:[\\/]* ) continue;; ++ NONE | '' ) case $ac_var in *prefix ) continue;; esac;; ++ esac ++ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 ++ { (exit 1); exit 1; }; } ++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 ++ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used." >&2 ++ 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 .` || ++ { echo "$as_me: error: Working directory cannot be determined" >&2 ++ { (exit 1); exit 1; }; } ++test "X$ac_ls_di" = "X$ac_pwd_ls_di" || ++ { echo "$as_me: error: pwd does not report name of working directory" >&2 ++ { (exit 1); exit 1; }; } ++ ++ ++# 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 -- "$0" || ++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$0" : 'X\(//\)[^/]' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++echo X"$0" | ++ 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 .." ++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 ++ { (exit 1); exit 1; }; } ++fi ++ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ++ac_abs_confdir=`( ++ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 ++ { (exit 1); exit 1; }; } ++ 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 xboard 4.3 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/xboard] ++ --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 ++ ++X features: ++ --x-includes=DIR X include files are in DIR ++ --x-libraries=DIR X library files are in DIR ++ ++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 xboard 4.3:";; ++ esac ++ cat <<\_ACEOF ++ ++Optional Features: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --disable-dependency-tracking speeds up one-time build ++ --enable-dependency-tracking do not reject slow dependency extractors ++ --enable-xpm libXpm will be used if found (default) ++ --disable-xpm libXpm will not be used ++ --enable-ptys force use of pseudo-ttys with child processes ++ --disable-ptys force use of pipes with child processes ++ --enable-zippy support interfacing a chess program to ICS (default) ++ --disable-zippy do not support interfacing a chess program to ICS ++ --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) ++ --disable-sigint typing a command wakes up GNU Chess ++ ++Optional Packages: ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --with-x use the X Window System ++ --with-Xaw3d use Xaw3d instead of Xaw ++ ++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 C/C++/Objective C preprocessor flags, e.g. -I if ++ you have headers in a nonstandard directory ++ CPP C preprocessor ++ XMKMF Path to xmkmf, Makefile generator for X Window System ++ ++Use these variables to override the choices made by `configure' or to help ++it to find libraries and programs with nonstandard names/locations. ++ ++_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" || continue ++ ac_builddir=. ++ ++case "$ac_dir" in ++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; ++*) ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` ++ # A ".." for each directory in $ac_dir_suffix. ++ ac_top_builddir_sub=`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 ++ 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 ++xboard configure 4.3 ++generated by GNU Autoconf 2.61 ++ ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, ++2002, 2003, 2004, 2005, 2006 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 ++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 xboard $as_me 4.3, which was ++generated by GNU Autoconf 2.61. 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=. ++ 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ case $ac_pass in ++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; ++ 2) ++ ac_configure_args1="$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 ++ ac_configure_args="$ac_configure_args '$ac_arg'" ++ ;; ++ esac ++ done ++done ++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } ++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 ++ ++ cat <<\_ASBOX ++## ---------------- ## ++## Cache variables. ## ++## ---------------- ## ++_ASBOX ++ 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 ++echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; ++ esac ++ case $ac_var in #( ++ _ | IFS | as_nl) ;; #( ++ *) $as_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 ++ ++ cat <<\_ASBOX ++## ----------------- ## ++## Output variables. ## ++## ----------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_vars ++ do ++ eval ac_val=\$$ac_var ++ case $ac_val in ++ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ esac ++ echo "$ac_var='\''$ac_val'\''" ++ done | sort ++ echo ++ ++ if test -n "$ac_subst_files"; then ++ cat <<\_ASBOX ++## ------------------- ## ++## File substitutions. ## ++## ------------------- ## ++_ASBOX ++ echo ++ for ac_var in $ac_subst_files ++ do ++ eval ac_val=\$$ac_var ++ case $ac_val in ++ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ esac ++ echo "$ac_var='\''$ac_val'\''" ++ done | sort ++ echo ++ fi ++ ++ if test -s confdefs.h; then ++ cat <<\_ASBOX ++## ----------- ## ++## confdefs.h. ## ++## ----------- ## ++_ASBOX ++ echo ++ cat confdefs.h ++ echo ++ fi ++ test "$ac_signal" != 0 && ++ echo "$as_me: caught signal $ac_signal" ++ 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'; { (exit 1); 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 ++ ++# 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 ++ ++ ++# Let the site file select an alternate cache file if it wants to. ++# Prefer explicitly selected file to automatically selected ones. ++if test -n "$CONFIG_SITE"; then ++ set x "$CONFIG_SITE" ++elif test "x$prefix" != xNONE; then ++ set x "$prefix/share/config.site" "$prefix/etc/config.site" ++else ++ set x "$ac_default_prefix/share/config.site" \ ++ "$ac_default_prefix/etc/config.site" ++fi ++shift ++for ac_site_file ++do ++ if test -r "$ac_site_file"; then ++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 ++echo "$as_me: loading site script $ac_site_file" >&6;} ++ sed 's/^/| /' "$ac_site_file" >&5 ++ . "$ac_site_file" ++ 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. ++ if test -f "$cache_file"; then ++ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 ++echo "$as_me: loading cache $cache_file" >&6;} ++ case $cache_file in ++ [\\/]* | ?:[\\/]* ) . "$cache_file";; ++ *) . "./$cache_file";; ++ esac ++ fi ++else ++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5 ++echo "$as_me: creating cache $cache_file" >&6;} ++ >$cache_file ++fi ++ ++# 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,) ++ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 ++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ++ ac_cache_corrupted=: ;; ++ ,set) ++ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 ++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 ++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 ++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 ++echo "$as_me: former value: $ac_old_val" >&2;} ++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 ++echo "$as_me: current value: $ac_new_val" >&2;} ++ ac_cache_corrupted=: ++ fi;; ++ esac ++ # Pass precious variables to config.status. ++ if test "$ac_new_set" = set; then ++ case $ac_new_val in ++ *\'*) ac_arg=$ac_var=`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. ++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ esac ++ fi ++done ++if $ac_cache_corrupted; then ++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 ++echo "$as_me: error: changes in the environment can compromise the build" >&2;} ++ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 ++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} ++ { (exit 1); exit 1; }; } ++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 ++ ++ ++am__api_version='1.10' ++ ++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 ++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 ++echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} ++ { (exit 1); exit 1; }; } ++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. ++{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 ++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } ++if test -z "$INSTALL"; then ++if test "${ac_cv_path_install+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 ++ fi ++ fi ++ done ++ done ++ ;; ++esac ++done ++IFS=$as_save_IFS ++ ++ ++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 ++{ echo "$as_me:$LINENO: result: $INSTALL" >&5 ++echo "${ECHO_T}$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' ++ ++{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 ++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } ++# Just in case ++sleep 1 ++echo timestamp > conftest.file ++# 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 ( ++ 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 ++ rm -f conftest.file ++ 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". ++ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken ++alias in your environment" >&5 ++echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken ++alias in your environment" >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++ ++ test "$2" = conftest.file ++ ) ++then ++ # Ok. ++ : ++else ++ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! ++Check your system clock" >&5 ++echo "$as_me: error: newly created file is older than distributed files! ++Check your system clock" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++{ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6; } ++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 $. echo might interpret backslashes. ++# By default was `s,x,x', remove it if useless. ++cat <<\_ACEOF >conftest.sed ++s/[\\$]/&&/g;s/;s,x,x,$// ++_ACEOF ++program_transform_name=`echo $program_transform_name | sed -f conftest.sed` ++rm -f conftest.sed ++ ++# expand $ac_aux_dir to an absolute path ++am_aux_dir=`cd $ac_aux_dir && pwd` ++ ++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" ++# Use eval to expand $SHELL ++if eval "$MISSING --run true"; then ++ am_missing_run="$MISSING --run " ++else ++ am_missing_run= ++ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 ++echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} ++fi ++ ++{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 ++echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } ++if test -z "$MKDIR_P"; then ++ if test "${ac_cv_path_mkdir+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 ++ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 ++ ++ 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. ++ test -d ./--version && rmdir ./--version ++ MKDIR_P="$ac_install_sh -d" ++ fi ++fi ++{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 ++echo "${ECHO_T}$MKDIR_P" >&6; } ++ ++mkdir_p="$MKDIR_P" ++case $mkdir_p in ++ [\\/$]* | ?:[\\/]*) ;; ++ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; ++esac ++ ++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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_AWK+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_AWK="$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $AWK" >&5 ++echo "${ECHO_T}$AWK" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$AWK" && break ++done ++ ++{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 ++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } ++set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` ++if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 ++ { echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6; } ++ SET_MAKE= ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++ ++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 ++ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 ++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} ++ { (exit 1); exit 1; }; } ++ 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='xboard' ++ VERSION='4.3' ++ ++ ++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"} ++ ++install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} ++ ++# 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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_STRIP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_STRIP="${ac_tool_prefix}strip" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $STRIP" >&5 ++echo "${ECHO_T}$STRIP" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_STRIP="strip" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 ++echo "${ECHO_T}$ac_ct_STRIP" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ if test "x$ac_ct_STRIP" = x; then ++ STRIP=":" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&5 ++echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&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" ++ ++# We need awk for the "check" target. The system "awk" is bad on ++# some platforms. ++# Always define AMTAR for backward compatibility. ++ ++AMTAR=${AMTAR-"${am_missing_run}tar"} ++ ++am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ++ ++ ++ ++ ++ ++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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}gcc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="gcc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ if test "x$ac_ct_CC" = x; then ++ CC="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&5 ++echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}cc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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:) ++{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&5 ++echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&2;} ++ac_tool_warned=yes ;; ++esac ++ CC=$ac_ct_CC ++ fi ++fi ++ ++fi ++ ++ ++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH ++See \`config.log' for more details." >&5 ++echo "$as_me: error: no acceptable C compiler found in \$PATH ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++ ++# Provide some information about the compiler. ++echo "$as_me:$LINENO: checking for C compiler version" >&5 ++ac_compiler=`set X $ac_compile; echo $2` ++{ (ac_try="$ac_compiler --version >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler --version >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (ac_try="$ac_compiler -v >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler -v >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (ac_try="$ac_compiler -V >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler -V >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files a.out 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. ++{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 ++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ++# ++# List of possible output files, starting from the most likely. ++# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) ++# only as a last resort. b.out is created by i960 compilers. ++ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' ++# ++# The IRIX 6 linker writes into existing files which may not be ++# executable, retaining their permissions. Remove them first so a ++# subsequent execution test works. ++ac_rmfiles= ++for ac_file in $ac_files ++do ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link_default") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; 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 | *.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 ++ ++{ echo "$as_me:$LINENO: result: $ac_file" >&5 ++echo "${ECHO_T}$ac_file" >&6; } ++if test -z "$ac_file"; then ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables ++See \`config.log' for more details." >&5 ++echo "$as_me: error: C compiler cannot create executables ++See \`config.log' for more details." >&2;} ++ { (exit 77); exit 77; }; } ++fi ++ ++ac_exeext=$ac_cv_exeext ++ ++# Check that the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 ++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } ++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 ++# If not cross compiling, check that we can run a simple program. ++if test "$cross_compiling" != yes; then ++ if { ac_try='./$ac_file' ++ { (case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ cross_compiling=no ++ else ++ if test "$cross_compiling" = maybe; then ++ cross_compiling=yes ++ else ++ { { echo "$as_me:$LINENO: error: cannot run C compiled programs. ++If you meant to cross compile, use \`--host'. ++See \`config.log' for more details." >&5 ++echo "$as_me: error: cannot run C compiled programs. ++If you meant to cross compile, use \`--host'. ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++ fi ++ fi ++fi ++{ echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6; } ++ ++rm -f a.out a.exe conftest$ac_cv_exeext b.out ++ac_clean_files=$ac_clean_files_save ++# Check that the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 ++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } ++{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 ++echo "${ECHO_T}$cross_compiling" >&6; } ++ ++{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 ++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } ++if { (ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; 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 | *.o | *.obj ) ;; ++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ break;; ++ * ) break;; ++ esac ++done ++else ++ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link ++See \`config.log' for more details." >&5 ++echo "$as_me: error: cannot compute suffix of executables: cannot compile and link ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++rm -f conftest$ac_cv_exeext ++{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 ++echo "${ECHO_T}$ac_cv_exeext" >&6; } ++ ++rm -f conftest.$ac_ext ++EXEEXT=$ac_cv_exeext ++ac_exeext=$EXEEXT ++{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 ++echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } ++if test "${ac_cv_objext+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; 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 ) ;; ++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` ++ break;; ++ esac ++done ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." >&5 ++echo "$as_me: error: cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++rm -f conftest.$ac_cv_objext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 ++echo "${ECHO_T}$ac_cv_objext" >&6; } ++OBJEXT=$ac_cv_objext ++ac_objext=$OBJEXT ++{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 ++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } ++if test "${ac_cv_c_compiler_gnu+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++#ifndef __GNUC__ ++ choke me ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_compiler_gnu=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ 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 ++{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 ++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } ++GCC=`test $ac_compiler_gnu = yes && echo yes` ++ac_test_CFLAGS=${CFLAGS+set} ++ac_save_CFLAGS=$CFLAGS ++{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 ++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } ++if test "${ac_cv_prog_cc_g+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_g=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ CFLAGS="" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_c_werror_flag=$ac_save_c_werror_flag ++ CFLAGS="-g" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_g=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++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 ++{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 ++echo "${ECHO_T}$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 ++{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 ++echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } ++if test "${ac_cv_prog_cc_c89+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_prog_cc_c89=no ++ac_save_CC=$CC ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++/* 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" ++ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_c89=$ac_arg ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++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) ++ { echo "$as_me:$LINENO: result: none needed" >&5 ++echo "${ECHO_T}none needed" >&6; } ;; ++ xno) ++ { echo "$as_me:$LINENO: result: unsupported" >&5 ++echo "${ECHO_T}unsupported" >&6; } ;; ++ *) ++ CC="$CC $ac_cv_prog_cc_c89" ++ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 ++echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; ++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 ++DEPDIR="${am__leading_dot}deps" ++ ++ac_config_commands="$ac_config_commands depfiles" ++ ++ ++am_make=${MAKE-make} ++cat > confinc << 'END' ++am__doit: ++ @echo done ++.PHONY: am__doit ++END ++# If we don't find an include directive, just comment out the code. ++{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 ++echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } ++am__include="#" ++am__quote= ++_am_result=none ++# First try GNU make style include. ++echo "include confinc" > confmf ++# We grep out `Entering directory' and `Leaving directory' ++# messages which can occur if `w' ends up in MAKEFLAGS. ++# In particular we don't look at `^make:' because GNU make might ++# be invoked under some other name (usually "gmake"), in which ++# case it prints its new name instead of `make'. ++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then ++ am__include=include ++ am__quote= ++ _am_result=GNU ++fi ++# Now try BSD make style include. ++if test "$am__include" = "#"; then ++ echo '.include "confinc"' > confmf ++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then ++ am__include=.include ++ am__quote="\"" ++ _am_result=BSD ++ fi ++fi ++ ++ ++{ echo "$as_me:$LINENO: result: $_am_result" >&5 ++echo "${ECHO_T}$_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='\' ++fi ++ if test "x$enable_dependency_tracking" != xno; then ++ AMDEP_TRUE= ++ AMDEP_FALSE='#' ++else ++ AMDEP_TRUE='#' ++ AMDEP_FALSE= ++fi ++ ++ ++ ++depcc="$CC" am_compiler_list= ++ ++{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 ++echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } ++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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'. ++ 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 ++ 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 8's {/usr,}/bin/sh. ++ touch sub/conftst$i.h ++ done ++ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf ++ ++ case $depmode in ++ 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 ++ ;; ++ none) break ;; ++ esac ++ # 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. ++ if depmode=$depmode \ ++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ ++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ ++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 ++{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 ++echo "${ECHO_T}$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_config_headers="$ac_config_headers config.h" ++ ++ac_config_files="$ac_config_files 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 ++echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; ++ esac ++ case $ac_var in #( ++ _ | IFS | as_nl) ;; #( ++ *) $as_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 ++ test "x$cache_file" != "x/dev/null" && ++ { echo "$as_me:$LINENO: updating cache $cache_file" >&5 ++echo "$as_me: updating cache $cache_file" >&6;} ++ cat confcache >$cache_file ++ else ++ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 ++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= ++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=`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. ++ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ++ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' ++done ++LIBOBJS=$ac_libobjs ++ ++LTLIBOBJS=$ac_ltlibobjs ++ ++ ++if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"AMDEP\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++: ${CONFIG_STATUS=./config.status} ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files $CONFIG_STATUS" ++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 ++echo "$as_me: creating $CONFIG_STATUS" >&6;} ++cat >$CONFIG_STATUS <<_ACEOF ++#! $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} ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++## --------------------- ## ++## 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=: ++ # Zsh 3.x and 4.x performs 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 ++ ++ ++ ++ ++# PATH needs CR ++# 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 ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ echo "#! /bin/sh" >conf$$.sh ++ echo "exit 0" >>conf$$.sh ++ chmod +x conf$$.sh ++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then ++ PATH_SEPARATOR=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++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.) ++as_nl=' ++' ++IFS=" "" $as_nl" ++ ++# Find who we are. Look in the path if we contain no directory separator. ++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 ++ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ { (exit 1); exit 1; } ++fi ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++for as_var in ENV MAIL MAILPATH ++do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++done ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++ fi ++done ++ ++# Required to use basename. ++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 ++ ++ ++# Name of the executable. ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ ++# CDPATH. ++$as_unset CDPATH ++ ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line after each line using $LINENO; the second 'sed' ++ # does the real work. The second script uses 'N' to pair each ++ # line-number line with the line containing $LINENO, and appends ++ # trailing '-' during substitution so that $LINENO is not a special ++ # case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # scripts with optimization help from Paolo Bonzini. 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" || ++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 ++ { (exit 1); exit 1; }; } ++ ++ # 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 ++} ++ ++ ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi ++ ++ECHO_C= ECHO_N= ECHO_T= ++case `echo -n x` in ++-n*) ++ case `echo 'x\c'` in ++ *c*) ECHO_T=' ';; # ECHO_T is single tab character. ++ *) ECHO_C='\c';; ++ esac;; ++*) ++ ECHO_N='-n';; ++esac ++ ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++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 ++fi ++echo >conf$$.file ++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 -p'. ++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || ++ as_ln_s='cp -p' ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++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=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x ++ ++# 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 ++ ++# 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 xboard $as_me 4.3, which was ++generated by GNU Autoconf 2.61. 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 ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++# 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_cs_usage="\ ++\`$as_me' instantiates files from templates according to the ++current configuration. ++ ++Usage: $0 [OPTIONS] [FILE]... ++ ++ -h, --help print this help, then exit ++ -V, --version print version number and configuration settings, then exit ++ -q, --quiet 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 ." ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ac_cs_version="\\ ++xboard config.status 4.3 ++configured by $0, generated by GNU Autoconf 2.61, ++ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" ++ ++Copyright (C) 2006 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' ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++# If no file are specified by the user, then we need to provide default ++# value. By we need to know if files were specified by the user. ++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=$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 ) ++ echo "$ac_cs_version"; exit ;; ++ --debug | --debu | --deb | --de | --d | -d ) ++ debug=: ;; ++ --file | --fil | --fi | --f ) ++ $ac_shift ++ CONFIG_FILES="$CONFIG_FILES $ac_optarg" ++ ac_need_defaults=false;; ++ --header | --heade | --head | --hea ) ++ $ac_shift ++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ++ ac_need_defaults=false;; ++ --he | --h) ++ # Conflict between --help and --header ++ { echo "$as_me: error: ambiguous option: $1 ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; };; ++ --help | --hel | -h ) ++ 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. ++ -*) { echo "$as_me: error: unrecognized option: $1 ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; } ;; ++ ++ *) ac_config_targets="$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 ++if \$ac_cs_recheck; then ++ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 ++ CONFIG_SHELL=$SHELL ++ export CONFIG_SHELL ++ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++exec 5>>config.log ++{ ++ echo ++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ++## Running $as_me. ## ++_ASBOX ++ echo "$ac_log" ++} >&5 ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++# ++# INIT-COMMANDS ++# ++AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" ++ ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++ ++# Handling of arguments. ++for ac_config_target in $ac_config_targets ++do ++ case $ac_config_target in ++ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; ++ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; ++ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; ++ ++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 ++echo "$as_me: error: invalid argument: $ac_config_target" >&2;} ++ { (exit 1); exit 1; }; };; ++ 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= ++ trap 'exit_status=$? ++ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ++' 0 ++ trap '{ (exit 1); exit 1; }' 1 2 13 15 ++} ++# Create a (secure) tmp directory for tmp files. ++ ++{ ++ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && ++ test -n "$tmp" && test -d "$tmp" ++} || ++{ ++ tmp=./conf$$-$RANDOM ++ (umask 077 && mkdir "$tmp") ++} || ++{ ++ echo "$me: cannot create a temporary directory in ." >&2 ++ { (exit 1); exit 1; } ++} ++ ++# ++# Set up the sed scripts for CONFIG_FILES section. ++# ++ ++# No need to generate the scripts if there are no CONFIG_FILES. ++# This happens for instance when ./config.status config.h ++if test -n "$CONFIG_FILES"; then ++ ++_ACEOF ++ ++ ++ ++ac_delim='%!_!# ' ++for ac_last_try in false false false false false :; do ++ cat >conf$$subs.sed <<_ACEOF ++SHELL!$SHELL$ac_delim ++PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim ++PACKAGE_NAME!$PACKAGE_NAME$ac_delim ++PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim ++PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim ++PACKAGE_STRING!$PACKAGE_STRING$ac_delim ++PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim ++exec_prefix!$exec_prefix$ac_delim ++prefix!$prefix$ac_delim ++program_transform_name!$program_transform_name$ac_delim ++bindir!$bindir$ac_delim ++sbindir!$sbindir$ac_delim ++libexecdir!$libexecdir$ac_delim ++datarootdir!$datarootdir$ac_delim ++datadir!$datadir$ac_delim ++sysconfdir!$sysconfdir$ac_delim ++sharedstatedir!$sharedstatedir$ac_delim ++localstatedir!$localstatedir$ac_delim ++includedir!$includedir$ac_delim ++oldincludedir!$oldincludedir$ac_delim ++docdir!$docdir$ac_delim ++infodir!$infodir$ac_delim ++htmldir!$htmldir$ac_delim ++dvidir!$dvidir$ac_delim ++pdfdir!$pdfdir$ac_delim ++psdir!$psdir$ac_delim ++libdir!$libdir$ac_delim ++localedir!$localedir$ac_delim ++mandir!$mandir$ac_delim ++DEFS!$DEFS$ac_delim ++ECHO_C!$ECHO_C$ac_delim ++ECHO_N!$ECHO_N$ac_delim ++ECHO_T!$ECHO_T$ac_delim ++LIBS!$LIBS$ac_delim ++build_alias!$build_alias$ac_delim ++host_alias!$host_alias$ac_delim ++target_alias!$target_alias$ac_delim ++INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim ++INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim ++INSTALL_DATA!$INSTALL_DATA$ac_delim ++am__isrc!$am__isrc$ac_delim ++CYGPATH_W!$CYGPATH_W$ac_delim ++PACKAGE!$PACKAGE$ac_delim ++VERSION!$VERSION$ac_delim ++ACLOCAL!$ACLOCAL$ac_delim ++AUTOCONF!$AUTOCONF$ac_delim ++AUTOMAKE!$AUTOMAKE$ac_delim ++AUTOHEADER!$AUTOHEADER$ac_delim ++MAKEINFO!$MAKEINFO$ac_delim ++install_sh!$install_sh$ac_delim ++STRIP!$STRIP$ac_delim ++INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim ++mkdir_p!$mkdir_p$ac_delim ++AWK!$AWK$ac_delim ++SET_MAKE!$SET_MAKE$ac_delim ++am__leading_dot!$am__leading_dot$ac_delim ++AMTAR!$AMTAR$ac_delim ++am__tar!$am__tar$ac_delim ++am__untar!$am__untar$ac_delim ++CC!$CC$ac_delim ++CFLAGS!$CFLAGS$ac_delim ++LDFLAGS!$LDFLAGS$ac_delim ++CPPFLAGS!$CPPFLAGS$ac_delim ++ac_ct_CC!$ac_ct_CC$ac_delim ++EXEEXT!$EXEEXT$ac_delim ++OBJEXT!$OBJEXT$ac_delim ++DEPDIR!$DEPDIR$ac_delim ++am__include!$am__include$ac_delim ++am__quote!$am__quote$ac_delim ++AMDEP_TRUE!$AMDEP_TRUE$ac_delim ++AMDEP_FALSE!$AMDEP_FALSE$ac_delim ++AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim ++CCDEPMODE!$CCDEPMODE$ac_delim ++am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim ++am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim ++LIBOBJS!$LIBOBJS$ac_delim ++LTLIBOBJS!$LTLIBOBJS$ac_delim ++_ACEOF ++ ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 77; then ++ break ++ elif $ac_last_try; then ++ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 ++echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} ++ { (exit 1); exit 1; }; } ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++ ++ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` ++if test -n "$ac_eof"; then ++ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ++ ac_eof=`expr $ac_eof + 1` ++fi ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end ++_ACEOF ++sed ' ++s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g ++s/^/s,@/; s/!/@,|#_!!_#|/ ++:n ++t n ++s/'"$ac_delim"'$/,g/; t ++s/$/\\/; p ++N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ++' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF ++:end ++s/|#_!!_#|//g ++CEOF$ac_eof ++_ACEOF ++ ++ ++# VPATH may cause trouble with some makes, so we remove $(srcdir), ++# ${srcdir} and @srcdir@ 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[ ]*=/{ ++s/:*\$(srcdir):*/:/ ++s/:*\${srcdir}:*/:/ ++s/:*@srcdir@:*/:/ ++s/^\([^=]*=[ ]*\):*/\1/ ++s/:*$// ++s/^[^=]*=[ ]*$// ++}' ++fi ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++fi # test -n "$CONFIG_FILES" ++ ++ ++for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS ++do ++ case $ac_tag in ++ :[FHLC]) ac_mode=$ac_tag; continue;; ++ esac ++ case $ac_mode$ac_tag in ++ :[FHL]*:*);; ++ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 ++echo "$as_me: error: Invalid tag $ac_tag." >&2;} ++ { (exit 1); exit 1; }; };; ++ :[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="$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 || ++ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 ++echo "$as_me: error: cannot find input file: $ac_f" >&2;} ++ { (exit 1); exit 1; }; };; ++ esac ++ ac_file_inputs="$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 "`IFS=: ++ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." ++ if test x"$ac_file" != x-; then ++ configure_input="$ac_file. $configure_input" ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ fi ++ ++ case $ac_tag in ++ *:-:* | *:-) cat >"$tmp/stdin";; ++ 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 || ++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" ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`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 || ++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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 ++echo "$as_me: error: cannot create directory $as_dir" >&2;} ++ { (exit 1); exit 1; }; }; } ++ ac_builddir=. ++ ++case "$ac_dir" in ++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; ++*) ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` ++ # A ".." for each directory in $ac_dir_suffix. ++ ac_top_builddir_sub=`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 ++# 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= ++ ++case `sed -n '/datarootdir/ { ++ p ++ q ++} ++/@datadir@/p ++/@docdir@/p ++/@infodir@/p ++/@localedir@/p ++/@mandir@/p ++' $ac_file_inputs` in ++*datarootdir*) ac_datarootdir_seen=yes;; ++*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) ++ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 ++echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ 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 ++ sed "$ac_vpsub ++$extrasub ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++:t ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b ++s&@configure_input@&$configure_input&;t t ++s&@top_builddir@&$ac_top_builddir_sub&;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 ++" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out ++ ++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && ++ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && ++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && ++ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++which seems to be undefined. Please make sure it is defined." >&5 ++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 "$tmp/stdin" ++ case $ac_file in ++ -) cat "$tmp/out"; rm -f "$tmp/out";; ++ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; ++ esac ++ ;; ++ :H) ++ # ++ # CONFIG_HEADER ++ # ++_ACEOF ++ ++# Transform confdefs.h into a sed script `conftest.defines', that ++# substitutes the proper values into config.h.in to produce config.h. ++rm -f conftest.defines conftest.tail ++# First, append a space to every undef/define line, to ease matching. ++echo 's/$/ /' >conftest.defines ++# Then, protect against being on the right side of a sed subst, or in ++# an unquoted here document, in config.status. If some macros were ++# called several times there might be several #defines for the same ++# symbol, which is useless. But do not sort them, since the last ++# AC_DEFINE must be honored. ++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* ++# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where ++# NAME is the cpp macro being defined, VALUE is the value it is being given. ++# PARAMS is the parameter list in the macro definition--in most cases, it's ++# just an empty string. ++ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ++ac_dB='\\)[ (].*,\\1define\\2' ++ac_dC=' ' ++ac_dD=' ,' ++ ++uniq confdefs.h | ++ sed -n ' ++ t rset ++ :rset ++ s/^[ ]*#[ ]*define[ ][ ]*// ++ t ok ++ d ++ :ok ++ s/[\\&,]/\\&/g ++ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p ++ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ++ ' >>conftest.defines ++ ++# Remove the space that was appended to ease matching. ++# Then 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. ++# (The regexp can be short, since the line contains either #define or #undef.) ++echo 's/ $// ++s,^[ #]*u.*,/* & */,' >>conftest.defines ++ ++# Break up conftest.defines: ++ac_max_sed_lines=50 ++ ++# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" ++# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" ++# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" ++# et cetera. ++ac_in='$ac_file_inputs' ++ac_out='"$tmp/out1"' ++ac_nxt='"$tmp/out2"' ++ ++while : ++do ++ # Write a here document: ++ cat >>$CONFIG_STATUS <<_ACEOF ++ # First, check the format of the line: ++ cat >"\$tmp/defines.sed" <<\\CEOF ++/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def ++/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def ++b ++:def ++_ACEOF ++ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS ++ echo 'CEOF ++ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ++ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in ++ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail ++ grep . conftest.tail >/dev/null || break ++ rm -f conftest.defines ++ mv conftest.tail conftest.defines ++done ++rm -f conftest.defines conftest.tail ++ ++echo "ac_result=$ac_in" >>$CONFIG_STATUS ++cat >>$CONFIG_STATUS <<\_ACEOF ++ if test x"$ac_file" != x-; then ++ echo "/* $configure_input */" >"$tmp/config.h" ++ cat "$ac_result" >>"$tmp/config.h" ++ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then ++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 ++echo "$as_me: $ac_file is unchanged" >&6;} ++ else ++ rm -f $ac_file ++ mv "$tmp/config.h" $ac_file ++ fi ++ else ++ echo "/* $configure_input */" ++ cat "$ac_result" ++ fi ++ rm -f "$tmp/out12" ++# 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 || ++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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 ++echo "$as_me: executing $ac_file commands" >&6;} ++ ;; ++ esac ++ ++ ++ case $ac_file$ac_mode in ++ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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 || ++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"` ++ # When using ansi2knr, U may be empty or an underscore; expand it ++ U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 || ++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 ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`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 || ++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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 ++echo "$as_me: error: cannot create directory $as_dir" >&2;} ++ { (exit 1); exit 1; }; }; } ++ # echo "creating $dirpart/$file" ++ echo '# dummy' > "$dirpart/$file" ++ done ++done ++ ;; ++ ++ esac ++done # for ac_tag ++ ++ ++{ (exit 0); exit 0; } ++_ACEOF ++chmod +x $CONFIG_STATUS ++ac_clean_files=$ac_clean_files_save ++ ++ ++# 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 || { (exit 1); exit 1; } ++fi ++ ++PRODUCT=xboard ++#VERSION=4.4 # version is already defined ++PATCHLEVEL=0c ++ ++ ++if test -z "$CFLAGS" ; then ++ CFLAGS=" " ++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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}gcc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="gcc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ if test "x$ac_ct_CC" = x; then ++ CC="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&5 ++echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}cc" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $CC" >&5 ++echo "${ECHO_T}$CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 ++echo "${ECHO_T}$ac_ct_CC" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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:) ++{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&5 ++echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools ++whose name does not start with the host triplet. If you think this ++configuration is useful to you, please write to autoconf@gnu.org." >&2;} ++ac_tool_warned=yes ;; ++esac ++ CC=$ac_ct_CC ++ fi ++fi ++ ++fi ++ ++ ++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH ++See \`config.log' for more details." >&5 ++echo "$as_me: error: no acceptable C compiler found in \$PATH ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++ ++# Provide some information about the compiler. ++echo "$as_me:$LINENO: checking for C compiler version" >&5 ++ac_compiler=`set X $ac_compile; echo $2` ++{ (ac_try="$ac_compiler --version >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler --version >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (ac_try="$ac_compiler -v >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler -v >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ (ac_try="$ac_compiler -V >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compiler -V >&5") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++ ++{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 ++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } ++if test "${ac_cv_c_compiler_gnu+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++#ifndef __GNUC__ ++ choke me ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_compiler_gnu=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ 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 ++{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 ++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } ++GCC=`test $ac_compiler_gnu = yes && echo yes` ++ac_test_CFLAGS=${CFLAGS+set} ++ac_save_CFLAGS=$CFLAGS ++{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 ++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } ++if test "${ac_cv_prog_cc_g+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_g=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ CFLAGS="" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_c_werror_flag=$ac_save_c_werror_flag ++ CFLAGS="-g" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_g=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++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 ++{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 ++echo "${ECHO_T}$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 ++{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 ++echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } ++if test "${ac_cv_prog_cc_c89+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_prog_cc_c89=no ++ac_save_CC=$CC ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++/* 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" ++ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_prog_cc_c89=$ac_arg ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++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) ++ { echo "$as_me:$LINENO: result: none needed" >&5 ++echo "${ECHO_T}none needed" >&6; } ;; ++ xno) ++ { echo "$as_me:$LINENO: result: unsupported" >&5 ++echo "${ECHO_T}unsupported" >&6; } ;; ++ *) ++ CC="$CC $ac_cv_prog_cc_c89" ++ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 ++echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; ++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 ++ ++depcc="$CC" am_compiler_list= ++ ++{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 ++echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } ++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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'. ++ 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 ++ 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 8's {/usr,}/bin/sh. ++ touch sub/conftst$i.h ++ done ++ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf ++ ++ case $depmode in ++ 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 ++ ;; ++ none) break ;; ++ esac ++ # 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. ++ if depmode=$depmode \ ++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ ++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ ++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 ++{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 ++echo "${ECHO_T}$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=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 ++{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 ++echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++ if test "${ac_cv_prog_CPP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Broken: fails on valid input. ++continue ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ # Broken: success on invalid input. ++continue ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f 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 ++{ echo "$as_me:$LINENO: result: $CPP" >&5 ++echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Broken: fails on valid input. ++continue ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ # Broken: success on invalid input. ++continue ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then ++ : ++else ++ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." >&5 ++echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." >&2;} ++ { (exit 1); exit 1; }; } ++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 ++ ++ ++{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 ++echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } ++if test "${ac_cv_search_strerror+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 strerror (); ++int ++main () ++{ ++return strerror (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' cposix; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_search_strerror=$ac_res ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ if test "${ac_cv_search_strerror+set}" = set; then ++ break ++fi ++done ++if test "${ac_cv_search_strerror+set}" = set; then ++ : ++else ++ ac_cv_search_strerror=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 ++echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ++ac_res=$ac_cv_search_strerror ++if test "$ac_res" != no; then ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++# 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. ++{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 ++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } ++if test -z "$INSTALL"; then ++if test "${ac_cv_path_install+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 ++ fi ++ fi ++ done ++ done ++ ;; ++esac ++done ++IFS=$as_save_IFS ++ ++ ++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 ++{ echo "$as_me:$LINENO: result: $INSTALL" >&5 ++echo "${ECHO_T}$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' ++ ++for ac_prog in lex flex ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_LEX+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_LEX="$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $LEX" >&5 ++echo "${ECHO_T}$LEX" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$LEX" && break ++done ++test -n "$LEX" || LEX="lex_not_found" ++ ++if test "$LEX" != lex_not_found ; then ++ 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 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_LEX+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_LEX="$ac_prog" ++ echo "$as_me:$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 ++ { echo "$as_me:$LINENO: result: $LEX" >&5 ++echo "${ECHO_T}$LEX" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}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 { 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$LEX conftest.l") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } ++{ echo "$as_me:$LINENO: checking lex output file root" >&5 ++echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } ++if test "${ac_cv_prog_lex_root+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 ++ { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 ++echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 ++echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } ++LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root ++ ++if test -z "${LEXLIB+set}"; then ++ { echo "$as_me:$LINENO: checking lex library" >&5 ++echo $ECHO_N "checking lex library... $ECHO_C" >&6; } ++if test "${ac_cv_lib_lex+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF ++`cat $LEX_OUTPUT_ROOT.c` ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_lex=$ac_lib ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++ test "$ac_cv_lib_lex" != 'none needed' && break ++ done ++ LIBS=$ac_save_LIBS ++ ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 ++echo "${ECHO_T}$ac_cv_lib_lex" >&6; } ++ test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex ++fi ++ ++ ++{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 ++echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } ++if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF ++#define YYTEXT_POINTER 1 ++`cat $LEX_OUTPUT_ROOT.c` ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_prog_lex_yytext_pointer=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_save_LIBS ++ ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 ++echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } ++if test $ac_cv_prog_lex_yytext_pointer = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define YYTEXT_POINTER 1 ++_ACEOF ++ ++fi ++rm -f conftest.l $LEX_OUTPUT_ROOT.c ++ ++fi ++fi ++for ac_prog in remsh rsh ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_RSH+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$RSH"; then ++ ac_cv_prog_RSH="$RSH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_RSH="$ac_prog" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++fi ++fi ++RSH=$ac_cv_prog_RSH ++if test -n "$RSH"; then ++ { echo "$as_me:$LINENO: result: $RSH" >&5 ++echo "${ECHO_T}$RSH" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$RSH" && break ++done ++test -n "$RSH" || RSH="rsh" ++ ++for ac_prog in makeinfo ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_MINFO+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$MINFO"; then ++ ac_cv_prog_MINFO="$MINFO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_MINFO="$ac_prog" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++fi ++fi ++MINFO=$ac_cv_prog_MINFO ++if test -n "$MINFO"; then ++ { echo "$as_me:$LINENO: result: $MINFO" >&5 ++echo "${ECHO_T}$MINFO" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$MINFO" && break ++done ++test -n "$MINFO" || MINFO="makeinfo_not_found" ++ ++if test "$MINFO" == makeinfo_not_found ; then ++ echo Please install \"makeinfo\" ++ exit 1 ++fi ++cat >>confdefs.h <<_ACEOF ++#define REMOTE_SHELL "$RSH" ++_ACEOF ++ ++# Extract the first word of "nroff", so it can be a program name with args. ++set dummy nroff; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_prog_NROFF+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$NROFF"; then ++ ac_cv_prog_NROFF="$NROFF" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_NROFF="nroff -man" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++ test -z "$ac_cv_prog_NROFF" && ac_cv_prog_NROFF="cat" ++fi ++fi ++NROFF=$ac_cv_prog_NROFF ++if test -n "$NROFF"; then ++ { echo "$as_me:$LINENO: result: $NROFF" >&5 ++echo "${ECHO_T}$NROFF" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ ++for ac_prog in awk mawk gawk nawk ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_path_AWKPATH+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ case $AWKPATH in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_AWKPATH="$AWKPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_path_AWKPATH="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++AWKPATH=$ac_cv_path_AWKPATH ++if test -n "$AWKPATH"; then ++ { echo "$as_me:$LINENO: result: $AWKPATH" >&5 ++echo "${ECHO_T}$AWKPATH" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$AWKPATH" && break ++done ++ ++for ac_prog in perl ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } ++if test "${ac_cv_path_PERLPATH+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ case $PERLPATH in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_PERLPATH="$PERLPATH" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_path_PERLPATH="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++PERLPATH=$ac_cv_path_PERLPATH ++if test -n "$PERLPATH"; then ++ { echo "$as_me:$LINENO: result: $PERLPATH" >&5 ++echo "${ECHO_T}$PERLPATH" >&6; } ++else ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++fi ++ ++ ++ test -n "$PERLPATH" && break ++done ++ ++ ++ ++ ++ ++ ++{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 ++echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } ++if test "${ac_cv_path_GREP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ # Extract the first word of "grep ggrep" to use in msg output ++if test -z "$GREP"; then ++set dummy grep ggrep; ac_prog_name=$2 ++if test "${ac_cv_path_GREP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ 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" ++ { test -f "$ac_path_GREP" && $as_test_x "$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 ++ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ 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 ++ ac_count=`expr $ac_count + 1` ++ 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 ++ ++ ++fi ++ ++GREP="$ac_cv_path_GREP" ++if test -z "$GREP"; then ++ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 ++echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++else ++ ac_cv_path_GREP=$GREP ++fi ++ ++ ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 ++echo "${ECHO_T}$ac_cv_path_GREP" >&6; } ++ GREP="$ac_cv_path_GREP" ++ ++ ++{ echo "$as_me:$LINENO: checking for egrep" >&5 ++echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } ++if test "${ac_cv_path_EGREP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 ++ then ac_cv_path_EGREP="$GREP -E" ++ else ++ # Extract the first word of "egrep" to use in msg output ++if test -z "$EGREP"; then ++set dummy egrep; ac_prog_name=$2 ++if test "${ac_cv_path_EGREP+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ 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" ++ { test -f "$ac_path_EGREP" && $as_test_x "$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 ++ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ 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 ++ ac_count=`expr $ac_count + 1` ++ 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 ++ ++ ++fi ++ ++EGREP="$ac_cv_path_EGREP" ++if test -z "$EGREP"; then ++ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 ++echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++else ++ ac_cv_path_EGREP=$EGREP ++fi ++ ++ ++ fi ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 ++echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } ++ EGREP="$ac_cv_path_EGREP" ++ ++ ++{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 ++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } ++if test "${ac_cv_header_stdc+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_header_stdc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ 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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 ++rm -f conftest$ac_exeext ++if { (ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' ++ { (case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ : ++else ++ echo "$as_me: program exited with status $ac_status" >&5 ++echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++( exit $ac_status ) ++ac_cv_header_stdc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext ++fi ++ ++ ++fi ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 ++echo "${ECHO_T}$ac_cv_header_stdc" >&6; } ++if test $ac_cv_header_stdc = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define STDC_HEADERS 1 ++_ACEOF ++ ++fi ++ ++{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 ++echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } ++if test "${ac_cv_header_time+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#include ++ ++int ++main () ++{ ++if ((struct tm *) 0) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_header_time=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_header_time=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 ++echo "${ECHO_T}$ac_cv_header_time" >&6; } ++if test $ac_cv_header_time = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define TIME_WITH_SYS_TIME 1 ++_ACEOF ++ ++fi ++ ++{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 ++echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } ++if test "${ac_cv_header_sys_wait_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++#ifndef WEXITSTATUS ++# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) ++#endif ++#ifndef WIFEXITED ++# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) ++#endif ++ ++int ++main () ++{ ++ int s; ++ wait (&s); ++ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_header_sys_wait_h=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_header_sys_wait_h=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 ++echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } ++if test $ac_cv_header_sys_wait_h = yes; then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_SYS_WAIT_H 1 ++_ACEOF ++ ++fi ++ ++ ++ ++ ++ ++ ++ac_header_dirent=no ++for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do ++ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 ++echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include <$ac_hdr> ++ ++int ++main () ++{ ++if ((DIR *) 0) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ eval "$as_ac_Header=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_Header=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 ++_ACEOF ++ ++ac_header_dirent=$ac_hdr; break ++fi ++ ++done ++# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. ++if test $ac_header_dirent = dirent.h; then ++ { echo "$as_me:$LINENO: checking for library containing opendir" >&5 ++echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } ++if test "${ac_cv_search_opendir+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 opendir (); ++int ++main () ++{ ++return opendir (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' dir; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_search_opendir=$ac_res ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ if test "${ac_cv_search_opendir+set}" = set; then ++ break ++fi ++done ++if test "${ac_cv_search_opendir+set}" = set; then ++ : ++else ++ ac_cv_search_opendir=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 ++echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ++ac_res=$ac_cv_search_opendir ++if test "$ac_res" != no; then ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++else ++ { echo "$as_me:$LINENO: checking for library containing opendir" >&5 ++echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } ++if test "${ac_cv_search_opendir+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 opendir (); ++int ++main () ++{ ++return opendir (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' x; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_search_opendir=$ac_res ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext ++ if test "${ac_cv_search_opendir+set}" = set; then ++ break ++fi ++done ++if test "${ac_cv_search_opendir+set}" = set; then ++ : ++else ++ ac_cv_search_opendir=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 ++echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ++ac_res=$ac_cv_search_opendir ++if test "$ac_res" != no; then ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++fi ++ ++{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 ++echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } ++if test "${ac_cv_type_signal+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++#include ++ ++int ++main () ++{ ++return *(signal (0, 0)) (0) == 1; ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_cv_type_signal=int ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_type_signal=void ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 ++echo "${ECHO_T}$ac_cv_type_signal" >&6; } ++ ++cat >>confdefs.h <<_ACEOF ++#define RETSIGTYPE $ac_cv_type_signal ++_ACEOF ++ ++ ++# 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++ ++#include <$ac_header> ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ eval "$as_ac_Header=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_Header=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ ++ ++ ++ ++ ++for ac_header in stropts.h sys/time.h string.h unistd.h sys/systeminfo.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ { echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ eval "$as_ac_Header=\$ac_header_preproc" ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ ++for ac_header in fcntl.h sys/fcntl.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ { echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ eval "$as_ac_Header=\$ac_header_preproc" ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++ ++done ++ ++ ++ ++for ac_header in sys/socket.h lan/socket.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ { echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ eval "$as_ac_Header=\$ac_header_preproc" ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++ ++done ++ ++if test "${ac_cv_header_stddef_h+set}" = set; then ++ { echo "$as_me:$LINENO: checking for stddef.h" >&5 ++echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_stddef_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 ++echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking stddef.h usability" >&5 ++echo $ECHO_N "checking stddef.h usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking stddef.h presence" >&5 ++echo $ECHO_N "checking stddef.h presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: stddef.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: stddef.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: stddef.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: stddef.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: stddef.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: stddef.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: stddef.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: stddef.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: stddef.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: stddef.h: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for stddef.h" >&5 ++echo $ECHO_N "checking for stddef.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_stddef_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_stddef_h=$ac_header_preproc ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_stddef_h" >&5 ++echo "${ECHO_T}$ac_cv_header_stddef_h" >&6; } ++ ++fi ++if test $ac_cv_header_stddef_h = yes; then ++ : ++else ++ cat >>confdefs.h <<\_ACEOF ++#define X_WCHAR 1 ++_ACEOF ++ ++fi ++ ++ ++ ++ ++ ++ ++ ++for ac_func in _getpty grantpt setitimer usleep ++do ++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_func" >&5 ++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } ++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case declares $ac_func. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $ac_func (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $ac_func ++ ++/* 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 $ac_func (); ++/* 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_$ac_func || defined __stub___$ac_func ++choke me ++#endif ++ ++int ++main () ++{ ++return $ac_func (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ eval "$as_ac_var=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_var=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_var'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_var'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++ ++ ++for ac_func in gettimeofday ftime ++do ++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_func" >&5 ++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } ++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case declares $ac_func. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $ac_func (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $ac_func ++ ++/* 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 $ac_func (); ++/* 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_$ac_func || defined __stub___$ac_func ++choke me ++#endif ++ ++int ++main () ++{ ++return $ac_func (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ eval "$as_ac_var=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_var=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_var'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_var'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++done ++ ++ ++ ++for ac_func in random rand48 ++do ++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_func" >&5 ++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } ++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case declares $ac_func. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $ac_func (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $ac_func ++ ++/* 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 $ac_func (); ++/* 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_$ac_func || defined __stub___$ac_func ++choke me ++#endif ++ ++int ++main () ++{ ++return $ac_func (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ eval "$as_ac_var=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_var=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_var'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_var'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++done ++ ++ ++ ++for ac_func in gethostname sysinfo ++do ++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` ++{ echo "$as_me:$LINENO: checking for $ac_func" >&5 ++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } ++if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define $ac_func to an innocuous variant, in case declares $ac_func. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $ac_func innocuous_$ac_func ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $ac_func (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $ac_func ++ ++/* 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 $ac_func (); ++/* 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_$ac_func || defined __stub___$ac_func ++choke me ++#endif ++ ++int ++main () ++{ ++return $ac_func (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ eval "$as_ac_var=yes" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ eval "$as_ac_var=no" ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ac_res=`eval echo '${'$as_ac_var'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++if test `eval echo '${'$as_ac_var'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++done ++ ++{ echo "$as_me:$LINENO: checking for setlocale" >&5 ++echo $ECHO_N "checking for setlocale... $ECHO_C" >&6; } ++if test "${ac_cv_func_setlocale+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define setlocale to an innocuous variant, in case declares setlocale. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define setlocale innocuous_setlocale ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char setlocale (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef setlocale ++ ++/* 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 setlocale (); ++/* 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_setlocale || defined __stub___setlocale ++choke me ++#endif ++ ++int ++main () ++{ ++return setlocale (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_setlocale=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_setlocale=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_setlocale" >&5 ++echo "${ECHO_T}$ac_cv_func_setlocale" >&6; } ++if test $ac_cv_func_setlocale = yes; then ++ : ++else ++ ++{ echo "$as_me:$LINENO: checking for setlocale in -li" >&5 ++echo $ECHO_N "checking for setlocale in -li... $ECHO_C" >&6; } ++if test "${ac_cv_lib_i_setlocale+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-li $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 setlocale (); ++int ++main () ++{ ++return setlocale (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_i_setlocale=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_i_setlocale=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_i_setlocale" >&5 ++echo "${ECHO_T}$ac_cv_lib_i_setlocale" >&6; } ++if test $ac_cv_lib_i_setlocale = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBI 1 ++_ACEOF ++ ++ LIBS="-li $LIBS" ++ ++else ++ cat >>confdefs.h <<\_ACEOF ++#define X_LOCALE 1 ++_ACEOF ++ ++fi ++ ++fi ++ ++ ++ ++{ echo "$as_me:$LINENO: checking for getpseudotty in -lseq" >&5 ++echo $ECHO_N "checking for getpseudotty in -lseq... $ECHO_C" >&6; } ++if test "${ac_cv_lib_seq_getpseudotty+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lseq $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 getpseudotty (); ++int ++main () ++{ ++return getpseudotty (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_seq_getpseudotty=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_seq_getpseudotty=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getpseudotty" >&5 ++echo "${ECHO_T}$ac_cv_lib_seq_getpseudotty" >&6; } ++if test $ac_cv_lib_seq_getpseudotty = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBSEQ 1 ++_ACEOF ++ ++ LIBS="-lseq $LIBS" ++ ++fi ++ ++ ++{ echo "$as_me:$LINENO: checking for X" >&5 ++echo $ECHO_N "checking for X... $ECHO_C" >&6; } ++ ++ ++# Check whether --with-x was given. ++if test "${with_x+set}" = set; then ++ withval=$with_x; ++fi ++ ++# $have_x is `yes', `no', `disabled', or empty when we do not yet know. ++if test "x$with_x" = xno; then ++ # The user explicitly disabled X. ++ have_x=disabled ++else ++ case $x_includes,$x_libraries in #( ++ *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 ++echo "$as_me: error: Cannot use X directory names containing '" >&2;} ++ { (exit 1); exit 1; }; };; #( ++ *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ # One or both of the vars are not set, and there is no cached value. ++ac_x_includes=no ac_x_libraries=no ++rm -f -r conftest.dir ++if mkdir conftest.dir; then ++ cd conftest.dir ++ cat >Imakefile <<'_ACEOF' ++incroot: ++ @echo incroot='${INCROOT}' ++usrlibdir: ++ @echo usrlibdir='${USRLIBDIR}' ++libdir: ++ @echo libdir='${LIBDIR}' ++_ACEOF ++ if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then ++ # GNU make sometimes prints "make[1]: Entering...", which would confuse us. ++ for ac_var in incroot usrlibdir libdir; do ++ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" ++ done ++ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. ++ for ac_extension in a so sl; do ++ if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && ++ test -f "$ac_im_libdir/libX11.$ac_extension"; then ++ ac_im_usrlibdir=$ac_im_libdir; break ++ fi ++ done ++ # Screen out bogus values from the imake configuration. They are ++ # bogus both because they are the default anyway, and because ++ # using them would break gcc on systems where it needs fixed includes. ++ case $ac_im_incroot in ++ /usr/include) ac_x_includes= ;; ++ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; ++ esac ++ case $ac_im_usrlibdir in ++ /usr/lib | /lib) ;; ++ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; ++ esac ++ fi ++ cd .. ++ rm -f -r conftest.dir ++fi ++ ++# Standard set of common directories for X headers. ++# Check X11 before X11Rn because it is often a symlink to the current release. ++ac_x_header_dirs=' ++/usr/X11/include ++/usr/X11R6/include ++/usr/X11R5/include ++/usr/X11R4/include ++ ++/usr/include/X11 ++/usr/include/X11R6 ++/usr/include/X11R5 ++/usr/include/X11R4 ++ ++/usr/local/X11/include ++/usr/local/X11R6/include ++/usr/local/X11R5/include ++/usr/local/X11R4/include ++ ++/usr/local/include/X11 ++/usr/local/include/X11R6 ++/usr/local/include/X11R5 ++/usr/local/include/X11R4 ++ ++/usr/X386/include ++/usr/x386/include ++/usr/XFree86/include/X11 ++ ++/usr/include ++/usr/local/include ++/usr/unsupported/include ++/usr/athena/include ++/usr/local/x11r5/include ++/usr/lpp/Xamples/include ++ ++/usr/openwin/include ++/usr/openwin/share/include' ++ ++if test "$ac_x_includes" = no; then ++ # Guess where to find include files, by looking for Xlib.h. ++ # First, try using that file with no special directory specified. ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ # We can compile using X headers with no special include directory. ++ac_x_includes= ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ for ac_dir in $ac_x_header_dirs; do ++ if test -r "$ac_dir/X11/Xlib.h"; then ++ ac_x_includes=$ac_dir ++ break ++ fi ++done ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++fi # $ac_x_includes = no ++ ++if test "$ac_x_libraries" = no; then ++ # Check for the libraries. ++ # See if we find them without any special options. ++ # Don't add to $LIBS permanently. ++ ac_save_LIBS=$LIBS ++ LIBS="-lX11 $LIBS" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++XrmInitialize () ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ LIBS=$ac_save_LIBS ++# We can link X programs with no special library path. ++ac_x_libraries= ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ LIBS=$ac_save_LIBS ++for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` ++do ++ # Don't even attempt the hair of trying to link an X program! ++ for ac_extension in a so sl; do ++ if test -r "$ac_dir/libX11.$ac_extension"; then ++ ac_x_libraries=$ac_dir ++ break 2 ++ fi ++ done ++done ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi # $ac_x_libraries = no ++ ++case $ac_x_includes,$ac_x_libraries in #( ++ no,* | *,no | *\'*) ++ # Didn't find X, or a directory has "'" in its name. ++ ac_cv_have_x="have_x=no";; #( ++ *) ++ # Record where we found X for the cache. ++ ac_cv_have_x="have_x=yes\ ++ ac_x_includes='$ac_x_includes'\ ++ ac_x_libraries='$ac_x_libraries'" ++esac ++fi ++;; #( ++ *) have_x=yes;; ++ esac ++ eval "$ac_cv_have_x" ++fi # $with_x != no ++ ++if test "$have_x" != yes; then ++ { echo "$as_me:$LINENO: result: $have_x" >&5 ++echo "${ECHO_T}$have_x" >&6; } ++ no_x=yes ++else ++ # If each of the values was on the command line, it overrides each guess. ++ test "x$x_includes" = xNONE && x_includes=$ac_x_includes ++ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries ++ # Update the cache value to reflect the command line values. ++ ac_cv_have_x="have_x=yes\ ++ ac_x_includes='$x_includes'\ ++ ac_x_libraries='$x_libraries'" ++ { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 ++echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } ++fi ++ ++if test "$no_x" = yes; then ++ # Not all programs may use this symbol, but it does not hurt to define it. ++ ++cat >>confdefs.h <<\_ACEOF ++#define X_DISPLAY_MISSING 1 ++_ACEOF ++ ++ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= ++else ++ if test -n "$x_includes"; then ++ X_CFLAGS="$X_CFLAGS -I$x_includes" ++ fi ++ ++ # It would also be nice to do this for all -L options, not just this one. ++ if test -n "$x_libraries"; then ++ X_LIBS="$X_LIBS -L$x_libraries" ++ # For Solaris; some versions of Sun CC require a space after -R and ++ # others require no space. Words are not sufficient . . . . ++ { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 ++echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ++ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ++ ac_xsave_c_werror_flag=$ac_c_werror_flag ++ ac_c_werror_flag=yes ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ { echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6; } ++ X_LIBS="$X_LIBS -R$x_libraries" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ LIBS="$ac_xsave_LIBS -R $x_libraries" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ { echo "$as_me:$LINENO: result: yes" >&5 ++echo "${ECHO_T}yes" >&6; } ++ X_LIBS="$X_LIBS -R $x_libraries" ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ { echo "$as_me:$LINENO: result: neither works" >&5 ++echo "${ECHO_T}neither works" >&6; } ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++ ac_c_werror_flag=$ac_xsave_c_werror_flag ++ LIBS=$ac_xsave_LIBS ++ fi ++ ++ # Check for system-dependent libraries X programs must link with. ++ # Do this before checking for the system-independent R6 libraries ++ # (-lICE), since we may need -lsocket or whatever for X linking. ++ ++ if test "$ISC" = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" ++ else ++ # Martyn Johnson says this is needed for Ultrix, if the X ++ # libraries were built with DECnet support. And Karl Berry says ++ # the Alpha needs dnet_stub (dnet does not exist). ++ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 XOpenDisplay (); ++int ++main () ++{ ++return XOpenDisplay (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ : ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 ++echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } ++if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-ldnet $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 dnet_ntoa (); ++int ++main () ++{ ++return dnet_ntoa (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_dnet_dnet_ntoa=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_dnet_dnet_ntoa=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 ++echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } ++if test $ac_cv_lib_dnet_dnet_ntoa = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" ++fi ++ ++ if test $ac_cv_lib_dnet_dnet_ntoa = no; then ++ { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 ++echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } ++if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-ldnet_stub $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 dnet_ntoa (); ++int ++main () ++{ ++return dnet_ntoa (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_dnet_stub_dnet_ntoa=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_dnet_stub_dnet_ntoa=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 ++echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } ++if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" ++fi ++ ++ fi ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++ LIBS="$ac_xsave_LIBS" ++ ++ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, ++ # to get the SysV transport functions. ++ # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) ++ # needs -lnsl. ++ # The nsl library prevents programs from opening the X display ++ # on Irix 5.2, according to T.E. Dickey. ++ # The functions gethostbyname, getservbyname, and inet_addr are ++ # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ++ { echo "$as_me:$LINENO: checking for gethostbyname" >&5 ++echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } ++if test "${ac_cv_func_gethostbyname+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define gethostbyname innocuous_gethostbyname ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char gethostbyname (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef gethostbyname ++ ++/* 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 gethostbyname (); ++/* 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_gethostbyname || defined __stub___gethostbyname ++choke me ++#endif ++ ++int ++main () ++{ ++return gethostbyname (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_gethostbyname=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_gethostbyname=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 ++echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } ++ ++ if test $ac_cv_func_gethostbyname = no; then ++ { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 ++echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } ++if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lnsl $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 gethostbyname (); ++int ++main () ++{ ++return gethostbyname (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_nsl_gethostbyname=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_nsl_gethostbyname=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 ++echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } ++if test $ac_cv_lib_nsl_gethostbyname = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" ++fi ++ ++ if test $ac_cv_lib_nsl_gethostbyname = no; then ++ { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 ++echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } ++if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lbsd $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 gethostbyname (); ++int ++main () ++{ ++return gethostbyname (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_bsd_gethostbyname=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_bsd_gethostbyname=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 ++echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } ++if test $ac_cv_lib_bsd_gethostbyname = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" ++fi ++ ++ fi ++ fi ++ ++ # lieder@skyler.mavd.honeywell.com says without -lsocket, ++ # socket/setsockopt and other routines are undefined under SCO ODT ++ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary ++ # on later versions), says Simon Leinen: it contains gethostby* ++ # variants that don't use the name server (or something). -lsocket ++ # must be given before -lnsl if both are needed. We assume that ++ # if connect needs -lnsl, so does gethostbyname. ++ { echo "$as_me:$LINENO: checking for connect" >&5 ++echo $ECHO_N "checking for connect... $ECHO_C" >&6; } ++if test "${ac_cv_func_connect+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define connect to an innocuous variant, in case declares connect. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define connect innocuous_connect ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char connect (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef connect ++ ++/* 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 connect (); ++/* 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_connect || defined __stub___connect ++choke me ++#endif ++ ++int ++main () ++{ ++return connect (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_connect=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_connect=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 ++echo "${ECHO_T}$ac_cv_func_connect" >&6; } ++ ++ if test $ac_cv_func_connect = no; then ++ { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 ++echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } ++if test "${ac_cv_lib_socket_connect+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lsocket $X_EXTRA_LIBS $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 connect (); ++int ++main () ++{ ++return connect (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_socket_connect=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_socket_connect=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 ++echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } ++if test $ac_cv_lib_socket_connect = yes; then ++ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" ++fi ++ ++ fi ++ ++ # Guillermo Gomez says -lposix is necessary on A/UX. ++ { echo "$as_me:$LINENO: checking for remove" >&5 ++echo $ECHO_N "checking for remove... $ECHO_C" >&6; } ++if test "${ac_cv_func_remove+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define remove to an innocuous variant, in case declares remove. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define remove innocuous_remove ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char remove (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef remove ++ ++/* 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 remove (); ++/* 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_remove || defined __stub___remove ++choke me ++#endif ++ ++int ++main () ++{ ++return remove (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_remove=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_remove=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 ++echo "${ECHO_T}$ac_cv_func_remove" >&6; } ++ ++ if test $ac_cv_func_remove = no; then ++ { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 ++echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } ++if test "${ac_cv_lib_posix_remove+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lposix $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 remove (); ++int ++main () ++{ ++return remove (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_posix_remove=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_posix_remove=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 ++echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } ++if test $ac_cv_lib_posix_remove = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" ++fi ++ ++ fi ++ ++ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ++ { echo "$as_me:$LINENO: checking for shmat" >&5 ++echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } ++if test "${ac_cv_func_shmat+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++/* Define shmat to an innocuous variant, in case declares shmat. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define shmat innocuous_shmat ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char shmat (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef shmat ++ ++/* 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 shmat (); ++/* 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_shmat || defined __stub___shmat ++choke me ++#endif ++ ++int ++main () ++{ ++return shmat (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_func_shmat=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_func_shmat=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 ++echo "${ECHO_T}$ac_cv_func_shmat" >&6; } ++ ++ if test $ac_cv_func_shmat = no; then ++ { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 ++echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } ++if test "${ac_cv_lib_ipc_shmat+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lipc $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 shmat (); ++int ++main () ++{ ++return shmat (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_ipc_shmat=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_ipc_shmat=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 ++echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } ++if test $ac_cv_lib_ipc_shmat = yes; then ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" ++fi ++ ++ fi ++ fi ++ ++ # Check for libraries that X11R6 Xt/Xaw programs need. ++ ac_save_LDFLAGS=$LDFLAGS ++ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" ++ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to ++ # check for ICE first), but we must link in the order -lSM -lICE or ++ # we get undefined symbols. So assume we have SM if we have ICE. ++ # These have to be linked with before -lX11, unlike the other ++ # libraries we check for below, so use a different variable. ++ # John Interrante, Karl Berry ++ { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 ++echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } ++if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lICE $X_EXTRA_LIBS $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 IceConnectionNumber (); ++int ++main () ++{ ++return IceConnectionNumber (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_ICE_IceConnectionNumber=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_ICE_IceConnectionNumber=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 ++echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } ++if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then ++ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" ++fi ++ ++ LDFLAGS=$ac_save_LDFLAGS ++ ++fi ++ ++if test -n "$no_x" ; then ++ echo $PRODUCT requires the X Window System header files and libraries! ++ echo They were not found on your system. See FAQ topic C.2. ++ echo configure failed ++ exit 1 ++fi ++ ++if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then ++ { echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 ++echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking X11/Intrinsic.h usability" >&5 ++echo $ECHO_N "checking X11/Intrinsic.h usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking X11/Intrinsic.h presence" >&5 ++echo $ECHO_N "checking X11/Intrinsic.h presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: X11/Intrinsic.h: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for X11/Intrinsic.h" >&5 ++echo $ECHO_N "checking for X11/Intrinsic.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Intrinsic_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_X11_Intrinsic_h=$ac_header_preproc ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Intrinsic_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Intrinsic_h" >&6; } ++ ++fi ++if test $ac_cv_header_X11_Intrinsic_h = yes; then ++ xt="yes" ++else ++ xt="no" ++fi ++ ++ ++ ++if test "$xt" == "no" ; then ++ echo Xt headers not found ++ exit 1 ++fi ++ ++ ++# Check whether --with-Xaw3d was given. ++if test "${with_Xaw3d+set}" = set; then ++ withval=$with_Xaw3d; with_xaw3d="yes" ++else ++ with_xaw3d="no" ++fi ++ ++ ++ ++xaw_headers="no" ++if test "$with_xaw3d" == "yes" ; then ++ XAW_LIBS="-lXaw3d" ++ { echo "$as_me:$LINENO: checking for XawTextReplace in -lXaw3d" >&5 ++echo $ECHO_N "checking for XawTextReplace in -lXaw3d... $ECHO_C" >&6; } ++if test "${ac_cv_lib_Xaw3d_XawTextReplace+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lXaw3d $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 XawTextReplace (); ++int ++main () ++{ ++return XawTextReplace (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_Xaw3d_XawTextReplace=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_Xaw3d_XawTextReplace=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawTextReplace" >&5 ++echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawTextReplace" >&6; } ++if test $ac_cv_lib_Xaw3d_XawTextReplace = yes; then ++ xaw3d_lib="yes" ++else ++ xaw3d_lib="no" ++fi ++ ++ if test "$xaw3d_lib" == "no" ; then ++ echo Xaw3d libraries not found ++ exit 1 ++ else ++ if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then ++ { echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h usability" >&5 ++echo $ECHO_N "checking X11/Xaw3d/Dialog.h usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking X11/Xaw3d/Dialog.h presence" >&5 ++echo $ECHO_N "checking X11/Xaw3d/Dialog.h presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: X11/Xaw3d/Dialog.h: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for X11/Xaw3d/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw3d/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw3d_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_X11_Xaw3d_Dialog_h=$ac_header_preproc ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Dialog_h" >&6; } ++ ++fi ++if test $ac_cv_header_X11_Xaw3d_Dialog_h = yes; then ++ xaw3d_headers="yes" ++else ++ xaw3d_headers="no" ++fi ++ ++ ++ if test "$xaw3d_headers" == "yes" ; then ++ cat >>confdefs.h <<\_ACEOF ++#define USE_XAW3D 1 ++_ACEOF ++ ++ xaw_headers="yes" ++ else ++ if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 ++echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 ++echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } ++ ++fi ++if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then ++ xaw_headers="yes" ++fi ++ ++ ++ fi ++ fi ++else ++ XAW_LIBS="-lXaw" ++ if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ { echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h usability" >&5 ++echo $ECHO_N "checking X11/Xaw/Dialog.h usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking X11/Xaw/Dialog.h presence" >&5 ++echo $ECHO_N "checking X11/Xaw/Dialog.h presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: X11/Xaw/Dialog.h: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for X11/Xaw/Dialog.h" >&5 ++echo $ECHO_N "checking for X11/Xaw/Dialog.h... $ECHO_C" >&6; } ++if test "${ac_cv_header_X11_Xaw_Dialog_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_X11_Xaw_Dialog_h=$ac_header_preproc ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw_Dialog_h" >&5 ++echo "${ECHO_T}$ac_cv_header_X11_Xaw_Dialog_h" >&6; } ++ ++fi ++if test $ac_cv_header_X11_Xaw_Dialog_h = yes; then ++ xaw_headers="yes" ++fi ++ ++ ++fi ++ ++ ++ ++ ++ ++if test "$xaw_headers" == "no" ; then ++ echo Xaw headers not found ++ exit 1 ++ ++fi ++ ++ ++ ++ ++# Make sure we can run config.sub. ++$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || ++ { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 ++echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} ++ { (exit 1); exit 1; }; } ++ ++{ echo "$as_me:$LINENO: checking build system type" >&5 ++echo $ECHO_N "checking build system type... $ECHO_C" >&6; } ++if test "${ac_cv_build+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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 && ++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 ++echo "$as_me: error: cannot guess build type; you must specify one" >&2;} ++ { (exit 1); exit 1; }; } ++ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || ++ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 ++echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} ++ { (exit 1); exit 1; }; } ++ ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 ++echo "${ECHO_T}$ac_cv_build" >&6; } ++case $ac_cv_build in ++*-*-*) ;; ++*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 ++echo "$as_me: error: invalid value of canonical build" >&2;} ++ { (exit 1); exit 1; }; };; ++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 ++ ++ ++{ echo "$as_me:$LINENO: checking host system type" >&5 ++echo $ECHO_N "checking host system type... $ECHO_C" >&6; } ++if test "${ac_cv_host+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&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` || ++ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 ++echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 ++echo "${ECHO_T}$ac_cv_host" >&6; } ++case $ac_cv_host in ++*-*-*) ;; ++*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 ++echo "$as_me: error: invalid value of canonical host" >&2;} ++ { (exit 1); exit 1; }; };; ++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 ++ ++ ++ ++ ++ ++USE_PTYS=0 ++case "$host" in ++ *-*-hpux* ) ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty/tty%c%x", c, i); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptym/pty%c%x", c, i); ++_ACEOF ++ ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ else ++ ++ ++ CONF_CFLAGS="-Aa -D_HPUX_SOURCE" ++ fi ++ ++ ++ if test -d /opt/hppd/include/X11; then ++ X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" ++ X_LIBS="$X_LIBS -L/opt/hppd/lib" ++ elif test -d /usr/contrib/X11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" ++ X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" ++ elif test -d /usr/contrib/mitX11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" ++ X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" ++ elif test -d /MIT/X11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" ++ X_LIBS="$X_LIBS -L/MIT/X11R5/lib" ++ elif test -d /usr/local/include/X11R5; then ++ X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" ++ X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" ++ fi ++ if test -d /usr/include/X11R5; then ++ X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" ++ X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" ++ elif test -d /usr/include/X11R4; then ++ X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" ++ X_LIBS="$X_LIBS -L/usr/lib/X11R4" ++ fi ++ ;; ++ ++ romp-ibm-aix* ) ++ cat >>confdefs.h <<\_ACEOF ++#define IBMRTAIX 1 ++_ACEOF ++ ++ ;; ++ ++ i386-ibm-aix ) ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ fi ++ ;; ++ ++ *-*-aix3* | *-*-bosx* ) ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_ITERATION for (c = 0; !c; c++) ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); ++_ACEOF ++ ++ ;; ++ ++ *-*-cxux* ) ++ cat >>confdefs.h <<\_ACEOF ++#define FIRST_PTY_LETTER 'A' ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define LAST_PTY_LETTER 'P' ++_ACEOF ++ ++ ;; ++ ++ *-*-uniplus* ) ++ cat >>confdefs.h <<\_ACEOF ++#define UNIPLUS 1 ++_ACEOF ++ ++ ;; ++ ++ *-*-rtu* ) ++ cat >>confdefs.h <<\_ACEOF ++#define FIRST_PTY_LETTER 'z' ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%x", i); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/pty%x", i); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define RTU 1 ++_ACEOF ++ ++ ;; ++ ++ *-*-iris* | *-*-irix3* ) ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_ITERATION for (c = 0; !c; c++) ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev)); ++_ACEOF ++ ++ ;; ++ ++ *-*-irix* ) ++ ;; ++ ++ *-*-sunos4* | *-*-solaris1* ) ++ ++ ++ if test "$GCC" = yes; then ++ PRE_XMULIB="-static" ++ POST_XMULIB="-dynamic" ++ else ++ PRE_XMULIB="-Bstatic" ++ POST_XMULIB="-Bdynamic" ++ fi ++ ;; ++ ++ *-*-sunos5* | *-*-solaris2* ) ++ ++ ++ X_LIBS="$X_LIBS -lelf" ++ ;; ++ ++ *-*-sco* ) ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_ITERATION for (i = 0; ; i++) ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_NAME_SPRINTF sprintf (pty_name, "/dev/ptyp%d", i); ++_ACEOF ++ ++ cat >>confdefs.h <<\_ACEOF ++#define PTY_TTY_NAME_SPRINTF sprintf (pty_name, "/dev/ttyp%d", i); ++_ACEOF ++ ++ ;; ++ ++ *-*-dynix* | *-*-ptx* ) ++ ;; ++ ++ *-*-esix* ) ++ ;; ++ ++ *-*-usg5-4* | *-*-sysvr4* ) ++ ;; ++ ++ *-*-usg* | *-*-sysv* | *-*-aix* ) ++ ;; ++ ++ vax-*-ultrix ) ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ fi ++ ;; ++esac ++ ++# Check whether --enable-xpm was given. ++if test "${enable_xpm+set}" = set; then ++ enableval=$enable_xpm; enable_xpm="$enableval" ++else ++ enable_xpm="yes" ++fi ++ ++ ++if test "$enable_xpm" = "yes"; then ++ save_cflags="$CFLAGS" ++ CFLAGS="$CFLAGS $X_CFLAGS" ++ CPPFLAGS="$CPPFLAGS $X_CFLAGS" ++ ++for ac_header in X11/xpm.h ++do ++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ { echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 ++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <$ac_header> ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_compile") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_compiler=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 ++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <$ac_header> ++_ACEOF ++if { (ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++ ++rm -f conftest.err conftest.$ac_ext ++{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ++ ++ ;; ++esac ++{ echo "$as_me:$LINENO: checking for $ac_header" >&5 ++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ eval "$as_ac_Header=\$ac_header_preproc" ++fi ++ac_res=`eval echo '${'$as_ac_Header'}'` ++ { echo "$as_me:$LINENO: result: $ac_res" >&5 ++echo "${ECHO_T}$ac_res" >&6; } ++ ++fi ++if test `eval echo '${'$as_ac_Header'}'` = yes; then ++ cat >>confdefs.h <<_ACEOF ++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ CFLAGS="$save_cflags" ++ if test "$ac_cv_header_X11_xpm_h" = "yes"; then ++ save_ldflags="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $X_LIBS" ++ { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 ++echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } ++if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lXpm $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* 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 XpmReadFileToPixmap (); ++int ++main () ++{ ++return XpmReadFileToPixmap (); ++ ; ++ return 0; ++} ++_ACEOF ++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ++ (eval "$ac_link") 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && ++ $as_test_x conftest$ac_exeext; then ++ ac_cv_lib_Xpm_XpmReadFileToPixmap=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_cv_lib_Xpm_XpmReadFileToPixmap=no ++fi ++ ++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 ++echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } ++if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then ++ X_PRE_LIBS="-lXpm $X_PRE_LIBS"; cat >>confdefs.h <<\_ACEOF ++#define HAVE_LIBXPM 1 ++_ACEOF ++ ++fi ++ ++ LDFLAGS="$save_ldflags" ++ fi ++fi ++ ++ ++ ++ ++ ++ ++{ echo "$as_me:$LINENO: checking whether ptys or pipes should be used" >&5 ++echo $ECHO_N "checking whether ptys or pipes should be used... $ECHO_C" >&6; } ++# Check whether --enable-ptys was given. ++if test "${enable_ptys+set}" = set; then ++ enableval=$enable_ptys; if test "$enableval" = yes; then ++ USE_PTYS=1 ++ { echo "$as_me:$LINENO: result: ptys (user override)" >&5 ++echo "${ECHO_T}ptys (user override)" >&6; } ++fi ++if test "$enableval" = no; then ++ USE_PTYS=0 ++ { echo "$as_me:$LINENO: result: pipes (user override)" >&5 ++echo "${ECHO_T}pipes (user override)" >&6; } ++fi ++else ++ if test "$USE_PTYS" = 1; then ++ { echo "$as_me:$LINENO: result: ptys" >&5 ++echo "${ECHO_T}ptys" >&6; } ++else ++ { echo "$as_me:$LINENO: result: pipes" >&5 ++echo "${ECHO_T}pipes" >&6; } ++fi ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define USE_PTYS $USE_PTYS ++_ACEOF ++ ++ ++# Check whether --enable-zippy was given. ++if test "${enable_zippy+set}" = set; then ++ enableval=$enable_zippy; enable_zippy="$enableval" ++else ++ enable_zippy="yes" ++fi ++ ++if test "$enable_zippy" = yes; then ++ cat >>confdefs.h <<\_ACEOF ++#define ZIPPY 1 ++_ACEOF ++ ++ ZIPPY_O=zippy.o ++ ZIPPY_H=zippy.h ++fi ++ ++ ++ ++# Check whether --enable-sigint was given. ++if test "${enable_sigint+set}" = set; then ++ enableval=$enable_sigint; if test "$enableval" = yes; then ++ cat >>confdefs.h <<\_ACEOF ++#define ATTENTION 1 ++_ACEOF ++ ++fi ++else ++ cat >>confdefs.h <<\_ACEOF ++#define ATTENTION 1 ++_ACEOF ++ ++fi ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define PRODUCT "$PRODUCT" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define VERSION "$VERSION" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PATCHLEVEL "$PATCHLEVEL" ++_ACEOF ++ ++ ++ ++ ++ ++ac_config_files="$ac_config_files cmail xboard.texinfo" ++ ++ac_config_commands="$ac_config_commands default" ++ ++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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 ++echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; ++ esac ++ case $ac_var in #( ++ _ | IFS | as_nl) ;; #( ++ *) $as_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 ++ test "x$cache_file" != "x/dev/null" && ++ { echo "$as_me:$LINENO: updating cache $cache_file" >&5 ++echo "$as_me: updating cache $cache_file" >&6;} ++ cat confcache >$cache_file ++ else ++ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 ++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= ++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=`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. ++ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ++ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' ++done ++LIBOBJS=$ac_libobjs ++ ++LTLIBOBJS=$ac_ltlibobjs ++ ++ ++if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"AMDEP\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then ++ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&5 ++echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. ++Usually this means the macro was only invoked conditionally." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++: ${CONFIG_STATUS=./config.status} ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files $CONFIG_STATUS" ++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 ++echo "$as_me: creating $CONFIG_STATUS" >&6;} ++cat >$CONFIG_STATUS <<_ACEOF ++#! $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} ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++## --------------------- ## ++## 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=: ++ # Zsh 3.x and 4.x performs 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 ++ ++ ++ ++ ++# PATH needs CR ++# 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 ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ echo "#! /bin/sh" >conf$$.sh ++ echo "exit 0" >>conf$$.sh ++ chmod +x conf$$.sh ++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then ++ PATH_SEPARATOR=';' ++ else ++ PATH_SEPARATOR=: ++ fi ++ rm -f conf$$.sh ++fi ++ ++# Support unset when possible. ++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++ as_unset=unset ++else ++ as_unset=false ++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.) ++as_nl=' ++' ++IFS=" "" $as_nl" ++ ++# Find who we are. Look in the path if we contain no directory separator. ++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 ++ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ { (exit 1); exit 1; } ++fi ++ ++# Work around bugs in pre-3.0 UWIN ksh. ++for as_var in ENV MAIL MAILPATH ++do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++done ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var ++ fi ++done ++ ++# Required to use basename. ++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 ++ ++ ++# Name of the executable. ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ ++# CDPATH. ++$as_unset CDPATH ++ ++ ++ ++ as_lineno_1=$LINENO ++ as_lineno_2=$LINENO ++ test "x$as_lineno_1" != "x$as_lineno_2" && ++ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { ++ ++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO ++ # uniformly replaced by the line number. The first 'sed' inserts a ++ # line-number line after each line using $LINENO; the second 'sed' ++ # does the real work. The second script uses 'N' to pair each ++ # line-number line with the line containing $LINENO, and appends ++ # trailing '-' during substitution so that $LINENO is not a special ++ # case at line end. ++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the ++ # scripts with optimization help from Paolo Bonzini. 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" || ++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 ++ { (exit 1); exit 1; }; } ++ ++ # 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 ++} ++ ++ ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi ++ ++ECHO_C= ECHO_N= ECHO_T= ++case `echo -n x` in ++-n*) ++ case `echo 'x\c'` in ++ *c*) ECHO_T=' ';; # ECHO_T is single tab character. ++ *) ECHO_C='\c';; ++ esac;; ++*) ++ ECHO_N='-n';; ++esac ++ ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++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 ++fi ++echo >conf$$.file ++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 -p'. ++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || ++ as_ln_s='cp -p' ++elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++else ++ as_ln_s='cp -p' ++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=: ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x ++ ++# 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 ++ ++# 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 xboard $as_me 4.3, which was ++generated by GNU Autoconf 2.61. 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 ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++# 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_cs_usage="\ ++\`$as_me' instantiates files from templates according to the ++current configuration. ++ ++Usage: $0 [OPTIONS] [FILE]... ++ ++ -h, --help print this help, then exit ++ -V, --version print version number and configuration settings, then exit ++ -q, --quiet 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 ." ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ac_cs_version="\\ ++xboard config.status 4.3 ++configured by $0, generated by GNU Autoconf 2.61, ++ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" ++ ++Copyright (C) 2006 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' ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++# If no file are specified by the user, then we need to provide default ++# value. By we need to know if files were specified by the user. ++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=$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 ) ++ echo "$ac_cs_version"; exit ;; ++ --debug | --debu | --deb | --de | --d | -d ) ++ debug=: ;; ++ --file | --fil | --fi | --f ) ++ $ac_shift ++ CONFIG_FILES="$CONFIG_FILES $ac_optarg" ++ ac_need_defaults=false;; ++ --header | --heade | --head | --hea ) ++ $ac_shift ++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ++ ac_need_defaults=false;; ++ --he | --h) ++ # Conflict between --help and --header ++ { echo "$as_me: error: ambiguous option: $1 ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; };; ++ --help | --hel | -h ) ++ 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. ++ -*) { echo "$as_me: error: unrecognized option: $1 ++Try \`$0 --help' for more information." >&2 ++ { (exit 1); exit 1; }; } ;; ++ ++ *) ac_config_targets="$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 ++if \$ac_cs_recheck; then ++ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 ++ CONFIG_SHELL=$SHELL ++ export CONFIG_SHELL ++ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++exec 5>>config.log ++{ ++ echo ++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ++## Running $as_me. ## ++_ASBOX ++ echo "$ac_log" ++} >&5 ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++# ++# INIT-COMMANDS ++# ++AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" ++ ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++ ++# Handling of arguments. ++for ac_config_target in $ac_config_targets ++do ++ case $ac_config_target in ++ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; ++ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; ++ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; ++ "cmail") CONFIG_FILES="$CONFIG_FILES cmail" ;; ++ "xboard.texinfo") CONFIG_FILES="$CONFIG_FILES xboard.texinfo" ;; ++ "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; ++ ++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 ++echo "$as_me: error: invalid argument: $ac_config_target" >&2;} ++ { (exit 1); exit 1; }; };; ++ 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= ++ trap 'exit_status=$? ++ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ++' 0 ++ trap '{ (exit 1); exit 1; }' 1 2 13 15 ++} ++# Create a (secure) tmp directory for tmp files. ++ ++{ ++ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && ++ test -n "$tmp" && test -d "$tmp" ++} || ++{ ++ tmp=./conf$$-$RANDOM ++ (umask 077 && mkdir "$tmp") ++} || ++{ ++ echo "$me: cannot create a temporary directory in ." >&2 ++ { (exit 1); exit 1; } ++} ++ ++# ++# Set up the sed scripts for CONFIG_FILES section. ++# ++ ++# No need to generate the scripts if there are no CONFIG_FILES. ++# This happens for instance when ./config.status config.h ++if test -n "$CONFIG_FILES"; then ++ ++_ACEOF ++ ++ ++ ++ac_delim='%!_!# ' ++for ac_last_try in false false false false false :; do ++ cat >conf$$subs.sed <<_ACEOF ++SHELL!$SHELL$ac_delim ++PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim ++PACKAGE_NAME!$PACKAGE_NAME$ac_delim ++PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim ++PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim ++PACKAGE_STRING!$PACKAGE_STRING$ac_delim ++PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim ++exec_prefix!$exec_prefix$ac_delim ++prefix!$prefix$ac_delim ++program_transform_name!$program_transform_name$ac_delim ++bindir!$bindir$ac_delim ++sbindir!$sbindir$ac_delim ++libexecdir!$libexecdir$ac_delim ++datarootdir!$datarootdir$ac_delim ++datadir!$datadir$ac_delim ++sysconfdir!$sysconfdir$ac_delim ++sharedstatedir!$sharedstatedir$ac_delim ++localstatedir!$localstatedir$ac_delim ++includedir!$includedir$ac_delim ++oldincludedir!$oldincludedir$ac_delim ++docdir!$docdir$ac_delim ++infodir!$infodir$ac_delim ++htmldir!$htmldir$ac_delim ++dvidir!$dvidir$ac_delim ++pdfdir!$pdfdir$ac_delim ++psdir!$psdir$ac_delim ++libdir!$libdir$ac_delim ++localedir!$localedir$ac_delim ++mandir!$mandir$ac_delim ++DEFS!$DEFS$ac_delim ++ECHO_C!$ECHO_C$ac_delim ++ECHO_N!$ECHO_N$ac_delim ++ECHO_T!$ECHO_T$ac_delim ++LIBS!$LIBS$ac_delim ++build_alias!$build_alias$ac_delim ++host_alias!$host_alias$ac_delim ++target_alias!$target_alias$ac_delim ++INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim ++INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim ++INSTALL_DATA!$INSTALL_DATA$ac_delim ++am__isrc!$am__isrc$ac_delim ++CYGPATH_W!$CYGPATH_W$ac_delim ++PACKAGE!$PACKAGE$ac_delim ++VERSION!$VERSION$ac_delim ++ACLOCAL!$ACLOCAL$ac_delim ++AUTOCONF!$AUTOCONF$ac_delim ++AUTOMAKE!$AUTOMAKE$ac_delim ++AUTOHEADER!$AUTOHEADER$ac_delim ++MAKEINFO!$MAKEINFO$ac_delim ++install_sh!$install_sh$ac_delim ++STRIP!$STRIP$ac_delim ++INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim ++mkdir_p!$mkdir_p$ac_delim ++AWK!$AWK$ac_delim ++SET_MAKE!$SET_MAKE$ac_delim ++am__leading_dot!$am__leading_dot$ac_delim ++AMTAR!$AMTAR$ac_delim ++am__tar!$am__tar$ac_delim ++am__untar!$am__untar$ac_delim ++CC!$CC$ac_delim ++CFLAGS!$CFLAGS$ac_delim ++LDFLAGS!$LDFLAGS$ac_delim ++CPPFLAGS!$CPPFLAGS$ac_delim ++ac_ct_CC!$ac_ct_CC$ac_delim ++EXEEXT!$EXEEXT$ac_delim ++OBJEXT!$OBJEXT$ac_delim ++DEPDIR!$DEPDIR$ac_delim ++am__include!$am__include$ac_delim ++am__quote!$am__quote$ac_delim ++AMDEP_TRUE!$AMDEP_TRUE$ac_delim ++AMDEP_FALSE!$AMDEP_FALSE$ac_delim ++AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim ++CCDEPMODE!$CCDEPMODE$ac_delim ++am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim ++am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim ++LIBOBJS!$LIBOBJS$ac_delim ++LTLIBOBJS!$LTLIBOBJS$ac_delim ++CPP!$CPP$ac_delim ++LEX!$LEX$ac_delim ++LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim ++LEXLIB!$LEXLIB$ac_delim ++RSH!$RSH$ac_delim ++MINFO!$MINFO$ac_delim ++NROFF!$NROFF$ac_delim ++NROFFFLAGS!$NROFFFLAGS$ac_delim ++AWKPATH!$AWKPATH$ac_delim ++PERLPATH!$PERLPATH$ac_delim ++GREP!$GREP$ac_delim ++EGREP!$EGREP$ac_delim ++XMKMF!$XMKMF$ac_delim ++X_CFLAGS!$X_CFLAGS$ac_delim ++X_PRE_LIBS!$X_PRE_LIBS$ac_delim ++X_LIBS!$X_LIBS$ac_delim ++X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim ++XAW_LIBS!$XAW_LIBS$ac_delim ++build!$build$ac_delim ++build_cpu!$build_cpu$ac_delim ++_ACEOF ++ ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then ++ break ++ elif $ac_last_try; then ++ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 ++echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} ++ { (exit 1); exit 1; }; } ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++ ++ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` ++if test -n "$ac_eof"; then ++ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ++ ac_eof=`expr $ac_eof + 1` ++fi ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b ++_ACEOF ++sed ' ++s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g ++s/^/s,@/; s/!/@,|#_!!_#|/ ++:n ++t n ++s/'"$ac_delim"'$/,g/; t ++s/$/\\/; p ++N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ++' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF ++CEOF$ac_eof ++_ACEOF ++ ++ ++ac_delim='%!_!# ' ++for ac_last_try in false false false false false :; do ++ cat >conf$$subs.sed <<_ACEOF ++build_vendor!$build_vendor$ac_delim ++build_os!$build_os$ac_delim ++host!$host$ac_delim ++host_cpu!$host_cpu$ac_delim ++host_vendor!$host_vendor$ac_delim ++host_os!$host_os$ac_delim ++PRE_XMULIB!$PRE_XMULIB$ac_delim ++POST_XMULIB!$POST_XMULIB$ac_delim ++CONF_CFLAGS!$CONF_CFLAGS$ac_delim ++CONF_LDFLAGS!$CONF_LDFLAGS$ac_delim ++ZIPPY_O!$ZIPPY_O$ac_delim ++ZIPPY_H!$ZIPPY_H$ac_delim ++PRODUCT!$PRODUCT$ac_delim ++PATCHLEVEL!$PATCHLEVEL$ac_delim ++_ACEOF ++ ++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then ++ break ++ elif $ac_last_try; then ++ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 ++echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} ++ { (exit 1); exit 1; }; } ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++ ++ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` ++if test -n "$ac_eof"; then ++ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ++ ac_eof=`expr $ac_eof + 1` ++fi ++ ++cat >>$CONFIG_STATUS <<_ACEOF ++cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end ++_ACEOF ++sed ' ++s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g ++s/^/s,@/; s/!/@,|#_!!_#|/ ++:n ++t n ++s/'"$ac_delim"'$/,g/; t ++s/$/\\/; p ++N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ++' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF ++:end ++s/|#_!!_#|//g ++CEOF$ac_eof ++_ACEOF ++ ++ ++# VPATH may cause trouble with some makes, so we remove $(srcdir), ++# ${srcdir} and @srcdir@ 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[ ]*=/{ ++s/:*\$(srcdir):*/:/ ++s/:*\${srcdir}:*/:/ ++s/:*@srcdir@:*/:/ ++s/^\([^=]*=[ ]*\):*/\1/ ++s/:*$// ++s/^[^=]*=[ ]*$// ++}' ++fi ++ ++cat >>$CONFIG_STATUS <<\_ACEOF ++fi # test -n "$CONFIG_FILES" ++ ++ ++for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS ++do ++ case $ac_tag in ++ :[FHLC]) ac_mode=$ac_tag; continue;; ++ esac ++ case $ac_mode$ac_tag in ++ :[FHL]*:*);; ++ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 ++echo "$as_me: error: Invalid tag $ac_tag." >&2;} ++ { (exit 1); exit 1; }; };; ++ :[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="$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 || ++ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 ++echo "$as_me: error: cannot find input file: $ac_f" >&2;} ++ { (exit 1); exit 1; }; };; ++ esac ++ ac_file_inputs="$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 "`IFS=: ++ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." ++ if test x"$ac_file" != x-; then ++ configure_input="$ac_file. $configure_input" ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ fi ++ ++ case $ac_tag in ++ *:-:* | *:-) cat >"$tmp/stdin";; ++ 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 || ++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" ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`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 || ++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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 ++echo "$as_me: error: cannot create directory $as_dir" >&2;} ++ { (exit 1); exit 1; }; }; } ++ ac_builddir=. ++ ++case "$ac_dir" in ++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; ++*) ++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` ++ # A ".." for each directory in $ac_dir_suffix. ++ ac_top_builddir_sub=`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 ++# 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= ++ ++case `sed -n '/datarootdir/ { ++ p ++ q ++} ++/@datadir@/p ++/@docdir@/p ++/@infodir@/p ++/@localedir@/p ++/@mandir@/p ++' $ac_file_inputs` in ++*datarootdir*) ac_datarootdir_seen=yes;; ++*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) ++ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 ++echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF ++ 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 ++ sed "$ac_vpsub ++$extrasub ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF ++:t ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b ++s&@configure_input@&$configure_input&;t t ++s&@top_builddir@&$ac_top_builddir_sub&;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 ++" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out ++ ++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && ++ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && ++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && ++ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++which seems to be undefined. Please make sure it is defined." >&5 ++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 "$tmp/stdin" ++ case $ac_file in ++ -) cat "$tmp/out"; rm -f "$tmp/out";; ++ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; ++ esac ++ ;; ++ :H) ++ # ++ # CONFIG_HEADER ++ # ++_ACEOF ++ ++# Transform confdefs.h into a sed script `conftest.defines', that ++# substitutes the proper values into config.h.in to produce config.h. ++rm -f conftest.defines conftest.tail ++# First, append a space to every undef/define line, to ease matching. ++echo 's/$/ /' >conftest.defines ++# Then, protect against being on the right side of a sed subst, or in ++# an unquoted here document, in config.status. If some macros were ++# called several times there might be several #defines for the same ++# symbol, which is useless. But do not sort them, since the last ++# AC_DEFINE must be honored. ++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* ++# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where ++# NAME is the cpp macro being defined, VALUE is the value it is being given. ++# PARAMS is the parameter list in the macro definition--in most cases, it's ++# just an empty string. ++ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ++ac_dB='\\)[ (].*,\\1define\\2' ++ac_dC=' ' ++ac_dD=' ,' ++ ++uniq confdefs.h | ++ sed -n ' ++ t rset ++ :rset ++ s/^[ ]*#[ ]*define[ ][ ]*// ++ t ok ++ d ++ :ok ++ s/[\\&,]/\\&/g ++ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p ++ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ++ ' >>conftest.defines ++ ++# Remove the space that was appended to ease matching. ++# Then 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. ++# (The regexp can be short, since the line contains either #define or #undef.) ++echo 's/ $// ++s,^[ #]*u.*,/* & */,' >>conftest.defines ++ ++# Break up conftest.defines: ++ac_max_sed_lines=50 ++ ++# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" ++# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" ++# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" ++# et cetera. ++ac_in='$ac_file_inputs' ++ac_out='"$tmp/out1"' ++ac_nxt='"$tmp/out2"' ++ ++while : ++do ++ # Write a here document: ++ cat >>$CONFIG_STATUS <<_ACEOF ++ # First, check the format of the line: ++ cat >"\$tmp/defines.sed" <<\\CEOF ++/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def ++/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def ++b ++:def ++_ACEOF ++ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS ++ echo 'CEOF ++ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ++ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in ++ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail ++ grep . conftest.tail >/dev/null || break ++ rm -f conftest.defines ++ mv conftest.tail conftest.defines ++done ++rm -f conftest.defines conftest.tail ++ ++echo "ac_result=$ac_in" >>$CONFIG_STATUS ++cat >>$CONFIG_STATUS <<\_ACEOF ++ if test x"$ac_file" != x-; then ++ echo "/* $configure_input */" >"$tmp/config.h" ++ cat "$ac_result" >>"$tmp/config.h" ++ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then ++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 ++echo "$as_me: $ac_file is unchanged" >&6;} ++ else ++ rm -f $ac_file ++ mv "$tmp/config.h" $ac_file ++ fi ++ else ++ echo "/* $configure_input */" ++ cat "$ac_result" ++ fi ++ rm -f "$tmp/out12" ++# 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 || ++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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 ++echo "$as_me: executing $ac_file commands" >&6;} ++ ;; ++ esac ++ ++ ++ case $ac_file$ac_mode in ++ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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 || ++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"` ++ # When using ansi2knr, U may be empty or an underscore; expand it ++ U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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 || ++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 ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`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 || ++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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 ++echo "$as_me: error: cannot create directory $as_dir" >&2;} ++ { (exit 1); exit 1; }; }; } ++ # echo "creating $dirpart/$file" ++ echo '# dummy' > "$dirpart/$file" ++ done ++done ++ ;; ++ "default":C) test -z "$CONFIG_HEADERS" || date > stamp-h ++chmod 755 cmail ++ ;; ++ ++ esac ++done # for ac_tag ++ ++ ++{ (exit 0); exit 0; } ++_ACEOF ++chmod +x $CONFIG_STATUS ++ac_clean_files=$ac_clean_files_save ++ ++ ++# 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 || { (exit 1); exit 1; } ++fi ++ diff --cc configure.in index cd5aea2,da09924..ef55295 --- a/configure.in +++ b/configure.in @@@ -1,323 -1,374 +1,374 @@@ --dnl| configure.in --dnl| --dnl| You can process this file with autoconf to produce a configure script. --dnl| However, normally the supplied configure script will work fine. --dnl| --dnl| If you do need to change the configure script, instead of editing --dnl| it directly, try to edit configure.in (in a way that will keep --dnl| it portable to sites and systems other than your own), and run autoconf --dnl| to regenerate configure. Then submit your changes to be folded into --dnl| the standard version of xboard. -- - AC_INIT(xboard.c) - AC_CONFIG_HEADER(config.h) - - PRODUCT=xboard - VERSION=4.2 - PATCHLEVEL=pre8 - - if test -z "$CFLAGS" ; then - dnl| Prevent the next macro from setting CFLAGS to -g - CFLAGS=" " - fi - AC_PROG_CC - AC_PROG_CPP - AC_ISC_POSIX - AC_PROG_INSTALL - AC_CHECK_PROGS(LEX, lex flex, lex_not_found) - if test "$LEX" != lex_not_found ; then - AC_DECL_YYTEXT - fi - AC_CHECK_PROGS(RSH, remsh rsh, rsh) - AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH") - AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat) - AC_SUBST(NROFFFLAGS) - AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk) - AC_PATH_PROGS(PERLPATH, perl) - - AC_ARG_WITH(Xaw3d, [ --with-Xaw3d use Xaw3d instead of Xaw], - [AC_DEFINE(USE_XAW3D) - XAW_LIBS="-lXaw3d"], - XAW_LIBS="-lXaw") - AC_SUBST(XAW_LIBS) - - AC_HEADER_STDC - AC_HEADER_TIME - AC_HEADER_SYS_WAIT - AC_HEADER_DIRENT - AC_TYPE_SIGNAL - AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h) - AC_CHECK_HEADERS(fcntl.h sys/fcntl.h, break) - AC_CHECK_HEADERS(sys/socket.h lan/socket.h, break) - AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1)) - - AC_CHECK_FUNCS(_getpty grantpt setitimer usleep) - AC_CHECK_FUNCS(gettimeofday ftime, break) - AC_CHECK_FUNCS(random rand48, break) - AC_CHECK_FUNCS(gethostname sysinfo, break) - AC_CHECK_FUNC(setlocale, [], - AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1))) - - AC_CHECK_LIB(seq, getpseudotty) - - AC_PATH_XTRA - if test -n "$no_x" ; then - echo $PRODUCT requires the X Window System header files and libraries! - echo They were not found on your system. See FAQ topic C.2. - echo configure failed - exit 1 - fi - - AC_CANONICAL_HOST - - AM_GNU_GETTEXT([external]) - - dnl| The following info is mostly gathered from GNU Emacs 19.24. Basically, - dnl| we are trying to find out whether this is a System-V derivative in - dnl| which pipes don't work with select() and if so, whether there is anything - dnl| strange about the way to open a pty. Some of the work was done above - dnl| by looking for _getpty, grantpt, and getpseudotty. A few other strange - dnl| properties of particular systems are also handled here. - - dnl| 4/6/97 I'm not sure there really are any systems where pipes - dnl| don't work with select(), and ptys cause problems on many - dnl| systems, so I'm changing the default to disable ptys in all - dnl| cases. I will change it back if I get bug reports that are fixed - dnl| by doing a "configure --enable-ptys" - - USE_PTYS=0 - case "$host" in - *-*-hpux* ) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) - dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - else - - dnl| Note: You might be able to build xboard even if your compiler does not - dnl| support ANSI C (-Aa). xboard itself does not require ANSI C. I don't - dnl| know whether the X header files on HP-UX require it. - - CONF_CFLAGS="-Aa -D_HPUX_SOURCE" - fi - - dnl| HP doesn't supply a full set of X header files and libraries. People - dnl| often have some things installed in one place and some in another. - dnl| AC_PATH_XTRA will find only one place, so we try to add all the - dnl| likely ones that might be missing here. It might be better to - dnl| change AC_PATH_XTRA to try to extract this information from imake, - dnl| since folks who install the missing bits often configure their - dnl| imake to find them, but I don't want to delve into autoconf and - dnl| hack on its internals. - - if test -d /opt/hppd/include/X11; then - X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" - X_LIBS="$X_LIBS -L/opt/hppd/lib" - elif test -d /usr/contrib/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" - elif test -d /usr/contrib/mitX11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" - elif test -d /MIT/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" - X_LIBS="$X_LIBS -L/MIT/X11R5/lib" - elif test -d /usr/local/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" - X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" - fi - if test -d /usr/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" - X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" - elif test -d /usr/include/X11R4; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" - X_LIBS="$X_LIBS -L/usr/lib/X11R4" - fi - ;; - - romp-ibm-aix* ) - AC_DEFINE(IBMRTAIX, 1) - dnl| USE_PTYS=1 - ;; - - i386-ibm-aix ) - dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - - *-*-aix3* | *-*-bosx* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));]) - dnl| USE_PTYS=1 - ;; - - *-*-cxux* ) - AC_DEFINE(FIRST_PTY_LETTER, 'A') - AC_DEFINE(LAST_PTY_LETTER, 'P') - dnl| USE_PTYS=1 - ;; - - *-*-uniplus* ) - AC_DEFINE(UNIPLUS, 1) - dnl| USE_PTYS=1 - ;; - - *-*-rtu* ) - AC_DEFINE(FIRST_PTY_LETTER, 'z') - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyp%x", i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty%x", i);]) - AC_DEFINE(RTU, 1) - dnl| USE_PTYS=1 - ;; - - *-*-iris* | *-*-irix3* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));]) - dnl| USE_PTYS=1 - ;; - - *-*-irix* ) - dnl| USE_PTYS=1 - ;; - - *-*-sunos4* | *-*-solaris1* ) - - dnl| Work around a bug in the SunOS 4.x linker. Not needed if you have patches - dnl| 100512-02 and 100573-03 from Sun. The X FAQ says that the following is - dnl| "overkill," but doesn't explain what should be done instead. - - if test "$GCC" = yes; then - PRE_XMULIB="-static" - POST_XMULIB="-dynamic" - else - PRE_XMULIB="-Bstatic" - POST_XMULIB="-Bdynamic" - fi - ;; - - *-*-sunos5* | *-*-solaris2* ) - dnl| USE_PTYS=1 - - dnl| I'm not sure -lelf is needed, but it was in the old Imakefile. - dnl| The other libraries should all be found by Ac_PATH_XTRA or other - dnl| code above. - - X_LIBS="$X_LIBS -lelf" - ;; - - *-*-sco* ) - AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);]) - dnl| USE_PTYS=1 - ;; - - *-*-dynix* | *-*-ptx* ) - dnl| USE_PTYS=1 - ;; - - *-*-esix* ) - dnl| USE_PTYS=1 - ;; - - *-*-usg5-4* | *-*-sysvr4* ) - dnl| USE_PTYS=1 - ;; - - *-*-usg* | *-*-sysv* | *-*-aix* ) - dnl| USE_PTYS=1 - ;; - - vax-*-ultrix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - esac - - AC_ARG_ENABLE(xpm, - [ --enable-xpm libXpm will be used if found (default) - --disable-xpm libXpm will not be used], - [enable_xpm="$enableval"], [enable_xpm="yes"]) - - if test "$enable_xpm" = "yes"; then - save_cflags="$CFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADERS(X11/xpm.h) - CFLAGS="$save_cflags" - if test "$ac_cv_header_X11_xpm_h" = "yes"; then - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS" - AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, - [X_PRE_LIBS="-lXpm $X_PRE_LIBS"; AC_DEFINE(HAVE_LIBXPM)], [], - [$X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) - LDFLAGS="$save_ldflags" - fi - fi - - AC_SUBST(PRE_XMULIB) - AC_SUBST(POST_XMULIB) - AC_SUBST(CONF_CFLAGS) - AC_SUBST(CONF_LDFLAGS) - - AC_MSG_CHECKING(whether ptys or pipes should be used) - AC_ARG_ENABLE(ptys, - [ --enable-ptys force use of pseudo-ttys with child processes - --disable-ptys force use of pipes with child processes], - [if test "$enableval" = yes; then - USE_PTYS=1 - AC_MSG_RESULT([ptys (user override)]) - fi - if test "$enableval" = no; then - USE_PTYS=0 - AC_MSG_RESULT([pipes (user override)]) - fi], - [if test "$USE_PTYS" = 1; then - AC_MSG_RESULT(ptys) - else - AC_MSG_RESULT(pipes) - fi]) - AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS) - - AC_ARG_ENABLE(zippy, - [ --enable-zippy support interfacing a chess program to ICS (default) - --disable-zippy do not support interfacing a chess program to ICS], - [enable_zippy="$enableval"], [enable_zippy="yes"]) - if test "$enable_zippy" = yes; then - AC_DEFINE(ZIPPY, 1) - ZIPPY_O=zippy.o - ZIPPY_H=zippy.h - fi - AC_SUBST(ZIPPY_O) - AC_SUBST(ZIPPY_H) - - AC_ARG_ENABLE(sigint, - [ --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) - --disable-sigint typing a command wakes up GNU Chess], - [if test "$enableval" = yes; then - AC_DEFINE(ATTENTION, 1) - fi], - [AC_DEFINE(ATTENTION, 1)]) - - AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") - AC_DEFINE_UNQUOTED(VERSION, "$VERSION") - AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL") - AC_SUBST(PRODUCT) - AC_SUBST(VERSION) - AC_SUBST(PATCHLEVEL) - - AC_OUTPUT(Makefile cmail xboard.texinfo po/Makefile.in , - [test -z "$CONFIG_HEADERS" || date > stamp-h - chmod 755 cmail - ]) -AC_INIT([xboard],[4.3]) -AM_INIT_AUTOMAKE -AC_PROG_CC -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([ -Makefile -]) -AC_OUTPUT -PRODUCT=xboard -#VERSION=4.3 # version is already defined -PATCHLEVEL=15 - - -if test -z "$CFLAGS" ; then -dnl| Prevent the next macro from setting CFLAGS to -g - CFLAGS=" " -fi -AC_PROG_CC -AC_PROG_CPP -AC_ISC_POSIX -AC_PROG_INSTALL -AC_CHECK_PROGS(LEX, lex flex, lex_not_found) -if test "$LEX" != lex_not_found ; then - AC_DECL_YYTEXT -fi -AC_CHECK_PROGS(RSH, remsh rsh, rsh) -AC_CHECK_PROGS(MINFO, makeinfo, makeinfo_not_found) -if test "$MINFO" == makeinfo_not_found ; then - echo Please install \"makeinfo\" - exit 1 -fi -AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH") -AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat) -AC_SUBST(NROFFFLAGS) -AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk) -AC_PATH_PROGS(PERLPATH, perl) - - - - -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_SYS_WAIT -AC_HEADER_DIRENT -AC_TYPE_SIGNAL -AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h) -AC_CHECK_HEADERS(fcntl.h sys/fcntl.h, break) -AC_CHECK_HEADERS(sys/socket.h lan/socket.h, break) -AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1)) - -AC_CHECK_FUNCS(_getpty grantpt setitimer usleep) -AC_CHECK_FUNCS(gettimeofday ftime, break) -AC_CHECK_FUNCS(random rand48, break) -AC_CHECK_FUNCS(gethostname sysinfo, break) -AC_CHECK_FUNC(setlocale, [], - AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1))) - -AC_CHECK_LIB(seq, getpseudotty) - -AC_PATH_XTRA -if test -n "$no_x" ; then - echo $PRODUCT requires the X Window System header files and libraries! - echo They were not found on your system. See FAQ topic C.2. - echo configure failed - exit 1 -fi - -AC_CHECK_HEADER(X11/Intrinsic.h,xt="yes",xt="no") - -if test "$xt" == "no" ; then - echo Xt headers not found - exit 1 -fi - -AC_ARG_WITH(Xaw3d, [ --with-Xaw3d use Xaw3d instead of Xaw], - with_xaw3d="yes", with_xaw3d="no") - - -xaw_headers="no" -if test "$with_xaw3d" == "yes" ; then - XAW_LIBS="-lXaw3d" - AC_CHECK_LIB([Xaw3d], [XawTextReplace], xaw3d_lib="yes", xaw3d_lib="no") - if test "$xaw3d_lib" == "no" ; then - echo Xaw3d libraries not found - exit 1 - else - AC_CHECK_HEADER(X11/Xaw3d/Dialog.h,xaw3d_headers="yes",xaw3d_headers="no") - if test "$xaw3d_headers" == "yes" ; then - AC_DEFINE(USE_XAW3D) - xaw_headers="yes" - else - AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") - fi - fi -else - XAW_LIBS="-lXaw" - AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") -fi - -AC_SUBST(XAW_LIBS) - - - -if test "$xaw_headers" == "no" ; then - echo Xaw headers not found - exit 1 - -fi - - - - -AC_CANONICAL_HOST - -dnl| The following info is mostly gathered from GNU Emacs 19.24. Basically, -dnl| we are trying to find out whether this is a System-V derivative in -dnl| which pipes don't work with select() and if so, whether there is anything -dnl| strange about the way to open a pty. Some of the work was done above -dnl| by looking for _getpty, grantpt, and getpseudotty. A few other strange -dnl| properties of particular systems are also handled here. - -dnl| 4/6/97 I'm not sure there really are any systems where pipes -dnl| don't work with select(), and ptys cause problems on many -dnl| systems, so I'm changing the default to disable ptys in all -dnl| cases. I will change it back if I get bug reports that are fixed -dnl| by doing a "configure --enable-ptys" - -USE_PTYS=0 -case "$host" in - *-*-hpux* ) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) -dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - else - -dnl| Note: You might be able to build xboard even if your compiler does not -dnl| support ANSI C (-Aa). xboard itself does not require ANSI C. I don't -dnl| know whether the X header files on HP-UX require it. - - CONF_CFLAGS="-Aa -D_HPUX_SOURCE" - fi - -dnl| HP doesn't supply a full set of X header files and libraries. People -dnl| often have some things installed in one place and some in another. -dnl| AC_PATH_XTRA will find only one place, so we try to add all the -dnl| likely ones that might be missing here. It might be better to -dnl| change AC_PATH_XTRA to try to extract this information from imake, -dnl| since folks who install the missing bits often configure their -dnl| imake to find them, but I don't want to delve into autoconf and -dnl| hack on its internals. - - if test -d /opt/hppd/include/X11; then - X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" - X_LIBS="$X_LIBS -L/opt/hppd/lib" - elif test -d /usr/contrib/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" - elif test -d /usr/contrib/mitX11R5/include; then - X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" - X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" - elif test -d /MIT/X11R5/include; then - X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" - X_LIBS="$X_LIBS -L/MIT/X11R5/lib" - elif test -d /usr/local/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" - X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" - fi - if test -d /usr/include/X11R5; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" - X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" - elif test -d /usr/include/X11R4; then - X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" - X_LIBS="$X_LIBS -L/usr/lib/X11R4" - fi - ;; - - romp-ibm-aix* ) - AC_DEFINE(IBMRTAIX, 1) -dnl| USE_PTYS=1 - ;; - - i386-ibm-aix ) -dnl| USE_PTYS=1 - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; - - *-*-aix3* | *-*-bosx* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));]) -dnl| USE_PTYS=1 - ;; - - *-*-cxux* ) - AC_DEFINE(FIRST_PTY_LETTER, 'A') - AC_DEFINE(LAST_PTY_LETTER, 'P') -dnl| USE_PTYS=1 - ;; - - *-*-uniplus* ) - AC_DEFINE(UNIPLUS, 1) -dnl| USE_PTYS=1 - ;; - - *-*-rtu* ) - AC_DEFINE(FIRST_PTY_LETTER, 'z') - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyp%x", i);]) - AC_DEFINE(PTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/pty%x", i);]) - AC_DEFINE(RTU, 1) -dnl| USE_PTYS=1 - ;; - - *-*-iris* | *-*-irix3* ) - AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, - [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));]) -dnl| USE_PTYS=1 - ;; - - *-*-irix* ) -dnl| USE_PTYS=1 - ;; - - *-*-sunos4* | *-*-solaris1* ) - -dnl| Work around a bug in the SunOS 4.x linker. Not needed if you have patches -dnl| 100512-02 and 100573-03 from Sun. The X FAQ says that the following is -dnl| "overkill," but doesn't explain what should be done instead. - - if test "$GCC" = yes; then - PRE_XMULIB="-static" - POST_XMULIB="-dynamic" - else - PRE_XMULIB="-Bstatic" - POST_XMULIB="-Bdynamic" - fi - ;; - - *-*-sunos5* | *-*-solaris2* ) -dnl| USE_PTYS=1 - -dnl| I'm not sure -lelf is needed, but it was in the old Imakefile. -dnl| The other libraries should all be found by Ac_PATH_XTRA or other -dnl| code above. - - X_LIBS="$X_LIBS -lelf" - ;; - - *-*-sco* ) - AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)]) - AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);]) -dnl| USE_PTYS=1 - ;; - - *-*-dynix* | *-*-ptx* ) -dnl| USE_PTYS=1 - ;; - - *-*-esix* ) -dnl| USE_PTYS=1 - ;; - - *-*-usg5-4* | *-*-sysvr4* ) -dnl| USE_PTYS=1 - ;; - - *-*-usg* | *-*-sysv* | *-*-aix* ) -dnl| USE_PTYS=1 - ;; - - vax-*-ultrix ) - if test "$GCC" = yes; then - CONF_CFLAGS="-fwritable-strings" - fi - ;; -esac - -AC_ARG_ENABLE(xpm, -[ --enable-xpm libXpm will be used if found (default) - --disable-xpm libXpm will not be used], -[enable_xpm="$enableval"], [enable_xpm="yes"]) - -if test "$enable_xpm" = "yes"; then - save_cflags="$CFLAGS" - CFLAGS="$CFLAGS $X_CFLAGS" - CPPFLAGS="$CPPFLAGS $X_CFLAGS" - AC_CHECK_HEADERS(X11/xpm.h) - CFLAGS="$save_cflags" - if test "$ac_cv_header_X11_xpm_h" = "yes"; then - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS $X_LIBS" - AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, - [X_PRE_LIBS="-lXpm $X_PRE_LIBS"; AC_DEFINE(HAVE_LIBXPM)], [], - [$X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) - LDFLAGS="$save_ldflags" - fi -fi - -AC_SUBST(PRE_XMULIB) -AC_SUBST(POST_XMULIB) -AC_SUBST(CONF_CFLAGS) -AC_SUBST(CONF_LDFLAGS) - -AC_MSG_CHECKING(whether ptys or pipes should be used) -AC_ARG_ENABLE(ptys, -[ --enable-ptys force use of pseudo-ttys with child processes - --disable-ptys force use of pipes with child processes], -[if test "$enableval" = yes; then - USE_PTYS=1 - AC_MSG_RESULT([ptys (user override)]) -fi -if test "$enableval" = no; then - USE_PTYS=0 - AC_MSG_RESULT([pipes (user override)]) -fi], -[if test "$USE_PTYS" = 1; then - AC_MSG_RESULT(ptys) -else - AC_MSG_RESULT(pipes) -fi]) -AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS) - -AC_ARG_ENABLE(zippy, -[ --enable-zippy support interfacing a chess program to ICS (default) - --disable-zippy do not support interfacing a chess program to ICS], -[enable_zippy="$enableval"], [enable_zippy="yes"]) -if test "$enable_zippy" = yes; then - AC_DEFINE(ZIPPY, 1) - ZIPPY_O=zippy.o - ZIPPY_H=zippy.h -fi -AC_SUBST(ZIPPY_O) -AC_SUBST(ZIPPY_H) - -AC_ARG_ENABLE(sigint, -[ --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) - --disable-sigint typing a command wakes up GNU Chess], -[if test "$enableval" = yes; then - AC_DEFINE(ATTENTION, 1) -fi], -[AC_DEFINE(ATTENTION, 1)]) - -AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") -AC_DEFINE_UNQUOTED(VERSION, "$VERSION") -AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL") -AC_SUBST(PRODUCT) -AC_SUBST(VERSION) -AC_SUBST(PATCHLEVEL) - -AC_OUTPUT(cmail xboard.texinfo, -[test -z "$CONFIG_HEADERS" || date > stamp-h -chmod 755 cmail -]) ++dnl| configure.in ++dnl| ++dnl| You can process this file with autoconf to produce a configure script. ++dnl| However, normally the supplied configure script will work fine. ++dnl| ++dnl| If you do need to change the configure script, instead of editing ++dnl| it directly, try to edit configure.in (in a way that will keep ++dnl| it portable to sites and systems other than your own), and run autoconf ++dnl| to regenerate configure. Then submit your changes to be folded into ++dnl| the standard version of xboard. ++ ++AC_INIT([xboard],[4.3]) ++AM_INIT_AUTOMAKE ++AC_PROG_CC ++AC_CONFIG_HEADERS([config.h]) ++AC_CONFIG_FILES([ ++Makefile ++]) ++AC_OUTPUT ++PRODUCT=xboard ++#VERSION=4.4 # version is already defined ++PATCHLEVEL=0e ++ ++ ++if test -z "$CFLAGS" ; then ++dnl| Prevent the next macro from setting CFLAGS to -g ++ CFLAGS=" " ++fi ++AC_PROG_CC ++AC_PROG_CPP ++AC_ISC_POSIX ++AC_PROG_INSTALL ++AC_CHECK_PROGS(LEX, lex flex, lex_not_found) ++if test "$LEX" != lex_not_found ; then ++ AC_DECL_YYTEXT ++fi ++AC_CHECK_PROGS(RSH, remsh rsh, rsh) ++AC_CHECK_PROGS(MINFO, makeinfo, makeinfo_not_found) ++if test "$MINFO" == makeinfo_not_found ; then ++ echo Please install \"makeinfo\" ++ exit 1 ++fi ++AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH") ++AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat) ++AC_SUBST(NROFFFLAGS) ++AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk) ++AC_PATH_PROGS(PERLPATH, perl) ++ ++ ++ ++ ++AC_HEADER_STDC ++AC_HEADER_TIME ++AC_HEADER_SYS_WAIT ++AC_HEADER_DIRENT ++AC_TYPE_SIGNAL ++AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h) ++AC_CHECK_HEADERS(fcntl.h sys/fcntl.h, break) ++AC_CHECK_HEADERS(sys/socket.h lan/socket.h, break) ++AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1)) ++ ++AC_CHECK_FUNCS(_getpty grantpt setitimer usleep) ++AC_CHECK_FUNCS(gettimeofday ftime, break) ++AC_CHECK_FUNCS(random rand48, break) ++AC_CHECK_FUNCS(gethostname sysinfo, break) ++AC_CHECK_FUNC(setlocale, [], ++ AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1))) ++ ++AC_CHECK_LIB(seq, getpseudotty) ++ ++AC_PATH_XTRA ++if test -n "$no_x" ; then ++ echo $PRODUCT requires the X Window System header files and libraries! ++ echo They were not found on your system. See FAQ topic C.2. ++ echo configure failed ++ exit 1 ++fi ++ ++AC_CHECK_HEADER(X11/Intrinsic.h,xt="yes",xt="no") ++ ++if test "$xt" == "no" ; then ++ echo Xt headers not found ++ exit 1 ++fi ++ ++AC_ARG_WITH(Xaw3d, [ --with-Xaw3d use Xaw3d instead of Xaw], ++ with_xaw3d="yes", with_xaw3d="no") ++ ++ ++xaw_headers="no" ++if test "$with_xaw3d" == "yes" ; then ++ XAW_LIBS="-lXaw3d" ++ AC_CHECK_LIB([Xaw3d], [XawTextReplace], xaw3d_lib="yes", xaw3d_lib="no") ++ if test "$xaw3d_lib" == "no" ; then ++ echo Xaw3d libraries not found ++ exit 1 ++ else ++ AC_CHECK_HEADER(X11/Xaw3d/Dialog.h,xaw3d_headers="yes",xaw3d_headers="no") ++ if test "$xaw3d_headers" == "yes" ; then ++ AC_DEFINE(USE_XAW3D) ++ xaw_headers="yes" ++ else ++ AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") ++ fi ++ fi ++else ++ XAW_LIBS="-lXaw" ++ AC_CHECK_HEADER(X11/Xaw/Dialog.h,xaw_headers="yes") ++fi ++ ++AC_SUBST(XAW_LIBS) ++ ++ ++ ++if test "$xaw_headers" == "no" ; then ++ echo Xaw headers not found ++ exit 1 ++ ++fi ++ ++ ++ ++ ++AC_CANONICAL_HOST ++ ++dnl| The following info is mostly gathered from GNU Emacs 19.24. Basically, ++dnl| we are trying to find out whether this is a System-V derivative in ++dnl| which pipes don't work with select() and if so, whether there is anything ++dnl| strange about the way to open a pty. Some of the work was done above ++dnl| by looking for _getpty, grantpt, and getpseudotty. A few other strange ++dnl| properties of particular systems are also handled here. ++ ++dnl| 4/6/97 I'm not sure there really are any systems where pipes ++dnl| don't work with select(), and ptys cause problems on many ++dnl| systems, so I'm changing the default to disable ptys in all ++dnl| cases. I will change it back if I get bug reports that are fixed ++dnl| by doing a "configure --enable-ptys" ++ ++USE_PTYS=0 ++case "$host" in ++ *-*-hpux* ) ++ AC_DEFINE(PTY_TTY_NAME_SPRINTF, ++ [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) ++ AC_DEFINE(PTY_NAME_SPRINTF, ++ [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) ++dnl| USE_PTYS=1 ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ else ++ ++dnl| Note: You might be able to build xboard even if your compiler does not ++dnl| support ANSI C (-Aa). xboard itself does not require ANSI C. I don't ++dnl| know whether the X header files on HP-UX require it. ++ ++ CONF_CFLAGS="-Aa -D_HPUX_SOURCE" ++ fi ++ ++dnl| HP doesn't supply a full set of X header files and libraries. People ++dnl| often have some things installed in one place and some in another. ++dnl| AC_PATH_XTRA will find only one place, so we try to add all the ++dnl| likely ones that might be missing here. It might be better to ++dnl| change AC_PATH_XTRA to try to extract this information from imake, ++dnl| since folks who install the missing bits often configure their ++dnl| imake to find them, but I don't want to delve into autoconf and ++dnl| hack on its internals. ++ ++ if test -d /opt/hppd/include/X11; then ++ X_CFLAGS="$X_CFLAGS -I/opt/hppd/include" ++ X_LIBS="$X_LIBS -L/opt/hppd/lib" ++ elif test -d /usr/contrib/X11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/usr/contrib/X11R5/include" ++ X_LIBS="$X_LIBS -L/usr/contrib/X11R5/lib" ++ elif test -d /usr/contrib/mitX11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/usr/contrib/mitX11R5/include" ++ X_LIBS="$X_LIBS -L/usr/contrib/mitX11R5/lib" ++ elif test -d /MIT/X11R5/include; then ++ X_CFLAGS="$X_CFLAGS -I/MIT/X11R5/include" ++ X_LIBS="$X_LIBS -L/MIT/X11R5/lib" ++ elif test -d /usr/local/include/X11R5; then ++ X_CFLAGS="$X_CFLAGS -I/usr/local/include/X11R5" ++ X_LIBS="$X_LIBS -L/usr/local/lib/X11R5" ++ fi ++ if test -d /usr/include/X11R5; then ++ X_CFLAGS="$X_CFLAGS -I/usr/include/X11R5" ++ X_LIBS="$X_LIBS -L/usr/lib/X11R5 -L/usr/lib/X11R4" ++ elif test -d /usr/include/X11R4; then ++ X_CFLAGS="$X_CFLAGS -I/usr/include/X11R4" ++ X_LIBS="$X_LIBS -L/usr/lib/X11R4" ++ fi ++ ;; ++ ++ romp-ibm-aix* ) ++ AC_DEFINE(IBMRTAIX, 1) ++dnl| USE_PTYS=1 ++ ;; ++ ++ i386-ibm-aix ) ++dnl| USE_PTYS=1 ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ fi ++ ;; ++ ++ *-*-aix3* | *-*-bosx* ) ++ AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) ++ AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) ++ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));]) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-cxux* ) ++ AC_DEFINE(FIRST_PTY_LETTER, 'A') ++ AC_DEFINE(LAST_PTY_LETTER, 'P') ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-uniplus* ) ++ AC_DEFINE(UNIPLUS, 1) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-rtu* ) ++ AC_DEFINE(FIRST_PTY_LETTER, 'z') ++ AC_DEFINE(PTY_TTY_NAME_SPRINTF, ++ [sprintf (pty_name, "/dev/ttyp%x", i);]) ++ AC_DEFINE(PTY_NAME_SPRINTF, ++ [sprintf (pty_name, "/dev/pty%x", i);]) ++ AC_DEFINE(RTU, 1) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-iris* | *-*-irix3* ) ++ AC_DEFINE(PTY_ITERATION, [for (c = 0; !c; c++)]) ++ AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) ++ AC_DEFINE(PTY_TTY_NAME_SPRINTF, ++ [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));]) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-irix* ) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-sunos4* | *-*-solaris1* ) ++ ++dnl| Work around a bug in the SunOS 4.x linker. Not needed if you have patches ++dnl| 100512-02 and 100573-03 from Sun. The X FAQ says that the following is ++dnl| "overkill," but doesn't explain what should be done instead. ++ ++ if test "$GCC" = yes; then ++ PRE_XMULIB="-static" ++ POST_XMULIB="-dynamic" ++ else ++ PRE_XMULIB="-Bstatic" ++ POST_XMULIB="-Bdynamic" ++ fi ++ ;; ++ ++ *-*-sunos5* | *-*-solaris2* ) ++dnl| USE_PTYS=1 ++ ++dnl| I'm not sure -lelf is needed, but it was in the old Imakefile. ++dnl| The other libraries should all be found by Ac_PATH_XTRA or other ++dnl| code above. ++ ++ X_LIBS="$X_LIBS -lelf" ++ ;; ++ ++ *-*-sco* ) ++ AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)]) ++ AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);]) ++ AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);]) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-dynix* | *-*-ptx* ) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-esix* ) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-usg5-4* | *-*-sysvr4* ) ++dnl| USE_PTYS=1 ++ ;; ++ ++ *-*-usg* | *-*-sysv* | *-*-aix* ) ++dnl| USE_PTYS=1 ++ ;; ++ ++ vax-*-ultrix ) ++ if test "$GCC" = yes; then ++ CONF_CFLAGS="-fwritable-strings" ++ fi ++ ;; ++esac ++ ++AC_ARG_ENABLE(xpm, ++[ --enable-xpm libXpm will be used if found (default) ++ --disable-xpm libXpm will not be used], ++[enable_xpm="$enableval"], [enable_xpm="yes"]) ++ ++if test "$enable_xpm" = "yes"; then ++ save_cflags="$CFLAGS" ++ CFLAGS="$CFLAGS $X_CFLAGS" ++ CPPFLAGS="$CPPFLAGS $X_CFLAGS" ++ AC_CHECK_HEADERS(X11/xpm.h) ++ CFLAGS="$save_cflags" ++ if test "$ac_cv_header_X11_xpm_h" = "yes"; then ++ save_ldflags="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $X_LIBS" ++ AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, ++ [X_PRE_LIBS="-lXpm $X_PRE_LIBS"; AC_DEFINE(HAVE_LIBXPM)], [], ++ [$X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) ++ LDFLAGS="$save_ldflags" ++ fi ++fi ++ ++AC_SUBST(PRE_XMULIB) ++AC_SUBST(POST_XMULIB) ++AC_SUBST(CONF_CFLAGS) ++AC_SUBST(CONF_LDFLAGS) ++ ++AC_MSG_CHECKING(whether ptys or pipes should be used) ++AC_ARG_ENABLE(ptys, ++[ --enable-ptys force use of pseudo-ttys with child processes ++ --disable-ptys force use of pipes with child processes], ++[if test "$enableval" = yes; then ++ USE_PTYS=1 ++ AC_MSG_RESULT([ptys (user override)]) ++fi ++if test "$enableval" = no; then ++ USE_PTYS=0 ++ AC_MSG_RESULT([pipes (user override)]) ++fi], ++[if test "$USE_PTYS" = 1; then ++ AC_MSG_RESULT(ptys) ++else ++ AC_MSG_RESULT(pipes) ++fi]) ++AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS) ++ ++AC_ARG_ENABLE(zippy, ++[ --enable-zippy support interfacing a chess program to ICS (default) ++ --disable-zippy do not support interfacing a chess program to ICS], ++[enable_zippy="$enableval"], [enable_zippy="yes"]) ++if test "$enable_zippy" = yes; then ++ AC_DEFINE(ZIPPY, 1) ++ ZIPPY_O=zippy.o ++ ZIPPY_H=zippy.h ++fi ++AC_SUBST(ZIPPY_O) ++AC_SUBST(ZIPPY_H) ++ ++AC_ARG_ENABLE(sigint, ++[ --enable-sigint sending SIGINT (^C) wakes up GNU Chess (default) ++ --disable-sigint typing a command wakes up GNU Chess], ++[if test "$enableval" = yes; then ++ AC_DEFINE(ATTENTION, 1) ++fi], ++[AC_DEFINE(ATTENTION, 1)]) ++ ++AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") ++AC_DEFINE_UNQUOTED(VERSION, "$VERSION") ++AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL") ++AC_SUBST(PRODUCT) ++AC_SUBST(VERSION) ++AC_SUBST(PATCHLEVEL) ++ ++AC_OUTPUT(cmail xboard.texinfo, ++[test -z "$CONFIG_HEADERS" || date > stamp-h ++chmod 755 cmail ++]) diff --cc engine-intf.html index 02166ea,13e1719..bad8e89 --- a/engine-intf.html +++ b/engine-intf.html @@@ -1,1895 -1,2177 +1,2244 @@@ - - - Chess Engine Communication Protocol - - - -
-

Chess Engine Communication Protocol

-

Tim Mann

-

- $Id$
- Version 2; implemented in xboard/WinBoard 4.2.1 and later.
- Changes since version 1 are indicated in red. -


- - - -
- -

1. Introduction

- -

- This document is a set of rough notes on the protocol that xboard and - WinBoard use to communicate with gnuchessx and other chess engines. - These notes may be useful if you want to connect a different chess - engine to xboard. Throughout the notes, "xboard" means both xboard - and WinBoard except where they are specifically contrasted. -

- -

- There are two reasons I can imagine someone wanting to do this: -

-
    -
  1. You have, or are developing, a chess engine but you don't want to - write your own graphical interface. -
  2. You have, or are developing,a chess engine, and you want to - interface it to the Internet Chess Server. -
- -

- In case (2), if you are using xboard, you will need to configure the - "Zippy" code into it, but WinBoard includes this code already. See - the file zippy.README - in the xboard or WinBoard distribution for more information. - -

- -

- These notes are unpolished, but I've attempted to make them complete - in this release. If you notice any errors, omissions, or misleading - statements, let me know. -

- -

- I'd like to hear from everyone who is trying to interface their own - chess engine to xboard/WinBoard. Please join the mailing list for - authors of xboard/WinBoard compatible chess engines and post a message - about what you're doing. The list is now hosted by Yahoo Groups; you - can join at http://groups.yahoo.com/group/chess-engines, or you can read the - list there without joining. The list is filtered to prevent spam. -

- -

2. Connection

- -

- An xboard chess engine runs as a separate process from xboard itself, - connected to xboard through a pair of anonymous pipes. The engine - does not have to do anything special to set up these pipes. xboard - sets up the pipes itself and starts the engine with one pipe as its - standard input and the other as its standard output. The engine then - reads commands from its standard input and writes responses to its - standard output. This is, unfortunately, a little more complicated to - do right than it sounds; see section 6 below. -

- -

- And yes, contrary to some people's expectations, exactly the same - thing is true for WinBoard. Pipes and standard input/output are - implemented in Win32 and work fine. You don't have to use DDE, COM, - DLLs, BSOD, or any of the other infinite complexity that - Microsoft has created just to talk between two programs. A WinBoard - chess engine is a Win32 console program that simply reads from its - standard input and writes to its standard output. See sections - 5 and 6 below for additional details. -

- -

3. Debugging

- -

- To diagnose problems in your engine's interaction with xboard, use the - -debug flag on xboard's command line to see the messages that are - being exchanged. In WinBoard, these messages are written to the file - WinBoard.debug instead of going to the screen. -

- -

- You can turn debug mode on or off while WinBoard is running by - pressing Ctrl+Alt+F12. You can turn debug mode on or off while xboard - is running by binding DebugProc to a shortcut key (and pressing the - key!); see the instructions on shortcut keys in the xboard man page. -

- -

- While your engine is running under xboard/WinBoard, you can send a - command directly to the engine by pressing Shift+1 (xboard) or Alt+1 - (WinBoard 4.0.3 and later). This brings up a dialog that you can type - your command into. Press Shift+2 (Alt+2) instead to send to the - second chess engine in Two Machines mode. On WinBoard 4.0.2 and earlier, - Ctrl+Alt is used in place of Alt; this had to be changed due to a conflict - with typing the @-sign on some European keyboards. -

- -

4. How it got this way

- -

- Originally, xboard was just trying to talk to the existing - command-line interface of GNU Chess 3.1+ and 4, which was designed - for people to type commands to. So the communication protocol is very - ad-hoc. It might have been good to redesign it early on, but because - xboard and GNU Chess are separate programs, I didn't want to force - people to upgrade them together to versions that matched. I - particularly wanted to keep new versions of xboard working with old - versions of GNU Chess, to make it easier to compare the play of old - and new gnuchess versions. I didn't foresee the need for a clean - protocol to be used with other chess engines in the future. -

- -

- Circumstances have changed over the years, and now there are many more - engines that work with xboard. I've had to make the protocol - description more precise, I've added some features that GNU Chess - does not support, and I've specified the standard semantics of a few - features to be slightly different from what GNU Chess 4 does. -

- -

- - This release of the protocol specification is the first to carry a - version number of its own -- version 2. Previous releases simply - carried a last-modified date and were loosely tied to specific - releases of xboard and WinBoard. The version number "1" applies - generally to all those older versions of the protocol. - - - -

Protocol version 2 remains compatible with older engines but has - several new capabilities. In particular, it adds the - "feature" command, a new mechanism for making backward-compatible - changes and extensions to the protocol. Engines that do not support a - particular new feature do not have to use it; new features are not - enabled unless the engine specifically requests them using the feature - command. If an engine does not send the feature command at all, the - protocol behavior is nearly identical to version 1. Several new - features can be selected by the feature command in version 2, - including the "ping" command (recommended for all engines), the - "setboard" command, and many optional parameters. Additional features - will probably be added in future versions. -

- - -

5. WinBoard requires Win32 engines

- -

- Due to some Microsoft brain damage that I don't understand, WinBoard - does not work with chess engines that were compiled to use a DOS - extender for 32-bit addressing. (Probably not with 16-bit DOS or - Windows programs either.) WinBoard works only with engines that are - compiled for the Win32 API. You can get a free compiler that targets - the Win32 API from http://sources.redhat.com/cygwin/. I think DJGPP 2.x should also - work if you use the RSXNTDJ extension, but I haven't tried it. Of - course, Microsoft Visual C++ will work. Most likely the other - commercial products that support Win32 will work too (Borland, etc.), - but I have not tried them. Delphi has been successfully used to write - engines for WinBoard; if you want to do this, Tony Werten has donated - some sample - code that should help you get started. -

- -

6. Hints on input/output

- -

- Beware of using buffered I/O in your chess engine. The C stdio - library, C++ streams, and the I/O packages in most other languages use - buffering both on input and output. That means two things. First, - when your engine tries to write some characters to xboard, the library - stashes them in an internal buffer and does not actually write them to - the pipe connected to xboard until either the buffer fills up or you - call a special library routine asking for it to be flushed. (In C - stdio, this routine is named fflush.) Second, when your engine tries - to read some characters from xboard, the library does not read just - the characters you asked for -- it reads all the characters that are - currently available (up to some limit) and stashes any characters you - are not yet ready for in an internal buffer. The next time you ask to - read, you get the characters from the buffer (if any) before the - library tries to read more data from the actual pipe. -

- -

- Why does this cause problems? First, on the output side, remember - that your engine produces output in small quantities (say, a few - characters for a move, or a line or two giving the current analysis), - and that data always needs to be delivered to xboard/WinBoard for - display immediately. If you use buffered output, the data you print - will sit in a buffer in your own address space instead of being - delivered. -

- -

- You can usually fix the output buffering problem by asking for the - buffering to be turned off. In C stdio, you do this by calling - setbuf(stdout, NULL). A more laborious and error-prone - method is to carefully call fflush(stdout) after every line - you output; I don't recommend this. In C++, you can try - cout.setf(ios::unitbuf), which is documented in current - editions of "The C++ Programming Language," but not older ones. - Another C++ method that might work is - cout.rdbuf()->setbuf(NULL, 0). Alternatively, you can - carefully call cout.flush() after every line you output; - again, I don't recommend this. -

- -

- Another way to fix the problem is to use unbuffered operating system - calls to write directly to the file descriptor for standard output. - On Unix, this means write(1, ...) -- see the man page for write(2). - On Win32, you can use either the Unix-like _write(1, ...) or Win32 - native routines like WriteFile. -

- -

- Second, on the input side, you are likely to want to poll during your - search and stop it if new input has come in. If you implement - pondering, you'll need this so that pondering stops when the user - makes a move. You should also poll during normal thinking on your - move, so that you can implement the "?" (move now) command, and so - that you can respond promptly to a "result", "force", or "quit" - command if xboard wants to end the game or terminate your engine. - Buffered input makes polling more complicated -- when you poll, you - must stop your search if there are either characters in the buffer - or characters available from the underlying file descriptor. -

- -

- The most direct way to fix this problem is to use unbuffered operating - system calls to read (and poll) the underlying file descriptor - directly. On Unix, use read(0, ...) to read from standard input, and - use select() to poll it. See the man pages read(2) and select(2). - (Don't follow the example of GNU Chess 4 and use the FIONREAD ioctl to - poll for input. It is not very portable; that is, it does not exist - on all versions of Unix, and is broken on some that do have it.) On - Win32, you can use either the Unix-like _read(0, ...) or the native - Win32 ReadFile() to read. Unfortunately, under Win32, the function to - use for polling is different depending on whether the input device is - a pipe, a console, or something else. (More Microsoft brain damage - here -- did they never hear of device independence?) For pipes, you - can use PeekNamedPipe to poll (even when the pipe is unnamed). - For consoles, - you can use GetNumberOfConsoleInputEvents. For sockets only, you can - use select(). It might be possible to use - WaitForSingleObject more - generally, but I have not tried it. Some code to do these things can - be found in Crafty's utility.c, but I don't guarantee that it's all - correct or optimal. -

- -

- A second way to fix the problem might be to ask your I/O library not - to buffer on input. It should then be safe to poll the underlying - file descriptor as described above. With C, you can try calling - setbuf(stdin, NULL). However, I have never tried this. Also, there - could be problems if you use scanf(), at least with certain patterns, - because scanf() sometimes needs to read one extra character and "push - it back" into the buffer; hence, there is a one-character pushback - buffer even if you asked for stdio to be unbuffered. With C++, you - can try cin.rdbuf()->setbuf(NULL, 0), but again, I have never tried - this. -

- -

- A third way to fix the problem is to check whether there are - characters in the buffer whenever you poll. C I/O libraries generally - do not provide any portable way to do this. Under C++, you can use - cin.rdbuf()->in_avail(). This method has been reported to - work with - EXchess. Remember that if there are no characters in the buffer, you - still have to poll the underlying file descriptor too, using the - method described above. -

- -

- A fourth way to fix the problem is to use a separate thread to read - from stdin. This way works well if you are familiar with thread - programming. This thread can be blocked waiting for input to come in - at all times, while the main thread of your engine does its thinking. - When input arrives, you have the thread put the input into a buffer - and set a flag in a global variable. Your search routine then - periodically tests the global variable to see if there is input to - process, and stops if there is. WinBoard and my Win32 ports of ICC - timestamp and FICS timeseal use threads to handle multiple input - sources. -

- -

7. Signals

- -

Engines that run on Unix need to be concerned with two Unix - signals: SIGTERM and SIGINT. This applies both to - engines that run under xboard and (the unusual case of) engines that - WinBoard remotely runs on a Unix host using the -firstHost or - -secondHost feature. It does not apply to engines that run on - Windows, because Windows does not have Unix-style signals. - - Beginning with version 2, you can now turn off the use of - either or both - signals. See the "feature" command in section 9 below. - -

- -

First, when an engine is sent the "quit" command, it is also given - a SIGTERM signal shortly afterward to make sure it goes away. - If your engine reliably responds to "quit", and the signal causes - problems for you, you should either ignore it by calling - signal(SIGTERM, SIG_IGN) at the start of your program, - or disable it with the "feature" command.

- -

Second, xboard will send an interrupt signal (SIGINT) at - certain times when it believes the engine may not be listening to user - input (thinking or pondering). WinBoard currently does this only when - the engine is running remotely using the -firstHost or -secondHost - feature, not when it is running locally. You probably need to know - only enough about this grungy feature to keep it from getting in your - way. -

- -

- The SIGINTs are basically tailored to the needs of GNU Chess 4 - on systems where its input polling code is broken or disabled. - Because they work in a rather peculiar way, it is recommended that you - either ignore SIGINT by having your engine call - signal(SIGINT, SIG_IGN), or disable it with the "feature" - command.

- -

- Here are details for the curious. If xboard needs to send a command - when it is the chess engine's move (such as before the "?" command), - it sends a SIGINT first. If xboard needs to send commands when it is - not the chess engine's move, but the chess engine may be pondering - (thinking on its opponent's time) or analyzing (analysis or analyze - file mode), xboard sends a SIGINT before the first such command only. - Another SIGINT is not sent until another move is made, even if xboard - issues more commands. This behavior is necessary for GNU Chess 4. The - first SIGINT stops it from pondering until the next move, but on some - systems, GNU Chess 4 will die if it receives a SIGINT when not - actually thinking or pondering. -

- -

- There are two reasons why WinBoard does not send the Win32 equivalent - of SIGINT (which is called CTRL_C_EVENT) to local - engines. First, the Win32 GNU Chess 4 port does not need it. Second, I - could not find a way to get it to work. Win32 seems to be designed - under the assumption that only console applications, not windowed - applications, would ever want to send a CTRL_C_EVENT. -

- -

8. Commands from xboard to the engine

- -

- All commands from xboard to the engine end with a newline (\n), even - where that is not explicitly stated. All your output to xboard must - be in complete lines; any form of prompt or partial line will cause - problems. -

- -

- At the beginning of each game, xboard sends an initialization string. - This is currently "new\nrandom\n" unless the user changes it with the - initString or secondInitString option. -

- -

- xboard normally reuses the same chess engine process for multiple - games. At the end of a game, xboard will send the "force" command - (see below) to make sure your engine stops thinking about the current - position. It will later send the initString again to start a new - game. If your engine can't play multiple games, you can disable reuse - - either with the "feature" command (beginning in protocol version - 2; see below) or - - with xboard's -xreuse (or -xreuse2) command line - option. xboard will then ask the process to quit after each game and - start a new process for the next game. -

- -
-
xboard -
This command will be sent once immediately after your engine - process is started. You can use it to put your engine into "xboard - mode" if that is needed. If your engine prints a prompt to ask for - user input, you must turn off the prompt and output a newline when the - "xboard" command comes in. -

- -

protover N -
- Beginning in protocol version 2 (in which N=2), this command will - be sent immediately after the "xboard" command. If you receive some - other command immediately after "xboard" (such as "new"), you can - assume that protocol version 1 is in use. The "protover" command is - the only new command that xboard always sends in version 2. All other - new commands to the engine are sent only if the engine first enables - them with the "feature" command. Protocol versions will always be - simple integers so that they can easily be compared. - -

Your engine should reply to the protover command by sending the - "feature" command (see below) with the list of non-default feature - settings that you require, if any. - -

Your engine should never refuse to run due to receiving a higher - protocol version number than it is expecting! New protocol versions - will always be compatible with older ones by default; the larger - version number is simply a hint that additional "feature" command - options added in later protocol versions may be accepted. - -

- -

accepted -
rejected -
- These commands may be sent to your engine in reply to the "feature" - command; see its documentation below. - -

- -

new -
Reset the board to the standard chess starting position. Set - White on move. Leave force mode and set the engine to play Black. - Associate the engine's clock with Black and the opponent's clock with - White. Reset clocks and time controls to the start of a new game. - Stop clocks. Do not ponder on this move, even if pondering is on. - Remove any search depth limit previously set by the sd command. -

- -

variant VARNAME -
If the game is not standard chess, but a variant, this command is - sent after "new" and before the first move or "edit" command. Currently - defined variant names are: - - -
wildcastleShuffle chess where king can castle from d file -
nocastleShuffle chess with no castling at all -
fischerandomFischer Random (not supported yet) -
bughouseBughouse, ICC/FICS rules -
crazyhouseCrazyhouse, ICC/FICS rules -
losersWin by losing all pieces or getting mated (ICC) -
suicideWin by losing all pieces including king, - or by having fewer pieces when one player has no legal moves (FICS) -
giveaway - Win by losing all pieces including king, - or by having no legal moves (ICC) -
twokingsWeird ICC wild 9 -
kriegspielKriegspiel (engines not supported) -
atomicAtomic -
3checkWin by giving check 3 times -
unknownUnknown variant (not supported) -
-

- -

quit -
The chess engine should immediately exit. This command is used - when xboard is itself exiting, and also between games if the -xreuse - command line option is given (or -xreuse2 for the second engine). - See also Signals above. -

- -

random -
This command is specific to GNU Chess 4. You can either ignore it - completely (that is, treat it as a no-op) or implement it as GNU Chess - does. The command toggles "random" mode (that is, it sets random = - !random). In random mode, the engine adds a small random value to its - evaluation function to vary its play. The "new" command sets random - mode off. -

- -

force -
Set the engine to play neither color ("force mode"). Stop clocks. - The engine should check that moves received in force mode are legal - and made in the proper turn, but should not think, ponder, or make - moves of its own. -

- -

go -
Leave force mode and set the engine to play the color that is on - move. Associate the engine's clock with the color that is on move, - the opponent's clock with the color that is not on move. Start the engine's - clock. Start thinking and eventually make a move. -

- -

playother -
- - (This command is new in protocol version 2. It is not - sent unless you enable it with the feature command.) - Leave force mode and set the engine to play the color that is not on - move. Associate the opponent's clock with the color that is on move, - the engine's clock with the color that is not on move. Start the opponent's - clock. If pondering is enabled, the engine should begin pondering. - If the engine later receives a move, it should start thinking and eventually - reply. - -

- -

white -
- - (This command is obsolete as of protocol version 2, but is still - sent in some situations to accommodate older engines unless you disable it - with the feature command.) - - Set White on move. Set the engine to play Black. Stop clocks. -

- -

black -
- - (This command is obsolete as of protocol version 2, but is still - sent in some situations to accommodate older engines unless you disable it - with the feature command.) - - Set Black on move. Set the engine to play White. Stop clocks. -

- -

level MPS BASE INC -
Set time controls. See the Time Control section below. -

- -

st TIME -
Set time controls. See the Time Control section - below. The commands "level" and "st" are not used together. -

- -

sd DEPTH -
The engine should limit its thinking to DEPTH ply. -

- -

time N -
Set a clock that always belongs to the engine. N is a number in - centiseconds (units of 1/100 second). Even if the engine changes to - playing the opposite color, this clock remains with the engine. -

- -

otim N - -
Set a clock that always belongs to the opponent. N is a number in - centiseconds (units of 1/100 second). Even if the opponent changes to - playing the opposite color, this clock remains with the opponent. -

- If needed for purposes of board display in force mode (where the - engine is not participating in the game) the time clock should be - associated with the last color that the engine was set to play, the - otim clock with the opposite color. -

- -

- - Beginning in protocol version 2, if you can't handle the time and - otim commands, you can use the "feature" command to disable them; see - below. - - The following techniques from older protocol versions also - work: You can ignore the time and otim commands (that is, treat them - as no-ops), or send back "Error (unknown command): time" the first - time you see "time". -

- -
MOVE -
See below for the syntax of moves. If the move is illegal, print - an error message; see the section "Commands from the engine to - xboard". If the move is legal and in turn, make it. If not in force - mode, stop the opponent's clock, start the engine's clock, start - thinking, and eventually make a move. -

- When xboard sends your engine a move, it normally sends coordinate - algebraic notation. Examples: -

- -
Normal moves:e2e4 -
Pawn promotion:e7e8q -
Castling:e1g1, e1c1, e8g8, e8c8 -
Bughouse/crazyhouse drop:P@h3 -
ICS Wild 0/1 castling:d1f1, d1b1, d8f8, d8b8 -
FischerRandom castling:O-O, O-O-O (oh, not zero) -
- -

- - Beginning in protocol version 2, you can use the feature command - to select SAN (standard algebraic notation) instead; for example, e4, - Nf3, exd5, Bxf7+, Qxf7#, e8=Q, O-O, or P@h3. Note that the last form, - P@h3, is a extension to the PGN standard's definition of SAN, which does - not support bughouse or crazyhouse. - -

- -

- xboard doesn't reliably detect illegal moves, because it does not keep - track of castling unavailability due to king or rook moves, or en - passant availability. If xboard sends an illegal move, send back an - error message so that xboard can retract it and inform the user; see - the section "Commands from the engine to xboard". -

- -
usermove MOVE -
- By default, moves are sent to the engine without a command name; - the notation is just sent as a line by itself. - Beginning in protocol version 2, you can use the feature command - to cause the command name "usermove" to be sent before the move. - Example: "usermove e2e4". - -

- -
? -
Move now. If your engine is thinking, it should move immediately; - otherwise, the command should be ignored (treated as a no-op). It - is permissible for your engine to always ignore the ? command. The - only bad consequence is that xboard's Move Now menu command will do - nothing. -

- It is also permissible for your engine to move immediately if it gets - any command while thinking, as long as it processes the command right - after moving, but it's preferable if you don't do this. For example, - xboard may send post, nopost, easy, hard, force, quit, - - or other commands - - while the engine is on move. -

- -
ping N -
- - In this command, N is a decimal number. When you receive the command, - reply by sending the string pong N, where N is the - same number you received. Important: You must not reply to a "ping" - command until you have finished executing all commands that you - received before it. Pondering does not count; if you receive a ping - while pondering, you should reply immediately and continue pondering. - Because of the way xboard uses the ping command, if you implement the - other commands in this protocol, you should never see a "ping" command - when it is your move; however, if you do, you must not send the "pong" - reply to xboard until after you send your move. For example, xboard - may send "?" immediately followed by "ping". If you implement the "?" - command, you will have moved by the time you see the subsequent ping - command. Similarly, xboard may send a sequence like "force", "new", - "ping". You must not send the pong response until after you have - finished executing the "new" command and are ready for the new game to - start. - -

- The ping command is new in protocol version 2 and will not be sent - unless you enable it with the "feature" command. Its purpose is to - allow several race conditions that could occur in previous versions of - the protocol to be fixed, so it is highly recommended that you - implement it. It is especially important in simple engines that do - not ponder and do not poll for input while thinking, but it is needed in all - engines. -

-
- -
draw -
The engine's opponent offers the engine a draw. To accept the - draw, send "offer draw". To decline, ignore the offer (that is, send - nothing). If you're playing on ICS, it's possible for the draw offer - to have been withdrawn by the time you accept it, so don't assume the - game is over because you accept a draw offer. Continue playing until - xboard tells you the game is over. See also "offer draw" below. -

- -

result RESULT {COMMENT} -
After the end of each game, xboard will send you a result command. - You can use this command to trigger learning. RESULT is either 1-0, - 0-1, 1/2-1/2, or *, indicating whether white won, black won, the game - was a draw, or the game was unfinished. The COMMENT string is purely - a human-readable comment; its content is unspecified and subject to - change. In ICS mode, it is passed through from ICS uninterpreted. - Example:
result 1-0 {White mates}
-

- Here are some notes on interpreting the "result" command. Some apply - only to playing on ICS ("Zippy" mode). -

- -

- If you won but did not just play a mate, your opponent must have - resigned or forfeited. If you lost but were not just mated, you - probably forfeited on time, or perhaps the operator resigned manually. - If there was a draw for some nonobvious reason, perhaps your opponent - called your flag when he had insufficient mating material (or vice - versa), or perhaps the operator agreed to a draw manually. -

- -

- You will get a result command even if you already know the game ended - -- for example, after you just checkmated your opponent. In fact, if - you send the "RESULT {COMMENT}" command (discussed below), you will - simply get the same thing fed back to you with "result" tacked in - front. You might not always get a "result *" command, however. In - particular, you won't get one in local chess engine mode when the user - stops playing by selecting Reset, Edit Game, Exit or the like. -

- -
setboard FEN -
- The setboard command is the new way to set up positions, beginning - in protocol version 2. It is not used unless it has been selected - with the feature command. Here FEN is a position in Forsythe-Edwards - Notation, as defined in the PGN standard. - -

Illegal positions: Note that either setboard or edit can - be used to send an illegal position to the engine. The user can - create any position with xboard's Edit Position command (even, say, - an empty board, or a board with 64 white kings and no black ones). - If your engine receives a position that it considers illegal, - I suggest that you send the response "tellusererror Illegal position", - and then respond to any attempted move with "Illegal move" until - the next new, edit, or setboard command.

-
-

- -

edit -
- - The edit command is the old way to set up positions. For compatibility - with old engines, it is still used by default, but new engines may prefer - to use the feature command (see below) to cause xboard to use setboard instead. - - The edit command puts the chess engine into a special mode, where - it accepts the following subcommands: - -
cchange current piece color, initially white -
Pa4 (for example)place pawn of current color on a4 -
xa4 (for example)empty the square a4 (not used by xboard) -
#clear board -
.leave edit mode -
- - See the Idioms section below for additional subcommands used in - ChessBase's implementation of the protocol. - - -

The edit command does not change the side to move. To set up a - black-on-move position, xboard uses the following command sequence: -

-
-     new
-     force
-     a2a3
-     edit
-     <edit commands>
-     .
- 
- -

- This sequence is used to avoid the "black" command, which is now - considered obsolete and which many engines never did implement as - specified in this document. -

- -

- After an edit command is complete, if a king and a rook are on their - home squares, castling is assumed to be available to them. En passant - capture is assumed to be illegal on the current move regardless of the - positions of the pawns. The clock for the 50 move rule starts at - zero, and for purposes of the draw by repetition rule, no prior - positions are deemed to have occurred. -

- -
hint -
If the user asks for a hint, xboard sends your engine the command - "hint". Your engine should respond with "Hint: xxx", where xxx is a - suggested move. If there is no move to suggest, you can ignore the - hint command (that is, treat it as a no-op). -

- -

bk -
If the user selects "Book" from the xboard menu, xboard will send - your engine the command "bk". You can send any text you like as the - response, as long as each line begins with a blank space or tab (\t) - character, and you send an empty line at the end. The text pops up in - a modal information dialog. -

- -

undo -
If the user asks to back up one move, xboard will send you the - "undo" command. xboard will not send this command without putting you - in "force" mode first, so you don't have to worry about what should - happen if the user asks to undo a move your engine made. (GNU Chess 4 - actually switches to playing the opposite color in this case.) -

- -

remove -
If the user asks to retract a move, xboard will send you the - "remove" command. It sends this command only when the user is on - move. Your engine should undo the last two moves (one for each - player) and continue playing the same color. -

- -

hard -
Turn on pondering (thinking on the opponent's time, also known as - "permanent brain"). xboard will not make any assumption about what - your default is for pondering or whether "new" affects this setting. -

- -

easy -
Turn off pondering. -

- -

post -
Turn on thinking/pondering output. - See Thinking Output section. -

- -

nopost -
Turn off thinking/pondering output. -

- -

analyze -
Enter analyze mode. See Analyze Mode section. -

- -

name X
This command informs the engine of its - opponent's name. When the engine is playing on a chess server, xboard - obtains the opponent's name from the server. - - When the engine is - playing locally against a human user, xboard obtains the user's login - name from the local operating system. When the engine is playing - locally against another engine, xboard uses either the other engine's - filename or the name that the other engine supplied in the myname - option to the feature command. By default, xboard uses the name - command only when the engine is playing on a chess server. Beginning - in protocol version 2, you can change this with the name option to the - feature command; see below. - -

- -

rating -
In ICS mode, xboard obtains the ICS opponent's rating from the - "Creating:" message that appears before each game. (This message may - not appear on servers using outdated versions of the FICS code.) In - Zippy mode, it sends these ratings on to the chess engine using the - "rating" command. The chess engine's own rating comes first, and if - either opponent is not rated, his rating is given as 0. - - In the future this command may also be used in other modes, if ratings - are known. - - Example:
rating 2600 1500
-

- -

ics HOSTNAME -
- If HOSTNAME is "-", the engine is playing against a local - opponent; otherwise, the engine is playing on an Internet Chess Server - (ICS) with the given hostname. This command is new in protocol - version 2 and is not sent unless the engine has enabled it with - the "feature" command. Example: "ics freechess.org" - -

- -

computer -
The opponent is also a computer chess engine. Some engines alter - their playing style when they receive this command. -

- -

pause -
resume -
(These commands are new in protocol - version 2 and will not be sent unless feature pause=1 is set. At - this writing, xboard actually does not use the commands at all, but it - or other interfaces may use them in the future.) - The "pause" command puts the engine into a special state where it - does not think, ponder, or otherwise consume significant CPU time. - The current thinking or pondering (if any) is suspended and both - player's clocks are stopped. The only command that the interface may - send to the engine while it is in the paused state is "resume". The - paused thinking or pondering (if any) resumes from exactly where it - left off, and the clock of the player on move resumes running from - where it stopped. - -
- -

Bughouse commands:

- -

- xboard now supports bughouse engines when in Zippy mode. See - zippy.README for information on Zippy mode and how to turn on the - bughouse support. The bughouse move format is given above. xboard - sends the following additional commands to the engine when in bughouse - mode. - Commands to inform your engine of the partner's game state may - be added in the future. -

- -
-
partner <player> -
<player> is now your partner for future games. Example:
partner mann
-

- -

partner -
Meaning: You no longer have a partner. -

- -

ptell <text> -
Your partner told you <text>, either with a ptell or an ordinary tell. -

- -

holding [<white>] [<black>] -
White currently holds <white>; black currently holds <black>. - Example:
holding [PPPRQ] []
- -
holding [<white>] [<black>] <color><piece> -
White currently holds <white>; black currently holds <black>, after - <color> acquired <piece>. Example:
holding [PPPRQ] [R] BR
-
- -

9. Commands from the engine to xboard

- -

- - In general, an engine should not send any output to xboard that is not - described in this document. As the protocol is extended, newer - versions of xboard may recognize additional strings as commands that - were previously not assigned a meaning. - -

- -
-
- feature FEATURE1=VALUE1 FEATURE2=VALUE2 ... - - -
- Beginning with version 2, the protocol includes the "feature" - command, which lets your engine control certain optional protocol - features. Feature settings are written as FEATURE=VALUE, where - FEATURE is a name from the list below and VALUE is the value to be - assigned. Features can take string, integer, or boolean values; the - type of value is listed for each feature. String values are written - in double quotes (for example, feature myname="Miracle Chess - 0.9"), integers are written in decimal, and boolean values are - written as 0 for false, 1 for true. Any number of features can be set - in one feature command, or multiple feature commands can be given. - -

- Your engine should send one or more feature commands immediately after - receiving the "protover" command, since xboard needs to know the - values of some features before sending further commands to the engine. - Because engines that predate protocol version 2 do not send "feature", - xboard uses a timeout mechanism: when it first starts your engine, it - sends "xboard" and "protover N", then listens for feature commands for - two seconds before sending any other commands. To end this timeout - and avoid the wait, set the feature "done=1" at the end of your last - feature command. To increase the timeout, if needed, set the feature - "done=0" before your first feature command and "done=1" at the end. - If needed, it is okay for your engine to set done=0 soon as it starts, - even before it receives the xboard and protover commands. This can be - useful if your engine takes a long time to initialize itself. It - should be harmless even if you are talking to a (version 1) user - interface that does not understand the "feature" command, since such - interfaces generally ignore commands from the engine that they do not - understand. -

- -

- The feature command is designed to let the protocol change without - breaking engines that were written for older protocol versions. When - a new feature is added to the protocol, its default value is always - chosen to be compatible with older versions of the protocol that did - not have the feature. Any feature that your engine does not set in a - "feature" command retains its default value, so as the protocol - changes, you do not have to change your engine to keep up with it - unless you want to take advantage of a new feature. Because some - features are improvements to the protocol, while others are meant to - cater to engines that do not implement all the protocol features, the - recommended setting for a feature is not always the same as the - default setting. The listing below gives both default and recommended - settings for most features. -

- -

- You may want to code your engine so as to be able to work with - multiple versions of the engine protocol. Protocol version 1 does not - send the protover command and does not implement the feature command; - if you send a feature command in protocol version 1, it will have no - effect and there will be no response. In protocol version 2 or later, - each feature F that you set generates the response "accepted F" if the - feature is implemented, or "rejected F" if it is not. Thus an engine - author can request any feature without having to keep track of which - protocol version it was introduced in; you need only check whether the - feature is accepted or rejected. This mechanism also makes it - possible for a user interface author to implement a subset of a - protocol version by rejecting some features that are defined in that - version; however, you should realize that engine authors are likely to - code for xboard and may not be prepared to have a feature that they - depend on be rejected. -

- -

- Here are the features that are currently defined. -

-
- -
-
- ping (boolean, default 0, recommended 1) - -
- If ping=1, xboard may use the protocol's new "ping" command; - if ping=0, xboard will not use the command. - - -
- setboard (boolean, default 0, recommended 1) - -
- If setboard=1, xboard will use the protocol's new "setboard" command - to set up positions; if setboard=0, it will use the older "edit" command. - - -
- playother (boolean, default 0, recommended 1) - -
- If playother=1, xboard will use the protocol's new "playother" command - when appropriate; if playother=0, it will not use the command. - - -
- san (boolean, default 0) - -
- If san=1, xboard will send moves to the engine in standard algebraic - notation (SAN); for example, Nf3. If san=0, xboard will send moves in - coordinate notation; for example, g1f3. See MOVE in - section 8 above for more details of both kinds of notation. - - -
- usermove (boolean, default 0) - -
- If usermove=1, xboard will send moves to the engine with the - command "usermove MOVE"; if usermove=0, xboard will send just the move, - with no command name. - - -
- time (boolean, default 1, recommended 1) - -
- If time=1, xboard will send the "time" and "otim" commands to - update the engine's clocks; if time=0, it will not. - - -
- draw (boolean, default 1, recommended 1) - -
- If draw=1, xboard will send the "draw" command if the engine's opponent - offers a draw; if draw=0, xboard will not inform the engine about - draw offers. Note that if draw=1, you may receive a draw offer while you - are on move; if this will cause you to move immediately, you should set - draw=0. - - -
- sigint (boolean, default 1) - -
- If sigint=1, xboard may send SIGINT (the interrupt signal) to - the engine as section 7 above; if sigint=0, it will - not. - - -
- sigterm (boolean, default 1) - -
- If sigterm=1, xboard may send SIGTERM (the termination signal) to - the engine as section 7 above; if sigterm=0, it will - not. - - -
- reuse (boolean, default 1, recommended 1) - -
- If reuse=1, xboard may reuse your engine for multiple games. If - reuse=0 (or if the user has set the -xreuse option on xboard's command - line), xboard will kill the engine process after every game and start - a fresh process for the next game. - - -
- analyze (boolean, default 1, recommended 1) - -
- If analyze=0, xboard will not try to use the "analyze" command; it - will pop up an error message if the user asks for analysis mode. If - analyze=1, xboard will try to use the command if the user asks for - analysis mode. - - -
- myname (string, default determined from engine filename) - -
- This feature lets you set the name that xboard will use for your - engine in window banners, in the PGN tags of saved game files, and when - sending the "name" command to another engine. - - -
- variants (string, see text below) - -
- This feature indicates which chess variants your engine accepts. - It should be a comma-separated list of variant names. See the table - under the "variant" command in section 8 above. If - you do not set this feature, xboard will assume by default that your - engine supports all variants. (However, the -zippyVariants - command-line option still limits which variants will be accepted in - Zippy mode.) It is recommended that you set this feature to the - correct value for your engine (just "normal" in most cases) rather - than leaving the default in place, so that the user will get an - appropriate error message if he tries to play a variant that your - engine does not support. - - -
- colors (boolean, default 1, recommended 0) - -
- If colors=1, xboard uses the obsolete "white" and "black" - commands in a stylized way that works with most older chess engines - that require the commands. See the "Idioms" section - below for details. If colors=0, xboard does not use the "white" and - "black" commands at all. - - -
- ics (boolean, default 0) - -
- If ics=1, xboard will use the protocol's new "ics" command - to inform the engine of whether or not it is playing on a chess server; - if ics=0, it will not. - - -
- name (boolean, see text below) - -
- If name=1, xboard will use the protocol's "name" command - to inform the engine of the opponent's name; if name=0, it will not. - By default, name=1 if the engine is playing on a chess server; name=0 if not. - - -
- pause (boolean, default 0) - -
- If pause=1, xboard may use the protocol's new "pause" command; - if pause=0, xboard assumes that the engine does not support this command. - - -
- done (integer, no default) - -
- If you set done=1 during the initial two-second timeout after - xboard sends you the "xboard" command, the - timeout will end and xboard will not look for any more feature - commands before starting normal operation. - If you set done=0, the initial timeout is increased to one hour; - in this case, you must set done=1 before xboard will enter normal operation. - -
-

- -

Illegal move: MOVE -
Illegal move (REASON): MOVE -
If your engine receives a MOVE command that is recognizably a move - but is not legal in the current position, your engine must print an - error message in one of the above formats so that xboard can pass the - error on to the user and retract the move. The (REASON) is entirely - optional. Examples: - -
-   Illegal move: e2e4
-   Illegal move (in check): Nf3
-   Illegal move (moving into check): e1g1
- 
-

- Generally, xboard will never send an ambiguous move, so it does not - matter whether you respond to such a move with an Illegal move message - or an Error message. -

- -
Error (ERRORTYPE): COMMAND -
If your engine receives a command it does not understand or does - not implement, it should print an error message in the above format so - that xboard can parse it. Examples: -
-   Error (ambiguous move): Nf3
-   Error (unknown command): analyze
-   Error (command not legal now): undo
-   Error (too many parameters): level 1 2 3 4 5 6 7
- 
- -
move MOVE -
Your engine is making the move MOVE. Do not echo moves from - xboard with this command; send only new moves made by the engine. - - -

For the actual move text from your chess engine (in place of MOVE - above), your move should be either -

    -
  • in coordinate notation (e.g., - e2e4, e7e8q) with castling indicated by the King's two-square move (e.g., - e1g1), or -
  • in Standard Algebraic Notation (SAN) as defined in the - Portable Game Notation standard (e.g, e4, Nf3, O-O, cxb5, Nxe4, e8=Q), - with the extension piece@square (e.g., P@f7) to handle piece placement - in bughouse and crazyhouse. -
- xboard itself also accepts some variants of SAN, but for compatibility - with non-xboard interfaces, it is best not to rely on this behavior. -

- -

Warning: Even though all versions of this protocol specification - have indicated that xboard accepts SAN moves, some non-xboard - interfaces are known to accept only coordinate notation. See the - Idioms section for more information on the known limitations of some - non-xboard interfaces. It should be safe to send SAN moves if you - receive a "protover 2" (or later) command from the interface, but - otherwise it is best to stick to coordinate notation for maximum - compatibility. An even more conservative approach would be for your - engine to send SAN to the interface only if you have set feature san=1 - (which causes the interface to send SAN to you) and have received - "accepted san" in reply. -

-
- -
RESULT {COMMENT}
When your engine detects - that the game has ended by rule, your engine must output a line of the - form "RESULT {comment}" (without the quotes), where RESULT is a PGN - result code (1-0, 0-1, or 1/2-1/2), and comment is the reason. Here - "by rule" means that the game is definitely over because of what - happened on the board. In normal chess, this includes checkmate, - stalemate, triple repetition, the 50 move rule, or insufficient - material; it does not include loss on time or the like. - Examples: -
-   0-1 {Black mates}
-   1-0 {White mates}
-   1/2-1/2 {Draw by repetition}
-   1/2-1/2 {Stalemate}
- 
- -

- xboard relays the result to the user, the ICS, the other engine in Two - Machines mode, and the PGN save file as required. -

- -
resign -
If your engine wants to resign, it can send the command "resign". - Alternatively, it can use the "RESULT {comment}" command if the string - "resign" is included in the comment; for example "0-1 {White - resigns}". xboard relays the resignation to the user, the ICS, the - other engine in Two Machines mode, and the PGN save file as required. -

- -

offer draw -
If your engine wants to offer a draw by agreement (as opposed to - claiming a draw by rule), it can send the command "offer draw". - xboard relays the offer to the user, the ICS, the other engine in Two - Machines mode, and the PGN save file as required. In Machine White, - Machine Black, or Two Machines mode, the offer is considered valid - until your engine has made two more moves. -

- -

tellopponent MESSAGE -
- This command lets the engine give a message to its opponent, - independent of whether the opponent is a user on the local machine or - a remote ICS user (Zippy mode). MESSAGE consists of any characters, - including whitespace, to the end of the line. When the engine is - playing against a user on the local machine, xboard pops up an - information dialog containing the message. When the engine is playing - against an opponent on the ICS (Zippy mode), xboard sends "say - MESSAGE\n" to the ICS. -

- -

tellothers MESSAGE -
This command lets the engine give a message to people watching the - game other than the engine's opponent. MESSAGE consists of any - characters, including whitespace, to the end of the line. When the - engine is playing against a user on the local machine, this command - does nothing. When the engine is playing against an opponent on the - ICS (Zippy mode), xboard sends "whisper MESSAGE\n" to the ICS. -

- -

tellall MESSAGE -
This command lets the engine give a message to its opponent and - other people watching the game, - independent of whether the opponent is a user on the local machine or - a remote ICS user (Zippy mode). MESSAGE consists of any characters, - including whitespace, to the end of the line. When the engine is - playing against a user on the local machine, xboard pops up an - information dialog containing the message. When the engine is playing - against an opponent on the ICS (Zippy mode), xboard sends "kibitz - MESSAGE\n" to the ICS. - -

- -

telluser MESSAGE -
xboard pops up an information dialog containing the message. - MESSAGE consists of any characters, including whitespace, to the end - of the line. -

- -

tellusererror MESSAGE -
xboard pops up an error dialog containing the message. - MESSAGE consists of any characters, including whitespace, to the end - of the line. -

- -

askuser REPTAG MESSAGE -
Here REPTAG is a string containing no whitespace, and MESSAGE - consists of any characters, including whitespace, to the end of the - line. xboard pops up a question dialog that says MESSAGE and - has a typein box. If the user types in "bar", xboard sends "REPTAG - bar" to the engine. The user can cancel the dialog and send nothing. -

- -

tellics MESSAGE -
In Zippy mode, xboard sends "MESSAGE\n" to ICS. MESSAGE consists - of any characters, including whitespace, to the end of the line. -

- -

tellicsnoalias MESSAGE -
- In Zippy mode, xboard sends "xMESSAGE\n" to ICS, where "x" is a - character that prevents the ICS from expanding command aliases, if - xboard knows of such a character. (On chessclub.com and chess.net, - "/" is used; on freechess.org, "$" is used.) MESSAGE consists of any - characters, including whitespace, to the end of the line. - -
-

- -

10. Thinking Output

- -

- If the user asks your engine to "show thinking", xboard sends your - engine the "post" command. It sends "nopost" to turn thinking off. - In post mode, your engine sends output lines to show the progress of - its thinking. The engine can send as many or few of these lines as it - wants to, whenever it wants to. Typically they would be sent when the - PV (principal variation) changes or the depth changes. The thinking - output should be in the following format: -

- -
ply score time nodes pv
- - Where: - -
plyInteger giving current search depth. -
scoreInteger giving current evaluation in centipawns. -
timeCurrent search time in centiseconds (ex: - 1028 = 10.28 seconds). - -
nodesNodes searched. -
pvFreeform text giving current "best" line. - You can continue the pv onto another line if you start each - continuation line with at least four space characters. -
- -

- Example: -

- -
  9 156 1084 48000 Nf3 Nc6 Nc3 Nf6
- -

- Meaning: -

- - 9 ply, score=1.56, time = 10.84 seconds, nodes=48000, - PV = "Nf3 Nc6 Nc3 Nf6" - -

- Longer example from actual Crafty output: -

-
-   4    109      14   1435  1. e4 d5 2. Qf3 dxe4 3. Qxe4 Nc6
-   4    116      23   2252  1. Nf3 Nc6 2. e4 e6
-   4    116      27   2589  1. Nf3 Nc6 2. e4 e6
-   5    141      44   4539  1. Nf3 Nc6 2. O-O e5 3. e4
-   5    141      54   5568  1. Nf3 Nc6 2. O-O e5 3. e4
- 
- -

- You can use the PV to show other things; for instance, while in book, - Crafty shows the observed frequency of different reply moves in its - book. In situations like this where your engine is not really - searching, start the PV with a '(' character: -

- -
-   0      0       0      0  (e4 64%, d4 24%)
- 
- -

- GNU Chess output is very slightly different. The ply number is - followed by an extra nonblank character, and the time is in seconds, - not hundredths of seconds. For compatibility, xboard accepts the - extra character and takes it as a flag indicating the different time - units. Example: -

- -
-  2.     14    0       38   d1d2  e8e7
-  3+     78    0       65   d1d2  e8e7  d2d3
-  3&     14    0       89   d1d2  e8e7  d2d3
-  3&     76    0      191   d1e2  e8e7  e2e3
-  3.     76    0      215   d1e2  e8e7  e2e3
-  4&     15    0      366   d1e2  e8e7  e2e3  e7e6
-  4.     15    0      515   d1e2  e8e7  e2e3  e7e6
-  5+     74    0      702   d1e2  f7f5  e2e3  e8e7  e3f4
-  5&     71    0     1085   d1e2  e8e7  e2e3  e7e6  e3f4
-  5.     71    0     1669   d1e2  e8e7  e2e3  e7e6  e3f4
-  6&     48    0     3035   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4
-  6.     48    0     3720   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4
-  7&     48    0     6381   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4
-  7.     48    0    10056   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4
-  8&     66    1    20536   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5
-  8.     66    1    24387   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5
-  9&     62    2    38886   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4
-                            d4e4
-  9.     62    4    72578   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4
-                            d4e4
- 10&     34    7   135944   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4
-                            d4e4  f7f5  e4f4
- 10.     34    9   173474   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4
-                            d4e4  f7f5  e4f4
- 
- -

If your engine is pondering (thinking on its opponent's time) in post - mode, it can show its thinking then too. In this case your engine may - omit the hint move (the move it is assuming its opponent will make) - from the thinking lines if and only if it sends xboard the move in - the usual "Hint: xxx" format before sending the first line. -

- -

11. Time control

- -

- xboard supports three styles of time control: conventional chess clocks, - the ICS-style incremental clock, and an exact number of seconds per move. -

- -

In conventional clock mode, every time control period is the same. - That is, if the time control is 40 moves in 5 minutes, then after each - side has made 40 moves, they each get an additional 5 minutes, and so - on, ad infinitum. At some future time it would be nice to support a - series of distinct time controls. This is very low on my personal - priority list, but code donations to the xboard project are accepted, - so feel free to take a swing at it. I suggest you talk to me first, - though. -

- -

- The command to set a conventional time control looks like this: -

- -
-   level 40 5 0
-   level 40 0:30 0
- 
- -

- The 40 means that there are 40 moves per time control. The 5 means - there are 5 minutes in the control. In the second example, the 0:30 - means there are 30 seconds. The final 0 means that we are in - conventional clock mode. -

- -

- The command to set an incremental time control looks like this: -

- -
-   level 0 2 12
- 
- -

- Here the 0 means "play the whole game in this time control period", - the 2 means "base=2 minutes", and the 12 means "inc=12 seconds". As - in conventional clock mode, the second argument to level can be in - minutes and seconds. -

- -

- At the start of the game, each player's clock is set to base minutes. - Immediately after a player makes a move, inc seconds are added to his - clock. A player's clock counts down while it is his turn. Your flag - can be called whenever your clock is zero or negative. (Your clock - can go negative and then become positive again because of the - increment.) -

- -

- A special rule on some ICS implementations: if you ask for a game with - base=0, the clocks really start at 10 seconds instead of 0. xboard - itself does not know about this rule, so it passes the 0 on to the - engine instead of changing it to 0:10. -

- -

- ICS also has time odds games. With time odds, each player has his own - (base, inc) pair, but otherwise things work the same as in normal - games. The Zippy xboard accepts time odds games but ignores the fact - that the opponent's parameters are different; this is perhaps not - quite the right thing to do, but gnuchess doesn't understand time - odds. Time odds games are always unrated. -

- -

- The command to set an exact number of seconds per move looks like this: -

- -
-   st 30
- 
- -

- This means that each move must be made in at most 30 seconds. Time not used - on one move does not accumulate for use on later moves. -

- -

12. Analyze Mode

- -

xboard supports analyzing fresh games, edited positions, and games - from files. However, all of these look the same from the chess - engine's perspective. Basically, the engine just has to respond to the - "analyze" command. - - Beginning in protocol version 2, - if your engine does not support analyze mode, it should use - the feature command to set analyze=0. - - The older method of - printing the error message "Error (unknown command): analyze" in - response to the "analyze" command will also work, however. -

- -

- To enter analyze mode, xboard sends the command sequence "post", "analyze". - Analyze mode in your engine should be - similar to force mode, except that your engine thinks about what move - it would make next if it were on move. Your engine should accept the - following commands while in analyze mode: -

- -
    -
  • Any legal move, as in force mode -
  • undo   Back up one move and analyze previous position. -
  • new   Reset position to start of game but stay in analyze mode. -
  • setboard if you have set feature setboard=1; otherwise edit. Exiting edit mode returns to analyze mode. - -
  • exit   Leave analyze mode. -
  • .   Send a search status update (optional); see below. -
  • - bk   Show book moves from this position, - if any; see above. -
  • - hint   Show the predicted move from this - position, if any; see above. -
- -

- If the user selects "Periodic Updates", xboard will send the string - ".\n" to the chess engine periodically during analyze mode, unless the - last PV received began with a '(' character. -

- -

- The chess engine should respond to ".\n" with a line like this: -

- -
- stat01: time nodes ply mvleft mvtot mvname
- 
- - Where: - -
timeElapsed search time in centiseconds (ie: 567 = 5.67 seconds). -
nodesNodes searched so far. -
plySearch depth so far. -
mvleftNumber of moves left to consider at this depth. -
mvtotTotal number of moves to consider. -
mvname - Move currently being considered (SAN or coordinate notation). Optional; - added in protocol version 2. -
- -

- Examples: -

-
-   stat01: 1234 30000 7 5 30
-   stat01: 1234 30000 7 5 30 Nf3
- 
- -

- Meaning: -

- -

After 12.34 seconds, I've searched 7 ply/30000 nodes, there are a - total of 30 legal moves, and I have 5 more moves to search - before going to depth 8. In the second example, of the 30 legal - moves, the one I am currently searching is Nf3.

- -

- Implementation of the "." command is optional. If the engine does not - respond to the "." command with a "stat01..." line, xboard will stop - sending "." commands. If the engine does not implement this command, - the analysis window will use a shortened format to display the engine - info. -

- -

- To give the user some extra information, the chess engine can output - the strings "++\n" and "--\n", to indicate that the current search is - failing high or low, respectively. You don't have to send anything - else to say "Okay, I'm not failing high/low anymore." xboard will - figure this out itself. -

- -

13. Idioms and backward compatibility features

- -

- Some engines have variant interpretations of the force/go/white/black, - time/otim, and hard/easy command sets. - In order to accommodate these older engines, xboard uses these commands - only according to the stylized patterns ("idioms") given in this section. - The obsolete white and black commands - have historically been particularly troublesome, and it is recommended - that new engines set the feature colors=0 and/or ignore the commands. -

- -
- -
time N -
otim N -
MOVE -
Sent when the opponent makes a move and the engine is already - playing the opposite color. -

- -

white -
go -
Sent when the engine is in force mode or playing Black but should - switch to playing White. This sequence is sent only when White is - already on move. - - If you set the feature colors=0, "white" is not sent. - -

- -

black -
go -
Sent when the engine is in force mode or playing White but should - switch to playing Black. This sequence is sent only when Black is - already on move. - - If you set the feature colors=0, "black" is not sent. - -

- -

white -
time N -
otim N -
black -
go -
Sent when Black is on move, the engine is in force mode or playing - White, and the engine's clock needs to be updated before it starts - playing. - The initial "white" is a kludge to accommodate GNU Chess - 4's variant interpretation of these commands. - - If you set the feature colors=0, "white" and "black" are not sent. - -

- -

black -
time N -
otim N -
white -
go -
Sent when White is on move, the engine is in force mode or playing - Black, and the engine's clock needs to be updated before it starts - playing. See previous idiom. - The initial "black" is a kludge to accommodate GNU Chess - 4's variant interpretation of these commands. - - If you set the feature colors=0, "black" and "white" are not sent. - -

- -

hard -
easy -
Sent in sequence to turn off pondering if xboard is not sure - whether it is on. When xboard is sure, it will send "hard" or "easy" - alone. xboard does this because "easy" is a toggle in GNU Chess 4 but - "hard" is an absolute on. - -
- -

- To support older engines, certain additional commands from the engine - to xboard are also recognized. (These are commands by themselves, not - values to be placed in the comment field of the PGN result code.) - These forms are not recommended for new engines; use the PGN result - code commands or the resign command instead. -

- - -
Command Interpreted as -
White resigns 0-1 {White resigns} -
Black resigns 1-0 {Black resigns} -
White 1-0 {White mates} -
Black 0-1 {Black mates} -
Draw 1/2-1/2 {Draw} -
computer mates 1-0 {White mates} or 0-1 {Black mates} -
opponent mates 1-0 {White mates} or 0-1 {Black mates} -
computer resigns 0-1 {White resigns} or 1-0 {Black resigns} -
game is a draw 1/2-1/2 {Draw} -
checkmate 1-0 {White mates} or 0-1 {Black mates} -
- -

- Commands in the above table are recognized if they begin a line and - arbitrary characters follow, so (for example) "White mates" will be - recognized as "White", and "game is a draw by the 50 move rule" will - be recognized as "game is a draw". All the commands are - case-sensitive. -

- -

- An alternative move syntax is also recognized: -

- - -
Command Interpreted as -
NUMBER ... MOVE move MOVE -
- -

- Here NUMBER means any string of decimal digits, optionally ending in a - period. MOVE is any string containing no whitespace. In this command - format, xboard requires the "..." even if your engine is playing - White. A command of the form NUMBER MOVE will be ignored. This odd - treatment of the commands is needed for compatibility with gnuchessx. - The original reasons for it are lost in the mists of time, but I - suspect it was originally a bug in the earliest versions of xboard, - before I started working on it, which someone "fixed" in the wrong - way, by creating a special version of gnuchess (gnuchessx) instead of - changing xboard. -

- -

- Any line that contains the words "offer" and "draw" is recognized as - "offer draw". -

- -

- The "Illegal move" message is recognized even if spelled "illegal - move" and even if the colon (":") is omitted. This accommodates GNU - Chess 4, which prints messages like "Illegal move (no matching - move)e2e4", and old versions of Crafty, which print just "illegal move". -

- -

- In Zippy mode, for compatibility with older versions of Crafty, - xboard passes through to ICS any line that begins "kibitz", "whisper", - "tell", or "draw". Do not use this feature in new code. Instead, use the - commands "tellall", "tellothers", "tellopponent", "tellics" (if needed), - "1/2-1/2 {COMMENT}", or "offer draw", as appropriate. -

- -

- - If the engine responds to the "sd DEPTH" command with an error message - indicating the command is not supported (such as "Illegal move: sd"), - xboard sets an internal flag and subsequently uses the command - "depth\nDEPTH" instead, for the benefit of GNU Chess 4. Note the - newline in the middle of this command! New engines should not rely on - this feature. - -

- -

- - If the engine responds to the "st TIME" command with an error message - indicating the command is not supported (such as "Illegal move: st"), - xboard sets an internal flag and subsequently uses the command "level - 1 TIME" instead, for the benefit of GNU Chess 4. Note that this is - not a standard use of the level command, as TIME seconds are not added - after each player makes 1 move; rather, each move is made in at most - TIME seconds. New engines should not implement or rely on this - feature. - -

- - -

- In support of the -firstHost/-secondHost features, which allow a chess - engine to be run on another machine using the rsh protocol, xboard recognizes - error messages that are likely to come from rsh as fatal errors. The following - messages are currently recognized: -

- -
- unknown host
- No remote directory
- not found
- No such file
- can't alloc
- Permission denied
-
-
- -

- - ChessBase/Fritz now implements the xboard/winboard protocol and can use - WinBoard-compatible engines in its GUI. ChessBase's version of the - protocol is generally the same as version 1, except that they have - added the commands fritz, reset, and - ponder, and the edit subcommands - castle and ep. If you want your - engine to work well with the ChessBase/Fritz GUI, you may need to - implement these additional commands, and you should also be aware of - the peculiar way that ChessBase uses the protocol. See their web page for documentation. - -

- -

- - ChessMaster 8000 also implements version 1 of the xboard/winboard - protocol and can use WinBoard-compatible engines. The original - release of CM8000 also has one additional restriction: only pure - coordinate notation (e.g., e2e4) is accepted in the move command. A - patch to correct this should be available from The Learning Company - (makers of CM8000) in February 2001. - -

- -
-
converted to HTML by Steffen A. Jakob
- - + + + Chess Engine Communication Protocol + + + +
+

Chess Engine Communication Protocol

+

Discussion Proposal

+

Tim Mann & H.G.Muller

+

+ $Id: engine-intf.html,v 2.1 2003/10/27 19:21:00 mann Exp $
+ Version 2; implemented in xboard/WinBoard 4.2.1 and later.
+ Changes since version 1 are indicated in red.
+ Changes for WinBoard 4.3.xx are indicated in green.
+ Proposed changes, implemented only in alpha versions are indicated in blue. +


+ + + +
+ +

1. Introduction

+ +

+ This document is a set of rough notes on the protocol that xboard and + WinBoard use to communicate with gnuchessx and other chess engines. + These notes may be useful if you want to connect a different chess + engine to xboard. Throughout the notes, "xboard" means both xboard + and WinBoard except where they are specifically contrasted. +

+ +

+ There are two reasons I can imagine someone wanting to do this: +

+
    +
  1. You have, or are developing, a chess engine but you don't want to + write your own graphical interface. +
  2. You have, or are developing,a chess engine, and you want to + interface it to the Internet Chess Server. +
+ +

+ In case (2), if you are using xboard, you will need to configure the + "Zippy" code into it, but WinBoard includes this code already. See + the file zippy.README + in the xboard or WinBoard distribution for more information. + +

+ +

+ These notes are unpolished, but I've attempted to make them complete + in this release. If you notice any errors, omissions, or misleading + statements, let me know. +

+ +

+ I'd like to hear from everyone who is trying to interface their own -chess engine to xboard/WinBoard. Please email me, -tim@tim-mann.org. Also, please join -the mailing list for authors of xboard/WinBoard compatible chess -engines. The list is now hosted by Yahoo Groups; you can join at http://www.egroups.com/group/chess-engines, or you can read the ++chess engine to xboard/WinBoard. Please join the mailing list for ++authors of xboard/WinBoard compatible chess engines and post a message ++about what you're doing. The list is now hosted by Yahoo Groups; you ++can join at http://groups.yahoo.com/group/chess-engines, or you can read the + list there without joining. The list is filtered to prevent spam. +

+

+ -Note that the WinBoard 4.3.xx line is developed independently of the ++Note that the WinBoard 4.3.xx line was developed independently of the + original GNU project, by H.G.Muller. + If you have questions about WinBoard 4.3.xx, or want to report bugs in it, + report them in the appropriate section of the + WinBoard forum. + +

+ +

2. Connection

+ +

+ An xboard chess engine runs as a separate process from xboard itself, + connected to xboard through a pair of anonymous pipes. The engine + does not have to do anything special to set up these pipes. xboard + sets up the pipes itself and starts the engine with one pipe as its + standard input and the other as its standard output. The engine then + reads commands from its standard input and writes responses to its + standard output. This is, unfortunately, a little more complicated to + do right than it sounds; see section 6 below. +

+ +

+ And yes, contrary to some people's expectations, exactly the same + thing is true for WinBoard. Pipes and standard input/output are + implemented in Win32 and work fine. You don't have to use DDE, COM, + DLLs, BSOD, or any of the other infinite complexity that + Microsoft has created just to talk between two programs. A WinBoard + chess engine is a Win32 console program that simply reads from its + standard input and writes to its standard output. See sections + 5 and 6 below for additional details. +

+ +

3. Debugging

+ +

+ To diagnose problems in your engine's interaction with xboard, use the + -debug flag on xboard's command line to see the messages that are + being exchanged. In WinBoard, these messages are written to the file + WinBoard.debug instead of going to the screen. +

+ +

+ You can turn debug mode on or off while WinBoard is running by + pressing Ctrl+Alt+F12. You can turn debug mode on or off while xboard + is running by binding DebugProc to a shortcut key (and pressing the + key!); see the instructions on shortcut keys in the xboard man page. +

+ +

+ While your engine is running under xboard/WinBoard, you can send a + command directly to the engine by pressing Shift+1 (xboard) or Alt+1 + (WinBoard 4.0.3 and later). This brings up a dialog that you can type + your command into. Press Shift+2 (Alt+2) instead to send to the + second chess engine in Two Machines mode. On WinBoard 4.0.2 and earlier, + Ctrl+Alt is used in place of Alt; this had to be changed due to a conflict + with typing the @-sign on some European keyboards. +

+ +

4. How it got this way

+ +

+ Originally, xboard was just trying to talk to the existing + command-line interface of GNU Chess 3.1+ and 4, which was designed + for people to type commands to. So the communication protocol is very + ad-hoc. It might have been good to redesign it early on, but because + xboard and GNU Chess are separate programs, I didn't want to force + people to upgrade them together to versions that matched. I + particularly wanted to keep new versions of xboard working with old + versions of GNU Chess, to make it easier to compare the play of old + and new gnuchess versions. I didn't foresee the need for a clean + protocol to be used with other chess engines in the future. +

+ +

+ Circumstances have changed over the years, and now there are many more + engines that work with xboard. I've had to make the protocol + description more precise, I've added some features that GNU Chess + does not support, and I've specified the standard semantics of a few + features to be slightly different from what GNU Chess 4 does. +

+ +

+ + This release of the protocol specification is the first to carry a + version number of its own -- version 2. Previous releases simply + carried a last-modified date and were loosely tied to specific + releases of xboard and WinBoard. The version number "1" applies + generally to all those older versions of the protocol. + + + +

Protocol version 2 remains compatible with older engines but has + several new capabilities. In particular, it adds the + "feature" command, a new mechanism for making backward-compatible + changes and extensions to the protocol. Engines that do not support a + particular new feature do not have to use it; new features are not + enabled unless the engine specifically requests them using the feature + command. If an engine does not send the feature command at all, the + protocol behavior is nearly identical to version 1. Several new + features can be selected by the feature command in version 2, + including the "ping" command (recommended for all engines), the + "setboard" command, and many optional parameters. Additional features + will probably be added in future versions. +

+ +

+ + If it is necessary to have a separate name, + it would be best to refer to the protocol including the green additions as version 2f. + I really don't think it is a different protocol from version 2, though. + I just tried to clarify some ambiguities in the original definition, + now that the WinBoard 4.3.xx line has implemented them in a specific way. + The hand-shaking protocol for features as defined in protocol 2 perfectly + allows addition of an occasional new features without any need for stepping up the protocol version number, + and I think refraining from the latter would enormously lower the barrier for actual + implementation of these features in engines. +
+ The two really new things are the engine debug comments, and the "nps" command. + The former merely tries to regulate an extremely common existing pactice + of having engines dump debug messages on WinBoard in an unprotected way, + as usually you get away with that. +
+ +
+ +

5. WinBoard requires Win32 engines

+ +

+ Due to some Microsoft brain damage that I don't understand, WinBoard + does not work with chess engines that were compiled to use a DOS + extender for 32-bit addressing. (Probably not with 16-bit DOS or + Windows programs either.) WinBoard works only with engines that are + compiled for the Win32 API. You can get a free compiler that targets + the Win32 API from http://sources.redhat.com/cygwin/. I think DJGPP 2.x should also + work if you use the RSXNTDJ extension, but I haven't tried it. Of + course, Microsoft Visual C++ will work. Most likely the other + commercial products that support Win32 will work too (Borland, etc.), + but I have not tried them. Delphi has been successfully used to write + engines for WinBoard; if you want to do this, Tony Werten has donated + some sample + code that should help you get started. +

+ +

6. Hints on input/output

+ +

+ Beware of using buffered I/O in your chess engine. The C stdio + library, C++ streams, and the I/O packages in most other languages use + buffering both on input and output. That means two things. First, + when your engine tries to write some characters to xboard, the library + stashes them in an internal buffer and does not actually write them to + the pipe connected to xboard until either the buffer fills up or you + call a special library routine asking for it to be flushed. (In C + stdio, this routine is named fflush.) Second, when your engine tries + to read some characters from xboard, the library does not read just + the characters you asked for -- it reads all the characters that are + currently available (up to some limit) and stashes any characters you + are not yet ready for in an internal buffer. The next time you ask to + read, you get the characters from the buffer (if any) before the + library tries to read more data from the actual pipe. +

+ +

+ Why does this cause problems? First, on the output side, remember + that your engine produces output in small quantities (say, a few + characters for a move, or a line or two giving the current analysis), + and that data always needs to be delivered to xboard/WinBoard for + display immediately. If you use buffered output, the data you print + will sit in a buffer in your own address space instead of being + delivered. +

+ +

+ You can usually fix the output buffering problem by asking for the + buffering to be turned off. In C stdio, you do this by calling + setbuf(stdout, NULL). A more laborious and error-prone + method is to carefully call fflush(stdout) after every line + you output; I don't recommend this. In C++, you can try + cout.setf(ios::unitbuf), which is documented in current + editions of "The C++ Programming Language," but not older ones. + Another C++ method that might work is + cout.rdbuf()->setbuf(NULL, 0). Alternatively, you can + carefully call cout.flush() after every line you output; + again, I don't recommend this. +

+ +

+ Another way to fix the problem is to use unbuffered operating system + calls to write directly to the file descriptor for standard output. + On Unix, this means write(1, ...) -- see the man page for write(2). + On Win32, you can use either the Unix-like _write(1, ...) or Win32 + native routines like WriteFile. +

+ +

+ Second, on the input side, you are likely to want to poll during your + search and stop it if new input has come in. If you implement + pondering, you'll need this so that pondering stops when the user + makes a move. You should also poll during normal thinking on your + move, so that you can implement the "?" (move now) command, and so + that you can respond promptly to a "result", "force", or "quit" + command if xboard wants to end the game or terminate your engine. + Buffered input makes polling more complicated -- when you poll, you + must stop your search if there are either characters in the buffer + or characters available from the underlying file descriptor. +

+ +

+ The most direct way to fix this problem is to use unbuffered operating + system calls to read (and poll) the underlying file descriptor + directly. On Unix, use read(0, ...) to read from standard input, and + use select() to poll it. See the man pages read(2) and select(2). + (Don't follow the example of GNU Chess 4 and use the FIONREAD ioctl to + poll for input. It is not very portable; that is, it does not exist + on all versions of Unix, and is broken on some that do have it.) On + Win32, you can use either the Unix-like _read(0, ...) or the native + Win32 ReadFile() to read. Unfortunately, under Win32, the function to + use for polling is different depending on whether the input device is + a pipe, a console, or something else. (More Microsoft brain damage + here -- did they never hear of device independence?) For pipes, you + can use PeekNamedPipe to poll (even when the pipe is unnamed). + For consoles, + you can use GetNumberOfConsoleInputEvents. For sockets only, you can + use select(). It might be possible to use + WaitForSingleObject more + generally, but I have not tried it. Some code to do these things can + be found in Crafty's utility.c, but I don't guarantee that it's all + correct or optimal. +

+ +

+ A second way to fix the problem might be to ask your I/O library not + to buffer on input. It should then be safe to poll the underlying + file descriptor as described above. With C, you can try calling + setbuf(stdin, NULL). However, I have never tried this. Also, there + could be problems if you use scanf(), at least with certain patterns, + because scanf() sometimes needs to read one extra character and "push + it back" into the buffer; hence, there is a one-character pushback + buffer even if you asked for stdio to be unbuffered. With C++, you + can try cin.rdbuf()->setbuf(NULL, 0), but again, I have never tried + this. +

+ +

+ A third way to fix the problem is to check whether there are + characters in the buffer whenever you poll. C I/O libraries generally + do not provide any portable way to do this. Under C++, you can use + cin.rdbuf()->in_avail(). This method has been reported to + work with + EXchess. Remember that if there are no characters in the buffer, you + still have to poll the underlying file descriptor too, using the + method described above. +

+ +

+ A fourth way to fix the problem is to use a separate thread to read + from stdin. This way works well if you are familiar with thread + programming. This thread can be blocked waiting for input to come in + at all times, while the main thread of your engine does its thinking. + When input arrives, you have the thread put the input into a buffer + and set a flag in a global variable. Your search routine then + periodically tests the global variable to see if there is input to + process, and stops if there is. WinBoard and my Win32 ports of ICC + timestamp and FICS timeseal use threads to handle multiple input + sources. +

+ +

7. Signals

+ +

Engines that run on Unix need to be concerned with two Unix + signals: SIGTERM and SIGINT. This applies both to + engines that run under xboard and (the unusual case of) engines that + WinBoard remotely runs on a Unix host using the -firstHost or + -secondHost feature. It does not apply to engines that run on + Windows, because Windows does not have Unix-style signals. + + Beginning with version 2, you can now turn off the use of + either or both + signals. See the "feature" command in section 9 below. + +

+ +

First, when an engine is sent the "quit" command, it is also given + a SIGTERM signal shortly afterward to make sure it goes away. + If your engine reliably responds to "quit", and the signal causes + problems for you, you should either ignore it by calling + signal(SIGTERM, SIG_IGN) at the start of your program, + or disable it with the "feature" command.

+ +

Second, xboard will send an interrupt signal (SIGINT) at + certain times when it believes the engine may not be listening to user + input (thinking or pondering). WinBoard currently does this only when + the engine is running remotely using the -firstHost or -secondHost + feature, not when it is running locally. You probably need to know + only enough about this grungy feature to keep it from getting in your + way. +

+ +

+ The SIGINTs are basically tailored to the needs of GNU Chess 4 + on systems where its input polling code is broken or disabled. + Because they work in a rather peculiar way, it is recommended that you + either ignore SIGINT by having your engine call + signal(SIGINT, SIG_IGN), or disable it with the "feature" + command.

+ +

+ Here are details for the curious. If xboard needs to send a command + when it is the chess engine's move (such as before the "?" command), + it sends a SIGINT first. If xboard needs to send commands when it is + not the chess engine's move, but the chess engine may be pondering + (thinking on its opponent's time) or analyzing (analysis or analyze + file mode), xboard sends a SIGINT before the first such command only. + Another SIGINT is not sent until another move is made, even if xboard + issues more commands. This behavior is necessary for GNU Chess 4. The + first SIGINT stops it from pondering until the next move, but on some + systems, GNU Chess 4 will die if it receives a SIGINT when not + actually thinking or pondering. +

+ +

+ There are two reasons why WinBoard does not send the Win32 equivalent + of SIGINT (which is called CTRL_C_EVENT) to local + engines. First, the Win32 GNU Chess 4 port does not need it. Second, I + could not find a way to get it to work. Win32 seems to be designed + under the assumption that only console applications, not windowed + applications, would ever want to send a CTRL_C_EVENT. +

+ +

8. Commands from xboard to the engine

+ +

+ All commands from xboard to the engine end with a newline (\n), even + where that is not explicitly stated. All your output to xboard must + be in complete lines; any form of prompt or partial line will cause + problems. +

+ +

+ At the beginning of each game, xboard sends an initialization string. + This is currently "new\nrandom\n" unless the user changes it with the + initString or secondInitString option. +

+ +

+ xboard normally reuses the same chess engine process for multiple + games. At the end of a game, xboard will send the "force" command + (see below) to make sure your engine stops thinking about the current + position. It will later send the initString again to start a new + game. If your engine can't play multiple games, you can disable reuse + + either with the "feature" command (beginning in protocol version + 2; see below) or + + with xboard's -xreuse (or -xreuse2) command line + option. xboard will then ask the process to quit after each game and + start a new process for the next game. +

+ +
+
xboard +
This command will be sent once immediately after your engine + process is started. You can use it to put your engine into "xboard + mode" if that is needed. If your engine prints a prompt to ask for + user input, you must turn off the prompt and output a newline when the + "xboard" command comes in. +

+ +

protover N +
+ Beginning in protocol version 2 (in which N=2), this command will + be sent immediately after the "xboard" command. If you receive some + other command immediately after "xboard" (such as "new"), you can + assume that protocol version 1 is in use. The "protover" command is + the only new command that xboard always sends in version 2. All other + new commands to the engine are sent only if the engine first enables + them with the "feature" command. Protocol versions will always be + simple integers so that they can easily be compared. + +

Your engine should reply to the protover command by sending the + "feature" command (see below) with the list of non-default feature + settings that you require, if any. + +

Your engine should never refuse to run due to receiving a higher + protocol version number than it is expecting! New protocol versions + will always be compatible with older ones by default; the larger + version number is simply a hint that additional "feature" command + options added in later protocol versions may be accepted. + +

+ +

accepted +
rejected +
+ These commands may be sent to your engine in reply to the "feature" + command; see its documentation below. + +

+ +

new +
Reset the board to the standard chess starting position. Set + White on move. Leave force mode and set the engine to play Black. + Associate the engine's clock with Black and the opponent's clock with + White. Reset clocks and time controls to the start of a new game. + Use wall clock for time measurement. + Stop clocks. Do not ponder on this move, even if pondering is on. + Remove any search depth limit previously set by the sd command. +

+ +

variant VARNAME +
If the game is not standard chess, but a variant, this command is + sent after "new" and before the first move or "edit" command. Currently + defined variant names are: + + +
wildcastleShuffle chess where king can castle from d file +
nocastleShuffle chess with no castling at all +
fischerandomFischer Random +
bughouseBughouse, ICC/FICS rules +
crazyhouseCrazyhouse, ICC/FICS rules +
losersWin by losing all pieces or getting mated (ICC) +
suicideWin by losing all pieces including king, + or by having fewer pieces when one player has no legal moves (FICS) +
giveaway + Win by losing all pieces including king, + or by having no legal moves (ICC) +
twokingsWeird ICC wild 9 +
kriegspielKriegspiel (engines not supported) +
atomicAtomic +
3checkWin by giving check 3 times +
xiangqi + Chinese Chess (9x10 board) +
shogi + Japanese Chess (9x9 bord) +
capablanca + Capablanca Chess (10x8 board, with Archbishop and Chancellor) +
gothic + Gothic Chess (10x8 board, same with better opening setup) +
falcon + Falcon Chess (10x8 board, with two Falcon pieces) +
shatranj + ancient Arabic Chess, with Elephants and General in stead of B and Q +
courier + Courier Chess (12x8 board, a medieval precursor of modern Chess +
knightmate + King moves as Knight and vice versa +
berolina + Pawns capture straight ahead, and move diagonally +
janus + Janus Chess (10x8, with two Archbishops) +
caparandom + shuffle variant like FRC (10x8 board) +
cylinder + Pieces wrap around between side edges, like board is a cylinder +
super + Superchess: a shuffle variant with 4 fairy pieces on 8x8 board +
unknownUnknown variant (not supported) +
+

+ +

quit +
The chess engine should immediately exit. This command is used + when xboard is itself exiting, and also between games if the -xreuse + command line option is given (or -xreuse2 for the second engine). + See also Signals above. +

+ +

random +
This command is specific to GNU Chess 4. You can either ignore it + completely (that is, treat it as a no-op) or implement it as GNU Chess + does. The command toggles "random" mode (that is, it sets random = + !random). In random mode, the engine adds a small random value to its + evaluation function to vary its play. The "new" command sets random + mode off. +

+ +

force +
Set the engine to play neither color ("force mode"). Stop clocks. + The engine should check that moves received in force mode are legal + and made in the proper turn, but should not think, ponder, or make + moves of its own. +

+ +

go +
Leave force mode and set the engine to play the color that is on + move. Associate the engine's clock with the color that is on move, + the opponent's clock with the color that is not on move. Start the engine's + clock. Start thinking and eventually make a move. +

+ +

playother +
+ + (This command is new in protocol version 2. It is not + sent unless you enable it with the feature command.) + Leave force mode and set the engine to play the color that is not on + move. Associate the opponent's clock with the color that is on move, + the engine's clock with the color that is not on move. Start the opponent's + clock. If pondering is enabled, the engine should begin pondering. + If the engine later receives a move, it should start thinking and eventually + reply. + +

+ +

white +
+ + (This command is obsolete as of protocol version 2, but is still + sent in some situations to accommodate older engines unless you disable it + with the feature command.) + + Set White on move. Set the engine to play Black. Stop clocks. +

+ +

black +
+ + (This command is obsolete as of protocol version 2, but is still + sent in some situations to accommodate older engines unless you disable it + with the feature command.) + + Set Black on move. Set the engine to play White. Stop clocks. +

+ +

level MPS BASE INC +
Set time controls. See the Time Control section below. +

+ +

st TIME +
Set time controls. See the Time Control section + below. +

+ +

sd DEPTH +
The engine should limit its thinking to DEPTH ply. + The commands "level" or "st" and "sd" can be used together in an orthogonal way. -If both are issued, the engine should observe both limitations. ++If both are issued, the engine should observe both limitations: ++In the protocol, the "sd" command isn't a time control. It doesn't ++say that your engine has unlimited time but must search to exactly the ++given depth. It says that you should pay attention to the time ++control as normal, but cut off the search at the specified depth even ++if you have time to search deeper. If you don't have time to search ++to the specified depth, given your normal time management algorithm, ++then you will want to stop sooner than the given depth. ++

++The "new" command should set the search depth back to unlimited. This ++is already stated in the spec. The "level" command should not affect ++the search depth. As it happens, xboard/WinBoard currently always ++sends sd (if needed) right after level, but that isn't part of the ++spec. +

+ +

nps NODE_RATE +
The engine should not use wall-clock time to make its timing decisions, + but an own internal time measure based on the number of nodes it has searched + (and will report as "thinking output", see section 10), + converted to seconds through dividing by the given NODE_RATE. + Example: after receiving the commands "st 8" and "nps 10000", + the engine should never use more that 80,000 nodes in the search for any move. + In this mode, the engine should report user CPU time used (in its thinking output), + rather than wall-clock time. + This even holds if NODE_RATE is given as 0, + but in that case it should also use the user CPU time for its timing decisions. + The effect of an "nps" command should persist until the next "new" command. + +

+ +

time N +
Set a clock that always belongs to the engine. N is a number in + centiseconds (units of 1/100 second). Even if the engine changes to + playing the opposite color, this clock remains with the engine. +

+ +

otim N + +
Set a clock that always belongs to the opponent. N is a number in + centiseconds (units of 1/100 second). Even if the opponent changes to + playing the opposite color, this clock remains with the opponent. +

+ If needed for purposes of board display in force mode (where the + engine is not participating in the game) the time clock should be + associated with the last color that the engine was set to play, the + otim clock with the opposite color. +

+

+ This business of "clocks remaining with the engine" is apparently so ambiguous + that many engines implement it wrong. + The clocks in fact always remain with the color. + Which clock reading is relayed with "time", and which by "otim", is determined by which side the engine plays. + Note that the way the clocks operate and receive extra time (in accordance with the selected time control) + is not affected in any way by which moves are made by the engine, which by the opponent, and which were forced. + +

+

+ + Beginning in protocol version 2, if you can't handle the time and + otim commands, you can use the "feature" command to disable them; see + below. + + The following techniques from older protocol versions also + work: You can ignore the time and otim commands (that is, treat them + as no-ops), or send back "Error (unknown command): time" the first + time you see "time". +

+ +
MOVE +
See below for the syntax of moves. If the move is illegal, print + an error message; see the section "Commands from the engine to + xboard". If the move is legal and in turn, make it. If not in force + mode, stop the opponent's clock, start the engine's clock, start + thinking, and eventually make a move. +

+ When xboard sends your engine a move, it normally sends coordinate + algebraic notation. Examples: +

+ +
Normal moves:e2e4 +
Pawn promotion:e7e8q +
Castling:e1g1, e1c1, e8g8, e8c8 +
Bughouse/crazyhouse drop:P@h3 +
ICS Wild 0/1 castling:d1f1, d1b1, d8f8, d8b8 +
FischerRandom castling:O-O, O-O-O (oh, not zero) +
+ +

+ + Note that on boards with more than 9 ranks, counting of the ranks starts at 0. + +

+

+ + Beginning in protocol version 2, you can use the feature command + to select SAN (standard algebraic notation) instead; for example, e4, + Nf3, exd5, Bxf7+, Qxf7#, e8=Q, O-O, or P@h3. Note that the last form, + P@h3, is a extension to the PGN standard's definition of SAN, which does + not support bughouse or crazyhouse. + +

+ +

+ xboard doesn't reliably detect illegal moves, because it does not keep + track of castling unavailability due to king or rook moves, or en + passant availability. If xboard sends an illegal move, send back an + error message so that xboard can retract it and inform the user; see + the section "Commands from the engine to xboard". +

+ +
usermove MOVE +
+ By default, moves are sent to the engine without a command name; + the notation is just sent as a line by itself. + Beginning in protocol version 2, you can use the feature command + to cause the command name "usermove" to be sent before the move. + Example: "usermove e2e4". + +

+ +
? +
Move now. If your engine is thinking, it should move immediately; + otherwise, the command should be ignored (treated as a no-op). It + is permissible for your engine to always ignore the ? command. The + only bad consequence is that xboard's Move Now menu command will do + nothing. +

+ It is also permissible for your engine to move immediately if it gets + any command while thinking, as long as it processes the command right + after moving, but it's preferable if you don't do this. For example, + xboard may send post, nopost, easy, hard, force, quit, + + or other commands + + while the engine is on move. +

+ +
ping N +
+ + In this command, N is a decimal number. When you receive the command, + reply by sending the string pong N, where N is the + same number you received. Important: You must not reply to a "ping" + command until you have finished executing all commands that you + received before it. Pondering does not count; if you receive a ping + while pondering, you should reply immediately and continue pondering. + Because of the way xboard uses the ping command, if you implement the + other commands in this protocol, you should never see a "ping" command + when it is your move; however, if you do, you must not send the "pong" + reply to xboard until after you send your move. For example, xboard + may send "?" immediately followed by "ping". If you implement the "?" + command, you will have moved by the time you see the subsequent ping + command. Similarly, xboard may send a sequence like "force", "new", + "ping". You must not send the pong response until after you have + finished executing the "new" command and are ready for the new game to + start. + +

+ The ping command is new in protocol version 2 and will not be sent + unless you enable it with the "feature" command. Its purpose is to + allow several race conditions that could occur in previous versions of + the protocol to be fixed, so it is highly recommended that you + implement it. It is especially important in simple engines that do + not ponder and do not poll for input while thinking, but it is needed in all + engines. +

+
+ +
draw +
The engine's opponent offers the engine a draw. To accept the + draw, send "offer draw". To decline, ignore the offer (that is, send + nothing). If you're playing on ICS, it's possible for the draw offer + to have been withdrawn by the time you accept it, so don't assume the + game is over because you accept a draw offer. Continue playing until + xboard tells you the game is over. See also "offer draw" below. +

+ +

result RESULT {COMMENT} +
After the end of each game, xboard will send you a result command. + You can use this command to trigger learning. RESULT is either 1-0, + 0-1, 1/2-1/2, or *, indicating whether white won, black won, the game + was a draw, or the game was unfinished. The COMMENT string is purely + a human-readable comment; its content is unspecified and subject to + change. In ICS mode, it is passed through from ICS uninterpreted. + Example:
result 1-0 {White mates}
+

+ Here are some notes on interpreting the "result" command. Some apply + only to playing on ICS ("Zippy" mode). +

+ +

+ If you won but did not just play a mate, your opponent must have + resigned or forfeited. If you lost but were not just mated, you + probably forfeited on time, or perhaps the operator resigned manually. + If there was a draw for some nonobvious reason, perhaps your opponent + called your flag when he had insufficient mating material (or vice + versa), or perhaps the operator agreed to a draw manually. +

+ +

+ You will get a result command even if you already know the game ended + -- for example, after you just checkmated your opponent. In fact, if + you send the "RESULT {COMMENT}" command (discussed below), you will + simply get the same thing fed back to you with "result" tacked in + front. You might not always get a "result *" command, however. In + particular, you won't get one in local chess engine mode when the user + stops playing by selecting Reset, Edit Game, Exit or the like. +

+ +
setboard FEN +
+ The setboard command is the new way to set up positions, beginning + in protocol version 2. It is not used unless it has been selected + with the feature command. Here FEN is a position in Forsythe-Edwards + Notation, as defined in the PGN standard. -In FRC or CRC, WinBoard will use Shredder-FEN or X-FEN standard, -i.e. it can use the rook-file indicator letter to represent a castling right (like HAha) -whenever it wants, but if it uses KQkq, this will always refer to the outermost rook on the given side ++Note that this PGN standard referred to here ++only applies to normal Chess; ++Obviously in variants that cannot be described by a FEN for normal Chess, ++e.g. because the board is not 8x8, other pieces then PNBRQK participate, ++there are holdings that need to be specified, etc., ++xboard will use a FEN format that is standard or suitable for that varant. ++In particular, in FRC or CRC, WinBoard will use Shredder-FEN or X-FEN standard, ++i.e. it can use the rook-file indicator letter to represent a castling right ++(like HAha) whenever it wants, but if it uses KQkq, this will always refer ++to the outermost rook on the given side. + + +

Illegal positions: Note that either setboard or edit can + be used to send an illegal position to the engine. The user can + create any position with xboard's Edit Position command (even, say, + an empty board, or a board with 64 white kings and no black ones). + If your engine receives a position that it considers illegal, + I suggest that you send the response "tellusererror Illegal position", + and then respond to any attempted move with "Illegal move" until + the next new, edit, or setboard command.

+
+

+ +

edit +
+ + The edit command is the old way to set up positions. For compatibility + with old engines, it is still used by default, but new engines may prefer + to use the feature command (see below) to cause xboard to use setboard instead. + + The edit command puts the chess engine into a special mode, where + it accepts the following subcommands: + +
cchange current piece color, initially white +
Pa4 (for example)place pawn of current color on a4 +
xa4 (for example)empty the square a4 (not used by xboard) +
#clear board +
.leave edit mode +
+ + See the Idioms section below for additional subcommands used in + ChessBase's implementation of the protocol. + + +

The edit command does not change the side to move. To set up a + black-on-move position, xboard uses the following command sequence: +

+
+     new
+     force
+     a2a3
+     edit
+     <edit commands>
+     .
+ 
+ +

+ This sequence is used to avoid the "black" command, which is now + considered obsolete and which many engines never did implement as + specified in this document. +

+ +

+ After an edit command is complete, if a king and a rook are on their + home squares, castling is assumed to be available to them. En passant + capture is assumed to be illegal on the current move regardless of the + positions of the pawns. The clock for the 50 move rule starts at + zero, and for purposes of the draw by repetition rule, no prior + positions are deemed to have occurred. + + In FRC or CRC, any rook and king put on the back rank should be considered to + have castling rights, even if it later becomes apparent that they cannot be both in the + initial position, because the position just set up is asymmetric. + It is upto WinBoard to find work-around in cases where this is not desired, + similar to the "black kludge" shown above, by setting up an earlier position, + and then do a move to destroy castling rights or create e.p. rights. + (Don't bet your life on it...) + +

+ +
hint +
If the user asks for a hint, xboard sends your engine the command + "hint". Your engine should respond with "Hint: xxx", where xxx is a + suggested move. If there is no move to suggest, you can ignore the + hint command (that is, treat it as a no-op). +

+ +

bk +
If the user selects "Book" from the xboard menu, xboard will send + your engine the command "bk". You can send any text you like as the + response, as long as each line begins with a blank space or tab (\t) + character, and you send an empty line at the end. The text pops up in + a modal information dialog. +

+ +

undo +
If the user asks to back up one move, xboard will send you the + "undo" command. xboard will not send this command without putting you + in "force" mode first, so you don't have to worry about what should + happen if the user asks to undo a move your engine made. (GNU Chess 4 + actually switches to playing the opposite color in this case.) +

+ +

remove +
If the user asks to retract a move, xboard will send you the + "remove" command. It sends this command only when the user is on + move. Your engine should undo the last two moves (one for each + player) and continue playing the same color. +

+ +

hard +
Turn on pondering (thinking on the opponent's time, also known as + "permanent brain"). xboard will not make any assumption about what + your default is for pondering or whether "new" affects this setting. +

+ +

easy +
Turn off pondering. +

+ +

post +
Turn on thinking/pondering output. + See Thinking Output section. +

+ +

nopost +
Turn off thinking/pondering output. +

+ +

analyze +
Enter analyze mode. See Analyze Mode section. +

+ +

name X
This command informs the engine of its + opponent's name. When the engine is playing on a chess server, xboard + obtains the opponent's name from the server. + + When the engine is + playing locally against a human user, xboard obtains the user's login + name from the local operating system. When the engine is playing + locally against another engine, xboard uses either the other engine's + filename or the name that the other engine supplied in the myname + option to the feature command. By default, xboard uses the name + command only when the engine is playing on a chess server. Beginning + in protocol version 2, you can change this with the name option to the + feature command; see below. + +

+ +

rating +
In ICS mode, xboard obtains the ICS opponent's rating from the + "Creating:" message that appears before each game. (This message may + not appear on servers using outdated versions of the FICS code.) In + Zippy mode, it sends these ratings on to the chess engine using the + "rating" command. The chess engine's own rating comes first, and if + either opponent is not rated, his rating is given as 0. + + In the future this command may also be used in other modes, if ratings + are known. + + Example:
rating 2600 1500
+

+ +

ics HOSTNAME +
+ If HOSTNAME is "-", the engine is playing against a local + opponent; otherwise, the engine is playing on an Internet Chess Server + (ICS) with the given hostname. This command is new in protocol + version 2 and is not sent unless the engine has enabled it with + the "feature" command. Example: "ics freechess.org" + +

+ +

computer +
The opponent is also a computer chess engine. Some engines alter + their playing style when they receive this command. +

+ +

pause +
resume +
(These commands are new in protocol + version 2 and will not be sent unless feature pause=1 is set. At + this writing, xboard actually does not use the commands at all, but it + or other interfaces may use them in the future.) + The "pause" command puts the engine into a special state where it + does not think, ponder, or otherwise consume significant CPU time. + The current thinking or pondering (if any) is suspended and both + player's clocks are stopped. The only command that the interface may + send to the engine while it is in the paused state is "resume". The + paused thinking or pondering (if any) resumes from exactly where it + left off, and the clock of the player on move resumes running from + where it stopped. + +

+ +

memory N +
+ This command informs the engine on how much memory it is allowed to use maximally, in MegaBytes. + On receipt of this command, the engine should adapt the size of its hash tables accordingly. + This command does only fix the total memory use, + the engine has to decide for itself + (or be configured by the user by other means) + how to divide up the available memory between the various tables it wants to use + (e.g. main hash, pawn hash, tablebase cache, bitbases). + This command will only be sent to engines that have requested it through the memory feature, + and only at the start of a game, + as the first of the commands to relay engine option settings just before each "new" command. + +

+ +

cores N +
+ This command informs the engine on how many CPU cores it is allowed to use maximally. + This could be interpreted as the number of search threads for SMP engines. + (Threads that do not consume significant amounts of CPU time, like I/O threads, need not be included in the count.) + This command will only be sent to engines that have requested it through the smp feature. + The engine should be able to respond to the "cores" command any time during a game, + but it is allowed to finish a search in progress before procesing the command. + (Obeying the command should take priority over finishing a ponder search, though.) + In any case it will be sent at the start of every game + as the last command to relay engine option settings before the "new" command. + +

+ +

egtpath TYPE PATH +
+ This command informs the engine in which directory (given by the PATH argument) + it can find end-game tables of the specified TYPE. + The TYPE argument can be any character string which does not contain spaces. + Currently nalimov and scorpio are defined types, + for Nalimov tablebases and Scorpio bitbases, respectively, + but future developers of other formats are free to define their own format names. + The GUI simply matches the TYPE names the engine says it supports + with those that the user supplied when configuring xboard. + For every match, it sends a separate "y" command. + The PATH argument would normally (for Nalimov) be the pathname of the directory the EGT files are in, + but could also be the name of a file, or in fact anything the particular EGT type requires. + It is upto the developer of the EGT format to specify the syntax of this parameter. + This command will only be sent to engines that have told the GUI they support EGTs of the given TYPE + through the egt feature. + It will be sent at the start of each game, before the "new" command. + ++

++ ++

option NAME [VALUE] ++
++This command changes the setting of the option NAME defined by the engine ++(through an earlier feature command) ++to the given VALUE. ++XBoard will in general have no idea what the option means, ++and will send the command only when a user changes the value of this option through a menu, ++or at startup of the engine ++(before the first 'cores' command or, if that is not sent, the first 'new' command) ++in reaction to command-line options. ++The NAME echoes back to the engine the string that was identified as an option NAME ++in the feature command defining the option. ++The VALUE is of the type (numeric or text or absent) that was implied by the option type ++specified in this feature command, ++i.e. with 'spin' and 'check' options VALUE will be a decimal integer (in the latter case 0 or 1), ++with 'combo' and 'string' options VALUE will be a text string, ++and with 'button' and 'save' options no VALUE will be sent at all. ++ +
+ +

Bughouse commands:

+ +

+ xboard now supports bughouse engines when in Zippy mode. See + zippy.README for information on Zippy mode and how to turn on the + bughouse support. The bughouse move format is given above. xboard + sends the following additional commands to the engine when in bughouse + mode. + Commands to inform your engine of the partner's game state may + be added in the future. +

+ +
+
partner <player> +
<player> is now your partner for future games. Example:
partner mann
+

+ +

partner +
Meaning: You no longer have a partner. +

+ +

ptell <text> +
Your partner told you <text>, either with a ptell or an ordinary tell. +

+ +

holding [<white>] [<black>] +
White currently holds <white>; black currently holds <black>. + Example:
holding [PPPRQ] []
+ +
holding [<white>] [<black>] <color><piece> +
White currently holds <white>; black currently holds <black>, after + <color> acquired <piece>. Example:
holding [PPPRQ] [R] BR
+
+ +

9. Commands from the engine to xboard

+ +

+ + In general, an engine should not send any output to xboard that is not + described in this document. As the protocol is extended, newer + versions of xboard may recognize additional strings as commands that + were previously not assigned a meaning. + +

+ +
+
+ feature FEATURE1=VALUE1 FEATURE2=VALUE2 ... + + +
+ Beginning with version 2, the protocol includes the "feature" + command, which lets your engine control certain optional protocol + features. Feature settings are written as FEATURE=VALUE, where + FEATURE is a name from the list below and VALUE is the value to be + assigned. Features can take string, integer, or boolean values; the + type of value is listed for each feature. String values are written + in double quotes (for example, feature myname="Miracle Chess + 0.9"), integers are written in decimal, and boolean values are + written as 0 for false, 1 for true. Any number of features can be set + in one feature command, or multiple feature commands can be given. + +

+ Your engine should send one or more feature commands immediately after + receiving the "protover" command, since xboard needs to know the + values of some features before sending further commands to the engine. + Because engines that predate protocol version 2 do not send "feature", + xboard uses a timeout mechanism: when it first starts your engine, it + sends "xboard" and "protover N", then listens for feature commands for + two seconds before sending any other commands. To end this timeout + and avoid the wait, set the feature "done=1" at the end of your last + feature command. To increase the timeout, if needed, set the feature + "done=0" before your first feature command and "done=1" at the end. + If needed, it is okay for your engine to set done=0 soon as it starts, + even before it receives the xboard and protover commands. This can be + useful if your engine takes a long time to initialize itself. It + should be harmless even if you are talking to a (version 1) user + interface that does not understand the "feature" command, since such + interfaces generally ignore commands from the engine that they do not + understand. +

+ +

+ The feature command is designed to let the protocol change without + breaking engines that were written for older protocol versions. When + a new feature is added to the protocol, its default value is always + chosen to be compatible with older versions of the protocol that did + not have the feature. Any feature that your engine does not set in a + "feature" command retains its default value, so as the protocol + changes, you do not have to change your engine to keep up with it + unless you want to take advantage of a new feature. Because some + features are improvements to the protocol, while others are meant to + cater to engines that do not implement all the protocol features, the + recommended setting for a feature is not always the same as the + default setting. The listing below gives both default and recommended + settings for most features. +

+ +

+ You may want to code your engine so as to be able to work with + multiple versions of the engine protocol. Protocol version 1 does not + send the protover command and does not implement the feature command; + if you send a feature command in protocol version 1, it will have no + effect and there will be no response. In protocol version 2 or later, + each feature F that you set generates the response "accepted F" if the + feature is implemented, or "rejected F" if it is not. Thus an engine + author can request any feature without having to keep track of which + protocol version it was introduced in; you need only check whether the + feature is accepted or rejected. This mechanism also makes it + possible for a user interface author to implement a subset of a + protocol version by rejecting some features that are defined in that + version; however, you should realize that engine authors are likely to + code for xboard and may not be prepared to have a feature that they + depend on be rejected. +

+ +

+ Here are the features that are currently defined. +

+
+ +
+
+ ping (boolean, default 0, recommended 1) + +
+ If ping=1, xboard may use the protocol's new "ping" command; + if ping=0, xboard will not use the command. + + +
+ setboard (boolean, default 0, recommended 1) + +
+ If setboard=1, xboard will use the protocol's new "setboard" command + to set up positions; if setboard=0, it will use the older "edit" command. + + +
+ playother (boolean, default 0, recommended 1) + +
+ If playother=1, xboard will use the protocol's new "playother" command + when appropriate; if playother=0, it will not use the command. + + +
+ san (boolean, default 0) + +
+ If san=1, xboard will send moves to the engine in standard algebraic + notation (SAN); for example, Nf3. If san=0, xboard will send moves in + coordinate notation; for example, g1f3. See MOVE in + section 8 above for more details of both kinds of notation. + + +
+ usermove (boolean, default 0) + +
+ If usermove=1, xboard will send moves to the engine with the + command "usermove MOVE"; if usermove=0, xboard will send just the move, + with no command name. + + +
+ time (boolean, default 1, recommended 1) + +
+ If time=1, xboard will send the "time" and "otim" commands to + update the engine's clocks; if time=0, it will not. + + +
+ draw (boolean, default 1, recommended 1) + +
+ If draw=1, xboard will send the "draw" command if the engine's opponent + offers a draw; if draw=0, xboard will not inform the engine about + draw offers. Note that if draw=1, you may receive a draw offer while you + are on move; if this will cause you to move immediately, you should set + draw=0. + + +
+ sigint (boolean, default 1) + +
+ If sigint=1, xboard may send SIGINT (the interrupt signal) to + the engine as section 7 above; if sigint=0, it will + not. + + +
+ sigterm (boolean, default 1) + +
+ If sigterm=1, xboard may send SIGTERM (the termination signal) to + the engine as section 7 above; if sigterm=0, it will + not. + + +
+ reuse (boolean, default 1, recommended 1) + +
+ If reuse=1, xboard may reuse your engine for multiple games. If + reuse=0 (or if the user has set the -xreuse option on xboard's command + line), xboard will kill the engine process after every game and start + a fresh process for the next game. + + +
+ analyze (boolean, default 1, recommended 1) + +
+ If analyze=0, xboard will not try to use the "analyze" command; it + will pop up an error message if the user asks for analysis mode. If + analyze=1, xboard will try to use the command if the user asks for + analysis mode. + + +
+ myname (string, default determined from engine filename) + +
+ This feature lets you set the name that xboard will use for your + engine in window banners, in the PGN tags of saved game files, and when + sending the "name" command to another engine. + + +
+ variants (string, see text below) + +
+ This feature indicates which chess variants your engine accepts. + It should be a comma-separated list of variant names. See the table + under the "variant" command in section 8 above. If + you do not set this feature, xboard will assume by default that your + engine supports all variants. (However, the -zippyVariants + command-line option still limits which variants will be accepted in + Zippy mode.) It is recommended that you set this feature to the + correct value for your engine (just "normal" in most cases) rather + than leaving the default in place, so that the user will get an + appropriate error message if he tries to play a variant that your + engine does not support. +
+ If your engine can play variants on a deviating board size, + like capablanca on an 8x8 board, or capablanca crazyhouse, + it can list them amongst the variants with a prefix spcifying board size plus + holdings size, like 8x8+0_capablanca or 10x8+7_capablanca. + If it is capable of playing any variant with an arbitrary board size, + it should list "boardsize" as one of the variants. + If there is a maximum to the board size, this can be prefixed, + e.g. "12x10+0_boardsize". + + +
+ colors (boolean, default 1, recommended 0) + +
+ If colors=1, xboard uses the obsolete "white" and "black" + commands in a stylized way that works with most older chess engines + that require the commands. See the "Idioms" section + below for details. If colors=0, xboard does not use the "white" and + "black" commands at all. + + +
+ ics (boolean, default 0) + +
+ If ics=1, xboard will use the protocol's new "ics" command + to inform the engine of whether or not it is playing on a chess server; + if ics=0, it will not. + + +
+ name (boolean, see text below) + +
+ If name=1, xboard will use the protocol's "name" command + to inform the engine of the opponent's name; if name=0, it will not. + By default, name=1 if the engine is playing on a chess server; name=0 if not. + + +
+ pause (boolean, default 0) + +
+ If pause=1, xboard may use the protocol's new "pause" command; + if pause=0, xboard assumes that the engine does not support this command. + + +
+ nps (boolean, default ?) + +
+ If nps=1, it means the engine supports the nps command. + If nps=0, it means the engine does not support it, and WinBoard should refrain from sending it. + Default is that WinBoard sends it, in an attempt to try out if the engine understand it. + The engine should properly respond with "Error (unkown command): nps" if it does not implement it, + (as any protocol version pre-scribes), + or WinBoard might assume that the engine did understand the command. + In that case the use of different time standards that ensues could lead to time forfeits for the engine. + + +
+ debug (boolean, default 0) + +
+ If debug=1, it means the engine wants to send debug output prefixed by '#', + which WinBoard should ignore, except for including it in the winboard.debug file. + As this feature is added to protocol 2 ony late, + so that not all protocol-2 supporting versions of WinBoard might implement it, + it is important that engines check if WinBoard accepts the feature. + If the feature is rejected, + engines must refrain from sending the debug output, + or do so at their own risk. + + +
+ memory (boolean, default 0) + +
+ If memory=1, the size of the total amount of memory available for the memory-consuming tables of the engine + (e.g. hash, EGTB cache) + will be set by the GUI through the "memory" command. + + +
+ smp (boolean, default 0) + +
+ If smp=1, the GUI will send the "cores" command to the engine to inform it how many CPU cores it can use. + Note that sending smp=1 does not imply the engine can use more than one CPU; + just that it wants to receive the "cores" command. + + +
+ egt (string, see text below) + +
+ This feature indicates which end-game table formats the engine supports. + It should be a comma-separated list of format names. + See under the "egtpath" command in section 8 above. + If you do not set this feature, xboard will assume the engine does not support end-game tables, + and will not send any "egtpath" commands to inform the engine about their whereabouts. + + ++
++option (string, see text below) ++ ++
++This feature is used by the engine to define an option command to appear in a GUI menu, ++so that the user can change the corresponding setting of the engine through the GUI. ++The string describes the option by defining a name, type, current value and (sometimes) the acceptable value range. ++There are six different options types, each requiring a slighly different syntax of the defining string: ++
++feature option="NAME -button" ++
++feature option="NAME -save" ++
++feature option="NAME -check VALUE" ++
++feature option="NAME -string VALUE" ++
++feature option="NAME -spin VALUE MIN MAX" ++
++feature option="NAME -combo CHOICE1 /// CHOICE2 ..." ++
++NAME is an arbitrary alphanumeric string which can contain spaces; ++the oter words in capitals would be replaced by the current (default) setting of the option, ++the minimum or maximum value of numeric (-spin) options, ++or arbitrary text labels (for -combo option). ++In the latter cae, the current value will be preceded by an asterisk. ++
++ +
+ done (integer, no default) + +
+ If you set done=1 during the initial two-second timeout after + xboard sends you the "xboard" command, the + timeout will end and xboard will not look for any more feature + commands before starting normal operation. + If you set done=0, the initial timeout is increased to one hour; + in this case, you must set done=1 before xboard will enter normal operation. + +
+

+ +

Illegal move: MOVE +
Illegal move (REASON): MOVE +
If your engine receives a MOVE command that is recognizably a move + but is not legal in the current position, your engine must print an + error message in one of the above formats so that xboard can pass the + error on to the user and retract the move. The (REASON) is entirely + optional. Examples: + +
+   Illegal move: e2e4
+   Illegal move (in check): Nf3
+   Illegal move (moving into check): e1g1
+ 
+

+ Generally, xboard will never send an ambiguous move, so it does not + matter whether you respond to such a move with an Illegal move message + or an Error message. +

+ +
Error (ERRORTYPE): COMMAND +
If your engine receives a command it does not understand or does + not implement, it should print an error message in the above format so + that xboard can parse it. Examples: +
+   Error (ambiguous move): Nf3
+   Error (unknown command): analyze
+   Error (command not legal now): undo
+   Error (too many parameters): level 1 2 3 4 5 6 7
+ 
+ +
move MOVE +
Your engine is making the move MOVE. Do not echo moves from + xboard with this command; send only new moves made by the engine. + + +

For the actual move text from your chess engine (in place of MOVE + above), your move should be either +

    +
  • in coordinate notation (e.g., + e2e4, e7e8q) with castling indicated by the King's two-square move (e.g., + e1g1), or +
  • in Standard Algebraic Notation (SAN) as defined in the + Portable Game Notation standard (e.g, e4, Nf3, O-O, cxb5, Nxe4, e8=Q), + with the extension piece@square (e.g., P@f7) to handle piece placement + in bughouse and crazyhouse. +
+ xboard itself also accepts some variants of SAN, but for compatibility + with non-xboard interfaces, it is best not to rely on this behavior. +

+ +

Warning: Even though all versions of this protocol specification + have indicated that xboard accepts SAN moves, some non-xboard + interfaces are known to accept only coordinate notation. See the + Idioms section for more information on the known limitations of some + non-xboard interfaces. It should be safe to send SAN moves if you + receive a "protover 2" (or later) command from the interface, but + otherwise it is best to stick to coordinate notation for maximum + compatibility. An even more conservative approach would be for your + engine to send SAN to the interface only if you have set feature san=1 + (which causes the interface to send SAN to you) and have received + "accepted san" in reply. +

+
+ +
RESULT {COMMENT}
When your engine detects + that the game has ended by rule, your engine must output a line of the + form "RESULT {comment}" (without the quotes), where RESULT is a PGN + result code (1-0, 0-1, or 1/2-1/2), and comment is the reason. Here + "by rule" means that the game is definitely over because of what + happened on the board. In normal chess, this includes checkmate, + stalemate, triple repetition, the 50 move rule, or insufficient + material; it does not include loss on time or the like. + Examples: +
+   0-1 {Black mates}
+   1-0 {White mates}
+   1/2-1/2 {Draw by repetition}
+   1/2-1/2 {Stalemate}
+ 
+ +

+ xboard relays the result to the user, the ICS, the other engine in Two + Machines mode, and the PGN save file as required. + Note that "definitey over" above means that sending this command + will be taken by WinBoard as an unconditional refusal of the engine to play on, + which might cause you to forfeit if the game was in fact not over. + This command should thus not be used to offer draws, accept draws, + or make draw-by-rule claims that might not be valid + (because it is not your move, and the opponent already moved without you knowing it yet). + For offering and claiming draws, "offer draw" should be used. +

+ +
resign +
If your engine wants to resign, it can send the command "resign". + Alternatively, it can use the "RESULT {comment}" command if the string + "resign" is included in the comment; for example "0-1 {White + resigns}". xboard relays the resignation to the user, the ICS, the + other engine in Two Machines mode, and the PGN save file as required. +

+ +

offer draw +
If your engine wants to offer a draw by agreement (as opposed to + claiming a draw by rule), it can send the command "offer draw". + xboard relays the offer to the user, the ICS, the other engine in Two + Machines mode, and the PGN save file as required. In Machine White, + Machine Black, or Two Machines mode, the offer is considered valid + until your engine has made two more moves. + This command must also be used to accept a draw offer. + Do not use the 1/2-1/2 command for that, as the offer might be no longer valid, + in which case a refusal to play on implied by the RESULT command would make you forfeit the game. + "offer draw" should also be used to claim 50-move and 3-fold-repetition draws + that will occur after your move, by sending it before making the move. + WinBoard will grant draw offers without the opponent having any say in + it in situations where draws can be claimed. + Only if the draw cannot be claimed, the offer will be passed to your opponent after you make your next move, + just before WinBoard relays this move to the opponent. + +

+ +

tellopponent MESSAGE +
+ This command lets the engine give a message to its opponent, + independent of whether the opponent is a user on the local machine or + a remote ICS user (Zippy mode). MESSAGE consists of any characters, + including whitespace, to the end of the line. When the engine is + playing against a user on the local machine, xboard pops up an + information dialog containing the message. When the engine is playing + against an opponent on the ICS (Zippy mode), xboard sends "say + MESSAGE\n" to the ICS. +

+ +

tellothers MESSAGE +
This command lets the engine give a message to people watching the + game other than the engine's opponent. MESSAGE consists of any + characters, including whitespace, to the end of the line. When the + engine is playing against a user on the local machine, this command + does nothing. When the engine is playing against an opponent on the + ICS (Zippy mode), xboard sends "whisper MESSAGE\n" to the ICS. +

+ +

tellall MESSAGE +
This command lets the engine give a message to its opponent and + other people watching the game, + independent of whether the opponent is a user on the local machine or + a remote ICS user (Zippy mode). MESSAGE consists of any characters, + including whitespace, to the end of the line. When the engine is + playing against a user on the local machine, xboard pops up an + information dialog containing the message. When the engine is playing + against an opponent on the ICS (Zippy mode), xboard sends "kibitz + MESSAGE\n" to the ICS. + +

+ +

telluser MESSAGE +
xboard pops up an information dialog containing the message. + MESSAGE consists of any characters, including whitespace, to the end + of the line. +

+ +

tellusererror MESSAGE +
xboard pops up an error dialog containing the message. + MESSAGE consists of any characters, including whitespace, to the end + of the line. +

+ +

askuser REPTAG MESSAGE +
Here REPTAG is a string containing no whitespace, and MESSAGE + consists of any characters, including whitespace, to the end of the + line. xboard pops up a question dialog that says MESSAGE and + has a typein box. If the user types in "bar", xboard sends "REPTAG + bar" to the engine. The user can cancel the dialog and send nothing. +

+ +

tellics MESSAGE +
In Zippy mode, xboard sends "MESSAGE\n" to ICS. MESSAGE consists + of any characters, including whitespace, to the end of the line. +

+ +

tellicsnoalias MESSAGE +
+ In Zippy mode, xboard sends "xMESSAGE\n" to ICS, where "x" is a + character that prevents the ICS from expanding command aliases, if + xboard knows of such a character. (On chessclub.com and chess.net, + "/" is used; on freechess.org, "$" is used.) MESSAGE consists of any + characters, including whitespace, to the end of the line. + +

+ +

# COMMENT +
+ The engine can send any string of printable characters, terminated by a newline, + for inclusion in the winboard.debug file, provided the line starts with a '#' character. + If the engine has set feature debug=1, + it is guaranteed that WinBoard (and any future version of it) will completely ignore + these lines in any other respect. + +
+

+ +

10. Thinking Output

+ +

+ If the user asks your engine to "show thinking", xboard sends your + engine the "post" command. It sends "nopost" to turn thinking off. + In post mode, your engine sends output lines to show the progress of + its thinking. The engine can send as many or few of these lines as it + wants to, whenever it wants to. Typically they would be sent when the + PV (principal variation) changes or the depth changes. The thinking + output should be in the following format: +

+ +
ply score time nodes pv
+ + Where: + +
plyInteger giving current search depth. +
scoreInteger giving current evaluation in centipawns. +
timeCurrent search time in centiseconds (ex: + 1028 = 10.28 seconds). + +
nodesNodes searched. +
pvFreeform text giving current "best" line. + You can continue the pv onto another line if you start each + continuation line with at least four space characters. +
+ +

+ Example: +

+ +
  9 156 1084 48000 Nf3 Nc6 Nc3 Nf6
+ +

+ Meaning: +

+ + 9 ply, score=1.56, time = 10.84 seconds, nodes=48000, + PV = "Nf3 Nc6 Nc3 Nf6" + +

+ Longer example from actual Crafty output: +

+
+   4    109      14   1435  1. e4 d5 2. Qf3 dxe4 3. Qxe4 Nc6
+   4    116      23   2252  1. Nf3 Nc6 2. e4 e6
+   4    116      27   2589  1. Nf3 Nc6 2. e4 e6
+   5    141      44   4539  1. Nf3 Nc6 2. O-O e5 3. e4
+   5    141      54   5568  1. Nf3 Nc6 2. O-O e5 3. e4
+ 
+ +

+ You can use the PV to show other things; for instance, while in book, + Crafty shows the observed frequency of different reply moves in its + book. In situations like this where your engine is not really + searching, start the PV with a '(' character: +

+ +
+   0      0       0      0  (e4 64%, d4 24%)
+ 
+ +

+ GNU Chess output is very slightly different. The ply number is + followed by an extra nonblank character, and the time is in seconds, + not hundredths of seconds. For compatibility, xboard accepts the + extra character and takes it as a flag indicating the different time + units. Example: +

+ +
+  2.     14    0       38   d1d2  e8e7 
+  3+     78    0       65   d1d2  e8e7  d2d3 
+  3&     14    0       89   d1d2  e8e7  d2d3 
+  3&     76    0      191   d1e2  e8e7  e2e3 
+  3.     76    0      215   d1e2  e8e7  e2e3 
+  4&     15    0      366   d1e2  e8e7  e2e3  e7e6 
+  4.     15    0      515   d1e2  e8e7  e2e3  e7e6 
+  5+     74    0      702   d1e2  f7f5  e2e3  e8e7  e3f4 
+  5&     71    0     1085   d1e2  e8e7  e2e3  e7e6  e3f4 
+  5.     71    0     1669   d1e2  e8e7  e2e3  e7e6  e3f4 
+  6&     48    0     3035   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
+  6.     48    0     3720   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
+  7&     48    0     6381   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
+  7.     48    0    10056   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
+  8&     66    1    20536   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5 
+  8.     66    1    24387   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5 
+  9&     62    2    38886   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4 
+                            d4e4 
+  9.     62    4    72578   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4 
+                            d4e4 
+ 10&     34    7   135944   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4 
+                            d4e4  f7f5  e4f4 
+ 10.     34    9   173474   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4 
+                            d4e4  f7f5  e4f4 
+ 
+ +

If your engine is pondering (thinking on its opponent's time) in post + mode, it can show its thinking then too. In this case your engine may + omit the hint move (the move it is assuming its opponent will make) + from the thinking lines if and only if it sends xboard the move in + the usual "Hint: xxx" format before sending the first line. +

+ +

11. Time control

+ +

+ xboard supports three styles of time control: conventional chess clocks, + the ICS-style incremental clock, and an exact number of seconds per move. +

+ +

In conventional clock mode, every time control period is the same. + That is, if the time control is 40 moves in 5 minutes, then after each + side has made 40 moves, they each get an additional 5 minutes, and so + on, ad infinitum. At some future time it would be nice to support a + series of distinct time controls. This is very low on my personal + priority list, but code donations to the xboard project are accepted, + so feel free to take a swing at it. I suggest you talk to me first, + though. +

+ +

+ The command to set a conventional time control looks like this: +

+ +
+   level 40 5 0
+   level 40 0:30 0
+ 
+ +

+ The 40 means that there are 40 moves per time control. The 5 means + there are 5 minutes in the control. In the second example, the 0:30 + means there are 30 seconds. The final 0 means that we are in + conventional clock mode. +

+ +

+ + Note that the time parameter in this command is not a pure numeric argument, + but in general is a character string, in order to pass the number of seconds. + Engines are encouraged to ignore any unexpected characters at the end of this string, + i.e. following the MIN or MIN:SEC specification. + Future protocol versions might (under control of an appropriate feature) + append such extra characters to this argument, + in order to inform the engine in advance of the time control it can expect after the current session completes. + E.g. "level 40 25+5 0" could mean that the engine has to play 40 moves in 25 minutes, + but should expect to get only 5 minutes for the entire remainder of the game after that, + rather than another 25 minutes for the next 40 moves. + When the time comes, (i.e. after the 40 moves), + it will be informed of the time-control change by receiving a new "level 0 5 0" command, + but engines with advanced time management might want to plan for this in advance. + +

+ +

+ The command to set an incremental time control looks like this: +

+ +
+   level 0 2 12
+ 
+ +

+ Here the 0 means "play the whole game in this time control period", + the 2 means "base=2 minutes", and the 12 means "inc=12 seconds". As + in conventional clock mode, the second argument to level can be in + minutes and seconds. +

+ +

+ At the start of the game, each player's clock is set to base minutes. + Immediately after a player makes a move, inc seconds are added to his + clock. A player's clock counts down while it is his turn. Your flag + can be called whenever your clock is zero or negative. (Your clock + can go negative and then become positive again because of the + increment.) +

+ +

+ The number of moves given in the level command (when non-zero) should + be taken as the number of moves still to do before the specified time + will be added to the clock, if the "level" command is received after + some moves have already been played. + The time given should be interpreted as the time left on its clock + (including any time left over from the previous sessions), + and not necessarily the time that will be added to the clock + after the specified number of moves has been played. + This is only relevant in WinBoard 4.3.xx, which might send the engine + "level" commands during a game, + just before the engine has to start thinking about the first move of + a new time-control session. + Example: if at the start of the game "level 40 60 0" was given + (40 moves per hour), + and the engine receives "level 20 22 0" just before move 41, + it should understand that it should do the next 20 moves in 22 minutes + (pehaps because the secondary session was 20 moves per 15 minutes, + and it had 7 minutes left on its clock after the first 40 moves). +

+ +

+ A special rule on some ICS implementations: if you ask for a game with + base=0, the clocks really start at 10 seconds instead of 0. xboard + itself does not know about this rule, so it passes the 0 on to the + engine instead of changing it to 0:10. +

+ +

+ ICS also has time odds games. With time odds, each player has his own + (base, inc) pair, but otherwise things work the same as in normal + games. The Zippy xboard accepts time odds games but ignores the fact + that the opponent's parameters are different; this is perhaps not + quite the right thing to do, but gnuchess doesn't understand time + odds. Time odds games are always unrated. +

+ +

+ The command to set an exact number of seconds per move looks like this: +

+ +
+   st 30
+ 
+ +

+ This means that each move must be made in at most 30 seconds. Time not used + on one move does not accumulate for use on later moves. +

+ +

12. Analyze Mode

+ +

xboard supports analyzing fresh games, edited positions, and games + from files. However, all of these look the same from the chess + engine's perspective. Basically, the engine just has to respond to the + "analyze" command. + + Beginning in protocol version 2, + if your engine does not support analyze mode, it should use + the feature command to set analyze=0. + + The older method of + printing the error message "Error (unknown command): analyze" in + response to the "analyze" command will also work, however. +

+ +

+ To enter analyze mode, xboard sends the command sequence "post", "analyze". + Analyze mode in your engine should be + similar to force mode, except that your engine thinks about what move + it would make next if it were on move. Your engine should accept the + following commands while in analyze mode: +

+ +
    +
  • Any legal move, as in force mode +
  • undo   Back up one move and analyze previous position. +
  • new   Reset position to start of game but stay in analyze mode. +
  • setboard if you have set feature setboard=1; otherwise edit. Exiting edit mode returns to analyze mode. + +
  • exit   Leave analyze mode. +
  • .   Send a search status update (optional); see below. +
  • + bk   Show book moves from this position, + if any; see above. +
  • + hint   Show the predicted move from this + position, if any; see above. +
+ +

+ If the user selects "Periodic Updates", xboard will send the string + ".\n" to the chess engine periodically during analyze mode, unless the + last PV received began with a '(' character. +

+ +

+ The chess engine should respond to ".\n" with a line like this: +

+ +
+ stat01: time nodes ply mvleft mvtot mvname
+ 
+ + Where: + +
timeElapsed search time in centiseconds (ie: 567 = 5.67 seconds). +
nodesNodes searched so far. +
plySearch depth so far. +
mvleftNumber of moves left to consider at this depth. +
mvtotTotal number of moves to consider. +
mvname + Move currently being considered (SAN or coordinate notation). Optional; + added in protocol version 2. +
+ +

+ Examples: +

+
+   stat01: 1234 30000 7 5 30
+   stat01: 1234 30000 7 5 30 Nf3
+ 
+ +

+ Meaning: +

+ +

After 12.34 seconds, I've searched 7 ply/30000 nodes, there are a + total of 30 legal moves, and I have 5 more moves to search + before going to depth 8. In the second example, of the 30 legal + moves, the one I am currently searching is Nf3.

+ +

+ Implementation of the "." command is optional. If the engine does not + respond to the "." command with a "stat01..." line, xboard will stop + sending "." commands. If the engine does not implement this command, + the analysis window will use a shortened format to display the engine + info. +

+ +

+ To give the user some extra information, the chess engine can output + the strings "++\n" and "--\n", to indicate that the current search is + failing high or low, respectively. You don't have to send anything + else to say "Okay, I'm not failing high/low anymore." xboard will + figure this out itself. +

+ +

13. Idioms and backward compatibility features

+ +

+ Some engines have variant interpretations of the force/go/white/black, + time/otim, and hard/easy command sets. + In order to accommodate these older engines, xboard uses these commands + only according to the stylized patterns ("idioms") given in this section. + The obsolete white and black commands + have historically been particularly troublesome, and it is recommended + that new engines set the feature colors=0 and/or ignore the commands. +

+ +
+ +
time N +
otim N +
MOVE +
Sent when the opponent makes a move and the engine is already + playing the opposite color. +

+ +

white +
go +
Sent when the engine is in force mode or playing Black but should + switch to playing White. This sequence is sent only when White is + already on move. + + If you set the feature colors=0, "white" is not sent. + +

+ +

black +
go +
Sent when the engine is in force mode or playing White but should + switch to playing Black. This sequence is sent only when Black is + already on move. + + If you set the feature colors=0, "black" is not sent. + +

+ +

white +
time N +
otim N +
black +
go +
Sent when Black is on move, the engine is in force mode or playing + White, and the engine's clock needs to be updated before it starts + playing. + The initial "white" is a kludge to accommodate GNU Chess + 4's variant interpretation of these commands. + + If you set the feature colors=0, "white" and "black" are not sent. + +

+ +

black +
time N +
otim N +
white +
go +
Sent when White is on move, the engine is in force mode or playing + Black, and the engine's clock needs to be updated before it starts + playing. See previous idiom. + The initial "black" is a kludge to accommodate GNU Chess + 4's variant interpretation of these commands. + + If you set the feature colors=0, "black" and "white" are not sent. + +

+ +

hard +
easy +
Sent in sequence to turn off pondering if xboard is not sure + whether it is on. When xboard is sure, it will send "hard" or "easy" + alone. xboard does this because "easy" is a toggle in GNU Chess 4 but + "hard" is an absolute on. + +
+ +

+ To support older engines, certain additional commands from the engine + to xboard are also recognized. (These are commands by themselves, not + values to be placed in the comment field of the PGN result code.) + These forms are not recommended for new engines; use the PGN result + code commands or the resign command instead. +

+ + +
Command Interpreted as +
White resigns 0-1 {White resigns} +
Black resigns 1-0 {Black resigns} +
White 1-0 {White mates} +
Black 0-1 {Black mates} +
Draw 1/2-1/2 {Draw} +
computer mates 1-0 {White mates} or 0-1 {Black mates} +
opponent mates 1-0 {White mates} or 0-1 {Black mates} +
computer resigns 0-1 {White resigns} or 1-0 {Black resigns} +
game is a draw 1/2-1/2 {Draw} +
checkmate 1-0 {White mates} or 0-1 {Black mates} +
+ +

+ Commands in the above table are recognized if they begin a line and + arbitrary characters follow, so (for example) "White mates" will be + recognized as "White", and "game is a draw by the 50 move rule" will + be recognized as "game is a draw". All the commands are + case-sensitive. +

+ +

+ An alternative move syntax is also recognized: +

+ + +
Command Interpreted as +
NUMBER ... MOVE move MOVE +
+ +

+ Here NUMBER means any string of decimal digits, optionally ending in a + period. MOVE is any string containing no whitespace. In this command + format, xboard requires the "..." even if your engine is playing + White. A command of the form NUMBER MOVE will be ignored. This odd + treatment of the commands is needed for compatibility with gnuchessx. + The original reasons for it are lost in the mists of time, but I + suspect it was originally a bug in the earliest versions of xboard, + before I started working on it, which someone "fixed" in the wrong + way, by creating a special version of gnuchess (gnuchessx) instead of + changing xboard. +

+ +

+ Any line that contains the words "offer" and "draw" is recognized as + "offer draw". +

+ +

+ The "Illegal move" message is recognized even if spelled "illegal + move" and even if the colon (":") is omitted. This accommodates GNU + Chess 4, which prints messages like "Illegal move (no matching + move)e2e4", and old versions of Crafty, which print just "illegal move". +

+ +

+ In Zippy mode, for compatibility with older versions of Crafty, + xboard passes through to ICS any line that begins "kibitz", "whisper", + "tell", or "draw". Do not use this feature in new code. Instead, use the + commands "tellall", "tellothers", "tellopponent", "tellics" (if needed), + "1/2-1/2 {COMMENT}", or "offer draw", as appropriate. +

+ +

+ + If the engine responds to the "sd DEPTH" command with an error message + indicating the command is not supported (such as "Illegal move: sd"), + xboard sets an internal flag and subsequently uses the command + "depth\nDEPTH" instead, for the benefit of GNU Chess 4. Note the + newline in the middle of this command! New engines should not rely on + this feature. + +

+ +

+ + If the engine responds to the "st TIME" command with an error message + indicating the command is not supported (such as "Illegal move: st"), + xboard sets an internal flag and subsequently uses the command "level + 1 TIME" instead, for the benefit of GNU Chess 4. Note that this is + not a standard use of the level command, as TIME seconds are not added + after each player makes 1 move; rather, each move is made in at most + TIME seconds. New engines should not implement or rely on this + feature. + +

+ + +

+ In support of the -firstHost/-secondHost features, which allow a chess + engine to be run on another machine using the rsh protocol, xboard recognizes + error messages that are likely to come from rsh as fatal errors. The following + messages are currently recognized: +

+ +
+ unknown host
+ No remote directory
+ not found
+ No such file
+ can't alloc
+ Permission denied
+
+
+ +

+ + ChessBase/Fritz now implements the xboard/winboard protocol and can use + WinBoard-compatible engines in its GUI. ChessBase's version of the + protocol is generally the same as version 1, except that they have + added the commands fritz, reset, and + ponder, and the edit subcommands + castle and ep. If you want your + engine to work well with the ChessBase/Fritz GUI, you may need to + implement these additional commands, and you should also be aware of + the peculiar way that ChessBase uses the protocol. See their web page for documentation. + +

+ +

+ + ChessMaster 8000 also implements version 1 of the xboard/winboard + protocol and can use WinBoard-compatible engines. The original + release of CM8000 also has one additional restriction: only pure + coordinate notation (e.g., e2e4) is accepted in the move command. A + patch to correct this should be available from The Learning Company + (makers of CM8000) in February 2001. + +

+ +
+
converted to HTML by Steffen A. Jakob
+ + diff --cc parser.c index 0000000,27d1a13..58282bd mode 000000,100644..100644 --- a/parser.c +++ b/parser.c @@@ -1,0 -1,4056 +1,4050 @@@ + /* A lexical scanner generated by flex */ + + /* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + + #define FLEX_SCANNER + #define YY_FLEX_MAJOR_VERSION 2 + #define YY_FLEX_MINOR_VERSION 5 + + #include + #include + + /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ + #ifdef c_plusplus + #ifndef __cplusplus + #define __cplusplus + #endif + #endif + + + #ifdef __cplusplus + + #include + #ifndef _WIN32 + #include + #endif + + /* Use prototypes in function declarations. */ + #define YY_USE_PROTOS + + /* The "const" storage-class-modifier is valid. */ + #define YY_USE_CONST + + #else /* ! __cplusplus */ + + #if __STDC__ + + #define YY_USE_PROTOS + #define YY_USE_CONST + + #endif /* __STDC__ */ + #endif /* ! __cplusplus */ + + #ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use + #include + #include + #define YY_USE_CONST + #define YY_USE_PROTOS + #endif + + #ifdef YY_USE_CONST + #define yyconst const + #else + #define yyconst + #endif + + + #ifdef YY_USE_PROTOS + #define YY_PROTO(proto) proto + #else + #define YY_PROTO(proto) () + #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. */ + #define YY_BUF_SIZE 16384 + + typedef struct yy_buffer_state *YY_BUFFER_STATE; + + extern int yyleng; + extern FILE *yyin, *yyout; + + #define EOB_ACT_CONTINUE_SCAN 0 + #define EOB_ACT_END_OF_FILE 1 + #define EOB_ACT_LAST_MATCH 2 + + /* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + + /* Return all but the first 'n' matched characters back to the input stream. */ + + #define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + + #define unput(c) yyunput( c, yytext_ptr ) + + /* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ + typedef unsigned int yy_size_t; + + + 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. + */ + int 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; + + /* 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 + }; + + static YY_BUFFER_STATE yy_current_buffer = 0; + + /* 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". + */ + #define YY_CURRENT_BUFFER yy_current_buffer + + + /* yy_hold_char holds the character lost when yytext is formed. */ + static char yy_hold_char; + + static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + + int yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; + static int yy_init = 1; /* 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 YY_PROTO(( FILE *input_file )); + + void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); + void yy_load_buffer_state YY_PROTO(( void )); + YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); + void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); + void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); + void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); + #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + + YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); + YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); + YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + + static void *yy_flex_alloc YY_PROTO(( yy_size_t )); + static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); + static void yy_flex_free YY_PROTO(( void * )); + + #define yy_new_buffer yy_create_buffer + + #define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + + #define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + + #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + + #define YY_USES_REJECT + typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + extern char *yytext; + #define yytext_ptr yytext + + static yy_state_type yy_get_previous_state YY_PROTO(( void )); + static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); + static int yy_get_next_buffer YY_PROTO(( void )); + static void yy_fatal_error YY_PROTO(( 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 = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + + #define YY_NUM_RULES 42 + #define YY_END_OF_BUFFER 43 + static yyconst short int yy_acclist[650] = + { 0, + 43, 41, 42, 41, 42, 41, 42, 40, 41, 42, + 41, 42, 25, 41, 42, 41, 42, 40, 41, 42, + 40, 41, 42,16410, 40, 41, 42,16410, 41, 42, + 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, + 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 40, 41, 42, 41, 42, 40, 41, 42, 40, 41, + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, + 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, + + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 40, 41, 42, 40, 41, 42, 41, 42, 41, 42, + 40, 41, 42, 40, 41, 42, 40, 41, 42,16410, + 40, 41, 42,16410, 41, 42, 40, 41, 42, 40, + 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, + 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, + + 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, + 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, + 41, 42, 33, 40, 17, 40, 9, 40, 40, 40, + 16410, 8218, 40, 35, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, + 40, 40, 36, 40, 3, 40, 40, 4, 40, 40, + 40, 40, 40, 40, 9, 40, 40, 40, 34, 40, + 40, 9, 40, 40, 40,16410, 8218, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 9, + 40, 40, 40, 40, 40, 40, 40, 3, 40, 40, + + 4, 40, 40, 40, 40, 40, 40, 9, 40, 40, + 40, 15, 9, 40, 23, 40, 23, 8, 40, 8218, + 22, 40, 22, 24, 40, 40, 40, 6, 40, 40, + 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, + 20, 40, 4, 40, 40, 3, 3, 40, 3, 40, + 40, 4, 5, 40, 4, 4, 40, 40, 40, 40, + 9, 40, 40, 34, 39, 9, 40, 23, 40, 8, + 40, 22, 40, 35, 40, 40, 40, 6, 40, 40, + 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, + 20, 40, 4, 40, 40, 3, 40, 3, 40, 40, + + 5, 40, 4, 40, 40, 40, 40, 9, 40, 40, + 38, 38, 37, 25, 25, 6, 40, 10, 6, 40, + 7, 40, 6, 40, 6, 40, 40, 40, 19, 40, + 40, 21, 40, 16, 40, 40, 40, 40, 40, 20, + 20, 40, 20, 40, 36, 3, 3, 2, 40, 5, + 4, 5, 5, 40, 40, 4, 4, 40, 40, 25, + 39, 40, 6, 40, 7, 40, 40, 40, 40, 40, + 19, 40, 40, 21, 40, 16, 40, 40, 40, 40, + 40, 20, 40, 20, 20, 40, 2, 40, 5, 40, + 40, 4, 40, 40, 7, 7, 1, 40, 40, 40, + + 19, 40, 40, 40, 21, 21, 40, 21, 40, 40, + 40, 40, 30, 36, 2, 2, 2, 40, 5, 5, + 5, 40, 39, 1, 40, 40, 40, 19, 40, 40, + 40, 21, 40, 21, 21, 40, 40, 40, 40, 20, + 39, 2, 40, 5, 40, 27, 38, 1, 23, 23, + 22, 22, 24, 24, 1, 1, 40, 20, 21, 40, + 40, 40, 11, 40, 40, 28, 36, 30, 2, 2, + 27, 34, 39, 39, 1, 40, 40, 40, 40, 21, + 39, 11, 40, 40, 20, 39, 18, 1, 24, 1, + 20, 21, 19, 40, 40, 40, 11, 40, 40, 40, + + 40, 21, 39, 40, 11, 40, 40, 12, 40, 40, + 40, 40, 12, 40, 40, 14, 40, 40, 40, 14, + 40, 40, 40, 39, 40, 40, 40, 40, 39, 39, + 40, 40, 31, 40, 39, 39, 31, 40, 13, 31, + 32, 32, 35, 39, 39, 31, 39, 34, 29 + } ; + + static yyconst short int yy_accept[698] = + { 0, + 1, 1, 1, 2, 4, 6, 8, 11, 13, 16, + 18, 21, 25, 29, 31, 34, 37, 40, 43, 46, + 49, 52, 55, 58, 61, 64, 66, 69, 72, 75, + 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, + 108, 111, 114, 117, 119, 121, 124, 127, 131, 135, + 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, + 167, 170, 173, 176, 179, 182, 185, 188, 191, 194, + 197, 200, 203, 206, 209, 212, 215, 218, 221, 223, + 223, 224, 225, 225, 225, 225, 225, 226, 226, 226, + 226, 227, 227, 229, 229, 229, 229, 230, 230, 230, + + 232, 232, 234, 234, 235, 235, 236, 236, 237, 237, + 238, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 248, 249, 250, 251, 252, 253, 253, 253, 253, 253, + 254, 255, 257, 257, 258, 260, 261, 262, 263, 264, + 265, 267, 268, 269, 269, 269, 269, 270, 270, 271, + 271, 272, 274, 274, 275, 277, 277, 279, 279, 280, + 281, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 292, 293, 294, 295, 296, 297, 298, 300, 300, + 301, 303, 304, 305, 306, 307, 308, 310, 311, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, + + 312, 313, 313, 313, 313, 313, 313, 315, 317, 318, + 320, 321, 321, 321, 321, 323, 324, 325, 325, 326, + 326, 327, 327, 328, 328, 330, 330, 330, 330, 330, + 331, 332, 333, 334, 335, 336, 338, 339, 340, 341, + 343, 343, 343, 343, 343, 345, 345, 346, 346, 347, + 349, 351, 352, 353, 353, 355, 356, 358, 359, 360, + 361, 363, 364, 365, 365, 365, 365, 365, 366, 368, + 370, 372, 374, 374, 375, 375, 376, 377, 377, 378, + 380, 381, 382, 383, 384, 385, 386, 388, 389, 390, + 391, 393, 395, 396, 396, 398, 400, 401, 403, 405, + + 406, 407, 408, 410, 411, 411, 411, 412, 413, 413, + 413, 414, 414, 414, 415, 415, 416, 416, 417, 417, + 417, 417, 418, 418, 418, 418, 418, 418, 418, 418, + 419, 421, 421, 423, 424, 425, 425, 426, 427, 427, + 427, 427, 427, 428, 429, 431, 431, 432, 434, 436, + 437, 438, 439, 440, 441, 443, 445, 445, 445, 445, + 445, 446, 447, 447, 448, 450, 451, 452, 452, 452, + 453, 455, 456, 457, 457, 459, 460, 460, 461, 461, + 461, 461, 461, 462, 462, 463, 463, 463, 465, 467, + 468, 468, 469, 470, 471, 473, 474, 476, 478, 479, + + 480, 481, 482, 484, 485, 487, 489, 491, 492, 494, + 495, 495, 495, 495, 495, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 497, 499, 499, 499, 499, + 499, 500, 501, 501, 503, 503, 504, 505, 506, 508, + 510, 511, 512, 513, 513, 513, 515, 515, 515, 516, + 516, 517, 519, 520, 520, 521, 521, 523, 523, 523, + 523, 523, 523, 523, 523, 524, 524, 524, 526, 527, + 528, 530, 531, 532, 534, 535, 537, 538, 539, 540, + 542, 544, 546, 546, 546, 548, 548, 549, 549, 550, + 550, 551, 551, 552, 552, 553, 553, 554, 554, 555, + + 555, 555, 555, 556, 558, 558, 558, 560, 560, 561, + 561, 561, 561, 561, 561, 562, 563, 565, 566, 568, + 568, 569, 570, 571, 571, 571, 573, 573, 573, 574, + 575, 575, 575, 577, 578, 579, 580, 582, 584, 585, + 587, 587, 588, 588, 588, 589, 589, 590, 591, 591, + 591, 591, 593, 593, 593, 594, 594, 594, 594, 594, + 595, 596, 597, 599, 600, 600, 600, 600, 600, 600, + 601, 602, 604, 605, 607, 608, 608, 608, 608, 608, + 608, 608, 609, 609, 609, 609, 609, 610, 611, 611, + 611, 611, 611, 612, 613, 613, 613, 613, 613, 614, + + 614, 614, 614, 615, 616, 618, 618, 618, 618, 618, + 619, 619, 620, 622, 622, 622, 622, 622, 623, 624, + 624, 624, 624, 624, 625, 626, 627, 627, 627, 627, + 627, 627, 628, 629, 629, 629, 629, 629, 630, 631, + 632, 633, 633, 633, 633, 633, 633, 635, 635, 635, + 635, 635, 636, 637, 639, 639, 639, 640, 640, 641, + 641, 642, 642, 642, 644, 644, 645, 646, 646, 646, + 646, 646, 648, 648, 648, 648, 648, 648, 648, 648, + 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, + 648, 648, 648, 648, 649, 650, 650 + + } ; + + static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 5, 6, 7, 8, 1, 9, 10, + 11, 12, 13, 1, 14, 15, 16, 17, 18, 19, + 20, 20, 20, 20, 20, 20, 20, 21, 22, 1, + 23, 1, 1, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 33, 34, 35, 36, 37, 38, 34, + 34, 39, 40, 33, 41, 33, 42, 43, 33, 33, + 44, 1, 45, 1, 46, 1, 47, 48, 49, 50, + + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 68, 72, 1, 73, 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 yyconst int yy_meta[74] = + { 0, + 1, 2, 3, 2, 1, 1, 1, 1, 4, 5, + 6, 1, 7, 8, 1, 1, 9, 9, 9, 9, + 10, 1, 11, 1, 12, 12, 12, 12, 12, 12, + 12, 12, 13, 12, 13, 13, 12, 12, 12, 13, + 13, 12, 14, 1, 1, 1, 15, 15, 15, 15, + 16, 15, 15, 15, 15, 15, 15, 15, 17, 18, + 18, 18, 18, 18, 17, 17, 17, 17, 17, 19, + 17, 1, 1 + } ; + + static yyconst short int yy_base[784] = + { 0, + 0, 73, 2729, 4517, 122, 131, 0, 142, 2724, 140, + 151, 171, 162, 2724, 231, 159, 2672, 2661, 119, 2660, + 2673, 143, 2668, 2652, 211, 301, 361, 212, 209, 279, + 243, 284, 301, 286, 221, 303, 309, 329, 2670, 239, + 2665, 2649, 338, 403, 2710, 149, 380, 475, 348, 190, + 538, 240, 2659, 2648, 236, 2650, 2663, 157, 2658, 2642, + 379, 600, 314, 353, 377, 395, 401, 413, 382, 408, + 513, 424, 516, 423, 562, 448, 544, 607, 612, 2654, + 468, 0, 2696, 309, 617, 174, 4517, 2692, 672, 246, + 353, 2686, 2686, 2680, 517, 661, 2680, 576, 280, 655, + + 2679, 0, 2692, 4517, 0, 696, 0, 741, 0, 580, + 644, 586, 622, 2645, 2640, 2592, 2592, 692, 2617, 2616, + 714, 2606, 680, 720, 2592, 2606, 811, 537, 884, 4517, + 911, 961, 0, 986, 1035, 687, 753, 757, 2584, 2588, + 2587, 2582, 2591, 318, 2568, 825, 2636, 2635, 430, 2634, + 747, 820, 253, 830, 1085, 160, 563, 455, 1148, 1193, + 2633, 784, 843, 850, 760, 603, 692, 844, 854, 2596, + 657, 858, 893, 862, 893, 658, 1217, 1267, 2629, 1292, + 1342, 913, 926, 1157, 831, 894, 915, 918, 895, 845, + 2568, 464, 487, 538, 2620, 556, 1162, 1073, 2619, 2556, + + 4517, 1146, 1209, 2624, 2623, 2622, 2611, 2620, 2619, 0, + 4517, 2618, 2616, 2615, 2614, 2613, 384, 1029, 1062, 1078, + 1367, 1147, 1145, 1167, 1412, 2558, 2551, 2564, 2559, 1240, + 1422, 2540, 756, 651, 2557, 2593, 2551, 2547, 1214, 1482, + 722, 1208, 761, 1555, 1619, 0, 1624, 0, 2594, 2592, + 2591, 1174, 1426, 1490, 1673, 2591, 2589, 560, 2550, 2549, + 2583, 2530, 4517, 1499, 1039, 2591, 725, 2587, 928, 845, + 592, 917, 642, 2585, 1156, 1503, 1716, 2584, 1516, 1761, + 1531, 1564, 1470, 1565, 1464, 1429, 1580, 1490, 1566, 1598, + 1831, 1896, 1901, 2583, 1582, 2573, 1613, 1950, 1587, 1676, + + 1588, 1614, 1581, 1149, 1539, 2528, 4517, 775, 799, 2562, + 4517, 1709, 2557, 2556, 2493, 2492, 1202, 1709, 2546, 2545, + 2544, 2544, 615, 2543, 744, 2542, 1099, 1674, 832, 4517, + 2535, 1719, 2534, 2533, 1955, 1622, 4517, 1410, 2490, 2490, + 2487, 2487, 2494, 2493, 778, 892, 920, 2013, 0, 2511, + 2495, 2496, 2495, 0, 2086, 2159, 940, 1210, 1233, 1309, + 2540, 2533, 1434, 4517, 1776, 1424, 2529, 910, 1615, 1616, + 2528, 1173, 4517, 2476, 0, 2476, 1842, 2532, 1727, 1735, + 2488, 2473, 2530, 1003, 1736, 904, 599, 1216, 1523, 2186, + 2528, 1847, 1726, 1767, 1880, 1771, 2244, 1522, 1813, 1849, + + 1848, 1862, 2317, 2527, 2390, 2029, 1869, 1879, 1713, 2021, + 1747, 2479, 2517, 1595, 2500, 1809, 2511, 2443, 2504, 2441, + 2500, 2433, 2460, 1869, 4517, 2454, 2427, 2423, 2423, 2418, + 2468, 1049, 2006, 2467, 1075, 2440, 2410, 0, 2497, 2570, + 2400, 2394, 2448, 1341, 1756, 4517, 2446, 1803, 1343, 1491, + 1768, 2439, 2438, 1416, 4517, 2386, 0, 2425, 1871, 2421, + 1240, 2416, 2373, 2366, 1454, 1718, 1473, 2635, 1888, 2044, + 1889, 2042, 2023, 2678, 2425, 1990, 1886, 2052, 2063, 2425, + 1870, 1899, 1958, 1000, 4517, 2095, 1777, 2416, 2415, 2351, + 2350, 2411, 2410, 2347, 2346, 2407, 2406, 2343, 2342, 2393, + + 2388, 1840, 2017, 2382, 2320, 2326, 2011, 2298, 2303, 2338, + 2296, 2275, 2316, 2293, 2302, 2270, 2018, 2264, 4517, 2117, + 4517, 2296, 4517, 2290, 2119, 2300, 2251, 2231, 2282, 1960, + 1445, 289, 2107, 2108, 2114, 2068, 2281, 2125, 2131, 2280, + 2139, 4517, 2227, 2176, 2262, 2267, 2258, 4517, 2187, 2173, + 2177, 4517, 2166, 2214, 2211, 2157, 2198, 2148, 2103, 2111, + 2085, 2098, 0, 2077, 2196, 2071, 2002, 827, 1575, 2168, + 2135, 2063, 2170, 2136, 2164, 2203, 2000, 2014, 1683, 1939, + 1931, 2030, 1944, 1630, 1954, 1906, 2751, 1919, 1917, 1913, + 1385, 1565, 2824, 2249, 2204, 1850, 1863, 1832, 4517, 1806, + + 1637, 1912, 2897, 1920, 0, 1775, 1762, 1585, 945, 2970, + 2096, 1949, 2188, 2207, 1772, 1743, 2250, 1745, 1677, 1563, + 1551, 1686, 681, 2260, 1568, 1502, 2258, 1408, 1406, 2243, + 2170, 1358, 1313, 1240, 1258, 1751, 1127, 2261, 2312, 1072, + 926, 2279, 2133, 809, 1969, 2073, 0, 855, 705, 711, + 1429, 2317, 2305, 0, 2284, 631, 4517, 546, 2094, 480, + 4517, 413, 392, 4517, 1794, 2351, 2357, 2298, 325, 206, + 1884, 2303, 2352, 203, 1915, 365, 2138, 2221, 2364, 2365, + 2369, 2370, 2371, 2372, 2373, 2427, 2444, 2451, 2452, 2453, + 2454, 2456, 2296, 179, 4517, 4517, 3040, 3059, 3072, 3086, + + 3105, 3124, 3140, 3159, 3178, 3196, 1267, 1342, 1671, 3214, + 3233, 1702, 3252, 3271, 3290, 3309, 3328, 3347, 3366, 3385, + 3404, 3416, 3435, 3454, 3473, 3492, 3511, 3519, 1896, 3529, + 3545, 3564, 3580, 3599, 3618, 3637, 3656, 3675, 3694, 3713, + 3732, 3744, 3763, 3782, 3801, 3820, 3839, 3858, 3877, 3893, + 3908, 3924, 3943, 3962, 3981, 3997, 4016, 4035, 4054, 4073, + 4092, 4111, 4130, 4149, 4168, 4187, 4206, 4225, 4244, 4259, + 4278, 4297, 4316, 4331, 4345, 4364, 4383, 4402, 4421, 4440, + 4459, 4478, 4497 + } ; + + static yyconst short int yy_def[784] = + { 0, + 696, 696, 696, 696, 696, 696, 697, 698, 696, 699, + 697, 696, 12, 700, 697, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 701, 697, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 697, 697, + 697, 697, 697, 702, 696, 703, 703, 696, 48, 700, + 703, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 703, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 703, 703, 703, 703, 703, 702, 696, + 696, 697, 704, 705, 704, 696, 696, 696, 696, 696, + 697, 696, 697, 696, 706, 706, 697, 706, 696, 12, + + 696, 697, 700, 696, 707, 697, 708, 697, 709, 108, + 696, 108, 108, 697, 697, 697, 697, 108, 106, 697, + 108, 697, 108, 108, 697, 710, 701, 710, 711, 696, + 697, 696, 712, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 702, 713, 702, 696, 714, 703, 696, + 703, 703, 696, 703, 696, 696, 703, 715, 703, 159, + 709, 160, 160, 160, 703, 703, 703, 703, 160, 159, + 703, 160, 703, 160, 160, 703, 159, 696, 712, 159, + 696, 703, 703, 703, 703, 703, 703, 703, 703, 702, + 696, 716, 717, 717, 718, 719, 716, 716, 720, 721, + + 696, 722, 722, 696, 696, 696, 697, 697, 696, 697, + 696, 696, 696, 696, 697, 696, 696, 696, 697, 696, + 697, 722, 697, 696, 697, 696, 696, 696, 696, 697, + 697, 697, 697, 697, 697, 697, 697, 697, 697, 723, + 724, 725, 726, 727, 697, 728, 697, 729, 728, 697, + 247, 697, 730, 730, 697, 254, 697, 697, 697, 697, + 697, 697, 696, 702, 696, 731, 696, 732, 733, 733, + 733, 733, 734, 731, 735, 733, 733, 222, 733, 277, + 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, + 736, 733, 277, 729, 733, 293, 733, 292, 733, 733, + + 733, 733, 733, 733, 702, 696, 696, 737, 737, 738, + 696, 739, 740, 740, 741, 741, 696, 742, 696, 696, + 696, 697, 696, 696, 696, 696, 696, 696, 696, 696, + 697, 742, 697, 696, 697, 332, 696, 697, 696, 696, + 696, 696, 697, 697, 697, 696, 697, 743, 697, 697, + 697, 697, 697, 744, 745, 745, 746, 746, 747, 748, + 749, 696, 696, 696, 750, 751, 696, 696, 751, 751, + 697, 697, 696, 696, 697, 697, 702, 696, 696, 696, + 696, 696, 752, 696, 733, 753, 753, 733, 733, 293, + 336, 733, 733, 733, 733, 733, 754, 733, 733, 733, + + 733, 733, 755, 744, 755, 756, 733, 733, 733, 733, + 702, 696, 757, 758, 696, 696, 759, 760, 761, 762, + 763, 764, 696, 696, 696, 697, 696, 696, 696, 696, + 697, 697, 696, 697, 696, 697, 697, 765, 766, 766, + 697, 697, 697, 767, 768, 696, 769, 696, 770, 770, + 770, 697, 696, 696, 696, 696, 697, 696, 702, 696, + 696, 696, 696, 696, 771, 772, 772, 733, 733, 733, + 733, 733, 733, 754, 765, 474, 733, 733, 733, 773, + 733, 733, 702, 696, 696, 758, 774, 759, 759, 760, + 760, 761, 761, 762, 762, 763, 763, 764, 764, 696, + + 696, 774, 774, 697, 696, 696, 696, 696, 697, 775, + 696, 696, 696, 696, 697, 697, 697, 697, 696, 696, + 696, 696, 696, 696, 702, 696, 696, 696, 771, 771, + 772, 772, 733, 733, 733, 733, 776, 733, 733, 773, + 702, 696, 696, 758, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 775, 775, 696, 696, 696, 696, 697, + 697, 697, 697, 697, 702, 696, 696, 772, 772, 733, + 733, 776, 733, 733, 733, 702, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 777, 697, 696, 696, + 772, 772, 778, 733, 702, 696, 696, 696, 696, 696, + + 779, 779, 777, 603, 697, 696, 696, 772, 772, 778, + 779, 610, 733, 702, 696, 696, 779, 603, 603, 696, + 696, 772, 772, 780, 610, 610, 702, 696, 696, 779, + 779, 603, 603, 696, 696, 772, 772, 780, 780, 610, + 610, 702, 696, 696, 779, 779, 603, 781, 696, 782, + 772, 780, 780, 610, 702, 696, 696, 696, 779, 781, + 696, 696, 782, 696, 772, 780, 780, 702, 696, 696, + 772, 780, 702, 696, 772, 702, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 696, 696, 0, 696, 696, 696, 696, + + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696 + } ; + + static yyconst short int yy_nxt[4591] = + { 0, + 4, 4, 4, 5, 4, 4, 6, 4, 7, 8, + 4, 9, 10, 7, 4, 4, 11, 12, 13, 13, + 4, 14, 4, 4, 15, 16, 17, 18, 15, 15, + 19, 15, 15, 15, 20, 21, 15, 22, 23, 24, + 15, 25, 15, 26, 4, 4, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 7, + 40, 7, 7, 41, 42, 7, 7, 7, 43, 7, + 7, 44, 4, 4, 4, 4, 5, 4, 45, 6, + 45, 7, 8, 4, 9, 10, 46, 4, 4, 47, + 48, 49, 49, 4, 50, 4, 4, 51, 52, 53, + + 54, 51, 51, 55, 51, 51, 51, 56, 57, 51, + 58, 59, 60, 51, 61, 51, 26, 4, 4, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 46, 75, 46, 46, 76, 77, 46, 46, + 46, 78, 46, 46, 79, 4, 80, 81, 81, 81, + 81, 84, 87, 88, 90, 115, 119, 82, 85, 85, + 85, 85, 111, 268, 91, 95, 92, 93, 80, 150, + 170, 94, 95, 95, 96, 82, 216, 696, 116, 82, + 120, 695, 696, 199, 97, 98, 99, 100, 100, 100, + 100, 101, 104, 158, 171, 102, 102, 102, 102, 102, + + 102, 102, 102, 82, 102, 82, 82, 102, 102, 102, + 82, 82, 102, 82, 111, 111, 112, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 82, + 102, 102, 102, 102, 102, 82, 82, 82, 82, 82, + 82, 82, 105, 111, 106, 200, 107, 108, 108, 108, + 108, 109, 140, 648, 105, 136, 268, 135, 135, 204, + 135, 205, 138, 674, 123, 124, 206, 136, 136, 137, + 209, 125, 166, 106, 135, 135, 135, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 136, + 136, 104, 135, 135, 135, 167, 216, 163, 217, 141, + + 106, 126, 127, 127, 127, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 128, 126, 126, 111, 195, 196, + 145, 126, 126, 126, 126, 136, 136, 135, 135, 135, + 136, 136, 136, 136, 135, 135, 135, 115, 135, 135, + 135, 111, 114, 569, 126, 130, 126, 136, 136, 136, + 136, 95, 135, 135, 135, 136, 136, 135, 135, 135, + 116, 149, 181, 696, 135, 135, 135, 677, 150, 207, + 208, 183, 126, 126, 131, 136, 136, 132, 132, 132, + 132, 133, 111, 90, 542, 135, 135, 328, 82, 117, + 147, 143, 125, 151, 664, 92, 152, 329, 125, 182, + + 153, 181, 181, 134, 329, 145, 184, 135, 135, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 146, + 146, 146, 146, 182, 182, 181, 181, 181, 182, 182, + 134, 82, 174, 175, 181, 181, 181, 147, 82, 176, + 165, 182, 182, 150, 181, 181, 181, 182, 182, 166, + 150, 181, 181, 181, 182, 182, 82, 274, 275, 182, + 182, 181, 181, 181, 181, 181, 181, 670, 150, 185, + 182, 182, 167, 193, 307, 147, 95, 95, 96, 181, + 181, 181, 661, 82, 81, 81, 81, 81, 154, 98, + 99, 155, 155, 155, 155, 156, 195, 308, 188, 157, + + 157, 157, 157, 157, 157, 157, 157, 149, 157, 149, + 149, 157, 157, 157, 149, 149, 157, 149, 95, 95, + 95, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 149, 157, 157, 157, 157, 157, 149, + 149, 149, 149, 149, 149, 149, 82, 195, 308, 105, + 241, 159, 82, 107, 160, 160, 160, 160, 161, 182, + 182, 105, 182, 182, 150, 310, 311, 181, 181, 181, + 82, 82, 181, 181, 374, 186, 168, 95, 95, 95, + 159, 130, 150, 150, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 225, 225, 225, 225, + + 82, 104, 225, 225, 225, 225, 669, 159, 82, 173, + 111, 82, 150, 177, 145, 82, 178, 178, 178, 178, + 179, 375, 187, 150, 417, 190, 193, 150, 146, 146, + 146, 146, 230, 197, 197, 197, 197, 198, 225, 225, + 225, 225, 180, 284, 274, 275, 181, 181, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 95, 467, + 189, 176, 95, 95, 95, 82, 82, 176, 82, 180, + 696, 226, 231, 227, 212, 696, 213, 150, 150, 228, + 657, 214, 229, 104, 147, 109, 418, 107, 202, 202, + 202, 202, 109, 226, 271, 227, 225, 225, 225, 225, + + 82, 348, 228, 255, 255, 255, 255, 229, 225, 225, + 225, 225, 150, 664, 109, 348, 348, 291, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, + 225, 225, 225, 225, 239, 358, 225, 225, 225, 225, + 637, 109, 219, 219, 219, 219, 219, 219, 219, 219, + 219, 219, 219, 219, 221, 82, 662, 235, 284, 346, + 216, 222, 217, 269, 270, 360, 130, 150, 82, 255, + 255, 255, 255, 255, 255, 255, 255, 381, 237, 240, + 150, 433, 347, 221, 310, 311, 382, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 259, + + 280, 280, 280, 280, 347, 361, 283, 260, 310, 311, + 221, 126, 127, 127, 127, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 145, 82, 104, + 591, 126, 126, 126, 126, 423, 271, 434, 82, 82, + 150, 146, 146, 146, 146, 264, 272, 145, 323, 424, + 150, 150, 82, 82, 126, 130, 126, 661, 305, 280, + 280, 280, 280, 658, 150, 150, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 126, 126, 126, 242, 242, 242, 243, 281, + 126, 126, 126, 126, 126, 126, 286, 147, 126, 126, + + 282, 82, 82, 82, 126, 126, 104, 126, 285, 280, + 280, 280, 280, 150, 150, 150, 290, 147, 435, 286, + 327, 82, 288, 82, 374, 82, 82, 126, 130, 298, + 298, 298, 298, 150, 82, 150, 82, 150, 150, 289, + 435, 385, 298, 298, 298, 298, 150, 104, 150, 304, + 466, 436, 291, 358, 303, 126, 126, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 82, + 246, 373, 301, 437, 247, 271, 654, 82, 82, 82, + 82, 248, 288, 249, 130, 250, 250, 250, 250, 250, + 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, + + 250, 250, 250, 251, 465, 623, 465, 252, 252, 252, + 252, 252, 252, 252, 252, 252, 252, 252, 252, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 247, 82, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 254, 330, 330, 330, 330, 542, + 378, 255, 255, 255, 255, 379, 380, 256, 543, 257, + 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 257, 331, 331, + 331, 331, 193, 307, 509, 258, 95, 95, 95, 312, + 312, 312, 312, 82, 332, 332, 332, 332, 149, 98, + + 654, 155, 155, 155, 155, 150, 513, 509, 419, 157, + 157, 157, 157, 157, 157, 157, 157, 149, 157, 149, + 149, 157, 157, 157, 149, 149, 157, 149, 514, 104, + 651, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 149, 157, 157, 157, 157, 157, 149, + 149, 149, 149, 149, 149, 149, 82, 82, 104, 222, + 696, 333, 333, 333, 333, 82, 222, 696, 150, 150, + 420, 193, 307, 298, 298, 298, 298, 150, 197, 197, + 197, 197, 198, 334, 334, 334, 334, 456, 222, 696, + 365, 365, 365, 365, 276, 276, 276, 276, 276, 276, + + 276, 276, 276, 276, 276, 276, 277, 302, 386, 242, + 242, 242, 243, 278, 402, 222, 696, 387, 415, 415, + 415, 415, 222, 444, 82, 318, 318, 318, 318, 222, + 333, 333, 333, 333, 457, 277, 150, 360, 337, 279, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 222, 130, 212, 130, 213, 333, 333, 333, 333, + 214, 649, 277, 292, 292, 292, 292, 292, 292, 292, + 292, 292, 292, 292, 292, 82, 246, 361, 222, 353, + 293, 218, 218, 149, 149, 149, 149, 294, 343, 249, + 648, 295, 295, 295, 295, 295, 295, 295, 295, 295, + + 295, 295, 295, 295, 295, 295, 295, 295, 295, 296, + 445, 445, 445, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 293, 149, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 82, 254, 450, 446, 444, 149, 220, 220, 298, 298, + 298, 298, 150, 647, 256, 451, 299, 299, 299, 299, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, + 299, 299, 299, 299, 299, 519, 647, 104, 149, 149, + 149, 149, 300, 149, 149, 149, 149, 149, 149, 149, + + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 335, 426, 426, 426, 426, + 456, 104, 336, 369, 337, 254, 608, 82, 333, 333, + 333, 333, 366, 366, 366, 366, 370, 104, 256, 150, + 449, 449, 449, 449, 335, 530, 384, 530, 338, 338, + 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 344, 644, 82, 643, 454, 104, 368, 455, 82, 398, + 665, 335, 354, 354, 150, 354, 354, 354, 354, 354, + 150, 354, 354, 354, 354, 568, 354, 354, 82, 696, + + 696, 145, 354, 354, 354, 354, 696, 696, 696, 696, + 150, 82, 696, 696, 397, 377, 377, 377, 377, 388, + 388, 388, 388, 150, 82, 354, 354, 354, 397, 397, + 82, 82, 389, 389, 389, 389, 150, 532, 395, 82, + 696, 145, 150, 150, 400, 425, 356, 389, 389, 389, + 389, 150, 411, 354, 354, 126, 242, 242, 242, 243, + 641, 126, 126, 126, 126, 126, 126, 104, 346, 126, + 126, 147, 82, 82, 82, 126, 126, 104, 126, 393, + 389, 389, 389, 389, 150, 150, 150, 104, 82, 82, + 82, 396, 364, 399, 410, 82, 82, 373, 126, 130, + + 150, 150, 150, 640, 193, 485, 82, 150, 150, 486, + 635, 147, 394, 396, 389, 389, 389, 389, 150, 609, + 634, 82, 82, 401, 696, 369, 126, 126, 254, 406, + 406, 406, 406, 150, 150, 696, 393, 696, 696, 622, + 592, 256, 696, 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, + 257, 257, 394, 402, 696, 696, 696, 617, 511, 258, + 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, + 252, 252, 369, 421, 82, 224, 224, 329, 104, 617, + 374, 696, 421, 511, 329, 370, 150, 371, 371, 371, + + 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, + 371, 371, 371, 371, 371, 371, 253, 253, 193, 307, + 104, 82, 336, 372, 82, 414, 414, 414, 414, 336, + 90, 337, 336, 150, 82, 633, 150, 409, 461, 336, + 460, 696, 92, 636, 82, 422, 150, 94, 462, 145, + 99, 336, 271, 104, 422, 101, 150, 445, 445, 445, + 483, 336, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 390, 82, 531, 450, 336, 82, + 632, 391, 469, 337, 82, 450, 502, 150, 336, 82, + 696, 150, 82, 82, 82, 82, 104, 629, 451, 503, + + 446, 650, 472, 390, 520, 520, 520, 392, 392, 392, + 392, 392, 392, 392, 392, 392, 392, 392, 392, 147, + 628, 82, 621, 470, 473, 487, 487, 487, 487, 620, + 390, 354, 354, 150, 354, 354, 354, 354, 354, 355, + 354, 354, 354, 354, 145, 354, 354, 521, 671, 696, + 271, 404, 354, 354, 354, 82, 82, 82, 459, 459, + 459, 459, 696, 468, 468, 468, 468, 150, 150, 150, + 82, 616, 500, 145, 354, 354, 354, 82, 82, 455, + 523, 599, 150, 433, 501, 525, 104, 82, 82, 150, + 150, 111, 433, 456, 82, 405, 82, 82, 478, 150, + + 150, 477, 354, 354, 82, 254, 150, 82, 150, 150, + 363, 363, 479, 615, 147, 542, 150, 104, 256, 150, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 471, + 482, 675, 617, 526, 618, 538, 300, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 369, + 145, 530, 384, 530, 617, 650, 619, 607, 606, 605, + 601, 541, 370, 625, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 601, 600, 626, 582, 659, 597, 617, + + 408, 338, 338, 338, 338, 338, 338, 338, 338, 338, + 338, 338, 338, 438, 438, 510, 438, 438, 438, 438, + 438, 617, 438, 438, 438, 438, 502, 438, 438, 82, + 147, 82, 547, 438, 438, 438, 438, 82, 450, 696, + 476, 150, 149, 150, 511, 149, 149, 149, 149, 150, + 82, 451, 82, 512, 476, 476, 438, 438, 438, 596, + 82, 551, 150, 440, 150, 384, 111, 590, 562, 511, + 535, 82, 150, 536, 589, 552, 82, 440, 440, 534, + 598, 271, 563, 150, 438, 438, 354, 354, 150, 354, + 354, 354, 354, 354, 599, 354, 354, 354, 354, 624, + + 354, 354, 534, 617, 193, 307, 354, 354, 354, 354, + 539, 544, 544, 544, 544, 82, 82, 548, 520, 520, + 520, 145, 82, 659, 617, 617, 617, 150, 150, 354, + 354, 354, 571, 82, 150, 565, 565, 565, 565, 82, + 679, 145, 588, 82, 82, 150, 617, 563, 617, 587, + 587, 150, 576, 570, 185, 150, 150, 354, 354, 354, + 354, 521, 354, 354, 354, 354, 354, 586, 354, 354, + 354, 354, 82, 354, 354, 573, 82, 575, 82, 354, + 354, 354, 354, 656, 150, 193, 485, 585, 150, 574, + 150, 147, 544, 544, 544, 544, 82, 657, 145, 593, + + 617, 584, 354, 354, 354, 145, 145, 593, 150, 145, + 263, 147, 565, 565, 565, 565, 595, 614, 583, 574, + 627, 555, 617, 679, 555, 582, 552, 581, 646, 594, + 354, 354, 392, 392, 392, 392, 392, 392, 392, 392, + 392, 392, 392, 392, 438, 438, 580, 438, 438, 438, + 438, 438, 439, 438, 438, 438, 438, 82, 438, 438, + 145, 579, 384, 384, 475, 438, 438, 438, 526, 150, + 578, 642, 548, 617, 630, 147, 147, 577, 645, 147, + 617, 145, 384, 384, 384, 567, 145, 438, 438, 438, + 639, 639, 655, 263, 476, 617, 631, 668, 679, 613, + + 145, 566, 617, 265, 455, 384, 523, 384, 476, 476, + 564, 673, 639, 639, 384, 438, 438, 354, 354, 384, + 354, 354, 354, 354, 354, 355, 354, 354, 354, 354, + 147, 354, 354, 639, 561, 639, 652, 404, 354, 354, + 354, 560, 639, 559, 558, 557, 556, 639, 555, 139, + 553, 147, 666, 384, 145, 639, 147, 639, 653, 384, + 354, 354, 354, 667, 639, 676, 679, 679, 694, 639, + 147, 679, 679, 679, 679, 679, 550, 680, 681, 672, + 549, 639, 682, 683, 684, 685, 686, 639, 354, 354, + 354, 354, 548, 354, 354, 354, 354, 354, 355, 354, + + 354, 354, 354, 639, 354, 354, 547, 672, 546, 639, + 404, 354, 354, 354, 499, 499, 497, 497, 495, 495, + 493, 493, 491, 491, 147, 489, 489, 384, 537, 679, + 528, 527, 216, 354, 354, 354, 263, 263, 209, 373, + 687, 263, 263, 263, 263, 263, 679, 524, 455, 523, + 448, 111, 518, 679, 679, 679, 679, 688, 679, 517, + 516, 354, 354, 502, 689, 690, 691, 692, 515, 693, + 433, 111, 508, 507, 506, 505, 503, 424, 504, 504, + 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, + 504, 504, 504, 504, 504, 504, 504, 438, 438, 263, + + 438, 438, 438, 438, 438, 499, 438, 438, 438, 438, + 497, 438, 438, 495, 493, 491, 263, 438, 438, 438, + 438, 489, 425, 263, 263, 263, 263, 196, 263, 484, + 480, 268, 384, 464, 463, 86, 210, 458, 455, 373, + 438, 438, 438, 364, 448, 443, 442, 441, 210, 432, + 431, 430, 429, 428, 427, 337, 425, 337, 216, 216, + 210, 209, 209, 209, 316, 316, 314, 314, 438, 438, + 438, 438, 196, 438, 438, 438, 438, 438, 412, 438, + 438, 438, 438, 364, 438, 438, 268, 268, 267, 384, + 438, 438, 438, 438, 267, 353, 376, 344, 343, 373, + + 254, 364, 364, 246, 352, 351, 350, 349, 345, 342, + 341, 340, 339, 438, 438, 438, 327, 327, 326, 325, + 440, 324, 323, 323, 322, 321, 320, 319, 316, 314, + 307, 306, 268, 287, 440, 440, 268, 268, 267, 265, + 263, 438, 438, 82, 502, 262, 237, 210, 261, 235, + 130, 240, 238, 210, 236, 150, 234, 503, 233, 533, + 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, + 533, 533, 533, 533, 533, 533, 533, 533, 438, 438, + 233, 438, 438, 438, 438, 438, 439, 438, 438, 438, + 438, 232, 438, 438, 104, 216, 215, 209, 475, 438, + + 438, 438, 210, 209, 201, 193, 191, 173, 172, 169, + 168, 165, 164, 148, 122, 142, 139, 122, 121, 118, + 117, 438, 438, 438, 114, 113, 104, 86, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 438, + 438, 602, 602, 696, 602, 602, 602, 602, 602, 696, + 602, 602, 602, 602, 696, 602, 602, 696, 696, 696, + 696, 602, 602, 602, 602, 696, 696, 696, 696, 696, + 696, 604, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 602, 602, 602, 696, 696, 696, + + 696, 696, 696, 604, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 602, 602, 602, 602, 696, 602, 602, 602, + 602, 602, 603, 602, 602, 602, 602, 696, 602, 602, + 696, 696, 696, 696, 611, 602, 602, 602, 696, 696, + 696, 696, 696, 696, 612, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 602, 602, 602, + 696, 696, 696, 696, 696, 696, 612, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 602, 602, 602, 602, 696, + + 602, 602, 602, 602, 602, 696, 602, 602, 602, 602, + 696, 602, 602, 696, 696, 696, 696, 602, 602, 602, + 602, 696, 696, 696, 696, 696, 696, 604, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 602, 602, 602, 696, 696, 696, 696, 696, 696, 604, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 602, 602, + 602, 602, 696, 602, 602, 602, 602, 602, 603, 602, + 602, 602, 602, 696, 602, 602, 696, 696, 696, 696, + 611, 602, 602, 602, 696, 696, 696, 696, 696, 696, + + 612, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 602, 602, 602, 696, 696, 696, 696, + 696, 696, 612, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 602, 602, 82, 696, 696, 696, 82, 82, 696, + 696, 82, 82, 82, 82, 82, 82, 82, 82, 83, + 83, 83, 83, 83, 696, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 89, 89, + 696, 696, 696, 89, 89, 89, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + + 103, 103, 103, 103, 103, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, + 129, 129, 129, 129, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 149, 696, 696, 696, 149, 149, 149, + 696, 149, 149, 149, 149, 149, 149, 149, 149, 192, + 192, 192, 192, 192, 696, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 211, 211, 696, + + 696, 696, 696, 696, 696, 696, 696, 211, 696, 696, + 211, 211, 696, 211, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, + + 273, 273, 273, 273, 273, 273, 273, 273, 273, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 313, 313, 696, 313, 313, + 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, + + 313, 313, 313, 313, 315, 315, 696, 315, 315, 315, + 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, + 315, 315, 315, 317, 696, 317, 696, 696, 696, 317, + 317, 317, 696, 696, 317, 355, 355, 696, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 359, 359, 359, 359, 359, 359, 359, 359, + + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 362, 362, 362, 367, 696, 696, 696, 367, 696, 367, + 367, 367, 367, 696, 367, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 149, 696, 696, 696, 149, 149, 149, + 696, 149, 149, 149, 149, 149, 149, 149, 149, 273, + + 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 403, 403, 696, + 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, + 403, 403, 403, 403, 403, 403, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 413, 413, 413, 413, 696, + 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, + 413, 413, 413, 413, 192, 192, 192, 192, 192, 192, + + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 313, 313, 696, 313, 313, 313, 313, + 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, + 313, 313, 315, 315, 696, 315, 315, 315, 315, 315, + 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, + 315, 416, 696, 416, 416, 696, 696, 416, 416, 416, + 696, 696, 416, 439, 439, 696, 439, 439, 439, 439, + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, + 439, 439, 354, 354, 696, 354, 354, 354, 354, 354, + 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, + + 354, 355, 355, 696, 355, 355, 355, 355, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, + 359, 359, 359, 359, 359, 359, 359, 359, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 447, 447, 447, + 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 447, 447, 447, 447, 447, 447, 452, 452, 696, 696, + + 452, 452, 696, 452, 452, 452, 452, 452, 452, 452, + 452, 452, 453, 696, 696, 696, 696, 696, 453, 453, + 453, 453, 696, 453, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, + 383, 383, 383, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 474, 474, 696, 474, 474, 474, 474, 474, + 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, + 474, 403, 403, 696, 403, 403, 403, 403, 403, 403, + 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, + + 481, 481, 696, 696, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 413, 413, 413, 413, + 696, 413, 413, 413, 413, 413, 413, 413, 413, 413, + 413, 413, 413, 413, 413, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 488, 488, 696, 488, 488, 488, + 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, + 488, 488, 488, 490, 490, 696, 490, 490, 490, 490, + 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, + 490, 490, 492, 492, 696, 492, 492, 492, 492, 492, + + 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, + 492, 494, 494, 696, 494, 494, 494, 494, 494, 494, + 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, + 496, 496, 696, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 498, + 498, 696, 498, 498, 498, 498, 498, 498, 498, 498, + 498, 498, 498, 498, 498, 498, 498, 498, 438, 438, + 696, 438, 438, 438, 438, 438, 438, 438, 438, 438, + 438, 438, 438, 438, 438, 438, 438, 439, 439, 696, + 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, + + 439, 439, 439, 439, 439, 439, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, + 357, 357, 357, 357, 357, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 447, 447, 447, 447, 447, 447, + 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 447, 447, 447, 522, 696, 696, 696, 696, 696, 522, + 522, 522, 522, 522, 522, 522, 522, 522, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 103, 103, 103, + + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 103, 103, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 545, 696, 696, 696, 696, + 696, 545, 545, 545, 545, 554, 554, 696, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, + 554, 554, 554, 554, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 603, 603, 696, 603, 603, 603, 603, + 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, + + 603, 603, 610, 610, 696, 610, 610, 610, 610, 610, + 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, + 610, 602, 602, 696, 602, 602, 602, 602, 602, 602, + 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, + 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, + 638, 638, 638, 638, 638, 638, 638, 638, 638, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, + 660, 660, 660, 660, 660, 660, 660, 660, 663, 663, + 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, + 663, 663, 663, 663, 663, 663, 663, 678, 678, 678, + + 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, + 678, 678, 678, 678, 678, 678, 3, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696 + } ; + + static yyconst short int yy_chk[4591] = + { 0, + 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, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 5, 6, 6, 6, + 6, 8, 10, 10, 11, 19, 22, 46, 8, 8, + 8, 8, 16, 156, 11, 13, 11, 11, 5, 46, + 58, 11, 12, 12, 12, 13, 156, 13, 19, 12, + 22, 694, 13, 86, 12, 12, 12, 12, 12, 12, + 12, 12, 50, 50, 58, 12, 12, 12, 12, 12, + + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 25, 28, 16, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 15, 52, 15, 86, 15, 15, 15, 15, + 15, 15, 40, 674, 15, 29, 153, 29, 29, 90, + 28, 90, 29, 670, 25, 25, 90, 35, 35, 28, + 153, 25, 55, 15, 35, 35, 35, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 31, + 31, 532, 31, 31, 31, 55, 99, 52, 99, 40, + + 15, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 63, 84, 84, + 144, 26, 26, 26, 26, 30, 30, 30, 30, 30, + 32, 32, 34, 34, 32, 32, 32, 33, 34, 34, + 34, 43, 30, 532, 26, 26, 26, 33, 33, 36, + 36, 49, 33, 33, 33, 37, 37, 36, 36, 36, + 33, 49, 63, 49, 37, 37, 37, 676, 49, 91, + 91, 63, 26, 26, 27, 38, 38, 27, 27, 27, + 27, 27, 61, 47, 669, 38, 38, 217, 47, 38, + 144, 43, 43, 47, 663, 47, 47, 217, 43, 64, + + 47, 64, 64, 27, 217, 44, 64, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 44, + 44, 44, 44, 65, 65, 65, 65, 65, 69, 69, + 27, 74, 61, 61, 69, 69, 69, 676, 149, 61, + 65, 66, 66, 74, 66, 66, 66, 67, 67, 68, + 149, 67, 67, 67, 70, 70, 76, 158, 158, 68, + 68, 70, 70, 70, 68, 68, 68, 662, 76, 74, + 72, 72, 68, 192, 192, 44, 48, 48, 48, 72, + 72, 72, 660, 48, 81, 81, 81, 81, 48, 48, + 48, 48, 48, 48, 48, 48, 193, 193, 76, 48, + + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 95, 95, + 95, 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, 51, 194, 194, 51, + 128, 51, 77, 51, 51, 51, 51, 51, 51, 71, + 71, 51, 73, 73, 77, 196, 196, 71, 71, 71, + 75, 157, 73, 73, 258, 75, 73, 98, 98, 98, + 51, 128, 75, 157, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 110, 110, 110, 110, + + 271, 387, 112, 112, 112, 112, 658, 51, 62, 77, + 78, 166, 271, 62, 79, 78, 62, 62, 62, 62, + 62, 258, 75, 166, 323, 79, 85, 78, 79, 79, + 79, 79, 112, 85, 85, 85, 85, 85, 113, 113, + 113, 113, 62, 166, 273, 273, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 100, 387, + 78, 78, 96, 96, 96, 171, 176, 78, 100, 62, + 100, 111, 113, 111, 96, 100, 96, 171, 176, 111, + 656, 96, 111, 623, 79, 89, 323, 89, 89, 89, + 89, 89, 89, 111, 171, 111, 123, 123, 123, 123, + + 167, 234, 111, 136, 136, 136, 136, 111, 118, 118, + 118, 118, 167, 650, 89, 234, 234, 176, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 121, 121, 121, 121, 123, 241, 124, 124, 124, 124, + 623, 89, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 108, 151, 649, 118, 167, 233, + 325, 108, 325, 151, 151, 243, 241, 151, 165, 137, + 137, 137, 137, 138, 138, 138, 138, 267, 121, 124, + 165, 345, 233, 108, 308, 308, 267, 108, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 137, + + 162, 162, 162, 162, 233, 243, 165, 138, 309, 309, + 108, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 146, 152, 568, + 568, 127, 127, 127, 127, 329, 152, 345, 154, 185, + 152, 146, 146, 146, 146, 146, 154, 190, 270, 329, + 154, 185, 168, 270, 127, 127, 127, 648, 190, 163, + 163, 163, 163, 644, 168, 270, 164, 164, 164, 164, + 169, 169, 169, 169, 172, 172, 172, 172, 174, 174, + 174, 174, 127, 127, 129, 129, 129, 129, 129, 163, + 129, 129, 129, 129, 129, 129, 185, 146, 129, 129, + + 164, 173, 186, 189, 129, 129, 386, 129, 168, 175, + 175, 175, 175, 173, 186, 189, 174, 190, 346, 169, + 272, 182, 172, 187, 368, 272, 188, 129, 129, 182, + 182, 182, 182, 182, 183, 187, 269, 272, 188, 173, + 346, 269, 183, 183, 183, 183, 183, 609, 269, 189, + 386, 347, 175, 357, 186, 129, 129, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 368, 183, 347, 132, 187, 641, 132, 132, 132, + 132, 132, 188, 132, 357, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + + 132, 132, 132, 132, 384, 609, 384, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 135, 218, 218, 218, 218, 484, + 265, 135, 135, 135, 135, 265, 265, 135, 484, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 219, 219, + 219, 219, 198, 198, 432, 135, 155, 155, 155, 198, + 198, 198, 198, 155, 220, 220, 220, 220, 155, 155, + + 640, 155, 155, 155, 155, 155, 435, 432, 327, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 435, 637, + 637, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 159, 304, 275, 202, + 222, 223, 223, 223, 223, 184, 202, 222, 159, 304, + 327, 197, 197, 184, 184, 184, 184, 184, 197, 197, + 197, 197, 197, 224, 224, 224, 224, 372, 202, 222, + 252, 252, 252, 252, 159, 159, 159, 159, 159, 159, + + 159, 159, 159, 159, 159, 159, 160, 184, 275, 242, + 242, 242, 242, 160, 304, 202, 222, 275, 317, 317, + 317, 317, 203, 358, 388, 203, 203, 203, 203, 203, + 239, 239, 239, 239, 372, 160, 388, 359, 388, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 203, 242, 461, 358, 461, 230, 230, 230, 230, + 461, 635, 160, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 178, 178, 359, 203, 239, + 178, 707, 707, 178, 178, 178, 178, 178, 230, 178, + 634, 178, 178, 178, 178, 178, 178, 178, 178, 178, + + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 360, 360, 360, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 181, 181, 449, 360, 444, 181, 708, 708, 181, 181, + 181, 181, 181, 633, 181, 449, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 444, 632, 591, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 225, 338, 338, 338, 338, + 454, 651, 225, 366, 225, 253, 591, 286, 231, 231, + 231, 231, 253, 253, 253, 253, 366, 531, 253, 286, + 363, 363, 363, 363, 225, 465, 465, 465, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 231, 629, 285, 628, 366, 467, 253, 454, 283, 286, + 651, 225, 240, 240, 285, 240, 240, 240, 240, 240, + 283, 240, 240, 240, 240, 531, 240, 240, 288, 254, + + 450, 264, 240, 240, 240, 240, 254, 254, 254, 254, + 288, 276, 254, 450, 285, 264, 264, 264, 264, 276, + 276, 276, 276, 276, 279, 240, 240, 240, 285, 285, + 398, 389, 279, 279, 279, 279, 279, 467, 283, 281, + 254, 305, 398, 389, 288, 389, 240, 281, 281, 281, + 281, 281, 305, 240, 240, 244, 244, 244, 244, 244, + 626, 244, 244, 244, 244, 244, 244, 592, 284, 244, + 244, 264, 282, 284, 289, 244, 244, 569, 244, 281, + 282, 282, 282, 282, 282, 284, 289, 608, 287, 303, + 295, 284, 295, 287, 303, 299, 301, 299, 244, 244, + + 287, 303, 295, 625, 414, 414, 290, 299, 301, 414, + 621, 305, 282, 284, 290, 290, 290, 290, 290, 592, + 620, 297, 302, 289, 369, 370, 244, 244, 245, 297, + 297, 297, 297, 297, 302, 336, 301, 369, 370, 608, + 569, 245, 336, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 302, 290, 336, 369, 370, 601, 584, 245, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 255, 328, 300, 709, 709, 328, 622, 601, + 300, 336, 579, 584, 328, 255, 300, 255, 255, 255, + + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 712, 712, 312, 312, + 466, 409, 318, 255, 277, 312, 312, 312, 312, 318, + 379, 318, 332, 409, 393, 619, 277, 300, 380, 332, + 379, 332, 379, 622, 385, 328, 393, 379, 380, 411, + 380, 318, 385, 636, 579, 380, 385, 445, 445, 445, + 411, 332, 277, 277, 277, 277, 277, 277, 277, 277, + 277, 277, 277, 277, 280, 394, 466, 451, 318, 396, + 618, 280, 393, 280, 365, 365, 487, 394, 332, 365, + 451, 396, 365, 365, 365, 365, 665, 616, 365, 487, + + 445, 636, 396, 280, 448, 448, 448, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 411, + 615, 399, 607, 394, 396, 416, 416, 416, 416, 606, + 280, 291, 291, 399, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 377, 291, 291, 448, 665, 502, + 399, 291, 291, 291, 291, 392, 401, 400, 377, 377, + 377, 377, 502, 392, 392, 392, 392, 392, 401, 400, + 402, 600, 424, 459, 291, 291, 291, 407, 481, 407, + 481, 598, 402, 395, 424, 459, 671, 408, 395, 407, + 481, 469, 471, 408, 477, 291, 469, 471, 401, 408, + + 395, 400, 291, 291, 292, 292, 477, 482, 469, 471, + 729, 729, 402, 597, 377, 596, 292, 675, 292, 482, + 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, + 292, 292, 292, 292, 292, 292, 292, 292, 292, 395, + 408, 671, 602, 459, 604, 477, 292, 293, 293, 293, + 293, 293, 293, 293, 293, 293, 293, 293, 293, 298, + 483, 530, 530, 530, 602, 675, 604, 590, 589, 588, + 586, 483, 298, 612, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 585, 583, 612, 581, 645, 580, 645, + + 298, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 348, 348, 433, 348, 348, 348, 348, + 348, 645, 348, 348, 348, 348, 503, 348, 348, 410, + 483, 473, 578, 348, 348, 348, 348, 406, 406, 503, + 476, 410, 406, 473, 433, 406, 406, 406, 406, 406, + 472, 406, 470, 433, 476, 476, 348, 348, 348, 577, + 478, 507, 472, 348, 470, 572, 479, 567, 517, 433, + 472, 479, 478, 473, 566, 507, 536, 348, 348, 470, + 582, 410, 517, 479, 348, 348, 355, 355, 536, 355, + 355, 355, 355, 355, 582, 355, 355, 355, 355, 611, + + 355, 355, 470, 646, 486, 486, 355, 355, 355, 355, + 478, 486, 486, 486, 486, 533, 534, 533, 520, 520, + 520, 525, 535, 646, 659, 646, 611, 533, 534, 355, + 355, 355, 536, 538, 535, 525, 525, 525, 525, 539, + 677, 541, 564, 571, 574, 538, 659, 562, 611, 561, + 560, 539, 541, 535, 534, 571, 574, 355, 355, 356, + 356, 520, 356, 356, 356, 356, 356, 559, 356, 356, + 356, 356, 575, 356, 356, 538, 570, 539, 573, 356, + 356, 356, 356, 643, 575, 544, 544, 558, 570, 538, + 573, 525, 544, 544, 544, 544, 613, 643, 565, 571, + + 631, 557, 356, 356, 356, 576, 595, 570, 613, 614, + 677, 541, 565, 565, 565, 565, 576, 595, 556, 573, + 614, 555, 631, 678, 554, 553, 551, 550, 631, 575, + 356, 356, 390, 390, 390, 390, 390, 390, 390, 390, + 390, 390, 390, 390, 397, 397, 549, 397, 397, 397, + 397, 397, 397, 397, 397, 397, 397, 594, 397, 397, + 627, 547, 624, 638, 397, 397, 397, 397, 565, 594, + 546, 627, 545, 630, 617, 576, 595, 543, 630, 614, + 617, 642, 540, 537, 529, 528, 655, 397, 397, 397, + 624, 638, 642, 678, 397, 630, 617, 655, 693, 594, + + 668, 527, 617, 526, 524, 672, 522, 653, 397, 397, + 518, 668, 624, 638, 639, 397, 397, 403, 403, 652, + 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, + 627, 403, 403, 672, 516, 653, 639, 403, 403, 403, + 403, 515, 639, 514, 513, 512, 511, 652, 510, 509, + 508, 642, 652, 666, 673, 672, 655, 653, 639, 667, + 403, 403, 403, 653, 639, 673, 679, 680, 693, 652, + 668, 681, 682, 683, 684, 685, 506, 679, 680, 666, + 505, 666, 681, 682, 683, 684, 685, 667, 403, 403, + 405, 405, 504, 405, 405, 405, 405, 405, 405, 405, + + 405, 405, 405, 666, 405, 405, 501, 667, 500, 667, + 405, 405, 405, 405, 499, 498, 497, 496, 495, 494, + 493, 492, 491, 490, 673, 489, 488, 480, 475, 686, + 464, 463, 462, 405, 405, 405, 679, 680, 460, 458, + 686, 681, 682, 683, 684, 685, 687, 456, 453, 452, + 447, 443, 442, 688, 689, 690, 691, 687, 692, 441, + 437, 405, 405, 426, 688, 689, 690, 691, 436, 692, + 434, 431, 430, 429, 428, 427, 426, 423, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, + 426, 426, 426, 426, 426, 426, 426, 439, 439, 686, + + 439, 439, 439, 439, 439, 422, 439, 439, 439, 439, + 421, 439, 439, 420, 419, 418, 687, 439, 439, 439, + 439, 417, 415, 688, 689, 690, 691, 413, 692, 412, + 404, 391, 383, 382, 381, 378, 376, 374, 371, 367, + 439, 439, 439, 362, 361, 353, 352, 351, 350, 344, + 343, 342, 341, 340, 339, 334, 333, 331, 326, 324, + 322, 321, 320, 319, 316, 315, 314, 313, 439, 439, + 440, 440, 310, 440, 440, 440, 440, 440, 306, 440, + 440, 440, 440, 296, 440, 440, 294, 278, 274, 268, + 440, 440, 440, 440, 266, 262, 261, 260, 259, 257, + + 256, 251, 250, 249, 238, 237, 236, 235, 232, 229, + 228, 227, 226, 440, 440, 440, 216, 215, 214, 213, + 440, 212, 209, 208, 207, 206, 205, 204, 200, 199, + 195, 191, 179, 170, 440, 440, 161, 150, 148, 147, + 145, 440, 440, 468, 468, 143, 142, 141, 140, 139, + 126, 125, 122, 120, 119, 468, 117, 468, 116, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 474, 474, + 115, 474, 474, 474, 474, 474, 474, 474, 474, 474, + 474, 114, 474, 474, 103, 101, 97, 94, 474, 474, + + 474, 474, 93, 92, 88, 83, 80, 60, 59, 57, + 56, 54, 53, 45, 42, 41, 39, 24, 23, 21, + 20, 474, 474, 474, 18, 17, 14, 9, 3, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 474, + 474, 587, 587, 0, 587, 587, 587, 587, 587, 0, + 587, 587, 587, 587, 0, 587, 587, 0, 0, 0, + 0, 587, 587, 587, 587, 0, 0, 0, 0, 0, + 0, 587, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 587, 587, 587, 0, 0, 0, + + 0, 0, 0, 587, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 587, 587, 593, 593, 0, 593, 593, 593, + 593, 593, 593, 593, 593, 593, 593, 0, 593, 593, + 0, 0, 0, 0, 593, 593, 593, 593, 0, 0, + 0, 0, 0, 0, 593, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 593, 593, 593, + 0, 0, 0, 0, 0, 0, 593, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 593, 593, 603, 603, 0, + + 603, 603, 603, 603, 603, 0, 603, 603, 603, 603, + 0, 603, 603, 0, 0, 0, 0, 603, 603, 603, + 603, 0, 0, 0, 0, 0, 0, 603, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 603, 603, 603, 0, 0, 0, 0, 0, 0, 603, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 603, 603, + 610, 610, 0, 610, 610, 610, 610, 610, 610, 610, + 610, 610, 610, 0, 610, 610, 0, 0, 0, 0, + 610, 610, 610, 610, 0, 0, 0, 0, 0, 0, + + 610, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 610, 610, 610, 0, 0, 0, 0, + 0, 0, 610, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 610, 610, 697, 0, 0, 0, 697, 697, 0, + 0, 697, 697, 697, 697, 697, 697, 697, 697, 698, + 698, 698, 698, 698, 0, 698, 698, 698, 698, 698, + 698, 698, 698, 698, 698, 698, 698, 698, 699, 699, + 0, 0, 0, 699, 699, 699, 700, 700, 700, 700, + 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, + + 700, 700, 700, 700, 700, 701, 701, 701, 701, 701, + 701, 701, 701, 701, 701, 701, 701, 701, 701, 701, + 701, 701, 701, 701, 702, 702, 702, 702, 702, 702, + 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + 702, 702, 702, 703, 0, 0, 0, 703, 703, 703, + 0, 703, 703, 703, 703, 703, 703, 703, 703, 704, + 704, 704, 704, 704, 0, 704, 704, 704, 704, 704, + 704, 704, 704, 704, 704, 704, 704, 704, 705, 705, + 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, + 705, 705, 705, 705, 705, 705, 705, 706, 706, 0, + + 0, 0, 0, 0, 0, 0, 0, 706, 0, 0, + 706, 706, 0, 706, 710, 710, 710, 710, 710, 710, + 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, + 710, 710, 710, 711, 711, 711, 711, 711, 711, 711, + 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, + 711, 711, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 714, 714, 714, 714, 714, 714, 714, 714, 714, + 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, + 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, + + 715, 715, 715, 715, 715, 715, 715, 715, 715, 716, + 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, + 716, 716, 716, 716, 716, 716, 716, 716, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 719, 719, 719, 719, + 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, + 719, 719, 719, 719, 719, 720, 720, 0, 720, 720, + 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, + + 720, 720, 720, 720, 721, 721, 0, 721, 721, 721, + 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, + 721, 721, 721, 722, 0, 722, 0, 0, 0, 722, + 722, 722, 0, 0, 722, 723, 723, 0, 723, 723, + 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, + 723, 723, 723, 723, 724, 724, 724, 724, 724, 724, + 724, 724, 724, 724, 724, 724, 724, 724, 724, 724, + 724, 724, 724, 725, 725, 725, 725, 725, 725, 725, + 725, 725, 725, 725, 725, 725, 725, 725, 725, 725, + 725, 725, 726, 726, 726, 726, 726, 726, 726, 726, + + 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, + 726, 727, 727, 727, 727, 727, 727, 727, 727, 727, + 727, 727, 727, 727, 727, 727, 727, 727, 727, 727, + 728, 728, 728, 730, 0, 0, 0, 730, 0, 730, + 730, 730, 730, 0, 730, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 732, 732, 732, 732, 732, 732, + 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, + 732, 732, 732, 733, 0, 0, 0, 733, 733, 733, + 0, 733, 733, 733, 733, 733, 733, 733, 733, 734, + + 734, 734, 734, 734, 734, 734, 734, 734, 734, 734, + 734, 734, 734, 734, 734, 734, 734, 734, 735, 735, + 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, + 735, 735, 735, 735, 735, 735, 735, 736, 736, 0, + 736, 736, 736, 736, 736, 736, 736, 736, 736, 736, + 736, 736, 736, 736, 736, 736, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, + 737, 737, 737, 737, 737, 738, 738, 738, 738, 0, + 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 739, 739, 739, 739, 739, 739, + + 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, + 739, 739, 739, 740, 740, 0, 740, 740, 740, 740, + 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, + 740, 740, 741, 741, 0, 741, 741, 741, 741, 741, + 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, + 741, 742, 0, 742, 742, 0, 0, 742, 742, 742, + 0, 0, 742, 743, 743, 0, 743, 743, 743, 743, + 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, + 743, 743, 744, 744, 0, 744, 744, 744, 744, 744, + 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, + + 744, 745, 745, 0, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, + 746, 746, 746, 746, 746, 746, 746, 746, 746, 747, + 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, + 747, 747, 747, 747, 747, 747, 747, 747, 748, 748, + 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, + 748, 748, 748, 748, 748, 748, 748, 749, 749, 749, + 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, + 749, 749, 749, 749, 749, 749, 750, 750, 0, 0, + + 750, 750, 0, 750, 750, 750, 750, 750, 750, 750, + 750, 750, 751, 0, 0, 0, 0, 0, 751, 751, + 751, 751, 0, 751, 752, 752, 752, 752, 752, 752, + 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, + 752, 752, 752, 753, 753, 753, 753, 753, 753, 753, + 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, + 753, 753, 754, 754, 0, 754, 754, 754, 754, 754, + 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, + 754, 755, 755, 0, 755, 755, 755, 755, 755, 755, + 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + + 756, 756, 0, 0, 756, 756, 756, 756, 756, 756, + 756, 756, 756, 756, 756, 756, 757, 757, 757, 757, + 0, 757, 757, 757, 757, 757, 757, 757, 757, 757, + 757, 757, 757, 757, 757, 758, 758, 758, 758, 758, + 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, + 758, 758, 758, 758, 759, 759, 0, 759, 759, 759, + 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, + 759, 759, 759, 760, 760, 0, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 761, 761, 0, 761, 761, 761, 761, 761, + + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 762, 762, 0, 762, 762, 762, 762, 762, 762, + 762, 762, 762, 762, 762, 762, 762, 762, 762, 762, + 763, 763, 0, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, 763, 764, + 764, 0, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 765, 765, + 0, 765, 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 766, 766, 0, + 766, 766, 766, 766, 766, 766, 766, 766, 766, 766, + + 766, 766, 766, 766, 766, 766, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 769, 769, 769, 769, 769, 769, + 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, + 769, 769, 769, 770, 0, 0, 0, 0, 0, 770, + 770, 770, 770, 770, 770, 770, 770, 770, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 772, 772, 772, + + 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 774, 0, 0, 0, 0, + 0, 774, 774, 774, 774, 775, 775, 0, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 777, 777, 0, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + + 777, 777, 778, 778, 0, 778, 778, 778, 778, 778, + 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, + 778, 779, 779, 0, 779, 779, 779, 779, 779, 779, + 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, + 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, + 780, 780, 780, 780, 780, 780, 780, 780, 780, 781, + 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, + 781, 781, 781, 781, 781, 781, 781, 781, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 783, 783, 783, + + 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, + 696, 696, 696, 696, 696, 696, 696, 696, 696, 696 + } ; + + static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; + static char *yy_full_match; + static int yy_lp; + static int yy_looking_for_trail_begin = 0; + static int yy_full_lp; + static int *yy_full_state; + #define YY_TRAILING_MASK 0x2000 + #define YY_TRAILING_HEAD_MASK 0x4000 + #define REJECT \ + { \ + *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ + yy_cp = yy_full_match; /* restore poss. backed-over text */ \ + yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ + yy_state_ptr = yy_full_state; /* restore orig. state */ \ + yy_current_state = *yy_state_ptr; /* restore curr. state */ \ + ++yy_lp; \ + goto find_rule; \ + } + #define yymore() yymore_used_but_not_detected + #define YY_MORE_ADJ 0 + #define YY_RESTORE_YY_MORE_OFFSET + char *yytext; + #define INITIAL 0 + /* + * parser.l -- lex parser of algebraic chess moves for XBoard + * $Id: parser.l,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + + /* This parser handles all forms of promotion. + * The parser resolves ambiguous moves by searching and check-testing. + * It also parses comments of the form [anything] or (anything). + * + * [HGM] Parser extensively modified for bigger boards, Shogi-like syntax, + * and unknow pieces. All pieces are now mandatory upper case, but can be + * any letter A-Z. Files must be lower case (as before), but can run upto 'l'. + * Ranks can be 0-9. The parser returns 0 for off-board files and ranks. + * For an unknown piece (as mover or promotion piece) it returns + * IllegalMove, like it does when the piece doesn't match. + * Promotions can now also be appended Shogi-style, a bare '=' or '+', + * and this is then returned as promotion character. The piece indicator + * can be prefixed by a '+' to indicate it is a promoted piece. + */ + + #include "config.h" + + #define NO_CONSTRAINT -1 + #undef YYLMAX + #define YYLMAX 4096 + #define UNPUT_BUF_SIZE YYLMAX + + #ifdef FLEX_SCANNER + /* yytext is probably a char*, but could be a char[]. yy_text is set + in YY_DECL below, because if yytext is a char*, its value is not + constant. */ + char *yy_text; + #else /*!FLEX_SCANNER*/ + /* yytext is definitely a char[], so yy_text can be set here, statically. */ + char *yy_text = (char *) yytext; + #endif + + #ifdef FLEX_SCANNER + /* This is flex */ + #undef YY_INPUT + #define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size) + #undef YY_DECL + #define YY_DECL \ + int _yylex YY_PROTO((void)); \ + int yylex YY_PROTO((void)) \ + { \ + int result = _yylex(); \ + yy_text = (char *) yytext; \ + return(result); \ + } \ + int _yylex YY_PROTO((void)) + #else + /* This is lex */ + #undef input + #undef output + #undef unput + #endif + + /* The includes must be here, below the #undef input */ + + #include + + #if STDC_HEADERS + # include + # include + #else /* not STDC_HEADERS */ + # if HAVE_STRING_H + # include + # else /* not HAVE_STRING_H */ + # include + # endif /* not HAVE_STRING_H */ + #endif /* not STDC_HEADERS */ + + #if HAVE_UNISTD_H + # include + #endif + + #if defined(_amigados) + # include + # if HAVE_FCNTL_H + # include /* isatty() prototype */ + # endif /* HAVE_FCNTL_H */ + #endif /* defined(_amigados) */ + + #include "common.h" + #include "backend.h" + #include "frontend.h" + #include "parser.h" + #include "moves.h" + + extern int PosFlags P((int)); + + extern Board boards[MAX_MOVES]; + int yyboardindex; + int yyskipmoves = FALSE; + char currentMoveString[YYLMAX]; + #ifndef FLEX_SCANNER + char unputBuffer[UNPUT_BUF_SIZE]; + int unputCount = 0; + #endif + + #ifdef FLEX_SCANNER + void my_yy_input P((char *buf, int *result, int max_size)); + #else /*!FLEX_SCANNER*/ + static int input P((void)); + static void output P((int ch)); + static void unput P((int ch)); + int yylook P((void)); + int yyback P((int *, int)); + #endif + #undef yywrap + int yywrap P((void)); + extern void CopyBoard P((Board to, Board from)); + + + /* Macros after this point can all be overridden by user definitions in + * section 1. + */ + + #ifndef YY_SKIP_YYWRAP + #ifdef __cplusplus + extern "C" int yywrap YY_PROTO(( void )); + #else + extern int yywrap YY_PROTO(( void )); + #endif + #endif + + #ifndef YY_NO_UNPUT + static void yyunput YY_PROTO(( int c, char *buf_ptr )); + #endif + + #ifndef yytext_ptr + static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); + #endif + + #ifdef YY_NEED_STRLEN + static int yy_flex_strlen YY_PROTO(( yyconst char * )); + #endif + + #ifndef YY_NO_INPUT + #ifdef __cplusplus + static int yyinput YY_PROTO(( void )); + #else + static int input YY_PROTO(( void )); + #endif + #endif + + #if YY_STACK_USED + static int yy_start_stack_ptr = 0; + static int yy_start_stack_depth = 0; + static int *yy_start_stack = 0; + #ifndef YY_NO_PUSH_STATE + static void yy_push_state YY_PROTO(( int new_state )); + #endif + #ifndef YY_NO_POP_STATE + static void yy_pop_state YY_PROTO(( void )); + #endif + #ifndef YY_NO_TOP_STATE + static int yy_top_state YY_PROTO(( void )); + #endif + + #else + #define YY_NO_PUSH_STATE 1 + #define YY_NO_POP_STATE 1 + #define YY_NO_TOP_STATE 1 + #endif + + #ifdef YY_MALLOC_DECL + YY_MALLOC_DECL + #else + #if __STDC__ + #ifndef __cplusplus + #include + #endif + #else + /* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ + #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 (void) 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) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + 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 + + /* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ + #ifndef YY_DECL + #define YY_DECL int yylex YY_PROTO(( void )) + #endif + + /* 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->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + + YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + + + + if ( yy_init ) + { + yy_init = 0; + + #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 ) + yy_current_buffer = + 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_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 697 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 4517 ); + + yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + yy_looking_for_trail_begin ) + { + if ( yy_act == yy_looking_for_trail_begin ) + { + yy_looking_for_trail_begin = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; + yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; + } + else + { + yy_full_match = yy_cp; + yy_full_state = yy_state_ptr; + yy_full_lp = yy_lp; + break; + } + ++yy_lp; + goto find_rule; + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = 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 1: + YY_RULE_SETUP + { + /* + * Fully-qualified algebraic move, possibly with promotion + */ + int skip1 = 0, skip2 = 0, skip3 = 0, promoted = 0; + ChessSquare piece; + ChessMove result; + char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (yytext[0] == '+') skip1 = skip3 = promoted = 1; /* [HGM] Shogi promoted */ + + /* remove the / */ + if (yytext[1+skip1] == '/') skip1++; + + /* remove the [xX:-] */ + if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') || + (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1; + + currentMoveString[0] = yytext[1+skip1]; + currentMoveString[1] = yytext[2+skip1]; + currentMoveString[2] = yytext[3+skip1+skip2]; + currentMoveString[3] = yytext[4+skip1+skip2]; + currentMoveString[4] = NULLCHAR; + + if (appData.debugMode) { + fprintf(debugFP, "Parser Qa1b2: yyleng=%d\n", + yyleng); + } + + if (yyleng-skip1-skip2 > 5) { char c; + if (yytext[yyleng-1] == ')') { + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; /* [HGM] promotion to invalid piece */ + } + + if (appData.debugMode) { + fprintf(debugFP, "parser: %s\n", currentMoveString); + } + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[1] - ONE >= BOARD_HEIGHT || + currentMoveString[1] - ONE < 0 || + currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + piece = boards[yyboardindex] + [currentMoveString[1] - ONE][currentMoveString[0] - AAA]; + if(promoted) piece = (ChessSquare) (DEMOTED piece); + c = PieceToChar(piece); + if(c == '~') c = PieceToChar((ChessSquare) (DEMOTED piece)); + if (ToLower(yytext[skip3]) != ToLower(c)) + return (int) IllegalMove; + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionKnight || result == BlackPromotionKnight || + result == WhitePromotionQueen || result == BlackPromotionQueen)) { + currentMoveString[4] = PieceToChar(BlackQueen); + currentMoveString[5] = NULLCHAR; + } + + return (int) result; + } + YY_BREAK + case 2: + YY_RULE_SETUP + { + /* + * Simple algebraic move, possibly with promotion + * [HGM] Engine moves are received in this format, with lower-case promoChar! + */ + int skip = 0; + ChessMove result; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the [xX:-] */ + if ((yytext[2] == 'x') || (yytext[2] == 'X') || + (yytext[2] == '-') || (yytext[2] == ':')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[1] = yytext[1]; + currentMoveString[2] = yytext[2+skip]; + currentMoveString[3] = yytext[3+skip]; + currentMoveString[4] = NULLCHAR; + + if (yyleng-skip > 4) { char c; + if (yytext[yyleng-1] == ')') { + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; + } + + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[1] - ONE >= BOARD_HEIGHT || + currentMoveString[1] - ONE < 0 || + currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionKnight || result == BlackPromotionKnight || + result == WhitePromotionQueen || result == BlackPromotionQueen)) { + if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) + currentMoveString[4] = PieceToChar(BlackFerz); - else if(gameInfo.variant == VariantGreat) - currentMoveString[4] = PieceToChar(BlackMan); + else + currentMoveString[4] = PieceToChar(BlackQueen); + currentMoveString[5] = NULLCHAR; + } + + return (int) result; + } + YY_BREAK + case 3: + YY_RULE_SETUP + { + /* + * Pawn move, possibly with promotion + */ + DisambiguateClosure cl; + int skip = 0; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the =() */ + if (yytext[2] == '=' && yytext[3] != NULLCHAR) skip++; + if (yytext[2+skip] == '(') skip++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - AAA; + cl.rtIn = yytext[1] - ONE; + cl.ftIn = yytext[0] - AAA; + c = cl.promoCharIn = yytext[2+skip]; + + /* [HGM] do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ffIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) + return IllegalMove; + + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + YY_BREAK + case 4: + YY_RULE_SETUP + { + /* + * Pawn capture, possibly with promotion, possibly ambiguous + */ + DisambiguateClosure cl; + int skip1 = 0, skip2 = 0; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] and =() */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1; + if (yytext[2+skip1] == '=' && yytext[3+skip1] != NULLCHAR) skip2++; + if (yytext[2+skip1+skip2] == '(') skip2++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - AAA; + cl.rtIn = -1; + cl.ftIn = yytext[1+skip1] - AAA; + c = cl.promoCharIn = yytext[2+skip1+skip2]; + + /* [HGM] do not allow values beyond board size */ + if(cl.ffIn >= BOARD_RGHT || + cl.ffIn < BOARD_LEFT || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) + return IllegalMove; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + YY_BREAK + case 5: + YY_RULE_SETUP + { + /* + * unambiguously abbreviated Pawn capture, possibly with promotion + */ + int skip = 0; + ChessMove result; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[2] = yytext[1+skip]; + currentMoveString[3] = yytext[2+skip]; + + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + if (gameInfo.variant == VariantXiangqi && /* [HGM] In Xiangqi rank stays same */ + currentMoveString[0] != currentMoveString[2] ) { ++ if (yytext[2+skip] == ONE) return (int) ImpossibleMove; + currentMoveString[1] = yytext[2+skip]; + } else + if (WhiteOnMove(yyboardindex)) { + if (yytext[2+skip] == ONE) return (int) ImpossibleMove; + currentMoveString[1] = yytext[2+skip] - 1; + } else { + currentMoveString[1] = currentMoveString[3] + 1; + if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove; + } + if (yyleng-skip > 3) { + if (yytext[yyleng-1] == ')') + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + else + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; + } else { + currentMoveString[4] = NULLCHAR; + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionQueen || result == BlackPromotionQueen || + result == WhitePromotionKnight || result == BlackPromotionKnight)) { + currentMoveString[4] = PieceToChar(BlackQueen); - // [HGM] shatranj: take care of variants without Queen - if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) - currentMoveString[4] = PieceToChar(BlackFerz); - if(gameInfo.variant == VariantGreat) - currentMoveString[4] = PieceToChar(BlackMan); + currentMoveString[5] = NULLCHAR; + } + + if (result != IllegalMove) return (int) result; + + /* Special case: improperly written en passant capture */ + if (WhiteOnMove(yyboardindex)) { + if (currentMoveString[3] == '5') { + currentMoveString[1] = '5'; + currentMoveString[3] = '6'; + } else { + return (int) IllegalMove; + } + } else { + if (currentMoveString[3] == '4') { + currentMoveString[1] = '4'; + currentMoveString[3] = '3'; + } else { + return (int) IllegalMove; + } + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant) + return (int) result; + else + return (int) IllegalMove; + } + YY_BREAK + case 6: + YY_RULE_SETUP + { + /* + * piece move, possibly ambiguous + */ + DisambiguateClosure cl; + int skip = 0, skip2 = 0, promoted = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if(yytext[0] == '+') promoted = skip = skip2 = 1; + + /* remove the [xX:-] */ + if ((yytext[1+skip] == 'x') || (yytext[1+skip] == 'X') + || (yytext[1+skip] == ':') || (yytext[1+skip] == '-')) skip++; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); + } + if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); + + cl.rfIn = -1; + cl.ffIn = -1; + cl.rtIn = yytext[2+skip] - ONE; + cl.ftIn = yytext[1+skip] - AAA; + cl.promoCharIn = NULLCHAR; + + if(yyleng-skip > 3) /* [HGM] can have Shogi-style promotion */ + cl.promoCharIn = yytext[yyleng-1]; + + if (appData.debugMode) { + fprintf(debugFP, "Parser Qa1: yyleng=%d, %d(%d,%d)-(%d,%d) = %d (%c)\n", + yyleng, + cl.pieceIn,cl.ffIn,cl.rfIn,cl.ftIn,cl.rtIn,cl.promoCharIn,cl.promoCharIn?cl.promoCharIn:' '); + } + + /* [HGM] but do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + YY_BREAK + case 7: + YY_RULE_SETUP + { + /* + * piece move with rank or file disambiguator + */ + DisambiguateClosure cl; + int skip = 0, skip2 = 0; int promoted=0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if(yytext[0]=='+') promoted = skip = skip2 = 1; + + /* remove the [xX:-] */ + if ((yytext[2+skip] == 'x') || (yytext[2+skip] == 'X') + || (yytext[2+skip] == ':') || (yytext[2+skip] == '-')) skip++; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); + } + if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); + + if (isalpha(yytext[1+skip2])) { + cl.rfIn = -1; + cl.ffIn = yytext[1+skip2] - AAA; + + if(cl.ffIn >= BOARD_RGHT || + cl.ffIn < BOARD_LEFT ) return 0; + } else { + cl.rfIn = yytext[1+skip2] - ONE; + cl.ffIn = -1; + if(cl.rfIn >= BOARD_HEIGHT || + cl.rfIn < 0) return 0; + } + cl.rtIn = yytext[3+skip] - ONE; + cl.ftIn = yytext[2+skip] - AAA; + cl.promoCharIn = NULLCHAR; + + if(yyleng-skip > 4) /* [HGM] can have Shogi-style promotion */ + cl.promoCharIn = yytext[yyleng-1]; + + /* [HGM] do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + YY_BREAK + case 8: + YY_RULE_SETUP + { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* [HGM] all squares referenced to board edges in stead of absolute */ + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { + /* ICS wild castling */ + rf = 0; + ff = (BOARD_WIDTH-1)>>1; + rt = 0; + ft = BOARD_RGHT-3; + } else { + rf = 0; + ff = BOARD_WIDTH>>1; + rt = 0; + ft = BOARD_LEFT+2; + } + } else{ + if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { + /* ICS wild castling */ + rf = BOARD_HEIGHT-1; + ff = (BOARD_WIDTH-1)>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_RGHT-3; + } else { + rf = BOARD_HEIGHT-1; + ff = BOARD_WIDTH>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_LEFT+2; + } + } + if(gameInfo.variant == VariantFischeRandom) { + if (WhiteOnMove(yyboardindex)) { + ff = initialRights[2]; + ft = initialRights[1]; + } else { + ff = initialRights[5]; + ft = initialRights[4]; + } + fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); + if(ff < 0 || ft < 0) return 0; + } + sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); + if (appData.debugMode) { + fprintf(debugFP, "long castling %d %d\n", ff, ft); + } + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + castlingRights[yyboardindex], /* [HGM] use true castling rights */ + rf, ff, rt, ft, NULLCHAR); + } + YY_BREAK + case 9: + YY_RULE_SETUP + { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { + /* ICS wild castling */ + rf = 0; + ff = (BOARD_WIDTH-1)>>1; + rt = 0; + ft = BOARD_LEFT+1; + } else { + rf = 0; + ff = BOARD_WIDTH>>1; + rt = 0; + ft = BOARD_RGHT-2; + } + } else { + if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { + /* ICS wild castling */ + rf = BOARD_HEIGHT-1; + ff = (BOARD_WIDTH-1)>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_LEFT+1; + } else { + rf = BOARD_HEIGHT-1; + ff = BOARD_WIDTH>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_RGHT-2; + } + } + if(gameInfo.variant == VariantFischeRandom) { + if (WhiteOnMove(yyboardindex)) { + ff = initialRights[2]; + ft = initialRights[0]; + } else { + ff = initialRights[5]; + ft = initialRights[3]; + } + if (appData.debugMode) { + fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft); + } + if(ff < 0 || ft < 0) return 0; + } + sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); + if (appData.debugMode) { + fprintf(debugFP, "short castling %d %d\n", ff, ft); + } + + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + castlingRights[yyboardindex], /* [HGM] use true castling rights */ + rf, ff, rt, ft, NULLCHAR); + } + YY_BREAK + case 10: + YY_RULE_SETUP + { + /* Bughouse piece drop. No legality checking for now. */ + currentMoveString[1] = '@'; + currentMoveString[2] = yytext[2]; + currentMoveString[3] = yytext[3]; + currentMoveString[4] = NULLCHAR; + + if (appData.debugMode) { + fprintf(debugFP, "Drop: %s\n", currentMoveString); + } + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[2] - AAA >= BOARD_WIDTH ) + return 0; + + if (WhiteOnMove(yyboardindex)) { + currentMoveString[0] = ToUpper(yytext[0]); + return (int) WhiteDrop; + } else { + currentMoveString[0] = ToLower(yytext[0]); + return (int) BlackDrop; + } + } + YY_BREAK + case 11: + YY_RULE_SETUP + { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + YY_BREAK + case 12: + YY_RULE_SETUP + { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); + } + YY_BREAK + case 13: + YY_RULE_SETUP + { + return (int) GameUnfinished; + } + YY_BREAK + case 14: + YY_RULE_SETUP + { + return (int) GameIsDrawn; + } + YY_BREAK + case 15: + YY_RULE_SETUP + { + return (int) GameIsDrawn; + } + YY_BREAK + case 16: + YY_RULE_SETUP + { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + YY_BREAK + case 17: + YY_RULE_SETUP + { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + YY_BREAK + case 18: + YY_RULE_SETUP + { + return (int) GameIsDrawn; + } + YY_BREAK + case 19: + YY_RULE_SETUP + { + return (int) GameIsDrawn; + } + YY_BREAK + case 20: + YY_RULE_SETUP + { + return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins); + } + YY_BREAK + case 21: + YY_RULE_SETUP + { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); + } + YY_BREAK + case 22: + YY_RULE_SETUP + { + return (int) WhiteWins; + } + YY_BREAK + case 23: + YY_RULE_SETUP + { + return (int) BlackWins; + } + YY_BREAK + case 24: + YY_RULE_SETUP + { + return (int) GameIsDrawn; + } + YY_BREAK + case 25: + YY_RULE_SETUP + { + return (int) GameUnfinished; + } + YY_BREAK + case 26: + YY_RULE_SETUP + { + /* move numbers */ + if ((yyleng == 1) && (yytext[0] == '1')) + return (int) MoveNumberOne; + } + YY_BREAK + case 27: + YY_RULE_SETUP + { + /* elapsed time indication, e.g. (0:12) or {10:21.071} */ + return (int) ElapsedTime; + } + YY_BREAK + case 28: + YY_RULE_SETUP + { + /* position diagram enclosed in [-- --] */ + return (int) PositionDiagram; + } + YY_BREAK + case 29: + *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ + yy_c_buf_p = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP + { + /* position diagram enclosed in {-- --} */ + return (int) PositionDiagram; + } + YY_BREAK + case 30: + YY_RULE_SETUP + { + return (int) PGNTag; + } + YY_BREAK + case 31: + YY_RULE_SETUP + { + return (int) GNUChessGame; + } + YY_BREAK + case 32: + *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ + yy_c_buf_p = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP + { + return (int) XBoardGame; + } + YY_BREAK + case 33: + YY_RULE_SETUP + { /* numeric annotation glyph */ + return (int) NAG; + } + YY_BREAK + case 34: + YY_RULE_SETUP + { /* anything in {} */ + return (int) Comment; + } + YY_BREAK + case 35: + *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ + yy_c_buf_p = yy_cp -= 1; + YY_DO_BEFORE_ACTION; /* set up yytext again */ + YY_RULE_SETUP + { /* ; to end of line */ + return (int) Comment; + } + YY_BREAK + case 36: + YY_RULE_SETUP + { /* anything in [] */ + return (int) Comment; + } + YY_BREAK + case 37: + YY_RULE_SETUP + { /* nested () */ + return (int) Comment; + } + YY_BREAK + case 38: + YY_RULE_SETUP + { /* >=2 chars in () */ + return (int) Comment; + } + YY_BREAK + case 39: + YY_RULE_SETUP + { + /* Skip mail headers */ + } + YY_BREAK + case 40: + YY_RULE_SETUP + { + /* Skip random words */ + } + YY_BREAK + case 41: + YY_RULE_SETUP + { + /* Skip everything else */ + } + YY_BREAK + case 42: + YY_RULE_SETUP + ECHO; + YY_BREAK + case YY_STATE_EOF(INITIAL): + 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->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->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->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->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->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() + { + register char *dest = yy_current_buffer->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->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + #ifdef YY_USES_REJECT + YY_FATAL_ERROR( + "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + #else + + /* 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 ) + { + int 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. */ + yy_flex_realloc( (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->yy_buf_size - + number_to_move - 1; + #endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->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->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->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() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 697 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + 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 ); + */ + + #ifdef YY_USE_PROTOS + static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) + #else + static yy_state_type yy_try_NUL_trans( yy_current_state ) + yy_state_type yy_current_state; + #endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 697 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 696); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + + #ifndef YY_NO_UNPUT + #ifdef YY_USE_PROTOS + static void yyunput( int c, register char *yy_bp ) + #else + static void yyunput( c, yy_bp ) + int c; + register char *yy_bp; + #endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->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; + } + #endif /* ifndef YY_NO_UNPUT */ + + + #ifdef __cplusplus + static int yyinput() + #else + static int input() + #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->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int 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 ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + 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->yy_at_bol = (c == '\n'); + + return c; + } + + + #ifdef YY_USE_PROTOS + void yyrestart( FILE *input_file ) + #else + void yyrestart( input_file ) + FILE *input_file; + #endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + + #ifdef YY_USE_PROTOS + void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) + #else + void yy_switch_to_buffer( new_buffer ) + YY_BUFFER_STATE new_buffer; + #endif + { + 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->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = 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; + } + + + #ifdef YY_USE_PROTOS + void yy_load_buffer_state( void ) + #else + void yy_load_buffer_state() + #endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + + #ifdef YY_USE_PROTOS + YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) + #else + YY_BUFFER_STATE yy_create_buffer( file, size ) + FILE *file; + int size; + #endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( 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 *) yy_flex_alloc( 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; + } + + + #ifdef YY_USE_PROTOS + void yy_delete_buffer( YY_BUFFER_STATE b ) + #else + void yy_delete_buffer( b ) + YY_BUFFER_STATE b; + #endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + #ifndef _WIN32 + #include + #else + #ifndef YY_ALWAYS_INTERACTIVE + #ifndef YY_NEVER_INTERACTIVE + extern int isatty YY_PROTO(( int )); + #endif + #endif + #endif + + #ifdef YY_USE_PROTOS + void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) + #else + void yy_init_buffer( b, file ) + YY_BUFFER_STATE b; + FILE *file; + #endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + #if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; + #else + #if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; + #else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + #endif + #endif + } + + + #ifdef YY_USE_PROTOS + void yy_flush_buffer( YY_BUFFER_STATE b ) + #else + void yy_flush_buffer( b ) + YY_BUFFER_STATE b; + #endif + + { + 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(); + } + + + #ifndef YY_NO_SCAN_BUFFER + #ifdef YY_USE_PROTOS + YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) + #else + YY_BUFFER_STATE yy_scan_buffer( base, size ) + char *base; + yy_size_t size; + #endif + { + 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) yy_flex_alloc( 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; + } + #endif + + + #ifndef YY_NO_SCAN_STRING + #ifdef YY_USE_PROTOS + YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) + #else + YY_BUFFER_STATE yy_scan_string( yy_str ) + yyconst char *yy_str; + #endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } + #endif + + + #ifndef YY_NO_SCAN_BYTES + #ifdef YY_USE_PROTOS + YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) + #else + YY_BUFFER_STATE yy_scan_bytes( bytes, len ) + yyconst char *bytes; + int len; + #endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[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; + } + #endif + + + #ifndef YY_NO_PUSH_STATE + #ifdef YY_USE_PROTOS + static void yy_push_state( int new_state ) + #else + static void yy_push_state( new_state ) + int new_state; + #endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } + #endif + + + #ifndef YY_NO_POP_STATE + static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } + #endif + + + #ifndef YY_NO_TOP_STATE + static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } + #endif + + #ifndef YY_EXIT_FAILURE + #define YY_EXIT_FAILURE 2 + #endif + + #ifdef YY_USE_PROTOS + static void yy_fatal_error( yyconst char msg[] ) + #else + static void yy_fatal_error( msg ) + char msg[]; + #endif + { + (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. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + + /* Internal utility routines. */ + + #ifndef yytext_ptr + #ifdef YY_USE_PROTOS + static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) + #else + static void yy_flex_strncpy( s1, s2, n ) + char *s1; + yyconst char *s2; + int n; + #endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } + #endif + + #ifdef YY_NEED_STRLEN + #ifdef YY_USE_PROTOS + static int yy_flex_strlen( yyconst char *s ) + #else + static int yy_flex_strlen( s ) + yyconst char *s; + #endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } + #endif + + + #ifdef YY_USE_PROTOS + static void *yy_flex_alloc( yy_size_t size ) + #else + static void *yy_flex_alloc( size ) + yy_size_t size; + #endif + { + return (void *) malloc( size ); + } + + #ifdef YY_USE_PROTOS + static void *yy_flex_realloc( void *ptr, yy_size_t size ) + #else + static void *yy_flex_realloc( ptr, size ) + void *ptr; + yy_size_t size; + #endif + { + /* 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 ); + } + + #ifdef YY_USE_PROTOS + static void yy_flex_free( void *ptr ) + #else + static void yy_flex_free( ptr ) + void *ptr; + #endif + { + free( ptr ); + } + + #if YY_MAIN + int main() + { + yylex(); + return 0; + } + #endif + + + + static char *StringToLex; + + #ifndef FLEX_SCANNER + static FILE *lexFP; + + static int input() + { + int ret; + + if (StringToLex != NULL) { + ret = *StringToLex; + if (ret == NULLCHAR) + ret = EOF; + else + StringToLex++; + } else if (unputCount > 0) { + ret = unputBuffer[--unputCount]; + } else { + ret = fgetc(lexFP); + } + + if (ret == EOF) + return 0; + else + return ret; + } + + /* + * Return offset of next pattern within current file + */ + int yyoffset() + { + int offset = ftell(lexFP) - unputCount; + + if (offset < 0) { + offset = 0; + } + return(offset); + } + + static void output(ch) + int ch; + { + fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", + ch, ch); + } + + static void unput(ch) + int ch; + { + if (ch == 0) return; + if (StringToLex != NULL) { + StringToLex--; + } else { + if (unputCount >= UNPUT_BUF_SIZE) + fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", + ch, ch); + unputBuffer[unputCount++] = ch; + } + } + + /* Get ready to lex from a new file. Kludge below sticks + an artificial newline at the front of the file, which the + above grammar ignores, but which makes ^ at start of pattern + match at the real start of the file. + */ + void yynewfile(f) + FILE *f; + { + lexFP = f; + StringToLex = NULL; + unputCount = 0; + unput('\n'); /* kludge */ + } + + /* Get ready to lex from a string. ^ at start of pattern WON'T + match at the start of the string! + */ + void yynewstr(s) + char *s; + { + lexFP = NULL; + StringToLex = s; + unputCount = 0; + } + #endif /*!FLEX_SCANNER*/ + + #ifdef FLEX_SCANNER + void my_yy_input(buf, result, max_size) + char *buf; + int *result; + int max_size; + { + int count; + + if (StringToLex != NULL) { + count = 0; + while (*StringToLex != NULLCHAR) { + *buf++ = *StringToLex++; + count++; + } + *result = count; + return; + } else { + count = fread(buf, 1, max_size, yyin); + if (count == 0) { + *result = YY_NULL; + } else { + *result = count; + } + return; + } + } + + static YY_BUFFER_STATE my_file_buffer = NULL; + + /* + Return offset of next pattern in the current file. + */ + int yyoffset() + { + int pos = yy_c_buf_p - yy_current_buffer->yy_ch_buf; + + return(ftell(yy_current_buffer->yy_input_file) - + yy_n_chars + pos); + } + + + void yynewstr(s) + char *s; + { + if (my_file_buffer != NULL) + yy_delete_buffer(my_file_buffer); + StringToLex = s; + my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE); + yy_switch_to_buffer(my_file_buffer); + } + + void yynewfile(f) + FILE *f; + { + if (my_file_buffer != NULL) + yy_delete_buffer(my_file_buffer); + StringToLex = NULL; + my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE); + yy_switch_to_buffer(my_file_buffer); + } + #endif /*FLEX_SCANNER*/ + + int yywrap() + { + return TRUE; + } + + /* Parse a move from the given string s */ + /* ^ at start of pattern WON'T work here unless using flex */ + ChessMove yylexstr(boardIndex, s) + int boardIndex; + char *s; + { + ChessMove ret; + char *oldStringToLex; + #ifdef FLEX_SCANNER + YY_BUFFER_STATE buffer, oldBuffer; + #endif + + yyboardindex = boardIndex; + oldStringToLex = StringToLex; + StringToLex = s; + #ifdef FLEX_SCANNER + buffer = yy_create_buffer(stdin, YY_BUF_SIZE); + oldBuffer = YY_CURRENT_BUFFER; + yy_switch_to_buffer(buffer); + #endif /*FLEX_SCANNER*/ + + ret = (ChessMove) yylex(); + + #ifdef FLEX_SCANNER + if (oldBuffer != NULL) + yy_switch_to_buffer(oldBuffer); + yy_delete_buffer(buffer); + #endif /*FLEX_SCANNER*/ + StringToLex = oldStringToLex; + + return ret; + } diff --cc parser.l index 137ce54,48e78f3..bdf11d0 mode 100644,100755..100755 --- a/parser.l +++ b/parser.l @@@ -1,931 -1,1107 +1,1117 @@@ - %a 10000 - %o 10000 - %e 2000 - %k 2500 - %p 7000 - %n 1000 - %{ - /* - * parser.l -- lex parser of algebraic chess moves for XBoard - * $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-95 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ - - /* This parser handles all forms of promotion. - * The parser resolves ambiguous moves by searching and check-testing. - * It also parses comments of the form [anything] or (anything). - */ - - #include "config.h" - - #define NO_CONSTRAINT -1 - #undef YYLMAX - #define YYLMAX 4096 - #define UNPUT_BUF_SIZE YYLMAX - - #ifdef FLEX_SCANNER - /* yytext is probably a char*, but could be a char[]. yy_text is set - in YY_DECL below, because if yytext is a char*, its value is not - constant. */ - char *yy_text; - #else /*!FLEX_SCANNER*/ - /* yytext is definitely a char[], so yy_text can be set here, statically. */ - char *yy_text = (char *) yytext; - #endif - - #ifdef FLEX_SCANNER - /* This is flex */ - /* use prototypes in function declarations */ - #define YY_USE_PROTOS - - #ifdef YY_USE_PROTOS - #define YY_PROTO(proto) proto - #else - #define YY_PROTO(proto) () - #endif - - #undef YY_INPUT - #define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size) - #undef YY_DECL - #define YY_DECL \ - int _yylex YY_PROTO((void)); \ - int yylex YY_PROTO((void)) \ - { \ - int result = _yylex(); \ - yy_text = (char *) yytext; \ - return(result); \ - } \ - int _yylex YY_PROTO((void)) - #else - /* This is lex */ - #undef input - #undef output - #undef unput - #endif - - /* The includes must be here, below the #undef input */ - - #include - - #if STDC_HEADERS - # include - # include - #else /* not STDC_HEADERS */ - # if HAVE_STRING_H - # include - # else /* not HAVE_STRING_H */ - # include - # endif /* not HAVE_STRING_H */ - #endif /* not STDC_HEADERS */ - - #if HAVE_UNISTD_H - # include - #endif - - #if defined(_amigados) - # include - # if HAVE_FCNTL_H - # include /* isatty() prototype */ - # endif /* HAVE_FCNTL_H */ - #endif /* defined(_amigados) */ - - #include "common.h" - #include "backend.h" - #include "frontend.h" - #include "parser.h" - #include "moves.h" - - extern int PosFlags P((int)); - - extern Board boards[MAX_MOVES]; - int yyboardindex; - int yyskipmoves = FALSE; - char currentMoveString[YYLMAX]; - #ifndef FLEX_SCANNER - char unputBuffer[UNPUT_BUF_SIZE]; - int unputCount = 0; - #endif - - #ifdef FLEX_SCANNER - void my_yy_input P((char *buf, int *result, int max_size)); - #else /*!FLEX_SCANNER*/ - static int input P((void)); - static void output P((int ch)); - static void unput P((int ch)); - int yylook P((void)); - int yyback P((int *, int)); - #endif - #undef yywrap - int yywrap P((void)); - extern void CopyBoard P((Board to, Board from)); - - %} - %% - - [RrBbNnQqKkPp][/]?[a-h][1-8][xX:-]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { - /* - * Fully-qualified algebraic move, possibly with promotion - */ - int skip1 = 0, skip2 = 0; - ChessSquare piece; - ChessMove result; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove the / */ - if (yytext[1] == '/') skip1 = 1; - - /* remove the [xX:-] */ - if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') || - (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1; - - currentMoveString[0] = yytext[1+skip1]; - currentMoveString[1] = yytext[2+skip1]; - currentMoveString[2] = yytext[3+skip1+skip2]; - currentMoveString[3] = yytext[4+skip1+skip2]; - currentMoveString[4] = NULLCHAR; - - if (yyleng-skip1-skip2 > 5) { - if (yytext[yyleng-1] == ')') { - currentMoveString[4] = ToLower(yytext[yyleng-2]); - } else { - currentMoveString[4] = ToLower(yytext[yyleng-1]); - } - currentMoveString[5] = NULLCHAR; - } - - piece = boards[yyboardindex] - [currentMoveString[1] - '1'][currentMoveString[0] - 'a']; - if (ToLower(yytext[0]) != ToLower(PieceToChar(piece))) - return (int) IllegalMove; - - result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - currentMoveString[1] - '1', - currentMoveString[0] - 'a', - currentMoveString[3] - '1', - currentMoveString[2] - 'a', - currentMoveString[4]); - - if (currentMoveString[4] == NULLCHAR && - (result == WhitePromotionQueen || result == BlackPromotionQueen)) { - currentMoveString[4] = 'q'; - currentMoveString[5] = NULLCHAR; - } - - return (int) result; - } - - [a-h][1-8][xX:-]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { - /* - * Simple algebraic move, possibly with promotion - */ - int skip = 0; - ChessMove result; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove the [xX:-] */ - if ((yytext[2] == 'x') || (yytext[2] == 'X') || - (yytext[2] == '-') || (yytext[2] == ':')) skip = 1; - - currentMoveString[0] = yytext[0]; - currentMoveString[1] = yytext[1]; - currentMoveString[2] = yytext[2+skip]; - currentMoveString[3] = yytext[3+skip]; - currentMoveString[4] = NULLCHAR; - - if (yyleng-skip > 4) { - if (yytext[yyleng-1] == ')') { - currentMoveString[4] = ToLower(yytext[yyleng-2]); - } else { - currentMoveString[4] = ToLower(yytext[yyleng-1]); - } - currentMoveString[5] = NULLCHAR; - } - - result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - currentMoveString[1] - '1', - currentMoveString[0] - 'a', - currentMoveString[3] - '1', - currentMoveString[2] - 'a', - currentMoveString[4]); - - if (currentMoveString[4] == NULLCHAR && - (result == WhitePromotionQueen || result == BlackPromotionQueen)) { - currentMoveString[4] = 'q'; - currentMoveString[5] = NULLCHAR; - } - - return (int) result; - } - - [a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { - /* - * Pawn move, possibly with promotion - */ - DisambiguateClosure cl; - int skip = 0; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove the =() */ - if (yytext[2] == '=') skip++; - if (yytext[2+skip] == '(') skip++; - - cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; - cl.rfIn = -1; - cl.ffIn = yytext[0] - 'a'; - cl.rtIn = yytext[1] - '1'; - cl.ftIn = yytext[0] - 'a'; - cl.promoCharIn = yytext[2+skip]; - Disambiguate(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, &cl); - - currentMoveString[0] = cl.ff + 'a'; - currentMoveString[1] = cl.rf + '1'; - currentMoveString[2] = cl.ft + 'a'; - currentMoveString[3] = cl.rt + '1'; - currentMoveString[4] = cl.promoChar; - currentMoveString[5] = NULLCHAR; - - return (int) cl.kind; - } - - - (ab|bc|cd|de|ef|fg|gh|hg|gf|fe|ed|dc|cb|ba|([a-h][xX:-][a-h]))(=?\(?[RrBbNnQqKk]\)?)?(ep|"e.p.")? { - /* - * Pawn capture, possibly with promotion, possibly ambiguous - */ - DisambiguateClosure cl; - int skip1 = 0, skip2 = 0; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove trailing ep or e.p. (nonstandard PGN) */ - if (yytext[yyleng-1] == 'p') { - yyleng -= 2; - yytext[yyleng] = NULLCHAR; - } else if (yytext[yyleng-1] == '.') { - yyleng -= 4; - yytext[yyleng] = NULLCHAR; - } - - /* remove the [xX:-] and =() */ - if ((yytext[1] == 'x') || (yytext[1] == 'X') - || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1; - if (yytext[2+skip1] == '=') skip2++; - if (yytext[2+skip1+skip2] == '(') skip2++; - - cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; - cl.rfIn = -1; - cl.ffIn = yytext[0] - 'a'; - cl.rtIn = -1; - cl.ftIn = yytext[1+skip1] - 'a'; - cl.promoCharIn = yytext[2+skip1+skip2]; - Disambiguate(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, &cl); - - currentMoveString[0] = cl.ff + 'a'; - currentMoveString[1] = cl.rf + '1'; - currentMoveString[2] = cl.ft + 'a'; - currentMoveString[3] = cl.rt + '1'; - currentMoveString[4] = cl.promoChar; - currentMoveString[5] = NULLCHAR; - - return (int) cl.kind; - } - - [a-h][xX:]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)?(ep|"e.p.")? { - /* - * unambiguously abbreviated Pawn capture, possibly with promotion - */ - int skip = 0; - ChessMove result; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove trailing ep or e.p. (nonstandard PGN) */ - if (yytext[yyleng-1] == 'p') { - yyleng -= 2; - yytext[yyleng] = NULLCHAR; - } else if (yytext[yyleng-1] == '.') { - yyleng -= 4; - yytext[yyleng] = NULLCHAR; - } - - /* remove the [xX:-] */ - if ((yytext[1] == 'x') || (yytext[1] == 'X') - || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; - - currentMoveString[0] = yytext[0]; - currentMoveString[2] = yytext[1+skip]; - currentMoveString[3] = yytext[2+skip]; - if (WhiteOnMove(yyboardindex)) { - if (yytext[2+skip] == '1') return (int) ImpossibleMove; - currentMoveString[1] = yytext[2+skip] - 1; - } else { - if (yytext[2+skip] == '8') return (int) ImpossibleMove; - currentMoveString[1] = yytext[2+skip] + 1; - } - if (yyleng-skip > 3) { - if (yytext[yyleng-1] == ')') - currentMoveString[4] = ToLower(yytext[yyleng-2]); - else - currentMoveString[4] = ToLower(yytext[yyleng-1]); - currentMoveString[5] = NULLCHAR; - } else { - currentMoveString[4] = NULLCHAR; - } - - result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - currentMoveString[1] - '1', - currentMoveString[0] - 'a', - currentMoveString[3] - '1', - currentMoveString[2] - 'a', - currentMoveString[4]); - - if (currentMoveString[4] == NULLCHAR && - (result == WhitePromotionQueen || result == BlackPromotionQueen)) { - currentMoveString[4] = 'q'; - currentMoveString[5] = NULLCHAR; - } - - if (result != IllegalMove) return (int) result; - - /* Special case: improperly written en passant capture */ - if (WhiteOnMove(yyboardindex)) { - if (currentMoveString[3] == '5') { - currentMoveString[1] = '5'; - currentMoveString[3] = '6'; - } else { - return (int) IllegalMove; - } - } else { - if (currentMoveString[3] == '4') { - currentMoveString[1] = '4'; - currentMoveString[3] = '3'; - } else { - return (int) IllegalMove; - } - } - - result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - currentMoveString[1] - '1', - currentMoveString[0] - 'a', - currentMoveString[3] - '1', - currentMoveString[2] - 'a', - currentMoveString[4]); - - if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant) - return (int) result; - else - return (int) IllegalMove; - } - - [RrBbNnQqKk][xX:-]?[a-h][1-8] { - /* - * piece move, possibly ambiguous - */ - DisambiguateClosure cl; - int skip = 0; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove the [xX:-] */ - if ((yytext[1] == 'x') || (yytext[1] == 'X') - || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; - - if (WhiteOnMove(yyboardindex)) { - cl.pieceIn = CharToPiece(ToUpper(yytext[0])); - } else { - cl.pieceIn = CharToPiece(ToLower(yytext[0])); - } - cl.rfIn = -1; - cl.ffIn = -1; - cl.rtIn = yytext[2+skip] - '1'; - cl.ftIn = yytext[1+skip] - 'a'; - cl.promoCharIn = NULLCHAR; - Disambiguate(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, &cl); - - currentMoveString[0] = cl.ff + 'a'; - currentMoveString[1] = cl.rf + '1'; - currentMoveString[2] = cl.ft + 'a'; - currentMoveString[3] = cl.rt + '1'; - currentMoveString[4] = cl.promoChar; - currentMoveString[5] = NULLCHAR; - - return (int) cl.kind; - } - - [RrBbNnQqKk][a-h1-8][xX:-]?[a-h][1-8] { - /* - * piece move with rank or file disambiguator - */ - DisambiguateClosure cl; - int skip = 0; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - /* remove the [xX:-] */ - if ((yytext[2] == 'x') || (yytext[2] == 'X') - || (yytext[2] == ':') || (yytext[2] == '-')) skip = 1; - - if (WhiteOnMove(yyboardindex)) { - cl.pieceIn = CharToPiece(ToUpper(yytext[0])); - } else { - cl.pieceIn = CharToPiece(ToLower(yytext[0])); - } - if (isalpha(yytext[1])) { - cl.rfIn = -1; - cl.ffIn = yytext[1] - 'a'; - } else { - cl.rfIn = yytext[1] - '1'; - cl.ffIn = -1; - } - cl.rtIn = yytext[3+skip] - '1'; - cl.ftIn = yytext[2+skip] - 'a'; - cl.promoCharIn = NULLCHAR; - Disambiguate(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, &cl); - - currentMoveString[0] = cl.ff + 'a'; - currentMoveString[1] = cl.rf + '1'; - currentMoveString[2] = cl.ft + 'a'; - currentMoveString[3] = cl.rt + '1'; - currentMoveString[4] = cl.promoChar; - currentMoveString[5] = NULLCHAR; - - return (int) cl.kind; - } - - 000|0-0-0|ooo|OOO|o-o-o|O-O-O { - int rf, ff, rt, ft; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - if (WhiteOnMove(yyboardindex)) { - if (boards[yyboardindex][0][3] == WhiteKing) { - /* ICS wild castling */ - strcpy(currentMoveString, "d1f1"); - rf = 0; - ff = 3; - rt = 0; - ft = 5; - } else { - strcpy(currentMoveString, "e1c1"); - rf = 0; - ff = 4; - rt = 0; - ft = 2; - } - } else{ - if (boards[yyboardindex][7][3] == BlackKing) { - /* ICS wild castling */ - strcpy(currentMoveString, "d8f8"); - rf = 7; - ff = 3; - rt = 7; - ft = 5; - } else { - strcpy(currentMoveString, "e8c8"); - rf = 7; - ff = 4; - rt = 7; - ft = 2; - } - } - return (int) LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - rf, ff, rt, ft, NULLCHAR); - } - - 00|0-0|oo|OO|o-o|O-O { - int rf, ff, rt, ft; - - if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ - - if (WhiteOnMove(yyboardindex)) { - if (boards[yyboardindex][0][3] == WhiteKing) { - /* ICS wild castling */ - strcpy(currentMoveString, "d1b1"); - rf = 0; - ff = 3; - rt = 0; - ft = 1; - } else { - strcpy(currentMoveString, "e1g1"); - rf = 0; - ff = 4; - rt = 0; - ft = 6; - } - } else { - if (boards[yyboardindex][7][3] == BlackKing) { - /* ICS wild castling */ - strcpy(currentMoveString, "d8b8"); - rf = 7; - ff = 3; - rt = 7; - ft = 1; - } else { - strcpy(currentMoveString, "e8g8"); - rf = 7; - ff = 4; - rt = 7; - ft = 6; - } - } - return (int) LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, - rf, ff, rt, ft, NULLCHAR); - } - - [PpNnBbRrQq]@[a-h][1-8] { - /* Bughouse piece drop. No legality checking for now. */ - currentMoveString[1] = '@'; - currentMoveString[2] = yytext[2]; - currentMoveString[3] = yytext[3]; - currentMoveString[4] = NULLCHAR; - if (WhiteOnMove(yyboardindex)) { - currentMoveString[0] = ToUpper(yytext[0]); - return (int) WhiteDrop; - } else { - currentMoveString[0] = ToLower(yytext[0]); - return (int) BlackDrop; - } - } - - [Rr]esign(s|ed)? { - if (WhiteOnMove(yyboardindex)) - return (int) BlackWins; - else - return (int) WhiteWins; - } - - (([Ww](hite)?)|([Bb](lack)?))" "(([Rr]esign)|([Ff]orfeit))(s|ed)? { - return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); - } - - (([Ww](hite)?)|([Bb](lack)?))" "[Dd]isconnect(s|ed) { - return (int) GameUnfinished; - } - - [Ss]talemate { - return (int) GameIsDrawn; - } - - "+-+" { - return (int) GameIsDrawn; - } - - ([Cc]heck)?[Mm]ate { - if (WhiteOnMove(yyboardindex)) - return (int) BlackWins; - else - return (int) WhiteWins; - } - - "++" { - if (WhiteOnMove(yyboardindex)) - return (int) BlackWins; - else - return (int) WhiteWins; - } - - [Dd]raw(n)?(" "by)?(" "[Rr]epetition)|(" "[Aa]gree(d|ment)) { - return (int) GameIsDrawn; - } - - [Dd]raw(n)?(" (".*")")? { - return (int) GameIsDrawn; - } - - (([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ww][io]n(s)?.*) { - return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins); - } - - (([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ll]os[tes]+.*) { - return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); - } - - ("{"[^\}\n]*"} ")?(1-0|"1 - 0"|"1/0"|"1 / 0"|"1:0"|"1 : 0")(" (".*")"|" {".*"}")? { - return (int) WhiteWins; - } - - ("{"[^\}\n]*"} ")?(0-1|"0 - 1"|"0/1"|"0 / 1"|"0:1"|"0 : 1")(" (".*")"|" {".*"}")? { - return (int) BlackWins; - } - - ("{"[^\}\n]*"} ")?("1/2"|"1 / 2")(" "?[-:]" "?("1/2"|"1 / 2"))?(" (".*")"|" {".*"}")? { - return (int) GameIsDrawn; - } - - ("{"[^\}\n]*"} ")?"*"(" (".*")"|" {".*"}")? { - return (int) GameUnfinished; - } - - [1-9][0-9]*/"."?[ \t\n]*[a-hNnPpRrBQqKkOo] { - /* move numbers */ - if ((yyleng == 1) && (yytext[0] == '1')) - return (int) MoveNumberOne; - } - - \([0-9]+:[0-9][0-9](\.[0-9]+)?\)|\{[0-9]+:[0-9][0-9](\.[0-9]+)?\} { - /* elapsed time indication, e.g. (0:12) or {10:21.071} */ - return (int) ElapsedTime; - } - - "[--"[^\]]*"--]" { - /* position diagram enclosed in [-- --] */ - return (int) PositionDiagram; - } - - ^"{--------------"\n[^\}]*\n"--------------}"$ { - /* position diagram enclosed in {-- --} */ - return (int) PositionDiagram; - } - - \[[ \t\n]*[A-Za-z0-9][A-Za-z0-9_+#=-]*[ \t\n]*\"[^"]*\"[ \t\n]*\] { - return (int) PGNTag; - } - - [Gg](nu|NU)" "?[Cc](hess|HESS).*[Gg](ame|AME) { - return (int) GNUChessGame; - } - - ^[#;%]" "[^ ]*(" game file"|" position file").*$ { - return (int) XBoardGame; - } - - \$[0-9]+ { /* numeric annotation glyph */ - return (int) NAG; - } - - \{[^\}]*\} { /* anything in {} */ - return (int) Comment; - } - - ;.*$ { /* ; to end of line */ - return (int) Comment; - } - - \[[^\]]*\] { /* anything in [] */ - return (int) Comment; - } - - \([^()]*(\([^()]*\)[^()]*)+[^()]*\) { /* nested () */ - return (int) Comment; - } - - \([^)][^)]+\) { /* >=2 chars in () */ - return (int) Comment; - } - - ^[-a-zA-Z0-9]+:" ".*(\n[ \t]+.*)* { - /* Skip mail headers */ - } - - [a-zA-Z0-9'-]+ { - /* Skip random words */ - } - - .|\n { - /* Skip everything else */ - } - - %% - - - static char *StringToLex; - - #ifndef FLEX_SCANNER - static FILE *lexFP; - - static int input() - { - int ret; - - if (StringToLex != NULL) { - ret = *StringToLex; - if (ret == NULLCHAR) - ret = EOF; - else - StringToLex++; - } else if (unputCount > 0) { - ret = unputBuffer[--unputCount]; - } else { - ret = fgetc(lexFP); - } - - if (ret == EOF) - return 0; - else - return ret; - } - - /* - * Return offset of next pattern within current file - */ - int yyoffset() - { - int offset = ftell(lexFP) - unputCount; - - if (offset < 0) { - offset = 0; - } - return(offset); - } - - static void output(ch) - int ch; - { - fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", - ch, ch); - } - - static void unput(ch) - int ch; - { - if (ch == 0) return; - if (StringToLex != NULL) { - StringToLex--; - } else { - if (unputCount >= UNPUT_BUF_SIZE) - fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", - ch, ch); - unputBuffer[unputCount++] = ch; - } - } - - /* Get ready to lex from a new file. Kludge below sticks - an artificial newline at the front of the file, which the - above grammar ignores, but which makes ^ at start of pattern - match at the real start of the file. - */ - void yynewfile(f) - FILE *f; - { - lexFP = f; - StringToLex = NULL; - unputCount = 0; - unput('\n'); /* kludge */ - } - - /* Get ready to lex from a string. ^ at start of pattern WON'T - match at the start of the string! - */ - void yynewstr(s) - char *s; - { - lexFP = NULL; - StringToLex = s; - unputCount = 0; - } - #endif /*!FLEX_SCANNER*/ - - #ifdef FLEX_SCANNER - void my_yy_input(buf, result, max_size) - char *buf; - int *result; - int max_size; - { - int count; - - if (StringToLex != NULL) { - count = 0; - while (*StringToLex != NULLCHAR) { - *buf++ = *StringToLex++; - count++; - } - *result = count; - return; - } else { - count = fread(buf, 1, max_size, yyin); - if (count == 0) { - *result = YY_NULL; - } else { - *result = count; - } - return; - } - } - - static YY_BUFFER_STATE my_file_buffer = NULL; - - /* - Return offset of next pattern in the current file. - */ - int yyoffset() - { - int pos = yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf; - - return(ftell(YY_CURRENT_BUFFER->yy_input_file) - - yy_n_chars + pos); - } - - - void yynewstr(s) - char *s; - { - if (my_file_buffer != NULL) - yy_delete_buffer(my_file_buffer); - StringToLex = s; - my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE); - yy_switch_to_buffer(my_file_buffer); - } - - void yynewfile(f) - FILE *f; - { - if (my_file_buffer != NULL) - yy_delete_buffer(my_file_buffer); - StringToLex = NULL; - my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE); - yy_switch_to_buffer(my_file_buffer); - } - #endif /*FLEX_SCANNER*/ - - int yywrap() - { - return TRUE; - } - - /* Parse a move from the given string s */ - /* ^ at start of pattern WON'T work here unless using flex */ - ChessMove yylexstr(boardIndex, s) - int boardIndex; - char *s; - { - ChessMove ret; - char *oldStringToLex; - #ifdef FLEX_SCANNER - YY_BUFFER_STATE buffer, oldBuffer; - #endif - - yyboardindex = boardIndex; - oldStringToLex = StringToLex; - StringToLex = s; - #ifdef FLEX_SCANNER - buffer = yy_create_buffer(stdin, YY_BUF_SIZE); - oldBuffer = YY_CURRENT_BUFFER; - yy_switch_to_buffer(buffer); - #endif /*FLEX_SCANNER*/ - - ret = (ChessMove) yylex(); - - #ifdef FLEX_SCANNER - if (oldBuffer != NULL) - yy_switch_to_buffer(oldBuffer); - yy_delete_buffer(buffer); - #endif /*FLEX_SCANNER*/ - StringToLex = oldStringToLex; - - return ret; - } + %a 10000 + %o 10000 + %e 2000 + %k 2500 + %p 7000 + %n 1000 + %{ + /* + * parser.l -- lex parser of algebraic chess moves for XBoard + * $Id: parser.l,v 2.1 2003/10/27 19:21:00 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + + /* This parser handles all forms of promotion. + * The parser resolves ambiguous moves by searching and check-testing. + * It also parses comments of the form [anything] or (anything). + * + * [HGM] Parser extensively modified for bigger boards, Shogi-like syntax, + * and unknow pieces. All pieces are now mandatory upper case, but can be + * any letter A-Z. Files must be lower case (as before), but can run upto 'l'. + * Ranks can be 0-9. The parser returns 0 for off-board files and ranks. + * For an unknown piece (as mover or promotion piece) it returns + * IllegalMove, like it does when the piece doesn't match. + * Promotions can now also be appended Shogi-style, a bare '=' or '+', + * and this is then returned as promotion character. The piece indicator + * can be prefixed by a '+' to indicate it is a promoted piece. + */ + + #include "config.h" + + #define NO_CONSTRAINT -1 + #undef YYLMAX + #define YYLMAX 4096 + #define UNPUT_BUF_SIZE YYLMAX + + #ifdef FLEX_SCANNER + /* yytext is probably a char*, but could be a char[]. yy_text is set + in YY_DECL below, because if yytext is a char*, its value is not + constant. */ + char *yy_text; + #else /*!FLEX_SCANNER*/ + /* yytext is definitely a char[], so yy_text can be set here, statically. */ + char *yy_text = (char *) yytext; + #endif + + #ifdef FLEX_SCANNER + /* This is flex */ ++/* [AP] use prototypes in function declarations */ ++#define YY_USE_PROTOS ++ ++#ifdef YY_USE_PROTOS ++#define YY_PROTO(proto) proto ++#else ++#define YY_PROTO(proto) () ++#endif ++/* end of [AP] fix */ ++ + #undef YY_INPUT + #define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size) + #undef YY_DECL + #define YY_DECL \ + int _yylex YY_PROTO((void)); \ + int yylex YY_PROTO((void)) \ + { \ + int result = _yylex(); \ + yy_text = (char *) yytext; \ + return(result); \ + } \ + int _yylex YY_PROTO((void)) + #else + /* This is lex */ + #undef input + #undef output + #undef unput + #endif + + /* The includes must be here, below the #undef input */ + + #include + + #if STDC_HEADERS + # include + # include + #else /* not STDC_HEADERS */ + # if HAVE_STRING_H + # include + # else /* not HAVE_STRING_H */ + # include + # endif /* not HAVE_STRING_H */ + #endif /* not STDC_HEADERS */ + + #if HAVE_UNISTD_H + # include + #endif + + #if defined(_amigados) + # include + # if HAVE_FCNTL_H + # include /* isatty() prototype */ + # endif /* HAVE_FCNTL_H */ + #endif /* defined(_amigados) */ + + #include "common.h" + #include "backend.h" + #include "frontend.h" + #include "parser.h" + #include "moves.h" + + extern int PosFlags P((int)); + + extern Board boards[MAX_MOVES]; + int yyboardindex; + int yyskipmoves = FALSE; + char currentMoveString[YYLMAX]; + #ifndef FLEX_SCANNER + char unputBuffer[UNPUT_BUF_SIZE]; + int unputCount = 0; + #endif + + #ifdef FLEX_SCANNER + void my_yy_input P((char *buf, int *result, int max_size)); + #else /*!FLEX_SCANNER*/ + static int input P((void)); + static void output P((int ch)); + static void unput P((int ch)); + int yylook P((void)); + int yyback P((int *, int)); + #endif + #undef yywrap + int yywrap P((void)); + extern void CopyBoard P((Board to, Board from)); + + %} + %% + + "+"?[A-Z][/]?[a-l][0-9][xX:-]?[a-l][0-9]((=?\(?[A-Z]\)?)|=)? { + /* + * Fully-qualified algebraic move, possibly with promotion + */ + int skip1 = 0, skip2 = 0, skip3 = 0, promoted = 0; + ChessSquare piece; + ChessMove result; + char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (yytext[0] == '+') skip1 = skip3 = promoted = 1; /* [HGM] Shogi promoted */ + + /* remove the / */ + if (yytext[1+skip1] == '/') skip1++; + + /* remove the [xX:-] */ + if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') || + (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1; + + currentMoveString[0] = yytext[1+skip1]; + currentMoveString[1] = yytext[2+skip1]; + currentMoveString[2] = yytext[3+skip1+skip2]; + currentMoveString[3] = yytext[4+skip1+skip2]; + currentMoveString[4] = NULLCHAR; + + if (appData.debugMode) { + fprintf(debugFP, "Parser Qa1b2: yyleng=%d\n", + yyleng); + } + + if (yyleng-skip1-skip2 > 5) { char c; + if (yytext[yyleng-1] == ')') { + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; /* [HGM] promotion to invalid piece */ + } + + if (appData.debugMode) { + fprintf(debugFP, "parser: %s\n", currentMoveString); + } + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[1] - ONE >= BOARD_HEIGHT || + currentMoveString[1] - ONE < 0 || + currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + piece = boards[yyboardindex] + [currentMoveString[1] - ONE][currentMoveString[0] - AAA]; + if(promoted) piece = (ChessSquare) (DEMOTED piece); + c = PieceToChar(piece); + if(c == '~') c = PieceToChar((ChessSquare) (DEMOTED piece)); + if (ToLower(yytext[skip3]) != ToLower(c)) + return (int) IllegalMove; + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionKnight || result == BlackPromotionKnight || + result == WhitePromotionQueen || result == BlackPromotionQueen)) { + currentMoveString[4] = PieceToChar(BlackQueen); + currentMoveString[5] = NULLCHAR; + } + + return (int) result; + } + + [a-l][0-9][xX:-]?[a-l][0-9]((=?\(?[A-Za-z]\)?)|=)? { + /* + * Simple algebraic move, possibly with promotion + * [HGM] Engine moves are received in this format, with lower-case promoChar! + */ + int skip = 0; + ChessMove result; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the [xX:-] */ + if ((yytext[2] == 'x') || (yytext[2] == 'X') || + (yytext[2] == '-') || (yytext[2] == ':')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[1] = yytext[1]; + currentMoveString[2] = yytext[2+skip]; + currentMoveString[3] = yytext[3+skip]; + currentMoveString[4] = NULLCHAR; + + if (yyleng-skip > 4) { char c; + if (yytext[yyleng-1] == ')') { + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; + } + + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[1] - ONE >= BOARD_HEIGHT || + currentMoveString[1] - ONE < 0 || + currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionKnight || result == BlackPromotionKnight || + result == WhitePromotionQueen || result == BlackPromotionQueen)) { + if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) + currentMoveString[4] = PieceToChar(BlackFerz); + else if(gameInfo.variant == VariantGreat) + currentMoveString[4] = PieceToChar(BlackMan); + else + currentMoveString[4] = PieceToChar(BlackQueen); + currentMoveString[5] = NULLCHAR; + } + + return (int) result; + } + + [a-l][0-9]((=?\(?[A-Z]\)?)|=)? { + /* + * Pawn move, possibly with promotion + */ + DisambiguateClosure cl; + int skip = 0; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the =() */ + if (yytext[2] == '=' && yytext[3] != NULLCHAR) skip++; + if (yytext[2+skip] == '(') skip++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - AAA; + cl.rtIn = yytext[1] - ONE; + cl.ftIn = yytext[0] - AAA; + c = cl.promoCharIn = yytext[2+skip]; + + /* [HGM] do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ffIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) + return IllegalMove; + + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + + + (ab|bc|cd|de|ef|fg|gh|hi|ij|jk|kl|lk|kj|ji|ih|hg|gf|fe|ed|dc|cb|ba|aa|bb|cc|dd|ee|ff|gg|hh|ii|jj|kk|ll|([a-l][xX:-][a-l]))((=?\(?[A-Z]\)?)|ep|"e.p."|=)? { + /* + * Pawn capture, possibly with promotion, possibly ambiguous + */ + DisambiguateClosure cl; + int skip1 = 0, skip2 = 0; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] and =() */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1; + if (yytext[2+skip1] == '=' && yytext[3+skip1] != NULLCHAR) skip2++; + if (yytext[2+skip1+skip2] == '(') skip2++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - AAA; + cl.rtIn = -1; + cl.ftIn = yytext[1+skip1] - AAA; + c = cl.promoCharIn = yytext[2+skip1+skip2]; + + /* [HGM] do not allow values beyond board size */ + if(cl.ffIn >= BOARD_RGHT || + cl.ffIn < BOARD_LEFT || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) + return IllegalMove; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + + [a-l][xX:]?[a-l][0-9]((=?\(?[A-Z]\)?)|ep|"e.p."|=)? { + /* + * unambiguously abbreviated Pawn capture, possibly with promotion + */ + int skip = 0; + ChessMove result; char c; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[2] = yytext[1+skip]; + currentMoveString[3] = yytext[2+skip]; + + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[0] - AAA >= BOARD_RGHT || + currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[3] - ONE < 0 || + currentMoveString[2] - AAA >= BOARD_RGHT || + currentMoveString[0] - AAA < BOARD_LEFT || + currentMoveString[2] - AAA < BOARD_LEFT ) + return 0; + + if (gameInfo.variant == VariantXiangqi && /* [HGM] In Xiangqi rank stays same */ + currentMoveString[0] != currentMoveString[2] ) { + currentMoveString[1] = yytext[2+skip]; + } else + if (WhiteOnMove(yyboardindex)) { + if (yytext[2+skip] == ONE) return (int) ImpossibleMove; + currentMoveString[1] = yytext[2+skip] - 1; + } else { + currentMoveString[1] = currentMoveString[3] + 1; + if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove; + } + if (yyleng-skip > 3) { + if (yytext[yyleng-1] == ')') + c = currentMoveString[4] = ToLower(yytext[yyleng-2]); + else + c = currentMoveString[4] = ToLower(yytext[yyleng-1]); + currentMoveString[5] = NULLCHAR; + if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) + return IllegalMove; + } else { + currentMoveString[4] = NULLCHAR; + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionQueen || result == BlackPromotionQueen || + result == WhitePromotionKnight || result == BlackPromotionKnight)) { + currentMoveString[4] = PieceToChar(BlackQueen); + // [HGM] shatranj: take care of variants without Queen + if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) + currentMoveString[4] = PieceToChar(BlackFerz); + if(gameInfo.variant == VariantGreat) + currentMoveString[4] = PieceToChar(BlackMan); + currentMoveString[5] = NULLCHAR; + } + + if (result != IllegalMove) return (int) result; + + /* Special case: improperly written en passant capture */ + if (WhiteOnMove(yyboardindex)) { + if (currentMoveString[3] == '5') { + currentMoveString[1] = '5'; + currentMoveString[3] = '6'; + } else { + return (int) IllegalMove; + } + } else { + if (currentMoveString[3] == '4') { + currentMoveString[1] = '4'; + currentMoveString[3] = '3'; + } else { + return (int) IllegalMove; + } + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + initialRights, /* [HGM] assume all castlings allowed */ + currentMoveString[1] - ONE, + currentMoveString[0] - AAA, + currentMoveString[3] - ONE, + currentMoveString[2] - AAA, + currentMoveString[4]); + + if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant) + return (int) result; + else + return (int) IllegalMove; + } + + "+"?[A-Z][xX:-]?[a-l][0-9]=? { + /* + * piece move, possibly ambiguous + */ + DisambiguateClosure cl; + int skip = 0, skip2 = 0, promoted = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if(yytext[0] == '+') promoted = skip = skip2 = 1; + + /* remove the [xX:-] */ + if ((yytext[1+skip] == 'x') || (yytext[1+skip] == 'X') + || (yytext[1+skip] == ':') || (yytext[1+skip] == '-')) skip++; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); + } + if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); + + cl.rfIn = -1; + cl.ffIn = -1; + cl.rtIn = yytext[2+skip] - ONE; + cl.ftIn = yytext[1+skip] - AAA; + cl.promoCharIn = NULLCHAR; + + if(yyleng-skip > 3) /* [HGM] can have Shogi-style promotion */ + cl.promoCharIn = yytext[yyleng-1]; + + if (appData.debugMode) { + fprintf(debugFP, "Parser Qa1: yyleng=%d, %d(%d,%d)-(%d,%d) = %d (%c)\n", + yyleng, + cl.pieceIn,cl.ffIn,cl.rfIn,cl.ftIn,cl.rtIn,cl.promoCharIn,cl.promoCharIn?cl.promoCharIn:' '); + } + + /* [HGM] but do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + + "+"?[A-Z][a-l0-9][xX:-]?[a-l][0-9]=? { + /* + * piece move with rank or file disambiguator + */ + DisambiguateClosure cl; + int skip = 0, skip2 = 0; int promoted=0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if(yytext[0]=='+') promoted = skip = skip2 = 1; + + /* remove the [xX:-] */ + if ((yytext[2+skip] == 'x') || (yytext[2+skip] == 'X') + || (yytext[2+skip] == ':') || (yytext[2+skip] == '-')) skip++; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); + } + if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); + + if (isalpha(yytext[1+skip2])) { + cl.rfIn = -1; + cl.ffIn = yytext[1+skip2] - AAA; + + if(cl.ffIn >= BOARD_RGHT || + cl.ffIn < BOARD_LEFT ) return 0; + } else { + cl.rfIn = yytext[1+skip2] - ONE; + cl.ffIn = -1; + if(cl.rfIn >= BOARD_HEIGHT || + cl.rfIn < 0) return 0; + } + cl.rtIn = yytext[3+skip] - ONE; + cl.ftIn = yytext[2+skip] - AAA; + cl.promoCharIn = NULLCHAR; + + if(yyleng-skip > 4) /* [HGM] can have Shogi-style promotion */ + cl.promoCharIn = yytext[yyleng-1]; + + /* [HGM] do not allow values beyond board size */ + if(cl.rtIn >= BOARD_HEIGHT || + cl.rtIn < 0 || + cl.ftIn >= BOARD_RGHT || + cl.ftIn < BOARD_LEFT ) + return 0; + + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + AAA; + currentMoveString[1] = cl.rf + ONE; + currentMoveString[2] = cl.ft + AAA; + currentMoveString[3] = cl.rt + ONE; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; + } + + 000|0-0-0|ooo|OOO|o-o-o|O-O-O { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* [HGM] all squares referenced to board edges in stead of absolute */ + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { + /* ICS wild castling */ + rf = 0; + ff = (BOARD_WIDTH-1)>>1; + rt = 0; + ft = BOARD_RGHT-3; + } else { + rf = 0; + ff = BOARD_WIDTH>>1; + rt = 0; + ft = BOARD_LEFT+2; + } + } else{ + if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { + /* ICS wild castling */ + rf = BOARD_HEIGHT-1; + ff = (BOARD_WIDTH-1)>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_RGHT-3; + } else { + rf = BOARD_HEIGHT-1; + ff = BOARD_WIDTH>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_LEFT+2; + } + } + if(gameInfo.variant == VariantFischeRandom) { + if (WhiteOnMove(yyboardindex)) { + ff = initialRights[2]; + ft = initialRights[1]; + } else { + ff = initialRights[5]; + ft = initialRights[4]; + } + fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); + if(ff < 0 || ft < 0) return 0; + } + sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); + if (appData.debugMode) { + fprintf(debugFP, "long castling %d %d\n", ff, ft); + } + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + castlingRights[yyboardindex], /* [HGM] use true castling rights */ + rf, ff, rt, ft, NULLCHAR); + } + + 00|0-0|oo|OO|o-o|O-O { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { + /* ICS wild castling */ + rf = 0; + ff = (BOARD_WIDTH-1)>>1; + rt = 0; + ft = BOARD_LEFT+1; + } else { + rf = 0; + ff = BOARD_WIDTH>>1; + rt = 0; + ft = BOARD_RGHT-2; + } + } else { + if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { + /* ICS wild castling */ + rf = BOARD_HEIGHT-1; + ff = (BOARD_WIDTH-1)>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_LEFT+1; + } else { + rf = BOARD_HEIGHT-1; + ff = BOARD_WIDTH>>1; + rt = BOARD_HEIGHT-1; + ft = BOARD_RGHT-2; + } + } + if(gameInfo.variant == VariantFischeRandom) { + if (WhiteOnMove(yyboardindex)) { + ff = initialRights[2]; + ft = initialRights[0]; + } else { + ff = initialRights[5]; + ft = initialRights[3]; + } + if (appData.debugMode) { + fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft); + } + if(ff < 0 || ft < 0) return 0; + } + sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); + if (appData.debugMode) { + fprintf(debugFP, "short castling %d %d\n", ff, ft); + } + + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + castlingRights[yyboardindex], /* [HGM] use true castling rights */ + rf, ff, rt, ft, NULLCHAR); + } + + [A-Z][@*][a-l][0-9] { + /* Bughouse piece drop. No legality checking for now. */ + currentMoveString[1] = '@'; + currentMoveString[2] = yytext[2]; + currentMoveString[3] = yytext[3]; + currentMoveString[4] = NULLCHAR; + + if (appData.debugMode) { + fprintf(debugFP, "Drop: %s\n", currentMoveString); + } + /* [HGM] do not allow values beyond board size */ + if(currentMoveString[3] - ONE >= BOARD_HEIGHT || + currentMoveString[2] - AAA >= BOARD_WIDTH ) + return 0; + + if (WhiteOnMove(yyboardindex)) { + currentMoveString[0] = ToUpper(yytext[0]); + return (int) WhiteDrop; + } else { + currentMoveString[0] = ToLower(yytext[0]); + return (int) BlackDrop; + } + } + + [Rr]esign(s|ed)? { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + + (([Ww](hite)?)|([Bb](lack)?))" "(([Rr]esign)|([Ff]orfeit))(s|ed)? { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); + } + + (([Ww](hite)?)|([Bb](lack)?))" "[Dd]isconnect(s|ed) { + return (int) GameUnfinished; + } + + [Ss]talemate { + return (int) GameIsDrawn; + } + + "+-+" { + return (int) GameIsDrawn; + } + + ([Cc]heck)?[Mm]ate { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + + "++" { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; + } + + [Dd]raw(n)?(" "by)?(" "[Rr]epetition)|(" "[Aa]gree(d|ment)) { + return (int) GameIsDrawn; + } + + [Dd]raw(n)?(" (".*")")? { + return (int) GameIsDrawn; + } + + (([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ww][io]n(s)?.*) { + return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins); + } + + (([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ll]os[tes]+.*) { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); + } + + ("{"[^\}\n]*"} ")?(1-0|"1 - 0"|"1/0"|"1 / 0"|"1:0"|"1 : 0")(" (".*")"|" {".*"}")? { + return (int) WhiteWins; + } + + ("{"[^\}\n]*"} ")?(0-1|"0 - 1"|"0/1"|"0 / 1"|"0:1"|"0 : 1")(" (".*")"|" {".*"}")? { + return (int) BlackWins; + } + + ("{"[^\}\n]*"} ")?("1/2"|"1 / 2")(" "?[-:]" "?("1/2"|"1 / 2"))?(" (".*")"|" {".*"}")? { + return (int) GameIsDrawn; + } + + ("{"[^\}\n]*"} ")?"*"(" (".*")"|" {".*"}")? { + return (int) GameUnfinished; + } + + [1-9][0-9]*/"."?[ \t\n]*[a-lNnPpRrBQqKACFEWDGHOo] { + /* move numbers */ + if ((yyleng == 1) && (yytext[0] == '1')) + return (int) MoveNumberOne; + } + + \([0-9]+:[0-9][0-9](\.[0-9]+)?\)|\{[0-9]+:[0-9][0-9](\.[0-9]+)?\} { + /* elapsed time indication, e.g. (0:12) or {10:21.071} */ + return (int) ElapsedTime; + } + + "[--"[^\]]*"--]" { + /* position diagram enclosed in [-- --] */ + return (int) PositionDiagram; + } + + ^"{--------------"\n[^\}]*\n"--------------}"$ { + /* position diagram enclosed in {-- --} */ + return (int) PositionDiagram; + } + + \[[ \t\n]*[A-Za-z0-9][A-Za-z0-9_+#=-]*[ \t\n]*\"[^"]*\"[ \t\n]*\] { + return (int) PGNTag; + } + + [Gg](nu|NU)" "?[Cc](hess|HESS).*[Gg](ame|AME) { + return (int) GNUChessGame; + } + + ^[#;%]" "[^ ]*(" game file"|" position file").*$ { + return (int) XBoardGame; + } + + \$[0-9]+ { /* numeric annotation glyph */ + return (int) NAG; + } + + \{[^\}]*\} { /* anything in {} */ + return (int) Comment; + } + + ;.*$ { /* ; to end of line */ + return (int) Comment; + } + + \[[^\]]*\] { /* anything in [] */ + return (int) Comment; + } + + \([^()]*(\([^()]*\)[^()]*)+[^()]*\) { /* nested () */ + return (int) Comment; + } + + \([^)][^)]+\) { /* >=2 chars in () */ + return (int) Comment; + } + + ^[-a-zA-Z0-9]+:" ".*(\n[ \t]+.*)* { + /* Skip mail headers */ + } + + [a-zA-Z0-9'-]+ { + /* Skip random words */ + } + + .|\n { + /* Skip everything else */ + } + + %% + + + static char *StringToLex; + + #ifndef FLEX_SCANNER + static FILE *lexFP; + + static int input() + { + int ret; + + if (StringToLex != NULL) { + ret = *StringToLex; + if (ret == NULLCHAR) + ret = EOF; + else + StringToLex++; + } else if (unputCount > 0) { + ret = unputBuffer[--unputCount]; + } else { + ret = fgetc(lexFP); + } + + if (ret == EOF) + return 0; + else + return ret; + } + + /* + * Return offset of next pattern within current file + */ + int yyoffset() + { + int offset = ftell(lexFP) - unputCount; + + if (offset < 0) { + offset = 0; + } + return(offset); + } + + static void output(ch) + int ch; + { + fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", + ch, ch); + } + + static void unput(ch) + int ch; + { + if (ch == 0) return; + if (StringToLex != NULL) { + StringToLex--; + } else { + if (unputCount >= UNPUT_BUF_SIZE) + fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", + ch, ch); + unputBuffer[unputCount++] = ch; + } + } + + /* Get ready to lex from a new file. Kludge below sticks + an artificial newline at the front of the file, which the + above grammar ignores, but which makes ^ at start of pattern + match at the real start of the file. + */ + void yynewfile(f) + FILE *f; + { + lexFP = f; + StringToLex = NULL; + unputCount = 0; + unput('\n'); /* kludge */ + } + + /* Get ready to lex from a string. ^ at start of pattern WON'T + match at the start of the string! + */ + void yynewstr(s) + char *s; + { + lexFP = NULL; + StringToLex = s; + unputCount = 0; + } + #endif /*!FLEX_SCANNER*/ + + #ifdef FLEX_SCANNER + void my_yy_input(buf, result, max_size) + char *buf; + int *result; + int max_size; + { + int count; + + if (StringToLex != NULL) { + count = 0; + while (*StringToLex != NULLCHAR) { + *buf++ = *StringToLex++; + count++; + } + *result = count; + return; + } else { + count = fread(buf, 1, max_size, yyin); + if (count == 0) { + *result = YY_NULL; + } else { + *result = count; + } + return; + } + } + + static YY_BUFFER_STATE my_file_buffer = NULL; + + /* + Return offset of next pattern in the current file. + */ + int yyoffset() + { - int pos = yy_c_buf_p - yy_current_buffer->yy_ch_buf; ++ int pos = yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf; + - return(ftell(yy_current_buffer->yy_input_file) - ++ return(ftell(YY_CURRENT_BUFFER->yy_input_file) - + yy_n_chars + pos); + } + + + void yynewstr(s) + char *s; + { + if (my_file_buffer != NULL) + yy_delete_buffer(my_file_buffer); + StringToLex = s; + my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE); + yy_switch_to_buffer(my_file_buffer); + } + + void yynewfile(f) + FILE *f; + { + if (my_file_buffer != NULL) + yy_delete_buffer(my_file_buffer); + StringToLex = NULL; + my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE); + yy_switch_to_buffer(my_file_buffer); + } + #endif /*FLEX_SCANNER*/ + + int yywrap() + { + return TRUE; + } + + /* Parse a move from the given string s */ + /* ^ at start of pattern WON'T work here unless using flex */ + ChessMove yylexstr(boardIndex, s) + int boardIndex; + char *s; + { + ChessMove ret; + char *oldStringToLex; + #ifdef FLEX_SCANNER + YY_BUFFER_STATE buffer, oldBuffer; + #endif + + yyboardindex = boardIndex; + oldStringToLex = StringToLex; + StringToLex = s; + #ifdef FLEX_SCANNER + buffer = yy_create_buffer(stdin, YY_BUF_SIZE); + oldBuffer = YY_CURRENT_BUFFER; + yy_switch_to_buffer(buffer); + #endif /*FLEX_SCANNER*/ + + ret = (ChessMove) yylex(); + + #ifdef FLEX_SCANNER + if (oldBuffer != NULL) + yy_switch_to_buffer(oldBuffer); + yy_delete_buffer(buffer); + #endif /*FLEX_SCANNER*/ + StringToLex = oldStringToLex; + + return ret; + } diff --cc winboard/config.h index 0c8f231,32aceb1..980e948 --- a/winboard/config.h +++ b/winboard/config.h @@@ -35,7 -36,7 +36,7 @@@ #define LAST_PTY_LETTER 'q' - #define PATCHLEVEL "8pre" -#define PATCHLEVEL "15k" ++#define PATCHLEVEL "0e" #define PRODUCT "WinBoard" @@@ -53,7 -54,7 +54,7 @@@ #define USE_PTYS 0 - #define VERSION "4.2" -#define VERSION "4.3" ++#define VERSION "4.4" /*#undef X_WCHAR*/ diff --cc winboard/defaults.h index 8a8d9df,bbc81cd..cbe1fe9 --- a/winboard/defaults.h +++ b/winboard/defaults.h @@@ -239,11 -241,11 +242,13 @@@ Pl&ay (name),play,1,1\n " #define FCP_NAMES "\ ++fmax /fd=Fairy-Max\n\ GNUChess\n\ \"GNUChes5 xboard\"\n\ " #define SCP_NAMES "\ ++fmax /sd=Fairy-Max\n\ GNUChess\n\ \"GNUChes5 xboard\"\n\ " diff --cc winboard/parser.c index 0000000,0000000..ff36db3 new file mode 100644 --- /dev/null +++ b/winboard/parser.c @@@ -1,0 -1,0 +1,4066 @@@ ++/* A lexical scanner generated by flex */ ++ ++/* Scanner skeleton version: ++ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ ++ */ ++ ++#define FLEX_SCANNER ++#define YY_FLEX_MAJOR_VERSION 2 ++#define YY_FLEX_MINOR_VERSION 5 ++ ++#include ++#include ++ ++/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ ++#ifdef c_plusplus ++#ifndef __cplusplus ++#define __cplusplus ++#endif ++#endif ++ ++ ++#ifdef __cplusplus ++ ++#include ++#ifndef _WIN32 ++#include ++#endif ++ ++/* Use prototypes in function declarations. */ ++#define YY_USE_PROTOS ++ ++/* The "const" storage-class-modifier is valid. */ ++#define YY_USE_CONST ++ ++#else /* ! __cplusplus */ ++ ++#if __STDC__ ++ ++#define YY_USE_PROTOS ++#define YY_USE_CONST ++ ++#endif /* __STDC__ */ ++#endif /* ! __cplusplus */ ++ ++#ifdef __TURBOC__ ++ #pragma warn -rch ++ #pragma warn -use ++#include ++#include ++#define YY_USE_CONST ++#define YY_USE_PROTOS ++#endif ++ ++#ifdef YY_USE_CONST ++#define yyconst const ++#else ++#define yyconst ++#endif ++ ++ ++#ifdef YY_USE_PROTOS ++#define YY_PROTO(proto) proto ++#else ++#define YY_PROTO(proto) () ++#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. */ ++#define YY_BUF_SIZE 16384 ++ ++typedef struct yy_buffer_state *YY_BUFFER_STATE; ++ ++extern int yyleng; ++extern FILE *yyin, *yyout; ++ ++#define EOB_ACT_CONTINUE_SCAN 0 ++#define EOB_ACT_END_OF_FILE 1 ++#define EOB_ACT_LAST_MATCH 2 ++ ++/* The funky do-while in the following #define is used to turn the definition ++ * int a single C statement (which needs a semi-colon terminator). This ++ * avoids problems with code like: ++ * ++ * if ( condition_holds ) ++ * yyless( 5 ); ++ * else ++ * do_something_else(); ++ * ++ * Prior to using the do-while the compiler would get upset at the ++ * "else" because it interpreted the "if" statement as being all ++ * done when it reached the ';' after the yyless() call. ++ */ ++ ++/* Return all but the first 'n' matched characters back to the input stream. */ ++ ++#define yyless(n) \ ++ do \ ++ { \ ++ /* Undo effects of setting up yytext. */ \ ++ *yy_cp = yy_hold_char; \ ++ YY_RESTORE_YY_MORE_OFFSET \ ++ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ ++ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ ++ } \ ++ while ( 0 ) ++ ++#define unput(c) yyunput( c, yytext_ptr ) ++ ++/* The following is because we cannot portably get our hands on size_t ++ * (without autoconf's help, which isn't available because we want ++ * flex-generated scanners to compile on their own). ++ */ ++typedef unsigned int yy_size_t; ++ ++ ++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. ++ */ ++ int 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; ++ ++ /* 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 ++ }; ++ ++static YY_BUFFER_STATE yy_current_buffer = 0; ++ ++/* 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". ++ */ ++#define YY_CURRENT_BUFFER yy_current_buffer ++ ++ ++/* yy_hold_char holds the character lost when yytext is formed. */ ++static char yy_hold_char; ++ ++static int yy_n_chars; /* number of characters read into yy_ch_buf */ ++ ++ ++int yyleng; ++ ++/* Points to current character in buffer. */ ++static char *yy_c_buf_p = (char *) 0; ++static int yy_init = 1; /* 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 YY_PROTO(( FILE *input_file )); ++ ++void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); ++void yy_load_buffer_state YY_PROTO(( void )); ++YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); ++void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); ++void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); ++void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); ++#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) ++ ++YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); ++YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); ++YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); ++ ++static void *yy_flex_alloc YY_PROTO(( yy_size_t )); ++static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); ++static void yy_flex_free YY_PROTO(( void * )); ++ ++#define yy_new_buffer yy_create_buffer ++ ++#define yy_set_interactive(is_interactive) \ ++ { \ ++ if ( ! yy_current_buffer ) \ ++ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ ++ yy_current_buffer->yy_is_interactive = is_interactive; \ ++ } ++ ++#define yy_set_bol(at_bol) \ ++ { \ ++ if ( ! yy_current_buffer ) \ ++ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ ++ yy_current_buffer->yy_at_bol = at_bol; \ ++ } ++ ++#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) ++ ++ ++#define YY_USES_REJECT ++typedef unsigned char YY_CHAR; ++FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; ++typedef int yy_state_type; ++extern char *yytext; ++#define yytext_ptr yytext ++ ++static yy_state_type yy_get_previous_state YY_PROTO(( void )); ++static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); ++static int yy_get_next_buffer YY_PROTO(( void )); ++static void yy_fatal_error YY_PROTO(( 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 = (int) (yy_cp - yy_bp); \ ++ yy_hold_char = *yy_cp; \ ++ *yy_cp = '\0'; \ ++ yy_c_buf_p = yy_cp; ++ ++#define YY_NUM_RULES 42 ++#define YY_END_OF_BUFFER 43 ++static yyconst short int yy_acclist[650] = ++ { 0, ++ 43, 41, 42, 41, 42, 41, 42, 40, 41, 42, ++ 41, 42, 25, 41, 42, 41, 42, 40, 41, 42, ++ 40, 41, 42,16410, 40, 41, 42,16410, 41, 42, ++ 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, ++ 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 40, 41, 42, 41, 42, 40, 41, 42, 40, 41, ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, ++ 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, ++ ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 40, 41, 42, 40, 41, 42, 41, 42, 41, 42, ++ 40, 41, 42, 40, 41, 42, 40, 41, 42,16410, ++ 40, 41, 42,16410, 41, 42, 40, 41, 42, 40, ++ 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, ++ 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 40, 41, 42, 40, 41, 42, 40, 41, 42, 40, ++ ++ 41, 42, 40, 41, 42, 40, 41, 42, 40, 41, ++ 42, 40, 41, 42, 40, 41, 42, 40, 41, 42, ++ 41, 42, 33, 40, 17, 40, 9, 40, 40, 40, ++ 16410, 8218, 40, 35, 40, 40, 40, 40, 40, 40, ++ 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, ++ 40, 40, 36, 40, 3, 40, 40, 4, 40, 40, ++ 40, 40, 40, 40, 9, 40, 40, 40, 34, 40, ++ 40, 9, 40, 40, 40,16410, 8218, 40, 40, 40, ++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 9, ++ 40, 40, 40, 40, 40, 40, 40, 3, 40, 40, ++ ++ 4, 40, 40, 40, 40, 40, 40, 9, 40, 40, ++ 40, 15, 9, 40, 23, 40, 23, 8, 40, 8218, ++ 22, 40, 22, 24, 40, 40, 40, 6, 40, 40, ++ 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, ++ 20, 40, 4, 40, 40, 3, 3, 40, 3, 40, ++ 40, 4, 5, 40, 4, 4, 40, 40, 40, 40, ++ 9, 40, 40, 34, 39, 9, 40, 23, 40, 8, ++ 40, 22, 40, 35, 40, 40, 40, 6, 40, 40, ++ 40, 40, 40, 40, 40, 9, 40, 40, 40, 40, ++ 20, 40, 4, 40, 40, 3, 40, 3, 40, 40, ++ ++ 5, 40, 4, 40, 40, 40, 40, 9, 40, 40, ++ 38, 38, 37, 25, 25, 6, 40, 10, 6, 40, ++ 7, 40, 6, 40, 6, 40, 40, 40, 19, 40, ++ 40, 21, 40, 16, 40, 40, 40, 40, 40, 20, ++ 20, 40, 20, 40, 36, 3, 3, 2, 40, 5, ++ 4, 5, 5, 40, 40, 4, 4, 40, 40, 25, ++ 39, 40, 6, 40, 7, 40, 40, 40, 40, 40, ++ 19, 40, 40, 21, 40, 16, 40, 40, 40, 40, ++ 40, 20, 40, 20, 20, 40, 2, 40, 5, 40, ++ 40, 4, 40, 40, 7, 7, 1, 40, 40, 40, ++ ++ 19, 40, 40, 40, 21, 21, 40, 21, 40, 40, ++ 40, 40, 30, 36, 2, 2, 2, 40, 5, 5, ++ 5, 40, 39, 1, 40, 40, 40, 19, 40, 40, ++ 40, 21, 40, 21, 21, 40, 40, 40, 40, 20, ++ 39, 2, 40, 5, 40, 27, 38, 1, 23, 23, ++ 22, 22, 24, 24, 1, 1, 40, 20, 21, 40, ++ 40, 40, 11, 40, 40, 28, 36, 30, 2, 2, ++ 27, 34, 39, 39, 1, 40, 40, 40, 40, 21, ++ 39, 11, 40, 40, 20, 39, 18, 1, 24, 1, ++ 20, 21, 19, 40, 40, 40, 11, 40, 40, 40, ++ ++ 40, 21, 39, 40, 11, 40, 40, 12, 40, 40, ++ 40, 40, 12, 40, 40, 14, 40, 40, 40, 14, ++ 40, 40, 40, 39, 40, 40, 40, 40, 39, 39, ++ 40, 40, 31, 40, 39, 39, 31, 40, 13, 31, ++ 32, 32, 35, 39, 39, 31, 39, 34, 29 ++ } ; ++ ++static yyconst short int yy_accept[698] = ++ { 0, ++ 1, 1, 1, 2, 4, 6, 8, 11, 13, 16, ++ 18, 21, 25, 29, 31, 34, 37, 40, 43, 46, ++ 49, 52, 55, 58, 61, 64, 66, 69, 72, 75, ++ 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, ++ 108, 111, 114, 117, 119, 121, 124, 127, 131, 135, ++ 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, ++ 167, 170, 173, 176, 179, 182, 185, 188, 191, 194, ++ 197, 200, 203, 206, 209, 212, 215, 218, 221, 223, ++ 223, 224, 225, 225, 225, 225, 225, 226, 226, 226, ++ 226, 227, 227, 229, 229, 229, 229, 230, 230, 230, ++ ++ 232, 232, 234, 234, 235, 235, 236, 236, 237, 237, ++ 238, 238, 239, 240, 241, 242, 243, 244, 245, 246, ++ 248, 249, 250, 251, 252, 253, 253, 253, 253, 253, ++ 254, 255, 257, 257, 258, 260, 261, 262, 263, 264, ++ 265, 267, 268, 269, 269, 269, 269, 270, 270, 271, ++ 271, 272, 274, 274, 275, 277, 277, 279, 279, 280, ++ 281, 281, 282, 283, 284, 285, 286, 287, 288, 289, ++ 290, 292, 293, 294, 295, 296, 297, 298, 300, 300, ++ 301, 303, 304, 305, 306, 307, 308, 310, 311, 312, ++ 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, ++ ++ 312, 313, 313, 313, 313, 313, 313, 315, 317, 318, ++ 320, 321, 321, 321, 321, 323, 324, 325, 325, 326, ++ 326, 327, 327, 328, 328, 330, 330, 330, 330, 330, ++ 331, 332, 333, 334, 335, 336, 338, 339, 340, 341, ++ 343, 343, 343, 343, 343, 345, 345, 346, 346, 347, ++ 349, 351, 352, 353, 353, 355, 356, 358, 359, 360, ++ 361, 363, 364, 365, 365, 365, 365, 365, 366, 368, ++ 370, 372, 374, 374, 375, 375, 376, 377, 377, 378, ++ 380, 381, 382, 383, 384, 385, 386, 388, 389, 390, ++ 391, 393, 395, 396, 396, 398, 400, 401, 403, 405, ++ ++ 406, 407, 408, 410, 411, 411, 411, 412, 413, 413, ++ 413, 414, 414, 414, 415, 415, 416, 416, 417, 417, ++ 417, 417, 418, 418, 418, 418, 418, 418, 418, 418, ++ 419, 421, 421, 423, 424, 425, 425, 426, 427, 427, ++ 427, 427, 427, 428, 429, 431, 431, 432, 434, 436, ++ 437, 438, 439, 440, 441, 443, 445, 445, 445, 445, ++ 445, 446, 447, 447, 448, 450, 451, 452, 452, 452, ++ 453, 455, 456, 457, 457, 459, 460, 460, 461, 461, ++ 461, 461, 461, 462, 462, 463, 463, 463, 465, 467, ++ 468, 468, 469, 470, 471, 473, 474, 476, 478, 479, ++ ++ 480, 481, 482, 484, 485, 487, 489, 491, 492, 494, ++ 495, 495, 495, 495, 495, 496, 496, 496, 496, 496, ++ 496, 496, 496, 496, 496, 497, 499, 499, 499, 499, ++ 499, 500, 501, 501, 503, 503, 504, 505, 506, 508, ++ 510, 511, 512, 513, 513, 513, 515, 515, 515, 516, ++ 516, 517, 519, 520, 520, 521, 521, 523, 523, 523, ++ 523, 523, 523, 523, 523, 524, 524, 524, 526, 527, ++ 528, 530, 531, 532, 534, 535, 537, 538, 539, 540, ++ 542, 544, 546, 546, 546, 548, 548, 549, 549, 550, ++ 550, 551, 551, 552, 552, 553, 553, 554, 554, 555, ++ ++ 555, 555, 555, 556, 558, 558, 558, 560, 560, 561, ++ 561, 561, 561, 561, 561, 562, 563, 565, 566, 568, ++ 568, 569, 570, 571, 571, 571, 573, 573, 573, 574, ++ 575, 575, 575, 577, 578, 579, 580, 582, 584, 585, ++ 587, 587, 588, 588, 588, 589, 589, 590, 591, 591, ++ 591, 591, 593, 593, 593, 594, 594, 594, 594, 594, ++ 595, 596, 597, 599, 600, 600, 600, 600, 600, 600, ++ 601, 602, 604, 605, 607, 608, 608, 608, 608, 608, ++ 608, 608, 609, 609, 609, 609, 609, 610, 611, 611, ++ 611, 611, 611, 612, 613, 613, 613, 613, 613, 614, ++ ++ 614, 614, 614, 615, 616, 618, 618, 618, 618, 618, ++ 619, 619, 620, 622, 622, 622, 622, 622, 623, 624, ++ 624, 624, 624, 624, 625, 626, 627, 627, 627, 627, ++ 627, 627, 628, 629, 629, 629, 629, 629, 630, 631, ++ 632, 633, 633, 633, 633, 633, 633, 635, 635, 635, ++ 635, 635, 636, 637, 639, 639, 639, 640, 640, 641, ++ 641, 642, 642, 642, 644, 644, 645, 646, 646, 646, ++ 646, 646, 648, 648, 648, 648, 648, 648, 648, 648, ++ 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, ++ 648, 648, 648, 648, 649, 650, 650 ++ ++ } ; ++ ++static yyconst int yy_ec[256] = ++ { 0, ++ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, ++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ++ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ++ 1, 4, 1, 5, 6, 7, 8, 1, 9, 10, ++ 11, 12, 13, 1, 14, 15, 16, 17, 18, 19, ++ 20, 20, 20, 20, 20, 20, 20, 21, 22, 1, ++ 23, 1, 1, 24, 25, 26, 27, 28, 29, 30, ++ 31, 32, 33, 33, 34, 35, 36, 37, 38, 34, ++ 34, 39, 40, 33, 41, 33, 42, 43, 33, 33, ++ 44, 1, 45, 1, 46, 1, 47, 48, 49, 50, ++ ++ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, ++ 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, ++ 71, 68, 72, 1, 73, 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 yyconst int yy_meta[74] = ++ { 0, ++ 1, 2, 3, 2, 1, 1, 1, 1, 4, 5, ++ 6, 1, 7, 8, 1, 1, 9, 9, 9, 9, ++ 10, 1, 11, 1, 12, 12, 12, 12, 12, 12, ++ 12, 12, 13, 12, 13, 13, 12, 12, 12, 13, ++ 13, 12, 14, 1, 1, 1, 15, 15, 15, 15, ++ 16, 15, 15, 15, 15, 15, 15, 15, 17, 18, ++ 18, 18, 18, 18, 17, 17, 17, 17, 17, 19, ++ 17, 1, 1 ++ } ; ++ ++static yyconst short int yy_base[784] = ++ { 0, ++ 0, 73, 2729, 4517, 122, 131, 0, 142, 2724, 140, ++ 151, 171, 162, 2724, 231, 159, 2672, 2661, 119, 2660, ++ 2673, 143, 2668, 2652, 211, 301, 361, 212, 209, 279, ++ 243, 284, 301, 286, 221, 303, 309, 329, 2670, 239, ++ 2665, 2649, 338, 403, 2710, 149, 380, 475, 348, 190, ++ 538, 240, 2659, 2648, 236, 2650, 2663, 157, 2658, 2642, ++ 379, 600, 314, 353, 377, 395, 401, 413, 382, 408, ++ 513, 424, 516, 423, 562, 448, 544, 607, 612, 2654, ++ 468, 0, 2696, 309, 617, 174, 4517, 2692, 672, 246, ++ 353, 2686, 2686, 2680, 517, 661, 2680, 576, 280, 655, ++ ++ 2679, 0, 2692, 4517, 0, 696, 0, 741, 0, 580, ++ 644, 586, 622, 2645, 2640, 2592, 2592, 692, 2617, 2616, ++ 714, 2606, 680, 720, 2592, 2606, 811, 537, 884, 4517, ++ 911, 961, 0, 986, 1035, 687, 753, 757, 2584, 2588, ++ 2587, 2582, 2591, 318, 2568, 825, 2636, 2635, 430, 2634, ++ 747, 820, 253, 830, 1085, 160, 563, 455, 1148, 1193, ++ 2633, 784, 843, 850, 760, 603, 692, 844, 854, 2596, ++ 657, 858, 893, 862, 893, 658, 1217, 1267, 2629, 1292, ++ 1342, 913, 926, 1157, 831, 894, 915, 918, 895, 845, ++ 2568, 464, 487, 538, 2620, 556, 1162, 1073, 2619, 2556, ++ ++ 4517, 1146, 1209, 2624, 2623, 2622, 2611, 2620, 2619, 0, ++ 4517, 2618, 2616, 2615, 2614, 2613, 384, 1029, 1062, 1078, ++ 1367, 1147, 1145, 1167, 1412, 2558, 2551, 2564, 2559, 1240, ++ 1422, 2540, 756, 651, 2557, 2593, 2551, 2547, 1214, 1482, ++ 722, 1208, 761, 1555, 1619, 0, 1624, 0, 2594, 2592, ++ 2591, 1174, 1426, 1490, 1673, 2591, 2589, 560, 2550, 2549, ++ 2583, 2530, 4517, 1499, 1039, 2591, 725, 2587, 928, 845, ++ 592, 917, 642, 2585, 1156, 1503, 1716, 2584, 1516, 1761, ++ 1531, 1564, 1470, 1565, 1464, 1429, 1580, 1490, 1566, 1598, ++ 1831, 1896, 1901, 2583, 1582, 2573, 1613, 1950, 1587, 1676, ++ ++ 1588, 1614, 1581, 1149, 1539, 2528, 4517, 775, 799, 2562, ++ 4517, 1709, 2557, 2556, 2493, 2492, 1202, 1709, 2546, 2545, ++ 2544, 2544, 615, 2543, 744, 2542, 1099, 1674, 832, 4517, ++ 2535, 1719, 2534, 2533, 1955, 1622, 4517, 1410, 2490, 2490, ++ 2487, 2487, 2494, 2493, 778, 892, 920, 2013, 0, 2511, ++ 2495, 2496, 2495, 0, 2086, 2159, 940, 1210, 1233, 1309, ++ 2540, 2533, 1434, 4517, 1776, 1424, 2529, 910, 1615, 1616, ++ 2528, 1173, 4517, 2476, 0, 2476, 1842, 2532, 1727, 1735, ++ 2488, 2473, 2530, 1003, 1736, 904, 599, 1216, 1523, 2186, ++ 2528, 1847, 1726, 1767, 1880, 1771, 2244, 1522, 1813, 1849, ++ ++ 1848, 1862, 2317, 2527, 2390, 2029, 1869, 1879, 1713, 2021, ++ 1747, 2479, 2517, 1595, 2500, 1809, 2511, 2443, 2504, 2441, ++ 2500, 2433, 2460, 1869, 4517, 2454, 2427, 2423, 2423, 2418, ++ 2468, 1049, 2006, 2467, 1075, 2440, 2410, 0, 2497, 2570, ++ 2400, 2394, 2448, 1341, 1756, 4517, 2446, 1803, 1343, 1491, ++ 1768, 2439, 2438, 1416, 4517, 2386, 0, 2425, 1871, 2421, ++ 1240, 2416, 2373, 2366, 1454, 1718, 1473, 2635, 1888, 2044, ++ 1889, 2042, 2023, 2678, 2425, 1990, 1886, 2052, 2063, 2425, ++ 1870, 1899, 1958, 1000, 4517, 2095, 1777, 2416, 2415, 2351, ++ 2350, 2411, 2410, 2347, 2346, 2407, 2406, 2343, 2342, 2393, ++ ++ 2388, 1840, 2017, 2382, 2320, 2326, 2011, 2298, 2303, 2338, ++ 2296, 2275, 2316, 2293, 2302, 2270, 2018, 2264, 4517, 2117, ++ 4517, 2296, 4517, 2290, 2119, 2300, 2251, 2231, 2282, 1960, ++ 1445, 289, 2107, 2108, 2114, 2068, 2281, 2125, 2131, 2280, ++ 2139, 4517, 2227, 2176, 2262, 2267, 2258, 4517, 2187, 2173, ++ 2177, 4517, 2166, 2214, 2211, 2157, 2198, 2148, 2103, 2111, ++ 2085, 2098, 0, 2077, 2196, 2071, 2002, 827, 1575, 2168, ++ 2135, 2063, 2170, 2136, 2164, 2203, 2000, 2014, 1683, 1939, ++ 1931, 2030, 1944, 1630, 1954, 1906, 2751, 1919, 1917, 1913, ++ 1385, 1565, 2824, 2249, 2204, 1850, 1863, 1832, 4517, 1806, ++ ++ 1637, 1912, 2897, 1920, 0, 1775, 1762, 1585, 945, 2970, ++ 2096, 1949, 2188, 2207, 1772, 1743, 2250, 1745, 1677, 1563, ++ 1551, 1686, 681, 2260, 1568, 1502, 2258, 1408, 1406, 2243, ++ 2170, 1358, 1313, 1240, 1258, 1751, 1127, 2261, 2312, 1072, ++ 926, 2279, 2133, 809, 1969, 2073, 0, 855, 705, 711, ++ 1429, 2317, 2305, 0, 2284, 631, 4517, 546, 2094, 480, ++ 4517, 413, 392, 4517, 1794, 2351, 2357, 2298, 325, 206, ++ 1884, 2303, 2352, 203, 1915, 365, 2138, 2221, 2364, 2365, ++ 2369, 2370, 2371, 2372, 2373, 2427, 2444, 2451, 2452, 2453, ++ 2454, 2456, 2296, 179, 4517, 4517, 3040, 3059, 3072, 3086, ++ ++ 3105, 3124, 3140, 3159, 3178, 3196, 1267, 1342, 1671, 3214, ++ 3233, 1702, 3252, 3271, 3290, 3309, 3328, 3347, 3366, 3385, ++ 3404, 3416, 3435, 3454, 3473, 3492, 3511, 3519, 1896, 3529, ++ 3545, 3564, 3580, 3599, 3618, 3637, 3656, 3675, 3694, 3713, ++ 3732, 3744, 3763, 3782, 3801, 3820, 3839, 3858, 3877, 3893, ++ 3908, 3924, 3943, 3962, 3981, 3997, 4016, 4035, 4054, 4073, ++ 4092, 4111, 4130, 4149, 4168, 4187, 4206, 4225, 4244, 4259, ++ 4278, 4297, 4316, 4331, 4345, 4364, 4383, 4402, 4421, 4440, ++ 4459, 4478, 4497 ++ } ; ++ ++static yyconst short int yy_def[784] = ++ { 0, ++ 696, 696, 696, 696, 696, 696, 697, 698, 696, 699, ++ 697, 696, 12, 700, 697, 15, 15, 15, 15, 15, ++ 15, 15, 15, 15, 15, 701, 697, 27, 27, 27, ++ 27, 27, 27, 27, 27, 27, 27, 27, 697, 697, ++ 697, 697, 697, 702, 696, 703, 703, 696, 48, 700, ++ 703, 51, 51, 51, 51, 51, 51, 51, 51, 51, ++ 51, 703, 62, 62, 62, 62, 62, 62, 62, 62, ++ 62, 62, 62, 703, 703, 703, 703, 703, 702, 696, ++ 696, 697, 704, 705, 704, 696, 696, 696, 696, 696, ++ 697, 696, 697, 696, 706, 706, 697, 706, 696, 12, ++ ++ 696, 697, 700, 696, 707, 697, 708, 697, 709, 108, ++ 696, 108, 108, 697, 697, 697, 697, 108, 106, 697, ++ 108, 697, 108, 108, 697, 710, 701, 710, 711, 696, ++ 697, 696, 712, 697, 697, 697, 697, 697, 697, 697, ++ 697, 697, 697, 702, 713, 702, 696, 714, 703, 696, ++ 703, 703, 696, 703, 696, 696, 703, 715, 703, 159, ++ 709, 160, 160, 160, 703, 703, 703, 703, 160, 159, ++ 703, 160, 703, 160, 160, 703, 159, 696, 712, 159, ++ 696, 703, 703, 703, 703, 703, 703, 703, 703, 702, ++ 696, 716, 717, 717, 718, 719, 716, 716, 720, 721, ++ ++ 696, 722, 722, 696, 696, 696, 697, 697, 696, 697, ++ 696, 696, 696, 696, 697, 696, 696, 696, 697, 696, ++ 697, 722, 697, 696, 697, 696, 696, 696, 696, 697, ++ 697, 697, 697, 697, 697, 697, 697, 697, 697, 723, ++ 724, 725, 726, 727, 697, 728, 697, 729, 728, 697, ++ 247, 697, 730, 730, 697, 254, 697, 697, 697, 697, ++ 697, 697, 696, 702, 696, 731, 696, 732, 733, 733, ++ 733, 733, 734, 731, 735, 733, 733, 222, 733, 277, ++ 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, ++ 736, 733, 277, 729, 733, 293, 733, 292, 733, 733, ++ ++ 733, 733, 733, 733, 702, 696, 696, 737, 737, 738, ++ 696, 739, 740, 740, 741, 741, 696, 742, 696, 696, ++ 696, 697, 696, 696, 696, 696, 696, 696, 696, 696, ++ 697, 742, 697, 696, 697, 332, 696, 697, 696, 696, ++ 696, 696, 697, 697, 697, 696, 697, 743, 697, 697, ++ 697, 697, 697, 744, 745, 745, 746, 746, 747, 748, ++ 749, 696, 696, 696, 750, 751, 696, 696, 751, 751, ++ 697, 697, 696, 696, 697, 697, 702, 696, 696, 696, ++ 696, 696, 752, 696, 733, 753, 753, 733, 733, 293, ++ 336, 733, 733, 733, 733, 733, 754, 733, 733, 733, ++ ++ 733, 733, 755, 744, 755, 756, 733, 733, 733, 733, ++ 702, 696, 757, 758, 696, 696, 759, 760, 761, 762, ++ 763, 764, 696, 696, 696, 697, 696, 696, 696, 696, ++ 697, 697, 696, 697, 696, 697, 697, 765, 766, 766, ++ 697, 697, 697, 767, 768, 696, 769, 696, 770, 770, ++ 770, 697, 696, 696, 696, 696, 697, 696, 702, 696, ++ 696, 696, 696, 696, 771, 772, 772, 733, 733, 733, ++ 733, 733, 733, 754, 765, 474, 733, 733, 733, 773, ++ 733, 733, 702, 696, 696, 758, 774, 759, 759, 760, ++ 760, 761, 761, 762, 762, 763, 763, 764, 764, 696, ++ ++ 696, 774, 774, 697, 696, 696, 696, 696, 697, 775, ++ 696, 696, 696, 696, 697, 697, 697, 697, 696, 696, ++ 696, 696, 696, 696, 702, 696, 696, 696, 771, 771, ++ 772, 772, 733, 733, 733, 733, 776, 733, 733, 773, ++ 702, 696, 696, 758, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 775, 775, 696, 696, 696, 696, 697, ++ 697, 697, 697, 697, 702, 696, 696, 772, 772, 733, ++ 733, 776, 733, 733, 733, 702, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 777, 697, 696, 696, ++ 772, 772, 778, 733, 702, 696, 696, 696, 696, 696, ++ ++ 779, 779, 777, 603, 697, 696, 696, 772, 772, 778, ++ 779, 610, 733, 702, 696, 696, 779, 603, 603, 696, ++ 696, 772, 772, 780, 610, 610, 702, 696, 696, 779, ++ 779, 603, 603, 696, 696, 772, 772, 780, 780, 610, ++ 610, 702, 696, 696, 779, 779, 603, 781, 696, 782, ++ 772, 780, 780, 610, 702, 696, 696, 696, 779, 781, ++ 696, 696, 782, 696, 772, 780, 780, 702, 696, 696, ++ 772, 780, 702, 696, 772, 702, 783, 783, 783, 783, ++ 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, ++ 783, 783, 783, 696, 696, 0, 696, 696, 696, 696, ++ ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696 ++ } ; ++ ++static yyconst short int yy_nxt[4591] = ++ { 0, ++ 4, 4, 4, 5, 4, 4, 6, 4, 7, 8, ++ 4, 9, 10, 7, 4, 4, 11, 12, 13, 13, ++ 4, 14, 4, 4, 15, 16, 17, 18, 15, 15, ++ 19, 15, 15, 15, 20, 21, 15, 22, 23, 24, ++ 15, 25, 15, 26, 4, 4, 27, 28, 29, 30, ++ 31, 32, 33, 34, 35, 36, 37, 38, 39, 7, ++ 40, 7, 7, 41, 42, 7, 7, 7, 43, 7, ++ 7, 44, 4, 4, 4, 4, 5, 4, 45, 6, ++ 45, 7, 8, 4, 9, 10, 46, 4, 4, 47, ++ 48, 49, 49, 4, 50, 4, 4, 51, 52, 53, ++ ++ 54, 51, 51, 55, 51, 51, 51, 56, 57, 51, ++ 58, 59, 60, 51, 61, 51, 26, 4, 4, 62, ++ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, ++ 73, 74, 46, 75, 46, 46, 76, 77, 46, 46, ++ 46, 78, 46, 46, 79, 4, 80, 81, 81, 81, ++ 81, 84, 87, 88, 90, 115, 119, 82, 85, 85, ++ 85, 85, 111, 268, 91, 95, 92, 93, 80, 150, ++ 170, 94, 95, 95, 96, 82, 216, 696, 116, 82, ++ 120, 695, 696, 199, 97, 98, 99, 100, 100, 100, ++ 100, 101, 104, 158, 171, 102, 102, 102, 102, 102, ++ ++ 102, 102, 102, 82, 102, 82, 82, 102, 102, 102, ++ 82, 82, 102, 82, 111, 111, 112, 102, 102, 102, ++ 102, 102, 102, 102, 102, 102, 102, 102, 102, 82, ++ 102, 102, 102, 102, 102, 82, 82, 82, 82, 82, ++ 82, 82, 105, 111, 106, 200, 107, 108, 108, 108, ++ 108, 109, 140, 648, 105, 136, 268, 135, 135, 204, ++ 135, 205, 138, 674, 123, 124, 206, 136, 136, 137, ++ 209, 125, 166, 106, 135, 135, 135, 110, 110, 110, ++ 110, 110, 110, 110, 110, 110, 110, 110, 110, 136, ++ 136, 104, 135, 135, 135, 167, 216, 163, 217, 141, ++ ++ 106, 126, 127, 127, 127, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 128, 126, 126, 111, 195, 196, ++ 145, 126, 126, 126, 126, 136, 136, 135, 135, 135, ++ 136, 136, 136, 136, 135, 135, 135, 115, 135, 135, ++ 135, 111, 114, 569, 126, 130, 126, 136, 136, 136, ++ 136, 95, 135, 135, 135, 136, 136, 135, 135, 135, ++ 116, 149, 181, 696, 135, 135, 135, 677, 150, 207, ++ 208, 183, 126, 126, 131, 136, 136, 132, 132, 132, ++ 132, 133, 111, 90, 542, 135, 135, 328, 82, 117, ++ 147, 143, 125, 151, 664, 92, 152, 329, 125, 182, ++ ++ 153, 181, 181, 134, 329, 145, 184, 135, 135, 136, ++ 136, 136, 136, 136, 136, 136, 136, 136, 136, 146, ++ 146, 146, 146, 182, 182, 181, 181, 181, 182, 182, ++ 134, 82, 174, 175, 181, 181, 181, 147, 82, 176, ++ 165, 182, 182, 150, 181, 181, 181, 182, 182, 166, ++ 150, 181, 181, 181, 182, 182, 82, 274, 275, 182, ++ 182, 181, 181, 181, 181, 181, 181, 670, 150, 185, ++ 182, 182, 167, 193, 307, 147, 95, 95, 96, 181, ++ 181, 181, 661, 82, 81, 81, 81, 81, 154, 98, ++ 99, 155, 155, 155, 155, 156, 195, 308, 188, 157, ++ ++ 157, 157, 157, 157, 157, 157, 157, 149, 157, 149, ++ 149, 157, 157, 157, 149, 149, 157, 149, 95, 95, ++ 95, 157, 157, 157, 157, 157, 157, 157, 157, 157, ++ 157, 157, 157, 149, 157, 157, 157, 157, 157, 149, ++ 149, 149, 149, 149, 149, 149, 82, 195, 308, 105, ++ 241, 159, 82, 107, 160, 160, 160, 160, 161, 182, ++ 182, 105, 182, 182, 150, 310, 311, 181, 181, 181, ++ 82, 82, 181, 181, 374, 186, 168, 95, 95, 95, ++ 159, 130, 150, 150, 162, 162, 162, 162, 162, 162, ++ 162, 162, 162, 162, 162, 162, 225, 225, 225, 225, ++ ++ 82, 104, 225, 225, 225, 225, 669, 159, 82, 173, ++ 111, 82, 150, 177, 145, 82, 178, 178, 178, 178, ++ 179, 375, 187, 150, 417, 190, 193, 150, 146, 146, ++ 146, 146, 230, 197, 197, 197, 197, 198, 225, 225, ++ 225, 225, 180, 284, 274, 275, 181, 181, 182, 182, ++ 182, 182, 182, 182, 182, 182, 182, 182, 95, 467, ++ 189, 176, 95, 95, 95, 82, 82, 176, 82, 180, ++ 696, 226, 231, 227, 212, 696, 213, 150, 150, 228, ++ 657, 214, 229, 104, 147, 109, 418, 107, 202, 202, ++ 202, 202, 109, 226, 271, 227, 225, 225, 225, 225, ++ ++ 82, 348, 228, 255, 255, 255, 255, 229, 225, 225, ++ 225, 225, 150, 664, 109, 348, 348, 291, 203, 203, ++ 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, ++ 225, 225, 225, 225, 239, 358, 225, 225, 225, 225, ++ 637, 109, 219, 219, 219, 219, 219, 219, 219, 219, ++ 219, 219, 219, 219, 221, 82, 662, 235, 284, 346, ++ 216, 222, 217, 269, 270, 360, 130, 150, 82, 255, ++ 255, 255, 255, 255, 255, 255, 255, 381, 237, 240, ++ 150, 433, 347, 221, 310, 311, 382, 223, 223, 223, ++ 223, 223, 223, 223, 223, 223, 223, 223, 223, 259, ++ ++ 280, 280, 280, 280, 347, 361, 283, 260, 310, 311, ++ 221, 126, 127, 127, 127, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 145, 82, 104, ++ 591, 126, 126, 126, 126, 423, 271, 434, 82, 82, ++ 150, 146, 146, 146, 146, 264, 272, 145, 323, 424, ++ 150, 150, 82, 82, 126, 130, 126, 661, 305, 280, ++ 280, 280, 280, 658, 150, 150, 280, 280, 280, 280, ++ 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, ++ 280, 280, 126, 126, 126, 242, 242, 242, 243, 281, ++ 126, 126, 126, 126, 126, 126, 286, 147, 126, 126, ++ ++ 282, 82, 82, 82, 126, 126, 104, 126, 285, 280, ++ 280, 280, 280, 150, 150, 150, 290, 147, 435, 286, ++ 327, 82, 288, 82, 374, 82, 82, 126, 130, 298, ++ 298, 298, 298, 150, 82, 150, 82, 150, 150, 289, ++ 435, 385, 298, 298, 298, 298, 150, 104, 150, 304, ++ 466, 436, 291, 358, 303, 126, 126, 245, 245, 245, ++ 245, 245, 245, 245, 245, 245, 245, 245, 245, 82, ++ 246, 373, 301, 437, 247, 271, 654, 82, 82, 82, ++ 82, 248, 288, 249, 130, 250, 250, 250, 250, 250, ++ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, ++ ++ 250, 250, 250, 251, 465, 623, 465, 252, 252, 252, ++ 252, 252, 252, 252, 252, 252, 252, 252, 252, 82, ++ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, ++ 247, 82, 135, 135, 135, 135, 135, 135, 135, 135, ++ 135, 135, 135, 135, 254, 330, 330, 330, 330, 542, ++ 378, 255, 255, 255, 255, 379, 380, 256, 543, 257, ++ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, ++ 257, 257, 257, 257, 257, 257, 257, 257, 331, 331, ++ 331, 331, 193, 307, 509, 258, 95, 95, 95, 312, ++ 312, 312, 312, 82, 332, 332, 332, 332, 149, 98, ++ ++ 654, 155, 155, 155, 155, 150, 513, 509, 419, 157, ++ 157, 157, 157, 157, 157, 157, 157, 149, 157, 149, ++ 149, 157, 157, 157, 149, 149, 157, 149, 514, 104, ++ 651, 157, 157, 157, 157, 157, 157, 157, 157, 157, ++ 157, 157, 157, 149, 157, 157, 157, 157, 157, 149, ++ 149, 149, 149, 149, 149, 149, 82, 82, 104, 222, ++ 696, 333, 333, 333, 333, 82, 222, 696, 150, 150, ++ 420, 193, 307, 298, 298, 298, 298, 150, 197, 197, ++ 197, 197, 198, 334, 334, 334, 334, 456, 222, 696, ++ 365, 365, 365, 365, 276, 276, 276, 276, 276, 276, ++ ++ 276, 276, 276, 276, 276, 276, 277, 302, 386, 242, ++ 242, 242, 243, 278, 402, 222, 696, 387, 415, 415, ++ 415, 415, 222, 444, 82, 318, 318, 318, 318, 222, ++ 333, 333, 333, 333, 457, 277, 150, 360, 337, 279, ++ 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, ++ 279, 222, 130, 212, 130, 213, 333, 333, 333, 333, ++ 214, 649, 277, 292, 292, 292, 292, 292, 292, 292, ++ 292, 292, 292, 292, 292, 82, 246, 361, 222, 353, ++ 293, 218, 218, 149, 149, 149, 149, 294, 343, 249, ++ 648, 295, 295, 295, 295, 295, 295, 295, 295, 295, ++ ++ 295, 295, 295, 295, 295, 295, 295, 295, 295, 296, ++ 445, 445, 445, 297, 297, 297, 297, 297, 297, 297, ++ 297, 297, 297, 297, 297, 149, 149, 149, 149, 149, ++ 149, 149, 149, 149, 149, 149, 293, 149, 181, 181, ++ 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, ++ 82, 254, 450, 446, 444, 149, 220, 220, 298, 298, ++ 298, 298, 150, 647, 256, 451, 299, 299, 299, 299, ++ 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, ++ 299, 299, 299, 299, 299, 519, 647, 104, 149, 149, ++ 149, 149, 300, 149, 149, 149, 149, 149, 149, 149, ++ ++ 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, ++ 149, 149, 149, 223, 223, 223, 223, 223, 223, 223, ++ 223, 223, 223, 223, 223, 335, 426, 426, 426, 426, ++ 456, 104, 336, 369, 337, 254, 608, 82, 333, 333, ++ 333, 333, 366, 366, 366, 366, 370, 104, 256, 150, ++ 449, 449, 449, 449, 335, 530, 384, 530, 338, 338, ++ 338, 338, 338, 338, 338, 338, 338, 338, 338, 338, ++ 344, 644, 82, 643, 454, 104, 368, 455, 82, 398, ++ 665, 335, 354, 354, 150, 354, 354, 354, 354, 354, ++ 150, 354, 354, 354, 354, 568, 354, 354, 82, 696, ++ ++ 696, 145, 354, 354, 354, 354, 696, 696, 696, 696, ++ 150, 82, 696, 696, 397, 377, 377, 377, 377, 388, ++ 388, 388, 388, 150, 82, 354, 354, 354, 397, 397, ++ 82, 82, 389, 389, 389, 389, 150, 532, 395, 82, ++ 696, 145, 150, 150, 400, 425, 356, 389, 389, 389, ++ 389, 150, 411, 354, 354, 126, 242, 242, 242, 243, ++ 641, 126, 126, 126, 126, 126, 126, 104, 346, 126, ++ 126, 147, 82, 82, 82, 126, 126, 104, 126, 393, ++ 389, 389, 389, 389, 150, 150, 150, 104, 82, 82, ++ 82, 396, 364, 399, 410, 82, 82, 373, 126, 130, ++ ++ 150, 150, 150, 640, 193, 485, 82, 150, 150, 486, ++ 635, 147, 394, 396, 389, 389, 389, 389, 150, 609, ++ 634, 82, 82, 401, 696, 369, 126, 126, 254, 406, ++ 406, 406, 406, 150, 150, 696, 393, 696, 696, 622, ++ 592, 256, 696, 257, 257, 257, 257, 257, 257, 257, ++ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, ++ 257, 257, 394, 402, 696, 696, 696, 617, 511, 258, ++ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, ++ 252, 252, 369, 421, 82, 224, 224, 329, 104, 617, ++ 374, 696, 421, 511, 329, 370, 150, 371, 371, 371, ++ ++ 371, 371, 371, 371, 371, 371, 371, 371, 371, 371, ++ 371, 371, 371, 371, 371, 371, 253, 253, 193, 307, ++ 104, 82, 336, 372, 82, 414, 414, 414, 414, 336, ++ 90, 337, 336, 150, 82, 633, 150, 409, 461, 336, ++ 460, 696, 92, 636, 82, 422, 150, 94, 462, 145, ++ 99, 336, 271, 104, 422, 101, 150, 445, 445, 445, ++ 483, 336, 279, 279, 279, 279, 279, 279, 279, 279, ++ 279, 279, 279, 279, 390, 82, 531, 450, 336, 82, ++ 632, 391, 469, 337, 82, 450, 502, 150, 336, 82, ++ 696, 150, 82, 82, 82, 82, 104, 629, 451, 503, ++ ++ 446, 650, 472, 390, 520, 520, 520, 392, 392, 392, ++ 392, 392, 392, 392, 392, 392, 392, 392, 392, 147, ++ 628, 82, 621, 470, 473, 487, 487, 487, 487, 620, ++ 390, 354, 354, 150, 354, 354, 354, 354, 354, 355, ++ 354, 354, 354, 354, 145, 354, 354, 521, 671, 696, ++ 271, 404, 354, 354, 354, 82, 82, 82, 459, 459, ++ 459, 459, 696, 468, 468, 468, 468, 150, 150, 150, ++ 82, 616, 500, 145, 354, 354, 354, 82, 82, 455, ++ 523, 599, 150, 433, 501, 525, 104, 82, 82, 150, ++ 150, 111, 433, 456, 82, 405, 82, 82, 478, 150, ++ ++ 150, 477, 354, 354, 82, 254, 150, 82, 150, 150, ++ 363, 363, 479, 615, 147, 542, 150, 104, 256, 150, ++ 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, ++ 299, 299, 299, 299, 299, 299, 299, 299, 299, 471, ++ 482, 675, 617, 526, 618, 538, 300, 297, 297, 297, ++ 297, 297, 297, 297, 297, 297, 297, 297, 297, 369, ++ 145, 530, 384, 530, 617, 650, 619, 607, 606, 605, ++ 601, 541, 370, 625, 407, 407, 407, 407, 407, 407, ++ 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, ++ 407, 407, 407, 601, 600, 626, 582, 659, 597, 617, ++ ++ 408, 338, 338, 338, 338, 338, 338, 338, 338, 338, ++ 338, 338, 338, 438, 438, 510, 438, 438, 438, 438, ++ 438, 617, 438, 438, 438, 438, 502, 438, 438, 82, ++ 147, 82, 547, 438, 438, 438, 438, 82, 450, 696, ++ 476, 150, 149, 150, 511, 149, 149, 149, 149, 150, ++ 82, 451, 82, 512, 476, 476, 438, 438, 438, 596, ++ 82, 551, 150, 440, 150, 384, 111, 590, 562, 511, ++ 535, 82, 150, 536, 589, 552, 82, 440, 440, 534, ++ 598, 271, 563, 150, 438, 438, 354, 354, 150, 354, ++ 354, 354, 354, 354, 599, 354, 354, 354, 354, 624, ++ ++ 354, 354, 534, 617, 193, 307, 354, 354, 354, 354, ++ 539, 544, 544, 544, 544, 82, 82, 548, 520, 520, ++ 520, 145, 82, 659, 617, 617, 617, 150, 150, 354, ++ 354, 354, 571, 82, 150, 565, 565, 565, 565, 82, ++ 679, 145, 588, 82, 82, 150, 617, 563, 617, 587, ++ 587, 150, 576, 570, 185, 150, 150, 354, 354, 354, ++ 354, 521, 354, 354, 354, 354, 354, 586, 354, 354, ++ 354, 354, 82, 354, 354, 573, 82, 575, 82, 354, ++ 354, 354, 354, 656, 150, 193, 485, 585, 150, 574, ++ 150, 147, 544, 544, 544, 544, 82, 657, 145, 593, ++ ++ 617, 584, 354, 354, 354, 145, 145, 593, 150, 145, ++ 263, 147, 565, 565, 565, 565, 595, 614, 583, 574, ++ 627, 555, 617, 679, 555, 582, 552, 581, 646, 594, ++ 354, 354, 392, 392, 392, 392, 392, 392, 392, 392, ++ 392, 392, 392, 392, 438, 438, 580, 438, 438, 438, ++ 438, 438, 439, 438, 438, 438, 438, 82, 438, 438, ++ 145, 579, 384, 384, 475, 438, 438, 438, 526, 150, ++ 578, 642, 548, 617, 630, 147, 147, 577, 645, 147, ++ 617, 145, 384, 384, 384, 567, 145, 438, 438, 438, ++ 639, 639, 655, 263, 476, 617, 631, 668, 679, 613, ++ ++ 145, 566, 617, 265, 455, 384, 523, 384, 476, 476, ++ 564, 673, 639, 639, 384, 438, 438, 354, 354, 384, ++ 354, 354, 354, 354, 354, 355, 354, 354, 354, 354, ++ 147, 354, 354, 639, 561, 639, 652, 404, 354, 354, ++ 354, 560, 639, 559, 558, 557, 556, 639, 555, 139, ++ 553, 147, 666, 384, 145, 639, 147, 639, 653, 384, ++ 354, 354, 354, 667, 639, 676, 679, 679, 694, 639, ++ 147, 679, 679, 679, 679, 679, 550, 680, 681, 672, ++ 549, 639, 682, 683, 684, 685, 686, 639, 354, 354, ++ 354, 354, 548, 354, 354, 354, 354, 354, 355, 354, ++ ++ 354, 354, 354, 639, 354, 354, 547, 672, 546, 639, ++ 404, 354, 354, 354, 499, 499, 497, 497, 495, 495, ++ 493, 493, 491, 491, 147, 489, 489, 384, 537, 679, ++ 528, 527, 216, 354, 354, 354, 263, 263, 209, 373, ++ 687, 263, 263, 263, 263, 263, 679, 524, 455, 523, ++ 448, 111, 518, 679, 679, 679, 679, 688, 679, 517, ++ 516, 354, 354, 502, 689, 690, 691, 692, 515, 693, ++ 433, 111, 508, 507, 506, 505, 503, 424, 504, 504, ++ 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, ++ 504, 504, 504, 504, 504, 504, 504, 438, 438, 263, ++ ++ 438, 438, 438, 438, 438, 499, 438, 438, 438, 438, ++ 497, 438, 438, 495, 493, 491, 263, 438, 438, 438, ++ 438, 489, 425, 263, 263, 263, 263, 196, 263, 484, ++ 480, 268, 384, 464, 463, 86, 210, 458, 455, 373, ++ 438, 438, 438, 364, 448, 443, 442, 441, 210, 432, ++ 431, 430, 429, 428, 427, 337, 425, 337, 216, 216, ++ 210, 209, 209, 209, 316, 316, 314, 314, 438, 438, ++ 438, 438, 196, 438, 438, 438, 438, 438, 412, 438, ++ 438, 438, 438, 364, 438, 438, 268, 268, 267, 384, ++ 438, 438, 438, 438, 267, 353, 376, 344, 343, 373, ++ ++ 254, 364, 364, 246, 352, 351, 350, 349, 345, 342, ++ 341, 340, 339, 438, 438, 438, 327, 327, 326, 325, ++ 440, 324, 323, 323, 322, 321, 320, 319, 316, 314, ++ 307, 306, 268, 287, 440, 440, 268, 268, 267, 265, ++ 263, 438, 438, 82, 502, 262, 237, 210, 261, 235, ++ 130, 240, 238, 210, 236, 150, 234, 503, 233, 533, ++ 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, ++ 533, 533, 533, 533, 533, 533, 533, 533, 438, 438, ++ 233, 438, 438, 438, 438, 438, 439, 438, 438, 438, ++ 438, 232, 438, 438, 104, 216, 215, 209, 475, 438, ++ ++ 438, 438, 210, 209, 201, 193, 191, 173, 172, 169, ++ 168, 165, 164, 148, 122, 142, 139, 122, 121, 118, ++ 117, 438, 438, 438, 114, 113, 104, 86, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 438, ++ 438, 602, 602, 696, 602, 602, 602, 602, 602, 696, ++ 602, 602, 602, 602, 696, 602, 602, 696, 696, 696, ++ 696, 602, 602, 602, 602, 696, 696, 696, 696, 696, ++ 696, 604, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 602, 602, 602, 696, 696, 696, ++ ++ 696, 696, 696, 604, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 602, 602, 602, 602, 696, 602, 602, 602, ++ 602, 602, 603, 602, 602, 602, 602, 696, 602, 602, ++ 696, 696, 696, 696, 611, 602, 602, 602, 696, 696, ++ 696, 696, 696, 696, 612, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 602, 602, 602, ++ 696, 696, 696, 696, 696, 696, 612, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 602, 602, 602, 602, 696, ++ ++ 602, 602, 602, 602, 602, 696, 602, 602, 602, 602, ++ 696, 602, 602, 696, 696, 696, 696, 602, 602, 602, ++ 602, 696, 696, 696, 696, 696, 696, 604, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 602, 602, 602, 696, 696, 696, 696, 696, 696, 604, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 602, 602, ++ 602, 602, 696, 602, 602, 602, 602, 602, 603, 602, ++ 602, 602, 602, 696, 602, 602, 696, 696, 696, 696, ++ 611, 602, 602, 602, 696, 696, 696, 696, 696, 696, ++ ++ 612, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 602, 602, 602, 696, 696, 696, 696, ++ 696, 696, 612, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 602, 602, 82, 696, 696, 696, 82, 82, 696, ++ 696, 82, 82, 82, 82, 82, 82, 82, 82, 83, ++ 83, 83, 83, 83, 696, 83, 83, 83, 83, 83, ++ 83, 83, 83, 83, 83, 83, 83, 83, 89, 89, ++ 696, 696, 696, 89, 89, 89, 103, 103, 103, 103, ++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, ++ ++ 103, 103, 103, 103, 103, 129, 129, 129, 129, 129, ++ 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, ++ 129, 129, 129, 129, 144, 144, 144, 144, 144, 144, ++ 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, ++ 144, 144, 144, 149, 696, 696, 696, 149, 149, 149, ++ 696, 149, 149, 149, 149, 149, 149, 149, 149, 192, ++ 192, 192, 192, 192, 696, 192, 192, 192, 192, 192, ++ 192, 192, 192, 192, 192, 192, 192, 192, 194, 194, ++ 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, ++ 194, 194, 194, 194, 194, 194, 194, 211, 211, 696, ++ ++ 696, 696, 696, 696, 696, 696, 696, 211, 696, 696, ++ 211, 211, 696, 211, 126, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, ++ 126, 126, 126, 244, 244, 244, 244, 244, 244, 244, ++ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, ++ 244, 244, 145, 145, 145, 145, 145, 145, 145, 145, ++ 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, ++ 145, 266, 266, 266, 266, 266, 266, 266, 266, 266, ++ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, ++ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, ++ ++ 273, 273, 273, 273, 273, 273, 273, 273, 273, 192, ++ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, ++ 192, 192, 192, 192, 192, 192, 192, 192, 194, 194, ++ 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, ++ 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, ++ 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, ++ 195, 195, 195, 195, 195, 195, 309, 309, 309, 309, ++ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, ++ 309, 309, 309, 309, 309, 313, 313, 696, 313, 313, ++ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, ++ ++ 313, 313, 313, 313, 315, 315, 696, 315, 315, 315, ++ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, ++ 315, 315, 315, 317, 696, 317, 696, 696, 696, 317, ++ 317, 317, 696, 696, 317, 355, 355, 696, 355, 355, ++ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, ++ 355, 355, 355, 355, 357, 357, 357, 357, 357, 357, ++ 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, ++ 357, 357, 357, 126, 126, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, ++ 126, 126, 359, 359, 359, 359, 359, 359, 359, 359, ++ ++ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, ++ 359, 244, 244, 244, 244, 244, 244, 244, 244, 244, ++ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, ++ 362, 362, 362, 367, 696, 696, 696, 367, 696, 367, ++ 367, 367, 367, 696, 367, 266, 266, 266, 266, 266, ++ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, ++ 266, 266, 266, 266, 383, 383, 383, 383, 383, 383, ++ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, ++ 383, 383, 383, 149, 696, 696, 696, 149, 149, 149, ++ 696, 149, 149, 149, 149, 149, 149, 149, 149, 273, ++ ++ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273, ++ 273, 273, 273, 273, 273, 273, 273, 273, 103, 103, ++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, ++ 103, 103, 103, 103, 103, 103, 103, 403, 403, 696, ++ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, ++ 403, 403, 403, 403, 403, 403, 309, 309, 309, 309, ++ 309, 309, 309, 309, 309, 309, 309, 309, 309, 309, ++ 309, 309, 309, 309, 309, 413, 413, 413, 413, 696, ++ 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, ++ 413, 413, 413, 413, 192, 192, 192, 192, 192, 192, ++ ++ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, ++ 192, 192, 192, 313, 313, 696, 313, 313, 313, 313, ++ 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, ++ 313, 313, 315, 315, 696, 315, 315, 315, 315, 315, ++ 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, ++ 315, 416, 696, 416, 416, 696, 696, 416, 416, 416, ++ 696, 696, 416, 439, 439, 696, 439, 439, 439, 439, ++ 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, ++ 439, 439, 354, 354, 696, 354, 354, 354, 354, 354, ++ 354, 354, 354, 354, 354, 354, 354, 354, 354, 354, ++ ++ 354, 355, 355, 696, 355, 355, 355, 355, 355, 355, ++ 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, ++ 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, ++ 357, 357, 357, 357, 357, 357, 357, 357, 357, 359, ++ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, ++ 359, 359, 359, 359, 359, 359, 359, 359, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 447, 447, 447, ++ 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, ++ 447, 447, 447, 447, 447, 447, 452, 452, 696, 696, ++ ++ 452, 452, 696, 452, 452, 452, 452, 452, 452, 452, ++ 452, 452, 453, 696, 696, 696, 696, 696, 453, 453, ++ 453, 453, 696, 453, 383, 383, 383, 383, 383, 383, ++ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, ++ 383, 383, 383, 103, 103, 103, 103, 103, 103, 103, ++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, ++ 103, 103, 474, 474, 696, 474, 474, 474, 474, 474, ++ 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, ++ 474, 403, 403, 696, 403, 403, 403, 403, 403, 403, ++ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, ++ ++ 481, 481, 696, 696, 481, 481, 481, 481, 481, 481, ++ 481, 481, 481, 481, 481, 481, 413, 413, 413, 413, ++ 696, 413, 413, 413, 413, 413, 413, 413, 413, 413, ++ 413, 413, 413, 413, 413, 192, 192, 192, 192, 192, ++ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, ++ 192, 192, 192, 192, 488, 488, 696, 488, 488, 488, ++ 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, ++ 488, 488, 488, 490, 490, 696, 490, 490, 490, 490, ++ 490, 490, 490, 490, 490, 490, 490, 490, 490, 490, ++ 490, 490, 492, 492, 696, 492, 492, 492, 492, 492, ++ ++ 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, ++ 492, 494, 494, 696, 494, 494, 494, 494, 494, 494, ++ 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, ++ 496, 496, 696, 496, 496, 496, 496, 496, 496, 496, ++ 496, 496, 496, 496, 496, 496, 496, 496, 496, 498, ++ 498, 696, 498, 498, 498, 498, 498, 498, 498, 498, ++ 498, 498, 498, 498, 498, 498, 498, 498, 438, 438, ++ 696, 438, 438, 438, 438, 438, 438, 438, 438, 438, ++ 438, 438, 438, 438, 438, 438, 438, 439, 439, 696, ++ 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, ++ ++ 439, 439, 439, 439, 439, 439, 357, 357, 357, 357, ++ 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, ++ 357, 357, 357, 357, 357, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, ++ 126, 126, 126, 126, 447, 447, 447, 447, 447, 447, ++ 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, ++ 447, 447, 447, 522, 696, 696, 696, 696, 696, 522, ++ 522, 522, 522, 522, 522, 522, 522, 522, 529, 529, ++ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, ++ 529, 529, 529, 529, 529, 529, 529, 103, 103, 103, ++ ++ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, ++ 103, 103, 103, 103, 103, 103, 540, 540, 540, 540, ++ 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, ++ 540, 540, 540, 540, 540, 545, 696, 696, 696, 696, ++ 696, 545, 545, 545, 545, 554, 554, 696, 554, 554, ++ 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, ++ 554, 554, 554, 554, 572, 572, 572, 572, 572, 572, ++ 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, ++ 572, 572, 572, 603, 603, 696, 603, 603, 603, 603, ++ 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, ++ ++ 603, 603, 610, 610, 696, 610, 610, 610, 610, 610, ++ 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, ++ 610, 602, 602, 696, 602, 602, 602, 602, 602, 602, ++ 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, ++ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, ++ 638, 638, 638, 638, 638, 638, 638, 638, 638, 660, ++ 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, ++ 660, 660, 660, 660, 660, 660, 660, 660, 663, 663, ++ 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, ++ 663, 663, 663, 663, 663, 663, 663, 678, 678, 678, ++ ++ 678, 678, 678, 678, 678, 678, 678, 678, 678, 678, ++ 678, 678, 678, 678, 678, 678, 3, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696 ++ } ; ++ ++static yyconst short int yy_chk[4591] = ++ { 0, ++ 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, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ++ 2, 2, 2, 2, 2, 2, 5, 6, 6, 6, ++ 6, 8, 10, 10, 11, 19, 22, 46, 8, 8, ++ 8, 8, 16, 156, 11, 13, 11, 11, 5, 46, ++ 58, 11, 12, 12, 12, 13, 156, 13, 19, 12, ++ 22, 694, 13, 86, 12, 12, 12, 12, 12, 12, ++ 12, 12, 50, 50, 58, 12, 12, 12, 12, 12, ++ ++ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, ++ 12, 12, 12, 12, 25, 28, 16, 12, 12, 12, ++ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, ++ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, ++ 12, 12, 15, 52, 15, 86, 15, 15, 15, 15, ++ 15, 15, 40, 674, 15, 29, 153, 29, 29, 90, ++ 28, 90, 29, 670, 25, 25, 90, 35, 35, 28, ++ 153, 25, 55, 15, 35, 35, 35, 15, 15, 15, ++ 15, 15, 15, 15, 15, 15, 15, 15, 15, 31, ++ 31, 532, 31, 31, 31, 55, 99, 52, 99, 40, ++ ++ 15, 26, 26, 26, 26, 26, 26, 26, 26, 26, ++ 26, 26, 26, 26, 26, 26, 26, 63, 84, 84, ++ 144, 26, 26, 26, 26, 30, 30, 30, 30, 30, ++ 32, 32, 34, 34, 32, 32, 32, 33, 34, 34, ++ 34, 43, 30, 532, 26, 26, 26, 33, 33, 36, ++ 36, 49, 33, 33, 33, 37, 37, 36, 36, 36, ++ 33, 49, 63, 49, 37, 37, 37, 676, 49, 91, ++ 91, 63, 26, 26, 27, 38, 38, 27, 27, 27, ++ 27, 27, 61, 47, 669, 38, 38, 217, 47, 38, ++ 144, 43, 43, 47, 663, 47, 47, 217, 43, 64, ++ ++ 47, 64, 64, 27, 217, 44, 64, 27, 27, 27, ++ 27, 27, 27, 27, 27, 27, 27, 27, 27, 44, ++ 44, 44, 44, 65, 65, 65, 65, 65, 69, 69, ++ 27, 74, 61, 61, 69, 69, 69, 676, 149, 61, ++ 65, 66, 66, 74, 66, 66, 66, 67, 67, 68, ++ 149, 67, 67, 67, 70, 70, 76, 158, 158, 68, ++ 68, 70, 70, 70, 68, 68, 68, 662, 76, 74, ++ 72, 72, 68, 192, 192, 44, 48, 48, 48, 72, ++ 72, 72, 660, 48, 81, 81, 81, 81, 48, 48, ++ 48, 48, 48, 48, 48, 48, 193, 193, 76, 48, ++ ++ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, ++ 48, 48, 48, 48, 48, 48, 48, 48, 95, 95, ++ 95, 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, 51, 194, 194, 51, ++ 128, 51, 77, 51, 51, 51, 51, 51, 51, 71, ++ 71, 51, 73, 73, 77, 196, 196, 71, 71, 71, ++ 75, 157, 73, 73, 258, 75, 73, 98, 98, 98, ++ 51, 128, 75, 157, 51, 51, 51, 51, 51, 51, ++ 51, 51, 51, 51, 51, 51, 110, 110, 110, 110, ++ ++ 271, 387, 112, 112, 112, 112, 658, 51, 62, 77, ++ 78, 166, 271, 62, 79, 78, 62, 62, 62, 62, ++ 62, 258, 75, 166, 323, 79, 85, 78, 79, 79, ++ 79, 79, 112, 85, 85, 85, 85, 85, 113, 113, ++ 113, 113, 62, 166, 273, 273, 62, 62, 62, 62, ++ 62, 62, 62, 62, 62, 62, 62, 62, 100, 387, ++ 78, 78, 96, 96, 96, 171, 176, 78, 100, 62, ++ 100, 111, 113, 111, 96, 100, 96, 171, 176, 111, ++ 656, 96, 111, 623, 79, 89, 323, 89, 89, 89, ++ 89, 89, 89, 111, 171, 111, 123, 123, 123, 123, ++ ++ 167, 234, 111, 136, 136, 136, 136, 111, 118, 118, ++ 118, 118, 167, 650, 89, 234, 234, 176, 89, 89, ++ 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, ++ 121, 121, 121, 121, 123, 241, 124, 124, 124, 124, ++ 623, 89, 106, 106, 106, 106, 106, 106, 106, 106, ++ 106, 106, 106, 106, 108, 151, 649, 118, 167, 233, ++ 325, 108, 325, 151, 151, 243, 241, 151, 165, 137, ++ 137, 137, 137, 138, 138, 138, 138, 267, 121, 124, ++ 165, 345, 233, 108, 308, 308, 267, 108, 108, 108, ++ 108, 108, 108, 108, 108, 108, 108, 108, 108, 137, ++ ++ 162, 162, 162, 162, 233, 243, 165, 138, 309, 309, ++ 108, 127, 127, 127, 127, 127, 127, 127, 127, 127, ++ 127, 127, 127, 127, 127, 127, 127, 146, 152, 568, ++ 568, 127, 127, 127, 127, 329, 152, 345, 154, 185, ++ 152, 146, 146, 146, 146, 146, 154, 190, 270, 329, ++ 154, 185, 168, 270, 127, 127, 127, 648, 190, 163, ++ 163, 163, 163, 644, 168, 270, 164, 164, 164, 164, ++ 169, 169, 169, 169, 172, 172, 172, 172, 174, 174, ++ 174, 174, 127, 127, 129, 129, 129, 129, 129, 163, ++ 129, 129, 129, 129, 129, 129, 185, 146, 129, 129, ++ ++ 164, 173, 186, 189, 129, 129, 386, 129, 168, 175, ++ 175, 175, 175, 173, 186, 189, 174, 190, 346, 169, ++ 272, 182, 172, 187, 368, 272, 188, 129, 129, 182, ++ 182, 182, 182, 182, 183, 187, 269, 272, 188, 173, ++ 346, 269, 183, 183, 183, 183, 183, 609, 269, 189, ++ 386, 347, 175, 357, 186, 129, 129, 131, 131, 131, ++ 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, ++ 132, 368, 183, 347, 132, 187, 641, 132, 132, 132, ++ 132, 132, 188, 132, 357, 132, 132, 132, 132, 132, ++ 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, ++ ++ 132, 132, 132, 132, 384, 609, 384, 132, 132, 132, ++ 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, ++ 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, ++ 132, 132, 134, 134, 134, 134, 134, 134, 134, 134, ++ 134, 134, 134, 134, 135, 218, 218, 218, 218, 484, ++ 265, 135, 135, 135, 135, 265, 265, 135, 484, 135, ++ 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, ++ 135, 135, 135, 135, 135, 135, 135, 135, 219, 219, ++ 219, 219, 198, 198, 432, 135, 155, 155, 155, 198, ++ 198, 198, 198, 155, 220, 220, 220, 220, 155, 155, ++ ++ 640, 155, 155, 155, 155, 155, 435, 432, 327, 155, ++ 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ++ 155, 155, 155, 155, 155, 155, 155, 155, 435, 637, ++ 637, 155, 155, 155, 155, 155, 155, 155, 155, 155, ++ 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, ++ 155, 155, 155, 155, 155, 155, 159, 304, 275, 202, ++ 222, 223, 223, 223, 223, 184, 202, 222, 159, 304, ++ 327, 197, 197, 184, 184, 184, 184, 184, 197, 197, ++ 197, 197, 197, 224, 224, 224, 224, 372, 202, 222, ++ 252, 252, 252, 252, 159, 159, 159, 159, 159, 159, ++ ++ 159, 159, 159, 159, 159, 159, 160, 184, 275, 242, ++ 242, 242, 242, 160, 304, 202, 222, 275, 317, 317, ++ 317, 317, 203, 358, 388, 203, 203, 203, 203, 203, ++ 239, 239, 239, 239, 372, 160, 388, 359, 388, 160, ++ 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, ++ 160, 203, 242, 461, 358, 461, 230, 230, 230, 230, ++ 461, 635, 160, 177, 177, 177, 177, 177, 177, 177, ++ 177, 177, 177, 177, 177, 178, 178, 359, 203, 239, ++ 178, 707, 707, 178, 178, 178, 178, 178, 230, 178, ++ 634, 178, 178, 178, 178, 178, 178, 178, 178, 178, ++ ++ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, ++ 360, 360, 360, 178, 178, 178, 178, 178, 178, 178, ++ 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, ++ 178, 178, 178, 178, 178, 178, 178, 178, 180, 180, ++ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, ++ 181, 181, 449, 360, 444, 181, 708, 708, 181, 181, ++ 181, 181, 181, 633, 181, 449, 181, 181, 181, 181, ++ 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, ++ 181, 181, 181, 181, 181, 444, 632, 591, 181, 181, ++ 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, ++ ++ 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, ++ 181, 181, 181, 221, 221, 221, 221, 221, 221, 221, ++ 221, 221, 221, 221, 221, 225, 338, 338, 338, 338, ++ 454, 651, 225, 366, 225, 253, 591, 286, 231, 231, ++ 231, 231, 253, 253, 253, 253, 366, 531, 253, 286, ++ 363, 363, 363, 363, 225, 465, 465, 465, 225, 225, ++ 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, ++ 231, 629, 285, 628, 366, 467, 253, 454, 283, 286, ++ 651, 225, 240, 240, 285, 240, 240, 240, 240, 240, ++ 283, 240, 240, 240, 240, 531, 240, 240, 288, 254, ++ ++ 450, 264, 240, 240, 240, 240, 254, 254, 254, 254, ++ 288, 276, 254, 450, 285, 264, 264, 264, 264, 276, ++ 276, 276, 276, 276, 279, 240, 240, 240, 285, 285, ++ 398, 389, 279, 279, 279, 279, 279, 467, 283, 281, ++ 254, 305, 398, 389, 288, 389, 240, 281, 281, 281, ++ 281, 281, 305, 240, 240, 244, 244, 244, 244, 244, ++ 626, 244, 244, 244, 244, 244, 244, 592, 284, 244, ++ 244, 264, 282, 284, 289, 244, 244, 569, 244, 281, ++ 282, 282, 282, 282, 282, 284, 289, 608, 287, 303, ++ 295, 284, 295, 287, 303, 299, 301, 299, 244, 244, ++ ++ 287, 303, 295, 625, 414, 414, 290, 299, 301, 414, ++ 621, 305, 282, 284, 290, 290, 290, 290, 290, 592, ++ 620, 297, 302, 289, 369, 370, 244, 244, 245, 297, ++ 297, 297, 297, 297, 302, 336, 301, 369, 370, 608, ++ 569, 245, 336, 245, 245, 245, 245, 245, 245, 245, ++ 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, ++ 245, 245, 302, 290, 336, 369, 370, 601, 584, 245, ++ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, ++ 247, 247, 255, 328, 300, 709, 709, 328, 622, 601, ++ 300, 336, 579, 584, 328, 255, 300, 255, 255, 255, ++ ++ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, ++ 255, 255, 255, 255, 255, 255, 712, 712, 312, 312, ++ 466, 409, 318, 255, 277, 312, 312, 312, 312, 318, ++ 379, 318, 332, 409, 393, 619, 277, 300, 380, 332, ++ 379, 332, 379, 622, 385, 328, 393, 379, 380, 411, ++ 380, 318, 385, 636, 579, 380, 385, 445, 445, 445, ++ 411, 332, 277, 277, 277, 277, 277, 277, 277, 277, ++ 277, 277, 277, 277, 280, 394, 466, 451, 318, 396, ++ 618, 280, 393, 280, 365, 365, 487, 394, 332, 365, ++ 451, 396, 365, 365, 365, 365, 665, 616, 365, 487, ++ ++ 445, 636, 396, 280, 448, 448, 448, 280, 280, 280, ++ 280, 280, 280, 280, 280, 280, 280, 280, 280, 411, ++ 615, 399, 607, 394, 396, 416, 416, 416, 416, 606, ++ 280, 291, 291, 399, 291, 291, 291, 291, 291, 291, ++ 291, 291, 291, 291, 377, 291, 291, 448, 665, 502, ++ 399, 291, 291, 291, 291, 392, 401, 400, 377, 377, ++ 377, 377, 502, 392, 392, 392, 392, 392, 401, 400, ++ 402, 600, 424, 459, 291, 291, 291, 407, 481, 407, ++ 481, 598, 402, 395, 424, 459, 671, 408, 395, 407, ++ 481, 469, 471, 408, 477, 291, 469, 471, 401, 408, ++ ++ 395, 400, 291, 291, 292, 292, 477, 482, 469, 471, ++ 729, 729, 402, 597, 377, 596, 292, 675, 292, 482, ++ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, ++ 292, 292, 292, 292, 292, 292, 292, 292, 292, 395, ++ 408, 671, 602, 459, 604, 477, 292, 293, 293, 293, ++ 293, 293, 293, 293, 293, 293, 293, 293, 293, 298, ++ 483, 530, 530, 530, 602, 675, 604, 590, 589, 588, ++ 586, 483, 298, 612, 298, 298, 298, 298, 298, 298, ++ 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, ++ 298, 298, 298, 585, 583, 612, 581, 645, 580, 645, ++ ++ 298, 335, 335, 335, 335, 335, 335, 335, 335, 335, ++ 335, 335, 335, 348, 348, 433, 348, 348, 348, 348, ++ 348, 645, 348, 348, 348, 348, 503, 348, 348, 410, ++ 483, 473, 578, 348, 348, 348, 348, 406, 406, 503, ++ 476, 410, 406, 473, 433, 406, 406, 406, 406, 406, ++ 472, 406, 470, 433, 476, 476, 348, 348, 348, 577, ++ 478, 507, 472, 348, 470, 572, 479, 567, 517, 433, ++ 472, 479, 478, 473, 566, 507, 536, 348, 348, 470, ++ 582, 410, 517, 479, 348, 348, 355, 355, 536, 355, ++ 355, 355, 355, 355, 582, 355, 355, 355, 355, 611, ++ ++ 355, 355, 470, 646, 486, 486, 355, 355, 355, 355, ++ 478, 486, 486, 486, 486, 533, 534, 533, 520, 520, ++ 520, 525, 535, 646, 659, 646, 611, 533, 534, 355, ++ 355, 355, 536, 538, 535, 525, 525, 525, 525, 539, ++ 677, 541, 564, 571, 574, 538, 659, 562, 611, 561, ++ 560, 539, 541, 535, 534, 571, 574, 355, 355, 356, ++ 356, 520, 356, 356, 356, 356, 356, 559, 356, 356, ++ 356, 356, 575, 356, 356, 538, 570, 539, 573, 356, ++ 356, 356, 356, 643, 575, 544, 544, 558, 570, 538, ++ 573, 525, 544, 544, 544, 544, 613, 643, 565, 571, ++ ++ 631, 557, 356, 356, 356, 576, 595, 570, 613, 614, ++ 677, 541, 565, 565, 565, 565, 576, 595, 556, 573, ++ 614, 555, 631, 678, 554, 553, 551, 550, 631, 575, ++ 356, 356, 390, 390, 390, 390, 390, 390, 390, 390, ++ 390, 390, 390, 390, 397, 397, 549, 397, 397, 397, ++ 397, 397, 397, 397, 397, 397, 397, 594, 397, 397, ++ 627, 547, 624, 638, 397, 397, 397, 397, 565, 594, ++ 546, 627, 545, 630, 617, 576, 595, 543, 630, 614, ++ 617, 642, 540, 537, 529, 528, 655, 397, 397, 397, ++ 624, 638, 642, 678, 397, 630, 617, 655, 693, 594, ++ ++ 668, 527, 617, 526, 524, 672, 522, 653, 397, 397, ++ 518, 668, 624, 638, 639, 397, 397, 403, 403, 652, ++ 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, ++ 627, 403, 403, 672, 516, 653, 639, 403, 403, 403, ++ 403, 515, 639, 514, 513, 512, 511, 652, 510, 509, ++ 508, 642, 652, 666, 673, 672, 655, 653, 639, 667, ++ 403, 403, 403, 653, 639, 673, 679, 680, 693, 652, ++ 668, 681, 682, 683, 684, 685, 506, 679, 680, 666, ++ 505, 666, 681, 682, 683, 684, 685, 667, 403, 403, ++ 405, 405, 504, 405, 405, 405, 405, 405, 405, 405, ++ ++ 405, 405, 405, 666, 405, 405, 501, 667, 500, 667, ++ 405, 405, 405, 405, 499, 498, 497, 496, 495, 494, ++ 493, 492, 491, 490, 673, 489, 488, 480, 475, 686, ++ 464, 463, 462, 405, 405, 405, 679, 680, 460, 458, ++ 686, 681, 682, 683, 684, 685, 687, 456, 453, 452, ++ 447, 443, 442, 688, 689, 690, 691, 687, 692, 441, ++ 437, 405, 405, 426, 688, 689, 690, 691, 436, 692, ++ 434, 431, 430, 429, 428, 427, 426, 423, 426, 426, ++ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, ++ 426, 426, 426, 426, 426, 426, 426, 439, 439, 686, ++ ++ 439, 439, 439, 439, 439, 422, 439, 439, 439, 439, ++ 421, 439, 439, 420, 419, 418, 687, 439, 439, 439, ++ 439, 417, 415, 688, 689, 690, 691, 413, 692, 412, ++ 404, 391, 383, 382, 381, 378, 376, 374, 371, 367, ++ 439, 439, 439, 362, 361, 353, 352, 351, 350, 344, ++ 343, 342, 341, 340, 339, 334, 333, 331, 326, 324, ++ 322, 321, 320, 319, 316, 315, 314, 313, 439, 439, ++ 440, 440, 310, 440, 440, 440, 440, 440, 306, 440, ++ 440, 440, 440, 296, 440, 440, 294, 278, 274, 268, ++ 440, 440, 440, 440, 266, 262, 261, 260, 259, 257, ++ ++ 256, 251, 250, 249, 238, 237, 236, 235, 232, 229, ++ 228, 227, 226, 440, 440, 440, 216, 215, 214, 213, ++ 440, 212, 209, 208, 207, 206, 205, 204, 200, 199, ++ 195, 191, 179, 170, 440, 440, 161, 150, 148, 147, ++ 145, 440, 440, 468, 468, 143, 142, 141, 140, 139, ++ 126, 125, 122, 120, 119, 468, 117, 468, 116, 468, ++ 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, ++ 468, 468, 468, 468, 468, 468, 468, 468, 474, 474, ++ 115, 474, 474, 474, 474, 474, 474, 474, 474, 474, ++ 474, 114, 474, 474, 103, 101, 97, 94, 474, 474, ++ ++ 474, 474, 93, 92, 88, 83, 80, 60, 59, 57, ++ 56, 54, 53, 45, 42, 41, 39, 24, 23, 21, ++ 20, 474, 474, 474, 18, 17, 14, 9, 3, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 474, ++ 474, 587, 587, 0, 587, 587, 587, 587, 587, 0, ++ 587, 587, 587, 587, 0, 587, 587, 0, 0, 0, ++ 0, 587, 587, 587, 587, 0, 0, 0, 0, 0, ++ 0, 587, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 587, 587, 587, 0, 0, 0, ++ ++ 0, 0, 0, 587, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 587, 587, 593, 593, 0, 593, 593, 593, ++ 593, 593, 593, 593, 593, 593, 593, 0, 593, 593, ++ 0, 0, 0, 0, 593, 593, 593, 593, 0, 0, ++ 0, 0, 0, 0, 593, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 593, 593, 593, ++ 0, 0, 0, 0, 0, 0, 593, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 593, 593, 603, 603, 0, ++ ++ 603, 603, 603, 603, 603, 0, 603, 603, 603, 603, ++ 0, 603, 603, 0, 0, 0, 0, 603, 603, 603, ++ 603, 0, 0, 0, 0, 0, 0, 603, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 603, 603, 603, 0, 0, 0, 0, 0, 0, 603, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 603, 603, ++ 610, 610, 0, 610, 610, 610, 610, 610, 610, 610, ++ 610, 610, 610, 0, 610, 610, 0, 0, 0, 0, ++ 610, 610, 610, 610, 0, 0, 0, 0, 0, 0, ++ ++ 610, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 610, 610, 610, 0, 0, 0, 0, ++ 0, 0, 610, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 610, 610, 697, 0, 0, 0, 697, 697, 0, ++ 0, 697, 697, 697, 697, 697, 697, 697, 697, 698, ++ 698, 698, 698, 698, 0, 698, 698, 698, 698, 698, ++ 698, 698, 698, 698, 698, 698, 698, 698, 699, 699, ++ 0, 0, 0, 699, 699, 699, 700, 700, 700, 700, ++ 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, ++ ++ 700, 700, 700, 700, 700, 701, 701, 701, 701, 701, ++ 701, 701, 701, 701, 701, 701, 701, 701, 701, 701, ++ 701, 701, 701, 701, 702, 702, 702, 702, 702, 702, ++ 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, ++ 702, 702, 702, 703, 0, 0, 0, 703, 703, 703, ++ 0, 703, 703, 703, 703, 703, 703, 703, 703, 704, ++ 704, 704, 704, 704, 0, 704, 704, 704, 704, 704, ++ 704, 704, 704, 704, 704, 704, 704, 704, 705, 705, ++ 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, ++ 705, 705, 705, 705, 705, 705, 705, 706, 706, 0, ++ ++ 0, 0, 0, 0, 0, 0, 0, 706, 0, 0, ++ 706, 706, 0, 706, 710, 710, 710, 710, 710, 710, ++ 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, ++ 710, 710, 710, 711, 711, 711, 711, 711, 711, 711, ++ 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, ++ 711, 711, 713, 713, 713, 713, 713, 713, 713, 713, ++ 713, 713, 713, 713, 713, 713, 713, 713, 713, 713, ++ 713, 714, 714, 714, 714, 714, 714, 714, 714, 714, ++ 714, 714, 714, 714, 714, 714, 714, 714, 714, 714, ++ 715, 715, 715, 715, 715, 715, 715, 715, 715, 715, ++ ++ 715, 715, 715, 715, 715, 715, 715, 715, 715, 716, ++ 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, ++ 716, 716, 716, 716, 716, 716, 716, 716, 717, 717, ++ 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, ++ 717, 717, 717, 717, 717, 717, 717, 718, 718, 718, ++ 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, ++ 718, 718, 718, 718, 718, 718, 719, 719, 719, 719, ++ 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, ++ 719, 719, 719, 719, 719, 720, 720, 0, 720, 720, ++ 720, 720, 720, 720, 720, 720, 720, 720, 720, 720, ++ ++ 720, 720, 720, 720, 721, 721, 0, 721, 721, 721, ++ 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, ++ 721, 721, 721, 722, 0, 722, 0, 0, 0, 722, ++ 722, 722, 0, 0, 722, 723, 723, 0, 723, 723, ++ 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, ++ 723, 723, 723, 723, 724, 724, 724, 724, 724, 724, ++ 724, 724, 724, 724, 724, 724, 724, 724, 724, 724, ++ 724, 724, 724, 725, 725, 725, 725, 725, 725, 725, ++ 725, 725, 725, 725, 725, 725, 725, 725, 725, 725, ++ 725, 725, 726, 726, 726, 726, 726, 726, 726, 726, ++ ++ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, ++ 726, 727, 727, 727, 727, 727, 727, 727, 727, 727, ++ 727, 727, 727, 727, 727, 727, 727, 727, 727, 727, ++ 728, 728, 728, 730, 0, 0, 0, 730, 0, 730, ++ 730, 730, 730, 0, 730, 731, 731, 731, 731, 731, ++ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, ++ 731, 731, 731, 731, 732, 732, 732, 732, 732, 732, ++ 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, ++ 732, 732, 732, 733, 0, 0, 0, 733, 733, 733, ++ 0, 733, 733, 733, 733, 733, 733, 733, 733, 734, ++ ++ 734, 734, 734, 734, 734, 734, 734, 734, 734, 734, ++ 734, 734, 734, 734, 734, 734, 734, 734, 735, 735, ++ 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, ++ 735, 735, 735, 735, 735, 735, 735, 736, 736, 0, ++ 736, 736, 736, 736, 736, 736, 736, 736, 736, 736, ++ 736, 736, 736, 736, 736, 736, 737, 737, 737, 737, ++ 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, ++ 737, 737, 737, 737, 737, 738, 738, 738, 738, 0, ++ 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, ++ 738, 738, 738, 738, 739, 739, 739, 739, 739, 739, ++ ++ 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, ++ 739, 739, 739, 740, 740, 0, 740, 740, 740, 740, ++ 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, ++ 740, 740, 741, 741, 0, 741, 741, 741, 741, 741, ++ 741, 741, 741, 741, 741, 741, 741, 741, 741, 741, ++ 741, 742, 0, 742, 742, 0, 0, 742, 742, 742, ++ 0, 0, 742, 743, 743, 0, 743, 743, 743, 743, ++ 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, ++ 743, 743, 744, 744, 0, 744, 744, 744, 744, 744, ++ 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, ++ ++ 744, 745, 745, 0, 745, 745, 745, 745, 745, 745, ++ 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, ++ 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, ++ 746, 746, 746, 746, 746, 746, 746, 746, 746, 747, ++ 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, ++ 747, 747, 747, 747, 747, 747, 747, 747, 748, 748, ++ 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, ++ 748, 748, 748, 748, 748, 748, 748, 749, 749, 749, ++ 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, ++ 749, 749, 749, 749, 749, 749, 750, 750, 0, 0, ++ ++ 750, 750, 0, 750, 750, 750, 750, 750, 750, 750, ++ 750, 750, 751, 0, 0, 0, 0, 0, 751, 751, ++ 751, 751, 0, 751, 752, 752, 752, 752, 752, 752, ++ 752, 752, 752, 752, 752, 752, 752, 752, 752, 752, ++ 752, 752, 752, 753, 753, 753, 753, 753, 753, 753, ++ 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, ++ 753, 753, 754, 754, 0, 754, 754, 754, 754, 754, ++ 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, ++ 754, 755, 755, 0, 755, 755, 755, 755, 755, 755, ++ 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, ++ ++ 756, 756, 0, 0, 756, 756, 756, 756, 756, 756, ++ 756, 756, 756, 756, 756, 756, 757, 757, 757, 757, ++ 0, 757, 757, 757, 757, 757, 757, 757, 757, 757, ++ 757, 757, 757, 757, 757, 758, 758, 758, 758, 758, ++ 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, ++ 758, 758, 758, 758, 759, 759, 0, 759, 759, 759, ++ 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, ++ 759, 759, 759, 760, 760, 0, 760, 760, 760, 760, ++ 760, 760, 760, 760, 760, 760, 760, 760, 760, 760, ++ 760, 760, 761, 761, 0, 761, 761, 761, 761, 761, ++ ++ 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, ++ 761, 762, 762, 0, 762, 762, 762, 762, 762, 762, ++ 762, 762, 762, 762, 762, 762, 762, 762, 762, 762, ++ 763, 763, 0, 763, 763, 763, 763, 763, 763, 763, ++ 763, 763, 763, 763, 763, 763, 763, 763, 763, 764, ++ 764, 0, 764, 764, 764, 764, 764, 764, 764, 764, ++ 764, 764, 764, 764, 764, 764, 764, 764, 765, 765, ++ 0, 765, 765, 765, 765, 765, 765, 765, 765, 765, ++ 765, 765, 765, 765, 765, 765, 765, 766, 766, 0, ++ 766, 766, 766, 766, 766, 766, 766, 766, 766, 766, ++ ++ 766, 766, 766, 766, 766, 766, 767, 767, 767, 767, ++ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, ++ 767, 767, 767, 767, 767, 768, 768, 768, 768, 768, ++ 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, ++ 768, 768, 768, 768, 769, 769, 769, 769, 769, 769, ++ 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, ++ 769, 769, 769, 770, 0, 0, 0, 0, 0, 770, ++ 770, 770, 770, 770, 770, 770, 770, 770, 771, 771, ++ 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, ++ 771, 771, 771, 771, 771, 771, 771, 772, 772, 772, ++ ++ 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, ++ 772, 772, 772, 772, 772, 772, 773, 773, 773, 773, ++ 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, ++ 773, 773, 773, 773, 773, 774, 0, 0, 0, 0, ++ 0, 774, 774, 774, 774, 775, 775, 0, 775, 775, ++ 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, ++ 775, 775, 775, 775, 776, 776, 776, 776, 776, 776, ++ 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, ++ 776, 776, 776, 777, 777, 0, 777, 777, 777, 777, ++ 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, ++ ++ 777, 777, 778, 778, 0, 778, 778, 778, 778, 778, ++ 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, ++ 778, 779, 779, 0, 779, 779, 779, 779, 779, 779, ++ 779, 779, 779, 779, 779, 779, 779, 779, 779, 779, ++ 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, ++ 780, 780, 780, 780, 780, 780, 780, 780, 780, 781, ++ 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, ++ 781, 781, 781, 781, 781, 781, 781, 781, 782, 782, ++ 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, ++ 782, 782, 782, 782, 782, 782, 782, 783, 783, 783, ++ ++ 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, ++ 783, 783, 783, 783, 783, 783, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696, ++ 696, 696, 696, 696, 696, 696, 696, 696, 696, 696 ++ } ; ++ ++static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; ++static char *yy_full_match; ++static int yy_lp; ++static int yy_looking_for_trail_begin = 0; ++static int yy_full_lp; ++static int *yy_full_state; ++#define YY_TRAILING_MASK 0x2000 ++#define YY_TRAILING_HEAD_MASK 0x4000 ++#define REJECT \ ++{ \ ++*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ ++yy_cp = yy_full_match; /* restore poss. backed-over text */ \ ++yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ ++yy_state_ptr = yy_full_state; /* restore orig. state */ \ ++yy_current_state = *yy_state_ptr; /* restore curr. state */ \ ++++yy_lp; \ ++goto find_rule; \ ++} ++#define yymore() yymore_used_but_not_detected ++#define YY_MORE_ADJ 0 ++#define YY_RESTORE_YY_MORE_OFFSET ++char *yytext; ++#define INITIAL 0 ++/* ++ * parser.l -- lex parser of algebraic chess moves for XBoard ++ * $Id: parser.l,v 2.1 2003/10/27 19:21:00 mann Exp $ ++ * ++ * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. ++ * Enhancements Copyright 1992-95 Free Software Foundation, Inc. ++ * ++ * The following terms apply to Digital Equipment Corporation's copyright ++ * interest in XBoard: ++ * ------------------------------------------------------------------------ ++ * All Rights Reserved ++ * ++ * Permission to use, copy, modify, and distribute this software and its ++ * documentation for any purpose and without fee is hereby granted, ++ * provided that the above copyright notice appear in all copies and that ++ * both that copyright notice and this permission notice appear in ++ * supporting documentation, and that the name of Digital not be ++ * used in advertising or publicity pertaining to distribution of the ++ * software without specific, written prior permission. ++ * ++ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ++ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ++ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ++ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ++ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ++ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ++ * SOFTWARE. ++ * ------------------------------------------------------------------------ ++ * ++ * The following terms apply to the enhanced version of XBoard distributed ++ * by the Free Software Foundation: ++ * ------------------------------------------------------------------------ ++ * 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 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, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ------------------------------------------------------------------------ ++ */ ++ ++/* This parser handles all forms of promotion. ++ * The parser resolves ambiguous moves by searching and check-testing. ++ * It also parses comments of the form [anything] or (anything). ++ * ++ * [HGM] Parser extensively modified for bigger boards, Shogi-like syntax, ++ * and unknow pieces. All pieces are now mandatory upper case, but can be ++ * any letter A-Z. Files must be lower case (as before), but can run upto 'l'. ++ * Ranks can be 0-9. The parser returns 0 for off-board files and ranks. ++ * For an unknown piece (as mover or promotion piece) it returns ++ * IllegalMove, like it does when the piece doesn't match. ++ * Promotions can now also be appended Shogi-style, a bare '=' or '+', ++ * and this is then returned as promotion character. The piece indicator ++ * can be prefixed by a '+' to indicate it is a promoted piece. ++ */ ++ ++#include "config.h" ++ ++#define NO_CONSTRAINT -1 ++#undef YYLMAX ++#define YYLMAX 4096 ++#define UNPUT_BUF_SIZE YYLMAX ++ ++#ifdef FLEX_SCANNER ++/* yytext is probably a char*, but could be a char[]. yy_text is set ++ in YY_DECL below, because if yytext is a char*, its value is not ++ constant. */ ++char *yy_text; ++#else /*!FLEX_SCANNER*/ ++/* yytext is definitely a char[], so yy_text can be set here, statically. */ ++char *yy_text = (char *) yytext; ++#endif ++ ++#ifdef FLEX_SCANNER ++/* This is flex */ ++/* [AP] use prototypes in function declarations */ ++#define YY_USE_PROTOS ++ ++#ifdef YY_USE_PROTOS ++#define YY_PROTO(proto) proto ++#else ++#define YY_PROTO(proto) () ++#endif ++/* end of [AP] fix */ ++ ++#undef YY_INPUT ++#define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size) ++#undef YY_DECL ++#define YY_DECL \ ++ int _yylex YY_PROTO((void)); \ ++ int yylex YY_PROTO((void)) \ ++ { \ ++ int result = _yylex(); \ ++ yy_text = (char *) yytext; \ ++ return(result); \ ++ } \ ++ int _yylex YY_PROTO((void)) ++#else ++/* This is lex */ ++#undef input ++#undef output ++#undef unput ++#endif ++ ++/* The includes must be here, below the #undef input */ ++ ++#include ++ ++#if STDC_HEADERS ++# include ++# include ++#else /* not STDC_HEADERS */ ++# if HAVE_STRING_H ++# include ++# else /* not HAVE_STRING_H */ ++# include ++# endif /* not HAVE_STRING_H */ ++#endif /* not STDC_HEADERS */ ++ ++#if HAVE_UNISTD_H ++# include ++#endif ++ ++#if defined(_amigados) ++# include ++# if HAVE_FCNTL_H ++# include /* isatty() prototype */ ++# endif /* HAVE_FCNTL_H */ ++#endif /* defined(_amigados) */ ++ ++#include "common.h" ++#include "backend.h" ++#include "frontend.h" ++#include "parser.h" ++#include "moves.h" ++ ++extern int PosFlags P((int)); ++ ++extern Board boards[MAX_MOVES]; ++int yyboardindex; ++int yyskipmoves = FALSE; ++char currentMoveString[YYLMAX]; ++#ifndef FLEX_SCANNER ++char unputBuffer[UNPUT_BUF_SIZE]; ++int unputCount = 0; ++#endif ++ ++#ifdef FLEX_SCANNER ++void my_yy_input P((char *buf, int *result, int max_size)); ++#else /*!FLEX_SCANNER*/ ++static int input P((void)); ++static void output P((int ch)); ++static void unput P((int ch)); ++int yylook P((void)); ++int yyback P((int *, int)); ++#endif ++#undef yywrap ++int yywrap P((void)); ++extern void CopyBoard P((Board to, Board from)); ++ ++ ++/* Macros after this point can all be overridden by user definitions in ++ * section 1. ++ */ ++ ++#ifndef YY_SKIP_YYWRAP ++#ifdef __cplusplus ++extern "C" int yywrap YY_PROTO(( void )); ++#else ++extern int yywrap YY_PROTO(( void )); ++#endif ++#endif ++ ++#ifndef YY_NO_UNPUT ++static void yyunput YY_PROTO(( int c, char *buf_ptr )); ++#endif ++ ++#ifndef yytext_ptr ++static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); ++#endif ++ ++#ifdef YY_NEED_STRLEN ++static int yy_flex_strlen YY_PROTO(( yyconst char * )); ++#endif ++ ++#ifndef YY_NO_INPUT ++#ifdef __cplusplus ++static int yyinput YY_PROTO(( void )); ++#else ++static int input YY_PROTO(( void )); ++#endif ++#endif ++ ++#if YY_STACK_USED ++static int yy_start_stack_ptr = 0; ++static int yy_start_stack_depth = 0; ++static int *yy_start_stack = 0; ++#ifndef YY_NO_PUSH_STATE ++static void yy_push_state YY_PROTO(( int new_state )); ++#endif ++#ifndef YY_NO_POP_STATE ++static void yy_pop_state YY_PROTO(( void )); ++#endif ++#ifndef YY_NO_TOP_STATE ++static int yy_top_state YY_PROTO(( void )); ++#endif ++ ++#else ++#define YY_NO_PUSH_STATE 1 ++#define YY_NO_POP_STATE 1 ++#define YY_NO_TOP_STATE 1 ++#endif ++ ++#ifdef YY_MALLOC_DECL ++YY_MALLOC_DECL ++#else ++#if __STDC__ ++#ifndef __cplusplus ++#include ++#endif ++#else ++/* Just try to get by without declaring the routines. This will fail ++ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) ++ * or sizeof(void*) != sizeof(int). ++ */ ++#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 (void) 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) \ ++ if ( yy_current_buffer->yy_is_interactive ) \ ++ { \ ++ int c = '*', n; \ ++ for ( n = 0; n < max_size && \ ++ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ ++ buf[n] = (char) c; \ ++ if ( c == '\n' ) \ ++ buf[n++] = (char) c; \ ++ if ( c == EOF && ferror( yyin ) ) \ ++ YY_FATAL_ERROR( "input in flex scanner failed" ); \ ++ result = n; \ ++ } \ ++ else \ ++ { \ ++ errno=0; \ ++ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ ++ { \ ++ 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 ++ ++/* Default declaration of generated scanner - a define so the user can ++ * easily add parameters. ++ */ ++#ifndef YY_DECL ++#define YY_DECL int yylex YY_PROTO(( void )) ++#endif ++ ++/* 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->yy_at_bol = \ ++ (yytext[yyleng - 1] == '\n'); \ ++ YY_USER_ACTION ++ ++YY_DECL ++ { ++ register yy_state_type yy_current_state; ++ register char *yy_cp, *yy_bp; ++ register int yy_act; ++ ++ ++ ++ ++ if ( yy_init ) ++ { ++ yy_init = 0; ++ ++#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 ) ++ yy_current_buffer = ++ 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_state_ptr = yy_state_buf; ++ *yy_state_ptr++ = yy_current_state; ++yy_match: ++ do ++ { ++ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; ++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ++ { ++ yy_current_state = (int) yy_def[yy_current_state]; ++ if ( yy_current_state >= 697 ) ++ yy_c = yy_meta[(unsigned int) yy_c]; ++ } ++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++ *yy_state_ptr++ = yy_current_state; ++ ++yy_cp; ++ } ++ while ( yy_base[yy_current_state] != 4517 ); ++ ++yy_find_action: ++ yy_current_state = *--yy_state_ptr; ++ yy_lp = yy_accept[yy_current_state]; ++find_rule: /* we branch to this label when backing up */ ++ for ( ; ; ) /* until we find what rule we matched */ ++ { ++ if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) ++ { ++ yy_act = yy_acclist[yy_lp]; ++ if ( yy_act & YY_TRAILING_HEAD_MASK || ++ yy_looking_for_trail_begin ) ++ { ++ if ( yy_act == yy_looking_for_trail_begin ) ++ { ++ yy_looking_for_trail_begin = 0; ++ yy_act &= ~YY_TRAILING_HEAD_MASK; ++ break; ++ } ++ } ++ else if ( yy_act & YY_TRAILING_MASK ) ++ { ++ yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; ++ yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; ++ } ++ else ++ { ++ yy_full_match = yy_cp; ++ yy_full_state = yy_state_ptr; ++ yy_full_lp = yy_lp; ++ break; ++ } ++ ++yy_lp; ++ goto find_rule; ++ } ++ --yy_cp; ++ yy_current_state = *--yy_state_ptr; ++ yy_lp = 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 1: ++YY_RULE_SETUP ++{ ++ /* ++ * Fully-qualified algebraic move, possibly with promotion ++ */ ++ int skip1 = 0, skip2 = 0, skip3 = 0, promoted = 0; ++ ChessSquare piece; ++ ChessMove result; ++ char c; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ if (yytext[0] == '+') skip1 = skip3 = promoted = 1; /* [HGM] Shogi promoted */ ++ ++ /* remove the / */ ++ if (yytext[1+skip1] == '/') skip1++; ++ ++ /* remove the [xX:-] */ ++ if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') || ++ (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1; ++ ++ currentMoveString[0] = yytext[1+skip1]; ++ currentMoveString[1] = yytext[2+skip1]; ++ currentMoveString[2] = yytext[3+skip1+skip2]; ++ currentMoveString[3] = yytext[4+skip1+skip2]; ++ currentMoveString[4] = NULLCHAR; ++ ++ if (appData.debugMode) { ++ fprintf(debugFP, "Parser Qa1b2: yyleng=%d\n", ++ yyleng); ++ } ++ ++ if (yyleng-skip1-skip2 > 5) { char c; ++ if (yytext[yyleng-1] == ')') { ++ c = currentMoveString[4] = ToLower(yytext[yyleng-2]); ++ } else { ++ c = currentMoveString[4] = ToLower(yytext[yyleng-1]); ++ } ++ currentMoveString[5] = NULLCHAR; ++ if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) ++ return IllegalMove; /* [HGM] promotion to invalid piece */ ++ } ++ ++ if (appData.debugMode) { ++ fprintf(debugFP, "parser: %s\n", currentMoveString); ++ } ++ /* [HGM] do not allow values beyond board size */ ++ if(currentMoveString[1] - ONE >= BOARD_HEIGHT || ++ currentMoveString[1] - ONE < 0 || ++ currentMoveString[0] - AAA >= BOARD_RGHT || ++ currentMoveString[3] - ONE >= BOARD_HEIGHT || ++ currentMoveString[3] - ONE < 0 || ++ currentMoveString[2] - AAA >= BOARD_RGHT || ++ currentMoveString[0] - AAA < BOARD_LEFT || ++ currentMoveString[2] - AAA < BOARD_LEFT ) ++ return 0; ++ ++ piece = boards[yyboardindex] ++ [currentMoveString[1] - ONE][currentMoveString[0] - AAA]; ++ if(promoted) piece = (ChessSquare) (DEMOTED piece); ++ c = PieceToChar(piece); ++ if(c == '~') c = PieceToChar((ChessSquare) (DEMOTED piece)); ++ if (ToLower(yytext[skip3]) != ToLower(c)) ++ return (int) IllegalMove; ++ ++ result = LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ initialRights, /* [HGM] assume all castlings allowed */ ++ currentMoveString[1] - ONE, ++ currentMoveString[0] - AAA, ++ currentMoveString[3] - ONE, ++ currentMoveString[2] - AAA, ++ currentMoveString[4]); ++ ++ if (currentMoveString[4] == NULLCHAR && ++ (result == WhitePromotionKnight || result == BlackPromotionKnight || ++ result == WhitePromotionQueen || result == BlackPromotionQueen)) { ++ currentMoveString[4] = PieceToChar(BlackQueen); ++ currentMoveString[5] = NULLCHAR; ++ } ++ ++ return (int) result; ++} ++ YY_BREAK ++case 2: ++YY_RULE_SETUP ++{ ++ /* ++ * Simple algebraic move, possibly with promotion ++ * [HGM] Engine moves are received in this format, with lower-case promoChar! ++ */ ++ int skip = 0; ++ ChessMove result; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ /* remove the [xX:-] */ ++ if ((yytext[2] == 'x') || (yytext[2] == 'X') || ++ (yytext[2] == '-') || (yytext[2] == ':')) skip = 1; ++ ++ currentMoveString[0] = yytext[0]; ++ currentMoveString[1] = yytext[1]; ++ currentMoveString[2] = yytext[2+skip]; ++ currentMoveString[3] = yytext[3+skip]; ++ currentMoveString[4] = NULLCHAR; ++ ++ if (yyleng-skip > 4) { char c; ++ if (yytext[yyleng-1] == ')') { ++ c = currentMoveString[4] = ToLower(yytext[yyleng-2]); ++ } else { ++ c = currentMoveString[4] = ToLower(yytext[yyleng-1]); ++ } ++ currentMoveString[5] = NULLCHAR; ++ if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) ++ return IllegalMove; ++ } ++ ++ /* [HGM] do not allow values beyond board size */ ++ if(currentMoveString[1] - ONE >= BOARD_HEIGHT || ++ currentMoveString[1] - ONE < 0 || ++ currentMoveString[0] - AAA >= BOARD_RGHT || ++ currentMoveString[3] - ONE >= BOARD_HEIGHT || ++ currentMoveString[3] - ONE < 0 || ++ currentMoveString[2] - AAA >= BOARD_RGHT || ++ currentMoveString[0] - AAA < BOARD_LEFT || ++ currentMoveString[2] - AAA < BOARD_LEFT ) ++ return 0; ++ ++ result = LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ initialRights, /* [HGM] assume all castlings allowed */ ++ currentMoveString[1] - ONE, ++ currentMoveString[0] - AAA, ++ currentMoveString[3] - ONE, ++ currentMoveString[2] - AAA, ++ currentMoveString[4]); ++ ++ if (currentMoveString[4] == NULLCHAR && ++ (result == WhitePromotionKnight || result == BlackPromotionKnight || ++ result == WhitePromotionQueen || result == BlackPromotionQueen)) { ++ if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) ++ currentMoveString[4] = PieceToChar(BlackFerz); ++ else if(gameInfo.variant == VariantGreat) ++ currentMoveString[4] = PieceToChar(BlackMan); ++ else ++ currentMoveString[4] = PieceToChar(BlackQueen); ++ currentMoveString[5] = NULLCHAR; ++ } ++ ++ return (int) result; ++} ++ YY_BREAK ++case 3: ++YY_RULE_SETUP ++{ ++ /* ++ * Pawn move, possibly with promotion ++ */ ++ DisambiguateClosure cl; ++ int skip = 0; char c; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ /* remove the =() */ ++ if (yytext[2] == '=' && yytext[3] != NULLCHAR) skip++; ++ if (yytext[2+skip] == '(') skip++; ++ ++ cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; ++ cl.rfIn = -1; ++ cl.ffIn = yytext[0] - AAA; ++ cl.rtIn = yytext[1] - ONE; ++ cl.ftIn = yytext[0] - AAA; ++ c = cl.promoCharIn = yytext[2+skip]; ++ ++ /* [HGM] do not allow values beyond board size */ ++ if(cl.rtIn >= BOARD_HEIGHT || ++ cl.rtIn < 0 || ++ cl.ffIn >= BOARD_RGHT || ++ cl.ftIn < BOARD_LEFT ) ++ return 0; ++ ++ if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) ++ return IllegalMove; ++ ++ ++ Disambiguate(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, &cl); ++ ++ currentMoveString[0] = cl.ff + AAA; ++ currentMoveString[1] = cl.rf + ONE; ++ currentMoveString[2] = cl.ft + AAA; ++ currentMoveString[3] = cl.rt + ONE; ++ currentMoveString[4] = cl.promoChar; ++ currentMoveString[5] = NULLCHAR; ++ ++ return (int) cl.kind; ++} ++ YY_BREAK ++case 4: ++YY_RULE_SETUP ++{ ++ /* ++ * Pawn capture, possibly with promotion, possibly ambiguous ++ */ ++ DisambiguateClosure cl; ++ int skip1 = 0, skip2 = 0; char c; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ /* remove trailing ep or e.p. (nonstandard PGN) */ ++ if (yytext[yyleng-1] == 'p') { ++ yyleng -= 2; ++ yytext[yyleng] = NULLCHAR; ++ } else if (yytext[yyleng-1] == '.') { ++ yyleng -= 4; ++ yytext[yyleng] = NULLCHAR; ++ } ++ ++ /* remove the [xX:-] and =() */ ++ if ((yytext[1] == 'x') || (yytext[1] == 'X') ++ || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1; ++ if (yytext[2+skip1] == '=' && yytext[3+skip1] != NULLCHAR) skip2++; ++ if (yytext[2+skip1+skip2] == '(') skip2++; ++ ++ cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; ++ cl.rfIn = -1; ++ cl.ffIn = yytext[0] - AAA; ++ cl.rtIn = -1; ++ cl.ftIn = yytext[1+skip1] - AAA; ++ c = cl.promoCharIn = yytext[2+skip1+skip2]; ++ ++ /* [HGM] do not allow values beyond board size */ ++ if(cl.ffIn >= BOARD_RGHT || ++ cl.ffIn < BOARD_LEFT || ++ cl.ftIn >= BOARD_RGHT || ++ cl.ftIn < BOARD_LEFT ) ++ return 0; ++ ++ if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare) ++ return IllegalMove; ++ ++ Disambiguate(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, &cl); ++ ++ currentMoveString[0] = cl.ff + AAA; ++ currentMoveString[1] = cl.rf + ONE; ++ currentMoveString[2] = cl.ft + AAA; ++ currentMoveString[3] = cl.rt + ONE; ++ currentMoveString[4] = cl.promoChar; ++ currentMoveString[5] = NULLCHAR; ++ ++ return (int) cl.kind; ++} ++ YY_BREAK ++case 5: ++YY_RULE_SETUP ++{ ++ /* ++ * unambiguously abbreviated Pawn capture, possibly with promotion ++ */ ++ int skip = 0; ++ ChessMove result; char c; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ /* remove trailing ep or e.p. (nonstandard PGN) */ ++ if (yytext[yyleng-1] == 'p') { ++ yyleng -= 2; ++ yytext[yyleng] = NULLCHAR; ++ } else if (yytext[yyleng-1] == '.') { ++ yyleng -= 4; ++ yytext[yyleng] = NULLCHAR; ++ } ++ ++ /* remove the [xX:-] */ ++ if ((yytext[1] == 'x') || (yytext[1] == 'X') ++ || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; ++ ++ currentMoveString[0] = yytext[0]; ++ currentMoveString[2] = yytext[1+skip]; ++ currentMoveString[3] = yytext[2+skip]; ++ ++ /* [HGM] do not allow values beyond board size */ ++ if(currentMoveString[0] - AAA >= BOARD_RGHT || ++ currentMoveString[3] - ONE >= BOARD_HEIGHT || ++ currentMoveString[3] - ONE < 0 || ++ currentMoveString[2] - AAA >= BOARD_RGHT || ++ currentMoveString[0] - AAA < BOARD_LEFT || ++ currentMoveString[2] - AAA < BOARD_LEFT ) ++ return 0; ++ ++ if (gameInfo.variant == VariantXiangqi && /* [HGM] In Xiangqi rank stays same */ ++ currentMoveString[0] != currentMoveString[2] ) { ++ currentMoveString[1] = yytext[2+skip]; ++ } else ++ if (WhiteOnMove(yyboardindex)) { ++ if (yytext[2+skip] == ONE) return (int) ImpossibleMove; ++ currentMoveString[1] = yytext[2+skip] - 1; ++ } else { ++ currentMoveString[1] = currentMoveString[3] + 1; ++ if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove; ++ } ++ if (yyleng-skip > 3) { ++ if (yytext[yyleng-1] == ')') ++ c = currentMoveString[4] = ToLower(yytext[yyleng-2]); ++ else ++ c = currentMoveString[4] = ToLower(yytext[yyleng-1]); ++ currentMoveString[5] = NULLCHAR; ++ if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare) ++ return IllegalMove; ++ } else { ++ currentMoveString[4] = NULLCHAR; ++ } ++ ++ result = LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ initialRights, /* [HGM] assume all castlings allowed */ ++ currentMoveString[1] - ONE, ++ currentMoveString[0] - AAA, ++ currentMoveString[3] - ONE, ++ currentMoveString[2] - AAA, ++ currentMoveString[4]); ++ ++ if (currentMoveString[4] == NULLCHAR && ++ (result == WhitePromotionQueen || result == BlackPromotionQueen || ++ result == WhitePromotionKnight || result == BlackPromotionKnight)) { ++ currentMoveString[4] = PieceToChar(BlackQueen); ++ // [HGM] shatranj: take care of variants without Queen ++ if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier) ++ currentMoveString[4] = PieceToChar(BlackFerz); ++ if(gameInfo.variant == VariantGreat) ++ currentMoveString[4] = PieceToChar(BlackMan); ++ currentMoveString[5] = NULLCHAR; ++ } ++ ++ if (result != IllegalMove) return (int) result; ++ ++ /* Special case: improperly written en passant capture */ ++ if (WhiteOnMove(yyboardindex)) { ++ if (currentMoveString[3] == '5') { ++ currentMoveString[1] = '5'; ++ currentMoveString[3] = '6'; ++ } else { ++ return (int) IllegalMove; ++ } ++ } else { ++ if (currentMoveString[3] == '4') { ++ currentMoveString[1] = '4'; ++ currentMoveString[3] = '3'; ++ } else { ++ return (int) IllegalMove; ++ } ++ } ++ ++ result = LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ initialRights, /* [HGM] assume all castlings allowed */ ++ currentMoveString[1] - ONE, ++ currentMoveString[0] - AAA, ++ currentMoveString[3] - ONE, ++ currentMoveString[2] - AAA, ++ currentMoveString[4]); ++ ++ if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant) ++ return (int) result; ++ else ++ return (int) IllegalMove; ++} ++ YY_BREAK ++case 6: ++YY_RULE_SETUP ++{ ++ /* ++ * piece move, possibly ambiguous ++ */ ++ DisambiguateClosure cl; ++ int skip = 0, skip2 = 0, promoted = 0; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ if(yytext[0] == '+') promoted = skip = skip2 = 1; ++ ++ /* remove the [xX:-] */ ++ if ((yytext[1+skip] == 'x') || (yytext[1+skip] == 'X') ++ || (yytext[1+skip] == ':') || (yytext[1+skip] == '-')) skip++; ++ ++ if (WhiteOnMove(yyboardindex)) { ++ cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); ++ } else { ++ cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); ++ } ++ if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); ++ ++ cl.rfIn = -1; ++ cl.ffIn = -1; ++ cl.rtIn = yytext[2+skip] - ONE; ++ cl.ftIn = yytext[1+skip] - AAA; ++ cl.promoCharIn = NULLCHAR; ++ ++ if(yyleng-skip > 3) /* [HGM] can have Shogi-style promotion */ ++ cl.promoCharIn = yytext[yyleng-1]; ++ ++ if (appData.debugMode) { ++ fprintf(debugFP, "Parser Qa1: yyleng=%d, %d(%d,%d)-(%d,%d) = %d (%c)\n", ++ yyleng, ++ cl.pieceIn,cl.ffIn,cl.rfIn,cl.ftIn,cl.rtIn,cl.promoCharIn,cl.promoCharIn?cl.promoCharIn:' '); ++ } ++ ++ /* [HGM] but do not allow values beyond board size */ ++ if(cl.rtIn >= BOARD_HEIGHT || ++ cl.rtIn < 0 || ++ cl.ftIn >= BOARD_RGHT || ++ cl.ftIn < BOARD_LEFT ) ++ return 0; ++ ++ Disambiguate(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, &cl); ++ ++ currentMoveString[0] = cl.ff + AAA; ++ currentMoveString[1] = cl.rf + ONE; ++ currentMoveString[2] = cl.ft + AAA; ++ currentMoveString[3] = cl.rt + ONE; ++ currentMoveString[4] = cl.promoChar; ++ currentMoveString[5] = NULLCHAR; ++ ++ return (int) cl.kind; ++} ++ YY_BREAK ++case 7: ++YY_RULE_SETUP ++{ ++ /* ++ * piece move with rank or file disambiguator ++ */ ++ DisambiguateClosure cl; ++ int skip = 0, skip2 = 0; int promoted=0; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ if(yytext[0]=='+') promoted = skip = skip2 = 1; ++ ++ /* remove the [xX:-] */ ++ if ((yytext[2+skip] == 'x') || (yytext[2+skip] == 'X') ++ || (yytext[2+skip] == ':') || (yytext[2+skip] == '-')) skip++; ++ ++ if (WhiteOnMove(yyboardindex)) { ++ cl.pieceIn = CharToPiece(ToUpper(yytext[skip2])); ++ } else { ++ cl.pieceIn = CharToPiece(ToLower(yytext[skip2])); ++ } ++ if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn); ++ ++ if (isalpha(yytext[1+skip2])) { ++ cl.rfIn = -1; ++ cl.ffIn = yytext[1+skip2] - AAA; ++ ++ if(cl.ffIn >= BOARD_RGHT || ++ cl.ffIn < BOARD_LEFT ) return 0; ++ } else { ++ cl.rfIn = yytext[1+skip2] - ONE; ++ cl.ffIn = -1; ++ if(cl.rfIn >= BOARD_HEIGHT || ++ cl.rfIn < 0) return 0; ++ } ++ cl.rtIn = yytext[3+skip] - ONE; ++ cl.ftIn = yytext[2+skip] - AAA; ++ cl.promoCharIn = NULLCHAR; ++ ++ if(yyleng-skip > 4) /* [HGM] can have Shogi-style promotion */ ++ cl.promoCharIn = yytext[yyleng-1]; ++ ++ /* [HGM] do not allow values beyond board size */ ++ if(cl.rtIn >= BOARD_HEIGHT || ++ cl.rtIn < 0 || ++ cl.ftIn >= BOARD_RGHT || ++ cl.ftIn < BOARD_LEFT ) ++ return 0; ++ ++ Disambiguate(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, &cl); ++ ++ currentMoveString[0] = cl.ff + AAA; ++ currentMoveString[1] = cl.rf + ONE; ++ currentMoveString[2] = cl.ft + AAA; ++ currentMoveString[3] = cl.rt + ONE; ++ currentMoveString[4] = cl.promoChar; ++ currentMoveString[5] = NULLCHAR; ++ ++ return (int) cl.kind; ++} ++ YY_BREAK ++case 8: ++YY_RULE_SETUP ++{ ++ int rf, ff, rt, ft; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ /* [HGM] all squares referenced to board edges in stead of absolute */ ++ if (WhiteOnMove(yyboardindex)) { ++ if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { ++ /* ICS wild castling */ ++ rf = 0; ++ ff = (BOARD_WIDTH-1)>>1; ++ rt = 0; ++ ft = BOARD_RGHT-3; ++ } else { ++ rf = 0; ++ ff = BOARD_WIDTH>>1; ++ rt = 0; ++ ft = BOARD_LEFT+2; ++ } ++ } else{ ++ if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { ++ /* ICS wild castling */ ++ rf = BOARD_HEIGHT-1; ++ ff = (BOARD_WIDTH-1)>>1; ++ rt = BOARD_HEIGHT-1; ++ ft = BOARD_RGHT-3; ++ } else { ++ rf = BOARD_HEIGHT-1; ++ ff = BOARD_WIDTH>>1; ++ rt = BOARD_HEIGHT-1; ++ ft = BOARD_LEFT+2; ++ } ++ } ++ if(gameInfo.variant == VariantFischeRandom) { ++ if (WhiteOnMove(yyboardindex)) { ++ ff = initialRights[2]; ++ ft = initialRights[1]; ++ } else { ++ ff = initialRights[5]; ++ ft = initialRights[4]; ++ } ++ fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); ++ if(ff < 0 || ft < 0) return 0; ++ } ++ sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); ++ if (appData.debugMode) { ++ fprintf(debugFP, "long castling %d %d\n", ff, ft); ++ } ++ return (int) LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ castlingRights[yyboardindex], /* [HGM] use true castling rights */ ++ rf, ff, rt, ft, NULLCHAR); ++} ++ YY_BREAK ++case 9: ++YY_RULE_SETUP ++{ ++ int rf, ff, rt, ft; ++ ++ if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ ++ ++ if (WhiteOnMove(yyboardindex)) { ++ if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) { ++ /* ICS wild castling */ ++ rf = 0; ++ ff = (BOARD_WIDTH-1)>>1; ++ rt = 0; ++ ft = BOARD_LEFT+1; ++ } else { ++ rf = 0; ++ ff = BOARD_WIDTH>>1; ++ rt = 0; ++ ft = BOARD_RGHT-2; ++ } ++ } else { ++ if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) { ++ /* ICS wild castling */ ++ rf = BOARD_HEIGHT-1; ++ ff = (BOARD_WIDTH-1)>>1; ++ rt = BOARD_HEIGHT-1; ++ ft = BOARD_LEFT+1; ++ } else { ++ rf = BOARD_HEIGHT-1; ++ ff = BOARD_WIDTH>>1; ++ rt = BOARD_HEIGHT-1; ++ ft = BOARD_RGHT-2; ++ } ++ } ++ if(gameInfo.variant == VariantFischeRandom) { ++ if (WhiteOnMove(yyboardindex)) { ++ ff = initialRights[2]; ++ ft = initialRights[0]; ++ } else { ++ ff = initialRights[5]; ++ ft = initialRights[3]; ++ } ++ if (appData.debugMode) { ++ fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft); ++ } ++ if(ff < 0 || ft < 0) return 0; ++ } ++ sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); ++ if (appData.debugMode) { ++ fprintf(debugFP, "short castling %d %d\n", ff, ft); ++ } ++ ++ return (int) LegalityTest(boards[yyboardindex], ++ PosFlags(yyboardindex), EP_UNKNOWN, ++ castlingRights[yyboardindex], /* [HGM] use true castling rights */ ++ rf, ff, rt, ft, NULLCHAR); ++} ++ YY_BREAK ++case 10: ++YY_RULE_SETUP ++{ ++ /* Bughouse piece drop. No legality checking for now. */ ++ currentMoveString[1] = '@'; ++ currentMoveString[2] = yytext[2]; ++ currentMoveString[3] = yytext[3]; ++ currentMoveString[4] = NULLCHAR; ++ ++ if (appData.debugMode) { ++ fprintf(debugFP, "Drop: %s\n", currentMoveString); ++ } ++ /* [HGM] do not allow values beyond board size */ ++ if(currentMoveString[3] - ONE >= BOARD_HEIGHT || ++ currentMoveString[2] - AAA >= BOARD_WIDTH ) ++ return 0; ++ ++ if (WhiteOnMove(yyboardindex)) { ++ currentMoveString[0] = ToUpper(yytext[0]); ++ return (int) WhiteDrop; ++ } else { ++ currentMoveString[0] = ToLower(yytext[0]); ++ return (int) BlackDrop; ++ } ++} ++ YY_BREAK ++case 11: ++YY_RULE_SETUP ++{ ++ if (WhiteOnMove(yyboardindex)) ++ return (int) BlackWins; ++ else ++ return (int) WhiteWins; ++} ++ YY_BREAK ++case 12: ++YY_RULE_SETUP ++{ ++ return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); ++} ++ YY_BREAK ++case 13: ++YY_RULE_SETUP ++{ ++ return (int) GameUnfinished; ++} ++ YY_BREAK ++case 14: ++YY_RULE_SETUP ++{ ++ return (int) GameIsDrawn; ++} ++ YY_BREAK ++case 15: ++YY_RULE_SETUP ++{ ++ return (int) GameIsDrawn; ++} ++ YY_BREAK ++case 16: ++YY_RULE_SETUP ++{ ++ if (WhiteOnMove(yyboardindex)) ++ return (int) BlackWins; ++ else ++ return (int) WhiteWins; ++} ++ YY_BREAK ++case 17: ++YY_RULE_SETUP ++{ ++ if (WhiteOnMove(yyboardindex)) ++ return (int) BlackWins; ++ else ++ return (int) WhiteWins; ++} ++ YY_BREAK ++case 18: ++YY_RULE_SETUP ++{ ++ return (int) GameIsDrawn; ++} ++ YY_BREAK ++case 19: ++YY_RULE_SETUP ++{ ++ return (int) GameIsDrawn; ++} ++ YY_BREAK ++case 20: ++YY_RULE_SETUP ++{ ++ return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins); ++} ++ YY_BREAK ++case 21: ++YY_RULE_SETUP ++{ ++ return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); ++} ++ YY_BREAK ++case 22: ++YY_RULE_SETUP ++{ ++ return (int) WhiteWins; ++} ++ YY_BREAK ++case 23: ++YY_RULE_SETUP ++{ ++ return (int) BlackWins; ++} ++ YY_BREAK ++case 24: ++YY_RULE_SETUP ++{ ++ return (int) GameIsDrawn; ++} ++ YY_BREAK ++case 25: ++YY_RULE_SETUP ++{ ++ return (int) GameUnfinished; ++} ++ YY_BREAK ++case 26: ++YY_RULE_SETUP ++{ ++ /* move numbers */ ++ if ((yyleng == 1) && (yytext[0] == '1')) ++ return (int) MoveNumberOne; ++} ++ YY_BREAK ++case 27: ++YY_RULE_SETUP ++{ ++ /* elapsed time indication, e.g. (0:12) or {10:21.071} */ ++ return (int) ElapsedTime; ++} ++ YY_BREAK ++case 28: ++YY_RULE_SETUP ++{ ++ /* position diagram enclosed in [-- --] */ ++ return (int) PositionDiagram; ++} ++ YY_BREAK ++case 29: ++*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ ++yy_c_buf_p = yy_cp -= 1; ++YY_DO_BEFORE_ACTION; /* set up yytext again */ ++YY_RULE_SETUP ++{ ++ /* position diagram enclosed in {-- --} */ ++ return (int) PositionDiagram; ++} ++ YY_BREAK ++case 30: ++YY_RULE_SETUP ++{ ++ return (int) PGNTag; ++} ++ YY_BREAK ++case 31: ++YY_RULE_SETUP ++{ ++ return (int) GNUChessGame; ++} ++ YY_BREAK ++case 32: ++*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ ++yy_c_buf_p = yy_cp -= 1; ++YY_DO_BEFORE_ACTION; /* set up yytext again */ ++YY_RULE_SETUP ++{ ++ return (int) XBoardGame; ++} ++ YY_BREAK ++case 33: ++YY_RULE_SETUP ++{ /* numeric annotation glyph */ ++ return (int) NAG; ++} ++ YY_BREAK ++case 34: ++YY_RULE_SETUP ++{ /* anything in {} */ ++ return (int) Comment; ++} ++ YY_BREAK ++case 35: ++*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ ++yy_c_buf_p = yy_cp -= 1; ++YY_DO_BEFORE_ACTION; /* set up yytext again */ ++YY_RULE_SETUP ++{ /* ; to end of line */ ++ return (int) Comment; ++} ++ YY_BREAK ++case 36: ++YY_RULE_SETUP ++{ /* anything in [] */ ++ return (int) Comment; ++} ++ YY_BREAK ++case 37: ++YY_RULE_SETUP ++{ /* nested () */ ++ return (int) Comment; ++} ++ YY_BREAK ++case 38: ++YY_RULE_SETUP ++{ /* >=2 chars in () */ ++ return (int) Comment; ++} ++ YY_BREAK ++case 39: ++YY_RULE_SETUP ++{ ++ /* Skip mail headers */ ++} ++ YY_BREAK ++case 40: ++YY_RULE_SETUP ++{ ++ /* Skip random words */ ++} ++ YY_BREAK ++case 41: ++YY_RULE_SETUP ++{ ++ /* Skip everything else */ ++} ++ YY_BREAK ++case 42: ++YY_RULE_SETUP ++ECHO; ++ YY_BREAK ++ case YY_STATE_EOF(INITIAL): ++ 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->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->yy_n_chars; ++ yy_current_buffer->yy_input_file = yyin; ++ yy_current_buffer->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->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->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() ++ { ++ register char *dest = yy_current_buffer->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->yy_ch_buf[yy_n_chars + 1] ) ++ YY_FATAL_ERROR( ++ "fatal flex scanner internal error--end of buffer missed" ); ++ ++ if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; ++ ++ else ++ { ++ int num_to_read = ++ yy_current_buffer->yy_buf_size - number_to_move - 1; ++ ++ while ( num_to_read <= 0 ) ++ { /* Not enough room in the buffer - grow it. */ ++#ifdef YY_USES_REJECT ++ YY_FATAL_ERROR( ++"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); ++#else ++ ++ /* 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 ) ++ { ++ int 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. */ ++ yy_flex_realloc( (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->yy_buf_size - ++ number_to_move - 1; ++#endif ++ } ++ ++ if ( num_to_read > YY_READ_BUF_SIZE ) ++ num_to_read = YY_READ_BUF_SIZE; ++ ++ /* Read in more data. */ ++ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), ++ yy_n_chars, num_to_read ); ++ ++ yy_current_buffer->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->yy_buffer_status = ++ YY_BUFFER_EOF_PENDING; ++ } ++ } ++ ++ else ++ ret_val = EOB_ACT_CONTINUE_SCAN; ++ ++ yy_n_chars += number_to_move; ++ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; ++ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; ++ ++ yytext_ptr = &yy_current_buffer->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() ++ { ++ register yy_state_type yy_current_state; ++ register char *yy_cp; ++ ++ yy_current_state = yy_start; ++ yy_current_state += YY_AT_BOL(); ++ yy_state_ptr = yy_state_buf; ++ *yy_state_ptr++ = yy_current_state; ++ ++ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) ++ { ++ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ++ { ++ yy_current_state = (int) yy_def[yy_current_state]; ++ if ( yy_current_state >= 697 ) ++ yy_c = yy_meta[(unsigned int) yy_c]; ++ } ++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++ *yy_state_ptr++ = yy_current_state; ++ } ++ ++ 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 ); ++ */ ++ ++#ifdef YY_USE_PROTOS ++static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) ++#else ++static yy_state_type yy_try_NUL_trans( yy_current_state ) ++yy_state_type yy_current_state; ++#endif ++ { ++ register int yy_is_jam; ++ ++ register YY_CHAR yy_c = 1; ++ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) ++ { ++ yy_current_state = (int) yy_def[yy_current_state]; ++ if ( yy_current_state >= 697 ) ++ yy_c = yy_meta[(unsigned int) yy_c]; ++ } ++ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++ yy_is_jam = (yy_current_state == 696); ++ if ( ! yy_is_jam ) ++ *yy_state_ptr++ = yy_current_state; ++ ++ return yy_is_jam ? 0 : yy_current_state; ++ } ++ ++ ++#ifndef YY_NO_UNPUT ++#ifdef YY_USE_PROTOS ++static void yyunput( int c, register char *yy_bp ) ++#else ++static void yyunput( c, yy_bp ) ++int c; ++register char *yy_bp; ++#endif ++ { ++ register char *yy_cp = yy_c_buf_p; ++ ++ /* undo effects of setting up yytext */ ++ *yy_cp = yy_hold_char; ++ ++ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) ++ { /* need to shift things up to make room */ ++ /* +2 for EOB chars. */ ++ register int number_to_move = yy_n_chars + 2; ++ register char *dest = &yy_current_buffer->yy_ch_buf[ ++ yy_current_buffer->yy_buf_size + 2]; ++ register char *source = ++ &yy_current_buffer->yy_ch_buf[number_to_move]; ++ ++ while ( source > yy_current_buffer->yy_ch_buf ) ++ *--dest = *--source; ++ ++ yy_cp += (int) (dest - source); ++ yy_bp += (int) (dest - source); ++ yy_current_buffer->yy_n_chars = ++ yy_n_chars = yy_current_buffer->yy_buf_size; ++ ++ if ( yy_cp < yy_current_buffer->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; ++ } ++#endif /* ifndef YY_NO_UNPUT */ ++ ++ ++#ifdef __cplusplus ++static int yyinput() ++#else ++static int input() ++#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->yy_ch_buf[yy_n_chars] ) ++ /* This was really a NUL. */ ++ *yy_c_buf_p = '\0'; ++ ++ else ++ { /* need more input */ ++ int 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 ); ++ ++ /* fall through */ ++ ++ case EOB_ACT_END_OF_FILE: ++ { ++ if ( yywrap() ) ++ return EOF; ++ ++ 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->yy_at_bol = (c == '\n'); ++ ++ return c; ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++void yyrestart( FILE *input_file ) ++#else ++void yyrestart( input_file ) ++FILE *input_file; ++#endif ++ { ++ if ( ! yy_current_buffer ) ++ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); ++ ++ yy_init_buffer( yy_current_buffer, input_file ); ++ yy_load_buffer_state(); ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) ++#else ++void yy_switch_to_buffer( new_buffer ) ++YY_BUFFER_STATE new_buffer; ++#endif ++ { ++ 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->yy_buf_pos = yy_c_buf_p; ++ yy_current_buffer->yy_n_chars = yy_n_chars; ++ } ++ ++ yy_current_buffer = 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; ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++void yy_load_buffer_state( void ) ++#else ++void yy_load_buffer_state() ++#endif ++ { ++ yy_n_chars = yy_current_buffer->yy_n_chars; ++ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; ++ yyin = yy_current_buffer->yy_input_file; ++ yy_hold_char = *yy_c_buf_p; ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) ++#else ++YY_BUFFER_STATE yy_create_buffer( file, size ) ++FILE *file; ++int size; ++#endif ++ { ++ YY_BUFFER_STATE b; ++ ++ b = (YY_BUFFER_STATE) yy_flex_alloc( 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 *) yy_flex_alloc( 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; ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++void yy_delete_buffer( YY_BUFFER_STATE b ) ++#else ++void yy_delete_buffer( b ) ++YY_BUFFER_STATE b; ++#endif ++ { ++ if ( ! b ) ++ return; ++ ++ if ( b == yy_current_buffer ) ++ yy_current_buffer = (YY_BUFFER_STATE) 0; ++ ++ if ( b->yy_is_our_buffer ) ++ yy_flex_free( (void *) b->yy_ch_buf ); ++ ++ yy_flex_free( (void *) b ); ++ } ++ ++ ++#ifndef _WIN32 ++#include ++#else ++#ifndef YY_ALWAYS_INTERACTIVE ++#ifndef YY_NEVER_INTERACTIVE ++extern int isatty YY_PROTO(( int )); ++#endif ++#endif ++#endif ++ ++#ifdef YY_USE_PROTOS ++void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) ++#else ++void yy_init_buffer( b, file ) ++YY_BUFFER_STATE b; ++FILE *file; ++#endif ++ ++ ++ { ++ yy_flush_buffer( b ); ++ ++ b->yy_input_file = file; ++ b->yy_fill_buffer = 1; ++ ++#if YY_ALWAYS_INTERACTIVE ++ b->yy_is_interactive = 1; ++#else ++#if YY_NEVER_INTERACTIVE ++ b->yy_is_interactive = 0; ++#else ++ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; ++#endif ++#endif ++ } ++ ++ ++#ifdef YY_USE_PROTOS ++void yy_flush_buffer( YY_BUFFER_STATE b ) ++#else ++void yy_flush_buffer( b ) ++YY_BUFFER_STATE b; ++#endif ++ ++ { ++ 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(); ++ } ++ ++ ++#ifndef YY_NO_SCAN_BUFFER ++#ifdef YY_USE_PROTOS ++YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) ++#else ++YY_BUFFER_STATE yy_scan_buffer( base, size ) ++char *base; ++yy_size_t size; ++#endif ++ { ++ 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) yy_flex_alloc( 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; ++ } ++#endif ++ ++ ++#ifndef YY_NO_SCAN_STRING ++#ifdef YY_USE_PROTOS ++YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) ++#else ++YY_BUFFER_STATE yy_scan_string( yy_str ) ++yyconst char *yy_str; ++#endif ++ { ++ int len; ++ for ( len = 0; yy_str[len]; ++len ) ++ ; ++ ++ return yy_scan_bytes( yy_str, len ); ++ } ++#endif ++ ++ ++#ifndef YY_NO_SCAN_BYTES ++#ifdef YY_USE_PROTOS ++YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) ++#else ++YY_BUFFER_STATE yy_scan_bytes( bytes, len ) ++yyconst char *bytes; ++int len; ++#endif ++ { ++ YY_BUFFER_STATE b; ++ char *buf; ++ yy_size_t n; ++ int i; ++ ++ /* Get memory for full buffer, including space for trailing EOB's. */ ++ n = len + 2; ++ buf = (char *) yy_flex_alloc( n ); ++ if ( ! buf ) ++ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); ++ ++ for ( i = 0; i < len; ++i ) ++ buf[i] = bytes[i]; ++ ++ buf[len] = buf[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; ++ } ++#endif ++ ++ ++#ifndef YY_NO_PUSH_STATE ++#ifdef YY_USE_PROTOS ++static void yy_push_state( int new_state ) ++#else ++static void yy_push_state( new_state ) ++int new_state; ++#endif ++ { ++ if ( yy_start_stack_ptr >= yy_start_stack_depth ) ++ { ++ yy_size_t new_size; ++ ++ yy_start_stack_depth += YY_START_STACK_INCR; ++ new_size = yy_start_stack_depth * sizeof( int ); ++ ++ if ( ! yy_start_stack ) ++ yy_start_stack = (int *) yy_flex_alloc( new_size ); ++ ++ else ++ yy_start_stack = (int *) yy_flex_realloc( ++ (void *) yy_start_stack, new_size ); ++ ++ if ( ! yy_start_stack ) ++ YY_FATAL_ERROR( ++ "out of memory expanding start-condition stack" ); ++ } ++ ++ yy_start_stack[yy_start_stack_ptr++] = YY_START; ++ ++ BEGIN(new_state); ++ } ++#endif ++ ++ ++#ifndef YY_NO_POP_STATE ++static void yy_pop_state() ++ { ++ if ( --yy_start_stack_ptr < 0 ) ++ YY_FATAL_ERROR( "start-condition stack underflow" ); ++ ++ BEGIN(yy_start_stack[yy_start_stack_ptr]); ++ } ++#endif ++ ++ ++#ifndef YY_NO_TOP_STATE ++static int yy_top_state() ++ { ++ return yy_start_stack[yy_start_stack_ptr - 1]; ++ } ++#endif ++ ++#ifndef YY_EXIT_FAILURE ++#define YY_EXIT_FAILURE 2 ++#endif ++ ++#ifdef YY_USE_PROTOS ++static void yy_fatal_error( yyconst char msg[] ) ++#else ++static void yy_fatal_error( msg ) ++char msg[]; ++#endif ++ { ++ (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. */ \ ++ yytext[yyleng] = yy_hold_char; \ ++ yy_c_buf_p = yytext + n; \ ++ yy_hold_char = *yy_c_buf_p; \ ++ *yy_c_buf_p = '\0'; \ ++ yyleng = n; \ ++ } \ ++ while ( 0 ) ++ ++ ++/* Internal utility routines. */ ++ ++#ifndef yytext_ptr ++#ifdef YY_USE_PROTOS ++static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) ++#else ++static void yy_flex_strncpy( s1, s2, n ) ++char *s1; ++yyconst char *s2; ++int n; ++#endif ++ { ++ register int i; ++ for ( i = 0; i < n; ++i ) ++ s1[i] = s2[i]; ++ } ++#endif ++ ++#ifdef YY_NEED_STRLEN ++#ifdef YY_USE_PROTOS ++static int yy_flex_strlen( yyconst char *s ) ++#else ++static int yy_flex_strlen( s ) ++yyconst char *s; ++#endif ++ { ++ register int n; ++ for ( n = 0; s[n]; ++n ) ++ ; ++ ++ return n; ++ } ++#endif ++ ++ ++#ifdef YY_USE_PROTOS ++static void *yy_flex_alloc( yy_size_t size ) ++#else ++static void *yy_flex_alloc( size ) ++yy_size_t size; ++#endif ++ { ++ return (void *) malloc( size ); ++ } ++ ++#ifdef YY_USE_PROTOS ++static void *yy_flex_realloc( void *ptr, yy_size_t size ) ++#else ++static void *yy_flex_realloc( ptr, size ) ++void *ptr; ++yy_size_t size; ++#endif ++ { ++ /* 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 ); ++ } ++ ++#ifdef YY_USE_PROTOS ++static void yy_flex_free( void *ptr ) ++#else ++static void yy_flex_free( ptr ) ++void *ptr; ++#endif ++ { ++ free( ptr ); ++ } ++ ++#if YY_MAIN ++int main() ++ { ++ yylex(); ++ return 0; ++ } ++#endif ++ ++ ++ ++static char *StringToLex; ++ ++#ifndef FLEX_SCANNER ++static FILE *lexFP; ++ ++static int input() ++{ ++ int ret; ++ ++ if (StringToLex != NULL) { ++ ret = *StringToLex; ++ if (ret == NULLCHAR) ++ ret = EOF; ++ else ++ StringToLex++; ++ } else if (unputCount > 0) { ++ ret = unputBuffer[--unputCount]; ++ } else { ++ ret = fgetc(lexFP); ++ } ++ ++ if (ret == EOF) ++ return 0; ++ else ++ return ret; ++} ++ ++/* ++ * Return offset of next pattern within current file ++ */ ++int yyoffset() ++{ ++ int offset = ftell(lexFP) - unputCount; ++ ++ if (offset < 0) { ++ offset = 0; ++ } ++ return(offset); ++} ++ ++static void output(ch) ++ int ch; ++{ ++ fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", ++ ch, ch); ++} ++ ++static void unput(ch) ++ int ch; ++{ ++ if (ch == 0) return; ++ if (StringToLex != NULL) { ++ StringToLex--; ++ } else { ++ if (unputCount >= UNPUT_BUF_SIZE) ++ fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", ++ ch, ch); ++ unputBuffer[unputCount++] = ch; ++ } ++} ++ ++/* Get ready to lex from a new file. Kludge below sticks ++ an artificial newline at the front of the file, which the ++ above grammar ignores, but which makes ^ at start of pattern ++ match at the real start of the file. ++*/ ++void yynewfile(f) ++ FILE *f; ++{ ++ lexFP = f; ++ StringToLex = NULL; ++ unputCount = 0; ++ unput('\n'); /* kludge */ ++} ++ ++/* Get ready to lex from a string. ^ at start of pattern WON'T ++ match at the start of the string! ++*/ ++void yynewstr(s) ++ char *s; ++{ ++ lexFP = NULL; ++ StringToLex = s; ++ unputCount = 0; ++} ++#endif /*!FLEX_SCANNER*/ ++ ++#ifdef FLEX_SCANNER ++void my_yy_input(buf, result, max_size) ++ char *buf; ++ int *result; ++ int max_size; ++{ ++ int count; ++ ++ if (StringToLex != NULL) { ++ count = 0; ++ while (*StringToLex != NULLCHAR) { ++ *buf++ = *StringToLex++; ++ count++; ++ } ++ *result = count; ++ return; ++ } else { ++ count = fread(buf, 1, max_size, yyin); ++ if (count == 0) { ++ *result = YY_NULL; ++ } else { ++ *result = count; ++ } ++ return; ++ } ++} ++ ++static YY_BUFFER_STATE my_file_buffer = NULL; ++ ++/* ++ Return offset of next pattern in the current file. ++*/ ++int yyoffset() ++{ ++ int pos = yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf; ++ ++ return(ftell(YY_CURRENT_BUFFER->yy_input_file) - ++ yy_n_chars + pos); ++} ++ ++ ++void yynewstr(s) ++ char *s; ++{ ++ if (my_file_buffer != NULL) ++ yy_delete_buffer(my_file_buffer); ++ StringToLex = s; ++ my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE); ++ yy_switch_to_buffer(my_file_buffer); ++} ++ ++void yynewfile(f) ++ FILE *f; ++{ ++ if (my_file_buffer != NULL) ++ yy_delete_buffer(my_file_buffer); ++ StringToLex = NULL; ++ my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE); ++ yy_switch_to_buffer(my_file_buffer); ++} ++#endif /*FLEX_SCANNER*/ ++ ++int yywrap() ++{ ++ return TRUE; ++} ++ ++/* Parse a move from the given string s */ ++/* ^ at start of pattern WON'T work here unless using flex */ ++ChessMove yylexstr(boardIndex, s) ++ int boardIndex; ++ char *s; ++{ ++ ChessMove ret; ++ char *oldStringToLex; ++#ifdef FLEX_SCANNER ++ YY_BUFFER_STATE buffer, oldBuffer; ++#endif ++ ++ yyboardindex = boardIndex; ++ oldStringToLex = StringToLex; ++ StringToLex = s; ++#ifdef FLEX_SCANNER ++ buffer = yy_create_buffer(stdin, YY_BUF_SIZE); ++ oldBuffer = YY_CURRENT_BUFFER; ++ yy_switch_to_buffer(buffer); ++#endif /*FLEX_SCANNER*/ ++ ++ ret = (ChessMove) yylex(); ++ ++#ifdef FLEX_SCANNER ++ if (oldBuffer != NULL) ++ yy_switch_to_buffer(oldBuffer); ++ yy_delete_buffer(buffer); ++#endif /*FLEX_SCANNER*/ ++ StringToLex = oldStringToLex; ++ ++ return ret; ++} diff --cc winboard/readme.txt index 0000000,b22e6b4..e05ed40 mode 000000,100644..100644 --- a/winboard/readme.txt +++ b/winboard/readme.txt @@@ -1,0 -1,240 +1,289 @@@ ++ WinBoard 4.3.16 RELEASE NOTES ++ ++Compared to version 4.3.15 described below, this version features ++ ++New command-line options ++/niceEngines=N for adjusting the priority of engine processes so they don't soak up all your system resources ++/firstOptions="..." Allows the setting of options that engines define through the feature option="..." commands ++/secondOptions="..." ++/firstLogo=filename.bmp Displays the mentioned bitmap next to the clock (with H:W =1:2 aspect ratio) (WB only) ++/secondLogo=filename.bmp ++/autoLogo=false get logo files automatically from engineDirectory\logo.bmp ++ ++General enhancements: ++* New WB-protocol command: 'feature option="NAME -TYPE VALUE OTHER"', which engines can use to define options ++* New WB-protocol command: 'option NAME VALUE' used to set value of engine-defned options. ++* implements /delayAfterQuit and /delayBeforeQuit in XBoard, and uses SIGKILL to terminate rogue engine processes ++ ++ ++ ++ WinBoard 4.3.15 RELEASE NOTES ++ ++Compared to version 4.3.14k described below, this version features ++ ++New command-line options ++/rewindIndex=N (for the new auto-increment mode of the loadGameIndex or loadPositionIndex in match mode) ++/sameColorGames=N (for playing a match where the same player has white all the time) ++/egtFormats="..." (for specifying where various end-game tables are installed on the computer) ++ ++New menu items +++ Time-odds factors can be set in the time-control dialog +++ Nr of CPUs for SMP engines can be set in the Options -> UCI dialog +++ Own-Book options can be switched from the Options -> UCI dialog +++ The ScoreIsAbs options can be set from the Options -> Engine dialog +++ New-Variant menu adds Superchess ++ ++General Enhancements: ++* WinBoard engines can now also use the Polyglot opening book (implemented as general GUI book) ++* New WB-protocol commands memory, cores and egtpath make interactive setting of these parameters ++ possible on WB engines ++* New Polyglot is available that relays the interactive setting of these parameters to UCI engines ++* Match mode suports an auto-increment mode, so that all games or positions from a file can be played ++* Draw claims with Kings and an arbitrary number of like Bishops (e.g. KBBKB) are accepted ++ ++The source tree in original xboard 4.2.7 format can now be compiled under Cygwin with the aid ++of the cygwin.mak file in the ~/winboard/ subdirectory of the source releasy, after you put ++the hep-file from an executabl distribution there. Maefiles for other compilers are not updated ++since 4.2.7, as I do not have those compilers. ++ ++ + WinBoard 4.3.14k RELEASE NOTES + + Compared to version 4.3.13 described below, this version features + + New command-line options: + /autoKibitz (for relaying the PV info of the engine to the ICS) + /userName="..." (for setting the name of the Human player, also as menu) + /engineDebugOutput=N (controlling the writing of engine output to debug file) + /firstNPS=N (for time management by node count or CPU time) + /secondNPS=N (likewise for the other engine) + + New Menu items + + Enter Username (same as /userName command-line option) + + Save Diagram (for saving the Chessboard display as bitmap file) + + Machine Both (not implemented yet, but menu item already provided) + + New-Variant menu adds CRC, Janus and Berolina (the latter only with legality testing off!) + + Any variant can be played from a shuffled opening setup + + Bugfixes: + * Problems with switching the variant in ICS zippy mode solved + * In ICS observing mode game history is now fully accessible + * Moves are not fed to engine in zippy mode, when observing a game from a variant unknown to the engine + * a problem with loading PGN of FRC games with move disambiguation and initial castling rights was fixed. -* A bug in the clock display that mad previous versions of WinBoard crash for tiny displays is fixed ++* A bug in the clock display that made previous versions of WinBoard crash for tiny displays is fixed + + General enhancements: + * variant name displayed in title bar in ICS mode, when not 'normal' + * when receiving a challenge in ICS zippy mode, it is checked if the engine supports the variant (/zippyVariants="..." can still be used to limit the allowed variants, and for protocol-1 engines is still the only thing to go on) + * when loading a game from a PGN file, WB automatically switches to the variant specified in the PGN tags + * when starting from a loaded position (using /loadPositionFile), this position will be used on subsequent 'New Game' commands as well (until we switch variant) + + New is also that the source tree is now brought back in the original WinBoard 4.2.7 format, including + xboard source files. Note, however, that the xboard sources are from an older date, and I did not test + if they still compile together with the much newer backend sources. I did add code in xboard.c to recognize + the new command-line options I added since then, and in so far they are back-end options that should be enough + to make them work. This is completely untested, though; I did not even try to compile it. Last time anyone + built a working xboard.exe from this was at a stage where WinBoard did have adjustable board size, allowing + it to play Xiangqi. But no crazyhouse holdings yet. + + WinBoard 4.3.13a RELEASE NOTES + + This version of WinBoard_F fixes several bugs in 4.3.12, and also addse a few new features. + The new features include: + - some more fairy pieces, so that each side now has 22 piece types in stead of 17, + making most fairy pieces available in board size "petite" (next to "bulky" and "middling"), + making the ArchBishop and Chancellor, as well as one wildcard piece (the Lance) available in all + sizes from "petite" to "bulky". + - The FRC support is fully fixed, both in local and ICS mode. + - A mechanism is provided for safe draw claiming in cases where a 3-fold repetition woud occur only + after your own move. In this case a draw will be awarded by WinBoard if the engine sends "offer draw" + before making its move. + - Genuine draw offers are not passed on immediately to the opponent but held up to when the offerer announces + its move. + - Variants FRC, Cylinder and Falcon are added to the "New Variant..." menu. + - Support for playing time-odds games is added. (Options /firstTimeOdds, /secondTimeOdds, /timeOddsMode) + - A mechanism is provided for attaching WinBoard options to the engine command, to create options that + follow the engine (e.g. time odds) in a tournament run under a tournament manager. + Bugfixes include: + - Shatranj in ICS mode (did not work at all before) + - Some draw adjudications (QRKR was mistaken for KRKR, and KBKB with like Bishops is now recognized) + - time info in the PGN is now correct + + + COMPILING + + This version was developed using gcc under cygwin. To compile, the following set of commands was used, + given from the directory where all the source files are: + flex -oparser.o -L parser.l + windres --use-temp-file --include-dir . winboard.rc -O coff -o wbres.o + gcc -O2 -mno-cygwin -mwindows -c *.c + gcc -mno-cygwin -mwindows *.o -lwsock32 -lwinmm -o winboard.exe + strip winboard.exe + rm *.o + The first command is only needed to produce a new parser.c from the parser.l. The parser.c is included + in this release, so you only need flex if you want to modify the parser. + The windres command builds the resource file wbres.o from winboard.rc and all bitmaps and sound files in + the sub-directories. + This release should be completely self-sufficient; no source files from other releases are needed, + even the unmodified files are included here, + + DESCRIPTION + + This WinBoard (beta-)version is derived from Allessandro Scotti's Winboard_x, and supports the following new options, mainly in the area of adjudication of engine-engine games, improved Crazyhouse support, and allowing variants with non-conventional pieces and or board sizes. (All option are shown here with their default values): + + /variant=normal + This (already existing) option has been expanded with several new variants, involving non-conventional pieces and deviating board sizes. The board size is automatically adapted to the selected variant, unless explicitly overruled (see below). The new variants are (with default board size, files x ranks, in parentheses): + + variant name Game board description + knightmate Knightmate (8x8) Variant where the King moves as a Knight, and vice versa + capablanca Capablanca Chess (10x8) Variant featuring Archbishop and Chancellor as new pieces + gothic Gothic Chess (10x8) Same as Capablanca, with a more interesting opening position + courier Courier Chess (12x8) a Medieval form that combines elements of Shatranj and modern Chess + shogi Shogi (9x9) Japanese Chess + xiangqi Xiangqi (9x10) Chinese Chess + fairy Fairy Chess (8x8) Variant were you can use all pieces of other variants together + fischerandom FRC (8x8) Shuffle variant with generalized castling rule + cylinder Cylinder Chess (8x8) left and right board edge are connected + falcon Falcon Chess (10x8) a patented variant featuring two Falcon pieces + + The variant can be set from the newly added "File -> New Variant..." sub-menu. + Extra board files are indicated by the letters i, j, k, l, ... For boards with more than 9 ranks, the counting starts at zero! More than 10 ranks is not tested and unlikely to work in the area of PGN saving / reading. Non-FIDE pieces will be referred to in FENs and PGN by letters that depend on the variant, and might collide with piece designators in other variants. E.g. in Xiangqi 'C' is a Cannon, in Capablanca Chess it is a Chancellor. Pieces that do not belong in a variant cannot be addressed in FEN and PGN either, for as long as that variant is selected, unless the letter assignment is overruled with the aid of the /pieceToCharTable option. The variant is not saved in the winboard.ini file; on start-up we always get variant "normal" unless we use the command-line option, or have added the option to the winboard.ini file manually (in which case it will disappear when this file is overwritten by WinBoard saving its options). + WinBoard_F knows the movement of all pieces occurring in Capablanca Chess (of which FIDE Chess is a subset), Shatranj, Courier, Xiangqi and 9x9 Shogi, so that these games can be played with legality testing enabled. + + /pieceToCharTable="PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk" (*********** ALTERED IN 4.3.13 *******) + Each piece that WinBoard knows (in its legality test) has a letter associated with it, by which it will be referred to in FEN or PGN. The default assignment can be overruled with this option. The value has to be a string of even length, with at least 12 characters. The first half of the string designates the white pieces, the second half the black. + The last letter for each color will be assigned to the King. (This is the piece that moves as an orthodox King; note that Nightmate and Xiangqi have a different royal piece.) All letters before it will be assigned to the other pieces in the order: + + P Pawn (move often depends on variant) + N Knight (move subtly different in Xiangqi (where it is written as H) or Shogi) + B Bishop + R Rook + Q Queen (Lance L in Shogi) + F Ferz/General (The Shatranj 'Queen' and Xiangqi 'Adviser', used for Silver General S in Shogi.) + E Alfil/Elephant (Moves subtly different in Xiangqi vs Shatranj/Courier) + A Archbishop/Cardinal + C Chancellor/Marshall + W Wazir/GrandVizer (Gold General G in Shogi, in Xiangqi it is royal and denoted by K) + M Commoner/Man + O Cannon/Pao + H Nightrider (Promoted Knight in Shogi and CrazyHouse) + I (Promoted Bishop in Shogi and CrazyHouse) + J (Promoted Rook in Shogi and CrazyHouse) + G Grasshopper (Promoted Queen in Crazyhouse, promoted Lance in Shogi) + D Dabbaba (Promoted Silver in Shogi) + V Falcon wildcard + L Lance wildcard + S Snake wildcard + U Unicorn (representation of Royal Knight in Knightmate, used as promoted Pawn in Shogi) + K King + + NOTE THIS ORDER HAS BEEN ALTERED IN 4.3.13 compred to 4.3.12. Sorry about that; this was unavoidable to accomodate an engine that can play a Crazyhouse version of Capablanca Chess. This made it impossible to continue using the Archbishop and Chancellor as promoted versions of Bishop and Rook. + + NEW IN 4.3.13 is the concept of a wildcard piece: WinBoard will accept any move of such a piece as legal, even + when legality testing is switched on. This allows participaton of a limited number of pieces that WinBoard + does not know, while still applying legality testing to the other pieces. The only rice to pay, is that WinBoard + cannot recognize checks (and thus mates) with such pieces. So if they participate, /testClaims should be off, + as WinBoard will no longer recognize all mates. + + Pieces that are not mentioned (because the argument has less than 44 characters) will remain disabled. Mentioned pieces can be disabled by assigning them a '.' (period). They are then not recognized in FEN or PGN input. Non-FIDE pieces that are not assigned a letter will also not appear on the promotion menu. It is not advisable to disable a piece that is present in the opening position of the selected variant, though. + Promoted pieces that need to be distinguished from original pieces of the same type (because of demotion on capture and transfer to the holdings) will be indicated by the letter for the unpromoted piece with a '+' in front of it (Shogi), or by the letter of the promoted piece with a '~' after it (Crazyhouse, Bughouse, in general everything with holdings that is not Shogi). To achieve this, they should be assigned the characters '+' or '~', respectively. + All the new pieces have a native bitmap representation in the board sizes 'bulky' and 'middling'. For all window sizes that do not support such fairy bitmaps, promoted NBRQ are represented as a 2-sizes-smaller normal piece symbol, so that Crazyhouse can be played at any size. People disliking the fairy representations might even prefer this. + There is an enhanced 'Edit Position' menu popup (right-clicking on the squares after selecting this mode in the main menu), featuring some common non-FIDE pieces, and 'promote' and 'demote' options to make those not directly in the menu. The promotion popup shows ArchBishop and Chancellor in Capablanca and Gothic, (or in fact in any game where this piece is not disabled or a promoted version of a normal piece), and leaves only the options YES / NO in Shogi. In Xiangqi there are no promotions. + From version 4.3.13 on, the default assignment of characters to pieces is variant dependent. This makes the + need for using this option even smaller. Xiangqi now uses H for Horse and C for Cannon. Shatranj uses B for Elephant and Q for Ferz (because some existing engines and ICC expect this) + + /fontPieceToCharTable="PNBRQFEACWMOHIJGDVLSUKpnbrqfeacwmohijgdvlsuk" (******* ALTERED IN 4.3.13 *******) + This option is similar to /pieceToCharTable, but sets the font character that is used to display the piece on the screen (when font-based rendering is in use), rather than in the FEN or PGN. The default setting should work with George Tsavdaris' WinboardF font, which uses the 'intuitive' mapping of font characters to symbols. With font-based rendering the fairy pieces can be used at any board size. + Note that UHIJGS are also used to represent the promoted versions of PNBRQF, in games like Crazyhouse and Shogi, where the promotion has to be undone on capture. In such games you are likely to prefer a different representation of those pieces then when they represent true fairy pieces. + NOTE THAT THE ORDER HAS CHANGED IN 4.3.13 compared to 4.3.12 + + /boardWidth=-1 /boardHeight=-1 + Set a number of files and ranks of the playing board to a value that will override the defaults for the variant that is selected. A value of -1 means the variant default board size will be used for the corresponding parameter (and is itself the default value of these options). These parameters can be set in the "Files -> New Variant..." sub-menu, where they are reset to the default -1 if you OK the chosen variant without typing something to overrule it. These parameters are saved in the winboard.ini file. (But unless you saved while a variant with board-size override was selected, they will always be saved as -1.) + A variant with a non-standard board size will be communicated to the engine(s) with the board size prefixed to the variant name, e.g. "variant 12x8_capablanca". In protocol 2 the engine must first enable this feature by sending "boardsizeFxR" amongst the accepted variants, where F is the maximum number of files, and R the maximum number of ranks, as decimal numbers. + + /holdingsSize=-1 + Set the size of the holdings for dropable pieces to a value that will override the default for the variant that is selected. A value of -1 means the variant default holdings size will be used for that parameter (and is itself the default value of this options). This parameter can be set in the Files -> New Variant... sub-menu, where it is reset to the default -1 if you OK the chosen variant without typing something to overrule it. This parameters is saved in the winboard.ini file. + To disable holdings, set their size to 0. They will then not be displayed. For non-zero holding size N, the holdings are displayed left and right of the board, and piece drops can be effected by dragging pieces from the holdings to the drop square. In bughouse, the holdings will be filled by the ICS. In all other variants, captured pieces will go into the holdings (after reversing their color). Only the first N pieces of the /pieceToCharTable argument will go into the holdings. All other pieces will be converted to Pawns. (In Shogi, however they will be demoted in the regular way before determining if they fit.) Pieces that are disabled (per default and per /pieceToCharTable option) might not be counted when determining what are the first N pieces. + Non-standard holdingsize will be communicated to the engine by prefixing it (together with the board size, even if this is standard) to the variant name, e.g. "variant 7x7+5_shogi". In protocol 2 the engine should enable this feature by sending "holdingsH" amongst the variant names, where H is the maximum acceptable holdings size as a decimal number. + + /firstTimeOdds=1 /secondTimeOdds=1 (********** NEW IN 4.3.13 *********) + The time given to first or second engine (initially, for later sessions, as increment or in the 'st' command) + is divided by the given factor. This replaces the time odds feature of WinBoard_x, where two times separated by + a slash could be given for the /timeContron parameter or in the time-control field of the menu. + + /timeOddsMode=1 + This option determines how the case is handled where both engines have a time-oddsfactor differing from 1. + In mode 1 the times will be scaled such that the engine that gets the most time will get the nominal time, + in mode 2 both engines will play at reduced time. + + /alphaRank=FALSE + When this parameter is true, a-h are converted to 1-9, and vice versa, in all move output and input (to PGN files or SAN move display as well as in communication with the engine). This might be useful for Shogi, where conventionally one uses letters to designate ranks, and digits to designate files. Engines that want to use this option must make sure pieces are never represented by lower case! This option can be set from the Files -> New Variant... menu, where it defaults to FALSE unless you explicitly set it. It is not saved in the winboard.ini file. + This kludge does not seem to work for reading PGN files. Saving works fine. For now, using it is not recommended. In the future it might be redefined as only affecting engine-engine communication, . + Note that the PGN format in Shogi also leaves out the trailing '+' as check indicator: In Shogi such a trailing '+' means promotion, while a trailing '=' means defer promotion. Prefix '+' signs are used on moves with promoted pieces, disambiguation is done western SAN style. + + /allWhite=FALSE + Causes the outline of the 'white' pieces to be superimposed onto the 'black' piece symbols as well (as a black outline) when native bitmaps are used (as opposed to font-based rendering). This is useful if we choose a very light color to represent the 'black' pieces. It might be particularly useful in Shogi, where the conventional representation of the 'black' pieces is as upside-down white pieces, so that both colors would be white. This option is saved in the winboard.ini file, and can be set in the "Options -> Board..." sub-menu. + + /flipBlack=FALSE + Setting this option will cause upside-down display of the native piece bitmaps used to represent the pieces of the side that plays black, as would be needed for a traditional representation of Shogi pieces. It can be set from the "Options -> Board..." sub-menu, and it is saved in the winboard.ini file. For now, traditional Shogi bitmaps are only included for size "moderate". For other sizes you must depend on font-based rendering. + + /detectMate=TRUE + /testClaim=TRUE + /materialDraws=TRUE + /trivialDraws=FALSE + /ruleMoves=51 + /repeatsToDraw=6 + These are all options that only affect engine-engine play, and can be set from the "Options -> Engine..." sub-menu. They are all related to adjudication of games by the GUI. Legality checking must be switched on for them to work. + If /detectMate is TRUE, the GUI recognizes checkmate and stalemate (but not in games with holdings!), and ends the game accordingly before the engines can claim. This is convenient for play with engines that fail to claim, and just exit. + With /testClaim set, all result and illegal-move claims by engines that claim more than their own loss are scrutinized for validity, and false claims result in forfeit of the game. Useful with buggy engines. + The option /materialDraws=TRUE causes games with insufficient mating material to be adjudicated immediately as draws, in case the engines would not claim these draws. This applies to KK, KNK and KBK. (A bug in 4.3.12, which + overlooked KBKB with like Bishops as a legal draw, has been corrected in 4.3.13.) + The option /trivialDraws adjudicates KNNK, KBKB, KNKN, KBKN, KRKR and KQKQ to draws after 3 moves (to allow for a quick tactical win). Note that in KQKQ this might not be sound, but that problem would disappear once bitbase probing is implemented. (A bug in 4.3.12, which led to KQKR being considered a trivail draw, is corrected in 4.3.13) + The /ruleMoves determine after how many reversible moves the game is adjudicated as a draw. Setting this to 0 turns this option off. Draw claims by the engine are still accepted (with /testClaim=TRUE) after 50 reversible moves, even if /ruleMoves species a larger number. Note that it is perfectly legal according to FIDE rules to play on after 50 reversible moves, but in tournaments having two engines that want to play on forever is a nuisance in endings like KBNKR, where one of the engines thinks it is ahead and can avoids repeats virtually forever. + The option /repeatsToDraw makes the GUI adjudicate a game as draw after the same position has occurred the specified number of times. If it is set to a value > 3, engines can still claim the draw after 3-fold repeat. + All these options are saved in the winboard.ini file. + + /matchPause=10000 + Determines the number of milliseconds that is paused between two games of a match. In the old WinBoard this was always 10 sec, which was inconveniently long in fast games. If you make the pause too short, tardy engines might get into trouble, though. Saved in the Winboard.ini. + + /zippyVariants="normal,fischerandom,crazyhouse,losers,suicide,3checks,twokings,bughouse,shatranj" + This option already existed, (giving the varinats that an engine can play on an ICS), but now by default setting + that icludes virtually all variants that WinBoard knows and that can be played on ICC. In this mode, however, + WinBoard now also checks if the variant the ICS wants to play is supportd by the engine (i.e. if it occurs + in the list given by the variant feature). Only for protocol-1 engines (which do not provide this info to WinBoard) + you would need to restrict the number of variants to those the engine can play, to avoid accepting challenges + the engine cannot handle. + + Clocks + There is an "Options -> swap clocks" command, that swaps the position of white and black clocks (convenient in over-the-board matches, where the display is standing next to the board, and you want your own time to be displayed on your side of the screen). The clocks can be adjusted in "edit game" mode: right-clicking them adds one minute, left-clicking subtracts one minute. (Also for OTB matches, to keep them synchronized with the official match clock.) The flag-fell condition is now indicated as '(!)' behind the displayed time, to eliminate the necessity for overwriting the message in the title bar (which might contain indispensible information in match mode). + + /pgnExtendedInfo contains time (******** NEW IN 4.3.13 *********) + If you selected this option in the "Options -> General..." menu, the search time is now also saved as a comment + in the PGN file with every move, together with the depth/score info (which WinBoard_x already did). The time + written is that reported by the engine if "Show Thinking" was on. If the engine does not give times, + the WinBoard clock is used in stead. + + Other improvements / changes + Castling rights and e.p. rights are now fully maintained, and considered in legality testing. They are imported from and written to FEN, as is the 50-move counter. (When reading an incomplete FEN they are still guessed, though.) + The time (in sec, or min:sec) is now always stored together with the PV information to the PGN, if storing the latter was requested (through ticking "extended PGN info" in "Options -> General..."). The saved time is the WinBoard clock time (as opposed to the time reported by the engine). + + Options from the engine command line (******** NEW IN 4.3.13 *********) + The command to startup the engine, as typed in the startup dialog box, or given to WinBoard in the + /firstChessProgram or /secondChessProgram (/fcp, /scp) can now contain options that are not passed to the + engine, but are interpreted by WinBoard. These would then overrule a similar option given in the winboard.ini + or in the command line. Every engine option following an option 'WBopt' would be treated this way. As tournament + managers use the /fcp and /scp options to pass the engines to WinBoard, this can be used to have engine- + dependent settings of WinBoard during a tournament. For instance, if we are playing a tournament at 40/5' time + control, but we want to accomodate an engine that only supports incremental time controls, we can install that engine in the tournament manager as "badengine.exe hashsize=128 WBopt /timeIncrement=3". Every time WinBoard + would start up this engine, it would then use 5'+3" TC for that game. + Options that apply to one engine only can also be passed this way. Such options contain 'first' or 'second' as + part of their name, depending on the engine they should apply to. As a given engine will play some of its games + as first and others as second during the tourney, to create an option that follows the engine, we need WinBoard + to dynamically decide if it should use the 'first' or 'second' flavor of the option, depending on which + engine startup command provided the option. This is indicated by letting the option contain '%s' in places + where WinBoard should read 'first' or 'second'. For example "strongengine.exe WBopt /%sTimeOdds=10" would + give the engine a time-odds factor of 10, whenever it plays, irrespective if it plays as first or second engine. + Note that options that do not come in a 'first' or 'second' flavor can still be passed to only one engine by + putting the WinBoard protocol commands in the init string. E.g., if we want to limit the search depth of + a particular engine to 6 ply in all its games. we can give 'engine.exe WBopt /%sInitString="newnrandom\nsd 6\n"', + so that only the applicable engine receives the 'sd 6' command. diff --cc winboard/wengineo.c index 0000000,994af41..942f593 mode 000000,100644..100644 --- a/winboard/wengineo.c +++ b/winboard/wengineo.c @@@ -1,0 -1,839 +1,842 @@@ -/* - * Engine output (PV) - * - * Author: Alessandro Scotti (Dec 2005) - * - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * ------------------------------------------------------------------------ - */ -#include "config.h" - -#include /* required for all Windows applications */ -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "winboard.h" -#include "frontend.h" -#include "backend.h" - -#include "wsnap.h" - -// [HGM] define numbers to indicate icons, for referring to them in platform-independent way -#define nColorBlack 1 -#define nColorWhite 2 -#define nColorUnknown 3 -#define nClear 4 -#define nPondering 5 -#define nThinking 6 -#define nAnalyzing 7 - -HICON icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle - -// [HGM] same for output fields (note that there are two of each type, one per color) -#define nColorIcon 1 -#define nStateIcon 2 -#define nLabel 3 -#define nStateData 4 -#define nLabelNPS 5 -#define nMemo 6 - -HWND outputField[2][7]; // [HGM] front-end array to translate output field to window handle - -void EngineOutputPopUp(); -void EngineOutputPopDown(); -int EngineOutputIsUp(); - -#define SHOW_PONDERING - -/* Imports from backend.c */ -char * SavePart(char *str); -extern int opponentKibitzes; - -/* Imports from winboard.c */ -extern HWND engineOutputDialog; -extern int engineOutputDialogUp; - -extern HINSTANCE hInst; -extern HWND hwndMain; - -extern WindowPlacement wpEngineOutput; - -/* Module variables */ -#define H_MARGIN 2 -#define V_MARGIN 2 -#define LABEL_V_DISTANCE 1 /* Distance between label and memo */ -#define SPLITTER_SIZE 4 /* Distance between first memo and second label */ - -#define ICON_SIZE 14 - -#define STATE_UNKNOWN -1 -#define STATE_THINKING 0 -#define STATE_IDLE 1 -#define STATE_PONDERING 2 -#define STATE_ANALYZING 3 - -static int windowMode = 1; - -static int needInit = TRUE; - -static int lastDepth[2] = { -1, -1 }; -static int lastForwardMostMove[2] = { -1, -1 }; -static int engineState[2] = { -1, -1 }; - -typedef struct { -// HWND hColorIcon; // [HGM] the output-control handles are no loger passed, -// HWND hLabel; // to give better front-end / back-end separation -// HWND hStateIcon; // the front-end routines now get them from a (front-end) -// HWND hStateData; // table, indexed by output-field indicators. -// HWND hLabelNPS; -// HWND hMemo; - char * name; - int which; - int depth; - unsigned long nodes; - int score; - int time; - char * pv; - char * hint; - int an_move_index; - int an_move_count; -} EngineOutputData; - -static VerifyDisplayMode(); -static void UpdateControls( EngineOutputData * ed ); -static SetEngineState( int which, int state, char * state_data ); - -// front end -static HICON LoadIconEx( int id ) -{ - return LoadImage( hInst, MAKEINTRESOURCE(id), IMAGE_ICON, ICON_SIZE, ICON_SIZE, 0 ); -} - -// [HGM] the platform-dependent way of indicating where output should go is now all -// concentrated here, where a table of platform-dependent handles are initialized. -// This cleanses most other routines of front-end stuff, so they can go into the back end. -static void InitializeEngineOutput() -{ - // if( needInit ) { // needInit was already tested before call - // [HGM] made this into a table, rather than separate global variables - icons[nColorBlack] = LoadIconEx( IDI_BLACK_14 ); - icons[nColorWhite] = LoadIconEx( IDI_WHITE_14 ); - icons[nColorUnknown] = LoadIconEx( IDI_UNKNOWN_14 ); - icons[nClear] = LoadIconEx( IDI_TRANS_14 ); - icons[nPondering] = LoadIconEx( IDI_PONDER_14 ); - icons[nThinking] = LoadIconEx( IDI_CLOCK_14 ); - icons[nAnalyzing] = LoadIconEx( IDI_ANALYZE2_14 ); - - // [HGM] also make a table of handles to output controls - // Note that engineOutputDialog must be defined first! - outputField[0][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color1 ); - outputField[0][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel1 ); - outputField[0][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon1 ); - outputField[0][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData1 ); - outputField[0][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine1_NPS ); - outputField[0][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo1 ); - - outputField[1][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color2 ); - outputField[1][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel2 ); - outputField[1][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon2 ); - outputField[1][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData2 ); - outputField[1][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine2_NPS ); - outputField[1][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo2 ); -// needInit = FALSE; -// } -} - -// front end -static void SetControlPos( HWND hDlg, int id, int x, int y, int width, int height ) -{ - HWND hControl = GetDlgItem( hDlg, id ); - - SetWindowPos( hControl, HWND_TOP, x, y, width, height, SWP_NOZORDER ); -} - -#define HIDDEN_X 20000 -#define HIDDEN_Y 20000 - -// front end -static void HideControl( HWND hDlg, int id ) -{ - HWND hControl = GetDlgItem( hDlg, id ); - RECT rc; - - GetWindowRect( hControl, &rc ); - - /* - Avoid hiding an already hidden control, because that causes many - unnecessary WM_ERASEBKGND messages! - */ - if( rc.left != HIDDEN_X || rc.top != HIDDEN_Y ) { - SetControlPos( hDlg, id, 20000, 20000, 100, 100 ); - } -} - -// front end, although we might make GetWindowRect front end instead -static int GetControlWidth( HWND hDlg, int id ) -{ - RECT rc; - - GetWindowRect( GetDlgItem( hDlg, id ), &rc ); - - return rc.right - rc.left; -} - -// front end? -static int GetControlHeight( HWND hDlg, int id ) -{ - RECT rc; - - GetWindowRect( GetDlgItem( hDlg, id ), &rc ); - - return rc.bottom - rc.top; -} - -static int GetHeaderHeight() -{ - int result = GetControlHeight( engineOutputDialog, IDC_EngineLabel1 ); - - if( result < ICON_SIZE ) result = ICON_SIZE; - - return result; -} - -// The size calculations should be backend? If setControlPos is a platform-dependent way of doing things, -// a platform-independent wrapper for it should be supplied. -static void PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) -{ - int label_x = x + ICON_SIZE + H_MARGIN; - int label_h = GetControlHeight( hDlg, IDC_EngineLabel1 ); - int label_y = y + ICON_SIZE - label_h; - int nps_w = GetControlWidth( hDlg, IDC_Engine1_NPS ); - int nps_x = clientWidth - H_MARGIN - nps_w; - int state_data_w = GetControlWidth( hDlg, IDC_StateData1 ); - int state_data_x = nps_x - H_MARGIN - state_data_w; - int state_icon_x = state_data_x - ICON_SIZE - 2; - int max_w = clientWidth - 2*H_MARGIN; - int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; - - SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); - SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); - SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); - SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); - SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); - SetControlPos( hDlg, idMemo, x, memo_y, max_w, memoHeight ); -} - -// Also here some of the size calculations should go to the back end, and their actual application to a front-end routine -static void ResizeWindowControls( HWND hDlg, int mode ) -{ - RECT rc; - int headerHeight = GetHeaderHeight(); - int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); - int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; - int labelDeltaY = ICON_SIZE - labelHeight; - int clientWidth; - int clientHeight; - int maxControlWidth; - int npsWidth; - - /* Initialize variables */ - GetClientRect( hDlg, &rc ); - - clientWidth = rc.right - rc.left; - clientHeight = rc.bottom - rc.top; - - maxControlWidth = clientWidth - 2*H_MARGIN; - - npsWidth = GetControlWidth( hDlg, IDC_Engine1_NPS ); - - /* Resize controls */ - if( mode == 0 ) { - /* One engine */ - PositionControlSet( hDlg, H_MARGIN, V_MARGIN, - clientWidth, - clientHeight - V_MARGIN - LABEL_V_DISTANCE - headerHeight- V_MARGIN, - IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); - - /* Hide controls for the second engine */ - HideControl( hDlg, IDC_Color2 ); - HideControl( hDlg, IDC_EngineLabel2 ); - HideControl( hDlg, IDC_StateIcon2 ); - HideControl( hDlg, IDC_StateData2 ); - HideControl( hDlg, IDC_Engine2_NPS ); - HideControl( hDlg, IDC_EngineMemo2 ); - SendDlgItemMessage( hDlg, IDC_EngineMemo2, WM_SETTEXT, 0, (LPARAM) "" ); - /* TODO: we should also hide/disable them!!! what about tab stops?!?! */ - } - else { - /* Two engines */ - int memo_h = (clientHeight - headerHeight*2 - V_MARGIN*2 - LABEL_V_DISTANCE*2 - SPLITTER_SIZE) / 2; - int header1_y = V_MARGIN; - int header2_y = V_MARGIN + headerHeight + LABEL_V_DISTANCE + memo_h + SPLITTER_SIZE; - - PositionControlSet( hDlg, H_MARGIN, header1_y, clientWidth, memo_h, - IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); - - PositionControlSet( hDlg, H_MARGIN, header2_y, clientWidth, memo_h, - IDC_Color2, IDC_EngineLabel2, IDC_Engine2_NPS, IDC_EngineMemo2, IDC_StateIcon2, IDC_StateData2 ); - } - - InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); - InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); -} - -// front end. Actual printing of PV lines into the output field -static void InsertIntoMemo( int which, char * text ) -{ - SendMessage( outputField[which][nMemo], EM_SETSEL, 0, 0 ); - - SendMessage( outputField[which][nMemo], EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) text ); -} - -// front end. Associates an icon with an output field ("control" in Windows jargon). -// [HGM] let it find out the output field from the 'which' number by itself -static void SetIcon( int which, int field, int nIcon ) -{ - - if( nIcon != 0 ) { - SendMessage( outputField[which][field], STM_SETICON, (WPARAM) icons[nIcon], 0 ); - } -} - -// front end wrapper for SetWindowText, taking control number in stead of handle -void DoSetWindowText(int which, int field, char *s_label) -{ - SetWindowText( outputField[which][field], s_label ); -} - -// This seems pure front end -LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) -{ - static SnapData sd; - - switch (message) { - case WM_INITDIALOG: - if( engineOutputDialog == NULL ) { - engineOutputDialog = hDlg; - - RestoreWindowPlacement( hDlg, &wpEngineOutput ); /* Restore window placement */ - - ResizeWindowControls( hDlg, windowMode ); - - SetEngineState( 0, STATE_IDLE, "" ); - SetEngineState( 1, STATE_IDLE, "" ); - } - - return FALSE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - EndDialog(hDlg, TRUE); - return TRUE; - - case IDCANCEL: - EndDialog(hDlg, FALSE); - return TRUE; - - default: - break; - } - - break; - - case WM_GETMINMAXINFO: - { - MINMAXINFO * mmi = (MINMAXINFO *) lParam; - - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 160; - } - break; - - case WM_CLOSE: - EngineOutputPopDown(); - break; - - case WM_SIZE: - ResizeWindowControls( hDlg, windowMode ); - break; - - case WM_ENTERSIZEMOVE: - return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); - - case WM_SIZING: - return OnSizing( &sd, hDlg, wParam, lParam ); - - case WM_MOVING: - return OnMoving( &sd, hDlg, wParam, lParam ); - - case WM_EXITSIZEMOVE: - return OnExitSizeMove( &sd, hDlg, wParam, lParam ); - } - - return FALSE; -} - -// front end -void EngineOutputPopUp() -{ - FARPROC lpProc; - - CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED); - - if( engineOutputDialog ) { - SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 ); - - if( ! engineOutputDialogUp ) { - ShowWindow(engineOutputDialog, SW_SHOW); - } - } - else { - lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst ); - - /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ - CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc ); - - FreeProcInstance(lpProc); - } - - // [HGM] displaced to after creation of dialog, to allow initialization of output fields - if( needInit ) { - InitializeEngineOutput(); - needInit = FALSE; - } - - engineOutputDialogUp = TRUE; -} - -// front end -void EngineOutputPopDown() -{ - CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_UNCHECKED); - - if( engineOutputDialog ) { - ShowWindow(engineOutputDialog, SW_HIDE); - } - - engineOutputDialogUp = FALSE; -} - -// front end. [HGM] Takes handle of output control from table, so only number is passed -void DoClearMemo(int which) -{ - SendMessage( outputField[which][nMemo], WM_SETTEXT, 0, (LPARAM) "" ); -} - -//------------------------ pure back-end routines ------------------------------- - - -// back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments -static SetEngineState( int which, int state, char * state_data ) -{ - int x_which = 1 - which; - - if( engineState[ which ] != state ) { - engineState[ which ] = state; - - switch( state ) { - case STATE_THINKING: - SetIcon( which, nStateIcon, nThinking ); - if( engineState[ x_which ] == STATE_THINKING ) { - SetEngineState( x_which, STATE_IDLE, "" ); - } - break; - case STATE_PONDERING: - SetIcon( which, nStateIcon, nPondering ); - break; - case STATE_ANALYZING: - SetIcon( which, nStateIcon, nAnalyzing ); - break; - default: - SetIcon( which, nStateIcon, nClear ); - break; - } - } - - if( state_data != 0 ) { - DoSetWindowText( which, nStateData, state_data ); - } -} - -// back end, now the front-end wrapper ClearMemo is used, and ed no longer contains handles. -void EngineOutputUpdate( FrontEndProgramStats * stats ) -{ - EngineOutputData ed; - int clearMemo = FALSE; - int which; - int depth; - - if( stats == 0 ) { - SetEngineState( 0, STATE_IDLE, "" ); - SetEngineState( 1, STATE_IDLE, "" ); - return; - } - - if(gameMode == IcsObserving) return; // [HGM] kibitz: shut up engine if we are observing an ICS game - - which = stats->which; - depth = stats->depth; - - if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { - return; - } - - if( engineOutputDialog == NULL ) { - return; - } - - VerifyDisplayMode(); - - ed.which = which; - ed.depth = depth; - ed.nodes = stats->nodes; - ed.score = stats->score; - ed.time = stats->time; - ed.pv = stats->pv; - ed.hint = stats->hint; - ed.an_move_index = stats->an_move_index; - ed.an_move_count = stats->an_move_count; - - /* Get target control. [HGM] this is moved to front end, which get them from a table */ - if( which == 0 ) { - ed.name = first.tidy; - } - else { - ed.name = second.tidy; - } - - /* Clear memo if needed */ - if( lastDepth[which] > depth || (lastDepth[which] == depth && depth <= 1) ) { - clearMemo = TRUE; - } - - if( lastForwardMostMove[which] != forwardMostMove ) { - clearMemo = TRUE; - } - - if( clearMemo ) DoClearMemo(which); - - /* Update */ - lastDepth[which] = depth; - lastForwardMostMove[which] = forwardMostMove; - - if( ed.pv != 0 && ed.pv[0] == ' ' ) { - if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ - ed.pv = ""; - } - } - - UpdateControls( &ed ); -} - -#define ENGINE_COLOR_WHITE 'w' -#define ENGINE_COLOR_BLACK 'b' -#define ENGINE_COLOR_UNKNOWN ' ' - -// pure back end -char GetEngineColor( int which ) -{ - char result = ENGINE_COLOR_UNKNOWN; - - if( which == 0 || which == 1 ) { - ChessProgramState * cps; - - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - result = ENGINE_COLOR_BLACK; - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - result = ENGINE_COLOR_WHITE; - break; - case AnalyzeMode: - case AnalyzeFile: - result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; - break; - case TwoMachinesPlay: - cps = (which == 0) ? &first : &second; - result = cps->twoMachinesColor[0]; - result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; - break; - } - } - - return result; -} - -// pure back end -char GetActiveEngineColor() -{ - char result = ENGINE_COLOR_UNKNOWN; - - if( gameMode == TwoMachinesPlay ) { - result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; - } - - return result; -} - -// pure back end -static int IsEnginePondering( int which ) -{ - int result = FALSE; - - switch (gameMode) { - case MachinePlaysBlack: - case IcsPlayingBlack: - if( WhiteOnMove(forwardMostMove) ) result = TRUE; - break; - case MachinePlaysWhite: - case IcsPlayingWhite: - if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; - break; - case TwoMachinesPlay: - if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { - if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; - } - break; - } - - return result; -} - -// back end -static void SetDisplayMode( int mode ) -{ - if( windowMode != mode ) { - windowMode = mode; - - ResizeWindowControls( engineOutputDialog, mode ); - } -} - -// pure back end -static VerifyDisplayMode() -{ - int mode; - - /* Get proper mode for current game */ - switch( gameMode ) { - case AnalyzeMode: - case AnalyzeFile: - case MachinePlaysWhite: - case MachinePlaysBlack: - mode = 0; - break; - case IcsPlayingWhite: - case IcsPlayingBlack: - mode = appData.zippyPlay && opponentKibitzes; // [HGM] kibitz - break; - case TwoMachinesPlay: - mode = 1; - break; - default: - /* Do not change */ - return; - } - - SetDisplayMode( mode ); -} - -// back end. Determine what icon to se in the color-icon field, and print it -static void SetEngineColorIcon( int which ) -{ - char color = GetEngineColor(which); - int nicon = 0; - - if( color == ENGINE_COLOR_BLACK ) - nicon = nColorBlack; - else if( color == ENGINE_COLOR_WHITE ) - nicon = nColorWhite; - else - nicon = nColorUnknown; - - SetIcon( which, nColorIcon, nicon ); -} - -#define MAX_NAME_LENGTH 32 - -// pure back end, now SetWindowText is called via wrapper DoSetWindowText -static void UpdateControls( EngineOutputData * ed ) -{ - int isPondering = FALSE; - - char s_label[MAX_NAME_LENGTH + 32]; - - char * name = ed->name; - - /* Label */ - if( name == 0 || *name == '\0' ) { - name = "?"; - } - - strncpy( s_label, name, MAX_NAME_LENGTH ); - s_label[ MAX_NAME_LENGTH-1 ] = '\0'; - -#ifdef SHOW_PONDERING - if( IsEnginePondering( ed->which ) ) { - char buf[8]; - - buf[0] = '\0'; - - if( ed->hint != 0 && *ed->hint != '\0' ) { - strncpy( buf, ed->hint, sizeof(buf) ); - buf[sizeof(buf)-1] = '\0'; - } - else if( ed->pv != 0 && *ed->pv != '\0' ) { - char * sep = strchr( ed->pv, ' ' ); - int buflen = sizeof(buf); - - if( sep != NULL ) { - buflen = sep - ed->pv + 1; - if( buflen > sizeof(buf) ) buflen = sizeof(buf); - } - - strncpy( buf, ed->pv, buflen ); - buf[ buflen-1 ] = '\0'; - } - - SetEngineState( ed->which, STATE_PONDERING, buf ); - } - else if( gameMode == TwoMachinesPlay ) { - SetEngineState( ed->which, STATE_THINKING, "" ); - } - else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { - char buf[64]; - int time_secs = ed->time / 100; - int time_mins = time_secs / 60; - - buf[0] = '\0'; - - if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { - char mov[16]; - - strncpy( mov, ed->hint, sizeof(mov) ); - mov[ sizeof(mov)-1 ] = '\0'; - - sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); - } - - SetEngineState( ed->which, STATE_ANALYZING, buf ); - } - else { - SetEngineState( ed->which, STATE_IDLE, "" ); - } -#endif - - DoSetWindowText( ed->which, nLabel, s_label ); - - s_label[0] = '\0'; - - if( ed->time > 0 && ed->nodes > 0 ) { - unsigned long nps_100 = ed->nodes / ed->time; - - if( nps_100 < 100000 ) { - sprintf( s_label, "NPS: %lu", nps_100 * 100 ); - } - else { - sprintf( s_label, "NPS: %.1fk", nps_100 / 10.0 ); - } - } - - DoSetWindowText( ed->which, nLabelNPS, s_label ); - - /* Memo */ - if( ed->pv != 0 && *ed->pv != '\0' ) { - char s_nodes[24]; - char s_score[16]; - char s_time[24]; - char buf[256]; - int buflen; - int time_secs = ed->time / 100; - int time_cent = ed->time % 100; - - /* Nodes */ - if( ed->nodes < 1000000 ) { - sprintf( s_nodes, "%lu", ed->nodes ); - } - else { - sprintf( s_nodes, "%.1fM", ed->nodes / 1000000.0 ); - } - - /* Score */ - if( ed->score > 0 ) { - sprintf( s_score, "+%.2f", ed->score / 100.0 ); - } - else { - sprintf( s_score, "%.2f", ed->score / 100.0 ); - } - - /* Time */ - sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); - - /* Put all together... */ - sprintf( buf, "%3d\t%s\t%s\t%s\t", ed->depth, s_score, s_nodes, s_time ); - - /* Add PV */ - buflen = strlen(buf); - - strncpy( buf + buflen, ed->pv, sizeof(buf) - buflen ); - - buf[ sizeof(buf) - 3 ] = '\0'; - - strcat( buf + buflen, "\r\n" ); - - /* Update memo */ - InsertIntoMemo( ed->which, buf ); - } - - /* Colors */ - SetEngineColorIcon( ed->which ); -} - -// back end -int EngineOutputIsUp() -{ - return engineOutputDialogUp; -} - -// [HGM] kibitz: write kibitz line; split window for it if necessary -void OutputKibitz(int window, char *text) -{ - if(!EngineOutputIsUp()) return; - if(!opponentKibitzes) { // on first kibitz of game, clear memos - DoClearMemo(1); - if(gameMode == IcsObserving) DoClearMemo(0); - } - opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes. - VerifyDisplayMode(); - if(gameMode == IcsObserving) { - DoSetWindowText(0, nLabel, gameInfo.white); - SetIcon( 0, nColorIcon, nColorWhite); - SetIcon( 0, nStateIcon, nClear); - } - DoSetWindowText(1, nLabel, gameMode == IcsPlayingBlack ? gameInfo.white : gameInfo.black); // opponent name - SetIcon( 1, nColorIcon, gameMode == IcsPlayingBlack ? nColorWhite : nColorBlack); - SetIcon( 1, nStateIcon, nClear); - InsertIntoMemo(window-1, text); -} - ++/* ++ * Engine output (PV) ++ * ++ * Author: Alessandro Scotti (Dec 2005) ++ * ++ * ------------------------------------------------------------------------ ++ * 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 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, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ------------------------------------------------------------------------ ++ */ ++#include "config.h" ++ ++#include /* required for all Windows applications */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "common.h" ++#include "winboard.h" ++#include "frontend.h" ++#include "backend.h" ++ ++#include "wsnap.h" ++ ++// [HGM] define numbers to indicate icons, for referring to them in platform-independent way ++#define nColorBlack 1 ++#define nColorWhite 2 ++#define nColorUnknown 3 ++#define nClear 4 ++#define nPondering 5 ++#define nThinking 6 ++#define nAnalyzing 7 ++ ++HICON icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle ++ ++// [HGM] same for output fields (note that there are two of each type, one per color) ++#define nColorIcon 1 ++#define nStateIcon 2 ++#define nLabel 3 ++#define nStateData 4 ++#define nLabelNPS 5 ++#define nMemo 6 ++ ++HWND outputField[2][7]; // [HGM] front-end array to translate output field to window handle ++ ++void EngineOutputPopUp(); ++void EngineOutputPopDown(); ++int EngineOutputIsUp(); ++ ++#define SHOW_PONDERING ++ ++/* Imports from backend.c */ ++char * SavePart(char *str); ++extern int opponentKibitzes; ++ ++/* Imports from winboard.c */ ++extern HWND engineOutputDialog; ++extern int engineOutputDialogUp; ++ ++extern HINSTANCE hInst; ++extern HWND hwndMain; ++ ++extern WindowPlacement wpEngineOutput; ++ ++/* Module variables */ ++#define H_MARGIN 2 ++#define V_MARGIN 2 ++#define LABEL_V_DISTANCE 1 /* Distance between label and memo */ ++#define SPLITTER_SIZE 4 /* Distance between first memo and second label */ ++ ++#define ICON_SIZE 14 ++ ++#define STATE_UNKNOWN -1 ++#define STATE_THINKING 0 ++#define STATE_IDLE 1 ++#define STATE_PONDERING 2 ++#define STATE_ANALYZING 3 ++ ++static int windowMode = 1; ++ ++static int needInit = TRUE; ++ ++static int lastDepth[2] = { -1, -1 }; ++static int lastForwardMostMove[2] = { -1, -1 }; ++static int engineState[2] = { -1, -1 }; ++ ++typedef struct { ++// HWND hColorIcon; // [HGM] the output-control handles are no loger passed, ++// HWND hLabel; // to give better front-end / back-end separation ++// HWND hStateIcon; // the front-end routines now get them from a (front-end) ++// HWND hStateData; // table, indexed by output-field indicators. ++// HWND hLabelNPS; ++// HWND hMemo; ++ char * name; ++ int which; ++ int depth; ++ u64 nodes; ++ int score; ++ int time; ++ char * pv; ++ char * hint; ++ int an_move_index; ++ int an_move_count; ++} EngineOutputData; ++ ++static VerifyDisplayMode(); ++static void UpdateControls( EngineOutputData * ed ); ++static SetEngineState( int which, int state, char * state_data ); ++ ++// front end ++static HICON LoadIconEx( int id ) ++{ ++ return LoadImage( hInst, MAKEINTRESOURCE(id), IMAGE_ICON, ICON_SIZE, ICON_SIZE, 0 ); ++} ++ ++// [HGM] the platform-dependent way of indicating where output should go is now all ++// concentrated here, where a table of platform-dependent handles are initialized. ++// This cleanses most other routines of front-end stuff, so they can go into the back end. ++static void InitializeEngineOutput() ++{ ++ // if( needInit ) { // needInit was already tested before call ++ // [HGM] made this into a table, rather than separate global variables ++ icons[nColorBlack] = LoadIconEx( IDI_BLACK_14 ); ++ icons[nColorWhite] = LoadIconEx( IDI_WHITE_14 ); ++ icons[nColorUnknown] = LoadIconEx( IDI_UNKNOWN_14 ); ++ icons[nClear] = LoadIconEx( IDI_TRANS_14 ); ++ icons[nPondering] = LoadIconEx( IDI_PONDER_14 ); ++ icons[nThinking] = LoadIconEx( IDI_CLOCK_14 ); ++ icons[nAnalyzing] = LoadIconEx( IDI_ANALYZE2_14 ); ++ ++ // [HGM] also make a table of handles to output controls ++ // Note that engineOutputDialog must be defined first! ++ outputField[0][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color1 ); ++ outputField[0][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel1 ); ++ outputField[0][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon1 ); ++ outputField[0][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData1 ); ++ outputField[0][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine1_NPS ); ++ outputField[0][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo1 ); ++ ++ outputField[1][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color2 ); ++ outputField[1][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel2 ); ++ outputField[1][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon2 ); ++ outputField[1][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData2 ); ++ outputField[1][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine2_NPS ); ++ outputField[1][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo2 ); ++// needInit = FALSE; ++// } ++} ++ ++// front end ++static void SetControlPos( HWND hDlg, int id, int x, int y, int width, int height ) ++{ ++ HWND hControl = GetDlgItem( hDlg, id ); ++ ++ SetWindowPos( hControl, HWND_TOP, x, y, width, height, SWP_NOZORDER ); ++} ++ ++#define HIDDEN_X 20000 ++#define HIDDEN_Y 20000 ++ ++// front end ++static void HideControl( HWND hDlg, int id ) ++{ ++ HWND hControl = GetDlgItem( hDlg, id ); ++ RECT rc; ++ ++ GetWindowRect( hControl, &rc ); ++ ++ /* ++ Avoid hiding an already hidden control, because that causes many ++ unnecessary WM_ERASEBKGND messages! ++ */ ++ if( rc.left != HIDDEN_X || rc.top != HIDDEN_Y ) { ++ SetControlPos( hDlg, id, 20000, 20000, 100, 100 ); ++ } ++} ++ ++// front end, although we might make GetWindowRect front end instead ++static int GetControlWidth( HWND hDlg, int id ) ++{ ++ RECT rc; ++ ++ GetWindowRect( GetDlgItem( hDlg, id ), &rc ); ++ ++ return rc.right - rc.left; ++} ++ ++// front end? ++static int GetControlHeight( HWND hDlg, int id ) ++{ ++ RECT rc; ++ ++ GetWindowRect( GetDlgItem( hDlg, id ), &rc ); ++ ++ return rc.bottom - rc.top; ++} ++ ++static int GetHeaderHeight() ++{ ++ int result = GetControlHeight( engineOutputDialog, IDC_EngineLabel1 ); ++ ++ if( result < ICON_SIZE ) result = ICON_SIZE; ++ ++ return result; ++} ++ ++// The size calculations should be backend? If setControlPos is a platform-dependent way of doing things, ++// a platform-independent wrapper for it should be supplied. ++static void PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) ++{ ++ int label_x = x + ICON_SIZE + H_MARGIN; ++ int label_h = GetControlHeight( hDlg, IDC_EngineLabel1 ); ++ int label_y = y + ICON_SIZE - label_h; ++ int nps_w = GetControlWidth( hDlg, IDC_Engine1_NPS ); ++ int nps_x = clientWidth - H_MARGIN - nps_w; ++ int state_data_w = GetControlWidth( hDlg, IDC_StateData1 ); ++ int state_data_x = nps_x - H_MARGIN - state_data_w; ++ int state_icon_x = state_data_x - ICON_SIZE - 2; ++ int max_w = clientWidth - 2*H_MARGIN; ++ int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; ++ ++ SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); ++ SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); ++ SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); ++ SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); ++ SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); ++ SetControlPos( hDlg, idMemo, x, memo_y, max_w, memoHeight ); ++} ++ ++// Also here some of the size calculations should go to the back end, and their actual application to a front-end routine ++static void ResizeWindowControls( HWND hDlg, int mode ) ++{ ++ RECT rc; ++ int headerHeight = GetHeaderHeight(); ++ int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); ++ int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; ++ int labelDeltaY = ICON_SIZE - labelHeight; ++ int clientWidth; ++ int clientHeight; ++ int maxControlWidth; ++ int npsWidth; ++ ++ /* Initialize variables */ ++ GetClientRect( hDlg, &rc ); ++ ++ clientWidth = rc.right - rc.left; ++ clientHeight = rc.bottom - rc.top; ++ ++ maxControlWidth = clientWidth - 2*H_MARGIN; ++ ++ npsWidth = GetControlWidth( hDlg, IDC_Engine1_NPS ); ++ ++ /* Resize controls */ ++ if( mode == 0 ) { ++ /* One engine */ ++ PositionControlSet( hDlg, H_MARGIN, V_MARGIN, ++ clientWidth, ++ clientHeight - V_MARGIN - LABEL_V_DISTANCE - headerHeight- V_MARGIN, ++ IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); ++ ++ /* Hide controls for the second engine */ ++ HideControl( hDlg, IDC_Color2 ); ++ HideControl( hDlg, IDC_EngineLabel2 ); ++ HideControl( hDlg, IDC_StateIcon2 ); ++ HideControl( hDlg, IDC_StateData2 ); ++ HideControl( hDlg, IDC_Engine2_NPS ); ++ HideControl( hDlg, IDC_EngineMemo2 ); ++ SendDlgItemMessage( hDlg, IDC_EngineMemo2, WM_SETTEXT, 0, (LPARAM) "" ); ++ /* TODO: we should also hide/disable them!!! what about tab stops?!?! */ ++ } ++ else { ++ /* Two engines */ ++ int memo_h = (clientHeight - headerHeight*2 - V_MARGIN*2 - LABEL_V_DISTANCE*2 - SPLITTER_SIZE) / 2; ++ int header1_y = V_MARGIN; ++ int header2_y = V_MARGIN + headerHeight + LABEL_V_DISTANCE + memo_h + SPLITTER_SIZE; ++ ++ PositionControlSet( hDlg, H_MARGIN, header1_y, clientWidth, memo_h, ++ IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); ++ ++ PositionControlSet( hDlg, H_MARGIN, header2_y, clientWidth, memo_h, ++ IDC_Color2, IDC_EngineLabel2, IDC_Engine2_NPS, IDC_EngineMemo2, IDC_StateIcon2, IDC_StateData2 ); ++ } ++ ++ InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); ++ InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); ++} ++ ++// front end. Actual printing of PV lines into the output field ++static void InsertIntoMemo( int which, char * text ) ++{ ++ SendMessage( outputField[which][nMemo], EM_SETSEL, 0, 0 ); ++ ++ SendMessage( outputField[which][nMemo], EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) text ); ++} ++ ++// front end. Associates an icon with an output field ("control" in Windows jargon). ++// [HGM] let it find out the output field from the 'which' number by itself ++static void SetIcon( int which, int field, int nIcon ) ++{ ++ ++ if( nIcon != 0 ) { ++ SendMessage( outputField[which][field], STM_SETICON, (WPARAM) icons[nIcon], 0 ); ++ } ++} ++ ++// front end wrapper for SetWindowText, taking control number in stead of handle ++void DoSetWindowText(int which, int field, char *s_label) ++{ ++ SetWindowText( outputField[which][field], s_label ); ++} ++ ++// This seems pure front end ++LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) ++{ ++ static SnapData sd; ++ ++ switch (message) { ++ case WM_INITDIALOG: ++ if( engineOutputDialog == NULL ) { ++ engineOutputDialog = hDlg; ++ ++ RestoreWindowPlacement( hDlg, &wpEngineOutput ); /* Restore window placement */ ++ ++ ResizeWindowControls( hDlg, windowMode ); ++ ++ SetEngineState( 0, STATE_IDLE, "" ); ++ SetEngineState( 1, STATE_IDLE, "" ); ++ } ++ ++ return FALSE; ++ ++ case WM_COMMAND: ++ switch (LOWORD(wParam)) { ++ case IDOK: ++ EndDialog(hDlg, TRUE); ++ return TRUE; ++ ++ case IDCANCEL: ++ EndDialog(hDlg, FALSE); ++ return TRUE; ++ ++ default: ++ break; ++ } ++ ++ break; ++ ++ case WM_GETMINMAXINFO: ++ { ++ MINMAXINFO * mmi = (MINMAXINFO *) lParam; ++ ++ mmi->ptMinTrackSize.x = 100; ++ mmi->ptMinTrackSize.y = 160; ++ } ++ break; ++ ++ case WM_CLOSE: ++ EngineOutputPopDown(); ++ break; ++ ++ case WM_SIZE: ++ ResizeWindowControls( hDlg, windowMode ); ++ break; ++ ++ case WM_ENTERSIZEMOVE: ++ return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); ++ ++ case WM_SIZING: ++ return OnSizing( &sd, hDlg, wParam, lParam ); ++ ++ case WM_MOVING: ++ return OnMoving( &sd, hDlg, wParam, lParam ); ++ ++ case WM_EXITSIZEMOVE: ++ return OnExitSizeMove( &sd, hDlg, wParam, lParam ); ++ } ++ ++ return FALSE; ++} ++ ++// front end ++void EngineOutputPopUp() ++{ ++ FARPROC lpProc; ++ ++ CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED); ++ ++ if( engineOutputDialog ) { ++ SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 ); ++ ++ if( ! engineOutputDialogUp ) { ++ ShowWindow(engineOutputDialog, SW_SHOW); ++ } ++ } ++ else { ++ lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst ); ++ ++ /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ ++ CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc ); ++ ++ FreeProcInstance(lpProc); ++ } ++ ++ // [HGM] displaced to after creation of dialog, to allow initialization of output fields ++ if( needInit ) { ++ InitializeEngineOutput(); ++ needInit = FALSE; ++ } ++ ++ engineOutputDialogUp = TRUE; ++} ++ ++// front end ++void EngineOutputPopDown() ++{ ++ CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_UNCHECKED); ++ ++ if( engineOutputDialog ) { ++ ShowWindow(engineOutputDialog, SW_HIDE); ++ } ++ ++ engineOutputDialogUp = FALSE; ++} ++ ++// front end. [HGM] Takes handle of output control from table, so only number is passed ++void DoClearMemo(int which) ++{ ++ SendMessage( outputField[which][nMemo], WM_SETTEXT, 0, (LPARAM) "" ); ++} ++ ++//------------------------ pure back-end routines ------------------------------- ++ ++ ++// back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments ++static SetEngineState( int which, int state, char * state_data ) ++{ ++ int x_which = 1 - which; ++ ++ if( engineState[ which ] != state ) { ++ engineState[ which ] = state; ++ ++ switch( state ) { ++ case STATE_THINKING: ++ SetIcon( which, nStateIcon, nThinking ); ++ if( engineState[ x_which ] == STATE_THINKING ) { ++ SetEngineState( x_which, STATE_IDLE, "" ); ++ } ++ break; ++ case STATE_PONDERING: ++ SetIcon( which, nStateIcon, nPondering ); ++ break; ++ case STATE_ANALYZING: ++ SetIcon( which, nStateIcon, nAnalyzing ); ++ break; ++ default: ++ SetIcon( which, nStateIcon, nClear ); ++ break; ++ } ++ } ++ ++ if( state_data != 0 ) { ++ DoSetWindowText( which, nStateData, state_data ); ++ } ++} ++ ++// back end, now the front-end wrapper ClearMemo is used, and ed no longer contains handles. ++void EngineOutputUpdate( FrontEndProgramStats * stats ) ++{ ++ EngineOutputData ed; ++ int clearMemo = FALSE; ++ int which; ++ int depth; ++ ++ if( stats == 0 ) { ++ SetEngineState( 0, STATE_IDLE, "" ); ++ SetEngineState( 1, STATE_IDLE, "" ); ++ return; ++ } ++ ++ if(gameMode == IcsObserving && !appData.icsEngineAnalyze) ++ return; // [HGM] kibitz: shut up engine if we are observing an ICS game ++ ++ which = stats->which; ++ depth = stats->depth; ++ ++ if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { ++ return; ++ } ++ ++ if( engineOutputDialog == NULL ) { ++ return; ++ } ++ ++ VerifyDisplayMode(); ++ ++ ed.which = which; ++ ed.depth = depth; ++ ed.nodes = stats->nodes; ++ ed.score = stats->score; ++ ed.time = stats->time; ++ ed.pv = stats->pv; ++ ed.hint = stats->hint; ++ ed.an_move_index = stats->an_move_index; ++ ed.an_move_count = stats->an_move_count; ++ ++ /* Get target control. [HGM] this is moved to front end, which get them from a table */ ++ if( which == 0 ) { ++ ed.name = first.tidy; ++ } ++ else { ++ ed.name = second.tidy; ++ } ++ ++ /* Clear memo if needed */ ++ if( lastDepth[which] > depth || (lastDepth[which] == depth && depth <= 1) ) { ++ clearMemo = TRUE; ++ } ++ ++ if( lastForwardMostMove[which] != forwardMostMove ) { ++ clearMemo = TRUE; ++ } ++ ++ if( clearMemo ) DoClearMemo(which); ++ ++ /* Update */ ++ lastDepth[which] = depth; ++ lastForwardMostMove[which] = forwardMostMove; ++ ++ if( ed.pv != 0 && ed.pv[0] == ' ' ) { ++ if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ ++ ed.pv = ""; ++ } ++ } ++ ++ UpdateControls( &ed ); ++} ++ ++#define ENGINE_COLOR_WHITE 'w' ++#define ENGINE_COLOR_BLACK 'b' ++#define ENGINE_COLOR_UNKNOWN ' ' ++ ++// pure back end ++char GetEngineColor( int which ) ++{ ++ char result = ENGINE_COLOR_UNKNOWN; ++ ++ if( which == 0 || which == 1 ) { ++ ChessProgramState * cps; ++ ++ switch (gameMode) { ++ case MachinePlaysBlack: ++ case IcsPlayingBlack: ++ result = ENGINE_COLOR_BLACK; ++ break; ++ case MachinePlaysWhite: ++ case IcsPlayingWhite: ++ result = ENGINE_COLOR_WHITE; ++ break; ++ case AnalyzeMode: ++ case AnalyzeFile: ++ result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; ++ break; ++ case TwoMachinesPlay: ++ cps = (which == 0) ? &first : &second; ++ result = cps->twoMachinesColor[0]; ++ result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; ++ break; ++ } ++ } ++ ++ return result; ++} ++ ++// pure back end ++char GetActiveEngineColor() ++{ ++ char result = ENGINE_COLOR_UNKNOWN; ++ ++ if( gameMode == TwoMachinesPlay ) { ++ result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; ++ } ++ ++ return result; ++} ++ ++// pure back end ++static int IsEnginePondering( int which ) ++{ ++ int result = FALSE; ++ ++ switch (gameMode) { ++ case MachinePlaysBlack: ++ case IcsPlayingBlack: ++ if( WhiteOnMove(forwardMostMove) ) result = TRUE; ++ break; ++ case MachinePlaysWhite: ++ case IcsPlayingWhite: ++ if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; ++ break; ++ case TwoMachinesPlay: ++ if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { ++ if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; ++ } ++ break; ++ } ++ ++ return result; ++} ++ ++// back end ++static void SetDisplayMode( int mode ) ++{ ++ if( windowMode != mode ) { ++ windowMode = mode; ++ ++ ResizeWindowControls( engineOutputDialog, mode ); ++ } ++} ++ ++// pure back end ++static VerifyDisplayMode() ++{ ++ int mode; ++ ++ /* Get proper mode for current game */ ++ switch( gameMode ) { ++ case IcsObserving: // [HGM] ICS analyze ++ if(!appData.icsEngineAnalyze) return; ++ case AnalyzeMode: ++ case AnalyzeFile: ++ case MachinePlaysWhite: ++ case MachinePlaysBlack: ++ mode = 0; ++ break; ++ case IcsPlayingWhite: ++ case IcsPlayingBlack: ++ mode = appData.zippyPlay && opponentKibitzes; // [HGM] kibitz ++ break; ++ case TwoMachinesPlay: ++ mode = 1; ++ break; ++ default: ++ /* Do not change */ ++ return; ++ } ++ ++ SetDisplayMode( mode ); ++} ++ ++// back end. Determine what icon to se in the color-icon field, and print it ++static void SetEngineColorIcon( int which ) ++{ ++ char color = GetEngineColor(which); ++ int nicon = 0; ++ ++ if( color == ENGINE_COLOR_BLACK ) ++ nicon = nColorBlack; ++ else if( color == ENGINE_COLOR_WHITE ) ++ nicon = nColorWhite; ++ else ++ nicon = nColorUnknown; ++ ++ SetIcon( which, nColorIcon, nicon ); ++} ++ ++#define MAX_NAME_LENGTH 32 ++ ++// pure back end, now SetWindowText is called via wrapper DoSetWindowText ++static void UpdateControls( EngineOutputData * ed ) ++{ ++ int isPondering = FALSE; ++ ++ char s_label[MAX_NAME_LENGTH + 32]; ++ ++ char * name = ed->name; ++ ++ /* Label */ ++ if( name == 0 || *name == '\0' ) { ++ name = "?"; ++ } ++ ++ strncpy( s_label, name, MAX_NAME_LENGTH ); ++ s_label[ MAX_NAME_LENGTH-1 ] = '\0'; ++ ++#ifdef SHOW_PONDERING ++ if( IsEnginePondering( ed->which ) ) { ++ char buf[8]; ++ ++ buf[0] = '\0'; ++ ++ if( ed->hint != 0 && *ed->hint != '\0' ) { ++ strncpy( buf, ed->hint, sizeof(buf) ); ++ buf[sizeof(buf)-1] = '\0'; ++ } ++ else if( ed->pv != 0 && *ed->pv != '\0' ) { ++ char * sep = strchr( ed->pv, ' ' ); ++ int buflen = sizeof(buf); ++ ++ if( sep != NULL ) { ++ buflen = sep - ed->pv + 1; ++ if( buflen > sizeof(buf) ) buflen = sizeof(buf); ++ } ++ ++ strncpy( buf, ed->pv, buflen ); ++ buf[ buflen-1 ] = '\0'; ++ } ++ ++ SetEngineState( ed->which, STATE_PONDERING, buf ); ++ } ++ else if( gameMode == TwoMachinesPlay ) { ++ SetEngineState( ed->which, STATE_THINKING, "" ); ++ } ++ else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ++ || gameMode == IcsObserving && appData.icsEngineAnalyze) { // [HGM] ICS-analyze ++ char buf[64]; ++ int time_secs = ed->time / 100; ++ int time_mins = time_secs / 60; ++ ++ buf[0] = '\0'; ++ ++ if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { ++ char mov[16]; ++ ++ strncpy( mov, ed->hint, sizeof(mov) ); ++ mov[ sizeof(mov)-1 ] = '\0'; ++ ++ sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); ++ } ++ ++ SetEngineState( ed->which, STATE_ANALYZING, buf ); ++ } ++ else { ++ SetEngineState( ed->which, STATE_IDLE, "" ); ++ } ++#endif ++ ++ DoSetWindowText( ed->which, nLabel, s_label ); ++ ++ s_label[0] = '\0'; ++ ++ if( ed->time > 0 && ed->nodes > 0 ) { ++ unsigned long nps_100 = ed->nodes / ed->time; ++ ++ if( nps_100 < 100000 ) { ++ sprintf( s_label, "NPS: %lu", nps_100 * 100 ); ++ } ++ else { ++ sprintf( s_label, "NPS: %.1fk", nps_100 / 10.0 ); ++ } ++ } ++ ++ DoSetWindowText( ed->which, nLabelNPS, s_label ); ++ ++ /* Memo */ ++ if( ed->pv != 0 && *ed->pv != '\0' ) { ++ char s_nodes[24]; ++ char s_score[16]; ++ char s_time[24]; ++ char buf[256]; ++ int buflen; ++ int time_secs = ed->time / 100; ++ int time_cent = ed->time % 100; ++ ++ /* Nodes */ ++ if( ed->nodes < 1000000 ) { ++ sprintf( s_nodes, u64Display, ed->nodes ); ++ } ++ else { ++ sprintf( s_nodes, "%.1fM", u64ToDouble(ed->nodes) / 1000000.0 ); ++ } ++ ++ /* Score */ ++ if( ed->score > 0 ) { ++ sprintf( s_score, "+%.2f", ed->score / 100.0 ); ++ } ++ else { ++ sprintf( s_score, "%.2f", ed->score / 100.0 ); ++ } ++ ++ /* Time */ ++ sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); ++ ++ /* Put all together... */ ++ sprintf( buf, "%3d\t%s\t%s\t%s\t", ed->depth, s_score, s_nodes, s_time ); ++ ++ /* Add PV */ ++ buflen = strlen(buf); ++ ++ strncpy( buf + buflen, ed->pv, sizeof(buf) - buflen ); ++ ++ buf[ sizeof(buf) - 3 ] = '\0'; ++ ++ strcat( buf + buflen, "\r\n" ); ++ ++ /* Update memo */ ++ InsertIntoMemo( ed->which, buf ); ++ } ++ ++ /* Colors */ ++ SetEngineColorIcon( ed->which ); ++} ++ ++// back end ++int EngineOutputIsUp() ++{ ++ return engineOutputDialogUp; ++} ++ ++// [HGM] kibitz: write kibitz line; split window for it if necessary ++void OutputKibitz(int window, char *text) ++{ ++ if(!EngineOutputIsUp()) return; ++ if(!opponentKibitzes) { // on first kibitz of game, clear memos ++ DoClearMemo(1); ++ if(gameMode == IcsObserving) DoClearMemo(0); ++ } ++ opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes. ++ VerifyDisplayMode(); ++ if(gameMode == IcsObserving) { ++ DoSetWindowText(0, nLabel, gameInfo.white); ++ SetIcon( 0, nColorIcon, nColorWhite); ++ SetIcon( 0, nStateIcon, nClear); ++ } ++ DoSetWindowText(1, nLabel, gameMode == IcsPlayingBlack ? gameInfo.white : gameInfo.black); // opponent name ++ SetIcon( 1, nColorIcon, gameMode == IcsPlayingBlack ? nColorWhite : nColorBlack); ++ SetIcon( 1, nStateIcon, nClear); ++ InsertIntoMemo(window-1, text); ++} diff --cc winboard/winboard.c index a06361f,6ad5def..fb64ff7 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@@ -1,7886 -1,10600 +1,10680 @@@ - /* - * WinBoard.c -- Windows NT front end to XBoard - * $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. - * - * XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess, - * which was written and is copyrighted by Wayne Christopher. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * ------------------------------------------------------------------------ - */ - - #include "config.h" - - #include - #include - #include - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #if __GNUC__ - #include - #include - #endif - - #include "common.h" - #include "winboard.h" - #include "frontend.h" - #include "backend.h" - #include "moves.h" - #include "wclipbrd.h" - #include "wgamelist.h" - #include "wedittags.h" - #include "woptions.h" - #include "wsockerr.h" - #include "defaults.h" - - typedef struct { - ChessSquare piece; - POINT pos; /* window coordinates of current pos */ - POINT lastpos; /* window coordinates of last pos - used for clipping */ - POINT from; /* board coordinates of the piece's orig pos */ - POINT to; /* board coordinates of the piece's new pos */ - } AnimInfo; - - static AnimInfo animInfo = { EmptySquare, {-1,-1}, {-1,-1}, {-1,-1} }; - - typedef struct { - POINT start; /* window coordinates of start pos */ - POINT pos; /* window coordinates of current pos */ - POINT lastpos; /* window coordinates of last pos - used for clipping */ - POINT from; /* board coordinates of the piece's orig pos */ - } DragInfo; - - static DragInfo dragInfo = { {-1,-1}, {-1,-1}, {-1,-1}, {-1,-1} }; - - typedef struct { - POINT sq[2]; /* board coordinates of from, to squares */ - } HighlightInfo; - - static HighlightInfo highlightInfo = { {{-1, -1}, {-1, -1}} }; - static HighlightInfo premoveHighlightInfo = { {{-1, -1}, {-1, -1}} }; - - /* Window class names */ - char szAppName[] = "WinBoard"; - char szConsoleName[] = "WBConsole"; - - /* Title bar text */ - char szTitle[] = "WinBoard"; - char szConsoleTitle[] = "ICS Interaction"; - - char *programName; - char *settingsFileName; - BOOLEAN saveSettingsOnExit; - char installDir[MSG_SIZ]; - - BoardSize boardSize; - BOOLEAN chessProgram; - static int boardX, boardY, consoleX, consoleY, consoleW, consoleH; - static int squareSize, lineGap; - static int winWidth, winHeight; - static RECT messageRect, whiteRect, blackRect; - static char messageText[MESSAGE_TEXT_MAX]; - static int clockTimerEvent = 0; - static int loadGameTimerEvent = 0; - static int analysisTimerEvent = 0; - static DelayedEventCallback delayedTimerCallback; - static int delayedTimerEvent = 0; - static int buttonCount = 2; - char *icsTextMenuString; - char *icsNames; - char *firstChessProgramNames; - char *secondChessProgramNames; - - #define ARG_MAX 20000 - - #define PALETTESIZE 256 - - HINSTANCE hInst; /* current instance */ - HWND hwndMain = NULL; /* root window*/ - HWND hwndConsole = NULL; - BOOLEAN alwaysOnTop = FALSE; - RECT boardRect; - COLORREF lightSquareColor, darkSquareColor, whitePieceColor, - blackPieceColor, highlightSquareColor, premoveHighlightColor; - HPALETTE hPal; - ColorClass currentColorClass; - - HWND hCommPort = NULL; /* currently open comm port */ - static HWND hwndPause; /* pause button */ - static HBITMAP pieceBitmap[3][(int) WhiteKing + 1]; - static HBRUSH lightSquareBrush, darkSquareBrush, - whitePieceBrush, blackPieceBrush, iconBkgndBrush, outlineBrush; - static POINT gridEndpoints[(BOARD_SIZE + 1) * 4]; - static DWORD gridVertexCounts[(BOARD_SIZE + 1) * 2]; - static HPEN gridPen = NULL; - static HPEN highlightPen = NULL; - static HPEN premovePen = NULL; - static NPLOGPALETTE pLogPal; - static BOOL paletteChanged = FALSE; - static HICON iconWhite, iconBlack, iconCurrent; - static int doingSizing = FALSE; - static int lastSizing = 0; - static int prevStderrPort; - - #if __GNUC__ && !defined(_winmajor) - #define oldDialog 0 /* cygwin doesn't define _winmajor; mingw does */ - #else - #define oldDialog (_winmajor < 4) - #endif - - char *defaultTextAttribs[] = - { - COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, - COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, - COLOR_NONE - }; - - typedef struct { - char *name; - int squareSize; - int lineGap; - int smallLayout; - int tinyLayout; - int cliWidth, cliHeight; - } SizeInfo; - - SizeInfo sizeInfo[] = - { - { "tiny", 21, 0, 1, 1, 0, 0 }, - { "teeny", 25, 1, 1, 1, 0, 0 }, - { "dinky", 29, 1, 1, 1, 0, 0 }, - { "petite", 33, 1, 1, 1, 0, 0 }, - { "slim", 37, 2, 1, 0, 0, 0 }, - { "small", 40, 2, 1, 0, 0, 0 }, - { "mediocre", 45, 2, 1, 0, 0, 0 }, - { "middling", 49, 2, 0, 0, 0, 0 }, - { "average", 54, 2, 0, 0, 0, 0 }, - { "moderate", 58, 3, 0, 0, 0, 0 }, - { "medium", 64, 3, 0, 0, 0, 0 }, - { "bulky", 72, 3, 0, 0, 0, 0 }, - { "large", 80, 3, 0, 0, 0, 0 }, - { "big", 87, 3, 0, 0, 0, 0 }, - { "huge", 95, 3, 0, 0, 0, 0 }, - { "giant", 108, 3, 0, 0, 0, 0 }, - { "colossal", 116, 4, 0, 0, 0, 0 }, - { "titanic", 129, 4, 0, 0, 0, 0 }, - { NULL, 0, 0, 0, 0, 0, 0 } - }; - - #define MF(x) {x, {0, }, {0, }, 0} - MyFont fontRec[NUM_SIZES][NUM_FONTS] = - { - { MF(CLOCK_FONT_TINY), MF(MESSAGE_FONT_TINY), - MF(COORD_FONT_TINY), MF(CONSOLE_FONT_TINY), - MF(COMMENT_FONT_TINY), MF(EDITTAGS_FONT_TINY) }, - { MF(CLOCK_FONT_TEENY), MF(MESSAGE_FONT_TEENY), - MF(COORD_FONT_TEENY), MF(CONSOLE_FONT_TEENY), - MF(COMMENT_FONT_TEENY), MF(EDITTAGS_FONT_TEENY) }, - { MF(CLOCK_FONT_DINKY), MF(MESSAGE_FONT_DINKY), - MF(COORD_FONT_DINKY), MF(CONSOLE_FONT_DINKY), - MF(COMMENT_FONT_DINKY), MF(EDITTAGS_FONT_DINKY) }, - { MF(CLOCK_FONT_PETITE), MF(MESSAGE_FONT_PETITE), - MF(COORD_FONT_PETITE), MF(CONSOLE_FONT_PETITE), - MF(COMMENT_FONT_PETITE), MF(EDITTAGS_FONT_PETITE) }, - { MF(CLOCK_FONT_SLIM), MF(MESSAGE_FONT_SLIM), - MF(COORD_FONT_SLIM), MF(CONSOLE_FONT_SLIM), - MF(COMMENT_FONT_SLIM), MF(EDITTAGS_FONT_SLIM) }, - { MF(CLOCK_FONT_SMALL), MF(MESSAGE_FONT_SMALL), - MF(COORD_FONT_SMALL), MF(CONSOLE_FONT_SMALL), - MF(COMMENT_FONT_SMALL), MF(EDITTAGS_FONT_SMALL) }, - { MF(CLOCK_FONT_MEDIOCRE), MF(MESSAGE_FONT_MEDIOCRE), - MF(COORD_FONT_MEDIOCRE), MF(CONSOLE_FONT_MEDIOCRE), - MF(COMMENT_FONT_MEDIOCRE), MF(EDITTAGS_FONT_MEDIOCRE) }, - { MF(CLOCK_FONT_MIDDLING), MF(MESSAGE_FONT_MIDDLING), - MF(COORD_FONT_MIDDLING), MF(CONSOLE_FONT_MIDDLING), - MF(COMMENT_FONT_MIDDLING), MF(EDITTAGS_FONT_MIDDLING) }, - { MF(CLOCK_FONT_AVERAGE), MF(MESSAGE_FONT_AVERAGE), - MF(COORD_FONT_AVERAGE), MF(CONSOLE_FONT_AVERAGE), - MF(COMMENT_FONT_AVERAGE), MF(EDITTAGS_FONT_AVERAGE) }, - { MF(CLOCK_FONT_MODERATE), MF(MESSAGE_FONT_MODERATE), - MF(COORD_FONT_MODERATE), MF(CONSOLE_FONT_MODERATE), - MF(COMMENT_FONT_MODERATE), MF(EDITTAGS_FONT_MODERATE) }, - { MF(CLOCK_FONT_MEDIUM), MF(MESSAGE_FONT_MEDIUM), - MF(COORD_FONT_MEDIUM), MF(CONSOLE_FONT_MEDIUM), - MF(COMMENT_FONT_MEDIUM), MF(EDITTAGS_FONT_MEDIUM) }, - { MF(CLOCK_FONT_BULKY), MF(MESSAGE_FONT_BULKY), - MF(COORD_FONT_BULKY), MF(CONSOLE_FONT_BULKY), - MF(COMMENT_FONT_BULKY), MF(EDITTAGS_FONT_BULKY) }, - { MF(CLOCK_FONT_LARGE), MF(MESSAGE_FONT_LARGE), - MF(COORD_FONT_LARGE), MF(CONSOLE_FONT_LARGE), - MF(COMMENT_FONT_LARGE), MF(EDITTAGS_FONT_LARGE) }, - { MF(CLOCK_FONT_BIG), MF(MESSAGE_FONT_BIG), - MF(COORD_FONT_BIG), MF(CONSOLE_FONT_BIG), - MF(COMMENT_FONT_BIG), MF(EDITTAGS_FONT_BIG) }, - { MF(CLOCK_FONT_HUGE), MF(MESSAGE_FONT_HUGE), - MF(COORD_FONT_HUGE), MF(CONSOLE_FONT_HUGE), - MF(COMMENT_FONT_HUGE), MF(EDITTAGS_FONT_HUGE) }, - { MF(CLOCK_FONT_GIANT), MF(MESSAGE_FONT_GIANT), - MF(COORD_FONT_GIANT), MF(CONSOLE_FONT_GIANT), - MF(COMMENT_FONT_GIANT), MF(EDITTAGS_FONT_GIANT) }, - { MF(CLOCK_FONT_COLOSSAL), MF(MESSAGE_FONT_COLOSSAL), - MF(COORD_FONT_COLOSSAL), MF(CONSOLE_FONT_COLOSSAL), - MF(COMMENT_FONT_COLOSSAL), MF(EDITTAGS_FONT_COLOSSAL) }, - { MF(CLOCK_FONT_TITANIC), MF(MESSAGE_FONT_TITANIC), - MF(COORD_FONT_TITANIC), MF(CONSOLE_FONT_TITANIC), - MF(COMMENT_FONT_TITANIC), MF(EDITTAGS_FONT_TITANIC) }, - }; - - MyFont *font[NUM_SIZES][NUM_FONTS]; - - typedef struct { - char *label; - int id; - HWND hwnd; - WNDPROC wndproc; - } MyButtonDesc; - - #define BUTTON_WIDTH (tinyLayout ? 16 : 32) - #define N_BUTTONS 5 - - MyButtonDesc buttonDesc[N_BUTTONS] = - { - {"<<", IDM_ToStart, NULL, NULL}, - {"<", IDM_Backward, NULL, NULL}, - {"P", IDM_Pause, NULL, NULL}, - {">", IDM_Forward, NULL, NULL}, - {">>", IDM_ToEnd, NULL, NULL}, - }; - - int tinyLayout = 0, smallLayout = 0; - #define MENU_BAR_ITEMS 6 - char *menuBarText[2][MENU_BAR_ITEMS+1] = { - { "&File", "&Mode", "&Action", "&Step", "&Options", "&Help", NULL }, - { "&F", "&M", "&A", "&S", "&O", "&H", NULL }, - }; - - - MySound sounds[(int)NSoundClasses]; - MyTextAttribs textAttribs[(int)NColorClasses]; - - MyColorizeAttribs colorizeAttribs[] = { - { (COLORREF)0, 0, "Shout Text" }, - { (COLORREF)0, 0, "SShout/CShout" }, - { (COLORREF)0, 0, "Channel 1 Text" }, - { (COLORREF)0, 0, "Channel Text" }, - { (COLORREF)0, 0, "Kibitz Text" }, - { (COLORREF)0, 0, "Tell Text" }, - { (COLORREF)0, 0, "Challenge Text" }, - { (COLORREF)0, 0, "Request Text" }, - { (COLORREF)0, 0, "Seek Text" }, - { (COLORREF)0, 0, "Normal Text" }, - { (COLORREF)0, 0, "None" } - }; - - - - static char *commentTitle; - static char *commentText; - static int commentIndex; - static Boolean editComment = FALSE; - HWND commentDialog = NULL; - BOOLEAN commentDialogUp = FALSE; - static int commentX, commentY, commentH, commentW; - - static char *analysisTitle; - static char *analysisText; - HWND analysisDialog = NULL; - BOOLEAN analysisDialogUp = FALSE; - static int analysisX, analysisY, analysisH, analysisW; - - char errorTitle[MSG_SIZ]; - char errorMessage[2*MSG_SIZ]; - HWND errorDialog = NULL; - BOOLEAN moveErrorMessageUp = FALSE; - BOOLEAN consoleEcho = TRUE; - CHARFORMAT consoleCF; - COLORREF consoleBackgroundColor; - - char *programVersion; - - #define CPReal 1 - #define CPComm 2 - #define CPSock 3 - #define CPRcmd 4 - typedef int CPKind; - - typedef struct { - CPKind kind; - HANDLE hProcess; - DWORD pid; - HANDLE hTo; - HANDLE hFrom; - SOCKET sock; - SOCKET sock2; /* stderr socket for OpenRcmd */ - } ChildProc; - - #define INPUT_SOURCE_BUF_SIZE 4096 - - typedef struct _InputSource { - CPKind kind; - HANDLE hFile; - SOCKET sock; - int lineByLine; - HANDLE hThread; - DWORD id; - char buf[INPUT_SOURCE_BUF_SIZE]; - char *next; - DWORD count; - int error; - InputCallback func; - struct _InputSource *second; /* for stderr thread on CPRcmd */ - VOIDSTAR closure; - } InputSource; - - InputSource *consoleInputSource; - - DCB dcb; - - /* forward */ - VOID ConsoleOutput(char* data, int length, int forceVisible); - VOID ConsoleCreate(); - LRESULT CALLBACK - ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - VOID ColorizeTextPopup(HWND hwnd, ColorClass cc); - VOID PrintCommSettings(FILE *f, char *name, DCB *dcb); - VOID ParseCommSettings(char *arg, DCB *dcb); - LRESULT CALLBACK - StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - VOID APIENTRY MenuPopup(HWND hwnd, POINT pt, HMENU hmenu, UINT def); - void ParseIcsTextMenu(char *icsTextMenuString); - VOID PopUpMoveDialog(char firstchar); - VOID UpdateSampleText(HWND hDlg, int id, MyColorizeAttribs *mca); - - /* - * Setting "frozen" should disable all user input other than deleting - * the window. We do this while engines are initializing themselves. - */ - static int frozen = 0; - static int oldMenuItemState[MENU_BAR_ITEMS]; - void FreezeUI() - { - HMENU hmenu; - int i; - - if (frozen) return; - frozen = 1; - hmenu = GetMenu(hwndMain); - for (i=0; i screenWidth - 32) *x = 0; - if (*y > screenHeight - 32) *y = 0; - } - - BOOL - InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) - { - HWND hwnd; /* Main window handle. */ - int ibs; - WINDOWPLACEMENT wp; - char *filepart; - - hInst = hInstance; /* Store instance handle in our global variable */ - - if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) { - *filepart = NULLCHAR; - } else { - GetCurrentDirectory(MSG_SIZ, installDir); - } - InitAppData(lpCmdLine); /* Get run-time parameters */ - if (appData.debugMode) { - debugFP = fopen("winboard.debug", "w"); - setbuf(debugFP, NULL); - } - - InitBackEnd1(); - - /* Create a main window for this application instance. */ - hwnd = CreateWindow(szAppName, szTitle, - (WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX), - CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, - NULL, NULL, hInstance, NULL); - hwndMain = hwnd; - - /* If window could not be created, return "failure" */ - if (!hwnd) { - return (FALSE); - } - - iconWhite = LoadIcon(hInstance, "icon_white"); - iconBlack = LoadIcon(hInstance, "icon_black"); - iconCurrent = iconWhite; - InitDrawingColors(); - screenHeight = GetSystemMetrics(SM_CYSCREEN); - screenWidth = GetSystemMetrics(SM_CXSCREEN); - for (ibs = (int) NUM_SIZES - 1; ibs >= 0; ibs--) { - /* Compute window size for each board size, and use the largest - size that fits on this screen as the default. */ - InitDrawingSizes((BoardSize)ibs, 0); - if (boardSize == (BoardSize)-1 && - winHeight <= screenHeight && winWidth <= screenWidth) { - boardSize = (BoardSize)ibs - 4 < 0 ? (BoardSize)0 : (BoardSize)ibs - 4; - } - } - InitDrawingSizes(boardSize, 0); - InitMenuChecks(); - buttonCount = GetSystemMetrics(SM_CMOUSEBUTTONS); - - InitBackEnd2(); - - /* Make the window visible; update its client area; and return "success" */ - EnsureOnScreen(&boardX, &boardY); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = nCmdShow; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = boardX; - wp.rcNormalPosition.right = boardX + winWidth; - wp.rcNormalPosition.top = boardY; - wp.rcNormalPosition.bottom = boardY + winHeight; - SetWindowPlacement(hwndMain, &wp); - - SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - if (hwndConsole) { - #if AOT_CONSOLE - SetWindowPos(hwndConsole, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - #endif - ShowWindow(hwndConsole, nCmdShow); - } - UpdateWindow(hwnd); - - return TRUE; - - } - - - typedef enum { - ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, - ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, - ArgSettingsFilename - } ArgType; - - typedef struct { - char *argName; - ArgType argType; - /*** - union { - String *pString; // ArgString - int *pInt; // ArgInt - float *pFloat; // ArgFloat - Boolean *pBoolean; // ArgBoolean - COLORREF *pColor; // ArgColor - ColorClass cc; // ArgAttribs - String *pFilename; // ArgFilename - BoardSize *pBoardSize; // ArgBoardSize - int whichFont; // ArgFont - DCB *pDCB; // ArgCommSettings - String *pFilename; // ArgSettingsFilename - } argLoc; - ***/ - LPVOID argLoc; - BOOL save; - } ArgDescriptor; - - int junk; - ArgDescriptor argDescriptors[] = { - /* positional arguments */ - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "", ArgNone, NULL }, - /* keyword arguments */ - { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE }, - { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE }, - { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE }, - { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE }, - { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE }, - { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE }, - { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE }, - { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE }, - { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE }, - { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE }, - { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE }, - { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE }, - { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE }, - { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE }, - { "initString", ArgString, (LPVOID) &appData.initString, FALSE }, - { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE }, - { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE }, - { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString, - FALSE }, - { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString, - FALSE }, - { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram, - FALSE }, - { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE }, - { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram, - FALSE }, - { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE }, - { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, - { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE }, - { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE }, - { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, - { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, - { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE }, - { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE }, - { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE }, - { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE }, - { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, - { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, - { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, - { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, - /*!!bitmapDirectory?*/ - { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, - { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, - { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, - { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, - { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE }, - { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE }, - { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE }, - { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE }, - { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE }, - { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE }, - { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE }, - { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE }, - { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, - { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, - { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE }, - { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE }, - { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE }, - { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE }, - { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, - { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, - { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, - { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE }, - { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE }, - { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, - { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, - { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE }, - { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE }, - { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE }, - { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, - { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, - { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, - { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE }, - { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE }, - { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE }, - { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE }, - { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, - { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, - { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, - { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, - { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, - { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, - { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, - { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, - { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE }, - { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE }, - { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, - { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, - { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE }, - { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE }, - { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE }, - { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE }, - { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, - { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, - { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE }, - { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE }, - { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, - { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, - { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE }, - { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE }, - { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, - { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, - { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE }, - { "st", ArgString, (LPVOID) &appData.searchTime, FALSE }, - { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, - { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, - { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE }, - { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE }, - { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, - { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, - { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE }, - { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE }, - { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, - { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, - { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE }, - { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE }, - { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, - { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, - { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE }, - { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE }, - { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, - { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, - { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE }, - { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE }, - { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, - { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, - { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE }, - { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, - { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, - FALSE }, /* only so that old WinBoard.ini files from betas can be read */ - { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE }, - { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE }, - { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE }, - { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE }, - { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE }, - { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE }, - { "boardSize", ArgBoardSize, (LPVOID) &boardSize, - TRUE }, /* must come after all fonts */ - { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE }, - { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves, - FALSE }, /* historical; kept only so old winboard.ini files will parse */ - { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE }, - { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE }, - { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, - { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, - { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE }, - { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE }, - { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, - { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, - { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE }, - { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE }, - { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, - { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, - { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE }, - { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE }, - { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, - { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, - { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE }, - { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE }, - { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, - { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, - { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE }, - { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE }, - { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, - { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, - { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE }, - { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE }, - { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, - { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, - #if 0 - { "cmailGameName", ArgString, (LPVOID) &appData.cmailGameName, FALSE }, - { "cmail", ArgString, (LPVOID) &appData.cmailGameName, FALSE }, - #endif - { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE }, - { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, - { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE }, - { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, - { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE }, - { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE }, - { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, - { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, - { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE }, - { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE }, - { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, - { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, - { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE }, - { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE }, - { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, - { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, - { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE }, - { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE }, - { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE }, - { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE }, - { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE }, - { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE }, - { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, - { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, - { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE }, - { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE }, - { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE }, - { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, - { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, - { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE }, - { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE}, - { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE}, - { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, - { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE}, - { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, - { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, - { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE }, - { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, - { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, - { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE }, - { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE }, - { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE }, - { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE }, - { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE }, - { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE }, - { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE }, - { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, - { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, - { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE }, - { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE }, - { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, - { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, - { "highlightLastMove", ArgBoolean, - (LPVOID) &appData.highlightLastMove, TRUE }, - { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE }, - { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, - { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, - { "highlightDragging", ArgBoolean, - (LPVOID) &appData.highlightDragging, TRUE }, - { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE }, - { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, - { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, - { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE }, - { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE }, - { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, - { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, - { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE }, - { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE }, - { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE }, - { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE }, - { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE }, - { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE }, - { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE }, - { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE }, - { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE }, - { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE }, - { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE }, - { "soundShout", ArgFilename, - (LPVOID) &textAttribs[ColorShout].sound.name, TRUE }, - { "soundSShout", ArgFilename, - (LPVOID) &textAttribs[ColorSShout].sound.name, TRUE }, - { "soundChannel1", ArgFilename, - (LPVOID) &textAttribs[ColorChannel1].sound.name, TRUE }, - { "soundChannel", ArgFilename, - (LPVOID) &textAttribs[ColorChannel].sound.name, TRUE }, - { "soundKibitz", ArgFilename, - (LPVOID) &textAttribs[ColorKibitz].sound.name, TRUE }, - { "soundTell", ArgFilename, - (LPVOID) &textAttribs[ColorTell].sound.name, TRUE }, - { "soundChallenge", ArgFilename, - (LPVOID) &textAttribs[ColorChallenge].sound.name, TRUE }, - { "soundRequest", ArgFilename, - (LPVOID) &textAttribs[ColorRequest].sound.name, TRUE }, - { "soundSeek", ArgFilename, - (LPVOID) &textAttribs[ColorSeek].sound.name, TRUE }, - { "soundMove", ArgFilename, (LPVOID) &sounds[(int)SoundMove].name, TRUE }, - { "soundBell", ArgFilename, (LPVOID) &sounds[(int)SoundBell].name, TRUE }, - { "soundIcsWin", ArgFilename, (LPVOID) &sounds[(int)SoundIcsWin].name,TRUE }, - { "soundIcsLoss", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsLoss].name, TRUE }, - { "soundIcsDraw", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsDraw].name, TRUE }, - { "soundIcsUnfinished", ArgFilename, - (LPVOID) &sounds[(int)SoundIcsUnfinished].name, TRUE}, - { "soundIcsAlarm", ArgFilename, - (LPVOID) &sounds[(int)SoundAlarm].name, TRUE }, - { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE }, - { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE }, - { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, - { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, - { "reuseChessPrograms", ArgBoolean, - (LPVOID) &appData.reuseFirst, FALSE }, /* backward compat only */ - { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE }, - { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE }, - { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, - { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, - { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE }, - { "x", ArgInt, (LPVOID) &boardX, TRUE }, - { "y", ArgInt, (LPVOID) &boardY, TRUE }, - { "icsX", ArgInt, (LPVOID) &consoleX, TRUE }, - { "icsY", ArgInt, (LPVOID) &consoleY, TRUE }, - { "icsW", ArgInt, (LPVOID) &consoleW, TRUE }, - { "icsH", ArgInt, (LPVOID) &consoleH, TRUE }, - { "analysisX", ArgInt, (LPVOID) &analysisX, TRUE }, - { "analysisY", ArgInt, (LPVOID) &analysisY, TRUE }, - { "analysisW", ArgInt, (LPVOID) &analysisW, TRUE }, - { "analysisH", ArgInt, (LPVOID) &analysisH, TRUE }, - { "commentX", ArgInt, (LPVOID) &commentX, TRUE }, - { "commentY", ArgInt, (LPVOID) &commentY, TRUE }, - { "commentW", ArgInt, (LPVOID) &commentW, TRUE }, - { "commentH", ArgInt, (LPVOID) &commentH, TRUE }, - { "tagsX", ArgInt, (LPVOID) &editTagsX, TRUE }, - { "tagsY", ArgInt, (LPVOID) &editTagsY, TRUE }, - { "tagsW", ArgInt, (LPVOID) &editTagsW, TRUE }, - { "tagsH", ArgInt, (LPVOID) &editTagsH, TRUE }, - { "gameListX", ArgInt, (LPVOID) &gameListX, TRUE }, - { "gameListY", ArgInt, (LPVOID) &gameListY, TRUE }, - { "gameListW", ArgInt, (LPVOID) &gameListW, TRUE }, - { "gameListH", ArgInt, (LPVOID) &gameListH, TRUE }, - { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, - { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, - { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE }, - { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE }, - { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE }, - { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE }, - { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE }, - { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE }, - { "icsNames", ArgString, (LPVOID) &icsNames, TRUE }, - { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames, - TRUE }, - { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames, - TRUE }, - { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE }, - { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE }, - { "variant", ArgString, (LPVOID) &appData.variant, FALSE }, - { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, - FALSE }, - { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion, - FALSE }, - { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE }, - { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE }, - { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, - { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, - #ifdef ZIPPY - { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE }, - { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE }, - { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, - { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, - { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE }, - { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE }, - { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, - { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, - { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE }, - { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE }, - { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE }, - { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE }, - { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword, - FALSE }, - { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE }, - { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE }, - { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE }, - { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, - { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, - { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE }, - { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty, - FALSE }, - { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, - { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE }, - { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE }, - { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, - { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE }, - { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE }, - { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, - { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, - { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE }, - { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE }, - { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE }, - /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ - { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE }, - #endif - { NULL, ArgNone, NULL, FALSE } - }; - - - /* Kludge for indirection files on command line */ - char* lastIndirectionFilename; - ArgDescriptor argDescriptorIndirection = - { "", ArgSettingsFilename, (LPVOID) NULL, FALSE }; - - - VOID - ExitArgError(char *msg, char *badArg) - { - char buf[MSG_SIZ]; - - sprintf(buf, "%s %s", msg, badArg); - DisplayFatalError(buf, 0, 2); - exit(2); - } - - /* Command line font name parser. NULL name means do nothing. - Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b" - For backward compatibility, syntax without the colon is also - accepted, but font names with digits in them won't work in that case. - */ - VOID - ParseFontName(char *name, MyFontParams *mfp) - { - char *p, *q; - if (name == NULL) return; - p = name; - q = strchr(p, ':'); - if (q) { - if (q - p >= sizeof(mfp->faceName)) - ExitArgError("Font name too long:", name); - memcpy(mfp->faceName, p, q - p); - mfp->faceName[q - p] = NULLCHAR; - p = q + 1; - } else { - q = mfp->faceName; - while (*p && !isdigit(*p)) { - *q++ = *p++; - if (q - mfp->faceName >= sizeof(mfp->faceName)) - ExitArgError("Font name too long:", name); - } - while (q > mfp->faceName && q[-1] == ' ') q--; - *q = NULLCHAR; - } - if (!*p) ExitArgError("Font point size missing:", name); - mfp->pointSize = (float) atof(p); - mfp->bold = (strchr(p, 'b') != NULL); - mfp->italic = (strchr(p, 'i') != NULL); - mfp->underline = (strchr(p, 'u') != NULL); - mfp->strikeout = (strchr(p, 's') != NULL); - } - - /* Color name parser. - X version accepts X color names, but this one - handles only the #rrggbb form (hex) or rrr,ggg,bbb (decimal) */ - COLORREF - ParseColorName(char *name) - { - int red, green, blue, count; - char buf[MSG_SIZ]; - - count = sscanf(name, "#%2x%2x%2x", &red, &green, &blue); - if (count != 3) { - count = sscanf(name, "%3d%*[^0-9]%3d%*[^0-9]%3d", - &red, &green, &blue); - } - if (count != 3) { - sprintf(buf, "Can't parse color name %s", name); - DisplayError(buf, 0); - return RGB(0, 0, 0); - } - return PALETTERGB(red, green, blue); - } - - - void ParseAttribs(COLORREF *color, int *effects, char* argValue) - { - char *e = argValue; - int eff = 0; - - while (*e) { - if (*e == 'b') eff |= CFE_BOLD; - else if (*e == 'i') eff |= CFE_ITALIC; - else if (*e == 'u') eff |= CFE_UNDERLINE; - else if (*e == 's') eff |= CFE_STRIKEOUT; - else if (*e == '#' || isdigit(*e)) break; - e++; - } - *effects = eff; - *color = ParseColorName(e); - } - - - BoardSize - ParseBoardSize(char *name) - { - BoardSize bs = SizeTiny; - while (sizeInfo[bs].name != NULL) { - if (StrCaseCmp(name, sizeInfo[bs].name) == 0) return bs; - bs++; - } - ExitArgError("Unrecognized board size value", name); - return bs; /* not reached */ - } - - - char - StringGet(void *getClosure) - { - char **p = (char **) getClosure; - return *((*p)++); - } - - char - FileGet(void *getClosure) - { - int c; - FILE* f = (FILE*) getClosure; - - c = getc(f); - if (c == EOF) - return NULLCHAR; - else - return (char) c; - } - - /* Parse settings file named "name". If file found, return the - full name in fullname and return TRUE; else return FALSE */ - BOOLEAN - ParseSettingsFile(char *name, char fullname[MSG_SIZ]) - { - char *dummy; - FILE *f; - - if (SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy)) { - f = fopen(fullname, "r"); - if (f != NULL) { - ParseArgs(FileGet, f); - fclose(f); - return TRUE; - } - } - return FALSE; - } - - VOID - ParseArgs(GetFunc get, void *cl) - { - char argName[ARG_MAX]; - char argValue[ARG_MAX]; - ArgDescriptor *ad; - char start; - char *q; - int i, octval; - char ch; - int posarg = 0; - - ch = get(cl); - for (;;) { - while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR) break; - if (ch == ';') { - /* Comment to end of line */ - ch = get(cl); - while (ch != '\n' && ch != NULLCHAR) ch = get(cl); - continue; - } else if (ch == '/' || ch == '-') { - /* Switch */ - q = argName; - while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR && - ch != '\n' && ch != '\t') { - *q++ = ch; - ch = get(cl); - } - *q = NULLCHAR; - - for (ad = argDescriptors; ad->argName != NULL; ad++) - if (strcmp(ad->argName, argName + 1) == 0) break; - - if (ad->argName == NULL) - ExitArgError("Unrecognized argument", argName); - - } else if (ch == '@') { - /* Indirection file */ - ad = &argDescriptorIndirection; - ch = get(cl); - } else { - /* Positional argument */ - ad = &argDescriptors[posarg++]; - strcpy(argName, ad->argName); - } - - if (ad->argType == ArgTrue) { - *(Boolean *) ad->argLoc = TRUE; - continue; - } - if (ad->argType == ArgFalse) { - *(Boolean *) ad->argLoc = FALSE; - continue; - } - - while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); - if (ch == NULLCHAR || ch == '\n') { - ExitArgError("No value provided for argument", argName); - } - q = argValue; - if (ch == '{') { - // Quoting with { }. No characters have to (or can) be escaped. - // Thus the string cannot contain a '}' character. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - case '}': - ch = get(cl); - start = NULLCHAR; - break; - - default: - *q++ = ch; - ch = get(cl); - break; - } - } - } else if (ch == '\'' || ch == '"') { - // Quoting with ' ' or " ", with \ as escape character. - // Inconvenient for long strings that may contain Windows filenames. - start = ch; - ch = get(cl); - while (start) { - switch (ch) { - case NULLCHAR: - start = NULLCHAR; - break; - - default: - not_special: - *q++ = ch; - ch = get(cl); - break; - - case '\'': - case '\"': - if (ch == start) { - ch = get(cl); - start = NULLCHAR; - break; - } else { - goto not_special; - } - - case '\\': - if (ad->argType == ArgFilename - || ad->argType == ArgSettingsFilename) { - goto not_special; - } - ch = get(cl); - switch (ch) { - case NULLCHAR: - ExitArgError("Incomplete \\ escape in value for", argName); - break; - case 'n': - *q++ = '\n'; - ch = get(cl); - break; - case 'r': - *q++ = '\r'; - ch = get(cl); - break; - case 't': - *q++ = '\t'; - ch = get(cl); - break; - case 'b': - *q++ = '\b'; - ch = get(cl); - break; - case 'f': - *q++ = '\f'; - ch = get(cl); - break; - default: - octval = 0; - for (i = 0; i < 3; i++) { - if (ch >= '0' && ch <= '7') { - octval = octval*8 + (ch - '0'); - ch = get(cl); - } else { - break; - } - } - if (i > 0) { - *q++ = (char) octval; - } else { - *q++ = ch; - ch = get(cl); - } - break; - } - break; - } - } - } else { - while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') { - *q++ = ch; - ch = get(cl); - } - } - *q = NULLCHAR; - - switch (ad->argType) { - case ArgInt: - *(int *) ad->argLoc = atoi(argValue); - break; - - case ArgFloat: - *(float *) ad->argLoc = (float) atof(argValue); - break; - - case ArgString: - case ArgFilename: - *(char **) ad->argLoc = strdup(argValue); - break; - - case ArgSettingsFilename: - { - char fullname[MSG_SIZ]; - if (ParseSettingsFile(argValue, fullname)) { - if (ad->argLoc != NULL) { - *(char **) ad->argLoc = strdup(fullname); - } - } else { - if (ad->argLoc != NULL) { - } else { - ExitArgError("Failed to open indirection file", argValue); - } - } - } - break; - - case ArgBoolean: - switch (argValue[0]) { - case 't': - case 'T': - *(Boolean *) ad->argLoc = TRUE; - break; - case 'f': - case 'F': - *(Boolean *) ad->argLoc = FALSE; - break; - default: - ExitArgError("Unrecognized boolean argument value", argValue); - break; - } - break; - - case ArgColor: - *(COLORREF *)ad->argLoc = ParseColorName(argValue); - break; - - case ArgAttribs: { - ColorClass cc = (ColorClass)ad->argLoc; - ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue); - } - break; - - case ArgBoardSize: - *(BoardSize *)ad->argLoc = ParseBoardSize(argValue); - break; - - case ArgFont: - ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp); - break; - - case ArgCommSettings: - ParseCommSettings(argValue, &dcb); - break; - - case ArgNone: - ExitArgError("Unrecognized argument", argValue); - break; - } - } - } - - VOID - LFfromMFP(LOGFONT* lf, MyFontParams *mfp) - { - HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); - lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); - DeleteDC(hdc); - lf->lfWidth = 0; - lf->lfEscapement = 0; - lf->lfOrientation = 0; - lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; - lf->lfItalic = mfp->italic; - lf->lfUnderline = mfp->underline; - lf->lfStrikeOut = mfp->strikeout; - lf->lfCharSet = DEFAULT_CHARSET; - lf->lfOutPrecision = OUT_DEFAULT_PRECIS; - lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf->lfQuality = DEFAULT_QUALITY; - lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; - strcpy(lf->lfFaceName, mfp->faceName); - } - - VOID - CreateFontInMF(MyFont *mf) - { - LFfromMFP(&mf->lf, &mf->mfp); - if (mf->hf) DeleteObject(mf->hf); - mf->hf = CreateFontIndirect(&mf->lf); - } - - VOID - SetDefaultTextAttribs() - { - ColorClass cc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - ParseAttribs(&textAttribs[cc].color, - &textAttribs[cc].effects, - defaultTextAttribs[cc]); - } - } - - VOID - SetDefaultSounds() - { - ColorClass cc; - SoundClass sc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - textAttribs[cc].sound.name = strdup(""); - textAttribs[cc].sound.data = NULL; - } - for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { - sounds[sc].name = strdup(""); - sounds[sc].data = NULL; - } - sounds[(int)SoundBell].name = strdup(SOUND_BELL); - } - - VOID - LoadAllSounds() - { - ColorClass cc; - SoundClass sc; - for (cc = (ColorClass)0; cc < NColorClasses; cc++) { - MyLoadSound(&textAttribs[cc].sound); - } - for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { - MyLoadSound(&sounds[sc]); - } - } - - VOID - InitAppData(LPSTR lpCmdLine) - { - int i, j; - char buf[ARG_MAX], currDir[MSG_SIZ]; - char *dummy, *p; - - programName = szAppName; - - /* Initialize to defaults */ - lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR); - darkSquareColor = ParseColorName(DARK_SQUARE_COLOR); - whitePieceColor = ParseColorName(WHITE_PIECE_COLOR); - blackPieceColor = ParseColorName(BLACK_PIECE_COLOR); - highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR); - premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR); - consoleBackgroundColor = ParseColorName(COLOR_BKGD); - SetDefaultTextAttribs(); - SetDefaultSounds(); - appData.movesPerSession = MOVES_PER_SESSION; - appData.initString = INIT_STRING; - appData.secondInitString = INIT_STRING; - appData.firstComputerString = COMPUTER_STRING; - appData.secondComputerString = COMPUTER_STRING; - appData.firstChessProgram = FIRST_CHESS_PROGRAM; - appData.secondChessProgram = SECOND_CHESS_PROGRAM; - appData.firstPlaysBlack = FALSE; - appData.noChessProgram = FALSE; - chessProgram = FALSE; - appData.firstHost = FIRST_HOST; - appData.secondHost = SECOND_HOST; - appData.firstDirectory = FIRST_DIRECTORY; - appData.secondDirectory = SECOND_DIRECTORY; - appData.bitmapDirectory = ""; - appData.remoteShell = REMOTE_SHELL; - appData.remoteUser = ""; - appData.timeDelay = TIME_DELAY; - appData.timeControl = TIME_CONTROL; - appData.timeIncrement = TIME_INCREMENT; - appData.icsActive = FALSE; - appData.icsHost = ""; - appData.icsPort = ICS_PORT; - appData.icsCommPort = ICS_COMM_PORT; - appData.icsLogon = ICS_LOGON; - appData.icsHelper = ""; - appData.useTelnet = FALSE; - appData.telnetProgram = TELNET_PROGRAM; - appData.gateway = ""; - appData.loadGameFile = ""; - appData.loadGameIndex = 0; - appData.saveGameFile = ""; - appData.autoSaveGames = FALSE; - appData.loadPositionFile = ""; - appData.loadPositionIndex = 1; - appData.savePositionFile = ""; - appData.matchMode = FALSE; - appData.matchGames = 0; - appData.monoMode = FALSE; - appData.debugMode = FALSE; - appData.clockMode = TRUE; - boardSize = (BoardSize) -1; /* determine by screen size */ - appData.Iconic = FALSE; /*unused*/ - appData.searchTime = ""; - appData.searchDepth = 0; - appData.showCoords = FALSE; - appData.ringBellAfterMoves = TRUE; /*obsolete in WinBoard*/ - appData.autoCallFlag = FALSE; - appData.flipView = FALSE; - appData.autoFlipView = TRUE; - appData.cmailGameName = ""; - appData.alwaysPromoteToQueen = FALSE; - appData.oldSaveStyle = FALSE; - appData.quietPlay = FALSE; - appData.showThinking = FALSE; - appData.ponderNextMove = TRUE; - appData.periodicUpdates = TRUE; - appData.popupExitMessage = TRUE; - appData.popupMoveErrors = FALSE; - appData.autoObserve = FALSE; - appData.autoComment = FALSE; - appData.animate = TRUE; - appData.animSpeed = 10; - appData.animateDragging = TRUE; - appData.highlightLastMove = TRUE; - appData.getMoveList = TRUE; - appData.testLegality = TRUE; - appData.premove = TRUE; - appData.premoveWhite = FALSE; - appData.premoveWhiteText = ""; - appData.premoveBlack = FALSE; - appData.premoveBlackText = ""; - appData.icsAlarm = TRUE; - appData.icsAlarmTime = 5000; - appData.autoRaiseBoard = TRUE; - appData.localLineEditing = TRUE; - appData.colorize = TRUE; - appData.reuseFirst = TRUE; - appData.reuseSecond = TRUE; - appData.blindfold = FALSE; - appData.icsEngineAnalyze = FALSE; - dcb.DCBlength = sizeof(DCB); - dcb.BaudRate = 9600; - dcb.fBinary = TRUE; - dcb.fParity = FALSE; - dcb.fOutxCtsFlow = FALSE; - dcb.fOutxDsrFlow = FALSE; - dcb.fDtrControl = DTR_CONTROL_ENABLE; - dcb.fDsrSensitivity = FALSE; - dcb.fTXContinueOnXoff = TRUE; - dcb.fOutX = FALSE; - dcb.fInX = FALSE; - dcb.fNull = FALSE; - dcb.fRtsControl = RTS_CONTROL_ENABLE; - dcb.fAbortOnError = FALSE; - /* Microsoft SDK >= Feb. 2003 (MS VS >= 2002) */ - #if (defined(_MSC_VER) && _MSC_VER <= 1200) - //dcb.wReserved = 0; - #else - dcb.wReserved = 0; - #endif - dcb.ByteSize = 7; - dcb.Parity = SPACEPARITY; - dcb.StopBits = ONESTOPBIT; - settingsFileName = SETTINGS_FILE; - saveSettingsOnExit = TRUE; - boardX = CW_USEDEFAULT; - boardY = CW_USEDEFAULT; - consoleX = CW_USEDEFAULT; - consoleY = CW_USEDEFAULT; - consoleW = CW_USEDEFAULT; - consoleH = CW_USEDEFAULT; - analysisX = CW_USEDEFAULT; - analysisY = CW_USEDEFAULT; - analysisW = CW_USEDEFAULT; - analysisH = CW_USEDEFAULT; - commentX = CW_USEDEFAULT; - commentY = CW_USEDEFAULT; - commentW = CW_USEDEFAULT; - commentH = CW_USEDEFAULT; - editTagsX = CW_USEDEFAULT; - editTagsY = CW_USEDEFAULT; - editTagsW = CW_USEDEFAULT; - editTagsH = CW_USEDEFAULT; - gameListX = CW_USEDEFAULT; - gameListY = CW_USEDEFAULT; - gameListW = CW_USEDEFAULT; - gameListH = CW_USEDEFAULT; - icsTextMenuString = ICS_TEXT_MENU_DEFAULT; - icsNames = ICS_NAMES; - firstChessProgramNames = FCP_NAMES; - secondChessProgramNames = SCP_NAMES; - appData.initialMode = ""; - appData.variant = "normal"; - appData.firstProtocolVersion = PROTOVER; - appData.secondProtocolVersion = PROTOVER; - appData.showButtonBar = TRUE; - #ifdef ZIPPY - appData.zippyTalk = ZIPPY_TALK; - appData.zippyPlay = ZIPPY_PLAY; - appData.zippyLines = ZIPPY_LINES; - appData.zippyPinhead = ZIPPY_PINHEAD; - appData.zippyPassword = ZIPPY_PASSWORD; - appData.zippyPassword2 = ZIPPY_PASSWORD2; - appData.zippyWrongPassword = ZIPPY_WRONG_PASSWORD; - appData.zippyAcceptOnly = ZIPPY_ACCEPT_ONLY; - appData.zippyUseI = ZIPPY_USE_I; - appData.zippyBughouse = ZIPPY_BUGHOUSE; - appData.zippyNoplayCrafty = ZIPPY_NOPLAY_CRAFTY; - appData.zippyGameEnd = ZIPPY_GAME_END; - appData.zippyGameStart = ZIPPY_GAME_START; - appData.zippyAdjourn = ZIPPY_ADJOURN; - appData.zippyAbort = ZIPPY_ABORT; - appData.zippyVariants = ZIPPY_VARIANTS; - appData.zippyMaxGames = ZIPPY_MAX_GAMES; - appData.zippyReplayTimeout = ZIPPY_REPLAY_TIMEOUT; - #endif - - /* Point font array elements to structures and - parse default font names */ - for (i=0; idef, &font[j][i]->mfp); - } - } - - /* Parse default settings file if any */ - if (ParseSettingsFile(settingsFileName, buf)) { - settingsFileName = strdup(buf); - } - - /* Parse command line */ - ParseArgs(StringGet, &lpCmdLine); - - /* Propagate options that affect others */ - if (appData.matchMode || appData.matchGames) chessProgram = TRUE; - if (appData.icsActive || appData.noChessProgram) { - chessProgram = FALSE; /* not local chess program mode */ - } - - /* Open startup dialog if needed */ - if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || - (appData.icsActive && *appData.icsHost == NULLCHAR) || - (chessProgram && (*appData.firstChessProgram == NULLCHAR || - *appData.secondChessProgram == NULLCHAR))) { - FARPROC lpProc; - - lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); - DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - - /* Make sure save files land in the right (?) directory */ - if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) { - appData.saveGameFile = strdup(buf); - } - if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) { - appData.savePositionFile = strdup(buf); - } - - /* Finish initialization for fonts and sounds */ - for (i=0; iargName != NULL; ad++) { - if (!ad->save) continue; - switch (ad->argType) { - case ArgString: - { - char *p = *(char **)ad->argLoc; - if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { - /* Quote multiline values or \-containing values - with { } if possible */ - fprintf(f, "/%s={%s}\n", ad->argName, p); - } else { - /* Else quote with " " */ - fprintf(f, "/%s=\"", ad->argName); - while (*p) { - if (*p == '\n') fprintf(f, "\n"); - else if (*p == '\r') fprintf(f, "\\r"); - else if (*p == '\t') fprintf(f, "\\t"); - else if (*p == '\b') fprintf(f, "\\b"); - else if (*p == '\f') fprintf(f, "\\f"); - else if (*p < ' ') fprintf(f, "\\%03o", *p); - else if (*p == '\"') fprintf(f, "\\\""); - else if (*p == '\\') fprintf(f, "\\\\"); - else putc(*p, f); - p++; - } - fprintf(f, "\"\n"); - } - } - break; - case ArgInt: - fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc); - break; - case ArgFloat: - fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc); - break; - case ArgBoolean: - fprintf(f, "/%s=%s\n", ad->argName, - (*(Boolean *)ad->argLoc) ? "true" : "false"); - break; - case ArgTrue: - if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); - break; - case ArgFalse: - if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); - break; - case ArgColor: - { - COLORREF color = *(COLORREF *)ad->argLoc; - fprintf(f, "/%s=#%02x%02x%02x\n", ad->argName, - color&0xff, (color>>8)&0xff, (color>>16)&0xff); - } - break; - case ArgAttribs: - { - MyTextAttribs* ta = &textAttribs[(ColorClass)ad->argLoc]; - fprintf(f, "/%s=\"%s%s%s%s%s#%02x%02x%02x\"\n", ad->argName, - (ta->effects & CFE_BOLD) ? "b" : "", - (ta->effects & CFE_ITALIC) ? "i" : "", - (ta->effects & CFE_UNDERLINE) ? "u" : "", - (ta->effects & CFE_STRIKEOUT) ? "s" : "", - (ta->effects) ? " " : "", - ta->color&0xff, (ta->color >> 8)&0xff, (ta->color >> 16)&0xff); - } - break; - case ArgFilename: - if (strchr(*(char **)ad->argLoc, '\"')) { - fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc); - } else { - fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc); - } - break; - case ArgBoardSize: - fprintf(f, "/%s=%s\n", ad->argName, - sizeInfo[*(BoardSize *)ad->argLoc].name); - break; - case ArgFont: - { - int bs; - for (bs=0; bsargLoc]->mfp; - fprintf(f, "/size=%s ", sizeInfo[bs].name); - fprintf(f, "/%s=\"%s:%g%s%s%s%s%s\"\n", - ad->argName, mfp->faceName, mfp->pointSize, - mfp->bold || mfp->italic || mfp->underline || mfp->strikeout ? " " : "", - mfp->bold ? "b" : "", - mfp->italic ? "i" : "", - mfp->underline ? "u" : "", - mfp->strikeout ? "s" : ""); - } - } - break; - case ArgCommSettings: - PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc); - } - } - fclose(f); - } - - - - /*---------------------------------------------------------------------------*\ - * - * GDI board drawing routines - * - \*---------------------------------------------------------------------------*/ - - HBITMAP - DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix) - { - char name[128]; - - sprintf(name, "%s%d%s", piece, squareSize, suffix); - if (gameInfo.event && - strcmp(gameInfo.event, "Easter Egg Hunt") == 0 && - strcmp(name, "k80s") == 0) { - strcpy(name, "tim"); - } - return LoadBitmap(hinst, name); - } - - - /* Insert a color into the program's logical palette - structure. This code assumes the given color is - the result of the RGB or PALETTERGB macro, and it - knows how those macros work (which is documented). - */ - VOID - InsertInPalette(COLORREF color) - { - LPPALETTEENTRY pe = &(pLogPal->palPalEntry[pLogPal->palNumEntries]); - - if (pLogPal->palNumEntries++ >= PALETTESIZE) { - DisplayFatalError("Too many colors", 0, 1); - pLogPal->palNumEntries--; - return; - } - - pe->peFlags = (char) 0; - pe->peRed = (char) (0xFF & color); - pe->peGreen = (char) (0xFF & (color >> 8)); - pe->peBlue = (char) (0xFF & (color >> 16)); - return; - } - - - VOID - InitDrawingColors() - { - if (pLogPal == NULL) { - /* Allocate enough memory for a logical palette with - * PALETTESIZE entries and set the size and version fields - * of the logical palette structure. - */ - pLogPal = (NPLOGPALETTE) - LocalAlloc(LMEM_FIXED, (sizeof(LOGPALETTE) + - (sizeof(PALETTEENTRY) * (PALETTESIZE)))); - pLogPal->palVersion = 0x300; - } - pLogPal->palNumEntries = 0; - - InsertInPalette(lightSquareColor); - InsertInPalette(darkSquareColor); - InsertInPalette(whitePieceColor); - InsertInPalette(blackPieceColor); - InsertInPalette(highlightSquareColor); - InsertInPalette(premoveHighlightColor); - - /* create a logical color palette according the information - * in the LOGPALETTE structure. - */ - hPal = CreatePalette((LPLOGPALETTE) pLogPal); - - lightSquareBrush = CreateSolidBrush(lightSquareColor); - darkSquareBrush = CreateSolidBrush(darkSquareColor); - whitePieceBrush = CreateSolidBrush(whitePieceColor); - blackPieceBrush = CreateSolidBrush(blackPieceColor); - iconBkgndBrush = CreateSolidBrush(GetSysColor(COLOR_BACKGROUND)); - } - - - int - BoardWidth(int boardSize) - { - return (BOARD_SIZE + 1) * sizeInfo[boardSize].lineGap + - BOARD_SIZE * sizeInfo[boardSize].squareSize; - } - - /* Respond to board resize by dragging edge */ - VOID - ResizeBoard(int newSizeX, int newSizeY, int flags) - { - BoardSize newSize = NUM_SIZES - 1; - static int recurse = 0; - if (IsIconic(hwndMain)) return; - if (recurse > 0) return; - recurse++; - while (newSize > 0 && - (newSizeX < sizeInfo[newSize].cliWidth || - newSizeY < sizeInfo[newSize].cliHeight)) { - newSize--; - } - boardSize = newSize; - InitDrawingSizes(boardSize, flags); - recurse--; - } - - - - VOID - InitDrawingSizes(BoardSize boardSize, int flags) - { - int i, boardWidth; - ChessSquare piece; - static int oldBoardSize = -1, oldTinyLayout = 0; - HDC hdc; - SIZE clockSize, messageSize; - HFONT oldFont; - char buf[MSG_SIZ]; - char *str; - HMENU hmenu = GetMenu(hwndMain); - RECT crect, wrect; - int offby; - LOGBRUSH logbrush; - - tinyLayout = sizeInfo[boardSize].tinyLayout; - smallLayout = sizeInfo[boardSize].smallLayout; - squareSize = sizeInfo[boardSize].squareSize; - lineGap = sizeInfo[boardSize].lineGap; - - if (tinyLayout != oldTinyLayout) { - long style = GetWindowLong(hwndMain, GWL_STYLE); - if (tinyLayout) { - style &= ~WS_SYSMENU; - InsertMenu(hmenu, IDM_Exit, MF_BYCOMMAND, IDM_Minimize, - "&Minimize\tCtrl+F4"); - } else { - style |= WS_SYSMENU; - RemoveMenu(hmenu, IDM_Minimize, MF_BYCOMMAND); - } - SetWindowLong(hwndMain, GWL_STYLE, style); - - for (i=0; menuBarText[tinyLayout][i]; i++) { - ModifyMenu(hmenu, i, MF_STRING|MF_BYPOSITION|MF_POPUP, - (UINT)GetSubMenu(hmenu, i), menuBarText[tinyLayout][i]); - } - DrawMenuBar(hwndMain); - } - - boardWidth = BoardWidth(boardSize); - - /* Get text area sizes */ - hdc = GetDC(hwndMain); - if (appData.clockMode) { - sprintf(buf, "White: %s", TimeString(23*60*60*1000L)); - } else { - sprintf(buf, "White"); - } - oldFont = SelectObject(hdc, font[boardSize][CLOCK_FONT]->hf); - GetTextExtentPoint(hdc, buf, strlen(buf), &clockSize); - SelectObject(hdc, font[boardSize][MESSAGE_FONT]->hf); - str = "We only care about the height here"; - GetTextExtentPoint(hdc, str, strlen(str), &messageSize); - SelectObject(hdc, oldFont); - ReleaseDC(hwndMain, hdc); - - /* Compute where everything goes */ - whiteRect.left = OUTER_MARGIN; - whiteRect.right = whiteRect.left + boardWidth/2 - INNER_MARGIN/2; - whiteRect.top = OUTER_MARGIN; - whiteRect.bottom = whiteRect.top + clockSize.cy; - - blackRect.left = whiteRect.right + INNER_MARGIN; - blackRect.right = blackRect.left + boardWidth/2 - 1; - blackRect.top = whiteRect.top; - blackRect.bottom = whiteRect.bottom; - - messageRect.left = whiteRect.left + MESSAGE_LINE_LEFTMARGIN; - if (appData.showButtonBar) { - messageRect.right = blackRect.right - - N_BUTTONS*BUTTON_WIDTH - MESSAGE_LINE_LEFTMARGIN; - } else { - messageRect.right = blackRect.right; - } - messageRect.top = whiteRect.bottom + INNER_MARGIN; - messageRect.bottom = messageRect.top + messageSize.cy; - - boardRect.left = whiteRect.left; - boardRect.right = boardRect.left + boardWidth; - boardRect.top = messageRect.bottom + INNER_MARGIN; - boardRect.bottom = boardRect.top + boardWidth; - - sizeInfo[boardSize].cliWidth = boardRect.right + OUTER_MARGIN; - sizeInfo[boardSize].cliHeight = boardRect.bottom + OUTER_MARGIN; - winWidth = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN; - winHeight = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + - GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN; - GetWindowRect(hwndMain, &wrect); - SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, - SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); - /* compensate if menu bar wrapped */ - GetClientRect(hwndMain, &crect); - offby = boardRect.bottom + OUTER_MARGIN - crect.bottom; - winHeight += offby; - switch (flags) { - case WMSZ_TOPLEFT: - SetWindowPos(hwndMain, NULL, - wrect.right - winWidth, wrect.bottom - winHeight, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); - break; - - case WMSZ_TOPRIGHT: - case WMSZ_TOP: - SetWindowPos(hwndMain, NULL, - wrect.left, wrect.bottom - winHeight, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); - break; - - case WMSZ_BOTTOMLEFT: - case WMSZ_LEFT: - SetWindowPos(hwndMain, NULL, - wrect.right - winWidth, wrect.top, - winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); - break; - - case WMSZ_BOTTOMRIGHT: - case WMSZ_BOTTOM: - case WMSZ_RIGHT: - default: - SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, - SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); - break; - } - - hwndPause = NULL; - for (i = 0; i < N_BUTTONS; i++) { - if (buttonDesc[i].hwnd != NULL) { - DestroyWindow(buttonDesc[i].hwnd); - buttonDesc[i].hwnd = NULL; - } - if (appData.showButtonBar) { - buttonDesc[i].hwnd = - CreateWindow("BUTTON", buttonDesc[i].label, - WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, - boardRect.right - BUTTON_WIDTH*(N_BUTTONS-i), - messageRect.top, BUTTON_WIDTH, messageSize.cy, hwndMain, - (HMENU) buttonDesc[i].id, - (HINSTANCE) GetWindowLong(hwndMain, GWL_HINSTANCE), NULL); - if (tinyLayout) { - SendMessage(buttonDesc[i].hwnd, WM_SETFONT, - (WPARAM)font[boardSize][MESSAGE_FONT]->hf, - MAKELPARAM(FALSE, 0)); - } - if (buttonDesc[i].id == IDM_Pause) - hwndPause = buttonDesc[i].hwnd; - buttonDesc[i].wndproc = (WNDPROC) - SetWindowLong(buttonDesc[i].hwnd, GWL_WNDPROC, (LONG) ButtonProc); - } - } - if (gridPen != NULL) DeleteObject(gridPen); - if (highlightPen != NULL) DeleteObject(highlightPen); - if (premovePen != NULL) DeleteObject(premovePen); - if (lineGap != 0) { - logbrush.lbStyle = BS_SOLID; - logbrush.lbColor = RGB(0, 0, 0); /* grid pen color = black */ - gridPen = - ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, - lineGap, &logbrush, 0, NULL); - logbrush.lbColor = highlightSquareColor; - highlightPen = - ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, - lineGap, &logbrush, 0, NULL); - - logbrush.lbColor = premoveHighlightColor; - premovePen = - ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, - lineGap, &logbrush, 0, NULL); - - for (i = 0; i < BOARD_SIZE + 1; i++) { - gridEndpoints[i*2].x = boardRect.left + lineGap / 2; - gridEndpoints[i*2 + BOARD_SIZE*2 + 2].y = boardRect.top + lineGap / 2; - gridEndpoints[i*2].y = gridEndpoints[i*2 + 1].y = - boardRect.top + lineGap / 2 + (i * (squareSize + lineGap)); - gridEndpoints[i*2 + 1].x = boardRect.left + lineGap / 2 + - BOARD_SIZE * (squareSize + lineGap); - gridEndpoints[i*2 + BOARD_SIZE*2 + 2].x = - gridEndpoints[i*2 + 1 + BOARD_SIZE*2 + 2].x = boardRect.left + - lineGap / 2 + (i * (squareSize + lineGap)); - gridEndpoints[i*2 + 1 + BOARD_SIZE*2 + 2].y = - boardRect.top + BOARD_SIZE * (squareSize + lineGap); - gridVertexCounts[i*2] = gridVertexCounts[i*2 + 1] = 2; - } - } - - if (boardSize == oldBoardSize) return; - oldBoardSize = boardSize; - oldTinyLayout = tinyLayout; - - /* Load piece bitmaps for this board size */ - for (i=0; i<=2; i++) { - for (piece = WhitePawn; - (int) piece <= (int) WhiteKing; - piece = (ChessSquare) ((int) piece + 1)) { - if (pieceBitmap[i][piece] != NULL) - DeleteObject(pieceBitmap[i][piece]); - } - } - - pieceBitmap[0][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "s"); - pieceBitmap[0][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "s"); - pieceBitmap[0][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "s"); - pieceBitmap[0][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "s"); - pieceBitmap[0][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "s"); - pieceBitmap[0][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "s"); - pieceBitmap[1][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "o"); - pieceBitmap[1][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "o"); - pieceBitmap[1][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "o"); - pieceBitmap[1][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "o"); - pieceBitmap[1][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "o"); - pieceBitmap[1][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "o"); - pieceBitmap[2][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "w"); - pieceBitmap[2][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "w"); - pieceBitmap[2][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "w"); - pieceBitmap[2][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "w"); - pieceBitmap[2][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "w"); - pieceBitmap[2][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "w"); - - } - - HBITMAP - PieceBitmap(ChessSquare p, int kind) - { - if ((int) p >= (int) BlackPawn) - p = (ChessSquare) ((int) p - (int) BlackPawn + (int) WhitePawn); - - return pieceBitmap[kind][(int) p]; - } - - /***************************************************************/ - - #define MIN(a,b) (((a) < (b)) ? (a) : (b)) - #define MAX(a,b) (((a) > (b)) ? (a) : (b)) - /* - #define MIN3(a,b,c) (((a) < (b) && (a) < (c)) ? (a) : (((b) < (a) && (b) < (c)) ? (b) : (c))) - #define MAX3(a,b,c) (((a) > (b) && (a) > (c)) ? (a) : (((b) > (a) && (b) > (c)) ? (b) : (c))) - */ - - VOID - SquareToPos(int row, int column, int * x, int * y) - { - if (flipView) { - *x = boardRect.left + lineGap + ((BOARD_SIZE-1)-column) * (squareSize + lineGap); - *y = boardRect.top + lineGap + row * (squareSize + lineGap); - } else { - *x = boardRect.left + lineGap + column * (squareSize + lineGap); - *y = boardRect.top + lineGap + ((BOARD_SIZE-1)-row) * (squareSize + lineGap); - } - } - - VOID - DrawCoordsOnDC(HDC hdc) - { - static char files[16] = {'1','2','3','4','5','6','7','8','8','7','6','5','4','3','2','1'}; - static char ranks[16] = {'h','g','f','e','d','c','b','a','a','b','c','d','e','f','g','h'}; - char str[2] = { NULLCHAR, NULLCHAR }; - int oldMode, oldAlign, x, y, start, i; - HFONT oldFont; - HBRUSH oldBrush; - - if (!appData.showCoords) - return; - - start = flipView ? 0 : 8; - - oldBrush = SelectObject(hdc, GetStockObject(BLACK_BRUSH)); - oldMode = SetBkMode(hdc, (appData.monoMode ? OPAQUE : TRANSPARENT)); - oldAlign = GetTextAlign(hdc); - oldFont = SelectObject(hdc, font[boardSize][COORD_FONT]->hf); - - y = boardRect.top + lineGap; - x = boardRect.left + lineGap; - - SetTextAlign(hdc, TA_LEFT|TA_TOP); - for (i = 0; i < 8; i++) { - str[0] = files[start + i]; - ExtTextOut(hdc, x + 2, y + 1, 0, NULL, str, 1, NULL); - y += squareSize + lineGap; - } - - SetTextAlign(hdc, TA_RIGHT|TA_BOTTOM); - for (i = 0; i < 8; i++) { - str[0] = ranks[start + i]; - ExtTextOut(hdc, x + squareSize - 2, y - 1, 0, NULL, str, 1, NULL); - x += squareSize + lineGap; - } - - SelectObject(hdc, oldBrush); - SetBkMode(hdc, oldMode); - SetTextAlign(hdc, oldAlign); - SelectObject(hdc, oldFont); - } - - VOID - DrawGridOnDC(HDC hdc) - { - HPEN oldPen; - - if (lineGap != 0) { - oldPen = SelectObject(hdc, gridPen); - PolyPolyline(hdc, gridEndpoints, gridVertexCounts, BOARD_SIZE*2 + 2); - SelectObject(hdc, oldPen); - } - } - - #define HIGHLIGHT_PEN 0 - #define PREMOVE_PEN 1 - - VOID - DrawHighlightOnDC(HDC hdc, BOOLEAN on, int x, int y, int pen) - { - int x1, y1; - HPEN oldPen, hPen; - if (lineGap == 0) return; - if (flipView) { - x1 = boardRect.left + - lineGap/2 + ((BOARD_SIZE-1)-x) * (squareSize + lineGap); - y1 = boardRect.top + - lineGap/2 + y * (squareSize + lineGap); - } else { - x1 = boardRect.left + - lineGap/2 + x * (squareSize + lineGap); - y1 = boardRect.top + - lineGap/2 + ((BOARD_SIZE-1)-y) * (squareSize + lineGap); - } - hPen = pen ? premovePen : highlightPen; - oldPen = SelectObject(hdc, on ? hPen : gridPen); - MoveToEx(hdc, x1, y1, NULL); - LineTo(hdc, x1 + squareSize + lineGap, y1); - LineTo(hdc, x1 + squareSize + lineGap, y1 + squareSize + lineGap); - LineTo(hdc, x1, y1 + squareSize + lineGap); - LineTo(hdc, x1, y1); - SelectObject(hdc, oldPen); - } - - VOID - DrawHighlightsOnDC(HDC hdc) - { - int i; - for (i=0; i<2; i++) { - if (highlightInfo.sq[i].x >= 0 && highlightInfo.sq[i].y >= 0) - DrawHighlightOnDC(hdc, TRUE, - highlightInfo.sq[i].x, highlightInfo.sq[i].y, - HIGHLIGHT_PEN); - } - for (i=0; i<2; i++) { - if (premoveHighlightInfo.sq[i].x >= 0 && - premoveHighlightInfo.sq[i].y >= 0) { - DrawHighlightOnDC(hdc, TRUE, - premoveHighlightInfo.sq[i].x, - premoveHighlightInfo.sq[i].y, - PREMOVE_PEN); - } - } - } - - /* Note: sqcolor is used only in monoMode */ - /* Note that this code is largely duplicated in woptions.c, - function DrawSampleSquare, so that needs to be updated too */ - VOID - DrawPieceOnDC(HDC hdc, ChessSquare piece, int color, int sqcolor, int x, int y, HDC tmphdc) - { - HBITMAP oldBitmap; - HBRUSH oldBrush; - - if (appData.blindfold) return; - - if (appData.monoMode) { - SelectObject(tmphdc, PieceBitmap(piece, - color == sqcolor ? OUTLINE_PIECE : SOLID_PIECE)); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, - sqcolor ? SRCCOPY : NOTSRCCOPY); - } else { - if (color) { - oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, WHITE_PIECE)); - oldBrush = SelectObject(hdc, whitePieceBrush); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, 0x00B8074A); - #if 0 - /* Use black piece color for outline of white pieces */ - /* Not sure this looks really good (though xboard does it). - Maybe better to have another selectable color, default black */ - SelectObject(hdc, blackPieceBrush); /* could have own brush */ - SelectObject(tmphdc, PieceBitmap(piece, OUTLINE_PIECE)); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, 0x00B8074A); - #else - /* Use black for outline of white pieces */ - SelectObject(tmphdc, PieceBitmap(piece, OUTLINE_PIECE)); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, SRCAND); - #endif - } else { - #if 0 - /* Use white piece color for details of black pieces */ - /* Requires filled-in solid bitmaps (BLACK_PIECE class); the - WHITE_PIECE ones aren't always the right shape. */ - /* Not sure this looks really good (though xboard does it). - Maybe better to have another selectable color, default medium gray? */ - oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, BLACK_PIECE)); - oldBrush = SelectObject(hdc, whitePieceBrush); /* could have own brush */ - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, 0x00B8074A); - SelectObject(tmphdc, PieceBitmap(piece, SOLID_PIECE)); - SelectObject(hdc, blackPieceBrush); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, 0x00B8074A); - #else - /* Use square color for details of black pieces */ - oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, SOLID_PIECE)); - oldBrush = SelectObject(hdc, blackPieceBrush); - BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, 0x00B8074A); - #endif - } - SelectObject(hdc, oldBrush); - SelectObject(tmphdc, oldBitmap); - } - } - - VOID - DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc) - { - int row, column, x, y, square_color, piece_color; - ChessSquare piece; - HBRUSH oldBrush; - - for (row = 0; row < BOARD_SIZE; row++) { - for (column = 0; column < BOARD_SIZE; column++) { - - SquareToPos(row, column, &x, &y); - - piece = board[row][column]; - - square_color = ((column + row) % 2) == 1; - piece_color = (int) piece < (int) BlackPawn; - - if (appData.monoMode) { - if (piece == EmptySquare) { - BitBlt(hdc, x, y, squareSize, squareSize, 0, 0, 0, - square_color ? WHITENESS : BLACKNESS); - } else { - DrawPieceOnDC(hdc, piece, piece_color, square_color, x, y, tmphdc); - } - } else { - oldBrush = SelectObject(hdc, square_color ? - lightSquareBrush : darkSquareBrush); - BitBlt(hdc, x, y, squareSize, squareSize, 0, 0, 0, PATCOPY); - SelectObject(hdc, oldBrush); - if (piece != EmptySquare) - DrawPieceOnDC(hdc, piece, piece_color, -1, x, y, tmphdc); - } - } - } - } - - #define MAX_CLIPS 200 /* more than enough */ - - VOID - HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) - { - static Board lastReq, lastDrawn; - static HighlightInfo lastDrawnHighlight, lastDrawnPremove; - static int lastDrawnFlipView = 0; - static int lastReqValid = 0, lastDrawnValid = 0; - int releaseDC, x, y, x2, y2, row, column, num_clips = 0, i; - HDC tmphdc; - HDC hdcmem; - HBITMAP bufferBitmap; - HBITMAP oldBitmap; - RECT Rect; - HRGN clips[MAX_CLIPS]; - ChessSquare dragged_piece = EmptySquare; - - /* I'm undecided on this - this function figures out whether a full - * repaint is necessary on its own, so there's no real reason to have the - * caller tell it that. I think this can safely be set to FALSE - but - * if we trust the callers not to request full repaints unnessesarily, then - * we could skip some clipping work. In other words, only request a full - * redraw when the majority of pieces have changed positions (ie. flip, - * gamestart and similar) --Hawk - */ - Boolean fullrepaint = repaint; - - if (board == NULL) { - if (!lastReqValid) { - return; - } - board = lastReq; - } else { - CopyBoard(lastReq, board); - lastReqValid = 1; - } - - if (doingSizing) { - return; - } - - if (IsIconic(hwndMain)) { - return; - } - - if (hdc == NULL) { - hdc = GetDC(hwndMain); - if (!appData.monoMode) { - SelectPalette(hdc, hPal, FALSE); - RealizePalette(hdc); - } - releaseDC = TRUE; - } else { - releaseDC = FALSE; - } - - #if 0 - fprintf(debugFP, "*******************************\n" - "repaint = %s\n" - "dragInfo.from (%d,%d)\n" - "dragInfo.start (%d,%d)\n" - "dragInfo.pos (%d,%d)\n" - "dragInfo.lastpos (%d,%d)\n", - repaint ? "TRUE" : "FALSE", - dragInfo.from.x, dragInfo.from.y, - dragInfo.start.x, dragInfo.start.y, - dragInfo.pos.x, dragInfo.pos.y, - dragInfo.lastpos.x, dragInfo.lastpos.y); - fprintf(debugFP, "prev: "); - for (row = 0; row < 8; row++) { - for (column = 0; column < 8; column++) { - fprintf(debugFP, "%d ", lastDrawn[row][column]); - } - } - fprintf(debugFP, "\n"); - fprintf(debugFP, "board: "); - for (row = 0; row < 8; row++) { - for (column = 0; column < 8; column++) { - fprintf(debugFP, "%d ", board[row][column]); - } - } - fprintf(debugFP, "\n"); - fflush(debugFP); - #endif - - /* Create some work-DCs */ - hdcmem = CreateCompatibleDC(hdc); - tmphdc = CreateCompatibleDC(hdc); - - /* Figure out which squares need updating by comparing the - * newest board with the last drawn board and checking if - * flipping has changed. - */ - if (!fullrepaint && lastDrawnValid && lastDrawnFlipView == flipView) { - for (row = 0; row < 8; row++) { - for (column = 0; column < 8; column++) { - if (lastDrawn[row][column] != board[row][column]) { - SquareToPos(row, column, &x, &y); - clips[num_clips++] = - CreateRectRgn(x, y, x + squareSize, y + squareSize); - } - } - } - for (i=0; i<2; i++) { - if (lastDrawnHighlight.sq[i].x != highlightInfo.sq[i].x || - lastDrawnHighlight.sq[i].y != highlightInfo.sq[i].y) { - if (lastDrawnHighlight.sq[i].x >= 0 && - lastDrawnHighlight.sq[i].y >= 0) { - SquareToPos(lastDrawnHighlight.sq[i].y, - lastDrawnHighlight.sq[i].x, &x, &y); - clips[num_clips++] = - CreateRectRgn(x - lineGap, y - lineGap, - x + squareSize + lineGap, y + squareSize + lineGap); - } - if (highlightInfo.sq[i].x >= 0 && highlightInfo.sq[i].y >= 0) { - SquareToPos(highlightInfo.sq[i].y, highlightInfo.sq[i].x, &x, &y); - clips[num_clips++] = - CreateRectRgn(x - lineGap, y - lineGap, - x + squareSize + lineGap, y + squareSize + lineGap); - } - } - } - for (i=0; i<2; i++) { - if (lastDrawnPremove.sq[i].x != premoveHighlightInfo.sq[i].x || - lastDrawnPremove.sq[i].y != premoveHighlightInfo.sq[i].y) { - if (lastDrawnPremove.sq[i].x >= 0 && - lastDrawnPremove.sq[i].y >= 0) { - SquareToPos(lastDrawnPremove.sq[i].y, - lastDrawnPremove.sq[i].x, &x, &y); - clips[num_clips++] = - CreateRectRgn(x - lineGap, y - lineGap, - x + squareSize + lineGap, y + squareSize + lineGap); - } - if (premoveHighlightInfo.sq[i].x >= 0 && - premoveHighlightInfo.sq[i].y >= 0) { - SquareToPos(premoveHighlightInfo.sq[i].y, - premoveHighlightInfo.sq[i].x, &x, &y); - clips[num_clips++] = - CreateRectRgn(x - lineGap, y - lineGap, - x + squareSize + lineGap, y + squareSize + lineGap); - } - } - } - } else { - fullrepaint = TRUE; - } - - /* Create a buffer bitmap - this is the actual bitmap - * being written to. When all the work is done, we can - * copy it to the real DC (the screen). This avoids - * the problems with flickering. - */ - GetClientRect(hwndMain, &Rect); - bufferBitmap = CreateCompatibleBitmap(hdc, Rect.right-Rect.left+1, - Rect.bottom-Rect.top+1); - oldBitmap = SelectObject(hdcmem, bufferBitmap); - if (!appData.monoMode) { - SelectPalette(hdcmem, hPal, FALSE); - } - - /* Create clips for dragging */ - if (!fullrepaint) { - if (dragInfo.from.x >= 0) { - SquareToPos(dragInfo.from.y, dragInfo.from.x, &x, &y); - clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); - } - if (dragInfo.start.x >= 0) { - SquareToPos(dragInfo.start.y, dragInfo.start.x, &x, &y); - clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); - } - if (dragInfo.pos.x >= 0) { - x = dragInfo.pos.x - squareSize / 2; - y = dragInfo.pos.y - squareSize / 2; - clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); - } - if (dragInfo.lastpos.x >= 0) { - x = dragInfo.lastpos.x - squareSize / 2; - y = dragInfo.lastpos.y - squareSize / 2; - clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); - } - } - - /* If dragging is in progress, we temporarely remove the piece */ - if (dragInfo.from.x >= 0 && dragInfo.pos.x >= 0) { - dragged_piece = board[dragInfo.from.y][dragInfo.from.x]; - board[dragInfo.from.y][dragInfo.from.x] = EmptySquare; - } - - /* Are we animating a move? - * If so, - * - remove the piece from the board (temporarely) - * - calculate the clipping region - */ - if (!fullrepaint) { - if (animInfo.piece != EmptySquare) { - board[animInfo.from.y][animInfo.from.x] = EmptySquare; - x = boardRect.left + animInfo.lastpos.x; - y = boardRect.top + animInfo.lastpos.y; - x2 = boardRect.left + animInfo.pos.x; - y2 = boardRect.top + animInfo.pos.y; - clips[num_clips++] = CreateRectRgn(MIN(x,x2), MIN(y,y2), MAX(x,x2)+squareSize, MAX(y,y2)+squareSize); - /* Slight kludge. The real problem is that after AnimateMove is - done, the position on the screen does not match lastDrawn. - This currently causes trouble only on e.p. captures in - atomic, where the piece moves to an empty square and then - explodes. The old and new positions both had an empty square - at the destination, but animation has drawn a piece there and - we have to remember to erase it. */ - lastDrawn[animInfo.to.y][animInfo.to.x] = animInfo.piece; - } - } - - /* No clips? Make sure we have fullrepaint set to TRUE */ - if (num_clips == 0) - fullrepaint = TRUE; - - /* Set clipping on the memory DC */ - if (!fullrepaint) { - SelectClipRgn(hdcmem, clips[0]); - for (x = 1; x < num_clips; x++) { - if (ExtSelectClipRgn(hdcmem, clips[x], RGN_OR) == ERROR) - abort(); // this should never ever happen! - } - } - - /* Do all the drawing to the memory DC */ - DrawGridOnDC(hdcmem); - DrawHighlightsOnDC(hdcmem); - DrawBoardOnDC(hdcmem, board, tmphdc); - DrawCoordsOnDC(hdcmem); - - /* Put the dragged piece back into place and draw it */ - if (dragged_piece != EmptySquare) { - board[dragInfo.from.y][dragInfo.from.x] = dragged_piece; - x = dragInfo.pos.x - squareSize / 2; - y = dragInfo.pos.y - squareSize / 2; - DrawPieceOnDC(hdcmem, dragged_piece, - ((int) dragged_piece < (int) BlackPawn), - (dragInfo.from.y + dragInfo.from.x) % 2, x, y, tmphdc); - } - - /* Put the animated piece back into place and draw it */ - if (animInfo.piece != EmptySquare) { - board[animInfo.from.y][animInfo.from.x] = animInfo.piece; - x = boardRect.left + animInfo.pos.x; - y = boardRect.top + animInfo.pos.y; - DrawPieceOnDC(hdcmem, animInfo.piece, - ((int) animInfo.piece < (int) BlackPawn), - (animInfo.from.y + animInfo.from.x) % 2, x, y, tmphdc); - } - - /* Release the bufferBitmap by selecting in the old bitmap - * and delete the memory DC - */ - SelectObject(hdcmem, oldBitmap); - DeleteDC(hdcmem); - - /* Set clipping on the target DC */ - if (!fullrepaint) { - SelectClipRgn(hdc, clips[0]); - for (x = 1; x < num_clips; x++) { - if (ExtSelectClipRgn(hdc, clips[x], RGN_OR) == ERROR) - abort(); // this should never ever happen! - } - } - - /* Copy the new bitmap onto the screen in one go. - * This way we avoid any flickering - */ - oldBitmap = SelectObject(tmphdc, bufferBitmap); - BitBlt(hdc, boardRect.left, boardRect.top, - boardRect.right - boardRect.left, - boardRect.bottom - boardRect.top, - tmphdc, boardRect.left, boardRect.top, SRCCOPY); - SelectObject(tmphdc, oldBitmap); - - /* Massive cleanup */ - for (x = 0; x < num_clips; x++) - DeleteObject(clips[x]); - - DeleteDC(tmphdc); - DeleteObject(bufferBitmap); - - if (releaseDC) - ReleaseDC(hwndMain, hdc); - - if (lastDrawnFlipView != flipView) { - if (flipView) - CheckMenuItem(GetMenu(hwndMain),IDM_FlipView, MF_BYCOMMAND|MF_CHECKED); - else - CheckMenuItem(GetMenu(hwndMain),IDM_FlipView, MF_BYCOMMAND|MF_UNCHECKED); - } - - CopyBoard(lastDrawn, board); - lastDrawnHighlight = highlightInfo; - lastDrawnPremove = premoveHighlightInfo; - lastDrawnFlipView = flipView; - lastDrawnValid = 1; - } - - - /*---------------------------------------------------------------------------*\ - | CLIENT PAINT PROCEDURE - | This is the main event-handler for the WM_PAINT message. - | - \*---------------------------------------------------------------------------*/ - VOID - PaintProc(HWND hwnd) - { - HDC hdc; - PAINTSTRUCT ps; - HFONT oldFont; - - if(hdc = BeginPaint(hwnd, &ps)) { - if (IsIconic(hwnd)) { - DrawIcon(hdc, 2, 2, iconCurrent); - } else { - if (!appData.monoMode) { - SelectPalette(hdc, hPal, FALSE); - RealizePalette(hdc); - } - HDCDrawPosition(hdc, 1, NULL); - oldFont = - SelectObject(hdc, font[boardSize][MESSAGE_FONT]->hf); - ExtTextOut(hdc, messageRect.left, messageRect.top, - ETO_CLIPPED|ETO_OPAQUE, - &messageRect, messageText, strlen(messageText), NULL); - SelectObject(hdc, oldFont); - DisplayBothClocks(); - } - EndPaint(hwnd,&ps); - } - - return; - } - - - /* - * If the user selects on a border boundary, return -1; if off the board, - * return -2. Otherwise map the event coordinate to the square. - * The offset boardRect.left or boardRect.top must already have been - * subtracted from x. - */ - int - EventToSquare(int x) - { - if (x <= 0) - return -2; - if (x < lineGap) - return -1; - x -= lineGap; - if ((x % (squareSize + lineGap)) >= squareSize) - return -1; - x /= (squareSize + lineGap); - if (x >= BOARD_SIZE) - return -2; - return x; - } - - typedef struct { - char piece; - int command; - char* name; - } DropEnable; - - DropEnable dropEnables[] = { - { 'P', DP_Pawn, "Pawn" }, - { 'N', DP_Knight, "Knight" }, - { 'B', DP_Bishop, "Bishop" }, - { 'R', DP_Rook, "Rook" }, - { 'Q', DP_Queen, "Queen" }, - }; - - VOID - SetupDropMenu(HMENU hmenu) - { - int i, count, enable; - char *p; - extern char white_holding[], black_holding[]; - char item[MSG_SIZ]; - - for (i=0; i 0 || !appData.testLegality - /*!!temp:*/ || (gameInfo.variant == VariantCrazyhouse - && !appData.icsActive); - ModifyMenu(hmenu, dropEnables[i].command, - MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED) | MF_STRING, - dropEnables[i].command, item); - } - } - - static int fromX = -1, fromY = -1, toX, toY; - - /* Event handler for mouse messages */ - VOID - MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - int x, y; - POINT pt; - static int recursive = 0; - HMENU hmenu; - BOOLEAN saveAnimate; - static BOOLEAN sameAgain = FALSE; - - if (recursive) { - if (message == WM_MBUTTONUP) { - /* Hideous kludge to fool TrackPopupMenu into paying attention - to the middle button: we simulate pressing the left button too! - */ - PostMessage(hwnd, WM_LBUTTONDOWN, wParam, lParam); - PostMessage(hwnd, WM_LBUTTONUP, wParam, lParam); - } - return; - } - recursive++; - - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); - x = EventToSquare(pt.x - boardRect.left); - y = EventToSquare(pt.y - boardRect.top); - if (!flipView && y >= 0) { - y = BOARD_SIZE - 1 - y; - } - if (flipView && x >= 0) { - x = BOARD_SIZE - 1 - x; - } - - switch (message) { - case WM_LBUTTONDOWN: - ErrorPopDown(); - sameAgain = FALSE; - if (y == -2) { - /* Downclick vertically off board; check if on clock */ - if (PtInRect((LPRECT) &whiteRect, pt)) { - if (gameMode == EditPosition) { - SetWhiteToPlayEvent(); - } else if (gameMode == IcsPlayingBlack || - gameMode == MachinePlaysWhite) { - CallFlagEvent(); - } - } else if (PtInRect((LPRECT) &blackRect, pt)) { - if (gameMode == EditPosition) { - SetBlackToPlayEvent(); - } else if (gameMode == IcsPlayingWhite || - gameMode == MachinePlaysBlack) { - CallFlagEvent(); - } - } - if (!appData.highlightLastMove) { - ClearHighlights(); - DrawPosition(FALSE, NULL); - } - fromX = fromY = -1; - dragInfo.start.x = dragInfo.start.y = -1; - dragInfo.from = dragInfo.start; - break; - } else if (x < 0 || y < 0) { - break; - } else if (fromX == x && fromY == y) { - /* Downclick on same square again */ - ClearHighlights(); - DrawPosition(FALSE, NULL); - sameAgain = TRUE; - } else if (fromX != -1) { - /* Downclick on different square */ - ChessSquare pdown, pup; - pdown = boards[currentMove][fromY][fromX]; - pup = boards[currentMove][y][x]; - if (gameMode == EditPosition || - !((WhitePawn <= pdown && pdown <= WhiteKing && - WhitePawn <= pup && pup <= WhiteKing) || - (BlackPawn <= pdown && pdown <= BlackKing && - BlackPawn <= pup && pup <= BlackKing))) { - /* EditPosition, empty square, or different color piece; - click-click move is possible */ - toX = x; - toY = y; - if (IsPromotion(fromX, fromY, toX, toY)) { - if (appData.alwaysPromoteToQueen) { - UserMoveEvent(fromX, fromY, toX, toY, 'q'); - if (!appData.highlightLastMove) { - ClearHighlights(); - DrawPosition(FALSE, NULL); - } - } else { - SetHighlights(fromX, fromY, toX, toY); - DrawPosition(FALSE, NULL); - PromotionPopup(hwnd); - } - } else { /* not a promotion */ - if (appData.animate || appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } - UserMoveEvent(fromX, fromY, toX, toY, NULLCHAR); - if (appData.animate && !appData.highlightLastMove) { - ClearHighlights(); - DrawPosition(FALSE, NULL); - } - } - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - break; - } - ClearHighlights(); - DrawPosition(FALSE, NULL); - } - /* First downclick, or restart on a square with same color piece */ - if (!frozen && OKToStartUserMove(x, y)) { - fromX = x; - fromY = y; - dragInfo.lastpos = pt; - dragInfo.from.x = fromX; - dragInfo.from.y = fromY; - dragInfo.start = dragInfo.from; - SetCapture(hwndMain); - } else { - fromX = fromY = -1; - dragInfo.start.x = dragInfo.start.y = -1; - dragInfo.from = dragInfo.start; - } - break; - - case WM_LBUTTONUP: - ReleaseCapture(); - if (fromX == -1) break; - if (x == fromX && y == fromY) { - dragInfo.from.x = dragInfo.from.y = -1; - /* Upclick on same square */ - if (sameAgain) { - /* Clicked same square twice: abort click-click move */ - fromX = fromY = -1; - gotPremove = 0; - ClearPremoveHighlights(); - } else { - /* First square clicked: start click-click move */ - SetHighlights(fromX, fromY, -1, -1); - } - DrawPosition(FALSE, NULL); - } else if (dragInfo.from.x < 0 || dragInfo.from.y < 0) { - /* Errant click; ignore */ - break; - } else { - /* Finish drag move */ - dragInfo.from.x = dragInfo.from.y = -1; - toX = x; - toY = y; - saveAnimate = appData.animate; /* sorry, Hawk :) */ - appData.animate = appData.animate && !appData.animateDragging; - if (IsPromotion(fromX, fromY, toX, toY)) { - if (appData.alwaysPromoteToQueen) { - UserMoveEvent(fromX, fromY, toX, toY, 'q'); - } else { - DrawPosition(FALSE, NULL); - PromotionPopup(hwnd); - } - } else { - UserMoveEvent(fromX, fromY, toX, toY, NULLCHAR); - } - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - appData.animate = saveAnimate; - fromX = fromY = -1; - if (appData.highlightDragging && !appData.highlightLastMove) { - ClearHighlights(); - } - if (appData.animate || appData.animateDragging || - appData.highlightDragging || gotPremove) { - DrawPosition(FALSE, NULL); - } - } - dragInfo.start.x = dragInfo.start.y = -1; - dragInfo.pos = dragInfo.lastpos = dragInfo.start; - break; - - case WM_MOUSEMOVE: - if ((appData.animateDragging || appData.highlightDragging) - && (wParam & MK_LBUTTON) - && dragInfo.from.x >= 0) { - if (appData.animateDragging) { - dragInfo.pos = pt; - } - if (appData.highlightDragging) { - SetHighlights(fromX, fromY, x, y); - } - DrawPosition(FALSE, NULL); - dragInfo.lastpos = dragInfo.pos; - } - break; - case WM_MOUSEWHEEL: - /* Mouse Wheel is being rolled forward - * Play moves forward - */ - if ((short)HIWORD(wParam) > 0) - if (forwardMostMove > 0 && currentMove != forwardMostMove) - ForwardEvent(); - /* Mouse Wheel is being rolled backward - * Play moves backward - */ - if ((short)HIWORD(wParam) < 0) - if (currentMove > 0) BackwardEvent(); - break; - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - ErrorPopDown(); - ReleaseCapture(); - fromX = fromY = -1; - dragInfo.pos.x = dragInfo.pos.y = -1; - dragInfo.start.x = dragInfo.start.y = -1; - dragInfo.from = dragInfo.start; - dragInfo.lastpos = dragInfo.pos; - if (appData.highlightDragging) { - ClearHighlights(); - } - DrawPosition(TRUE, NULL); - - switch (gameMode) { - case EditPosition: - case IcsExamining: - if (x < 0 || y < 0) break; - fromX = x; - fromY = y; - if (message == WM_MBUTTONDOWN) { - buttonCount = 3; /* even if system didn't think so */ - if (wParam & MK_SHIFT) - MenuPopup(hwnd, pt, LoadMenu(hInst, "BlackPieceMenu"), -1); - else - MenuPopup(hwnd, pt, LoadMenu(hInst, "WhitePieceMenu"), -1); - } else { /* message == WM_RBUTTONDOWN */ - #if 0 - if (buttonCount == 3) { - if (wParam & MK_SHIFT) - MenuPopup(hwnd, pt, LoadMenu(hInst, "WhitePieceMenu"), -1); - else - MenuPopup(hwnd, pt, LoadMenu(hInst, "BlackPieceMenu"), -1); - } else { - MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1); - } - #else - /* Just have one menu, on the right button. Windows users don't - think to try the middle one, and sometimes other software steals - it, or it doesn't really exist. */ - MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1); - #endif - } - break; - case IcsPlayingWhite: - case IcsPlayingBlack: - case EditGame: - case MachinePlaysWhite: - case MachinePlaysBlack: - if (appData.testLegality && - gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse) break; - if (x < 0 || y < 0) break; - fromX = x; - fromY = y; - hmenu = LoadMenu(hInst, "DropPieceMenu"); - SetupDropMenu(hmenu); - MenuPopup(hwnd, pt, hmenu, -1); - break; - default: - break; - } - break; - } - - recursive--; - } - - /* Preprocess messages for buttons in main window */ - LRESULT CALLBACK - ButtonProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - int id = GetWindowLong(hwnd, GWL_ID); - int i, dir; - - for (i=0; inumber > 1) { - GameListPopUp(f, fileTitle); - return; - } - GameListDestroy(); - number = 1; - } - LoadGame(f, number, fileTitle, FALSE); - } - } - - VOID - ChangedConsoleFont() - { - CHARFORMAT cfmt; - CHARRANGE tmpsel, sel; - MyFont *f = font[boardSize][CONSOLE_FONT]; - HWND hText = GetDlgItem(hwndConsole, OPT_ConsoleText); - HWND hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - PARAFORMAT paraf; - - cfmt.cbSize = sizeof(CHARFORMAT); - cfmt.dwMask = CFM_FACE|CFM_SIZE|CFM_CHARSET; - strcpy(cfmt.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName); - /* yHeight is expressed in twips. A twip is 1/20 of a font's point - * size. This was undocumented in the version of MSVC++ that I had - * when I wrote the code, but is apparently documented now. - */ - cfmt.yHeight = (int)(f->mfp.pointSize * 20.0 + 0.5); - cfmt.bCharSet = f->lf.lfCharSet; - cfmt.bPitchAndFamily = f->lf.lfPitchAndFamily; - SendMessage(hText, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &cfmt); - SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &cfmt); - /* Why are the following seemingly needed too? */ - SendMessage(hText, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM) &cfmt); - SendMessage(hInput, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM) &cfmt); - SendMessage(hText, EM_EXGETSEL, 0, (LPARAM)&sel); - tmpsel.cpMin = 0; - tmpsel.cpMax = -1; /*999999?*/ - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&tmpsel); - SendMessage(hText, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cfmt); - /* Trying putting this here too. It still seems to tickle a RichEdit - * bug: sometimes RichEdit indents the first line of a paragraph too. - */ - paraf.cbSize = sizeof(paraf); - paraf.dwMask = PFM_OFFSET | PFM_STARTINDENT; - paraf.dxStartIndent = 0; - paraf.dxOffset = WRAP_INDENT; - SendMessage(hText, EM_SETPARAFORMAT, 0, (LPARAM) ¶f); - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); - } - - /*---------------------------------------------------------------------------*\ - * - * Window Proc for main window - * - \*---------------------------------------------------------------------------*/ - - /* Process messages for main window, etc. */ - LRESULT CALLBACK - WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - FARPROC lpProc; - int wmId, wmEvent; - char *defName; - FILE *f; - UINT number; - char fileTitle[MSG_SIZ]; - char buf[MSG_SIZ]; - - switch (message) { - - case WM_PAINT: /* message: repaint portion of window */ - PaintProc(hwnd); - break; - - case WM_ERASEBKGND: - if (IsIconic(hwnd)) { - /* Cheat; change the message */ - return (DefWindowProc(hwnd, WM_ICONERASEBKGND, wParam, lParam)); - } else { - return (DefWindowProc(hwnd, message, wParam, lParam)); - } - break; - - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - case WM_MOUSEMOVE: - case WM_MOUSEWHEEL: - MouseEvent(hwnd, message, wParam, lParam); - break; - - case WM_CHAR: - - if (appData.icsActive) { - if (wParam == '\t') { - if (GetKeyState(VK_SHIFT) < 0) { - /* shifted */ - HWND h = GetDlgItem(hwndConsole, OPT_ConsoleInput); - if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); - SetFocus(h); - } else { - /* unshifted */ - HWND h = GetDlgItem(hwndConsole, OPT_ConsoleText); - if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); - SetFocus(h); - } - } else { - HWND h = GetDlgItem(hwndConsole, OPT_ConsoleInput); - if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); - SetFocus(h); - SendMessage(h, message, wParam, lParam); - } - } else if (isalpha((char)wParam) || isdigit((char)wParam)) { - PopUpMoveDialog((char)wParam); - } - break; - - case WM_PALETTECHANGED: - if (hwnd != (HWND)wParam && !appData.monoMode) { - int nnew; - HDC hdc = GetDC(hwndMain); - SelectPalette(hdc, hPal, TRUE); - nnew = RealizePalette(hdc); - if (nnew > 0) { - paletteChanged = TRUE; - #if 0 - UpdateColors(hdc); - #else - InvalidateRect(hwnd, &boardRect, FALSE);/*faster!*/ - #endif - } - ReleaseDC(hwnd, hdc); - } - break; - - case WM_QUERYNEWPALETTE: - if (!appData.monoMode /*&& paletteChanged*/) { - int nnew; - HDC hdc = GetDC(hwndMain); - paletteChanged = FALSE; - SelectPalette(hdc, hPal, FALSE); - nnew = RealizePalette(hdc); - if (nnew > 0) { - InvalidateRect(hwnd, &boardRect, FALSE); - } - ReleaseDC(hwnd, hdc); - return TRUE; - } - return FALSE; - - case WM_COMMAND: /* message: command from application menu */ - wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); - - switch (wmId) { - case IDM_NewGame: - ResetGameEvent(); - AnalysisPopDown(); - break; - - case IDM_LoadGame: - LoadGameDialog(hwnd, "Load Game from File"); - break; - - case IDM_LoadNextGame: - ReloadGame(1); - break; - - case IDM_LoadPrevGame: - ReloadGame(-1); - break; - - case IDM_ReloadGame: - ReloadGame(0); - break; - - case IDM_LoadPosition: - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - Reset(FALSE, TRUE); - } - number = 1; - f = OpenFileDialog(hwnd, FALSE, "", - appData.oldSaveStyle ? "pos" : "fen", - POSITION_FILT, - "Load Position from File", &number, fileTitle, NULL); - if (f != NULL) { - LoadPosition(f, number, fileTitle); - } - break; - - case IDM_LoadNextPosition: - ReloadPosition(1); - break; - - case IDM_LoadPrevPosition: - ReloadPosition(-1); - break; - - case IDM_ReloadPosition: - ReloadPosition(0); - break; - - case IDM_SaveGame: - defName = DefaultFileName(appData.oldSaveStyle ? "gam" : "pgn"); - f = OpenFileDialog(hwnd, TRUE, defName, - appData.oldSaveStyle ? "gam" : "pgn", - GAME_FILT, - "Save Game to File", NULL, fileTitle, NULL); - if (f != NULL) { - SaveGame(f, 0, ""); - } - break; - - case IDM_SavePosition: - defName = DefaultFileName(appData.oldSaveStyle ? "pos" : "fen"); - f = OpenFileDialog(hwnd, TRUE, defName, - appData.oldSaveStyle ? "pos" : "fen", - POSITION_FILT, - "Save Position to File", NULL, fileTitle, NULL); - if (f != NULL) { - SavePosition(f, 0, ""); - } - break; - - case IDM_CopyGame: - CopyGameToClipboard(); - break; - - case IDM_PasteGame: - PasteGameFromClipboard(); - break; - - case IDM_CopyPosition: - CopyFENToClipboard(); - break; - - case IDM_PastePosition: - PasteFENFromClipboard(); - break; - - case IDM_MailMove: - MailMoveEvent(); - break; - - case IDM_ReloadCMailMsg: - Reset(TRUE, TRUE); - ReloadCmailMsgEvent(FALSE); - break; - - case IDM_Minimize: - ShowWindow(hwnd, SW_MINIMIZE); - break; - - case IDM_Exit: - ExitEvent(0); - break; - - case IDM_MachineWhite: - MachineWhiteEvent(); - /* - * refresh the tags dialog only if it's visible - */ - if (gameMode == MachinePlaysWhite && IsWindowVisible(editTagsDialog)) { - char *tags; - tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - break; - - case IDM_MachineBlack: - MachineBlackEvent(); - /* - * refresh the tags dialog only if it's visible - */ - if (gameMode == MachinePlaysBlack && IsWindowVisible(editTagsDialog)) { - char *tags; - tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - break; - - case IDM_TwoMachines: - TwoMachinesEvent(); - /* - * refresh the tags dialog only if it's visible - */ - if (gameMode == TwoMachinesPlay && IsWindowVisible(editTagsDialog)) { - char *tags; - tags = PGNTags(&gameInfo); - TagsPopUp(tags, CmailMsg()); - free(tags); - } - break; - - case IDM_AnalysisMode: - if (!first.analysisSupport) { - sprintf(buf, "%s does not support analysis", first.tidy); - DisplayError(buf, 0); - } else { - /* icsEngineAnlyze */ - if (appData.icsActive) { - if (gameMode != IcsObserving) { - sprintf(buf, "You are not observing a game"); - DisplayError(buf, 0); - /* secure check */ - if (appData.icsEngineAnalyze) { - if (appData.debugMode) - fprintf(debugFP, "Found unexpected active ICS engine analyze \n"); - ExitAnalyzeMode(); - ModeHighlight(); - break; - } - break; - } else { - /* if enable, user want disable icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - break; - } - appData.icsEngineAnalyze = TRUE; - if (appData.debugMode) fprintf(debugFP, "ICS engine analyze starting...\n"); - } - } - if (!appData.showThinking) ToggleShowThinking(); - AnalyzeModeEvent(); - } - break; - case IDM_AnalyzeFile: - if (!first.analysisSupport) { - char buf[MSG_SIZ]; - sprintf(buf, "%s does not support analysis", first.tidy); - DisplayError(buf, 0); - } else { - if (!appData.showThinking) ToggleShowThinking(); - AnalyzeFileEvent(); - LoadGameDialog(hwnd, "Analyze Game from File"); - AnalysisPeriodicEvent(1); - } - break; - - case IDM_IcsClient: - IcsClientEvent(); - break; - - case IDM_EditGame: - EditGameEvent(); - break; - - case IDM_EditPosition: - EditPositionEvent(); - break; - - case IDM_Training: - TrainingEvent(); - break; - - case IDM_ShowGameList: - ShowGameListProc(); - break; - - case IDM_EditTags: - EditTagsProc(); - break; - - case IDM_EditComment: - if (commentDialogUp && editComment) { - CommentPopDown(); - } else { - EditCommentEvent(); - } - break; - - case IDM_Pause: - PauseEvent(); - break; - - case IDM_Accept: - AcceptEvent(); - break; - - case IDM_Decline: - DeclineEvent(); - break; - - case IDM_Rematch: - RematchEvent(); - break; - - case IDM_CallFlag: - CallFlagEvent(); - break; - - case IDM_Draw: - DrawEvent(); - break; - - case IDM_Adjourn: - AdjournEvent(); - break; - - case IDM_Abort: - AbortEvent(); - break; - - case IDM_Resign: - ResignEvent(); - break; - - case IDM_StopObserving: - StopObservingEvent(); - break; - - case IDM_StopExamining: - StopExaminingEvent(); - break; - - case IDM_TypeInMove: - PopUpMoveDialog('\000'); - break; - - case IDM_Backward: - BackwardEvent(); - SetFocus(hwndMain); - break; - - case IDM_Forward: - ForwardEvent(); - SetFocus(hwndMain); - break; - - case IDM_ToStart: - ToStartEvent(); - SetFocus(hwndMain); - break; - - case IDM_ToEnd: - ToEndEvent(); - SetFocus(hwndMain); - break; - - case IDM_Revert: - RevertEvent(); - break; - - case IDM_TruncateGame: - TruncateGameEvent(); - break; - - case IDM_MoveNow: - MoveNowEvent(); - break; - - case IDM_RetractMove: - RetractMoveEvent(); - break; - - case IDM_FlipView: - flipView = !flipView; - DrawPosition(FALSE, NULL); - break; - - case IDM_GeneralOptions: - GeneralOptionsPopup(hwnd); - break; - - case IDM_BoardOptions: - BoardOptionsPopup(hwnd); - break; - - case IDM_IcsOptions: - IcsOptionsPopup(hwnd); - break; - - case IDM_Fonts: - FontsOptionsPopup(hwnd); - break; - - case IDM_Sounds: - SoundOptionsPopup(hwnd); - break; - - case IDM_CommPort: - CommPortOptionsPopup(hwnd); - break; - - case IDM_LoadOptions: - LoadOptionsPopup(hwnd); - break; - - case IDM_SaveOptions: - SaveOptionsPopup(hwnd); - break; - - case IDM_TimeControl: - TimeControlOptionsPopup(hwnd); - break; - - case IDM_SaveSettings: - SaveSettings(settingsFileName); - break; - - case IDM_SaveSettingsOnExit: - saveSettingsOnExit = !saveSettingsOnExit; - (void) CheckMenuItem(GetMenu(hwndMain), IDM_SaveSettingsOnExit, - MF_BYCOMMAND|(saveSettingsOnExit ? - MF_CHECKED : MF_UNCHECKED)); - break; - - case IDM_Hint: - HintEvent(); - break; - - case IDM_Book: - BookEvent(); - break; - - case IDM_AboutGame: - AboutGameEvent(); - break; - - case IDM_Debug: - appData.debugMode = !appData.debugMode; - if (appData.debugMode) { - char dir[MSG_SIZ]; - GetCurrentDirectory(MSG_SIZ, dir); - SetCurrentDirectory(installDir); - debugFP = fopen("WinBoard.debug", "w"); - SetCurrentDirectory(dir); - setbuf(debugFP, NULL); - } else { - fclose(debugFP); - debugFP = NULL; - } - break; - - case IDM_HELPCONTENTS: - if (!WinHelp (hwnd, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS")) { - MessageBox (GetFocus(), - "Unable to activate help", - szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); - } - break; - - case IDM_HELPSEARCH: - if (!WinHelp(hwnd, "winboard.hlp", HELP_PARTIALKEY, (DWORD)(LPSTR)"")) { - MessageBox (GetFocus(), - "Unable to activate help", - szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); - } - break; - - case IDM_HELPHELP: - if(!WinHelp(hwnd, (LPSTR)NULL, HELP_HELPONHELP, 0)) { - MessageBox (GetFocus(), - "Unable to activate help", - szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); - } - break; - - case IDM_ABOUT: - lpProc = MakeProcInstance((FARPROC)About, hInst); - DialogBox(hInst, - (gameInfo.event && strcmp(gameInfo.event, "Easter Egg Hunt") == 0) ? - "AboutBox2" : "AboutBox", hwnd, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - break; - - case IDM_DirectCommand1: - AskQuestionEvent("Direct Command", - "Send to chess program:", "", "1"); - break; - case IDM_DirectCommand2: - AskQuestionEvent("Direct Command", - "Send to second chess program:", "", "2"); - break; - - case EP_WhitePawn: - EditPositionMenuEvent(WhitePawn, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_WhiteKnight: - EditPositionMenuEvent(WhiteKnight, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_WhiteBishop: - EditPositionMenuEvent(WhiteBishop, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_WhiteRook: - EditPositionMenuEvent(WhiteRook, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_WhiteQueen: - EditPositionMenuEvent(WhiteQueen, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_WhiteKing: - EditPositionMenuEvent(WhiteKing, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackPawn: - EditPositionMenuEvent(BlackPawn, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackKnight: - EditPositionMenuEvent(BlackKnight, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackBishop: - EditPositionMenuEvent(BlackBishop, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackRook: - EditPositionMenuEvent(BlackRook, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackQueen: - EditPositionMenuEvent(BlackQueen, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_BlackKing: - EditPositionMenuEvent(BlackKing, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_EmptySquare: - EditPositionMenuEvent(EmptySquare, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_ClearBoard: - EditPositionMenuEvent(ClearBoard, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_White: - EditPositionMenuEvent(WhitePlay, fromX, fromY); - fromX = fromY = -1; - break; - - case EP_Black: - EditPositionMenuEvent(BlackPlay, fromX, fromY); - fromX = fromY = -1; - break; - - case DP_Pawn: - DropMenuEvent(WhitePawn, fromX, fromY); - fromX = fromY = -1; - break; - - case DP_Knight: - DropMenuEvent(WhiteKnight, fromX, fromY); - fromX = fromY = -1; - break; - - case DP_Bishop: - DropMenuEvent(WhiteBishop, fromX, fromY); - fromX = fromY = -1; - break; - - case DP_Rook: - DropMenuEvent(WhiteRook, fromX, fromY); - fromX = fromY = -1; - break; - - case DP_Queen: - DropMenuEvent(WhiteQueen, fromX, fromY); - fromX = fromY = -1; - break; - - default: - return (DefWindowProc(hwnd, message, wParam, lParam)); - } - break; - - case WM_TIMER: - switch (wParam) { - case CLOCK_TIMER_ID: - KillTimer(hwnd, clockTimerEvent); /* Simulate one-shot timer as in X */ - clockTimerEvent = 0; - DecrementClocks(); /* call into back end */ - break; - case LOAD_GAME_TIMER_ID: - KillTimer(hwnd, loadGameTimerEvent); /* Simulate one-shot timer as in X*/ - loadGameTimerEvent = 0; - AutoPlayGameLoop(); /* call into back end */ - break; - case ANALYSIS_TIMER_ID: - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile - || appData.icsEngineAnalyze) && appData.periodicUpdates) { - AnalysisPeriodicEvent(0); - } else { - KillTimer(hwnd, analysisTimerEvent); - analysisTimerEvent = 0; - } - break; - case DELAYED_TIMER_ID: - KillTimer(hwnd, delayedTimerEvent); - delayedTimerEvent = 0; - delayedTimerCallback(); - break; - } - break; - - case WM_USER_Input: - InputEvent(hwnd, message, wParam, lParam); - break; - - case WM_ENTERSIZEMOVE: - if (hwnd == hwndMain) { - doingSizing = TRUE; - lastSizing = 0; - } - break; - - case WM_SIZING: - if (hwnd == hwndMain) { - lastSizing = wParam; - } - break; - - case WM_EXITSIZEMOVE: - if (hwnd == hwndMain) { - RECT client; - doingSizing = FALSE; - InvalidateRect(hwnd, &boardRect, FALSE); - GetClientRect(hwnd, &client); - ResizeBoard(client.right, client.bottom, lastSizing); - lastSizing = 0; - } - break; - - case WM_DESTROY: /* message: window being destroyed */ - PostQuitMessage(0); - break; - - case WM_CLOSE: - if (hwnd == hwndMain) { - ExitEvent(0); - } - break; - - default: /* Passes it on if unprocessed */ - return (DefWindowProc(hwnd, message, wParam, lParam)); - } - return 0; - } - - /*---------------------------------------------------------------------------*\ - * - * Misc utility routines - * - \*---------------------------------------------------------------------------*/ - - /* - * Decent random number generator, at least not as bad as Windows - * standard rand, which returns a value in the range 0 to 0x7fff. - */ - unsigned int randstate; - - int - myrandom(void) - { - randstate = randstate * 1664525 + 1013904223; - return (int) randstate & 0x7fffffff; - } - - void - mysrandom(unsigned int seed) - { - randstate = seed; - } - - - /* - * returns TRUE if user selects a different color, FALSE otherwise - */ - - BOOL - ChangeColor(HWND hwnd, COLORREF *which) - { - static BOOL firstTime = TRUE; - static DWORD customColors[16]; - CHOOSECOLOR cc; - COLORREF newcolor; - int i; - ColorClass ccl; - - if (firstTime) { - /* Make initial colors in use available as custom colors */ - /* Should we put the compiled-in defaults here instead? */ - i = 0; - customColors[i++] = lightSquareColor & 0xffffff; - customColors[i++] = darkSquareColor & 0xffffff; - customColors[i++] = whitePieceColor & 0xffffff; - customColors[i++] = blackPieceColor & 0xffffff; - customColors[i++] = highlightSquareColor & 0xffffff; - customColors[i++] = premoveHighlightColor & 0xffffff; - - for (ccl = (ColorClass) 0; ccl < NColorClasses && i < 16; ccl++) { - customColors[i++] = textAttribs[ccl].color; - } - while (i < 16) customColors[i++] = RGB(255, 255, 255); - firstTime = FALSE; - } - - cc.lStructSize = sizeof(cc); - cc.hwndOwner = hwnd; - cc.hInstance = NULL; - cc.rgbResult = (DWORD) (*which & 0xffffff); - cc.lpCustColors = (LPDWORD) customColors; - cc.Flags = CC_RGBINIT|CC_FULLOPEN; - - if (!ChooseColor(&cc)) return FALSE; - - newcolor = (COLORREF) (0x2000000 | cc.rgbResult); - if (newcolor == *which) return FALSE; - *which = newcolor; - return TRUE; - - /* - InitDrawingColors(); - InvalidateRect(hwnd, &boardRect, FALSE); - */ - } - - BOOLEAN - MyLoadSound(MySound *ms) - { - BOOL ok = FALSE; - struct stat st; - FILE *f; - - if (ms->data) free(ms->data); - ms->data = NULL; - - switch (ms->name[0]) { - case NULLCHAR: - /* Silence */ - ok = TRUE; - break; - case '$': - /* System sound from Control Panel. Don't preload here. */ - ok = TRUE; - break; - case '!': - if (ms->name[1] == NULLCHAR) { - /* "!" alone = silence */ - ok = TRUE; - } else { - /* Builtin wave resource. Error if not found. */ - HANDLE h = FindResource(hInst, ms->name + 1, "WAVE"); - if (h == NULL) break; - ms->data = (void *)LoadResource(hInst, h); - if (h == NULL) break; - ok = TRUE; - } - break; - default: - /* .wav file. Error if not found. */ - f = fopen(ms->name, "rb"); - if (f == NULL) break; - if (fstat(fileno(f), &st) < 0) break; - ms->data = malloc(st.st_size); - if (fread(ms->data, st.st_size, 1, f) < 1) break; - fclose(f); - ok = TRUE; - break; - } - if (!ok) { - char buf[MSG_SIZ]; - sprintf(buf, "Error loading sound %s", ms->name); - DisplayError(buf, GetLastError()); - } - return ok; - } - - BOOLEAN - MyPlaySound(MySound *ms) - { - BOOLEAN ok = FALSE; - switch (ms->name[0]) { - case NULLCHAR: - /* Silence */ - ok = TRUE; - break; - case '$': - /* System sound from Control Panel (deprecated feature). - "$" alone or an unset sound name gets default beep (still in use). */ - if (ms->name[1]) { - ok = PlaySound(ms->name + 1, NULL, SND_ALIAS|SND_ASYNC); - } - if (!ok) ok = MessageBeep(MB_OK); - break; - case '!': - /* Builtin wave resource, or "!" alone for silence */ - if (ms->name[1]) { - if (ms->data == NULL) return FALSE; - ok = PlaySound(ms->data, NULL, SND_MEMORY|SND_ASYNC); - } else { - ok = TRUE; - } - break; - default: - /* .wav file. Error if not found. */ - if (ms->data == NULL) return FALSE; - ok = PlaySound(ms->data, NULL, SND_MEMORY|SND_ASYNC); - break; - } - /* Don't print an error: this can happen innocently if the sound driver - is busy; for instance, if another instance of WinBoard is playing - a sound at about the same time. */ - #if 0 - if (!ok) { - char buf[MSG_SIZ]; - sprintf(buf, "Error playing sound %s", ms->name); - DisplayError(buf, GetLastError()); - } - #endif - return ok; - } - - - LRESULT CALLBACK - OldOpenFileHook(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - BOOL ok; - OPENFILENAME *ofn; - static UINT *number; /* gross that this is static */ - - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - /* Center the dialog over the application window */ - ofn = (OPENFILENAME *) lParam; - if (ofn->Flags & OFN_ENABLETEMPLATE) { - number = (UINT *) ofn->lCustData; - SendMessage(GetDlgItem(hDlg, edt2), WM_SETTEXT, 0, (LPARAM) ""); - } else { - number = NULL; - } - CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); - return FALSE; /* Allow for further processing */ - - case WM_COMMAND: - if ((LOWORD(wParam) == IDOK) && (number != NULL)) { - *number = GetDlgItemInt(hDlg, OPT_IndexNumberOld, &ok, FALSE); - } - return FALSE; /* Allow for further processing */ - } - return FALSE; - } - - UINT APIENTRY - OpenFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) - { - static UINT *number; - OPENFILENAME *ofname; - OFNOTIFY *ofnot; - switch (uiMsg) { - case WM_INITDIALOG: - ofname = (OPENFILENAME *)lParam; - number = (UINT *)(ofname->lCustData); - break; - case WM_NOTIFY: - ofnot = (OFNOTIFY *)lParam; - if (ofnot->hdr.code == CDN_FILEOK) { - *number = GetDlgItemInt(hdlg, OPT_IndexNumber, NULL, FALSE); - } - break; - } - return 0; - } - - - FILE * - OpenFileDialog(HWND hwnd, BOOL write, char *defName, char *defExt, - char *nameFilt, char *dlgTitle, UINT *number, - char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]) - { - OPENFILENAME openFileName; - char buf1[MSG_SIZ]; - FILE *f; - - if (fileName == NULL) fileName = buf1; - if (defName == NULL) { - strcpy(fileName, "*."); - strcat(fileName, defExt); - } else { - strcpy(fileName, defName); - } - if (fileTitle) strcpy(fileTitle, ""); - if (number) *number = 0; - - openFileName.lStructSize = sizeof(OPENFILENAME); - openFileName.hwndOwner = hwnd; - openFileName.hInstance = (HANDLE) hInst; - openFileName.lpstrFilter = nameFilt; - openFileName.lpstrCustomFilter = (LPSTR) NULL; - openFileName.nMaxCustFilter = 0L; - openFileName.nFilterIndex = 1L; - openFileName.lpstrFile = fileName; - openFileName.nMaxFile = MSG_SIZ; - openFileName.lpstrFileTitle = fileTitle; - openFileName.nMaxFileTitle = fileTitle ? MSG_SIZ : 0; - openFileName.lpstrInitialDir = NULL; - openFileName.lpstrTitle = dlgTitle; - openFileName.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY - | (write ? 0 : OFN_FILEMUSTEXIST) - | (number ? OFN_ENABLETEMPLATE | OFN_ENABLEHOOK: 0) - | (oldDialog ? 0 : OFN_EXPLORER); - openFileName.nFileOffset = 0; - openFileName.nFileExtension = 0; - openFileName.lpstrDefExt = defExt; - openFileName.lCustData = (LONG) number; - openFileName.lpfnHook = oldDialog ? - (LPOFNHOOKPROC) OldOpenFileHook : (LPOFNHOOKPROC) OpenFileHook; - openFileName.lpTemplateName = (LPSTR)(oldDialog ? 1536 : DLG_IndexNumber); - - if (write ? GetSaveFileName(&openFileName) : - GetOpenFileName(&openFileName)) { - /* open the file */ - f = fopen(openFileName.lpstrFile, write ? "a" : "rb"); - if (f == NULL) { - MessageBox(hwnd, "File open failed", NULL, - MB_OK|MB_ICONEXCLAMATION); - return NULL; - } - } else { - int err = CommDlgExtendedError(); - if (err != 0) DisplayError("Internal error in file dialog box", err); - return FALSE; - } - return f; - } - - - - VOID APIENTRY - MenuPopup(HWND hwnd, POINT pt, HMENU hmenu, UINT def) - { - HMENU hmenuTrackPopup; /* floating pop-up menu */ - - /* - * Get the first pop-up menu in the menu template. This is the - * menu that TrackPopupMenu displays. - */ - hmenuTrackPopup = GetSubMenu(hmenu, 0); - - SetMenuDefaultItem(hmenuTrackPopup, def, FALSE); - - /* - * TrackPopup uses screen coordinates, so convert the - * coordinates of the mouse click to screen coordinates. - */ - ClientToScreen(hwnd, (LPPOINT) &pt); - - /* Draw and track the floating pop-up menu. */ - TrackPopupMenu(hmenuTrackPopup, TPM_CENTERALIGN | TPM_RIGHTBUTTON, - pt.x, pt.y, 0, hwnd, NULL); - - /* Destroy the menu.*/ - DestroyMenu(hmenu); - } - - typedef struct { - HWND hDlg, hText; - int sizeX, sizeY, newSizeX, newSizeY; - HDWP hdwp; - } ResizeEditPlusButtonsClosure; - - BOOL CALLBACK - ResizeEditPlusButtonsCallback(HWND hChild, LPARAM lparam) - { - ResizeEditPlusButtonsClosure *cl = (ResizeEditPlusButtonsClosure *)lparam; - RECT rect; - POINT pt; - - if (hChild == cl->hText) return TRUE; - GetWindowRect(hChild, &rect); /* gives screen coords */ - pt.x = rect.left + (cl->newSizeX - cl->sizeX)/2; - pt.y = rect.top + cl->newSizeY - cl->sizeY; - ScreenToClient(cl->hDlg, &pt); - cl->hdwp = DeferWindowPos(cl->hdwp, hChild, NULL, - pt.x, pt.y, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER); - return TRUE; - } - - /* Resize a dialog that has a (rich) edit field filling most of - the top, with a row of buttons below */ - VOID - ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY) - { - RECT rectText; - int newTextHeight, newTextWidth; - ResizeEditPlusButtonsClosure cl; - - /*if (IsIconic(hDlg)) return;*/ - if (newSizeX == sizeX && newSizeY == sizeY) return; - - cl.hdwp = BeginDeferWindowPos(8); - - GetWindowRect(hText, &rectText); /* gives screen coords */ - newTextWidth = rectText.right - rectText.left + newSizeX - sizeX; - newTextHeight = rectText.bottom - rectText.top + newSizeY - sizeY; - if (newTextHeight < 0) { - newSizeY += -newTextHeight; - newTextHeight = 0; - } - cl.hdwp = DeferWindowPos(cl.hdwp, hText, NULL, 0, 0, - newTextWidth, newTextHeight, SWP_NOZORDER|SWP_NOMOVE); - - cl.hDlg = hDlg; - cl.hText = hText; - cl.sizeX = sizeX; - cl.sizeY = sizeY; - cl.newSizeX = newSizeX; - cl.newSizeY = newSizeY; - EnumChildWindows(hDlg, ResizeEditPlusButtonsCallback, (LPARAM)&cl); - - EndDeferWindowPos(cl.hdwp); - } - - /* Center one window over another */ - BOOL CenterWindow (HWND hwndChild, HWND hwndParent) - { - RECT rChild, rParent; - int wChild, hChild, wParent, hParent; - int wScreen, hScreen, xNew, yNew; - HDC hdc; - - /* Get the Height and Width of the child window */ - GetWindowRect (hwndChild, &rChild); - wChild = rChild.right - rChild.left; - hChild = rChild.bottom - rChild.top; - - /* Get the Height and Width of the parent window */ - GetWindowRect (hwndParent, &rParent); - wParent = rParent.right - rParent.left; - hParent = rParent.bottom - rParent.top; - - /* Get the display limits */ - hdc = GetDC (hwndChild); - wScreen = GetDeviceCaps (hdc, HORZRES); - hScreen = GetDeviceCaps (hdc, VERTRES); - ReleaseDC(hwndChild, hdc); - - /* Calculate new X position, then adjust for screen */ - xNew = rParent.left + ((wParent - wChild) /2); - if (xNew < 0) { - xNew = 0; - } else if ((xNew+wChild) > wScreen) { - xNew = wScreen - wChild; - } - - /* Calculate new Y position, then adjust for screen */ - yNew = rParent.top + ((hParent - hChild) /2); - if (yNew < 0) { - yNew = 0; - } else if ((yNew+hChild) > hScreen) { - yNew = hScreen - hChild; - } - - /* Set it, and return */ - return SetWindowPos (hwndChild, NULL, - xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER); - } - - /*---------------------------------------------------------------------------*\ - * - * Startup Dialog functions - * - \*---------------------------------------------------------------------------*/ - void - InitComboStrings(HANDLE hwndCombo, char **cd) - { - SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); - - while (*cd != NULL) { - SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) *cd); - cd++; - } - } - - void - InitComboStringsFromOption(HANDLE hwndCombo, char *str) - { - char buf1[ARG_MAX]; - int len; - - if (str[0] == '@') { - FILE* f = fopen(str + 1, "r"); - if (f == NULL) { - DisplayFatalError(str + 1, errno, 2); - return; - } - len = fread(buf1, 1, sizeof(buf1)-1, f); - fclose(f); - buf1[len] = NULLCHAR; - str = buf1; - } - - SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); - - for (;;) { - char buf[MSG_SIZ]; - char *end = strchr(str, '\n'); - if (end == NULL) return; - memcpy(buf, str, end - str); - buf[end - str] = NULLCHAR; - SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) buf); - str = end + 1; - } - } - - void - SetStartupDialogEnables(HWND hDlg) - { - EnableWindow(GetDlgItem(hDlg, OPT_ChessEngineName), - IsDlgButtonChecked(hDlg, OPT_ChessEngine) || - appData.zippyPlay && IsDlgButtonChecked(hDlg, OPT_ChessServer)); - EnableWindow(GetDlgItem(hDlg, OPT_SecondChessEngineName), - IsDlgButtonChecked(hDlg, OPT_ChessEngine)); - EnableWindow(GetDlgItem(hDlg, OPT_ChessServerName), - IsDlgButtonChecked(hDlg, OPT_ChessServer)); - EnableWindow(GetDlgItem(hDlg, OPT_AdditionalOptions), - IsDlgButtonChecked(hDlg, OPT_AnyAdditional)); - EnableWindow(GetDlgItem(hDlg, IDOK), - IsDlgButtonChecked(hDlg, OPT_ChessEngine) || - IsDlgButtonChecked(hDlg, OPT_ChessServer) || - IsDlgButtonChecked(hDlg, OPT_View)); - } - - char * - QuoteForFilename(char *filename) - { - int dquote, space; - dquote = strchr(filename, '"') != NULL; - space = strchr(filename, ' ') != NULL; - if (dquote || space) { - if (dquote) { - return "'"; - } else { - return "\""; - } - } else { - return ""; - } - } - - VOID - InitEngineBox(HWND hDlg, HWND hwndCombo, char* nthcp, char* nthd, char* nthdir, char *nthnames) - { - char buf[MSG_SIZ]; - char *q; - - InitComboStringsFromOption(hwndCombo, nthnames); - q = QuoteForFilename(nthcp); - sprintf(buf, "%s%s%s", q, nthcp, q); - if (*nthdir != NULLCHAR) { - q = QuoteForFilename(nthdir); - sprintf(buf + strlen(buf), " /%s=%s%s%s", nthd, q, nthdir, q); - } - if (*nthcp == NULLCHAR) { - SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) 0, (LPARAM) 0); - } else if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) { - SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0); - SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf); - } - } - - LRESULT CALLBACK - StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - char buf[MSG_SIZ]; - HANDLE hwndCombo; - char *p; - - switch (message) { - case WM_INITDIALOG: - /* Center the dialog */ - CenterWindow (hDlg, GetDesktopWindow()); - /* Initialize the dialog items */ - InitEngineBox(hDlg, GetDlgItem(hDlg, OPT_ChessEngineName), - appData.firstChessProgram, "fd", appData.firstDirectory, - firstChessProgramNames); - InitEngineBox(hDlg, GetDlgItem(hDlg, OPT_SecondChessEngineName), - appData.secondChessProgram, "sd", appData.secondDirectory, - secondChessProgramNames); - hwndCombo = GetDlgItem(hDlg, OPT_ChessServerName); - InitComboStringsFromOption(hwndCombo, icsNames); - sprintf(buf, "%s /icsport=%s", appData.icsHost, appData.icsPort); - if (*appData.icsHelper != NULLCHAR) { - char *q = QuoteForFilename(appData.icsHelper); - sprintf(buf + strlen(buf), " /icshelper=%s%s%s", q, appData.icsHelper, q); - } - if (*appData.icsHost == NULLCHAR) { - SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) 0, (LPARAM) 0); - /*SendMessage(hwndCombo, CB_SHOWDROPDOWN, (WPARAM) TRUE, (LPARAM) 0); !!too soon */ - } else if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) { - SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0); - SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf); - } - if (chessProgram) { - CheckDlgButton(hDlg, OPT_ChessEngine, BST_CHECKED); - } else if (appData.icsActive) { - CheckDlgButton(hDlg, OPT_ChessServer, BST_CHECKED); - } else if (appData.noChessProgram) { - CheckDlgButton(hDlg, OPT_View, BST_CHECKED); - } - SetStartupDialogEnables(hDlg); - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - if (IsDlgButtonChecked(hDlg, OPT_ChessEngine)) { - strcpy(buf, "/fcp="); - GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); - p = buf; - ParseArgs(StringGet, &p); - strcpy(buf, "/scp="); - GetDlgItemText(hDlg, OPT_SecondChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); - p = buf; - ParseArgs(StringGet, &p); - appData.noChessProgram = FALSE; - appData.icsActive = FALSE; - } else if (IsDlgButtonChecked(hDlg, OPT_ChessServer)) { - strcpy(buf, "/ics /icshost="); - GetDlgItemText(hDlg, OPT_ChessServerName, buf + strlen(buf), sizeof(buf) - strlen(buf)); - p = buf; - ParseArgs(StringGet, &p); - if (appData.zippyPlay) { - strcpy(buf, "/fcp="); - GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); - p = buf; - ParseArgs(StringGet, &p); - } - } else if (IsDlgButtonChecked(hDlg, OPT_View)) { - appData.noChessProgram = TRUE; - appData.icsActive = FALSE; - } else { - MessageBox(hDlg, "Choose an option, or cancel to exit", - "Option Error", MB_OK|MB_ICONEXCLAMATION); - return TRUE; - } - if (IsDlgButtonChecked(hDlg, OPT_AnyAdditional)) { - GetDlgItemText(hDlg, OPT_AdditionalOptions, buf, sizeof(buf)); - p = buf; - ParseArgs(StringGet, &p); - } - EndDialog(hDlg, TRUE); - return TRUE; - - case IDCANCEL: - ExitEvent(0); - return TRUE; - - case IDM_HELPCONTENTS: - if (!WinHelp (hDlg, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS")) { - MessageBox (GetFocus(), - "Unable to activate help", - szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); - } - break; - - default: - SetStartupDialogEnables(hDlg); - break; - } - break; - } - return FALSE; - } - - /*---------------------------------------------------------------------------*\ - * - * About box dialog functions - * - \*---------------------------------------------------------------------------*/ - - /* Process messages for "About" dialog box */ - LRESULT CALLBACK - About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - /* Center the dialog over the application window */ - CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); - SetDlgItemText(hDlg, ABOUTBOX_Version, programVersion); - return (TRUE); - - case WM_COMMAND: /* message: received a command */ - if (LOWORD(wParam) == IDOK /* "OK" box selected? */ - || LOWORD(wParam) == IDCANCEL) { /* System menu close command? */ - EndDialog(hDlg, TRUE); /* Exit the dialog */ - return (TRUE); - } - break; - } - return (FALSE); - } - - /*---------------------------------------------------------------------------*\ - * - * Comment Dialog functions - * - \*---------------------------------------------------------------------------*/ - - LRESULT CALLBACK - CommentDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - static HANDLE hwndText = NULL; - int len, newSizeX, newSizeY, flags; - static int sizeX, sizeY; - char *str; - RECT rect; - MINMAXINFO *mmi; - - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - /* Initialize the dialog items */ - hwndText = GetDlgItem(hDlg, OPT_CommentText); - SetDlgItemText(hDlg, OPT_CommentText, commentText); - EnableWindow(GetDlgItem(hDlg, OPT_CancelComment), editComment); - EnableWindow(GetDlgItem(hDlg, OPT_ClearComment), editComment); - EnableWindow(GetDlgItem(hDlg, OPT_EditComment), !editComment); - SendMessage(hwndText, EM_SETREADONLY, !editComment, 0); - SetWindowText(hDlg, commentTitle); - if (editComment) { - SetFocus(hwndText); - } else { - SetFocus(GetDlgItem(hDlg, IDOK)); - } - SendMessage(GetDlgItem(hDlg, OPT_CommentText), - WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf, - MAKELPARAM(FALSE, 0)); - /* Size and position the dialog */ - if (!commentDialog) { - commentDialog = hDlg; - flags = SWP_NOZORDER; - GetClientRect(hDlg, &rect); - sizeX = rect.right; - sizeY = rect.bottom; - if (commentX != CW_USEDEFAULT && commentY != CW_USEDEFAULT && - commentW != CW_USEDEFAULT && commentH != CW_USEDEFAULT) { - WINDOWPLACEMENT wp; - EnsureOnScreen(&commentX, &commentY); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = SW_SHOW; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = commentX; - wp.rcNormalPosition.right = commentX + commentW; - wp.rcNormalPosition.top = commentY; - wp.rcNormalPosition.bottom = commentY + commentH; - SetWindowPlacement(hDlg, &wp); - - GetClientRect(hDlg, &rect); - newSizeX = rect.right; - newSizeY = rect.bottom; - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, - newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - } - } - return FALSE; - - case WM_COMMAND: /* message: received a command */ - switch (LOWORD(wParam)) { - case IDOK: - if (editComment) { - char *p, *q; - /* Read changed options from the dialog box */ - hwndText = GetDlgItem(hDlg, OPT_CommentText); - len = GetWindowTextLength(hwndText); - str = (char *) malloc(len + 1); - GetWindowText(hwndText, str, len + 1); - p = q = str; - while (*q) { - if (*q == '\r') - q++; - else - *p++ = *q++; - } - *p = NULLCHAR; - ReplaceComment(commentIndex, str); - free(str); - } - CommentPopDown(); - return TRUE; - - case IDCANCEL: - case OPT_CancelComment: - CommentPopDown(); - return TRUE; - - case OPT_ClearComment: - SetDlgItemText(hDlg, OPT_CommentText, ""); - break; - - case OPT_EditComment: - EditCommentEvent(); - return TRUE; - - default: - break; - } - break; - - case WM_SIZE: - newSizeX = LOWORD(lParam); - newSizeY = HIWORD(lParam); - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - break; - - case WM_GETMINMAXINFO: - /* Prevent resizing window too small */ - mmi = (MINMAXINFO *) lParam; - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 100; - break; - } - return FALSE; - } - - VOID - EitherCommentPopUp(int index, char *title, char *str, BOOLEAN edit) - { - FARPROC lpProc; - char *p, *q; - - CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, edit ? MF_CHECKED : MF_UNCHECKED); - - if (str == NULL) str = ""; - p = (char *) malloc(2 * strlen(str) + 2); - q = p; - while (*str) { - if (*str == '\n') *q++ = '\r'; - *q++ = *str++; - } - *q = NULLCHAR; - if (commentText != NULL) free(commentText); - - commentIndex = index; - commentTitle = title; - commentText = p; - editComment = edit; - - if (commentDialog) { - SendMessage(commentDialog, WM_INITDIALOG, 0, 0); - if (!commentDialogUp) ShowWindow(commentDialog, SW_SHOW); - } else { - lpProc = MakeProcInstance((FARPROC)CommentDialog, hInst); - CreateDialog(hInst, MAKEINTRESOURCE(DLG_EditComment), - hwndMain, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - commentDialogUp = TRUE; - } - - - /*---------------------------------------------------------------------------*\ - * - * Type-in move dialog functions - * - \*---------------------------------------------------------------------------*/ - - LRESULT CALLBACK - TypeInMoveDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - char move[MSG_SIZ]; - HWND hInput; - ChessMove moveType; - int fromX, fromY, toX, toY; - char promoChar; - - switch (message) { - case WM_INITDIALOG: - move[0] = (char) lParam; - move[1] = NULLCHAR; - CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); - hInput = GetDlgItem(hDlg, OPT_Move); - SetWindowText(hInput, move); - SetFocus(hInput); - SendMessage(hInput, EM_SETSEL, (WPARAM)9999, (LPARAM)9999); - return FALSE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - if (gameMode != EditGame && currentMove != forwardMostMove && - gameMode != Training) { - DisplayMoveError("Displayed move is not current"); - } else { - GetDlgItemText(hDlg, OPT_Move, move, sizeof(move)); - if (ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, - &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { - if (gameMode != Training) - forwardMostMove = currentMove; - UserMoveEvent(fromX, fromY, toX, toY, promoChar); - } else { - DisplayMoveError("Could not parse move"); - } - } - EndDialog(hDlg, TRUE); - return TRUE; - case IDCANCEL: - EndDialog(hDlg, FALSE); - return TRUE; - default: - break; - } - break; - } - return FALSE; - } - - VOID - PopUpMoveDialog(char firstchar) - { - FARPROC lpProc; - - if ((gameMode == BeginningOfGame && !appData.icsActive) || - gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || - gameMode == AnalyzeMode || gameMode == EditGame || - gameMode == EditPosition || gameMode == IcsExamining || - gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || - gameMode == Training) { - lpProc = MakeProcInstance((FARPROC)TypeInMoveDialog, hInst); - DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_TypeInMove), - hwndMain, (DLGPROC)lpProc, (LPARAM)firstchar); - FreeProcInstance(lpProc); - } - } - - /*---------------------------------------------------------------------------*\ - * - * Error dialogs - * - \*---------------------------------------------------------------------------*/ - - /* Nonmodal error box */ - LRESULT CALLBACK ErrorDialog(HWND hDlg, UINT message, - WPARAM wParam, LPARAM lParam); - - VOID - ErrorPopUp(char *title, char *content) - { - FARPROC lpProc; - char *p, *q; - BOOLEAN modal = hwndMain == NULL; - - p = content; - q = errorMessage; - while (*p) { - if (*p == '\n') { - if (modal) { - *q++ = ' '; - p++; - } else { - *q++ = '\r'; - *q++ = *p++; - } - } else { - *q++ = *p++; - } - } - *q = NULLCHAR; - strncpy(errorTitle, title, sizeof(errorTitle)); - errorTitle[sizeof(errorTitle) - 1] = '\0'; - - if (modal) { - MessageBox(NULL, errorMessage, errorTitle, MB_OK|MB_ICONEXCLAMATION); - } else { - lpProc = MakeProcInstance((FARPROC)ErrorDialog, hInst); - CreateDialog(hInst, MAKEINTRESOURCE(DLG_Error), - hwndMain, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - } - - VOID - ErrorPopDown() - { - if (!appData.popupMoveErrors && moveErrorMessageUp) DisplayMessage("", ""); - if (errorDialog == NULL) return; - DestroyWindow(errorDialog); - errorDialog = NULL; - } - - LRESULT CALLBACK - ErrorDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - HANDLE hwndText; - RECT rChild; - - switch (message) { - case WM_INITDIALOG: - GetWindowRect(hDlg, &rChild); - SetWindowPos(hDlg, NULL, rChild.left, - rChild.top + boardRect.top - (rChild.bottom - rChild.top), - 0, 0, SWP_NOZORDER|SWP_NOSIZE); - errorDialog = hDlg; - SetWindowText(hDlg, errorTitle); - hwndText = GetDlgItem(hDlg, OPT_ErrorText); - SetDlgItemText(hDlg, OPT_ErrorText, errorMessage); - return FALSE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - case IDCANCEL: - if (errorDialog == hDlg) errorDialog = NULL; - DestroyWindow(hDlg); - return TRUE; - - default: - break; - } - break; - } - return FALSE; - } - - /*---------------------------------------------------------------------------*\ - * - * Ics Interaction console functions - * - \*---------------------------------------------------------------------------*/ - - #define HISTORY_SIZE 64 - static char *history[HISTORY_SIZE]; - int histIn = 0, histP = 0; - - VOID - SaveInHistory(char *cmd) - { - if (history[histIn] != NULL) { - free(history[histIn]); - history[histIn] = NULL; - } - if (*cmd == NULLCHAR) return; - history[histIn] = StrSave(cmd); - histIn = (histIn + 1) % HISTORY_SIZE; - if (history[histIn] != NULL) { - free(history[histIn]); - history[histIn] = NULL; - } - histP = histIn; - } - - char * - PrevInHistory(char *cmd) - { - int newhp; - if (histP == histIn) { - if (history[histIn] != NULL) free(history[histIn]); - history[histIn] = StrSave(cmd); - } - newhp = (histP - 1 + HISTORY_SIZE) % HISTORY_SIZE; - if (newhp == histIn || history[newhp] == NULL) return NULL; - histP = newhp; - return history[histP]; - } - - char * - NextInHistory() - { - if (histP == histIn) return NULL; - histP = (histP + 1) % HISTORY_SIZE; - return history[histP]; - } - - typedef struct { - char *item; - char *command; - BOOLEAN getname; - BOOLEAN immediate; - } IcsTextMenuEntry; - #define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) - IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; - - void - ParseIcsTextMenu(char *icsTextMenuString) - { - int flags = 0; - IcsTextMenuEntry *e = icsTextMenuEntry; - char *p = icsTextMenuString; - while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - free(e->item); - e->item = NULL; - if (e->command != NULL) { - free(e->command); - e->command = NULL; - } - e++; - } - e = icsTextMenuEntry; - while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { - if (*p == ';' || *p == '\n') { - e->item = strdup("-"); - e->command = NULL; - p++; - } else if (*p == '-') { - e->item = strdup("-"); - e->command = NULL; - p++; - if (*p) p++; - } else { - char *q, *r, *s, *t; - char c; - q = strchr(p, ','); - if (q == NULL) break; - *q = NULLCHAR; - r = strchr(q + 1, ','); - if (r == NULL) break; - *r = NULLCHAR; - s = strchr(r + 1, ','); - if (s == NULL) break; - *s = NULLCHAR; - c = ';'; - t = strchr(s + 1, c); - if (t == NULL) { - c = '\n'; - t = strchr(s + 1, c); - } - if (t != NULL) *t = NULLCHAR; - e->item = strdup(p); - e->command = strdup(q + 1); - e->getname = *(r + 1) != '0'; - e->immediate = *(s + 1) != '0'; - *q = ','; - *r = ','; - *s = ','; - if (t == NULL) break; - *t = c; - p = t + 1; - } - e++; - } - } - - HMENU - LoadIcsTextMenu(IcsTextMenuEntry *e) - { - HMENU hmenu, h; - int i = 0; - hmenu = LoadMenu(hInst, "TextMenu"); - h = GetSubMenu(hmenu, 0); - while (e->item) { - if (strcmp(e->item, "-") == 0) { - AppendMenu(h, MF_SEPARATOR, 0, 0); - } else { - if (e->item[0] == '|') { - AppendMenu(h, MF_STRING|MF_MENUBARBREAK, - IDM_CommandX + i, &e->item[1]); - } else { - AppendMenu(h, MF_STRING, IDM_CommandX + i, e->item); - } - } - e++; - i++; - } - return hmenu; - } - - WNDPROC consoleTextWindowProc; - - void - CommandX(HWND hwnd, char *command, BOOLEAN getname, BOOLEAN immediate) - { - char buf[MSG_SIZ], name[MSG_SIZ]; - HWND hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - CHARRANGE sel; - - if (!getname) { - SetWindowText(hInput, command); - if (immediate) { - SendMessage(hInput, WM_CHAR, '\r', 0); - } else { - sel.cpMin = 999999; - sel.cpMax = 999999; - SendMessage(hInput, EM_EXSETSEL, 0, (LPARAM)&sel); - SetFocus(hInput); - } - return; - } - SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin == sel.cpMax) { - /* Expand to surrounding word */ - TEXTRANGE tr; - do { - tr.chrg.cpMax = sel.cpMin; - tr.chrg.cpMin = --sel.cpMin; - if (sel.cpMin < 0) break; - tr.lpstrText = name; - SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr); - } while (isalpha(name[0]) || isdigit(name[0]) || name[0] == '-'); - sel.cpMin++; - - do { - tr.chrg.cpMin = sel.cpMax; - tr.chrg.cpMax = ++sel.cpMax; - tr.lpstrText = name; - if (SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr) < 1) break; - } while (isalpha(name[0]) || isdigit(name[0]) || name[0] == '-'); - sel.cpMax--; - - if (sel.cpMax == sel.cpMin || sel.cpMax - sel.cpMin > MSG_SIZ/2) { - MessageBeep(MB_ICONEXCLAMATION); - return; - } - tr.chrg = sel; - tr.lpstrText = name; - SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr); - } else { - if (sel.cpMax - sel.cpMin > MSG_SIZ/2) { - MessageBeep(MB_ICONEXCLAMATION); - return; - } - SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM) name); - } - if (immediate) { - sprintf(buf, "%s %s", command, name); - SetWindowText(hInput, buf); - SendMessage(hInput, WM_CHAR, '\r', 0); - } else { - sprintf(buf, "%s %s ", command, name); /* trailing space */ - SetWindowText(hInput, buf); - sel.cpMin = 999999; - sel.cpMax = 999999; - SendMessage(hInput, EM_EXSETSEL, 0, (LPARAM)&sel); - SetFocus(hInput); - } - } - - LRESULT CALLBACK - ConsoleTextSubclass(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - HWND hInput; - CHARRANGE sel; - - switch (message) { - case WM_KEYDOWN: - if (!(GetKeyState(VK_CONTROL) & ~1)) break; - switch (wParam) { - case VK_PRIOR: - SendMessage(hwnd, EM_LINESCROLL, 0, -999999); - return 0; - case VK_NEXT: - sel.cpMin = 999999; - sel.cpMax = 999999; - SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); - SendMessage(hwnd, EM_SCROLLCARET, 0, 0); - return 0; - } - break; - case WM_CHAR: - if (wParam == '\t') { - if (GetKeyState(VK_SHIFT) < 0) { - /* shifted */ - if (IsIconic(hwndMain)) ShowWindow(hwndMain, SW_RESTORE); - if (buttonDesc[0].hwnd) { - SetFocus(buttonDesc[0].hwnd); - } else { - SetFocus(hwndMain); - } - } else { - /* unshifted */ - SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleInput)); - } - } else { - hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - SetFocus(hInput); - SendMessage(hInput, message, wParam, lParam); - } - return 0; - case WM_PASTE: - hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - SetFocus(hInput); - return SendMessage(hInput, message, wParam, lParam); - case WM_MBUTTONDOWN: - return SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); - case WM_RBUTTONDOWN: - if (!(GetKeyState(VK_SHIFT) & ~1)) { - /* Move selection here if it was empty */ - POINT pt; - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); - SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin == sel.cpMax) { - sel.cpMin = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)&pt); /*doc is wrong*/ - sel.cpMax = sel.cpMin; - SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); - } - SendMessage(hwnd, EM_HIDESELECTION, FALSE, FALSE); - } - return 0; - case WM_RBUTTONUP: - if (GetKeyState(VK_SHIFT) & ~1) { - SendDlgItemMessage(hwndConsole, OPT_ConsoleText, - WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); - } else { - POINT pt; - HMENU hmenu = LoadIcsTextMenu(icsTextMenuEntry); - SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin == sel.cpMax) { - EnableMenuItem(hmenu, IDM_Copy, MF_BYCOMMAND|MF_GRAYED); - EnableMenuItem(hmenu, IDM_QuickPaste, MF_BYCOMMAND|MF_GRAYED); - } - if (!IsClipboardFormatAvailable(CF_TEXT)) { - EnableMenuItem(hmenu, IDM_Paste, MF_BYCOMMAND|MF_GRAYED); - } - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); - MenuPopup(hwnd, pt, hmenu, -1); - } - return 0; - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDM_QuickPaste: - { - SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin == sel.cpMax) { - MessageBeep(MB_ICONEXCLAMATION); - return 0; - } - SendMessage(hwnd, WM_COPY, 0, 0); - hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - SendMessage(hInput, WM_PASTE, 0, 0); - SetFocus(hInput); - return 0; - } - case IDM_Cut: - SendMessage(hwnd, WM_CUT, 0, 0); - return 0; - case IDM_Paste: - SendMessage(hwnd, WM_PASTE, 0, 0); - return 0; - case IDM_Copy: - SendMessage(hwnd, WM_COPY, 0, 0); - return 0; - default: - { - int i = LOWORD(wParam) - IDM_CommandX; - if (i >= 0 && i < ICS_TEXT_MENU_SIZE && - icsTextMenuEntry[i].command != NULL) { - CommandX(hwnd, icsTextMenuEntry[i].command, - icsTextMenuEntry[i].getname, - icsTextMenuEntry[i].immediate); - return 0; - } - } - break; - } - break; - } - return (*consoleTextWindowProc)(hwnd, message, wParam, lParam); - } - - WNDPROC consoleInputWindowProc; - - LRESULT CALLBACK - ConsoleInputSubclass(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - char buf[MSG_SIZ]; - char *p; - static BOOL sendNextChar = FALSE; - static BOOL quoteNextChar = FALSE; - InputSource *is = consoleInputSource; - CHARFORMAT cf; - CHARRANGE sel; - - switch (message) { - case WM_CHAR: - if (!appData.localLineEditing || sendNextChar) { - is->buf[0] = (CHAR) wParam; - is->count = 1; - SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); - sendNextChar = FALSE; - return 0; - } - if (quoteNextChar) { - buf[0] = (char) wParam; - buf[1] = NULLCHAR; - SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM) buf); - quoteNextChar = FALSE; - return 0; - } - switch (wParam) { - case '\r': /* Enter key */ - is->count = GetWindowText(hwnd, is->buf, INPUT_SOURCE_BUF_SIZE-1); - if (consoleEcho) SaveInHistory(is->buf); - is->buf[is->count++] = '\n'; - is->buf[is->count] = NULLCHAR; - SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); - if (consoleEcho) { - ConsoleOutput(is->buf, is->count, TRUE); - } else if (appData.localLineEditing) { - ConsoleOutput("\n", 1, TRUE); - } - /* fall thru */ - case '\033': /* Escape key */ - SetWindowText(hwnd, ""); - cf.cbSize = sizeof(CHARFORMAT); - cf.dwMask = CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT; - if (consoleEcho) { - cf.crTextColor = textAttribs[ColorNormal].color; - } else { - cf.crTextColor = COLOR_ECHOOFF; - } - cf.dwEffects = textAttribs[ColorNormal].effects; - SendMessage(hwnd, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); - return 0; - case '\t': /* Tab key */ - if (GetKeyState(VK_SHIFT) < 0) { - /* shifted */ - SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleText)); - } else { - /* unshifted */ - if (IsIconic(hwndMain)) ShowWindow(hwndMain, SW_RESTORE); - if (buttonDesc[0].hwnd) { - SetFocus(buttonDesc[0].hwnd); - } else { - SetFocus(hwndMain); - } - } - return 0; - case '\023': /* Ctrl+S */ - sendNextChar = TRUE; - return 0; - case '\021': /* Ctrl+Q */ - quoteNextChar = TRUE; - return 0; - default: - break; - } - break; - case WM_KEYDOWN: - switch (wParam) { - case VK_UP: - GetWindowText(hwnd, buf, MSG_SIZ); - p = PrevInHistory(buf); - if (p != NULL) { - SetWindowText(hwnd, p); - sel.cpMin = 999999; - sel.cpMax = 999999; - SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); - return 0; - } - break; - case VK_DOWN: - p = NextInHistory(); - if (p != NULL) { - SetWindowText(hwnd, p); - sel.cpMin = 999999; - sel.cpMax = 999999; - SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); - return 0; - } - break; - case VK_HOME: - case VK_END: - if (!(GetKeyState(VK_CONTROL) & ~1)) break; - /* fall thru */ - case VK_PRIOR: - case VK_NEXT: - SendDlgItemMessage(hwndConsole, OPT_ConsoleText, message, wParam, lParam); - return 0; - } - break; - case WM_MBUTTONDOWN: - SendDlgItemMessage(hwndConsole, OPT_ConsoleText, - WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); - break; - case WM_RBUTTONUP: - if (GetKeyState(VK_SHIFT) & ~1) { - SendDlgItemMessage(hwndConsole, OPT_ConsoleText, - WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); - } else { - POINT pt; - HMENU hmenu; - hmenu = LoadMenu(hInst, "InputMenu"); - SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); - if (sel.cpMin == sel.cpMax) { - EnableMenuItem(hmenu, IDM_Copy, MF_BYCOMMAND|MF_GRAYED); - EnableMenuItem(hmenu, IDM_Cut, MF_BYCOMMAND|MF_GRAYED); - } - if (!IsClipboardFormatAvailable(CF_TEXT)) { - EnableMenuItem(hmenu, IDM_Paste, MF_BYCOMMAND|MF_GRAYED); - } - pt.x = LOWORD(lParam); - pt.y = HIWORD(lParam); - MenuPopup(hwnd, pt, hmenu, -1); - } - return 0; - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDM_Undo: - SendMessage(hwnd, EM_UNDO, 0, 0); - return 0; - case IDM_SelectAll: - sel.cpMin = 0; - sel.cpMax = -1; /*999999?*/ - SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); - return 0; - case IDM_Cut: - SendMessage(hwnd, WM_CUT, 0, 0); - return 0; - case IDM_Paste: - SendMessage(hwnd, WM_PASTE, 0, 0); - return 0; - case IDM_Copy: - SendMessage(hwnd, WM_COPY, 0, 0); - return 0; - } - break; - } - return (*consoleInputWindowProc)(hwnd, message, wParam, lParam); - } - - #define CO_MAX 100000 - #define CO_TRIM 1000 - - LRESULT CALLBACK - ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - static HWND hText, hInput, hFocus; - InputSource *is = consoleInputSource; - RECT rect; - static int sizeX, sizeY; - int newSizeX, newSizeY; - MINMAXINFO *mmi; - - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - hwndConsole = hDlg; - hText = GetDlgItem(hDlg, OPT_ConsoleText); - hInput = GetDlgItem(hDlg, OPT_ConsoleInput); - SetFocus(hInput); - consoleTextWindowProc = (WNDPROC) - SetWindowLong(hText, GWL_WNDPROC, (LONG) ConsoleTextSubclass); - SendMessage(hText, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); - consoleInputWindowProc = (WNDPROC) - SetWindowLong(hInput, GWL_WNDPROC, (LONG) ConsoleInputSubclass); - SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); - Colorize(ColorNormal, TRUE); - SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &consoleCF); - ChangedConsoleFont(); - GetClientRect(hDlg, &rect); - sizeX = rect.right; - sizeY = rect.bottom; - if (consoleX != CW_USEDEFAULT && consoleY != CW_USEDEFAULT && - consoleW != CW_USEDEFAULT && consoleH != CW_USEDEFAULT) { - WINDOWPLACEMENT wp; - EnsureOnScreen(&consoleX, &consoleY); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = SW_SHOW; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = consoleX; - wp.rcNormalPosition.right = consoleX + consoleW; - wp.rcNormalPosition.top = consoleY; - wp.rcNormalPosition.bottom = consoleY + consoleH; - SetWindowPlacement(hDlg, &wp); - } - else { /* Determine Defaults */ - WINDOWPLACEMENT wp; - consoleX = winWidth + 1; - consoleY = boardY; - consoleW = screenWidth - winWidth; - consoleH = winHeight; - EnsureOnScreen(&consoleX, &consoleY); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = SW_SHOW; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = consoleX; - wp.rcNormalPosition.right = consoleX + consoleW; - wp.rcNormalPosition.top = consoleY; - wp.rcNormalPosition.bottom = consoleY + consoleH; - SetWindowPlacement(hDlg, &wp); - } - return FALSE; - - case WM_SETFOCUS: - SetFocus(hInput); - return 0; - - case WM_CLOSE: - ExitEvent(0); - /* not reached */ - break; - - case WM_SIZE: - if (IsIconic(hDlg)) break; - newSizeX = LOWORD(lParam); - newSizeY = HIWORD(lParam); - if (sizeX != newSizeX || sizeY != newSizeY) { - RECT rectText, rectInput; - POINT pt; - int newTextHeight, newTextWidth; - GetWindowRect(hText, &rectText); - newTextWidth = rectText.right - rectText.left + newSizeX - sizeX; - newTextHeight = rectText.bottom - rectText.top + newSizeY - sizeY; - if (newTextHeight < 0) { - newSizeY += -newTextHeight; - newTextHeight = 0; - } - SetWindowPos(hText, NULL, 0, 0, - newTextWidth, newTextHeight, SWP_NOZORDER|SWP_NOMOVE); - GetWindowRect(hInput, &rectInput); /* gives screen coords */ - pt.x = rectInput.left; - pt.y = rectInput.top + newSizeY - sizeY; - ScreenToClient(hDlg, &pt); - SetWindowPos(hInput, NULL, - pt.x, pt.y, /* needs client coords */ - rectInput.right - rectInput.left + newSizeX - sizeX, - rectInput.bottom - rectInput.top, SWP_NOZORDER); - } - sizeX = newSizeX; - sizeY = newSizeY; - break; - - case WM_GETMINMAXINFO: - /* Prevent resizing window too small */ - mmi = (MINMAXINFO *) lParam; - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 100; - break; - } - return DefWindowProc(hDlg, message, wParam, lParam); - } - - - VOID - ConsoleCreate() - { - HWND hCons; - if (hwndConsole) return; - hCons = CreateDialog(hInst, szConsoleName, 0, NULL); - SendMessage(hCons, WM_INITDIALOG, 0, 0); - } - - - VOID - ConsoleOutput(char* data, int length, int forceVisible) - { - HWND hText; - int trim, exlen; - char *p, *q; - char buf[CO_MAX+1]; - POINT pEnd; - RECT rect; - static int delayLF = 0; - CHARRANGE savesel, sel; - - if (hwndConsole == NULL || length > CO_MAX-100 || length == 0) return; - p = data; - q = buf; - if (delayLF) { - *q++ = '\r'; - *q++ = '\n'; - delayLF = 0; - } - while (length--) { - if (*p == '\n') { - if (*++p) { - *q++ = '\r'; - *q++ = '\n'; - } else { - delayLF = 1; - } - } else if (*p == '\007') { - MyPlaySound(&sounds[(int)SoundBell]); - p++; - } else { - *q++ = *p++; - } - } - *q = NULLCHAR; - hText = GetDlgItem(hwndConsole, OPT_ConsoleText); - SendMessage(hText, EM_HIDESELECTION, TRUE, FALSE); - /* Save current selection */ - SendMessage(hText, EM_EXGETSEL, 0, (LPARAM)&savesel); - exlen = GetWindowTextLength(hText); - /* Find out whether current end of text is visible */ - SendMessage(hText, EM_GETRECT, 0, (LPARAM) &rect); - SendMessage(hText, EM_POSFROMCHAR, (WPARAM) &pEnd, exlen); - /* Trim existing text if it's too long */ - if (exlen + (q - buf) > CO_MAX) { - trim = (CO_TRIM > (q - buf)) ? CO_TRIM : (q - buf); - sel.cpMin = 0; - sel.cpMax = trim; - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); - SendMessage(hText, EM_REPLACESEL, 0, (LPARAM)""); - exlen -= trim; - savesel.cpMin -= trim; - savesel.cpMax -= trim; - if (exlen < 0) exlen = 0; - if (savesel.cpMin < 0) savesel.cpMin = 0; - if (savesel.cpMax < savesel.cpMin) savesel.cpMax = savesel.cpMin; - } - /* Append the new text */ - sel.cpMin = exlen; - sel.cpMax = exlen; - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); - SendMessage(hText, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&consoleCF); - SendMessage(hText, EM_REPLACESEL, 0, (LPARAM) buf); - if (forceVisible || exlen == 0 || - (rect.left <= pEnd.x && pEnd.x < rect.right && - rect.top <= pEnd.y && pEnd.y < rect.bottom)) { - /* Scroll to make new end of text visible if old end of text - was visible or new text is an echo of user typein */ - sel.cpMin = 9999999; - sel.cpMax = 9999999; - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); - SendMessage(hText, EM_HIDESELECTION, FALSE, FALSE); - SendMessage(hText, EM_SCROLLCARET, 0, 0); - SendMessage(hText, EM_HIDESELECTION, TRUE, FALSE); - } - if (savesel.cpMax == exlen || forceVisible) { - /* Move insert point to new end of text if it was at the old - end of text or if the new text is an echo of user typein */ - sel.cpMin = 9999999; - sel.cpMax = 9999999; - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); - } else { - /* Restore previous selection */ - SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&savesel); - } - SendMessage(hText, EM_HIDESELECTION, FALSE, FALSE); - } - - /*---------*/ - - - void - DisplayAClock(HDC hdc, int timeRemaining, int highlight, - RECT *rect, char *color) - { - char buf[100]; - char *str; - COLORREF oldFg, oldBg; - HFONT oldFont; - - if (appData.clockMode) { - if (tinyLayout) - sprintf(buf, "%c %s", color[0], TimeString(timeRemaining)); - else - sprintf(buf, "%s: %s", color, TimeString(timeRemaining)); - str = buf; - } else { - str = color; - } - - if (highlight) { - oldFg = SetTextColor(hdc, RGB(255, 255, 255)); /* white */ - oldBg = SetBkColor(hdc, RGB(0, 0, 0)); /* black */ - } else { - oldFg = SetTextColor(hdc, RGB(0, 0, 0)); /* black */ - oldBg = SetBkColor(hdc, RGB(255, 255, 255)); /* white */ - } - oldFont = SelectObject(hdc, font[boardSize][CLOCK_FONT]->hf); - - ExtTextOut(hdc, rect->left + MESSAGE_LINE_LEFTMARGIN, - rect->top, ETO_CLIPPED|ETO_OPAQUE, - rect, str, strlen(str), NULL); - - (void) SetTextColor(hdc, oldFg); - (void) SetBkColor(hdc, oldBg); - (void) SelectObject(hdc, oldFont); - } - - - int - DoReadFile(HANDLE hFile, char *buf, int count, DWORD *outCount, - OVERLAPPED *ovl) - { - int ok, err; - - ResetEvent(ovl->hEvent); - ovl->Offset = ovl->OffsetHigh = 0; - ok = ReadFile(hFile, buf, count, outCount, ovl); - if (ok) { - err = NO_ERROR; - } else { - err = GetLastError(); - if (err == ERROR_IO_PENDING) { - ok = GetOverlappedResult(hFile, ovl, outCount, TRUE); - if (ok) - err = NO_ERROR; - else - err = GetLastError(); - } - } - return err; - } - - int - DoWriteFile(HANDLE hFile, char *buf, int count, DWORD *outCount, - OVERLAPPED *ovl) - { - int ok, err; - - ResetEvent(ovl->hEvent); - ovl->Offset = ovl->OffsetHigh = 0; - ok = WriteFile(hFile, buf, count, outCount, ovl); - if (ok) { - err = NO_ERROR; - } else { - err = GetLastError(); - if (err == ERROR_IO_PENDING) { - ok = GetOverlappedResult(hFile, ovl, outCount, TRUE); - if (ok) - err = NO_ERROR; - else - err = GetLastError(); - } - } - return err; - } - - - DWORD - InputThread(LPVOID arg) - { - InputSource *is; - OVERLAPPED ovl; - - is = (InputSource *) arg; - ovl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - ovl.Internal = ovl.InternalHigh = ovl.Offset = ovl.OffsetHigh = 0; - while (is->hThread != NULL) { - is->error = DoReadFile(is->hFile, is->next, - INPUT_SOURCE_BUF_SIZE - (is->next - is->buf), - &is->count, &ovl); - if (is->error == NO_ERROR) { - is->next += is->count; - } else { - if (is->error == ERROR_BROKEN_PIPE) { - /* Correct for MS brain damage. EOF reading a pipe is not an error. */ - is->count = 0; - } else { - is->count = (DWORD) -1; - } - } - SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); - if (is->count <= 0) break; /* Quit on EOF or error */ - } - CloseHandle(ovl.hEvent); - CloseHandle(is->hFile); - return 0; - } - - - /* Windows 95 beta 2 won't let you do overlapped i/o on a console or pipe */ - DWORD - NonOvlInputThread(LPVOID arg) - { - InputSource *is; - char *p, *q; - int i; - char prev; - - is = (InputSource *) arg; - while (is->hThread != NULL) { - is->error = ReadFile(is->hFile, is->next, - INPUT_SOURCE_BUF_SIZE - (is->next - is->buf), - &is->count, NULL) ? NO_ERROR : GetLastError(); - if (is->error == NO_ERROR) { - /* Change CRLF to LF */ - if (is->next > is->buf) { - p = is->next - 1; - i = is->count + 1; - } else { - p = is->next; - i = is->count; - } - q = p; - prev = NULLCHAR; - while (i > 0) { - if (prev == '\r' && *p == '\n') { - *(q-1) = '\n'; - is->count--; - } else { - *q++ = *p; - } - prev = *p++; - i--; - } - *q = NULLCHAR; - is->next = q; - } else { - if (is->error == ERROR_BROKEN_PIPE) { - /* Correct for MS brain damage. EOF reading a pipe is not an error. */ - is->count = 0; - } else { - is->count = (DWORD) -1; - } - } - SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); - if (is->count < 0) break; /* Quit on error */ - } - CloseHandle(is->hFile); - return 0; - } - - DWORD - SocketInputThread(LPVOID arg) - { - InputSource *is; - - is = (InputSource *) arg; - while (is->hThread != NULL) { - is->count = recv(is->sock, is->buf, INPUT_SOURCE_BUF_SIZE, 0); - if ((int)is->count == SOCKET_ERROR) { - is->count = (DWORD) -1; - is->error = WSAGetLastError(); - } else { - is->error = NO_ERROR; - is->next += is->count; - if (is->count == 0 && is->second == is) { - /* End of file on stderr; quit with no message */ - break; - } - } - SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); - if (is->count <= 0) break; /* Quit on EOF or error */ - } - return 0; - } - - VOID - InputEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - InputSource *is; - - is = (InputSource *) lParam; - if (is->lineByLine) { - /* Feed in lines one by one */ - char *p = is->buf; - char *q = p; - while (q < is->next) { - if (*q++ == '\n') { - (is->func)(is, is->closure, p, q - p, NO_ERROR); - p = q; - } - } - /* Move any partial line to the start of the buffer */ - q = is->buf; - while (p < is->next) { - *q++ = *p++; - } - is->next = q; - if (is->error != NO_ERROR || is->count == 0) { - /* Notify backend of the error. Note: If there was a partial - line at the end, it is not flushed through. */ - (is->func)(is, is->closure, is->buf, is->count, is->error); - } - } else { - /* Feed in the whole chunk of input at once */ - (is->func)(is, is->closure, is->buf, is->count, is->error); - is->next = is->buf; - } - } - - /*---------------------------------------------------------------------------*\ - * - * Menu enables. Used when setting various modes. - * - \*---------------------------------------------------------------------------*/ - - typedef struct { - int item; - int flags; - } Enables; - - VOID - SetMenuEnables(HMENU hmenu, Enables *enab) - { - while (enab->item > 0) { - (void) EnableMenuItem(hmenu, enab->item, enab->flags); - enab++; - } - } - - Enables gnuEnables[] = { - { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, - { IDM_IcsClient, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Accept, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Decline, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Rematch, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Adjourn, MF_BYCOMMAND|MF_GRAYED }, - { IDM_StopExamining, MF_BYCOMMAND|MF_GRAYED }, - { IDM_StopObserving, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Revert, MF_BYCOMMAND|MF_GRAYED }, - { -1, -1 } - }; - - Enables icsEnables[] = { - { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, - { IDM_AnalysisMode, MF_BYCOMMAND|MF_GRAYED }, - { IDM_AnalyzeFile, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TimeControl, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Hint, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Book, MF_BYCOMMAND|MF_GRAYED }, - { IDM_IcsOptions, MF_BYCOMMAND|MF_ENABLED }, - { -1, -1 } - }; - - #ifdef ZIPPY - Enables zippyEnables[] = { - { IDM_MoveNow, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Hint, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Book, MF_BYCOMMAND|MF_ENABLED }, - { -1, -1 } - }; - #endif - - Enables ncpEnables[] = { - { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, - { IDM_AnalysisMode, MF_BYCOMMAND|MF_GRAYED }, - { IDM_AnalyzeFile, MF_BYCOMMAND|MF_GRAYED }, - { IDM_IcsClient, MF_BYCOMMAND|MF_GRAYED }, - { ACTION_POS, MF_BYPOSITION|MF_GRAYED }, - { IDM_Revert, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, - { IDM_RetractMove, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TimeControl, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Hint, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Book, MF_BYCOMMAND|MF_GRAYED }, - { -1, -1 } - }; - - Enables trainingOnEnables[] = { - { IDM_EditComment, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Pause, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Forward, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Backward, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ToEnd, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ToStart, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TruncateGame, MF_BYCOMMAND|MF_GRAYED }, - { -1, -1 } - }; - - Enables trainingOffEnables[] = { - { IDM_EditComment, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Pause, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Forward, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Backward, MF_BYCOMMAND|MF_ENABLED }, - { IDM_ToEnd, MF_BYCOMMAND|MF_ENABLED }, - { IDM_ToStart, MF_BYCOMMAND|MF_ENABLED }, - { IDM_MoveNow, MF_BYCOMMAND|MF_ENABLED }, - { IDM_TruncateGame, MF_BYCOMMAND|MF_ENABLED }, - { -1, -1 } - }; - - /* These modify either ncpEnables or gnuEnables */ - Enables cmailEnables[] = { - { IDM_MailMove, MF_BYCOMMAND|MF_ENABLED }, - { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_ENABLED }, - { ACTION_POS, MF_BYPOSITION|MF_ENABLED }, - { IDM_CallFlag, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Draw, MF_BYCOMMAND|MF_ENABLED }, - { IDM_Adjourn, MF_BYCOMMAND|MF_GRAYED }, - { IDM_Abort, MF_BYCOMMAND|MF_GRAYED }, - { -1, -1 } - }; - - Enables machineThinkingEnables[] = { - { IDM_LoadGame, MF_BYCOMMAND|MF_GRAYED }, - { IDM_LoadNextGame, MF_BYCOMMAND|MF_GRAYED }, - { IDM_LoadPrevGame, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ReloadGame, MF_BYCOMMAND|MF_GRAYED }, - { IDM_PasteGame, MF_BYCOMMAND|MF_GRAYED }, - { IDM_LoadPosition, MF_BYCOMMAND|MF_GRAYED }, - { IDM_LoadNextPosition, MF_BYCOMMAND|MF_GRAYED }, - { IDM_LoadPrevPosition, MF_BYCOMMAND|MF_GRAYED }, - { IDM_ReloadPosition, MF_BYCOMMAND|MF_GRAYED }, - { IDM_PastePosition, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, - { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, - { IDM_TypeInMove, MF_BYCOMMAND|MF_GRAYED }, - { IDM_RetractMove, MF_BYCOMMAND|MF_GRAYED }, - { -1, -1 } - }; - - Enables userThinkingEnables[] = { - { IDM_LoadGame, MF_BYCOMMAND|MF_ENABLED }, - { IDM_LoadNextGame, MF_BYCOMMAND|MF_ENABLED }, - { IDM_LoadPrevGame, MF_BYCOMMAND|MF_ENABLED }, - { IDM_ReloadGame, MF_BYCOMMAND|MF_ENABLED }, - { IDM_PasteGame, MF_BYCOMMAND|MF_ENABLED }, - { IDM_LoadPosition, MF_BYCOMMAND|MF_ENABLED }, - { IDM_LoadNextPosition, MF_BYCOMMAND|MF_ENABLED }, - { IDM_LoadPrevPosition, MF_BYCOMMAND|MF_ENABLED }, - { IDM_ReloadPosition, MF_BYCOMMAND|MF_ENABLED }, - { IDM_PastePosition, MF_BYCOMMAND|MF_ENABLED }, - { IDM_MachineWhite, MF_BYCOMMAND|MF_ENABLED }, - { IDM_MachineBlack, MF_BYCOMMAND|MF_ENABLED }, - { IDM_TwoMachines, MF_BYCOMMAND|MF_ENABLED }, - { IDM_TypeInMove, MF_BYCOMMAND|MF_ENABLED }, - { IDM_RetractMove, MF_BYCOMMAND|MF_ENABLED }, - { -1, -1 } - }; - - /*---------------------------------------------------------------------------*\ - * - * Front-end interface functions exported by XBoard. - * Functions appear in same order as prototypes in frontend.h. - * - \*---------------------------------------------------------------------------*/ - VOID - ModeHighlight() - { - static UINT prevChecked = 0; - static int prevPausing = 0; - UINT nowChecked; - - if (pausing != prevPausing) { - prevPausing = pausing; - (void) CheckMenuItem(GetMenu(hwndMain), IDM_Pause, - MF_BYCOMMAND|(pausing ? MF_CHECKED : MF_UNCHECKED)); - if (hwndPause) SetWindowText(hwndPause, pausing ? "C" : "P"); - } - - switch (gameMode) { - case BeginningOfGame: - if (appData.icsActive) - nowChecked = IDM_IcsClient; - else if (appData.noChessProgram) - nowChecked = IDM_EditGame; - else - nowChecked = IDM_MachineBlack; - break; - case MachinePlaysBlack: - nowChecked = IDM_MachineBlack; - break; - case MachinePlaysWhite: - nowChecked = IDM_MachineWhite; - break; - case TwoMachinesPlay: - nowChecked = IDM_TwoMachines; - break; - case AnalyzeMode: - nowChecked = IDM_AnalysisMode; - break; - case AnalyzeFile: - nowChecked = IDM_AnalyzeFile; - break; - case EditGame: - nowChecked = IDM_EditGame; - break; - case PlayFromGameFile: - nowChecked = IDM_LoadGame; - break; - case EditPosition: - nowChecked = IDM_EditPosition; - break; - case Training: - nowChecked = IDM_Training; - break; - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsIdle: - nowChecked = IDM_IcsClient; - break; - default: - case EndOfGame: - nowChecked = 0; - break; - } - if (prevChecked != 0) - (void) CheckMenuItem(GetMenu(hwndMain), - prevChecked, MF_BYCOMMAND|MF_UNCHECKED); - if (nowChecked != 0) - (void) CheckMenuItem(GetMenu(hwndMain), - nowChecked, MF_BYCOMMAND|MF_CHECKED); - - if (nowChecked == IDM_LoadGame || nowChecked == IDM_Training) { - (void) EnableMenuItem(GetMenu(hwndMain), IDM_Training, - MF_BYCOMMAND|MF_ENABLED); - } else { - (void) EnableMenuItem(GetMenu(hwndMain), - IDM_Training, MF_BYCOMMAND|MF_GRAYED); - } - - prevChecked = nowChecked; - - /* icsEngineAnalyze - Do a sceure check too */ - if (appData.icsActive) { - if (appData.icsEngineAnalyze) { - (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, - MF_BYCOMMAND|MF_CHECKED); - } else { - (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, - MF_BYCOMMAND|MF_UNCHECKED); - } - } - } - - VOID - SetICSMode() - { - HMENU hmenu = GetMenu(hwndMain); - SetMenuEnables(hmenu, icsEnables); - EnableMenuItem(GetSubMenu(hmenu, OPTIONS_POS), ICS_POS, - MF_BYPOSITION|MF_ENABLED); - #ifdef ZIPPY - if (appData.zippyPlay) { - SetMenuEnables(hmenu, zippyEnables); - /* icsEngineAnalyze */ - if (!appData.noChessProgram) - (void) EnableMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, - MF_BYCOMMAND|MF_ENABLED); - } - #endif - } - - VOID - SetGNUMode() - { - SetMenuEnables(GetMenu(hwndMain), gnuEnables); - } - - VOID - SetNCPMode() - { - HMENU hmenu = GetMenu(hwndMain); - SetMenuEnables(hmenu, ncpEnables); - EnableMenuItem(GetSubMenu(hmenu, OPTIONS_POS), SOUNDS_POS, - MF_BYPOSITION|MF_GRAYED); - DrawMenuBar(hwndMain); - } - - VOID - SetCmailMode() - { - SetMenuEnables(GetMenu(hwndMain), cmailEnables); - } - - VOID - SetTrainingModeOn() - { - int i; - SetMenuEnables(GetMenu(hwndMain), trainingOnEnables); - for (i = 0; i < N_BUTTONS; i++) { - if (buttonDesc[i].hwnd != NULL) - EnableWindow(buttonDesc[i].hwnd, FALSE); - } - CommentPopDown(); - } - - VOID SetTrainingModeOff() - { - int i; - SetMenuEnables(GetMenu(hwndMain), trainingOffEnables); - for (i = 0; i < N_BUTTONS; i++) { - if (buttonDesc[i].hwnd != NULL) - EnableWindow(buttonDesc[i].hwnd, TRUE); - } - } - - - VOID - SetUserThinkingEnables() - { - SetMenuEnables(GetMenu(hwndMain), userThinkingEnables); - } - - VOID - SetMachineThinkingEnables() - { - HMENU hMenu = GetMenu(hwndMain); - int flags = MF_BYCOMMAND|MF_ENABLED; - - SetMenuEnables(hMenu, machineThinkingEnables); - - if (gameMode == MachinePlaysBlack) { - (void)EnableMenuItem(hMenu, IDM_MachineBlack, flags); - } else if (gameMode == MachinePlaysWhite) { - (void)EnableMenuItem(hMenu, IDM_MachineWhite, flags); - } else if (gameMode == TwoMachinesPlay) { - (void)EnableMenuItem(hMenu, IDM_TwoMachines, flags); - } - } - - - VOID - DisplayTitle(char *str) - { - char title[MSG_SIZ], *host; - if (str[0] != NULLCHAR) { - strcpy(title, str); - } else if (appData.icsActive) { - if (appData.icsCommPort[0] != NULLCHAR) - host = "ICS"; - else - host = appData.icsHost; - sprintf(title, "%s: %s", szTitle, host); - } else if (appData.noChessProgram) { - strcpy(title, szTitle); - } else { - strcpy(title, szTitle); - strcat(title, ": "); - strcat(title, first.tidy); - } - SetWindowText(hwndMain, title); - } - - - VOID - DisplayMessage(char *str1, char *str2) - { - HDC hdc; - HFONT oldFont; - int remain = MESSAGE_TEXT_MAX - 1; - int len; - - moveErrorMessageUp = FALSE; /* turned on later by caller if needed */ - messageText[0] = NULLCHAR; - if (*str1) { - len = strlen(str1); - if (len > remain) len = remain; - strncpy(messageText, str1, len); - messageText[len] = NULLCHAR; - remain -= len; - } - if (*str2 && remain >= 2) { - if (*str1) { - strcat(messageText, " "); - remain -= 2; - } - len = strlen(str2); - if (len > remain) len = remain; - strncat(messageText, str2, len); - } - messageText[MESSAGE_TEXT_MAX - 1] = NULLCHAR; - - if (IsIconic(hwndMain)) return; - hdc = GetDC(hwndMain); - oldFont = SelectObject(hdc, font[boardSize][MESSAGE_FONT]->hf); - ExtTextOut(hdc, messageRect.left, messageRect.top, ETO_CLIPPED|ETO_OPAQUE, - &messageRect, messageText, strlen(messageText), NULL); - (void) SelectObject(hdc, oldFont); - (void) ReleaseDC(hwndMain, hdc); - } - - VOID - DisplayError(char *str, int error) - { - char buf[MSG_SIZ*2], buf2[MSG_SIZ]; - int len; - - if (error == 0) { - strcpy(buf, str); - } else { - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, LANG_NEUTRAL, - (LPSTR) buf2, MSG_SIZ, NULL); - if (len > 0) { - sprintf(buf, "%s:\n%s", str, buf2); - } else { - ErrorMap *em = errmap; - while (em->err != 0 && em->err != error) em++; - if (em->err != 0) { - sprintf(buf, "%s:\n%s", str, em->msg); - } else { - sprintf(buf, "%s:\nError code %d", str, error); - } - } - } - - ErrorPopUp("Error", buf); - } - - - VOID - DisplayMoveError(char *str) - { - fromX = fromY = -1; - ClearHighlights(); - DrawPosition(FALSE, NULL); - if (appData.popupMoveErrors) { - ErrorPopUp("Error", str); - } else { - DisplayMessage(str, ""); - moveErrorMessageUp = TRUE; - } - } - - VOID - DisplayFatalError(char *str, int error, int exitStatus) - { - char buf[2*MSG_SIZ], buf2[MSG_SIZ]; - int len; - char *label = exitStatus ? "Fatal Error" : "Exiting"; - - if (error != 0) { - len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, LANG_NEUTRAL, - (LPSTR) buf2, MSG_SIZ, NULL); - if (len > 0) { - sprintf(buf, "%s:\n%s", str, buf2); - } else { - ErrorMap *em = errmap; - while (em->err != 0 && em->err != error) em++; - if (em->err != 0) { - sprintf(buf, "%s:\n%s", str, em->msg); - } else { - sprintf(buf, "%s:\nError code %d", str, error); - } - } - str = buf; - } - if (appData.debugMode) { - fprintf(debugFP, "%s: %s\n", label, str); - } - if (appData.popupExitMessage) { - (void) MessageBox(hwndMain, str, label, MB_OK| - (exitStatus ? MB_ICONSTOP : MB_ICONINFORMATION)); - } - ExitEvent(exitStatus); - } - - - VOID - DisplayInformation(char *str) - { - (void) MessageBox(hwndMain, str, "Information", MB_OK|MB_ICONINFORMATION); - } - - - VOID - DisplayNote(char *str) - { - ErrorPopUp("Note", str); - } - - - typedef struct { - char *title, *question, *replyPrefix; - ProcRef pr; - } QuestionParams; - - LRESULT CALLBACK - QuestionDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - static QuestionParams *qp; - char reply[MSG_SIZ]; - int len, err; - - switch (message) { - case WM_INITDIALOG: - qp = (QuestionParams *) lParam; - CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); - SetWindowText(hDlg, qp->title); - SetDlgItemText(hDlg, OPT_QuestionText, qp->question); - SetFocus(GetDlgItem(hDlg, OPT_QuestionInput)); - return FALSE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - strcpy(reply, qp->replyPrefix); - if (*reply) strcat(reply, " "); - len = strlen(reply); - GetDlgItemText(hDlg, OPT_QuestionInput, reply + len, sizeof(reply) - len); - strcat(reply, "\n"); - OutputToProcess(qp->pr, reply, strlen(reply), &err); - EndDialog(hDlg, TRUE); - if (err) DisplayFatalError("Error writing to chess program", err, 1); - return TRUE; - case IDCANCEL: - EndDialog(hDlg, FALSE); - return TRUE; - default: - break; - } - break; - } - return FALSE; - } - - VOID - AskQuestion(char* title, char *question, char *replyPrefix, ProcRef pr) - { - QuestionParams qp; - FARPROC lpProc; - - qp.title = title; - qp.question = question; - qp.replyPrefix = replyPrefix; - qp.pr = pr; - lpProc = MakeProcInstance((FARPROC)QuestionDialog, hInst); - DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_Question), - hwndMain, (DLGPROC)lpProc, (LPARAM)&qp); - FreeProcInstance(lpProc); - } - - - VOID - DisplayIcsInteractionTitle(char *str) - { - char consoleTitle[MSG_SIZ]; - - sprintf(consoleTitle, "%s: %s", szConsoleTitle, str); - SetWindowText(hwndConsole, consoleTitle); - } - - void - DrawPosition(int fullRedraw, Board board) - { - HDCDrawPosition(NULL, (BOOLEAN) fullRedraw, board); - } - - - VOID - ResetFrontEnd() - { - fromX = fromY = -1; - if (dragInfo.pos.x != -1 || dragInfo.pos.y != -1) { - dragInfo.pos.x = dragInfo.pos.y = -1; - dragInfo.pos.x = dragInfo.pos.y = -1; - dragInfo.lastpos = dragInfo.pos; - dragInfo.start.x = dragInfo.start.y = -1; - dragInfo.from = dragInfo.start; - ReleaseCapture(); - DrawPosition(TRUE, NULL); - } - } - - - VOID - CommentPopUp(char *title, char *str) - { - HWND hwnd = GetActiveWindow(); - EitherCommentPopUp(0, title, str, FALSE); - SetActiveWindow(hwnd); - } - - VOID - CommentPopDown(void) - { - CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, MF_UNCHECKED); - if (commentDialog) { - ShowWindow(commentDialog, SW_HIDE); - } - commentDialogUp = FALSE; - } - - VOID - EditCommentPopUp(int index, char *title, char *str) - { - EitherCommentPopUp(index, title, str, TRUE); - } - - - VOID - RingBell() - { - MyPlaySound(&sounds[(int)SoundMove]); - } - - VOID PlayIcsWinSound() - { - MyPlaySound(&sounds[(int)SoundIcsWin]); - } - - VOID PlayIcsLossSound() - { - MyPlaySound(&sounds[(int)SoundIcsLoss]); - } - - VOID PlayIcsDrawSound() - { - MyPlaySound(&sounds[(int)SoundIcsDraw]); - } - - VOID PlayIcsUnfinishedSound() - { - MyPlaySound(&sounds[(int)SoundIcsUnfinished]); - } - - VOID - PlayAlarmSound() - { - MyPlaySound(&sounds[(int)SoundAlarm]); - } - - - VOID - EchoOn() - { - HWND hInput; - consoleEcho = TRUE; - hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&consoleCF); - SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); - } - - - VOID - EchoOff() - { - CHARFORMAT cf; - HWND hInput; - consoleEcho = FALSE; - hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); - /* This works OK: set text and background both to the same color */ - cf = consoleCF; - cf.crTextColor = COLOR_ECHOOFF; - SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); - SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, cf.crTextColor); - } - - /* No Raw()...? */ - - void Colorize(ColorClass cc, int continuation) - { - currentColorClass = cc; - consoleCF.dwMask = CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT; - consoleCF.crTextColor = textAttribs[cc].color; - consoleCF.dwEffects = textAttribs[cc].effects; - if (!continuation) MyPlaySound(&textAttribs[cc].sound); - } - - char * - UserName() - { - static char buf[MSG_SIZ]; - DWORD bufsiz = MSG_SIZ; - - if (!GetUserName(buf, &bufsiz)) { - /*DisplayError("Error getting user name", GetLastError());*/ - strcpy(buf, "User"); - } - return buf; - } - - char * - HostName() - { - static char buf[MSG_SIZ]; - DWORD bufsiz = MSG_SIZ; - - if (!GetComputerName(buf, &bufsiz)) { - /*DisplayError("Error getting host name", GetLastError());*/ - strcpy(buf, "Unknown"); - } - return buf; - } - - - int - ClockTimerRunning() - { - return clockTimerEvent != 0; - } - - int - StopClockTimer() - { - if (clockTimerEvent == 0) return FALSE; - KillTimer(hwndMain, clockTimerEvent); - clockTimerEvent = 0; - return TRUE; - } - - void - StartClockTimer(long millisec) - { - clockTimerEvent = SetTimer(hwndMain, (UINT) CLOCK_TIMER_ID, - (UINT) millisec, NULL); - } - - void - DisplayWhiteClock(long timeRemaining, int highlight) - { - HDC hdc; - hdc = GetDC(hwndMain); - if (!IsIconic(hwndMain)) { - DisplayAClock(hdc, timeRemaining, highlight, &whiteRect, "White"); - } - if (highlight && iconCurrent == iconBlack) { - iconCurrent = iconWhite; - PostMessage(hwndMain, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); - if (IsIconic(hwndMain)) { - DrawIcon(hdc, 2, 2, iconCurrent); - } - } - (void) ReleaseDC(hwndMain, hdc); - if (hwndConsole) - PostMessage(hwndConsole, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); - } - - void - DisplayBlackClock(long timeRemaining, int highlight) - { - HDC hdc; - hdc = GetDC(hwndMain); - if (!IsIconic(hwndMain)) { - DisplayAClock(hdc, timeRemaining, highlight, &blackRect, "Black"); - } - if (highlight && iconCurrent == iconWhite) { - iconCurrent = iconBlack; - PostMessage(hwndMain, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); - if (IsIconic(hwndMain)) { - DrawIcon(hdc, 2, 2, iconCurrent); - } - } - (void) ReleaseDC(hwndMain, hdc); - if (hwndConsole) - PostMessage(hwndConsole, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); - } - - - int - LoadGameTimerRunning() - { - return loadGameTimerEvent != 0; - } - - int - StopLoadGameTimer() - { - if (loadGameTimerEvent == 0) return FALSE; - KillTimer(hwndMain, loadGameTimerEvent); - loadGameTimerEvent = 0; - return TRUE; - } - - void - StartLoadGameTimer(long millisec) - { - loadGameTimerEvent = SetTimer(hwndMain, (UINT) LOAD_GAME_TIMER_ID, - (UINT) millisec, NULL); - } - - void - AutoSaveGame() - { - char *defName; - FILE *f; - char fileTitle[MSG_SIZ]; - - defName = DefaultFileName(appData.oldSaveStyle ? "gam" : "pgn"); - f = OpenFileDialog(hwndMain, TRUE, defName, - appData.oldSaveStyle ? "gam" : "pgn", - GAME_FILT, - "Save Game to File", NULL, fileTitle, NULL); - if (f != NULL) { - SaveGame(f, 0, ""); - fclose(f); - } - } - - - void - ScheduleDelayedEvent(DelayedEventCallback cb, long millisec) - { - if (delayedTimerEvent != 0) { - if (appData.debugMode) { - fprintf(debugFP, "ScheduleDelayedEvent: event already scheduled\n"); - } - KillTimer(hwndMain, delayedTimerEvent); - delayedTimerEvent = 0; - delayedTimerCallback(); - } - delayedTimerCallback = cb; - delayedTimerEvent = SetTimer(hwndMain, (UINT) DELAYED_TIMER_ID, - (UINT) millisec, NULL); - } - - DelayedEventCallback - GetDelayedEvent() - { - if (delayedTimerEvent) { - return delayedTimerCallback; - } else { - return NULL; - } - } - - void - CancelDelayedEvent() - { - if (delayedTimerEvent) { - KillTimer(hwndMain, delayedTimerEvent); - delayedTimerEvent = 0; - } - } - - /* Start a child process running the given program. - The process's standard output can be read from "from", and its - standard input can be written to "to". - Exit with fatal error if anything goes wrong. - Returns an opaque pointer that can be used to destroy the process - later. - */ - int - StartChildProcess(char *cmdLine, char *dir, ProcRef *pr) - { - #define BUFSIZE 4096 - - HANDLE hChildStdinRd, hChildStdinWr, - hChildStdoutRd, hChildStdoutWr; - HANDLE hChildStdinWrDup, hChildStdoutRdDup; - SECURITY_ATTRIBUTES saAttr; - BOOL fSuccess; - PROCESS_INFORMATION piProcInfo; - STARTUPINFO siStartInfo; - ChildProc *cp; - char buf[MSG_SIZ]; - DWORD err; - - if (appData.debugMode) { - fprintf(debugFP, "StartChildProcess (dir=\"%s\") %s\n", dir, cmdLine); - } - - *pr = NoProc; - - /* Set the bInheritHandle flag so pipe handles are inherited. */ - saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); - saAttr.bInheritHandle = TRUE; - saAttr.lpSecurityDescriptor = NULL; - - /* - * The steps for redirecting child's STDOUT: - * 1. Create anonymous pipe to be STDOUT for child. - * 2. Create a noninheritable duplicate of read handle, - * and close the inheritable read handle. - */ - - /* Create a pipe for the child's STDOUT. */ - if (! CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) { - return GetLastError(); - } - - /* Duplicate the read handle to the pipe, so it is not inherited. */ - fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd, - GetCurrentProcess(), &hChildStdoutRdDup, 0, - FALSE, /* not inherited */ - DUPLICATE_SAME_ACCESS); - if (! fSuccess) { - return GetLastError(); - } - CloseHandle(hChildStdoutRd); - - /* - * The steps for redirecting child's STDIN: - * 1. Create anonymous pipe to be STDIN for child. - * 2. Create a noninheritable duplicate of write handle, - * and close the inheritable write handle. - */ - - /* Create a pipe for the child's STDIN. */ - if (! CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) { - return GetLastError(); - } - - /* Duplicate the write handle to the pipe, so it is not inherited. */ - fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, - GetCurrentProcess(), &hChildStdinWrDup, 0, - FALSE, /* not inherited */ - DUPLICATE_SAME_ACCESS); - if (! fSuccess) { - return GetLastError(); - } - CloseHandle(hChildStdinWr); - - /* Arrange to (1) look in dir for the child .exe file, and - * (2) have dir be the child's working directory. Interpret - * dir relative to the directory WinBoard loaded from. */ - GetCurrentDirectory(MSG_SIZ, buf); - SetCurrentDirectory(installDir); - SetCurrentDirectory(dir); - - /* Now create the child process. */ - - siStartInfo.cb = sizeof(STARTUPINFO); - siStartInfo.lpReserved = NULL; - siStartInfo.lpDesktop = NULL; - siStartInfo.lpTitle = NULL; - siStartInfo.dwFlags = STARTF_USESTDHANDLES; - siStartInfo.cbReserved2 = 0; - siStartInfo.lpReserved2 = NULL; - siStartInfo.hStdInput = hChildStdinRd; - siStartInfo.hStdOutput = hChildStdoutWr; - siStartInfo.hStdError = hChildStdoutWr; - - fSuccess = CreateProcess(NULL, - cmdLine, /* command line */ - NULL, /* process security attributes */ - NULL, /* primary thread security attrs */ - TRUE, /* handles are inherited */ - DETACHED_PROCESS|CREATE_NEW_PROCESS_GROUP, - NULL, /* use parent's environment */ - NULL, - &siStartInfo, /* STARTUPINFO pointer */ - &piProcInfo); /* receives PROCESS_INFORMATION */ - - err = GetLastError(); - SetCurrentDirectory(buf); /* return to prev directory */ - if (! fSuccess) { - return err; - } - - /* Close the handles we don't need in the parent */ - CloseHandle(piProcInfo.hThread); - CloseHandle(hChildStdinRd); - CloseHandle(hChildStdoutWr); - - /* Prepare return value */ - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPReal; - cp->hProcess = piProcInfo.hProcess; - cp->pid = piProcInfo.dwProcessId; - cp->hFrom = hChildStdoutRdDup; - cp->hTo = hChildStdinWrDup; - - *pr = (void *) cp; - - /* Klaus Friedel says that this Sleep solves a problem under Windows - 2000 where engines sometimes don't see the initial command(s) - from WinBoard and hang. I don't understand how that can happen, - but the Sleep is harmless, so I've put it in. Others have also - reported what may be the same problem, so hopefully this will fix - it for them too. */ - Sleep(500); - - return NO_ERROR; - } - - - void - DestroyChildProcess(ProcRef pr, int/*boolean*/ signal) - { - ChildProc *cp; - - cp = (ChildProc *) pr; - if (cp == NULL) return; - - switch (cp->kind) { - case CPReal: - /* TerminateProcess is considered harmful, so... */ - CloseHandle(cp->hTo); /* Closing this will give the child an EOF and hopefully kill it */ - if (cp->hFrom) CloseHandle(cp->hFrom); /* if NULL, InputThread will close it */ - /* The following doesn't work because the chess program - doesn't "have the same console" as WinBoard. Maybe - we could arrange for this even though neither WinBoard - nor the chess program uses a console for stdio? */ - /*!!if (signal) GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, cp->pid);*/ - CloseHandle(cp->hProcess); - break; - - case CPComm: - if (cp->hFrom) CloseHandle(cp->hFrom); - break; - - case CPSock: - closesocket(cp->sock); - WSACleanup(); - break; - - case CPRcmd: - if (signal) send(cp->sock2, "\017", 1, 0); /* 017 = 15 = SIGTERM */ - closesocket(cp->sock); - closesocket(cp->sock2); - WSACleanup(); - break; - } - free(cp); - } - - void - InterruptChildProcess(ProcRef pr) - { - ChildProc *cp; - - cp = (ChildProc *) pr; - if (cp == NULL) return; - switch (cp->kind) { - case CPReal: - /* The following doesn't work because the chess program - doesn't "have the same console" as WinBoard. Maybe - we could arrange for this even though neither WinBoard - nor the chess program uses a console for stdio */ - /*!!GenerateConsoleCtrlEvent(CTRL_C_EVENT, cp->pid);*/ - break; - - case CPComm: - case CPSock: - /* Can't interrupt */ - break; - - case CPRcmd: - send(cp->sock2, "\002", 1, 0); /* 2 = SIGINT */ - break; - } - } - - - int - OpenTelnet(char *host, char *port, ProcRef *pr) - { - char cmdLine[MSG_SIZ]; - - if (port[0] == NULLCHAR) { - sprintf(cmdLine, "%s %s", appData.telnetProgram, host); - } else { - sprintf(cmdLine, "%s %s %s", appData.telnetProgram, host, port); - } - return StartChildProcess(cmdLine, "", pr); - } - - - /* Code to open TCP sockets */ - - int - OpenTCP(char *host, char *port, ProcRef *pr) - { - ChildProc *cp; - int err; - SOCKET s; - struct sockaddr_in sa, mysa; - struct hostent FAR *hp; - unsigned short uport; - WORD wVersionRequested; - WSADATA wsaData; - - /* Initialize socket DLL */ - wVersionRequested = MAKEWORD(1, 1); - err = WSAStartup(wVersionRequested, &wsaData); - if (err != 0) return err; - - /* Make socket */ - if ((s = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - err = WSAGetLastError(); - WSACleanup(); - return err; - } - - /* Bind local address using (mostly) don't-care values. - */ - memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); - mysa.sin_family = AF_INET; - mysa.sin_addr.s_addr = INADDR_ANY; - uport = (unsigned short) 0; - mysa.sin_port = htons(uport); - if (bind(s, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) - == SOCKET_ERROR) { - err = WSAGetLastError(); - WSACleanup(); - return err; - } - - /* Resolve remote host name */ - memset((char *) &sa, 0, sizeof(struct sockaddr_in)); - if (!(hp = gethostbyname(host))) { - unsigned int b0, b1, b2, b3; - - err = WSAGetLastError(); - - if (sscanf(host, "%u.%u.%u.%u", &b0, &b1, &b2, &b3) == 4) { - hp = (struct hostent *) calloc(1, sizeof(struct hostent)); - hp->h_addrtype = AF_INET; - hp->h_length = 4; - hp->h_addr_list = (char **) calloc(2, sizeof(char *)); - hp->h_addr_list[0] = (char *) malloc(4); - hp->h_addr_list[0][0] = (char) b0; - hp->h_addr_list[0][1] = (char) b1; - hp->h_addr_list[0][2] = (char) b2; - hp->h_addr_list[0][3] = (char) b3; - } else { - WSACleanup(); - return err; - } - } - sa.sin_family = hp->h_addrtype; - uport = (unsigned short) atoi(port); - sa.sin_port = htons(uport); - memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); - - /* Make connection */ - if (connect(s, (struct sockaddr *) &sa, - sizeof(struct sockaddr_in)) == SOCKET_ERROR) { - err = WSAGetLastError(); - WSACleanup(); - return err; - } - - /* Prepare return value */ - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPSock; - cp->sock = s; - *pr = (ProcRef *) cp; - - return NO_ERROR; - } - - int - OpenCommPort(char *name, ProcRef *pr) - { - HANDLE h; - COMMTIMEOUTS ct; - ChildProc *cp; - char fullname[MSG_SIZ]; - - if (*name != '\\') - sprintf(fullname, "\\\\.\\%s", name); - else - strcpy(fullname, name); - - h = CreateFile(name, GENERIC_READ | GENERIC_WRITE, - 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); - if (h == (HANDLE) -1) { - return GetLastError(); - } - hCommPort = h; - - if (!SetCommState(h, (LPDCB) &dcb)) return GetLastError(); - - /* Accumulate characters until a 100ms pause, then parse */ - ct.ReadIntervalTimeout = 100; - ct.ReadTotalTimeoutMultiplier = 0; - ct.ReadTotalTimeoutConstant = 0; - ct.WriteTotalTimeoutMultiplier = 0; - ct.WriteTotalTimeoutConstant = 0; - if (!SetCommTimeouts(h, (LPCOMMTIMEOUTS) &ct)) return GetLastError(); - - /* Prepare return value */ - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPComm; - cp->hFrom = h; - cp->hTo = h; - *pr = (ProcRef *) cp; - - return NO_ERROR; - } - - int - OpenLoopback(ProcRef *pr) - { - DisplayFatalError("Not implemented", 0, 1); - return NO_ERROR; - } - - - int - OpenRcmd(char* host, char* user, char* cmd, ProcRef* pr) - { - ChildProc *cp; - int err; - SOCKET s, s2, s3; - struct sockaddr_in sa, mysa; - struct hostent FAR *hp; - unsigned short uport; - WORD wVersionRequested; - WSADATA wsaData; - int fromPort; - char stderrPortStr[MSG_SIZ]; - - /* Initialize socket DLL */ - wVersionRequested = MAKEWORD(1, 1); - err = WSAStartup(wVersionRequested, &wsaData); - if (err != 0) return err; - - /* Resolve remote host name */ - memset((char *) &sa, 0, sizeof(struct sockaddr_in)); - if (!(hp = gethostbyname(host))) { - unsigned int b0, b1, b2, b3; - - err = WSAGetLastError(); - - if (sscanf(host, "%u.%u.%u.%u", &b0, &b1, &b2, &b3) == 4) { - hp = (struct hostent *) calloc(1, sizeof(struct hostent)); - hp->h_addrtype = AF_INET; - hp->h_length = 4; - hp->h_addr_list = (char **) calloc(2, sizeof(char *)); - hp->h_addr_list[0] = (char *) malloc(4); - hp->h_addr_list[0][0] = (char) b0; - hp->h_addr_list[0][1] = (char) b1; - hp->h_addr_list[0][2] = (char) b2; - hp->h_addr_list[0][3] = (char) b3; - } else { - WSACleanup(); - return err; - } - } - sa.sin_family = hp->h_addrtype; - uport = (unsigned short) 514; - sa.sin_port = htons(uport); - memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); - - /* Bind local socket to unused "privileged" port address - */ - s = INVALID_SOCKET; - memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); - mysa.sin_family = AF_INET; - mysa.sin_addr.s_addr = INADDR_ANY; - for (fromPort = 1023;; fromPort--) { - if (fromPort < 0) { - WSACleanup(); - return WSAEADDRINUSE; - } - if (s == INVALID_SOCKET) { - if ((s = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - err = WSAGetLastError(); - WSACleanup(); - return err; - } - } - uport = (unsigned short) fromPort; - mysa.sin_port = htons(uport); - if (bind(s, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) - == SOCKET_ERROR) { - err = WSAGetLastError(); - if (err == WSAEADDRINUSE) continue; - WSACleanup(); - return err; - } - if (connect(s, (struct sockaddr *) &sa, - sizeof(struct sockaddr_in)) == SOCKET_ERROR) { - err = WSAGetLastError(); - if (err == WSAEADDRINUSE) { - closesocket(s); - s = -1; - continue; - } - WSACleanup(); - return err; - } - break; - } - - /* Bind stderr local socket to unused "privileged" port address - */ - s2 = INVALID_SOCKET; - memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); - mysa.sin_family = AF_INET; - mysa.sin_addr.s_addr = INADDR_ANY; - for (fromPort = 1023;; fromPort--) { - if (fromPort == prevStderrPort) continue; // don't reuse port - if (fromPort < 0) { - (void) closesocket(s); - WSACleanup(); - return WSAEADDRINUSE; - } - if (s2 == INVALID_SOCKET) { - if ((s2 = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { - err = WSAGetLastError(); - closesocket(s); - WSACleanup(); - return err; - } - } - uport = (unsigned short) fromPort; - mysa.sin_port = htons(uport); - if (bind(s2, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) - == SOCKET_ERROR) { - err = WSAGetLastError(); - if (err == WSAEADDRINUSE) continue; - (void) closesocket(s); - WSACleanup(); - return err; - } - if (listen(s2, 1) == SOCKET_ERROR) { - err = WSAGetLastError(); - if (err == WSAEADDRINUSE) { - closesocket(s2); - s2 = INVALID_SOCKET; - continue; - } - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - break; - } - prevStderrPort = fromPort; // remember port used - sprintf(stderrPortStr, "%d", fromPort); - - if (send(s, stderrPortStr, strlen(stderrPortStr) + 1, 0) == SOCKET_ERROR) { - err = WSAGetLastError(); - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - - if (send(s, UserName(), strlen(UserName()) + 1, 0) == SOCKET_ERROR) { - err = WSAGetLastError(); - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - if (*user == NULLCHAR) user = UserName(); - if (send(s, user, strlen(user) + 1, 0) == SOCKET_ERROR) { - err = WSAGetLastError(); - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - if (send(s, cmd, strlen(cmd) + 1, 0) == SOCKET_ERROR) { - err = WSAGetLastError(); - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - - if ((s3 = accept(s2, NULL, NULL)) == INVALID_SOCKET) { - err = WSAGetLastError(); - (void) closesocket(s); - (void) closesocket(s2); - WSACleanup(); - return err; - } - (void) closesocket(s2); /* Stop listening */ - - /* Prepare return value */ - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPRcmd; - cp->sock = s; - cp->sock2 = s3; - *pr = (ProcRef *) cp; - - return NO_ERROR; - } - - - InputSourceRef - AddInputSource(ProcRef pr, int lineByLine, - InputCallback func, VOIDSTAR closure) - { - InputSource *is, *is2; - ChildProc *cp = (ChildProc *) pr; - - is = (InputSource *) calloc(1, sizeof(InputSource)); - is->lineByLine = lineByLine; - is->func = func; - is->closure = closure; - is->second = NULL; - is->next = is->buf; - if (pr == NoProc) { - is->kind = CPReal; - consoleInputSource = is; - } else { - is->kind = cp->kind; - switch (cp->kind) { - case CPReal: - is->hFile = cp->hFrom; - cp->hFrom = NULL; /* now owned by InputThread */ - is->hThread = - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) NonOvlInputThread, - (LPVOID) is, 0, &is->id); - break; - - case CPComm: - is->hFile = cp->hFrom; - cp->hFrom = NULL; /* now owned by InputThread */ - is->hThread = - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) InputThread, - (LPVOID) is, 0, &is->id); - break; - - case CPSock: - is->sock = cp->sock; - is->hThread = - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, - (LPVOID) is, 0, &is->id); - break; - - case CPRcmd: - is2 = (InputSource *) calloc(1, sizeof(InputSource)); - *is2 = *is; - is->sock = cp->sock; - is->second = is2; - is2->sock = cp->sock2; - is2->second = is2; - is->hThread = - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, - (LPVOID) is, 0, &is->id); - is2->hThread = - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, - (LPVOID) is2, 0, &is2->id); - break; - } - } - return (InputSourceRef) is; - } - - void - RemoveInputSource(InputSourceRef isr) - { - InputSource *is; - - is = (InputSource *) isr; - is->hThread = NULL; /* tell thread to stop */ - CloseHandle(is->hThread); - if (is->second != NULL) { - is->second->hThread = NULL; - CloseHandle(is->second->hThread); - } - } - - - int - OutputToProcess(ProcRef pr, char *message, int count, int *outError) - { - DWORD dOutCount; - int outCount = SOCKET_ERROR; - ChildProc *cp = (ChildProc *) pr; - static OVERLAPPED ovl; - - if (pr == NoProc) { - ConsoleOutput(message, count, FALSE); - return count; - } - - if (ovl.hEvent == NULL) { - ovl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - } - ovl.Internal = ovl.InternalHigh = ovl.Offset = ovl.OffsetHigh = 0; - - switch (cp->kind) { - case CPSock: - case CPRcmd: - outCount = send(cp->sock, message, count, 0); - if (outCount == SOCKET_ERROR) { - *outError = WSAGetLastError(); - } else { - *outError = NO_ERROR; - } - break; - - case CPReal: - if (WriteFile(((ChildProc *)pr)->hTo, message, count, - &dOutCount, NULL)) { - *outError = NO_ERROR; - outCount = (int) dOutCount; - } else { - *outError = GetLastError(); - } - break; - - case CPComm: - *outError = DoWriteFile(((ChildProc *)pr)->hTo, message, count, - &dOutCount, &ovl); - if (*outError == NO_ERROR) { - outCount = (int) dOutCount; - } - break; - } - return outCount; - } - - int - OutputToProcessDelayed(ProcRef pr, char *message, int count, int *outError, - long msdelay) - { - /* Ignore delay, not implemented for WinBoard */ - return OutputToProcess(pr, message, count, outError); - } - - - void - CmailSigHandlerCallBack(InputSourceRef isr, VOIDSTAR closure, - char *buf, int count, int error) - { - DisplayFatalError("Not implemented", 0, 1); - } - - /* see wgamelist.c for Game List functions */ - /* see wedittags.c for Edit Tags functions */ - - - VOID - ICSInitScript() - { - FILE *f; - char buf[MSG_SIZ]; - char *dummy; - - if (SearchPath(installDir, appData.icsLogon, NULL, MSG_SIZ, buf, &dummy)) { - f = fopen(buf, "r"); - if (f != NULL) { - ProcessICSInitScript(f); - fclose(f); - } - } - } - - - VOID - StartAnalysisClock() - { - if (analysisTimerEvent) return; - analysisTimerEvent = SetTimer(hwndMain, (UINT) ANALYSIS_TIMER_ID, - (UINT) 2000, NULL); - } - - LRESULT CALLBACK - AnalysisDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) - { - static HANDLE hwndText; - RECT rect; - static int sizeX, sizeY; - int newSizeX, newSizeY, flags; - MINMAXINFO *mmi; - - switch (message) { - case WM_INITDIALOG: /* message: initialize dialog box */ - /* Initialize the dialog items */ - hwndText = GetDlgItem(hDlg, OPT_AnalysisText); - SetWindowText(hDlg, analysisTitle); - SetDlgItemText(hDlg, OPT_AnalysisText, analysisText); - /* Size and position the dialog */ - if (!analysisDialog) { - analysisDialog = hDlg; - flags = SWP_NOZORDER; - GetClientRect(hDlg, &rect); - sizeX = rect.right; - sizeY = rect.bottom; - if (analysisX != CW_USEDEFAULT && analysisY != CW_USEDEFAULT && - analysisW != CW_USEDEFAULT && analysisH != CW_USEDEFAULT) { - WINDOWPLACEMENT wp; - EnsureOnScreen(&analysisX, &analysisY); - wp.length = sizeof(WINDOWPLACEMENT); - wp.flags = 0; - wp.showCmd = SW_SHOW; - wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; - wp.rcNormalPosition.left = analysisX; - wp.rcNormalPosition.right = analysisX + analysisW; - wp.rcNormalPosition.top = analysisY; - wp.rcNormalPosition.bottom = analysisY + analysisH; - SetWindowPlacement(hDlg, &wp); - - GetClientRect(hDlg, &rect); - newSizeX = rect.right; - newSizeY = rect.bottom; - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, - newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - } - } - return FALSE; - - case WM_COMMAND: /* message: received a command */ - switch (LOWORD(wParam)) { - case IDCANCEL: - /* icsEngineAnalyze */ - if (appData.icsActive && appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - return TRUE; - } - EditGameEvent(); - return TRUE; - default: - break; - } - break; - - case WM_SIZE: - newSizeX = LOWORD(lParam); - newSizeY = HIWORD(lParam); - ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, newSizeX, newSizeY); - sizeX = newSizeX; - sizeY = newSizeY; - break; - - case WM_GETMINMAXINFO: - /* Prevent resizing window too small */ - mmi = (MINMAXINFO *) lParam; - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 100; - break; - } - return FALSE; - } - - VOID - AnalysisPopUp(char* title, char* str) - { - FARPROC lpProc; - char *p, *q; - - if (str == NULL) str = ""; - p = (char *) malloc(2 * strlen(str) + 2); - q = p; - while (*str) { - if (*str == '\n') *q++ = '\r'; - *q++ = *str++; - } - *q = NULLCHAR; - if (analysisText != NULL) free(analysisText); - analysisText = p; - - if (analysisDialog) { - SetWindowText(analysisDialog, title); - SetDlgItemText(analysisDialog, OPT_AnalysisText, analysisText); - ShowWindow(analysisDialog, SW_SHOW); - } else { - analysisTitle = title; - lpProc = MakeProcInstance((FARPROC)AnalysisDialog, hInst); - CreateDialog(hInst, MAKEINTRESOURCE(DLG_Analysis), - hwndMain, (DLGPROC)lpProc); - FreeProcInstance(lpProc); - } - analysisDialogUp = TRUE; - } - - VOID - AnalysisPopDown() - { - if (analysisDialog) { - ShowWindow(analysisDialog, SW_HIDE); - } - analysisDialogUp = FALSE; - } - - - VOID - SetHighlights(int fromX, int fromY, int toX, int toY) - { - highlightInfo.sq[0].x = fromX; - highlightInfo.sq[0].y = fromY; - highlightInfo.sq[1].x = toX; - highlightInfo.sq[1].y = toY; - } - - VOID - ClearHighlights() - { - highlightInfo.sq[0].x = highlightInfo.sq[0].y = - highlightInfo.sq[1].x = highlightInfo.sq[1].y = -1; - } - - VOID - SetPremoveHighlights(int fromX, int fromY, int toX, int toY) - { - premoveHighlightInfo.sq[0].x = fromX; - premoveHighlightInfo.sq[0].y = fromY; - premoveHighlightInfo.sq[1].x = toX; - premoveHighlightInfo.sq[1].y = toY; - } - - VOID - ClearPremoveHighlights() - { - premoveHighlightInfo.sq[0].x = premoveHighlightInfo.sq[0].y = - premoveHighlightInfo.sq[1].x = premoveHighlightInfo.sq[1].y = -1; - } - - VOID - ShutDownFrontEnd() - { - if (saveSettingsOnExit) SaveSettings(settingsFileName); - DeleteClipboardTempFiles(); - } - - void - BoardToTop() - { - if (IsIconic(hwndMain)) - ShowWindow(hwndMain, SW_RESTORE); - - SetActiveWindow(hwndMain); - } - - /* - * Prototypes for animation support routines - */ - static void ScreenSquare(int column, int row, POINT * pt); - static void Tween( POINT * start, POINT * mid, POINT * finish, int factor, - POINT frames[], int * nFrames); - - - #define kFactor 4 - - void - AnimateMove(board, fromX, fromY, toX, toY) - Board board; - int fromX; - int fromY; - int toX; - int toY; - { - ChessSquare piece; - POINT start, finish, mid; - POINT frames[kFactor * 2 + 1]; - int nFrames, n; - - if (!appData.animate) return; - if (doingSizing) return; - if (fromY < 0 || fromX < 0) return; - piece = board[fromY][fromX]; - if (piece >= EmptySquare) return; - - ScreenSquare(fromX, fromY, &start); - ScreenSquare(toX, toY, &finish); - - /* All pieces except knights move in straight line */ - if (piece != WhiteKnight && piece != BlackKnight) { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = start.y + (finish.y - start.y) / 2; - } else { - /* Knight: make diagonal movement then straight */ - if (abs(toY - fromY) < abs(toX - fromX)) { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = finish.y; - } else { - mid.x = finish.x; - mid.y = start.y + (finish.y - start.y) / 2; - } - } - - /* Don't use as many frames for very short moves */ - if (abs(toY - fromY) + abs(toX - fromX) <= 2) - Tween(&start, &mid, &finish, kFactor - 1, frames, &nFrames); - else - Tween(&start, &mid, &finish, kFactor, frames, &nFrames); - - animInfo.from.x = fromX; - animInfo.from.y = fromY; - animInfo.to.x = toX; - animInfo.to.y = toY; - animInfo.lastpos = start; - animInfo.piece = piece; - for (n = 0; n < nFrames; n++) { - animInfo.pos = frames[n]; - DrawPosition(FALSE, NULL); - animInfo.lastpos = animInfo.pos; - Sleep(appData.animSpeed); - } - animInfo.pos = finish; - DrawPosition(FALSE, NULL); - animInfo.piece = EmptySquare; - } - - /* Convert board position to corner of screen rect and color */ - - static void - ScreenSquare(column, row, pt) - int column; int row; POINT * pt; - { - if (flipView) { - pt->x = lineGap + ((BOARD_SIZE-1)-column) * (squareSize + lineGap); - pt->y = lineGap + row * (squareSize + lineGap); - } else { - pt->x = lineGap + column * (squareSize + lineGap); - pt->y = lineGap + ((BOARD_SIZE-1)-row) * (squareSize + lineGap); - } - } - - /* Generate a series of frame coords from start->mid->finish. - The movement rate doubles until the half way point is - reached, then halves back down to the final destination, - which gives a nice slow in/out effect. The algorithmn - may seem to generate too many intermediates for short - moves, but remember that the purpose is to attract the - viewers attention to the piece about to be moved and - then to where it ends up. Too few frames would be less - noticeable. */ - - static void - Tween(start, mid, finish, factor, frames, nFrames) - POINT * start; POINT * mid; - POINT * finish; int factor; - POINT frames[]; int * nFrames; - { - int n, fraction = 1, count = 0; - - /* Slow in, stepping 1/16th, then 1/8th, ... */ - for (n = 0; n < factor; n++) - fraction *= 2; - for (n = 0; n < factor; n++) { - frames[count].x = start->x + (mid->x - start->x) / fraction; - frames[count].y = start->y + (mid->y - start->y) / fraction; - count ++; - fraction = fraction / 2; - } - - /* Midpoint */ - frames[count] = *mid; - count ++; - - /* Slow out, stepping 1/2, then 1/4, ... */ - fraction = 2; - for (n = 0; n < factor; n++) { - frames[count].x = finish->x - (finish->x - mid->x) / fraction; - frames[count].y = finish->y - (finish->y - mid->y) / fraction; - count ++; - fraction = fraction * 2; - } - *nFrames = count; - } - - void - HistorySet(char movelist[][2*MOVE_LEN], int first, int last, int current) - { - /* Currently not implemented in WinBoard */ - } - - + /* + * WinBoard.c -- Windows NT front end to XBoard + * $Id: winboard.c,v 2.3 2003/11/25 05:25:20 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. + * + * XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess, + * which was written and is copyrighted by Wayne Christopher. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * ------------------------------------------------------------------------ + */ + + #include "config.h" + + #include + #include + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #if __GNUC__ + #include + #include + #endif + + #include "common.h" + #include "winboard.h" + #include "frontend.h" + #include "backend.h" + #include "moves.h" + #include "wclipbrd.h" + #include "wgamelist.h" + #include "wedittags.h" + #include "woptions.h" + #include "wsockerr.h" + #include "defaults.h" + + #include "wsnap.h" + + //void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); + + int myrandom(void); + void mysrandom(unsigned int seed); + + extern int whiteFlag, blackFlag; + Boolean flipClock = FALSE; + + void DisplayHoldingsCount(HDC hdc, int x, int y, int align, int copyNumber); + + typedef struct { + ChessSquare piece; + POINT pos; /* window coordinates of current pos */ + POINT lastpos; /* window coordinates of last pos - used for clipping */ + POINT from; /* board coordinates of the piece's orig pos */ + POINT to; /* board coordinates of the piece's new pos */ + } AnimInfo; + + static AnimInfo animInfo = { EmptySquare, {-1,-1}, {-1,-1}, {-1,-1} }; + + typedef struct { + POINT start; /* window coordinates of start pos */ + POINT pos; /* window coordinates of current pos */ + POINT lastpos; /* window coordinates of last pos - used for clipping */ + POINT from; /* board coordinates of the piece's orig pos */ + } DragInfo; + + static DragInfo dragInfo = { {-1,-1}, {-1,-1}, {-1,-1}, {-1,-1} }; + + typedef struct { + POINT sq[2]; /* board coordinates of from, to squares */ + } HighlightInfo; + + static HighlightInfo highlightInfo = { {{-1, -1}, {-1, -1}} }; + static HighlightInfo premoveHighlightInfo = { {{-1, -1}, {-1, -1}} }; + + /* Window class names */ + char szAppName[] = "WinBoard"; + char szConsoleName[] = "WBConsole"; + + /* Title bar text */ + char szTitle[] = "WinBoard"; + char szConsoleTitle[] = "ICS Interaction"; + + char *programName; + char *settingsFileName; + BOOLEAN saveSettingsOnExit; + char installDir[MSG_SIZ]; + + BoardSize boardSize; + BOOLEAN chessProgram; + static int boardX, boardY, consoleX, consoleY, consoleW, consoleH; + static int squareSize, lineGap, minorSize; + static int winWidth, winHeight; + static RECT messageRect, whiteRect, blackRect, leftLogoRect, rightLogoRect; // [HGM] logo + static int logoHeight = 0; + static char messageText[MESSAGE_TEXT_MAX]; + static int clockTimerEvent = 0; + static int loadGameTimerEvent = 0; + static int analysisTimerEvent = 0; + static DelayedEventCallback delayedTimerCallback; + static int delayedTimerEvent = 0; + static int buttonCount = 2; + char *icsTextMenuString; + char *icsNames; + char *firstChessProgramNames; + char *secondChessProgramNames; + + #define ARG_MAX 128*1024 /* [AS] For Roger Brown's very long list! */ + + #define PALETTESIZE 256 + + HINSTANCE hInst; /* current instance */ + HWND hwndMain = NULL; /* root window*/ + HWND hwndConsole = NULL; + BOOLEAN alwaysOnTop = FALSE; + RECT boardRect; + COLORREF lightSquareColor, darkSquareColor, whitePieceColor, + blackPieceColor, highlightSquareColor, premoveHighlightColor; + HPALETTE hPal; + ColorClass currentColorClass; + + HWND hCommPort = NULL; /* currently open comm port */ + static HWND hwndPause; /* pause button */ + static HBITMAP pieceBitmap[3][(int) BlackPawn]; /* [HGM] nr of bitmaps referred to bP in stead of wK */ + static HBRUSH lightSquareBrush, darkSquareBrush, + blackSquareBrush, /* [HGM] for band between board and holdings */ + whitePieceBrush, blackPieceBrush, iconBkgndBrush, outlineBrush; + static POINT gridEndpoints[(BOARD_SIZE + 1) * 4]; + static DWORD gridVertexCounts[(BOARD_SIZE + 1) * 2]; + static HPEN gridPen = NULL; + static HPEN highlightPen = NULL; + static HPEN premovePen = NULL; + static NPLOGPALETTE pLogPal; + static BOOL paletteChanged = FALSE; + static HICON iconWhite, iconBlack, iconCurrent; + static int doingSizing = FALSE; + static int lastSizing = 0; + static int prevStderrPort; + + /* [AS] Support for background textures */ + #define BACK_TEXTURE_MODE_DISABLED 0 + #define BACK_TEXTURE_MODE_PLAIN 1 + #define BACK_TEXTURE_MODE_FULL_RANDOM 2 + + static HBITMAP liteBackTexture = NULL; + static HBITMAP darkBackTexture = NULL; + static int liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN; + static int darkBackTextureMode = BACK_TEXTURE_MODE_PLAIN; + static int backTextureSquareSize = 0; + static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_SIZE][BOARD_SIZE]; + + #if __GNUC__ && !defined(_winmajor) + #define oldDialog 0 /* cygwin doesn't define _winmajor; mingw does */ + #else + #define oldDialog (_winmajor < 4) + #endif + + char *defaultTextAttribs[] = + { + COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ, + COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL, + COLOR_NONE + }; + + typedef struct { + char *name; + int squareSize; + int lineGap; + int smallLayout; + int tinyLayout; + int cliWidth, cliHeight; + } SizeInfo; + + SizeInfo sizeInfo[] = + { + { "tiny", 21, 0, 1, 1, 0, 0 }, + { "teeny", 25, 1, 1, 1, 0, 0 }, + { "dinky", 29, 1, 1, 1, 0, 0 }, + { "petite", 33, 1, 1, 1, 0, 0 }, + { "slim", 37, 2, 1, 0, 0, 0 }, + { "small", 40, 2, 1, 0, 0, 0 }, + { "mediocre", 45, 2, 1, 0, 0, 0 }, + { "middling", 49, 2, 0, 0, 0, 0 }, + { "average", 54, 2, 0, 0, 0, 0 }, + { "moderate", 58, 3, 0, 0, 0, 0 }, + { "medium", 64, 3, 0, 0, 0, 0 }, + { "bulky", 72, 3, 0, 0, 0, 0 }, + { "large", 80, 3, 0, 0, 0, 0 }, + { "big", 87, 3, 0, 0, 0, 0 }, + { "huge", 95, 3, 0, 0, 0, 0 }, + { "giant", 108, 3, 0, 0, 0, 0 }, + { "colossal", 116, 4, 0, 0, 0, 0 }, + { "titanic", 129, 4, 0, 0, 0, 0 }, + { NULL, 0, 0, 0, 0, 0, 0 } + }; + + #define MF(x) {x, {0, }, {0, }, 0} + MyFont fontRec[NUM_SIZES][NUM_FONTS] = + { + { MF(CLOCK_FONT_TINY), MF(MESSAGE_FONT_TINY), MF(COORD_FONT_TINY), MF(CONSOLE_FONT_TINY), MF(COMMENT_FONT_TINY), MF(EDITTAGS_FONT_TINY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_TEENY), MF(MESSAGE_FONT_TEENY), MF(COORD_FONT_TEENY), MF(CONSOLE_FONT_TEENY), MF(COMMENT_FONT_TEENY), MF(EDITTAGS_FONT_TEENY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_DINKY), MF(MESSAGE_FONT_DINKY), MF(COORD_FONT_DINKY), MF(CONSOLE_FONT_DINKY), MF(COMMENT_FONT_DINKY), MF(EDITTAGS_FONT_DINKY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_PETITE), MF(MESSAGE_FONT_PETITE), MF(COORD_FONT_PETITE), MF(CONSOLE_FONT_PETITE), MF(COMMENT_FONT_PETITE), MF(EDITTAGS_FONT_PETITE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_SLIM), MF(MESSAGE_FONT_SLIM), MF(COORD_FONT_SLIM), MF(CONSOLE_FONT_SLIM), MF(COMMENT_FONT_SLIM), MF(EDITTAGS_FONT_SLIM), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_SMALL), MF(MESSAGE_FONT_SMALL), MF(COORD_FONT_SMALL), MF(CONSOLE_FONT_SMALL), MF(COMMENT_FONT_SMALL), MF(EDITTAGS_FONT_SMALL), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MEDIOCRE), MF(MESSAGE_FONT_MEDIOCRE), MF(COORD_FONT_MEDIOCRE), MF(CONSOLE_FONT_MEDIOCRE), MF(COMMENT_FONT_MEDIOCRE), MF(EDITTAGS_FONT_MEDIOCRE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MIDDLING), MF(MESSAGE_FONT_MIDDLING), MF(COORD_FONT_MIDDLING), MF(CONSOLE_FONT_MIDDLING), MF(COMMENT_FONT_MIDDLING), MF(EDITTAGS_FONT_MIDDLING), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_AVERAGE), MF(MESSAGE_FONT_AVERAGE), MF(COORD_FONT_AVERAGE), MF(CONSOLE_FONT_AVERAGE), MF(COMMENT_FONT_AVERAGE), MF(EDITTAGS_FONT_AVERAGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MODERATE), MF(MESSAGE_FONT_MODERATE), MF(COORD_FONT_MODERATE), MF(CONSOLE_FONT_MODERATE), MF(COMMENT_FONT_MODERATE), MF(EDITTAGS_FONT_MODERATE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_MEDIUM), MF(MESSAGE_FONT_MEDIUM), MF(COORD_FONT_MEDIUM), MF(CONSOLE_FONT_MEDIUM), MF(COMMENT_FONT_MEDIUM), MF(EDITTAGS_FONT_MEDIUM), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_BULKY), MF(MESSAGE_FONT_BULKY), MF(COORD_FONT_BULKY), MF(CONSOLE_FONT_BULKY), MF(COMMENT_FONT_BULKY), MF(EDITTAGS_FONT_BULKY), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_LARGE), MF(MESSAGE_FONT_LARGE), MF(COORD_FONT_LARGE), MF(CONSOLE_FONT_LARGE), MF(COMMENT_FONT_LARGE), MF(EDITTAGS_FONT_LARGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_BIG), MF(MESSAGE_FONT_BIG), MF(COORD_FONT_BIG), MF(CONSOLE_FONT_BIG), MF(COMMENT_FONT_BIG), MF(EDITTAGS_FONT_BIG), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_HUGE), MF(MESSAGE_FONT_HUGE), MF(COORD_FONT_HUGE), MF(CONSOLE_FONT_HUGE), MF(COMMENT_FONT_HUGE), MF(EDITTAGS_FONT_HUGE), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_GIANT), MF(MESSAGE_FONT_GIANT), MF(COORD_FONT_GIANT), MF(CONSOLE_FONT_GIANT), MF(COMMENT_FONT_GIANT), MF(EDITTAGS_FONT_GIANT), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_COLOSSAL), MF(MESSAGE_FONT_COLOSSAL), MF(COORD_FONT_COLOSSAL), MF(CONSOLE_FONT_COLOSSAL), MF(COMMENT_FONT_COLOSSAL), MF(EDITTAGS_FONT_COLOSSAL), MF(MOVEHISTORY_FONT_ALL) }, + { MF(CLOCK_FONT_TITANIC), MF(MESSAGE_FONT_TITANIC), MF(COORD_FONT_TITANIC), MF(CONSOLE_FONT_TITANIC), MF(COMMENT_FONT_TITANIC), MF(EDITTAGS_FONT_TITANIC), MF(MOVEHISTORY_FONT_ALL) }, + }; + + MyFont *font[NUM_SIZES][NUM_FONTS]; + + typedef struct { + char *label; + int id; + HWND hwnd; + WNDPROC wndproc; + } MyButtonDesc; + + #define BUTTON_WIDTH (tinyLayout ? 16 : 32) + #define N_BUTTONS 5 + + MyButtonDesc buttonDesc[N_BUTTONS] = + { + {"<<", IDM_ToStart, NULL, NULL}, + {"<", IDM_Backward, NULL, NULL}, + {"P", IDM_Pause, NULL, NULL}, + {">", IDM_Forward, NULL, NULL}, + {">>", IDM_ToEnd, NULL, NULL}, + }; + + int tinyLayout = 0, smallLayout = 0; + #define MENU_BAR_ITEMS 6 + char *menuBarText[2][MENU_BAR_ITEMS+1] = { + { "&File", "&Mode", "&Action", "&Step", "&Options", "&Help", NULL }, + { "&F", "&M", "&A", "&S", "&O", "&H", NULL }, + }; + + + MySound sounds[(int)NSoundClasses]; + MyTextAttribs textAttribs[(int)NColorClasses]; + + MyColorizeAttribs colorizeAttribs[] = { + { (COLORREF)0, 0, "Shout Text" }, + { (COLORREF)0, 0, "SShout/CShout" }, + { (COLORREF)0, 0, "Channel 1 Text" }, + { (COLORREF)0, 0, "Channel Text" }, + { (COLORREF)0, 0, "Kibitz Text" }, + { (COLORREF)0, 0, "Tell Text" }, + { (COLORREF)0, 0, "Challenge Text" }, + { (COLORREF)0, 0, "Request Text" }, + { (COLORREF)0, 0, "Seek Text" }, + { (COLORREF)0, 0, "Normal Text" }, + { (COLORREF)0, 0, "None" } + }; + + + + static char *commentTitle; + static char *commentText; + static int commentIndex; + static Boolean editComment = FALSE; + HWND commentDialog = NULL; + BOOLEAN commentDialogUp = FALSE; + static int commentX, commentY, commentH, commentW; + + static char *analysisTitle; + static char *analysisText; + HWND analysisDialog = NULL; + BOOLEAN analysisDialogUp = FALSE; + static int analysisX, analysisY, analysisH, analysisW; + + char errorTitle[MSG_SIZ]; + char errorMessage[2*MSG_SIZ]; + HWND errorDialog = NULL; + BOOLEAN moveErrorMessageUp = FALSE; + BOOLEAN consoleEcho = TRUE; + CHARFORMAT consoleCF; + COLORREF consoleBackgroundColor; + + char *programVersion; + + #define CPReal 1 + #define CPComm 2 + #define CPSock 3 + #define CPRcmd 4 + typedef int CPKind; + + typedef struct { + CPKind kind; + HANDLE hProcess; + DWORD pid; + HANDLE hTo; + HANDLE hFrom; + SOCKET sock; + SOCKET sock2; /* stderr socket for OpenRcmd */ + } ChildProc; + + #define INPUT_SOURCE_BUF_SIZE 4096 + + typedef struct _InputSource { + CPKind kind; + HANDLE hFile; + SOCKET sock; + int lineByLine; + HANDLE hThread; + DWORD id; + char buf[INPUT_SOURCE_BUF_SIZE]; + char *next; + DWORD count; + int error; + InputCallback func; + struct _InputSource *second; /* for stderr thread on CPRcmd */ + VOIDSTAR closure; + } InputSource; + + InputSource *consoleInputSource; + + DCB dcb; + + /* forward */ + VOID ConsoleOutput(char* data, int length, int forceVisible); + VOID ConsoleCreate(); + LRESULT CALLBACK + ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + VOID ColorizeTextPopup(HWND hwnd, ColorClass cc); + VOID PrintCommSettings(FILE *f, char *name, DCB *dcb); + VOID ParseCommSettings(char *arg, DCB *dcb); + LRESULT CALLBACK + StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); + VOID APIENTRY MenuPopup(HWND hwnd, POINT pt, HMENU hmenu, UINT def); + void ParseIcsTextMenu(char *icsTextMenuString); + VOID PopUpMoveDialog(char firstchar); + VOID PopUpNameDialog(char firstchar); + VOID UpdateSampleText(HWND hDlg, int id, MyColorizeAttribs *mca); + + /* [AS] */ + int NewGameFRC(); + int GameListOptions(); + + HWND moveHistoryDialog = NULL; + BOOLEAN moveHistoryDialogUp = FALSE; + + WindowPlacement wpMoveHistory; + + HWND evalGraphDialog = NULL; + BOOLEAN evalGraphDialogUp = FALSE; + + WindowPlacement wpEvalGraph; + + HWND engineOutputDialog = NULL; + BOOLEAN engineOutputDialogUp = FALSE; + + WindowPlacement wpEngineOutput; + + VOID MoveHistoryPopUp(); + VOID MoveHistoryPopDown(); + VOID MoveHistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo ); + BOOL MoveHistoryIsUp(); + + VOID EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo ); + VOID EvalGraphPopUp(); + VOID EvalGraphPopDown(); + BOOL EvalGraphIsUp(); + + VOID EngineOutputPopUp(); + VOID EngineOutputPopDown(); + BOOL EngineOutputIsUp(); + VOID EngineOutputUpdate( FrontEndProgramStats * stats ); + + VOID GothicPopUp(char *title, VariantClass variant); + /* + * Setting "frozen" should disable all user input other than deleting + * the window. We do this while engines are initializing themselves. + */ + static int frozen = 0; + static int oldMenuItemState[MENU_BAR_ITEMS]; + void FreezeUI() + { + HMENU hmenu; + int i; + + if (frozen) return; + frozen = 1; + hmenu = GetMenu(hwndMain); + for (i=0; i screenWidth - 32) *x = 0; + if (*y > screenHeight - 32) *y = 0; + if (*x < 10) *x = 10; + if (*y < gap) *y = gap; + } + + BOOL + InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) + { + HWND hwnd; /* Main window handle. */ + int ibs; + WINDOWPLACEMENT wp; + char *filepart; + + hInst = hInstance; /* Store instance handle in our global variable */ + + if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) { + *filepart = NULLCHAR; + } else { + GetCurrentDirectory(MSG_SIZ, installDir); + } + gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise + InitAppData(lpCmdLine); /* Get run-time parameters */ + if (appData.debugMode) { + debugFP = fopen(appData.nameOfDebugFile, "w"); + setbuf(debugFP, NULL); + } + + InitBackEnd1(); + + // InitEngineUCI( installDir, &first ); // [HGM] incorporated in InitBackEnd1() + // InitEngineUCI( installDir, &second ); + + /* Create a main window for this application instance. */ + hwnd = CreateWindow(szAppName, szTitle, + (WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX), + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, + NULL, NULL, hInstance, NULL); + hwndMain = hwnd; + + /* If window could not be created, return "failure" */ + if (!hwnd) { + return (FALSE); + } + + /* [HGM] logo: Load logos if specified (must be done before InitDrawingSizes) */ + if( appData.firstLogo && appData.firstLogo[0] != NULLCHAR) { + first.programLogo = LoadImage( 0, appData.firstLogo, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + + if (first.programLogo == NULL && appData.debugMode) { + fprintf( debugFP, "Unable to load logo bitmap '%s'\n", appData.firstLogo ); + } + } else if(appData.autoLogo) { + if(appData.firstDirectory && appData.firstDirectory[0]) { + char buf[MSG_SIZ]; + sprintf(buf, "%s/logo.bmp", appData.firstDirectory); + first.programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + } + } + + if( appData.secondLogo && appData.secondLogo[0] != NULLCHAR) { + second.programLogo = LoadImage( 0, appData.secondLogo, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + + if (second.programLogo == NULL && appData.debugMode) { + fprintf( debugFP, "Unable to load logo bitmap '%s'\n", appData.secondLogo ); + } + } else if(appData.autoLogo) { + if(appData.secondDirectory && appData.secondDirectory[0]) { + char buf[MSG_SIZ]; + sprintf(buf, "%s\\logo.bmp", appData.secondDirectory); + second.programLogo = LoadImage( 0, buf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + } + } + + iconWhite = LoadIcon(hInstance, "icon_white"); + iconBlack = LoadIcon(hInstance, "icon_black"); + iconCurrent = iconWhite; + InitDrawingColors(); + screenHeight = GetSystemMetrics(SM_CYSCREEN); + screenWidth = GetSystemMetrics(SM_CXSCREEN); + for (ibs = (int) NUM_SIZES - 1; ibs >= 0; ibs--) { + /* Compute window size for each board size, and use the largest + size that fits on this screen as the default. */ + InitDrawingSizes((BoardSize)ibs, 0); + if (boardSize == (BoardSize)-1 && + winHeight <= screenHeight + - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYCAPTION) - 10 + && winWidth <= screenWidth) { + boardSize = (BoardSize)ibs; + } + } + + InitDrawingSizes(boardSize, 0); + InitMenuChecks(); + buttonCount = GetSystemMetrics(SM_CMOUSEBUTTONS); + + /* [AS] Load textures if specified */ + ZeroMemory( &backTextureSquareInfo, sizeof(backTextureSquareInfo) ); + + if( appData.liteBackTextureFile && appData.liteBackTextureFile[0] != NULLCHAR && appData.liteBackTextureFile[0] != '*' ) { + liteBackTexture = LoadImage( 0, appData.liteBackTextureFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + liteBackTextureMode = appData.liteBackTextureMode; + + if (liteBackTexture == NULL && appData.debugMode) { + fprintf( debugFP, "Unable to load lite texture bitmap '%s'\n", appData.liteBackTextureFile ); + } + } + + if( appData.darkBackTextureFile && appData.darkBackTextureFile[0] != NULLCHAR && appData.darkBackTextureFile[0] != '*' ) { + darkBackTexture = LoadImage( 0, appData.darkBackTextureFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ); + darkBackTextureMode = appData.darkBackTextureMode; + + if (darkBackTexture == NULL && appData.debugMode) { + fprintf( debugFP, "Unable to load dark texture bitmap '%s'\n", appData.darkBackTextureFile ); + } + } + + mysrandom( (unsigned) time(NULL) ); + - /* Make a console window if needed */ - if (appData.icsActive) { - ConsoleCreate(); - } - + /* [AS] Restore layout */ + if( wpMoveHistory.visible ) { + MoveHistoryPopUp(); + } + + if( wpEvalGraph.visible ) { + EvalGraphPopUp(); + } + + if( wpEngineOutput.visible ) { + EngineOutputPopUp(); + } + + InitBackEnd2(); + + /* Make the window visible; update its client area; and return "success" */ + EnsureOnScreen(&boardX, &boardY); + wp.length = sizeof(WINDOWPLACEMENT); + wp.flags = 0; + wp.showCmd = nCmdShow; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; + wp.rcNormalPosition.left = boardX; + wp.rcNormalPosition.right = boardX + winWidth; + wp.rcNormalPosition.top = boardY; + wp.rcNormalPosition.bottom = boardY + winHeight; + SetWindowPlacement(hwndMain, &wp); + + SetWindowPos(hwndMain, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + + #if 0 + /* [AS] Disable the FRC stuff if not playing the proper variant */ + if( gameInfo.variant != VariantFischeRandom ) { + EnableMenuItem( GetMenu(hwndMain), IDM_NewGameFRC, MF_GRAYED ); + } + #endif + if (hwndConsole) { + #if AOT_CONSOLE + SetWindowPos(hwndConsole, alwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); + #endif + ShowWindow(hwndConsole, nCmdShow); + } + UpdateWindow(hwnd); + + return TRUE; + + } + + + typedef enum { + ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, + ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings, + ArgSettingsFilename + } ArgType; + + typedef struct { + char *argName; + ArgType argType; + /*** + union { + String *pString; // ArgString + int *pInt; // ArgInt + float *pFloat; // ArgFloat + Boolean *pBoolean; // ArgBoolean + COLORREF *pColor; // ArgColor + ColorClass cc; // ArgAttribs + String *pFilename; // ArgFilename + BoardSize *pBoardSize; // ArgBoardSize + int whichFont; // ArgFont + DCB *pDCB; // ArgCommSettings + String *pFilename; // ArgSettingsFilename + } argLoc; + ***/ + LPVOID argLoc; + BOOL save; + } ArgDescriptor; + + int junk; + ArgDescriptor argDescriptors[] = { + /* positional arguments */ + { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, + { "", ArgNone, NULL }, + /* keyword arguments */ + { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE }, + { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE }, + { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE }, + { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE }, + { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE }, + { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE }, + { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE }, + { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE }, + { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE }, + { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE }, + { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE }, + { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE }, + { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE }, + { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE }, + { "initString", ArgString, (LPVOID) &appData.initString, FALSE }, + { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE }, + { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE }, + { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString, + FALSE }, + { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString, + FALSE }, + { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram, + FALSE }, + { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE }, + { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram, + FALSE }, + { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE }, + { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE }, + { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE }, + { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, + { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE }, + { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE }, + { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE }, + { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, + { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE }, + { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE }, + { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE }, + { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE }, + { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE }, + { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, + { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE }, + { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, + { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE }, + /*!!bitmapDirectory?*/ + { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, + { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE }, + { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, + { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE }, + { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE }, + { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE }, + { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE }, + { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE }, + { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE }, + { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE }, + { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE }, + { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE }, + { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, + { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE }, + { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE }, + { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE }, + { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE }, + { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE }, + { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, + { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, + { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, + { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE }, + { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, + { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE }, + { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE }, + { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE }, + { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, + { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE }, + { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE }, + { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE }, + { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE }, + { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, + { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE }, + { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, + { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE }, + { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE }, + { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE }, + { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE }, + { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE }, + { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, + { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE }, + { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, + { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE }, + { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, + { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE }, + { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, + { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE }, + { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE }, + { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE }, + { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, + { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE }, + { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE }, + { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE }, + { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE }, + { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE }, + { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, + { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE }, + { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE }, + { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE }, + { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, + { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE }, + { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE }, + { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE }, + { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, + { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE }, + { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE }, + { "st", ArgString, (LPVOID) &appData.searchTime, FALSE }, + { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, + { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE }, + { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE }, + { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE }, + { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, + { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE }, + { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE }, + { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE }, + { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, + { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE }, + { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE }, + { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE }, + { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, + { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE }, + { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE }, + { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE }, + { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, + { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE }, + { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE }, + { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE }, + { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, + { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE }, + { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE }, + { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE }, + { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, + { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE }, + { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, + FALSE }, /* only so that old WinBoard.ini files from betas can be read */ + { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE }, + { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE }, + { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE }, + { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE }, + { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE }, + { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE }, + { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE }, /* [AS] */ + { "boardSize", ArgBoardSize, (LPVOID) &boardSize, + TRUE }, /* must come after all fonts */ + { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE }, + { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves, + FALSE }, /* historical; kept only so old winboard.ini files will parse */ + { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE }, + { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE }, + { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, + { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE }, + { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE }, + { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE }, + { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, + { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE }, + { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE }, + { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE }, + { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, + { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE }, + { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE }, + { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE }, + { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, + { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE }, + { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE }, + { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE }, + { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, + { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE }, + { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE }, + { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE }, + { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, + { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE }, + { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE }, + { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE }, + { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, + { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE }, + #if 0 + { "cmailGameName", ArgString, (LPVOID) &appData.cmailGameName, FALSE }, + { "cmail", ArgString, (LPVOID) &appData.cmailGameName, FALSE }, + #endif + { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE }, + { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, + { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, + { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE }, + { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE }, + { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE }, + { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, + { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE }, + { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE }, + { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE }, + { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, + { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE }, + { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE }, + { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE }, + { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, + { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE }, + { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE }, + { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE }, + { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, + { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE }, + { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE }, + { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE }, + { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE }, + { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE }, + { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE }, + { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE }, + { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, + { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE }, + { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE }, + { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE }, + { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE }, + { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, + { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE }, + { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE }, + { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE}, + { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE}, + { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, + { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE}, + { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE}, + { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, + { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE}, + { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE }, + { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, + { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE }, + { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE }, + { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE }, + { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE }, + { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE }, + { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE }, + { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE }, + { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE }, + { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, + { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE }, + { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE }, + { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE }, + { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, + { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE }, + { "highlightLastMove", ArgBoolean, + (LPVOID) &appData.highlightLastMove, TRUE }, + { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE }, + { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, + { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE }, + { "highlightDragging", ArgBoolean, + (LPVOID) &appData.highlightDragging, TRUE }, + { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE }, + { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, + { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE }, + { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE }, + { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE }, + { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, + { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE }, + { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE }, + { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE }, + { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE }, + { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE }, + { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE }, + { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE }, + { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE }, + { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE }, + { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE }, + { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE }, + { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE }, + { "soundShout", ArgFilename, + (LPVOID) &textAttribs[ColorShout].sound.name, TRUE }, + { "soundSShout", ArgFilename, + (LPVOID) &textAttribs[ColorSShout].sound.name, TRUE }, + { "soundChannel1", ArgFilename, + (LPVOID) &textAttribs[ColorChannel1].sound.name, TRUE }, + { "soundChannel", ArgFilename, + (LPVOID) &textAttribs[ColorChannel].sound.name, TRUE }, + { "soundKibitz", ArgFilename, + (LPVOID) &textAttribs[ColorKibitz].sound.name, TRUE }, + { "soundTell", ArgFilename, + (LPVOID) &textAttribs[ColorTell].sound.name, TRUE }, + { "soundChallenge", ArgFilename, + (LPVOID) &textAttribs[ColorChallenge].sound.name, TRUE }, + { "soundRequest", ArgFilename, + (LPVOID) &textAttribs[ColorRequest].sound.name, TRUE }, + { "soundSeek", ArgFilename, + (LPVOID) &textAttribs[ColorSeek].sound.name, TRUE }, + { "soundMove", ArgFilename, (LPVOID) &sounds[(int)SoundMove].name, TRUE }, + { "soundBell", ArgFilename, (LPVOID) &sounds[(int)SoundBell].name, TRUE }, + { "soundIcsWin", ArgFilename, (LPVOID) &sounds[(int)SoundIcsWin].name,TRUE }, + { "soundIcsLoss", ArgFilename, + (LPVOID) &sounds[(int)SoundIcsLoss].name, TRUE }, + { "soundIcsDraw", ArgFilename, + (LPVOID) &sounds[(int)SoundIcsDraw].name, TRUE }, + { "soundIcsUnfinished", ArgFilename, + (LPVOID) &sounds[(int)SoundIcsUnfinished].name, TRUE}, + { "soundIcsAlarm", ArgFilename, + (LPVOID) &sounds[(int)SoundAlarm].name, TRUE }, + { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE }, + { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE }, + { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, + { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE }, + { "reuseChessPrograms", ArgBoolean, + (LPVOID) &appData.reuseFirst, FALSE }, /* backward compat only */ + { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE }, + { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE }, + { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, + { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE }, + { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE }, + { "x", ArgInt, (LPVOID) &boardX, TRUE }, + { "y", ArgInt, (LPVOID) &boardY, TRUE }, + { "icsX", ArgInt, (LPVOID) &consoleX, TRUE }, + { "icsY", ArgInt, (LPVOID) &consoleY, TRUE }, + { "icsW", ArgInt, (LPVOID) &consoleW, TRUE }, + { "icsH", ArgInt, (LPVOID) &consoleH, TRUE }, + { "analysisX", ArgInt, (LPVOID) &analysisX, TRUE }, + { "analysisY", ArgInt, (LPVOID) &analysisY, TRUE }, + { "analysisW", ArgInt, (LPVOID) &analysisW, TRUE }, + { "analysisH", ArgInt, (LPVOID) &analysisH, TRUE }, + { "commentX", ArgInt, (LPVOID) &commentX, TRUE }, + { "commentY", ArgInt, (LPVOID) &commentY, TRUE }, + { "commentW", ArgInt, (LPVOID) &commentW, TRUE }, + { "commentH", ArgInt, (LPVOID) &commentH, TRUE }, + { "tagsX", ArgInt, (LPVOID) &editTagsX, TRUE }, + { "tagsY", ArgInt, (LPVOID) &editTagsY, TRUE }, + { "tagsW", ArgInt, (LPVOID) &editTagsW, TRUE }, + { "tagsH", ArgInt, (LPVOID) &editTagsH, TRUE }, + { "gameListX", ArgInt, (LPVOID) &gameListX, TRUE }, + { "gameListY", ArgInt, (LPVOID) &gameListY, TRUE }, + { "gameListW", ArgInt, (LPVOID) &gameListW, TRUE }, + { "gameListH", ArgInt, (LPVOID) &gameListH, TRUE }, + { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, + { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE }, + { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE }, + { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE }, + { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE }, + { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE }, + { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE }, + { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE }, + { "icsNames", ArgString, (LPVOID) &icsNames, TRUE }, + { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames, + TRUE }, + { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames, + TRUE }, + { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE }, + { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE }, + { "variant", ArgString, (LPVOID) &appData.variant, FALSE }, + { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, FALSE }, + { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion,FALSE }, + { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE }, + { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE }, + { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, + { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE }, + /* [AS] New features */ + { "firstScoreAbs", ArgBoolean, (LPVOID) &appData.firstScoreIsAbsolute, FALSE }, + { "secondScoreAbs", ArgBoolean, (LPVOID) &appData.secondScoreIsAbsolute, FALSE }, + { "pgnExtendedInfo", ArgBoolean, (LPVOID) &appData.saveExtendedInfoInPGN, TRUE }, + { "hideThinkingFromHuman", ArgBoolean, (LPVOID) &appData.hideThinkingFromHuman, TRUE }, + { "liteBackTextureFile", ArgString, (LPVOID) &appData.liteBackTextureFile, TRUE }, + { "darkBackTextureFile", ArgString, (LPVOID) &appData.darkBackTextureFile, TRUE }, + { "liteBackTextureMode", ArgInt, (LPVOID) &appData.liteBackTextureMode, TRUE }, + { "darkBackTextureMode", ArgInt, (LPVOID) &appData.darkBackTextureMode, TRUE }, + { "renderPiecesWithFont", ArgString, (LPVOID) &appData.renderPiecesWithFont, TRUE }, + { "fontPieceToCharTable", ArgString, (LPVOID) &appData.fontToPieceTable, TRUE }, + { "fontPieceBackColorWhite", ArgColor, (LPVOID) &appData.fontBackColorWhite, TRUE }, + { "fontPieceForeColorWhite", ArgColor, (LPVOID) &appData.fontForeColorWhite, TRUE }, + { "fontPieceBackColorBlack", ArgColor, (LPVOID) &appData.fontBackColorBlack, TRUE }, + { "fontPieceForeColorBlack", ArgColor, (LPVOID) &appData.fontForeColorBlack, TRUE }, + { "fontPieceSize", ArgInt, (LPVOID) &appData.fontPieceSize, TRUE }, + { "overrideLineGap", ArgInt, (LPVOID) &appData.overrideLineGap, TRUE }, + { "adjudicateLossThreshold", ArgInt, (LPVOID) &appData.adjudicateLossThreshold, TRUE }, + { "delayBeforeQuit", ArgInt, (LPVOID) &appData.delayBeforeQuit, TRUE }, + { "delayAfterQuit", ArgInt, (LPVOID) &appData.delayAfterQuit, TRUE }, + { "nameOfDebugFile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE }, + { "debugfile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE }, + { "pgnEventHeader", ArgString, (LPVOID) &appData.pgnEventHeader, TRUE }, + { "defaultFrcPosition", ArgInt, (LPVOID) &appData.defaultFrcPosition, TRUE }, + { "gameListTags", ArgString, (LPVOID) &appData.gameListTags, TRUE }, + { "saveOutOfBookInfo", ArgBoolean, (LPVOID) &appData.saveOutOfBookInfo, TRUE }, + { "showEvalInMoveHistory", ArgBoolean, (LPVOID) &appData.showEvalInMoveHistory, TRUE }, + { "evalHistColorWhite", ArgColor, (LPVOID) &appData.evalHistColorWhite, TRUE }, + { "evalHistColorBlack", ArgColor, (LPVOID) &appData.evalHistColorBlack, TRUE }, + { "highlightMoveWithArrow", ArgBoolean, (LPVOID) &appData.highlightMoveWithArrow, TRUE }, + { "highlightArrowColor", ArgColor, (LPVOID) &appData.highlightArrowColor, TRUE }, + { "stickyWindows", ArgBoolean, (LPVOID) &appData.useStickyWindows, TRUE }, + { "adjudicateDrawMoves", ArgInt, (LPVOID) &appData.adjudicateDrawMoves, TRUE }, + { "autoDisplayComment", ArgBoolean, (LPVOID) &appData.autoDisplayComment, TRUE }, + { "autoDisplayTags", ArgBoolean, (LPVOID) &appData.autoDisplayTags, TRUE }, + { "firstIsUCI", ArgBoolean, (LPVOID) &appData.firstIsUCI, FALSE }, + { "fUCI", ArgTrue, (LPVOID) &appData.firstIsUCI, FALSE }, + { "secondIsUCI", ArgBoolean, (LPVOID) &appData.secondIsUCI, FALSE }, + { "sUCI", ArgTrue, (LPVOID) &appData.secondIsUCI, FALSE }, + { "firstHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.firstHasOwnBookUCI, FALSE }, + { "fNoOwnBookUCI", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE }, + { "secondHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.secondHasOwnBookUCI, FALSE }, + { "sNoOwnBookUCI", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE }, + { "polyglotDir", ArgFilename, (LPVOID) &appData.polyglotDir, TRUE }, + { "usePolyglotBook", ArgBoolean, (LPVOID) &appData.usePolyglotBook, TRUE }, + { "polyglotBook", ArgFilename, (LPVOID) &appData.polyglotBook, TRUE }, + { "defaultHashSize", ArgInt, (LPVOID) &appData.defaultHashSize, TRUE }, + { "defaultCacheSizeEGTB", ArgInt, (LPVOID) &appData.defaultCacheSizeEGTB, TRUE }, + { "defaultPathEGTB", ArgFilename, (LPVOID) &appData.defaultPathEGTB, TRUE }, + + /* [AS] Layout stuff */ + { "moveHistoryUp", ArgBoolean, (LPVOID) &wpMoveHistory.visible, TRUE }, + { "moveHistoryX", ArgInt, (LPVOID) &wpMoveHistory.x, TRUE }, + { "moveHistoryY", ArgInt, (LPVOID) &wpMoveHistory.y, TRUE }, + { "moveHistoryW", ArgInt, (LPVOID) &wpMoveHistory.width, TRUE }, + { "moveHistoryH", ArgInt, (LPVOID) &wpMoveHistory.height, TRUE }, + + { "evalGraphUp", ArgBoolean, (LPVOID) &wpEvalGraph.visible, TRUE }, + { "evalGraphX", ArgInt, (LPVOID) &wpEvalGraph.x, TRUE }, + { "evalGraphY", ArgInt, (LPVOID) &wpEvalGraph.y, TRUE }, + { "evalGraphW", ArgInt, (LPVOID) &wpEvalGraph.width, TRUE }, + { "evalGraphH", ArgInt, (LPVOID) &wpEvalGraph.height, TRUE }, + + { "engineOutputUp", ArgBoolean, (LPVOID) &wpEngineOutput.visible, TRUE }, + { "engineOutputX", ArgInt, (LPVOID) &wpEngineOutput.x, TRUE }, + { "engineOutputY", ArgInt, (LPVOID) &wpEngineOutput.y, TRUE }, + { "engineOutputW", ArgInt, (LPVOID) &wpEngineOutput.width, TRUE }, + { "engineOutputH", ArgInt, (LPVOID) &wpEngineOutput.height, TRUE }, + + /* [HGM] board-size, adjudication and misc. options */ + { "boardWidth", ArgInt, (LPVOID) &appData.NrFiles, TRUE }, + { "boardHeight", ArgInt, (LPVOID) &appData.NrRanks, TRUE }, + { "holdingsSize", ArgInt, (LPVOID) &appData.holdingsSize, TRUE }, + { "matchPause", ArgInt, (LPVOID) &appData.matchPause, TRUE }, + { "pieceToCharTable", ArgString, (LPVOID) &appData.pieceToCharTable, FALSE }, + { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE }, + { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE }, + { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE }, + { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE }, + { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE }, + { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE }, + { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE }, + { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE }, + { "trivialDraws", ArgBoolean, (LPVOID) &appData.trivialDraws, TRUE }, + { "ruleMoves", ArgInt, (LPVOID) &appData.ruleMoves, TRUE }, + { "repeatsToDraw", ArgInt, (LPVOID) &appData.drawRepeats, TRUE }, + { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE }, + { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE }, + { "userName", ArgString, (LPVOID) &appData.userName, FALSE }, + { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE }, + { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE }, + { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE }, + { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE }, + { "niceEngines", ArgInt, (LPVOID) &appData.niceEngines, TRUE }, + { "firstLogo", ArgFilename, (LPVOID) &appData.firstLogo, FALSE }, + { "secondLogo", ArgFilename, (LPVOID) &appData.secondLogo, FALSE }, + { "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE }, + + #ifdef ZIPPY + { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE }, + { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE }, + { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, + { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE }, + { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE }, + { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE }, + { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, + { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE }, + { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE }, + { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE }, + { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE }, + { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE }, + { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword, + FALSE }, + { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE }, + { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE }, + { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE }, + { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, + { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE }, + { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE }, + { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty, + FALSE }, + { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, + { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, + { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE }, + { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE }, + { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE }, + { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE }, + { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE }, + { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, + { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE }, + { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE }, + { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE }, + { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, + { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE }, + { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE }, + { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE }, + { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE }, + /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */ + { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE }, + #endif + /* [HGM] options for broadcasting and time odds */ + { "serverMoves", ArgString, (LPVOID) &appData.serverMovesName, FALSE }, + { "suppressLoadMoves", ArgBoolean, (LPVOID) &appData.suppressLoadMoves, FALSE }, + { "serverPause", ArgInt, (LPVOID) &appData.serverPause, FALSE }, + { "firstTimeOdds", ArgInt, (LPVOID) &appData.firstTimeOdds, FALSE }, + { "secondTimeOdds", ArgInt, (LPVOID) &appData.secondTimeOdds, FALSE }, + { "timeOddsMode", ArgInt, (LPVOID) &appData.timeOddsMode, TRUE }, + { "firstAccumulateTC", ArgInt, (LPVOID) &appData.firstAccumulateTC, FALSE }, + { "secondAccumulateTC", ArgInt, (LPVOID) &appData.secondAccumulateTC, FALSE }, + { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE }, + { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE }, ++ { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE }, + { NULL, ArgNone, NULL, FALSE } + }; + + + /* Kludge for indirection files on command line */ + char* lastIndirectionFilename; + ArgDescriptor argDescriptorIndirection = + { "", ArgSettingsFilename, (LPVOID) NULL, FALSE }; + + + VOID + ExitArgError(char *msg, char *badArg) + { + char buf[MSG_SIZ]; + + sprintf(buf, "%s %s", msg, badArg); + DisplayFatalError(buf, 0, 2); + exit(2); + } + + /* Command line font name parser. NULL name means do nothing. + Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b" + For backward compatibility, syntax without the colon is also + accepted, but font names with digits in them won't work in that case. + */ + VOID + ParseFontName(char *name, MyFontParams *mfp) + { + char *p, *q; + if (name == NULL) return; + p = name; + q = strchr(p, ':'); + if (q) { + if (q - p >= sizeof(mfp->faceName)) + ExitArgError("Font name too long:", name); + memcpy(mfp->faceName, p, q - p); + mfp->faceName[q - p] = NULLCHAR; + p = q + 1; + } else { + q = mfp->faceName; + while (*p && !isdigit(*p)) { + *q++ = *p++; + if (q - mfp->faceName >= sizeof(mfp->faceName)) + ExitArgError("Font name too long:", name); + } + while (q > mfp->faceName && q[-1] == ' ') q--; + *q = NULLCHAR; + } + if (!*p) ExitArgError("Font point size missing:", name); + mfp->pointSize = (float) atof(p); + mfp->bold = (strchr(p, 'b') != NULL); + mfp->italic = (strchr(p, 'i') != NULL); + mfp->underline = (strchr(p, 'u') != NULL); + mfp->strikeout = (strchr(p, 's') != NULL); + } + + /* Color name parser. + X version accepts X color names, but this one + handles only the #rrggbb form (hex) or rrr,ggg,bbb (decimal) */ + COLORREF + ParseColorName(char *name) + { + int red, green, blue, count; + char buf[MSG_SIZ]; + + count = sscanf(name, "#%2x%2x%2x", &red, &green, &blue); + if (count != 3) { + count = sscanf(name, "%3d%*[^0-9]%3d%*[^0-9]%3d", + &red, &green, &blue); + } + if (count != 3) { + sprintf(buf, "Can't parse color name %s", name); + DisplayError(buf, 0); + return RGB(0, 0, 0); + } + return PALETTERGB(red, green, blue); + } + + + void ParseAttribs(COLORREF *color, int *effects, char* argValue) + { + char *e = argValue; + int eff = 0; + + while (*e) { + if (*e == 'b') eff |= CFE_BOLD; + else if (*e == 'i') eff |= CFE_ITALIC; + else if (*e == 'u') eff |= CFE_UNDERLINE; + else if (*e == 's') eff |= CFE_STRIKEOUT; + else if (*e == '#' || isdigit(*e)) break; + e++; + } + *effects = eff; + *color = ParseColorName(e); + } + + + BoardSize + ParseBoardSize(char *name) + { + BoardSize bs = SizeTiny; + while (sizeInfo[bs].name != NULL) { + if (StrCaseCmp(name, sizeInfo[bs].name) == 0) return bs; + bs++; + } + ExitArgError("Unrecognized board size value", name); + return bs; /* not reached */ + } + + + char + StringGet(void *getClosure) + { + char **p = (char **) getClosure; + return *((*p)++); + } + + char + FileGet(void *getClosure) + { + int c; + FILE* f = (FILE*) getClosure; + + c = getc(f); + if (c == EOF) + return NULLCHAR; + else + return (char) c; + } + + /* Parse settings file named "name". If file found, return the + full name in fullname and return TRUE; else return FALSE */ + BOOLEAN + ParseSettingsFile(char *name, char fullname[MSG_SIZ]) + { + char *dummy; + FILE *f; + + if (SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy)) { + f = fopen(fullname, "r"); + if (f != NULL) { + ParseArgs(FileGet, f); + fclose(f); + return TRUE; + } + } + return FALSE; + } + + VOID + ParseArgs(GetFunc get, void *cl) + { + char argName[ARG_MAX]; + char argValue[ARG_MAX]; + ArgDescriptor *ad; + char start; + char *q; + int i, octval; + char ch; + int posarg = 0; + + ch = get(cl); + for (;;) { + while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl); + if (ch == NULLCHAR) break; + if (ch == ';') { + /* Comment to end of line */ + ch = get(cl); + while (ch != '\n' && ch != NULLCHAR) ch = get(cl); + continue; + } else if (ch == '/' || ch == '-') { + /* Switch */ + q = argName; + while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR && + ch != '\n' && ch != '\t') { + *q++ = ch; + ch = get(cl); + } + *q = NULLCHAR; + + for (ad = argDescriptors; ad->argName != NULL; ad++) + if (strcmp(ad->argName, argName + 1) == 0) break; + + if (ad->argName == NULL) + ExitArgError("Unrecognized argument", argName); + + } else if (ch == '@') { + /* Indirection file */ + ad = &argDescriptorIndirection; + ch = get(cl); + } else { + /* Positional argument */ + ad = &argDescriptors[posarg++]; + strcpy(argName, ad->argName); + } + + if (ad->argType == ArgTrue) { + *(Boolean *) ad->argLoc = TRUE; + continue; + } + if (ad->argType == ArgFalse) { + *(Boolean *) ad->argLoc = FALSE; + continue; + } + + while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl); + if (ch == NULLCHAR || ch == '\n') { + ExitArgError("No value provided for argument", argName); + } + q = argValue; + if (ch == '{') { + // Quoting with { }. No characters have to (or can) be escaped. + // Thus the string cannot contain a '}' character. + start = ch; + ch = get(cl); + while (start) { + switch (ch) { + case NULLCHAR: + start = NULLCHAR; + break; + + case '}': + ch = get(cl); + start = NULLCHAR; + break; + + default: + *q++ = ch; + ch = get(cl); + break; + } + } + } else if (ch == '\'' || ch == '"') { + // Quoting with ' ' or " ", with \ as escape character. + // Inconvenient for long strings that may contain Windows filenames. + start = ch; + ch = get(cl); + while (start) { + switch (ch) { + case NULLCHAR: + start = NULLCHAR; + break; + + default: + not_special: + *q++ = ch; + ch = get(cl); + break; + + case '\'': + case '\"': + if (ch == start) { + ch = get(cl); + start = NULLCHAR; + break; + } else { + goto not_special; + } + + case '\\': + if (ad->argType == ArgFilename + || ad->argType == ArgSettingsFilename) { + goto not_special; + } + ch = get(cl); + switch (ch) { + case NULLCHAR: + ExitArgError("Incomplete \\ escape in value for", argName); + break; + case 'n': + *q++ = '\n'; + ch = get(cl); + break; + case 'r': + *q++ = '\r'; + ch = get(cl); + break; + case 't': + *q++ = '\t'; + ch = get(cl); + break; + case 'b': + *q++ = '\b'; + ch = get(cl); + break; + case 'f': + *q++ = '\f'; + ch = get(cl); + break; + default: + octval = 0; + for (i = 0; i < 3; i++) { + if (ch >= '0' && ch <= '7') { + octval = octval*8 + (ch - '0'); + ch = get(cl); + } else { + break; + } + } + if (i > 0) { + *q++ = (char) octval; + } else { + *q++ = ch; + ch = get(cl); + } + break; + } + break; + } + } + } else { + while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') { + *q++ = ch; + ch = get(cl); + } + } + *q = NULLCHAR; + + switch (ad->argType) { + case ArgInt: + *(int *) ad->argLoc = atoi(argValue); + break; + + case ArgFloat: + *(float *) ad->argLoc = (float) atof(argValue); + break; + + case ArgString: + case ArgFilename: + *(char **) ad->argLoc = strdup(argValue); + break; + + case ArgSettingsFilename: + { + char fullname[MSG_SIZ]; + if (ParseSettingsFile(argValue, fullname)) { + if (ad->argLoc != NULL) { + *(char **) ad->argLoc = strdup(fullname); + } + } else { + if (ad->argLoc != NULL) { + } else { + ExitArgError("Failed to open indirection file", argValue); + } + } + } + break; + + case ArgBoolean: + switch (argValue[0]) { + case 't': + case 'T': + *(Boolean *) ad->argLoc = TRUE; + break; + case 'f': + case 'F': + *(Boolean *) ad->argLoc = FALSE; + break; + default: + ExitArgError("Unrecognized boolean argument value", argValue); + break; + } + break; + + case ArgColor: + *(COLORREF *)ad->argLoc = ParseColorName(argValue); + break; + + case ArgAttribs: { + ColorClass cc = (ColorClass)ad->argLoc; + ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue); + } + break; + + case ArgBoardSize: + *(BoardSize *)ad->argLoc = ParseBoardSize(argValue); + break; + + case ArgFont: + ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp); + break; + + case ArgCommSettings: + ParseCommSettings(argValue, &dcb); + break; + + case ArgNone: + ExitArgError("Unrecognized argument", argValue); + break; + } + } + } + + VOID + LFfromMFP(LOGFONT* lf, MyFontParams *mfp) + { + HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL); + lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5); + DeleteDC(hdc); + lf->lfWidth = 0; + lf->lfEscapement = 0; + lf->lfOrientation = 0; + lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL; + lf->lfItalic = mfp->italic; + lf->lfUnderline = mfp->underline; + lf->lfStrikeOut = mfp->strikeout; + lf->lfCharSet = DEFAULT_CHARSET; + lf->lfOutPrecision = OUT_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf->lfQuality = DEFAULT_QUALITY; + lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; + strcpy(lf->lfFaceName, mfp->faceName); + } + + VOID + CreateFontInMF(MyFont *mf) + { + LFfromMFP(&mf->lf, &mf->mfp); + if (mf->hf) DeleteObject(mf->hf); + mf->hf = CreateFontIndirect(&mf->lf); + } + + VOID + SetDefaultTextAttribs() + { + ColorClass cc; + for (cc = (ColorClass)0; cc < NColorClasses; cc++) { + ParseAttribs(&textAttribs[cc].color, + &textAttribs[cc].effects, + defaultTextAttribs[cc]); + } + } + + VOID + SetDefaultSounds() + { + ColorClass cc; + SoundClass sc; + for (cc = (ColorClass)0; cc < NColorClasses; cc++) { + textAttribs[cc].sound.name = strdup(""); + textAttribs[cc].sound.data = NULL; + } + for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { + sounds[sc].name = strdup(""); + sounds[sc].data = NULL; + } + sounds[(int)SoundBell].name = strdup(SOUND_BELL); + } + + VOID + LoadAllSounds() + { + ColorClass cc; + SoundClass sc; + for (cc = (ColorClass)0; cc < NColorClasses; cc++) { + MyLoadSound(&textAttribs[cc].sound); + } + for (sc = (SoundClass)0; sc < NSoundClasses; sc++) { + MyLoadSound(&sounds[sc]); + } + } + + VOID + InitAppData(LPSTR lpCmdLine) + { + int i, j; + char buf[ARG_MAX], currDir[MSG_SIZ]; + char *dummy, *p; + + programName = szAppName; + + /* Initialize to defaults */ + lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR); + darkSquareColor = ParseColorName(DARK_SQUARE_COLOR); + whitePieceColor = ParseColorName(WHITE_PIECE_COLOR); + blackPieceColor = ParseColorName(BLACK_PIECE_COLOR); + highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR); + premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR); + consoleBackgroundColor = ParseColorName(COLOR_BKGD); + SetDefaultTextAttribs(); + SetDefaultSounds(); + appData.movesPerSession = MOVES_PER_SESSION; + appData.initString = INIT_STRING; + appData.secondInitString = INIT_STRING; + appData.firstComputerString = COMPUTER_STRING; + appData.secondComputerString = COMPUTER_STRING; + appData.firstChessProgram = FIRST_CHESS_PROGRAM; + appData.secondChessProgram = SECOND_CHESS_PROGRAM; + appData.firstPlaysBlack = FALSE; + appData.noChessProgram = FALSE; + chessProgram = FALSE; + appData.firstHost = FIRST_HOST; + appData.secondHost = SECOND_HOST; + appData.firstDirectory = FIRST_DIRECTORY; + appData.secondDirectory = SECOND_DIRECTORY; + appData.bitmapDirectory = ""; + appData.remoteShell = REMOTE_SHELL; + appData.remoteUser = ""; + appData.timeDelay = TIME_DELAY; + appData.timeControl = TIME_CONTROL; + appData.timeIncrement = TIME_INCREMENT; + appData.icsActive = FALSE; + appData.icsHost = ""; + appData.icsPort = ICS_PORT; + appData.icsCommPort = ICS_COMM_PORT; + appData.icsLogon = ICS_LOGON; + appData.icsHelper = ""; + appData.useTelnet = FALSE; + appData.telnetProgram = TELNET_PROGRAM; + appData.gateway = ""; + appData.loadGameFile = ""; + appData.loadGameIndex = 0; + appData.saveGameFile = ""; + appData.autoSaveGames = FALSE; + appData.loadPositionFile = ""; + appData.loadPositionIndex = 1; + appData.savePositionFile = ""; + appData.matchMode = FALSE; + appData.matchGames = 0; + appData.monoMode = FALSE; + appData.debugMode = FALSE; + appData.clockMode = TRUE; + boardSize = (BoardSize) -1; /* determine by screen size */ + appData.Iconic = FALSE; /*unused*/ + appData.searchTime = ""; + appData.searchDepth = 0; + appData.showCoords = FALSE; + appData.ringBellAfterMoves = TRUE; /*obsolete in WinBoard*/ + appData.autoCallFlag = FALSE; + appData.flipView = FALSE; + appData.autoFlipView = TRUE; + appData.cmailGameName = ""; + appData.alwaysPromoteToQueen = FALSE; + appData.oldSaveStyle = FALSE; + appData.quietPlay = FALSE; + appData.showThinking = FALSE; + appData.ponderNextMove = TRUE; + appData.periodicUpdates = TRUE; + appData.popupExitMessage = TRUE; + appData.popupMoveErrors = FALSE; + appData.autoObserve = FALSE; + appData.autoComment = FALSE; + appData.animate = TRUE; + appData.animSpeed = 10; + appData.animateDragging = TRUE; + appData.highlightLastMove = TRUE; + appData.getMoveList = TRUE; + appData.testLegality = TRUE; + appData.premove = TRUE; + appData.premoveWhite = FALSE; + appData.premoveWhiteText = ""; + appData.premoveBlack = FALSE; + appData.premoveBlackText = ""; + appData.icsAlarm = TRUE; + appData.icsAlarmTime = 5000; + appData.autoRaiseBoard = TRUE; + appData.localLineEditing = TRUE; + appData.colorize = TRUE; + appData.reuseFirst = TRUE; + appData.reuseSecond = TRUE; + appData.blindfold = FALSE; ++ appData.icsEngineAnalyze = FALSE; + dcb.DCBlength = sizeof(DCB); + dcb.BaudRate = 9600; + dcb.fBinary = TRUE; + dcb.fParity = FALSE; + dcb.fOutxCtsFlow = FALSE; + dcb.fOutxDsrFlow = FALSE; + dcb.fDtrControl = DTR_CONTROL_ENABLE; + dcb.fDsrSensitivity = FALSE; + dcb.fTXContinueOnXoff = TRUE; + dcb.fOutX = FALSE; + dcb.fInX = FALSE; + dcb.fNull = FALSE; + dcb.fRtsControl = RTS_CONTROL_ENABLE; + dcb.fAbortOnError = FALSE; - dcb.wReserved = 0; ++ /* Microsoft SDK >= Feb. 2003 (MS VS >= 2002) */ ++ #if (defined(_MSC_VER) && _MSC_VER <= 1200) ++ //dcb.wReserved = 0; ++ #else ++ dcb.wReserved = 0; ++ #endif + dcb.ByteSize = 7; + dcb.Parity = SPACEPARITY; + dcb.StopBits = ONESTOPBIT; + settingsFileName = SETTINGS_FILE; + saveSettingsOnExit = TRUE; + boardX = CW_USEDEFAULT; + boardY = CW_USEDEFAULT; + consoleX = CW_USEDEFAULT; + consoleY = CW_USEDEFAULT; + consoleW = CW_USEDEFAULT; + consoleH = CW_USEDEFAULT; + analysisX = CW_USEDEFAULT; + analysisY = CW_USEDEFAULT; + analysisW = CW_USEDEFAULT; + analysisH = CW_USEDEFAULT; + commentX = CW_USEDEFAULT; + commentY = CW_USEDEFAULT; + commentW = CW_USEDEFAULT; + commentH = CW_USEDEFAULT; + editTagsX = CW_USEDEFAULT; + editTagsY = CW_USEDEFAULT; + editTagsW = CW_USEDEFAULT; + editTagsH = CW_USEDEFAULT; + gameListX = CW_USEDEFAULT; + gameListY = CW_USEDEFAULT; + gameListW = CW_USEDEFAULT; + gameListH = CW_USEDEFAULT; + icsTextMenuString = ICS_TEXT_MENU_DEFAULT; + icsNames = ICS_NAMES; + firstChessProgramNames = FCP_NAMES; + secondChessProgramNames = SCP_NAMES; + appData.initialMode = ""; + appData.variant = "normal"; + appData.firstProtocolVersion = PROTOVER; + appData.secondProtocolVersion = PROTOVER; + appData.showButtonBar = TRUE; + + /* [AS] New properties (see comments in header file) */ + appData.firstScoreIsAbsolute = FALSE; + appData.secondScoreIsAbsolute = FALSE; + appData.saveExtendedInfoInPGN = FALSE; + appData.hideThinkingFromHuman = FALSE; + appData.liteBackTextureFile = ""; + appData.liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN; + appData.darkBackTextureFile = ""; + appData.darkBackTextureMode = BACK_TEXTURE_MODE_PLAIN; + appData.renderPiecesWithFont = ""; + appData.fontToPieceTable = ""; + appData.fontBackColorWhite = 0; + appData.fontForeColorWhite = 0; + appData.fontBackColorBlack = 0; + appData.fontForeColorBlack = 0; + appData.fontPieceSize = 80; + appData.overrideLineGap = 1; + appData.adjudicateLossThreshold = 0; + appData.delayBeforeQuit = 0; + appData.delayAfterQuit = 0; + appData.nameOfDebugFile = "winboard.debug"; + appData.pgnEventHeader = "Computer Chess Game"; + appData.defaultFrcPosition = -1; + appData.gameListTags = GLT_DEFAULT_TAGS; + appData.saveOutOfBookInfo = TRUE; + appData.showEvalInMoveHistory = TRUE; + appData.evalHistColorWhite = ParseColorName( "#FFFFB0" ); + appData.evalHistColorBlack = ParseColorName( "#AD5D3D" ); + appData.highlightMoveWithArrow = FALSE; + appData.highlightArrowColor = ParseColorName( "#FFFF80" ); + appData.useStickyWindows = TRUE; + appData.adjudicateDrawMoves = 0; + appData.autoDisplayComment = TRUE; + appData.autoDisplayTags = TRUE; + appData.firstIsUCI = FALSE; + appData.secondIsUCI = FALSE; + appData.firstHasOwnBookUCI = TRUE; + appData.secondHasOwnBookUCI = TRUE; + appData.polyglotDir = ""; + appData.usePolyglotBook = FALSE; + appData.polyglotBook = ""; + appData.defaultHashSize = 64; + appData.defaultCacheSizeEGTB = 4; + appData.defaultPathEGTB = "c:\\egtb"; + + InitWindowPlacement( &wpMoveHistory ); + InitWindowPlacement( &wpEvalGraph ); + InitWindowPlacement( &wpEngineOutput ); + + /* [HGM] User-selectable board size, adjudication control, miscellaneous */ + appData.NrFiles = -1; + appData.NrRanks = -1; + appData.holdingsSize = -1; + appData.testClaims = FALSE; + appData.checkMates = FALSE; + appData.materialDraws= FALSE; + appData.trivialDraws = FALSE; + appData.ruleMoves = 51; + appData.drawRepeats = 6; + appData.matchPause = 10000; + appData.alphaRank = FALSE; + appData.allWhite = FALSE; + appData.upsideDown = FALSE; + appData.serverPause = 15; + appData.serverMovesName = NULL; + appData.suppressLoadMoves = FALSE; + appData.firstTimeOdds = 1; + appData.secondTimeOdds = 1; + appData.firstAccumulateTC = 1; // combine previous and current sessions + appData.secondAccumulateTC = 1; + appData.firstNPS = -1; // [HGM] nps: use wall-clock time + appData.secondNPS = -1; + appData.engineComments = 1; + appData.smpCores = 1; // [HGM] SMP: max nr of cores + appData.egtFormats = ""; + + #ifdef ZIPPY + appData.zippyTalk = ZIPPY_TALK; + appData.zippyPlay = ZIPPY_PLAY; + appData.zippyLines = ZIPPY_LINES; + appData.zippyPinhead = ZIPPY_PINHEAD; + appData.zippyPassword = ZIPPY_PASSWORD; + appData.zippyPassword2 = ZIPPY_PASSWORD2; + appData.zippyWrongPassword = ZIPPY_WRONG_PASSWORD; + appData.zippyAcceptOnly = ZIPPY_ACCEPT_ONLY; + appData.zippyUseI = ZIPPY_USE_I; + appData.zippyBughouse = ZIPPY_BUGHOUSE; + appData.zippyNoplayCrafty = ZIPPY_NOPLAY_CRAFTY; + appData.zippyGameEnd = ZIPPY_GAME_END; + appData.zippyGameStart = ZIPPY_GAME_START; + appData.zippyAdjourn = ZIPPY_ADJOURN; + appData.zippyAbort = ZIPPY_ABORT; + appData.zippyVariants = ZIPPY_VARIANTS; + appData.zippyMaxGames = ZIPPY_MAX_GAMES; + appData.zippyReplayTimeout = ZIPPY_REPLAY_TIMEOUT; + #endif + + /* Point font array elements to structures and + parse default font names */ + for (i=0; idef, &font[j][i]->mfp); + } + } + + /* Parse default settings file if any */ + if (ParseSettingsFile(settingsFileName, buf)) { + settingsFileName = strdup(buf); + } + + /* Parse command line */ + ParseArgs(StringGet, &lpCmdLine); + + /* [HGM] make sure board size is acceptable */ + if(appData.NrFiles > BOARD_SIZE || + appData.NrRanks > BOARD_SIZE ) + DisplayFatalError("Recompile with BOARD_SIZE > 12, to support this size", 0, 2); + + /* [HGM] After parsing the options from the .ini file, and overruling them + * with options from the command line, we now make an even higher priority + * overrule by WB options attached to the engine command line. This so that + * tournament managers can use WB options (such as /timeOdds) that follow + * the engines. + */ + if(appData.firstChessProgram != NULL) { + char *p = StrStr(appData.firstChessProgram, "WBopt"); + static char *f = "first"; + char buf[MSG_SIZ], *q = buf; + if(p != NULL) { // engine command line contains WinBoard options + sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first" + ParseArgs(StringGet, &q); + p[-1] = 0; // cut them offengine command line + } + } + // now do same for second chess program + if(appData.secondChessProgram != NULL) { + char *p = StrStr(appData.secondChessProgram, "WBopt"); + static char *s = "second"; + char buf[MSG_SIZ], *q = buf; + if(p != NULL) { // engine command line contains WinBoard options + sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first" + ParseArgs(StringGet, &q); + p[-1] = 0; // cut them offengine command line + } + } + + + /* Propagate options that affect others */ + if (appData.matchMode || appData.matchGames) chessProgram = TRUE; + if (appData.icsActive || appData.noChessProgram) { + chessProgram = FALSE; /* not local chess program mode */ + } + + /* Open startup dialog if needed */ + if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) || + (appData.icsActive && *appData.icsHost == NULLCHAR) || + (chessProgram && (*appData.firstChessProgram == NULLCHAR || + *appData.secondChessProgram == NULLCHAR))) { + FARPROC lpProc; + + lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst); + DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + + /* Make sure save files land in the right (?) directory */ + if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) { + appData.saveGameFile = strdup(buf); + } + if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) { + appData.savePositionFile = strdup(buf); + } + + /* Finish initialization for fonts and sounds */ + for (i=0; iargName != NULL; ad++) { + if (!ad->save) continue; + switch (ad->argType) { + case ArgString: + { + char *p = *(char **)ad->argLoc; + if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) { + /* Quote multiline values or \-containing values + with { } if possible */ + fprintf(f, "/%s={%s}\n", ad->argName, p); + } else { + /* Else quote with " " */ + fprintf(f, "/%s=\"", ad->argName); + while (*p) { + if (*p == '\n') fprintf(f, "\n"); + else if (*p == '\r') fprintf(f, "\\r"); + else if (*p == '\t') fprintf(f, "\\t"); + else if (*p == '\b') fprintf(f, "\\b"); + else if (*p == '\f') fprintf(f, "\\f"); + else if (*p < ' ') fprintf(f, "\\%03o", *p); + else if (*p == '\"') fprintf(f, "\\\""); + else if (*p == '\\') fprintf(f, "\\\\"); + else putc(*p, f); + p++; + } + fprintf(f, "\"\n"); + } + } + break; + case ArgInt: + fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc); + break; + case ArgFloat: + fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc); + break; + case ArgBoolean: + fprintf(f, "/%s=%s\n", ad->argName, + (*(Boolean *)ad->argLoc) ? "true" : "false"); + break; + case ArgTrue: + if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); + break; + case ArgFalse: + if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName); + break; + case ArgColor: + { + COLORREF color = *(COLORREF *)ad->argLoc; + fprintf(f, "/%s=#%02x%02x%02x\n", ad->argName, + color&0xff, (color>>8)&0xff, (color>>16)&0xff); + } + break; + case ArgAttribs: + { + MyTextAttribs* ta = &textAttribs[(ColorClass)ad->argLoc]; + fprintf(f, "/%s=\"%s%s%s%s%s#%02x%02x%02x\"\n", ad->argName, + (ta->effects & CFE_BOLD) ? "b" : "", + (ta->effects & CFE_ITALIC) ? "i" : "", + (ta->effects & CFE_UNDERLINE) ? "u" : "", + (ta->effects & CFE_STRIKEOUT) ? "s" : "", + (ta->effects) ? " " : "", + ta->color&0xff, (ta->color >> 8)&0xff, (ta->color >> 16)&0xff); + } + break; + case ArgFilename: + if (strchr(*(char **)ad->argLoc, '\"')) { + fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc); + } else { + fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc); + } + break; + case ArgBoardSize: + fprintf(f, "/%s=%s\n", ad->argName, + sizeInfo[*(BoardSize *)ad->argLoc].name); + break; + case ArgFont: + { + int bs; + for (bs=0; bsargLoc]->mfp; + fprintf(f, "/size=%s ", sizeInfo[bs].name); + fprintf(f, "/%s=\"%s:%g%s%s%s%s%s\"\n", + ad->argName, mfp->faceName, mfp->pointSize, + mfp->bold || mfp->italic || mfp->underline || mfp->strikeout ? " " : "", + mfp->bold ? "b" : "", + mfp->italic ? "i" : "", + mfp->underline ? "u" : "", + mfp->strikeout ? "s" : ""); + } + } + break; + case ArgCommSettings: + PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc); + } + } + fclose(f); + } + + + + /*---------------------------------------------------------------------------*\ + * + * GDI board drawing routines + * + \*---------------------------------------------------------------------------*/ + + /* [AS] Draw square using background texture */ + static void DrawTile( int dx, int dy, int dw, int dh, HDC dst, HDC src, int mode, int sx, int sy ) + { + XFORM x; + + if( mode == 0 ) { + return; /* Should never happen! */ + } + + SetGraphicsMode( dst, GM_ADVANCED ); + + switch( mode ) { + case 1: + /* Identity */ + break; + case 2: + /* X reflection */ + x.eM11 = -1.0; + x.eM12 = 0; + x.eM21 = 0; + x.eM22 = 1.0; + x.eDx = (FLOAT) dw + dx - 1; + x.eDy = 0; + dx = 0; + SetWorldTransform( dst, &x ); + break; + case 3: + /* Y reflection */ + x.eM11 = 1.0; + x.eM12 = 0; + x.eM21 = 0; + x.eM22 = -1.0; + x.eDx = 0; + x.eDy = (FLOAT) dh + dy - 1; + dy = 0; + SetWorldTransform( dst, &x ); + break; + case 4: + /* X/Y flip */ + x.eM11 = 0; + x.eM12 = 1.0; + x.eM21 = 1.0; + x.eM22 = 0; + x.eDx = (FLOAT) dx; + x.eDy = (FLOAT) dy; + dx = 0; + dy = 0; + SetWorldTransform( dst, &x ); + break; + } + + BitBlt( dst, dx, dy, dw, dh, src, sx, sy, SRCCOPY ); + + x.eM11 = 1.0; + x.eM12 = 0; + x.eM21 = 0; + x.eM22 = 1.0; + x.eDx = 0; + x.eDy = 0; + SetWorldTransform( dst, &x ); + + ModifyWorldTransform( dst, 0, MWT_IDENTITY ); + } + + /* [AS] [HGM] Make room for more piece types, so all pieces can be different */ + enum { + PM_WP = (int) WhitePawn, + PM_WN = (int) WhiteKnight, + PM_WB = (int) WhiteBishop, + PM_WR = (int) WhiteRook, + PM_WQ = (int) WhiteQueen, + PM_WF = (int) WhiteFerz, + PM_WW = (int) WhiteWazir, + PM_WE = (int) WhiteAlfil, + PM_WM = (int) WhiteMan, + PM_WO = (int) WhiteCannon, + PM_WU = (int) WhiteUnicorn, + PM_WH = (int) WhiteNightrider, + PM_WA = (int) WhiteAngel, + PM_WC = (int) WhiteMarshall, + PM_WAB = (int) WhiteCardinal, + PM_WD = (int) WhiteDragon, + PM_WL = (int) WhiteLance, + PM_WS = (int) WhiteCobra, + PM_WV = (int) WhiteFalcon, + PM_WSG = (int) WhiteSilver, + PM_WG = (int) WhiteGrasshopper, + PM_WK = (int) WhiteKing, + PM_BP = (int) BlackPawn, + PM_BN = (int) BlackKnight, + PM_BB = (int) BlackBishop, + PM_BR = (int) BlackRook, + PM_BQ = (int) BlackQueen, + PM_BF = (int) BlackFerz, + PM_BW = (int) BlackWazir, + PM_BE = (int) BlackAlfil, + PM_BM = (int) BlackMan, + PM_BO = (int) BlackCannon, + PM_BU = (int) BlackUnicorn, + PM_BH = (int) BlackNightrider, + PM_BA = (int) BlackAngel, + PM_BC = (int) BlackMarshall, + PM_BG = (int) BlackGrasshopper, + PM_BAB = (int) BlackCardinal, + PM_BD = (int) BlackDragon, + PM_BL = (int) BlackLance, + PM_BS = (int) BlackCobra, + PM_BV = (int) BlackFalcon, + PM_BSG = (int) BlackSilver, + PM_BK = (int) BlackKing + }; + + static HFONT hPieceFont = NULL; + static HBITMAP hPieceMask[(int) EmptySquare]; + static HBITMAP hPieceFace[(int) EmptySquare]; + static int fontBitmapSquareSize = 0; + static char pieceToFontChar[(int) EmptySquare] = + { 'p', 'n', 'b', 'r', 'q', + 'n', 'b', 'p', 'n', 'b', 'r', 'b', 'r', 'q', 'k', + 'k', 'o', 'm', 'v', 't', 'w', + 'v', 't', 'o', 'm', 'v', 't', 'v', 't', 'w', 'l', + 'l' }; + + extern BOOL SetCharTable( char *table, const char * map ); + /* [HGM] moved to backend.c */ + + static void SetPieceBackground( HDC hdc, COLORREF color, int mode ) + { + HBRUSH hbrush; + BYTE r1 = GetRValue( color ); + BYTE g1 = GetGValue( color ); + BYTE b1 = GetBValue( color ); + BYTE r2 = r1 / 2; + BYTE g2 = g1 / 2; + BYTE b2 = b1 / 2; + RECT rc; + + /* Create a uniform background first */ + hbrush = CreateSolidBrush( color ); + SetRect( &rc, 0, 0, squareSize, squareSize ); + FillRect( hdc, &rc, hbrush ); + DeleteObject( hbrush ); + + if( mode == 1 ) { + /* Vertical gradient, good for pawn, knight and rook, less for queen and king */ + int steps = squareSize / 2; + int i; + + for( i=0; i= (int)BlackPawn && appData.fontBackColorBlack != appData.fontForeColorBlack ) { + backColor = appData.fontBackColorBlack; + foreColor = appData.fontForeColorBlack; + } + + /* Mask */ + hbm = CreateCompatibleBitmap( hdc_window, squareSize, squareSize ); + + hbm_old = SelectObject( hdc, hbm ); + + rc.left = 0; + rc.top = 0; + rc.right = squareSize; + rc.bottom = squareSize; + + /* Step 1: background is now black */ + FillRect( hdc, &rc, GetStockObject(BLACK_BRUSH) ); + + GetTextExtentPoint32( hdc, &pieceToFontChar[index], 1, &sz ); + + pt.x = (squareSize - sz.cx) / 2; + pt.y = (squareSize - sz.cy) / 2; + + SetBkMode( hdc, TRANSPARENT ); + SetTextColor( hdc, chroma ); + /* Step 2: the piece has been drawn in purple, there are now black and purple in this bitmap */ + TextOut( hdc, pt.x, pt.y, &pieceToFontChar[appData.allWhite && index >= (int)BlackPawn ? index - (int)BlackPawn : index], 1 ); + + SelectObject( hdc, GetStockObject(WHITE_BRUSH) ); + /* Step 3: the area outside the piece is filled with white */ + // FloodFill( hdc, 0, 0, chroma ); + ExtFloodFill( hdc, 0, 0, 0, FLOODFILLSURFACE ); + ExtFloodFill( hdc, 0, squareSize-1, 0, FLOODFILLSURFACE ); // [HGM] fill from all 4 corners, for if piece too big + ExtFloodFill( hdc, squareSize-1, 0, 0, FLOODFILLSURFACE ); + ExtFloodFill( hdc, squareSize-1, squareSize-1, 0, FLOODFILLSURFACE ); + SelectObject( hdc, GetStockObject(BLACK_BRUSH) ); + /* + Step 4: this is the tricky part, the area inside the piece is filled with black, + but if the start point is not inside the piece we're lost! + There should be a better way to do this... if we could create a region or path + from the fill operation we would be fine for example. + */ + // FloodFill( hdc, squareSize / 2, squareSize / 2, RGB(0xFF,0xFF,0xFF) ); + ExtFloodFill( hdc, squareSize / 2, squareSize / 2, RGB(0xFF,0xFF,0xFF), FLOODFILLBORDER ); + + { /* [HGM] shave off edges of mask, in an attempt to correct for the fact that FloodFill does not work correctly under Win XP */ + HDC dc2 = CreateCompatibleDC( hdc_window ); + HBITMAP bm2 = CreateCompatibleBitmap( hdc_window, squareSize, squareSize ); + + SelectObject( dc2, bm2 ); + BitBlt( dc2, 0, 0, squareSize, squareSize, hdc, 0, 0, SRCCOPY ); // make copy + BitBlt( hdc, 0, 1, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 2, 1, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 1, 0, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + BitBlt( hdc, 1, 2, squareSize-2, squareSize-2, dc2, 1, 1, SRCPAINT ); + + DeleteDC( dc2 ); + DeleteObject( bm2 ); + } + + SetTextColor( hdc, 0 ); + /* + Step 5: some fonts have "disconnected" areas that are skipped by the fill: + draw the piece again in black for safety. + */ + TextOut( hdc, pt.x, pt.y, &pieceToFontChar[appData.allWhite && index >= (int)BlackPawn ? index - (int)BlackPawn : index], 1 ); + + SelectObject( hdc, hbm_old ); + + if( hPieceMask[index] != NULL ) { + DeleteObject( hPieceMask[index] ); + } + + hPieceMask[index] = hbm; + + /* Face */ + hbm = CreateCompatibleBitmap( hdc_window, squareSize, squareSize ); + + SelectObject( hdc, hbm ); + + { + HDC dc1 = CreateCompatibleDC( hdc_window ); + HDC dc2 = CreateCompatibleDC( hdc_window ); + HBITMAP bm2 = CreateCompatibleBitmap( hdc_window, squareSize, squareSize ); + + SelectObject( dc1, hPieceMask[index] ); + SelectObject( dc2, bm2 ); + FillRect( dc2, &rc, GetStockObject(WHITE_BRUSH) ); + BitBlt( dc2, 0, 0, squareSize, squareSize, dc1, 0, 0, SRCINVERT ); + + /* + Now dc2 contains the inverse of the piece mask, i.e. a mask that preserves + the piece background and deletes (makes transparent) the rest. + Thanks to that mask, we are free to paint the background with the greates + freedom, as we'll be able to mask off the unwanted parts when finished. + We use this, to make gradients and give the pieces a "roundish" look. + */ + SetPieceBackground( hdc, backColor, 2 ); + BitBlt( hdc, 0, 0, squareSize, squareSize, dc2, 0, 0, SRCAND ); + + DeleteDC( dc2 ); + DeleteDC( dc1 ); + DeleteObject( bm2 ); + } + + SetTextColor( hdc, foreColor ); + TextOut( hdc, pt.x, pt.y, &pieceToFontChar[appData.allWhite && index >= (int)BlackPawn ? index - (int)BlackPawn : index], 1 ); + + SelectObject( hdc, hbm_old ); + + if( hPieceFace[index] != NULL ) { + DeleteObject( hPieceFace[index] ); + } + + hPieceFace[index] = hbm; + } + + static int TranslatePieceToFontPiece( int piece ) + { + switch( piece ) { + case BlackPawn: + return PM_BP; + case BlackKnight: + return PM_BN; + case BlackBishop: + return PM_BB; + case BlackRook: + return PM_BR; + case BlackQueen: + return PM_BQ; + case BlackKing: + return PM_BK; + case WhitePawn: + return PM_WP; + case WhiteKnight: + return PM_WN; + case WhiteBishop: + return PM_WB; + case WhiteRook: + return PM_WR; + case WhiteQueen: + return PM_WQ; + case WhiteKing: + return PM_WK; + + case BlackAngel: + return PM_BA; + case BlackMarshall: + return PM_BC; + case BlackFerz: + return PM_BF; + case BlackNightrider: + return PM_BH; + case BlackAlfil: + return PM_BE; + case BlackWazir: + return PM_BW; + case BlackUnicorn: + return PM_BU; + case BlackCannon: + return PM_BO; + case BlackGrasshopper: + return PM_BG; + case BlackMan: + return PM_BM; + case BlackSilver: + return PM_BSG; + case BlackLance: + return PM_BL; + case BlackFalcon: + return PM_BV; + case BlackCobra: + return PM_BS; + case BlackCardinal: + return PM_BAB; + case BlackDragon: + return PM_BD; + + case WhiteAngel: + return PM_WA; + case WhiteMarshall: + return PM_WC; + case WhiteFerz: + return PM_WF; + case WhiteNightrider: + return PM_WH; + case WhiteAlfil: + return PM_WE; + case WhiteWazir: + return PM_WW; + case WhiteUnicorn: + return PM_WU; + case WhiteCannon: + return PM_WO; + case WhiteGrasshopper: + return PM_WG; + case WhiteMan: + return PM_WM; + case WhiteSilver: + return PM_WSG; + case WhiteLance: + return PM_WL; + case WhiteFalcon: + return PM_WV; + case WhiteCobra: + return PM_WS; + case WhiteCardinal: + return PM_WAB; + case WhiteDragon: + return PM_WD; + } + + return 0; + } + + void CreatePiecesFromFont() + { + LOGFONT lf; + HDC hdc_window = NULL; + HDC hdc = NULL; + HFONT hfont_old; + int fontHeight; + int i; + + if( fontBitmapSquareSize < 0 ) { + /* Something went seriously wrong in the past: do not try to recreate fonts! */ + return; + } + + if( appData.renderPiecesWithFont == NULL || appData.renderPiecesWithFont[0] == NULLCHAR || appData.renderPiecesWithFont[0] == '*' ) { + fontBitmapSquareSize = -1; + return; + } + + if( fontBitmapSquareSize != squareSize ) { + hdc_window = GetDC( hwndMain ); + hdc = CreateCompatibleDC( hdc_window ); + + if( hPieceFont != NULL ) { + DeleteObject( hPieceFont ); + } + else { + for( i=0; i<=(int)BlackKing; i++ ) { + hPieceMask[i] = NULL; + hPieceFace[i] = NULL; + } + } + + fontHeight = 75; + + if( appData.fontPieceSize >= 50 && appData.fontPieceSize <= 150 ) { + fontHeight = appData.fontPieceSize; + } + + fontHeight = (fontHeight * squareSize) / 100; + + lf.lfHeight = -MulDiv( fontHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72 ); + lf.lfWidth = 0; + lf.lfEscapement = 0; + lf.lfOrientation = 0; + lf.lfWeight = FW_NORMAL; + lf.lfItalic = 0; + lf.lfUnderline = 0; + lf.lfStrikeOut = 0; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfOutPrecision = OUT_DEFAULT_PRECIS; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfQuality = PROOF_QUALITY; + lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; + strncpy( lf.lfFaceName, appData.renderPiecesWithFont, sizeof(lf.lfFaceName) ); + lf.lfFaceName[ sizeof(lf.lfFaceName) - 1 ] = '\0'; + + hPieceFont = CreateFontIndirect( &lf ); + + if( hPieceFont == NULL ) { + fontBitmapSquareSize = -2; + } + else { + /* Setup font-to-piece character table */ + if( ! SetCharTable(pieceToFontChar, appData.fontToPieceTable) ) { + /* No (or wrong) global settings, try to detect the font */ + if( strstr(lf.lfFaceName,"Alpha") != NULL ) { + /* Alpha */ + SetCharTable(pieceToFontChar, "phbrqkojntwl"); + } + else if( strstr(lf.lfFaceName,"DiagramTT") != NULL ) { + /* DiagramTT* family */ + SetCharTable(pieceToFontChar, "PNLRQKpnlrqk"); + } + else if( strstr(lf.lfFaceName,"WinboardF") != NULL ) { + /* Fairy symbols */ + SetCharTable(pieceToFontChar, "PNBRQFEACWMOHIJGDVSLUKpnbrqfeacwmohijgdvsluk"); + } + else if( strstr(lf.lfFaceName,"GC2004D") != NULL ) { + /* Good Companion (Some characters get warped as literal :-( */ + char s[] = "1cmWG0ñueOS¯®oYI23wgQU"; + s[0]=0xB9; s[1]=0xA9; s[6]=0xB1; s[11]=0xBB; s[12]=0xAB; s[17]=0xB3; + SetCharTable(pieceToFontChar, s); + } + else { + /* Cases, Condal, Leipzig, Lucena, Marroquin, Merida, Usual */ + SetCharTable(pieceToFontChar, "pnbrqkomvtwl"); + } + } + + /* Create bitmaps */ + hfont_old = SelectObject( hdc, hPieceFont ); + #if 0 + CreatePieceMaskFromFont( hdc_window, hdc, PM_WP ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WN ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WR ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WQ ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WK ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BP ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BN ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BR ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BQ ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BK ); + + CreatePieceMaskFromFont( hdc_window, hdc, PM_WA ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WC ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WF ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WH ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WE ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WW ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WU ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WO ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WM ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WSG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WV ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WAB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WD ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WL ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_WS ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BA ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BC ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BF ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BH ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BE ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BW ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BU ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BO ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BM ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BSG ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BV ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BAB ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BD ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BL ); + CreatePieceMaskFromFont( hdc_window, hdc, PM_BS ); + #else + for(i=(int)WhitePawn; i<(int)EmptySquare; i++) /* [HGM] made a loop for this */ + if(PieceToChar((ChessSquare)i) != '.') /* skip unused pieces */ + CreatePieceMaskFromFont( hdc_window, hdc, i ); + #endif + SelectObject( hdc, hfont_old ); + + fontBitmapSquareSize = squareSize; + } + } + + if( hdc != NULL ) { + DeleteDC( hdc ); + } + + if( hdc_window != NULL ) { + ReleaseDC( hwndMain, hdc_window ); + } + } + + HBITMAP + DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix) + { + char name[128]; + + sprintf(name, "%s%d%s", piece, squareSize, suffix); + if (gameInfo.event && + strcmp(gameInfo.event, "Easter Egg Hunt") == 0 && + strcmp(name, "k80s") == 0) { + strcpy(name, "tim"); + } + return LoadBitmap(hinst, name); + } + + + /* Insert a color into the program's logical palette + structure. This code assumes the given color is + the result of the RGB or PALETTERGB macro, and it + knows how those macros work (which is documented). + */ + VOID + InsertInPalette(COLORREF color) + { + LPPALETTEENTRY pe = &(pLogPal->palPalEntry[pLogPal->palNumEntries]); + + if (pLogPal->palNumEntries++ >= PALETTESIZE) { + DisplayFatalError("Too many colors", 0, 1); + pLogPal->palNumEntries--; + return; + } + + pe->peFlags = (char) 0; + pe->peRed = (char) (0xFF & color); + pe->peGreen = (char) (0xFF & (color >> 8)); + pe->peBlue = (char) (0xFF & (color >> 16)); + return; + } + + + VOID + InitDrawingColors() + { + if (pLogPal == NULL) { + /* Allocate enough memory for a logical palette with + * PALETTESIZE entries and set the size and version fields + * of the logical palette structure. + */ + pLogPal = (NPLOGPALETTE) + LocalAlloc(LMEM_FIXED, (sizeof(LOGPALETTE) + + (sizeof(PALETTEENTRY) * (PALETTESIZE)))); + pLogPal->palVersion = 0x300; + } + pLogPal->palNumEntries = 0; + + InsertInPalette(lightSquareColor); + InsertInPalette(darkSquareColor); + InsertInPalette(whitePieceColor); + InsertInPalette(blackPieceColor); + InsertInPalette(highlightSquareColor); + InsertInPalette(premoveHighlightColor); + + /* create a logical color palette according the information + * in the LOGPALETTE structure. + */ + hPal = CreatePalette((LPLOGPALETTE) pLogPal); + + lightSquareBrush = CreateSolidBrush(lightSquareColor); + blackSquareBrush = CreateSolidBrush(blackPieceColor); + darkSquareBrush = CreateSolidBrush(darkSquareColor); + whitePieceBrush = CreateSolidBrush(whitePieceColor); + blackPieceBrush = CreateSolidBrush(blackPieceColor); + iconBkgndBrush = CreateSolidBrush(GetSysColor(COLOR_BACKGROUND)); + + /* [AS] Force rendering of the font-based pieces */ + if( fontBitmapSquareSize > 0 ) { + fontBitmapSquareSize = 0; + } + } + + + int + BoardWidth(int boardSize, int n) + { /* [HGM] argument n added to allow different width and height */ + int lineGap = sizeInfo[boardSize].lineGap; + + if( appData.overrideLineGap >= 0 && appData.overrideLineGap <= 5 ) { + lineGap = appData.overrideLineGap; + } + + return (n + 1) * lineGap + + n * sizeInfo[boardSize].squareSize; + } + + /* Respond to board resize by dragging edge */ + VOID + ResizeBoard(int newSizeX, int newSizeY, int flags) + { + BoardSize newSize = NUM_SIZES - 1; + static int recurse = 0; + if (IsIconic(hwndMain)) return; + if (recurse > 0) return; + recurse++; + while (newSize > 0) { + InitDrawingSizes(newSize, 0); + if(newSizeX >= sizeInfo[newSize].cliWidth || + newSizeY >= sizeInfo[newSize].cliHeight) break; + newSize--; + } + boardSize = newSize; + InitDrawingSizes(boardSize, flags); + recurse--; + } + + + + VOID + InitDrawingSizes(BoardSize boardSize, int flags) + { + int i, boardWidth, boardHeight; /* [HGM] height treated separately */ + ChessSquare piece; + static int oldBoardSize = -1, oldTinyLayout = 0; + HDC hdc; + SIZE clockSize, messageSize; + HFONT oldFont; + char buf[MSG_SIZ]; + char *str; + HMENU hmenu = GetMenu(hwndMain); + RECT crect, wrect; + int offby; + LOGBRUSH logbrush; + + /* [HGM] call with -1 uses old size (for if nr of files, ranks changes) */ + if(boardSize == (BoardSize)(-2) ) boardSize = oldBoardSize; + + tinyLayout = sizeInfo[boardSize].tinyLayout; + smallLayout = sizeInfo[boardSize].smallLayout; + squareSize = sizeInfo[boardSize].squareSize; + lineGap = sizeInfo[boardSize].lineGap; + minorSize = 0; /* [HGM] Kludge to see if demagnified pieces need to be shifted */ + + if( appData.overrideLineGap >= 0 && appData.overrideLineGap <= 5 ) { + lineGap = appData.overrideLineGap; + } + + if (tinyLayout != oldTinyLayout) { + long style = GetWindowLong(hwndMain, GWL_STYLE); + if (tinyLayout) { + style &= ~WS_SYSMENU; + InsertMenu(hmenu, IDM_Exit, MF_BYCOMMAND, IDM_Minimize, + "&Minimize\tCtrl+F4"); + } else { + style |= WS_SYSMENU; + RemoveMenu(hmenu, IDM_Minimize, MF_BYCOMMAND); + } + SetWindowLong(hwndMain, GWL_STYLE, style); + + for (i=0; menuBarText[tinyLayout][i]; i++) { + ModifyMenu(hmenu, i, MF_STRING|MF_BYPOSITION|MF_POPUP, + (UINT)GetSubMenu(hmenu, i), menuBarText[tinyLayout][i]); + } + DrawMenuBar(hwndMain); + } + + boardWidth = BoardWidth(boardSize, BOARD_WIDTH); + boardHeight = BoardWidth(boardSize, BOARD_HEIGHT); + + /* Get text area sizes */ + hdc = GetDC(hwndMain); + if (appData.clockMode) { + sprintf(buf, "White: %s", TimeString(23*60*60*1000L)); + } else { + sprintf(buf, "White"); + } + oldFont = SelectObject(hdc, font[boardSize][CLOCK_FONT]->hf); + GetTextExtentPoint(hdc, buf, strlen(buf), &clockSize); + SelectObject(hdc, font[boardSize][MESSAGE_FONT]->hf); + str = "We only care about the height here"; + GetTextExtentPoint(hdc, str, strlen(str), &messageSize); + SelectObject(hdc, oldFont); + ReleaseDC(hwndMain, hdc); + + /* Compute where everything goes */ + if(first.programLogo || second.programLogo) { + /* [HGM] logo: if either logo is on, reserve space for it */ + logoHeight = 2*clockSize.cy; + leftLogoRect.left = OUTER_MARGIN; + leftLogoRect.right = leftLogoRect.left + 4*clockSize.cy; + leftLogoRect.top = OUTER_MARGIN; + leftLogoRect.bottom = OUTER_MARGIN + logoHeight; + + rightLogoRect.right = OUTER_MARGIN + boardWidth; + rightLogoRect.left = rightLogoRect.right - 4*clockSize.cy; + rightLogoRect.top = OUTER_MARGIN; + rightLogoRect.bottom = OUTER_MARGIN + logoHeight; + + + blackRect.left = leftLogoRect.right; + blackRect.right = rightLogoRect.left; + blackRect.top = OUTER_MARGIN; + blackRect.bottom = blackRect.top + clockSize.cy; + + whiteRect.left = blackRect.left ; + whiteRect.right = blackRect.right; + whiteRect.top = blackRect.bottom; + whiteRect.bottom = leftLogoRect.bottom; + } else { + whiteRect.left = OUTER_MARGIN; + whiteRect.right = whiteRect.left + boardWidth/2 - INNER_MARGIN/2; + whiteRect.top = OUTER_MARGIN + logoHeight; + whiteRect.bottom = whiteRect.top + clockSize.cy; + + blackRect.left = whiteRect.right + INNER_MARGIN; + blackRect.right = blackRect.left + boardWidth/2 - 1; + blackRect.top = whiteRect.top; + blackRect.bottom = whiteRect.bottom; + } + + messageRect.left = OUTER_MARGIN + MESSAGE_LINE_LEFTMARGIN; + if (appData.showButtonBar) { + messageRect.right = OUTER_MARGIN + boardWidth // [HGM] logo: expressed independent of clock placement + - N_BUTTONS*BUTTON_WIDTH - MESSAGE_LINE_LEFTMARGIN; + } else { + messageRect.right = OUTER_MARGIN + boardWidth; + } + messageRect.top = whiteRect.bottom + INNER_MARGIN; + messageRect.bottom = messageRect.top + messageSize.cy; + + boardRect.left = OUTER_MARGIN; + boardRect.right = boardRect.left + boardWidth; + boardRect.top = messageRect.bottom + INNER_MARGIN; + boardRect.bottom = boardRect.top + boardHeight; + + sizeInfo[boardSize].cliWidth = boardRect.right + OUTER_MARGIN; + sizeInfo[boardSize].cliHeight = boardRect.bottom + OUTER_MARGIN; + winWidth = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN; + winHeight = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + + GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN; + GetWindowRect(hwndMain, &wrect); + SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, + SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); + /* compensate if menu bar wrapped */ + GetClientRect(hwndMain, &crect); + offby = boardRect.bottom + OUTER_MARGIN - crect.bottom; + winHeight += offby; + switch (flags) { + case WMSZ_TOPLEFT: + SetWindowPos(hwndMain, NULL, + wrect.right - winWidth, wrect.bottom - winHeight, + winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + break; + + case WMSZ_TOPRIGHT: + case WMSZ_TOP: + SetWindowPos(hwndMain, NULL, + wrect.left, wrect.bottom - winHeight, + winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + break; + + case WMSZ_BOTTOMLEFT: + case WMSZ_LEFT: + SetWindowPos(hwndMain, NULL, + wrect.right - winWidth, wrect.top, + winWidth, winHeight, SWP_NOCOPYBITS|SWP_NOZORDER); + break; + + case WMSZ_BOTTOMRIGHT: + case WMSZ_BOTTOM: + case WMSZ_RIGHT: + default: + SetWindowPos(hwndMain, NULL, 0, 0, winWidth, winHeight, + SWP_NOCOPYBITS|SWP_NOZORDER|SWP_NOMOVE); + break; + } + + hwndPause = NULL; + for (i = 0; i < N_BUTTONS; i++) { + if (buttonDesc[i].hwnd != NULL) { + DestroyWindow(buttonDesc[i].hwnd); + buttonDesc[i].hwnd = NULL; + } + if (appData.showButtonBar) { + buttonDesc[i].hwnd = + CreateWindow("BUTTON", buttonDesc[i].label, + WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, + boardRect.right - BUTTON_WIDTH*(N_BUTTONS-i), + messageRect.top, BUTTON_WIDTH, messageSize.cy, hwndMain, + (HMENU) buttonDesc[i].id, + (HINSTANCE) GetWindowLong(hwndMain, GWL_HINSTANCE), NULL); + if (tinyLayout) { + SendMessage(buttonDesc[i].hwnd, WM_SETFONT, + (WPARAM)font[boardSize][MESSAGE_FONT]->hf, + MAKELPARAM(FALSE, 0)); + } + if (buttonDesc[i].id == IDM_Pause) + hwndPause = buttonDesc[i].hwnd; + buttonDesc[i].wndproc = (WNDPROC) + SetWindowLong(buttonDesc[i].hwnd, GWL_WNDPROC, (LONG) ButtonProc); + } + } + if (gridPen != NULL) DeleteObject(gridPen); + if (highlightPen != NULL) DeleteObject(highlightPen); + if (premovePen != NULL) DeleteObject(premovePen); + if (lineGap != 0) { + logbrush.lbStyle = BS_SOLID; + logbrush.lbColor = RGB(0, 0, 0); /* grid pen color = black */ + gridPen = + ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, + lineGap, &logbrush, 0, NULL); + logbrush.lbColor = highlightSquareColor; + highlightPen = + ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, + lineGap, &logbrush, 0, NULL); + + logbrush.lbColor = premoveHighlightColor; + premovePen = + ExtCreatePen(PS_GEOMETRIC|PS_SOLID|PS_ENDCAP_FLAT|PS_JOIN_MITER, + lineGap, &logbrush, 0, NULL); + + /* [HGM] Loop had to be split in part for vert. and hor. lines */ + for (i = 0; i < BOARD_HEIGHT + 1; i++) { + gridEndpoints[i*2].x = boardRect.left + lineGap / 2; + gridEndpoints[i*2].y = gridEndpoints[i*2 + 1].y = + boardRect.top + lineGap / 2 + (i * (squareSize + lineGap)); + gridEndpoints[i*2 + 1].x = boardRect.left + lineGap / 2 + + BOARD_WIDTH * (squareSize + lineGap); + lineGap / 2 + (i * (squareSize + lineGap)); + gridVertexCounts[i*2] = gridVertexCounts[i*2 + 1] = 2; + } + for (i = 0; i < BOARD_WIDTH + 1; i++) { + gridEndpoints[i*2 + BOARD_HEIGHT*2 + 2].y = boardRect.top + lineGap / 2; + gridEndpoints[i*2 + BOARD_HEIGHT*2 + 2].x = + gridEndpoints[i*2 + 1 + BOARD_HEIGHT*2 + 2].x = boardRect.left + + lineGap / 2 + (i * (squareSize + lineGap)); + gridEndpoints[i*2 + 1 + BOARD_HEIGHT*2 + 2].y = + boardRect.top + BOARD_HEIGHT * (squareSize + lineGap); + gridVertexCounts[i*2] = gridVertexCounts[i*2 + 1] = 2; + } + } + + /* [HGM] Licensing requirement */ + #ifdef GOTHIC + if(gameInfo.variant == VariantGothic) GothicPopUp( GOTHIC, VariantGothic); else + #endif + #ifdef FALCON + if(gameInfo.variant == VariantFalcon) GothicPopUp( FALCON, VariantFalcon); else + #endif + GothicPopUp( "", VariantNormal); + + + /* if (boardSize == oldBoardSize) return; [HGM] variant might have changed */ + oldBoardSize = boardSize; + oldTinyLayout = tinyLayout; + + /* Load piece bitmaps for this board size */ + for (i=0; i<=2; i++) { + for (piece = WhitePawn; + (int) piece < (int) BlackPawn; + piece = (ChessSquare) ((int) piece + 1)) { + if (pieceBitmap[i][piece] != NULL) + DeleteObject(pieceBitmap[i][piece]); + } + } + + fontBitmapSquareSize = 0; /* [HGM] render: make sure pieces will be recreated, as we might need others now */ + // Orthodox Chess pieces + pieceBitmap[0][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "s"); + pieceBitmap[0][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "s"); + pieceBitmap[0][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "s"); + pieceBitmap[0][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "s"); + pieceBitmap[0][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "s"); + pieceBitmap[1][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "o"); + pieceBitmap[1][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "o"); + pieceBitmap[1][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "o"); + pieceBitmap[1][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "o"); + pieceBitmap[1][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "o"); + pieceBitmap[2][WhitePawn] = DoLoadBitmap(hInst, "p", squareSize, "w"); + pieceBitmap[2][WhiteKnight] = DoLoadBitmap(hInst, "n", squareSize, "w"); + pieceBitmap[2][WhiteBishop] = DoLoadBitmap(hInst, "b", squareSize, "w"); + pieceBitmap[2][WhiteRook] = DoLoadBitmap(hInst, "r", squareSize, "w"); + pieceBitmap[2][WhiteKing] = DoLoadBitmap(hInst, "k", squareSize, "w"); + if( !strcmp(appData.variant, "shogi") && (squareSize==72 || squareSize==49)) { + // in Shogi, Hijack the unused Queen for Lance + pieceBitmap[0][WhiteQueen] = DoLoadBitmap(hInst, "l", squareSize, "s"); + pieceBitmap[1][WhiteQueen] = DoLoadBitmap(hInst, "l", squareSize, "o"); + pieceBitmap[2][WhiteQueen] = DoLoadBitmap(hInst, "l", squareSize, "w"); + } else { + pieceBitmap[0][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "s"); + pieceBitmap[1][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "o"); + pieceBitmap[2][WhiteQueen] = DoLoadBitmap(hInst, "q", squareSize, "w"); + } + + if(squareSize <= 72 && squareSize >= 33) { + /* A & C are available in most sizes now */ + if(squareSize != 49 && squareSize != 72 && squareSize != 33) { // Vortex-like + pieceBitmap[0][WhiteAngel] = DoLoadBitmap(hInst, "a", squareSize, "s"); + pieceBitmap[1][WhiteAngel] = DoLoadBitmap(hInst, "a", squareSize, "o"); + pieceBitmap[2][WhiteAngel] = DoLoadBitmap(hInst, "a", squareSize, "w"); + pieceBitmap[0][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "s"); + pieceBitmap[1][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "o"); + pieceBitmap[2][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "w"); + pieceBitmap[0][WhiteCobra] = DoLoadBitmap(hInst, "cv", squareSize, "s"); + pieceBitmap[1][WhiteCobra] = DoLoadBitmap(hInst, "cv", squareSize, "o"); + pieceBitmap[2][WhiteCobra] = DoLoadBitmap(hInst, "cv", squareSize, "w"); + pieceBitmap[0][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "s"); + pieceBitmap[1][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "o"); + pieceBitmap[2][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "w"); + } else { // Smirf-like + pieceBitmap[0][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "s"); + pieceBitmap[1][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "o"); + pieceBitmap[2][WhiteAngel] = DoLoadBitmap(hInst, "aa", squareSize, "w"); + } + if(gameInfo.variant == VariantGothic) { // Vortex-like + pieceBitmap[0][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "s"); + pieceBitmap[1][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "o"); + pieceBitmap[2][WhiteMarshall] = DoLoadBitmap(hInst, "cv", squareSize, "w"); + } else { // WinBoard standard + pieceBitmap[0][WhiteMarshall] = DoLoadBitmap(hInst, "c", squareSize, "s"); + pieceBitmap[1][WhiteMarshall] = DoLoadBitmap(hInst, "c", squareSize, "o"); + pieceBitmap[2][WhiteMarshall] = DoLoadBitmap(hInst, "c", squareSize, "w"); + } + } + + + if(squareSize==72 || squareSize==49 || squareSize==33) { /* experiment with some home-made bitmaps */ + pieceBitmap[0][WhiteFerz] = DoLoadBitmap(hInst, "f", squareSize, "s"); + pieceBitmap[1][WhiteFerz] = DoLoadBitmap(hInst, "f", squareSize, "o"); + pieceBitmap[2][WhiteFerz] = DoLoadBitmap(hInst, "f", squareSize, "w"); + pieceBitmap[0][WhiteWazir] = DoLoadBitmap(hInst, "w", squareSize, "s"); + pieceBitmap[1][WhiteWazir] = DoLoadBitmap(hInst, "w", squareSize, "o"); + pieceBitmap[2][WhiteWazir] = DoLoadBitmap(hInst, "w", squareSize, "w"); + pieceBitmap[0][WhiteAlfil] = DoLoadBitmap(hInst, "e", squareSize, "s"); + pieceBitmap[1][WhiteAlfil] = DoLoadBitmap(hInst, "e", squareSize, "o"); + pieceBitmap[2][WhiteAlfil] = DoLoadBitmap(hInst, "e", squareSize, "w"); + pieceBitmap[0][WhiteMan] = DoLoadBitmap(hInst, "m", squareSize, "s"); + pieceBitmap[1][WhiteMan] = DoLoadBitmap(hInst, "m", squareSize, "o"); + pieceBitmap[2][WhiteMan] = DoLoadBitmap(hInst, "m", squareSize, "w"); + pieceBitmap[0][WhiteCardinal] = DoLoadBitmap(hInst, "a", squareSize, "s"); + pieceBitmap[1][WhiteCardinal] = DoLoadBitmap(hInst, "a", squareSize, "o"); + pieceBitmap[2][WhiteCardinal] = DoLoadBitmap(hInst, "a", squareSize, "w"); + pieceBitmap[0][WhiteDragon] = DoLoadBitmap(hInst, "dk", squareSize, "s"); + pieceBitmap[1][WhiteDragon] = DoLoadBitmap(hInst, "dk", squareSize, "o"); + pieceBitmap[2][WhiteDragon] = DoLoadBitmap(hInst, "dk", squareSize, "w"); + pieceBitmap[0][WhiteFalcon] = DoLoadBitmap(hInst, "v", squareSize, "s"); + pieceBitmap[1][WhiteFalcon] = DoLoadBitmap(hInst, "v", squareSize, "o"); + pieceBitmap[2][WhiteFalcon] = DoLoadBitmap(hInst, "v", squareSize, "w"); + pieceBitmap[0][WhiteCobra] = DoLoadBitmap(hInst, "s", squareSize, "s"); + pieceBitmap[1][WhiteCobra] = DoLoadBitmap(hInst, "s", squareSize, "o"); + pieceBitmap[2][WhiteCobra] = DoLoadBitmap(hInst, "s", squareSize, "w"); + pieceBitmap[0][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "s"); + pieceBitmap[1][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "o"); + pieceBitmap[2][WhiteLance] = DoLoadBitmap(hInst, "l", squareSize, "w"); + pieceBitmap[0][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "s"); + pieceBitmap[1][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "o"); + pieceBitmap[2][WhiteUnicorn] = DoLoadBitmap(hInst, "u", squareSize, "w"); + + if(gameInfo.variant == VariantShogi) { /* promoted Gold represemtations */ + pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "s"); + pieceBitmap[1][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "o"); + pieceBitmap[2][WhiteCannon] = DoLoadBitmap(hInst, "w", squareSize, "w"); + pieceBitmap[0][WhiteNightrider] = DoLoadBitmap(hInst, "wn", squareSize, "s"); + pieceBitmap[1][WhiteNightrider] = DoLoadBitmap(hInst, "wn", squareSize, "o"); + pieceBitmap[2][WhiteNightrider] = DoLoadBitmap(hInst, "w", squareSize, "w"); + pieceBitmap[0][WhiteSilver] = DoLoadBitmap(hInst, "ws", squareSize, "s"); + pieceBitmap[1][WhiteSilver] = DoLoadBitmap(hInst, "ws", squareSize, "o"); + pieceBitmap[2][WhiteSilver] = DoLoadBitmap(hInst, "w", squareSize, "w"); + pieceBitmap[0][WhiteGrasshopper] = DoLoadBitmap(hInst, "wl", squareSize, "s"); + pieceBitmap[1][WhiteGrasshopper] = DoLoadBitmap(hInst, "wl", squareSize, "o"); + pieceBitmap[2][WhiteGrasshopper] = DoLoadBitmap(hInst, "w", squareSize, "w"); + } else { + pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "o", squareSize, "s"); + pieceBitmap[1][WhiteCannon] = DoLoadBitmap(hInst, "o", squareSize, "o"); + pieceBitmap[2][WhiteCannon] = DoLoadBitmap(hInst, "o", squareSize, "w"); + pieceBitmap[0][WhiteNightrider] = DoLoadBitmap(hInst, "h", squareSize, "s"); + pieceBitmap[1][WhiteNightrider] = DoLoadBitmap(hInst, "h", squareSize, "o"); + pieceBitmap[2][WhiteNightrider] = DoLoadBitmap(hInst, "h", squareSize, "w"); + pieceBitmap[0][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "s"); + pieceBitmap[1][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "o"); + pieceBitmap[2][WhiteSilver] = DoLoadBitmap(hInst, "cv", squareSize, "w"); + pieceBitmap[0][WhiteGrasshopper] = DoLoadBitmap(hInst, "g", squareSize, "s"); + pieceBitmap[1][WhiteGrasshopper] = DoLoadBitmap(hInst, "g", squareSize, "o"); + pieceBitmap[2][WhiteGrasshopper] = DoLoadBitmap(hInst, "g", squareSize, "w"); + } + + } else { /* other size, no special bitmaps available. Use smaller symbols */ + if((int)boardSize < 2) minorSize = sizeInfo[0].squareSize; + else minorSize = sizeInfo[(int)boardSize - 2].squareSize; + pieceBitmap[0][WhiteNightrider] = DoLoadBitmap(hInst, "n", minorSize, "s"); + pieceBitmap[1][WhiteNightrider] = DoLoadBitmap(hInst, "n", minorSize, "o"); + pieceBitmap[2][WhiteNightrider] = DoLoadBitmap(hInst, "n", minorSize, "w"); + pieceBitmap[0][WhiteCardinal] = DoLoadBitmap(hInst, "b", minorSize, "s"); + pieceBitmap[1][WhiteCardinal] = DoLoadBitmap(hInst, "b", minorSize, "o"); + pieceBitmap[2][WhiteCardinal] = DoLoadBitmap(hInst, "b", minorSize, "w"); + pieceBitmap[0][WhiteDragon] = DoLoadBitmap(hInst, "r", minorSize, "s"); + pieceBitmap[1][WhiteDragon] = DoLoadBitmap(hInst, "r", minorSize, "o"); + pieceBitmap[2][WhiteDragon] = DoLoadBitmap(hInst, "r", minorSize, "w"); + pieceBitmap[0][WhiteGrasshopper] = DoLoadBitmap(hInst, "q", minorSize, "s"); + pieceBitmap[1][WhiteGrasshopper] = DoLoadBitmap(hInst, "q", minorSize, "o"); + pieceBitmap[2][WhiteGrasshopper] = DoLoadBitmap(hInst, "q", minorSize, "w"); + } + + + if(gameInfo.variant == VariantShogi && squareSize == 58) + /* special Shogi support in this size */ + { for (i=0; i<=2; i++) { /* replace all bitmaps */ + for (piece = WhitePawn; + (int) piece < (int) BlackPawn; + piece = (ChessSquare) ((int) piece + 1)) { + if (pieceBitmap[i][piece] != NULL) + DeleteObject(pieceBitmap[i][piece]); + } + } + pieceBitmap[0][WhitePawn] = DoLoadBitmap(hInst, "sp", squareSize, "o"); + pieceBitmap[0][WhiteKnight] = DoLoadBitmap(hInst, "sn", squareSize, "o"); + pieceBitmap[0][WhiteBishop] = DoLoadBitmap(hInst, "sb", squareSize, "o"); + pieceBitmap[0][WhiteRook] = DoLoadBitmap(hInst, "sr", squareSize, "o"); + pieceBitmap[0][WhiteQueen] = DoLoadBitmap(hInst, "sl", squareSize, "o"); + pieceBitmap[0][WhiteKing] = DoLoadBitmap(hInst, "sk", squareSize, "o"); + pieceBitmap[0][WhiteFerz] = DoLoadBitmap(hInst, "sf", squareSize, "o"); + pieceBitmap[0][WhiteWazir] = DoLoadBitmap(hInst, "sw", squareSize, "o"); + pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "su", squareSize, "o"); + pieceBitmap[0][WhiteNightrider] = DoLoadBitmap(hInst, "sh", squareSize, "o"); + pieceBitmap[0][WhiteCardinal] = DoLoadBitmap(hInst, "sa", squareSize, "o"); + pieceBitmap[0][WhiteDragon] = DoLoadBitmap(hInst, "sc", squareSize, "o"); + pieceBitmap[0][WhiteGrasshopper] = DoLoadBitmap(hInst, "sg", squareSize, "o"); + pieceBitmap[0][WhiteSilver] = DoLoadBitmap(hInst, "ss", squareSize, "o"); + pieceBitmap[1][WhitePawn] = DoLoadBitmap(hInst, "sp", squareSize, "o"); + pieceBitmap[1][WhiteKnight] = DoLoadBitmap(hInst, "sn", squareSize, "o"); + pieceBitmap[1][WhiteBishop] = DoLoadBitmap(hInst, "sb", squareSize, "o"); + pieceBitmap[1][WhiteRook] = DoLoadBitmap(hInst, "sr", squareSize, "o"); + pieceBitmap[1][WhiteQueen] = DoLoadBitmap(hInst, "sl", squareSize, "o"); + pieceBitmap[1][WhiteKing] = DoLoadBitmap(hInst, "sk", squareSize, "o"); + pieceBitmap[1][WhiteFerz] = DoLoadBitmap(hInst, "sf", squareSize, "o"); + pieceBitmap[1][WhiteWazir] = DoLoadBitmap(hInst, "sw", squareSize, "o"); + pieceBitmap[1][WhiteCannon] = DoLoadBitmap(hInst, "su", squareSize, "o"); + pieceBitmap[1][WhiteNightrider] = DoLoadBitmap(hInst, "sh", squareSize, "o"); + pieceBitmap[1][WhiteCardinal] = DoLoadBitmap(hInst, "sa", squareSize, "o"); + pieceBitmap[1][WhiteDragon] = DoLoadBitmap(hInst, "sc", squareSize, "o"); + pieceBitmap[1][WhiteGrasshopper] = DoLoadBitmap(hInst, "sg", squareSize, "o"); + pieceBitmap[1][WhiteSilver] = DoLoadBitmap(hInst, "ss", squareSize, "o"); + pieceBitmap[2][WhitePawn] = DoLoadBitmap(hInst, "sp", squareSize, "w"); + pieceBitmap[2][WhiteKnight] = DoLoadBitmap(hInst, "sn", squareSize, "w"); + pieceBitmap[2][WhiteBishop] = DoLoadBitmap(hInst, "sr", squareSize, "w"); + pieceBitmap[2][WhiteRook] = DoLoadBitmap(hInst, "sr", squareSize, "w"); + pieceBitmap[2][WhiteQueen] = DoLoadBitmap(hInst, "sl", squareSize, "w"); + pieceBitmap[2][WhiteKing] = DoLoadBitmap(hInst, "sk", squareSize, "w"); + pieceBitmap[2][WhiteFerz] = DoLoadBitmap(hInst, "sw", squareSize, "w"); + pieceBitmap[2][WhiteWazir] = DoLoadBitmap(hInst, "sw", squareSize, "w"); + pieceBitmap[2][WhiteCannon] = DoLoadBitmap(hInst, "sp", squareSize, "w"); + pieceBitmap[2][WhiteNightrider] = DoLoadBitmap(hInst, "sn", squareSize, "w"); + pieceBitmap[2][WhiteCardinal] = DoLoadBitmap(hInst, "sr", squareSize, "w"); + pieceBitmap[2][WhiteDragon] = DoLoadBitmap(hInst, "sr", squareSize, "w"); + pieceBitmap[2][WhiteGrasshopper] = DoLoadBitmap(hInst, "sl", squareSize, "w"); + pieceBitmap[2][WhiteSilver] = DoLoadBitmap(hInst, "sw", squareSize, "w"); + minorSize = 0; + } + } + + HBITMAP + PieceBitmap(ChessSquare p, int kind) + { + if ((int) p >= (int) BlackPawn) + p = (ChessSquare) ((int) p - (int) BlackPawn + (int) WhitePawn); + + return pieceBitmap[kind][(int) p]; + } + + /***************************************************************/ + + #define MIN(a,b) (((a) < (b)) ? (a) : (b)) + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) + /* + #define MIN3(a,b,c) (((a) < (b) && (a) < (c)) ? (a) : (((b) < (a) && (b) < (c)) ? (b) : (c))) + #define MAX3(a,b,c) (((a) > (b) && (a) > (c)) ? (a) : (((b) > (a) && (b) > (c)) ? (b) : (c))) + */ + + VOID + SquareToPos(int row, int column, int * x, int * y) + { + if (flipView) { + *x = boardRect.left + lineGap + ((BOARD_WIDTH-1)-column) * (squareSize + lineGap); + *y = boardRect.top + lineGap + row * (squareSize + lineGap); + } else { + *x = boardRect.left + lineGap + column * (squareSize + lineGap); + *y = boardRect.top + lineGap + ((BOARD_HEIGHT-1)-row) * (squareSize + lineGap); + } + } + + VOID + DrawCoordsOnDC(HDC hdc) + { + static char files[24] = {'0', '1','2','3','4','5','6','7','8','9','0','1','1','0','9','8','7','6','5','4','3','2','1','0'}; + static char ranks[24] = {'l', 'k','j','i','h','g','f','e','d','c','b','a','a','b','c','d','e','f','g','h','i','j','k','l'}; + char str[2] = { NULLCHAR, NULLCHAR }; + int oldMode, oldAlign, x, y, start, i; + HFONT oldFont; + HBRUSH oldBrush; + + if (!appData.showCoords) + return; + + start = flipView ? 1-(ONE!='1') : 23+(ONE!='1')-BOARD_HEIGHT; + + oldBrush = SelectObject(hdc, GetStockObject(BLACK_BRUSH)); + oldMode = SetBkMode(hdc, (appData.monoMode ? OPAQUE : TRANSPARENT)); + oldAlign = GetTextAlign(hdc); + oldFont = SelectObject(hdc, font[boardSize][COORD_FONT]->hf); + + y = boardRect.top + lineGap; + x = boardRect.left + lineGap + gameInfo.holdingsWidth*(squareSize + lineGap); + + SetTextAlign(hdc, TA_LEFT|TA_TOP); + for (i = 0; i < BOARD_HEIGHT; i++) { + str[0] = files[start + i]; + ExtTextOut(hdc, x + 2, y + 1, 0, NULL, str, 1, NULL); + y += squareSize + lineGap; + } + + start = flipView ? 12-(BOARD_RGHT-BOARD_LEFT) : 12; + + SetTextAlign(hdc, TA_RIGHT|TA_BOTTOM); + for (i = 0; i < BOARD_RGHT - BOARD_LEFT; i++) { + str[0] = ranks[start + i]; + ExtTextOut(hdc, x + squareSize - 2, y - 1, 0, NULL, str, 1, NULL); + x += squareSize + lineGap; + } + + SelectObject(hdc, oldBrush); + SetBkMode(hdc, oldMode); + SetTextAlign(hdc, oldAlign); + SelectObject(hdc, oldFont); + } + + VOID + DrawGridOnDC(HDC hdc) + { + HPEN oldPen; + + if (lineGap != 0) { + oldPen = SelectObject(hdc, gridPen); + PolyPolyline(hdc, gridEndpoints, gridVertexCounts, BOARD_WIDTH+BOARD_HEIGHT + 2); + SelectObject(hdc, oldPen); + } + } + + #define HIGHLIGHT_PEN 0 + #define PREMOVE_PEN 1 + + VOID + DrawHighlightOnDC(HDC hdc, BOOLEAN on, int x, int y, int pen) + { + int x1, y1; + HPEN oldPen, hPen; + if (lineGap == 0) return; + if (flipView) { + x1 = boardRect.left + + lineGap/2 + ((BOARD_WIDTH-1)-x) * (squareSize + lineGap); + y1 = boardRect.top + + lineGap/2 + y * (squareSize + lineGap); + } else { + x1 = boardRect.left + + lineGap/2 + x * (squareSize + lineGap); + y1 = boardRect.top + + lineGap/2 + ((BOARD_HEIGHT-1)-y) * (squareSize + lineGap); + } + hPen = pen ? premovePen : highlightPen; + oldPen = SelectObject(hdc, on ? hPen : gridPen); + MoveToEx(hdc, x1, y1, NULL); + LineTo(hdc, x1 + squareSize + lineGap, y1); + LineTo(hdc, x1 + squareSize + lineGap, y1 + squareSize + lineGap); + LineTo(hdc, x1, y1 + squareSize + lineGap); + LineTo(hdc, x1, y1); + SelectObject(hdc, oldPen); + } + + VOID + DrawHighlightsOnDC(HDC hdc) + { + int i; + for (i=0; i<2; i++) { + if (highlightInfo.sq[i].x >= 0 && highlightInfo.sq[i].y >= 0) + DrawHighlightOnDC(hdc, TRUE, + highlightInfo.sq[i].x, highlightInfo.sq[i].y, + HIGHLIGHT_PEN); + } + for (i=0; i<2; i++) { + if (premoveHighlightInfo.sq[i].x >= 0 && + premoveHighlightInfo.sq[i].y >= 0) { + DrawHighlightOnDC(hdc, TRUE, + premoveHighlightInfo.sq[i].x, + premoveHighlightInfo.sq[i].y, + PREMOVE_PEN); + } + } + } + + /* Note: sqcolor is used only in monoMode */ + /* Note that this code is largely duplicated in woptions.c, + function DrawSampleSquare, so that needs to be updated too */ + VOID + DrawPieceOnDC(HDC hdc, ChessSquare piece, int color, int sqcolor, int x, int y, HDC tmphdc) + { + HBITMAP oldBitmap; + HBRUSH oldBrush; + int tmpSize; + + if (appData.blindfold) return; + + /* [AS] Use font-based pieces if needed */ + if( fontBitmapSquareSize >= 0 && squareSize > 32 ) { + /* Create piece bitmaps, or do nothing if piece set is up to date */ + CreatePiecesFromFont(); + + if( fontBitmapSquareSize == squareSize ) { + int index = TranslatePieceToFontPiece(piece); + + SelectObject( tmphdc, hPieceMask[ index ] ); + + BitBlt( hdc, + x, y, + squareSize, squareSize, + tmphdc, + 0, 0, + SRCAND ); + + SelectObject( tmphdc, hPieceFace[ index ] ); + + BitBlt( hdc, + x, y, + squareSize, squareSize, + tmphdc, + 0, 0, + SRCPAINT ); + + return; + } + } + + if (appData.monoMode) { + SelectObject(tmphdc, PieceBitmap(piece, + color == sqcolor ? OUTLINE_PIECE : SOLID_PIECE)); + BitBlt(hdc, x, y, squareSize, squareSize, tmphdc, 0, 0, + sqcolor ? SRCCOPY : NOTSRCCOPY); + } else { + tmpSize = squareSize; + if(minorSize && + (piece >= (int)WhiteNightrider && piece <= WhiteGrasshopper || + piece >= (int)BlackNightrider && piece <= BlackGrasshopper) ) { + /* [HGM] no bitmap available for promoted pieces in Crazyhouse */ + /* Bitmaps of smaller size are substituted, but we have to align them */ + x += (squareSize - minorSize)>>1; + y += squareSize - minorSize - 2; + tmpSize = minorSize; + } + if (color || appData.allWhite ) { + oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, WHITE_PIECE)); + if( color ) + oldBrush = SelectObject(hdc, whitePieceBrush); + else oldBrush = SelectObject(hdc, blackPieceBrush); + if(appData.upsideDown && color==flipView) + StretchBlt(hdc, x+tmpSize, y+tmpSize, -tmpSize, -tmpSize, tmphdc, 0, 0, tmpSize, tmpSize, 0x00B8074A); + else + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, 0x00B8074A); + #if 0 + /* Use black piece color for outline of white pieces */ + /* Not sure this looks really good (though xboard does it). + Maybe better to have another selectable color, default black */ + SelectObject(hdc, blackPieceBrush); /* could have own brush */ + SelectObject(tmphdc, PieceBitmap(piece, OUTLINE_PIECE)); + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, 0x00B8074A); + #else + /* Use black for outline of white pieces */ + SelectObject(tmphdc, PieceBitmap(piece, OUTLINE_PIECE)); + if(appData.upsideDown && color==flipView) + StretchBlt(hdc, x+tmpSize, y+tmpSize, -tmpSize, -tmpSize, tmphdc, 0, 0, tmpSize, tmpSize, SRCAND); + else + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, SRCAND); + #endif + } else { + #if 0 + /* Use white piece color for details of black pieces */ + /* Requires filled-in solid bitmaps (BLACK_PIECE class); the + WHITE_PIECE ones aren't always the right shape. */ + /* Not sure this looks really good (though xboard does it). + Maybe better to have another selectable color, default medium gray? */ + oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, BLACK_PIECE)); + oldBrush = SelectObject(hdc, whitePieceBrush); /* could have own brush */ + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, 0x00B8074A); + SelectObject(tmphdc, PieceBitmap(piece, SOLID_PIECE)); + SelectObject(hdc, blackPieceBrush); + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, 0x00B8074A); + #else + /* Use square color for details of black pieces */ + oldBitmap = SelectObject(tmphdc, PieceBitmap(piece, SOLID_PIECE)); + oldBrush = SelectObject(hdc, blackPieceBrush); + if(appData.upsideDown && !flipView) + StretchBlt(hdc, x+tmpSize, y+tmpSize, -tmpSize, -tmpSize, tmphdc, 0, 0, tmpSize, tmpSize, 0x00B8074A); + else + BitBlt(hdc, x, y, tmpSize, tmpSize, tmphdc, 0, 0, 0x00B8074A); + #endif + } + SelectObject(hdc, oldBrush); + SelectObject(tmphdc, oldBitmap); + } + } + + /* [AS] Compute a drawing mode for a square, based on specified settings (see DrawTile) */ + int GetBackTextureMode( int algo ) + { + int result = BACK_TEXTURE_MODE_DISABLED; + + switch( algo ) + { + case BACK_TEXTURE_MODE_PLAIN: + result = 1; /* Always use identity map */ + break; + case BACK_TEXTURE_MODE_FULL_RANDOM: + result = 1 + (myrandom() % 3); /* Pick a transformation at random */ + break; + } + + return result; + } + + /* + [AS] Compute and save texture drawing info, otherwise we may not be able + to handle redraws cleanly (as random numbers would always be different). + */ + VOID RebuildTextureSquareInfo() + { + BITMAP bi; + int lite_w = 0; + int lite_h = 0; + int dark_w = 0; + int dark_h = 0; + int row; + int col; + + ZeroMemory( &backTextureSquareInfo, sizeof(backTextureSquareInfo) ); + + if( liteBackTexture != NULL ) { + if( GetObject( liteBackTexture, sizeof(bi), &bi ) > 0 ) { + lite_w = bi.bmWidth; + lite_h = bi.bmHeight; + } + } + + if( darkBackTexture != NULL ) { + if( GetObject( darkBackTexture, sizeof(bi), &bi ) > 0 ) { + dark_w = bi.bmWidth; + dark_h = bi.bmHeight; + } + } + + for( row=0; row= squareSize && lite_h >= squareSize ) { + backTextureSquareInfo[row][col].x = col * (lite_w - squareSize) / (BOARD_WIDTH-1); /* [HGM] divide by size-1 in stead of size! */ + backTextureSquareInfo[row][col].y = (BOARD_HEIGHT-1-row) * (lite_h - squareSize) / (BOARD_HEIGHT-1); + backTextureSquareInfo[row][col].mode = GetBackTextureMode(liteBackTextureMode); + } + } + else { + /* Dark square */ + if( dark_w >= squareSize && dark_h >= squareSize ) { + backTextureSquareInfo[row][col].x = col * (dark_w - squareSize) / (BOARD_WIDTH-1); + backTextureSquareInfo[row][col].y = (BOARD_HEIGHT-1-row) * (dark_h - squareSize) / (BOARD_HEIGHT-1); + backTextureSquareInfo[row][col].mode = GetBackTextureMode(darkBackTextureMode); + } + } + } + } + } + + /* [AS] Arrow highlighting support */ + + static int A_WIDTH = 5; /* Width of arrow body */ + + #define A_HEIGHT_FACTOR 6 /* Length of arrow "point", relative to body width */ + #define A_WIDTH_FACTOR 3 /* Width of arrow "point", relative to body width */ + + static double Sqr( double x ) + { + return x*x; + } + + static int Round( double x ) + { + return (int) (x + 0.5); + } + + /* Draw an arrow between two points using current settings */ + VOID DrawArrowBetweenPoints( HDC hdc, int s_x, int s_y, int d_x, int d_y ) + { + POINT arrow[7]; + double dx, dy, j, k, x, y; + + if( d_x == s_x ) { + int h = (d_y > s_y) ? +A_WIDTH*A_HEIGHT_FACTOR : -A_WIDTH*A_HEIGHT_FACTOR; + + arrow[0].x = s_x + A_WIDTH; + arrow[0].y = s_y; + + arrow[1].x = s_x + A_WIDTH; + arrow[1].y = d_y - h; + + arrow[2].x = s_x + A_WIDTH*A_WIDTH_FACTOR; + arrow[2].y = d_y - h; + + arrow[3].x = d_x; + arrow[3].y = d_y; + + arrow[4].x = s_x - A_WIDTH*A_WIDTH_FACTOR; + arrow[4].y = d_y - h; + + arrow[5].x = s_x - A_WIDTH; + arrow[5].y = d_y - h; + + arrow[6].x = s_x - A_WIDTH; + arrow[6].y = s_y; + } + else if( d_y == s_y ) { + int w = (d_x > s_x) ? +A_WIDTH*A_HEIGHT_FACTOR : -A_WIDTH*A_HEIGHT_FACTOR; + + arrow[0].x = s_x; + arrow[0].y = s_y + A_WIDTH; + + arrow[1].x = d_x - w; + arrow[1].y = s_y + A_WIDTH; + + arrow[2].x = d_x - w; + arrow[2].y = s_y + A_WIDTH*A_WIDTH_FACTOR; + + arrow[3].x = d_x; + arrow[3].y = d_y; + + arrow[4].x = d_x - w; + arrow[4].y = s_y - A_WIDTH*A_WIDTH_FACTOR; + + arrow[5].x = d_x - w; + arrow[5].y = s_y - A_WIDTH; + + arrow[6].x = s_x; + arrow[6].y = s_y - A_WIDTH; + } + else { + /* [AS] Needed a lot of paper for this! :-) */ + dy = (double) (d_y - s_y) / (double) (d_x - s_x); + dx = (double) (s_x - d_x) / (double) (s_y - d_y); + + j = sqrt( Sqr(A_WIDTH) / (1.0 + Sqr(dx)) ); + + k = sqrt( Sqr(A_WIDTH*A_HEIGHT_FACTOR) / (1.0 + Sqr(dy)) ); + + x = s_x; + y = s_y; + + arrow[0].x = Round(x - j); + arrow[0].y = Round(y + j*dx); + + arrow[1].x = Round(x + j); + arrow[1].y = Round(y - j*dx); + + if( d_x > s_x ) { + x = (double) d_x - k; + y = (double) d_y - k*dy; + } + else { + x = (double) d_x + k; + y = (double) d_y + k*dy; + } + + arrow[2].x = Round(x + j); + arrow[2].y = Round(y - j*dx); + + arrow[3].x = Round(x + j*A_WIDTH_FACTOR); + arrow[3].y = Round(y - j*A_WIDTH_FACTOR*dx); + + arrow[4].x = d_x; + arrow[4].y = d_y; + + arrow[5].x = Round(x - j*A_WIDTH_FACTOR); + arrow[5].y = Round(y + j*A_WIDTH_FACTOR*dx); + + arrow[6].x = Round(x - j); + arrow[6].y = Round(y + j*dx); + } + + Polygon( hdc, arrow, 7 ); + } + + /* [AS] Draw an arrow between two squares */ + VOID DrawArrowBetweenSquares( HDC hdc, int s_col, int s_row, int d_col, int d_row ) + { + int s_x, s_y, d_x, d_y; + HPEN hpen; + HPEN holdpen; + HBRUSH hbrush; + HBRUSH holdbrush; + LOGBRUSH stLB; + + if( s_col == d_col && s_row == d_row ) { + return; + } + + /* Get source and destination points */ + SquareToPos( s_row, s_col, &s_x, &s_y); + SquareToPos( d_row, d_col, &d_x, &d_y); + + if( d_y > s_y ) { + d_y += squareSize / 4; + } + else if( d_y < s_y ) { + d_y += 3 * squareSize / 4; + } + else { + d_y += squareSize / 2; + } + + if( d_x > s_x ) { + d_x += squareSize / 4; + } + else if( d_x < s_x ) { + d_x += 3 * squareSize / 4; + } + else { + d_x += squareSize / 2; + } + + s_x += squareSize / 2; + s_y += squareSize / 2; + + /* Adjust width */ + A_WIDTH = squareSize / 14; + + /* Draw */ + stLB.lbStyle = BS_SOLID; + stLB.lbColor = appData.highlightArrowColor; + stLB.lbHatch = 0; + + hpen = CreatePen( PS_SOLID, 2, RGB(0x00,0x00,0x00) ); + holdpen = SelectObject( hdc, hpen ); + hbrush = CreateBrushIndirect( &stLB ); + holdbrush = SelectObject( hdc, hbrush ); + + DrawArrowBetweenPoints( hdc, s_x, s_y, d_x, d_y ); + + SelectObject( hdc, holdpen ); + SelectObject( hdc, holdbrush ); + DeleteObject( hpen ); + DeleteObject( hbrush ); + } + + BOOL HasHighlightInfo() + { + BOOL result = FALSE; + + if( highlightInfo.sq[0].x >= 0 && highlightInfo.sq[0].y >= 0 && + highlightInfo.sq[1].x >= 0 && highlightInfo.sq[1].y >= 0 ) + { + result = TRUE; + } + + return result; + } + + BOOL IsDrawArrowEnabled() + { + BOOL result = FALSE; + + if( appData.highlightMoveWithArrow && squareSize >= 32 ) { + result = TRUE; + } + + return result; + } + + VOID DrawArrowHighlight( HDC hdc ) + { + if( IsDrawArrowEnabled() && HasHighlightInfo() ) { + DrawArrowBetweenSquares( hdc, + highlightInfo.sq[0].x, highlightInfo.sq[0].y, + highlightInfo.sq[1].x, highlightInfo.sq[1].y ); + } + } + + HRGN GetArrowHighlightClipRegion( HDC hdc ) + { + HRGN result = NULL; + + if( HasHighlightInfo() ) { + int x1, y1, x2, y2; + int sx, sy, dx, dy; + + SquareToPos(highlightInfo.sq[0].y, highlightInfo.sq[0].x, &x1, &y1 ); + SquareToPos(highlightInfo.sq[1].y, highlightInfo.sq[1].x, &x2, &y2 ); + + sx = MIN( x1, x2 ); + sy = MIN( y1, y2 ); + dx = MAX( x1, x2 ) + squareSize; + dy = MAX( y1, y2 ) + squareSize; + + result = CreateRectRgn( sx, sy, dx, dy ); + } + + return result; + } + + /* + Warning: this function modifies the behavior of several other functions. + + Basically, Winboard is optimized to avoid drawing the whole board if not strictly + needed. Unfortunately, the decision whether or not to perform a full or partial + repaint is scattered all over the place, which is not good for features such as + "arrow highlighting" that require a full repaint of the board. + + So, I've tried to patch the code where I thought it made sense (e.g. after or during + user interaction, when speed is not so important) but especially to avoid errors + in the displayed graphics. + + In such patched places, I always try refer to this function so there is a single + place to maintain knowledge. + + To restore the original behavior, just return FALSE unconditionally. + */ + BOOL IsFullRepaintPreferrable() + { + BOOL result = FALSE; + + if( (appData.highlightLastMove || appData.highlightDragging) && IsDrawArrowEnabled() ) { + /* Arrow may appear on the board */ + result = TRUE; + } + + return result; + } + + /* + This function is called by DrawPosition to know whether a full repaint must + be forced or not. + + Only DrawPosition may directly call this function, which makes use of + some state information. Other function should call DrawPosition specifying + the repaint flag, and can use IsFullRepaintPreferrable if needed. + */ + BOOL DrawPositionNeedsFullRepaint() + { + BOOL result = FALSE; + + /* + Probably a slightly better policy would be to trigger a full repaint + when animInfo.piece changes state (i.e. empty -> non-empty and viceversa), + but animation is fast enough that it's difficult to notice. + */ + if( animInfo.piece == EmptySquare ) { + if( (appData.highlightLastMove || appData.highlightDragging) && IsDrawArrowEnabled() && HasHighlightInfo() ) { + result = TRUE; + } + } + + return result; + } + + VOID + DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc) + { + int row, column, x, y, square_color, piece_color; + ChessSquare piece; + HBRUSH oldBrush; + HDC texture_hdc = NULL; + + /* [AS] Initialize background textures if needed */ + if( liteBackTexture != NULL || darkBackTexture != NULL ) { + static int backTextureBoardSize; /* [HGM] boardsize: also new texture if board format changed */ + if( backTextureSquareSize != squareSize + || backTextureBoardSize != BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT) { + backTextureBoardSize = BOARD_WIDTH+BOARD_SIZE*BOARD_HEIGHT; + backTextureSquareSize = squareSize; + RebuildTextureSquareInfo(); + } + + texture_hdc = CreateCompatibleDC( hdc ); + } + + for (row = 0; row < BOARD_HEIGHT; row++) { + for (column = 0; column < BOARD_WIDTH; column++) { + + SquareToPos(row, column, &x, &y); + + piece = board[row][column]; + + square_color = ((column + row) % 2) == 1; + if( gameInfo.variant == VariantXiangqi ) { + square_color = !InPalace(row, column); + if(BOARD_HEIGHT&1) { if(row==BOARD_HEIGHT/2) square_color ^= 1; } + else if(row < BOARD_HEIGHT/2) square_color ^= 1; + } + piece_color = (int) piece < (int) BlackPawn; + + + /* [HGM] holdings file: light square or black */ + if(column == BOARD_LEFT-2) { + if( row > BOARD_HEIGHT - gameInfo.holdingsSize - 1 ) + square_color = 1; + else { + DisplayHoldingsCount(hdc, x, y, 0, 0); /* black out */ + continue; + } + } else + if(column == BOARD_RGHT + 1 ) { + if( row < gameInfo.holdingsSize ) + square_color = 1; + else { + DisplayHoldingsCount(hdc, x, y, 0, 0); + continue; + } + } + if(column == BOARD_LEFT-1 ) /* left align */ + DisplayHoldingsCount(hdc, x, y, flipView, (int) board[row][column]); + else if( column == BOARD_RGHT) /* right align */ + DisplayHoldingsCount(hdc, x, y, !flipView, (int) board[row][column]); + else + if (appData.monoMode) { + if (piece == EmptySquare) { + BitBlt(hdc, x, y, squareSize, squareSize, 0, 0, 0, + square_color ? WHITENESS : BLACKNESS); + } else { + DrawPieceOnDC(hdc, piece, piece_color, square_color, x, y, tmphdc); + } + } + else if( backTextureSquareInfo[row][column].mode > 0 ) { + /* [AS] Draw the square using a texture bitmap */ + HBITMAP hbm = SelectObject( texture_hdc, square_color ? liteBackTexture : darkBackTexture ); + int r = row, c = column; // [HGM] do not flip board in flipView + if(flipView) { r = BOARD_HEIGHT-1 - r; c = BOARD_WIDTH-1 - c; } + + DrawTile( x, y, + squareSize, squareSize, + hdc, + texture_hdc, + backTextureSquareInfo[r][c].mode, + backTextureSquareInfo[r][c].x, + backTextureSquareInfo[r][c].y ); + + SelectObject( texture_hdc, hbm ); + + if (piece != EmptySquare) { + DrawPieceOnDC(hdc, piece, piece_color, -1, x, y, tmphdc); + } + } + else { + HBRUSH brush = square_color ? lightSquareBrush : darkSquareBrush; + + oldBrush = SelectObject(hdc, brush ); + BitBlt(hdc, x, y, squareSize, squareSize, 0, 0, 0, PATCOPY); + SelectObject(hdc, oldBrush); + if (piece != EmptySquare) + DrawPieceOnDC(hdc, piece, piece_color, -1, x, y, tmphdc); + } + } + } + + if( texture_hdc != NULL ) { + DeleteDC( texture_hdc ); + } + } + + int saveDiagFlag = 0; FILE *diagFile; // [HGM] diag + void fputDW(FILE *f, int x) + { + fputc(x & 255, f); + fputc(x>>8 & 255, f); + fputc(x>>16 & 255, f); + fputc(x>>24 & 255, f); + } + + #define MAX_CLIPS 200 /* more than enough */ + + VOID + DrawLogoOnDC(HDC hdc, RECT logoRect, ChessProgramState *cps) + { + HBITMAP bufferBitmap; + BITMAP bi; + RECT Rect; + HDC tmphdc; + HBITMAP hbm; + int w = 100, h = 50; + + if(cps->programLogo == NULL) return; + // GetClientRect(hwndMain, &Rect); + // bufferBitmap = CreateCompatibleBitmap(hdc, Rect.right-Rect.left+1, + // Rect.bottom-Rect.top+1); + tmphdc = CreateCompatibleDC(hdc); + hbm = SelectObject(tmphdc, (HBITMAP) cps->programLogo); + if( GetObject( cps->programLogo, sizeof(bi), &bi ) > 0 ) { + w = bi.bmWidth; + h = bi.bmHeight; + } + StretchBlt(hdc, logoRect.left, logoRect.top, logoRect.right - logoRect.left, + logoRect.bottom - logoRect.top, tmphdc, 0, 0, w, h, SRCCOPY); + SelectObject(tmphdc, hbm); + DeleteDC(tmphdc); + } + + VOID + HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) + { + static Board lastReq, lastDrawn; + static HighlightInfo lastDrawnHighlight, lastDrawnPremove; + static int lastDrawnFlipView = 0; + static int lastReqValid = 0, lastDrawnValid = 0; + int releaseDC, x, y, x2, y2, row, column, num_clips = 0, i; + HDC tmphdc; + HDC hdcmem; + HBITMAP bufferBitmap; + HBITMAP oldBitmap; + RECT Rect; + HRGN clips[MAX_CLIPS]; + ChessSquare dragged_piece = EmptySquare; + + /* I'm undecided on this - this function figures out whether a full + * repaint is necessary on its own, so there's no real reason to have the + * caller tell it that. I think this can safely be set to FALSE - but + * if we trust the callers not to request full repaints unnessesarily, then + * we could skip some clipping work. In other words, only request a full + * redraw when the majority of pieces have changed positions (ie. flip, + * gamestart and similar) --Hawk + */ + Boolean fullrepaint = repaint; + + if( DrawPositionNeedsFullRepaint() ) { + fullrepaint = TRUE; + } + + #if 0 + if( fullrepaint ) { + static int repaint_count = 0; + char buf[128]; + + repaint_count++; + sprintf( buf, "FULL repaint: %d\n", repaint_count ); + OutputDebugString( buf ); + } + #endif + + if (board == NULL) { + if (!lastReqValid) { + return; + } + board = lastReq; + } else { + CopyBoard(lastReq, board); + lastReqValid = 1; + } + + if (doingSizing) { + return; + } + + if (IsIconic(hwndMain)) { + return; + } + + if (hdc == NULL) { + hdc = GetDC(hwndMain); + if (!appData.monoMode) { + SelectPalette(hdc, hPal, FALSE); + RealizePalette(hdc); + } + releaseDC = TRUE; + } else { + releaseDC = FALSE; + } + + #if 0 + fprintf(debugFP, "*******************************\n" + "repaint = %s\n" + "dragInfo.from (%d,%d)\n" + "dragInfo.start (%d,%d)\n" + "dragInfo.pos (%d,%d)\n" + "dragInfo.lastpos (%d,%d)\n", + repaint ? "TRUE" : "FALSE", + dragInfo.from.x, dragInfo.from.y, + dragInfo.start.x, dragInfo.start.y, + dragInfo.pos.x, dragInfo.pos.y, + dragInfo.lastpos.x, dragInfo.lastpos.y); + fprintf(debugFP, "prev: "); + for (row = 0; row < BOARD_HEIGHT; row++) { + for (column = 0; column < BOARD_WIDTH; column++) { + fprintf(debugFP, "%d ", lastDrawn[row][column]); + } + } + fprintf(debugFP, "\n"); + fprintf(debugFP, "board: "); + for (row = 0; row < BOARD_HEIGHT; row++) { + for (column = 0; column < BOARD_WIDTH; column++) { + fprintf(debugFP, "%d ", board[row][column]); + } + } + fprintf(debugFP, "\n"); + fflush(debugFP); + #endif + + /* Create some work-DCs */ + hdcmem = CreateCompatibleDC(hdc); + tmphdc = CreateCompatibleDC(hdc); + + /* If dragging is in progress, we temporarely remove the piece */ + /* [HGM] or temporarily decrease count if stacked */ + /* !! Moved to before board compare !! */ + if (dragInfo.from.x >= 0 && dragInfo.pos.x >= 0) { + dragged_piece = board[dragInfo.from.y][dragInfo.from.x]; + if(dragInfo.from.x == BOARD_LEFT-2 ) { + if(--board[dragInfo.from.y][dragInfo.from.x+1] == 0 ) + board[dragInfo.from.y][dragInfo.from.x] = EmptySquare; + } else + if(dragInfo.from.x == BOARD_RGHT+1) { + if(--board[dragInfo.from.y][dragInfo.from.x-1] == 0 ) + board[dragInfo.from.y][dragInfo.from.x] = EmptySquare; + } else + board[dragInfo.from.y][dragInfo.from.x] = EmptySquare; + } + + /* Figure out which squares need updating by comparing the + * newest board with the last drawn board and checking if + * flipping has changed. + */ + if (!fullrepaint && lastDrawnValid && lastDrawnFlipView == flipView) { + for (row = 0; row < BOARD_HEIGHT; row++) { /* [HGM] true size, not 8 */ + for (column = 0; column < BOARD_WIDTH; column++) { + if (lastDrawn[row][column] != board[row][column]) { + SquareToPos(row, column, &x, &y); + clips[num_clips++] = + CreateRectRgn(x, y, x + squareSize, y + squareSize); + } + } + } + for (i=0; i<2; i++) { + if (lastDrawnHighlight.sq[i].x != highlightInfo.sq[i].x || + lastDrawnHighlight.sq[i].y != highlightInfo.sq[i].y) { + if (lastDrawnHighlight.sq[i].x >= 0 && + lastDrawnHighlight.sq[i].y >= 0) { + SquareToPos(lastDrawnHighlight.sq[i].y, + lastDrawnHighlight.sq[i].x, &x, &y); + clips[num_clips++] = + CreateRectRgn(x - lineGap, y - lineGap, + x + squareSize + lineGap, y + squareSize + lineGap); + } + if (highlightInfo.sq[i].x >= 0 && highlightInfo.sq[i].y >= 0) { + SquareToPos(highlightInfo.sq[i].y, highlightInfo.sq[i].x, &x, &y); + clips[num_clips++] = + CreateRectRgn(x - lineGap, y - lineGap, + x + squareSize + lineGap, y + squareSize + lineGap); + } + } + } + for (i=0; i<2; i++) { + if (lastDrawnPremove.sq[i].x != premoveHighlightInfo.sq[i].x || + lastDrawnPremove.sq[i].y != premoveHighlightInfo.sq[i].y) { + if (lastDrawnPremove.sq[i].x >= 0 && + lastDrawnPremove.sq[i].y >= 0) { + SquareToPos(lastDrawnPremove.sq[i].y, + lastDrawnPremove.sq[i].x, &x, &y); + clips[num_clips++] = + CreateRectRgn(x - lineGap, y - lineGap, + x + squareSize + lineGap, y + squareSize + lineGap); + } + if (premoveHighlightInfo.sq[i].x >= 0 && + premoveHighlightInfo.sq[i].y >= 0) { + SquareToPos(premoveHighlightInfo.sq[i].y, + premoveHighlightInfo.sq[i].x, &x, &y); + clips[num_clips++] = + CreateRectRgn(x - lineGap, y - lineGap, + x + squareSize + lineGap, y + squareSize + lineGap); + } + } + } + } else { + fullrepaint = TRUE; + } + + /* Create a buffer bitmap - this is the actual bitmap + * being written to. When all the work is done, we can + * copy it to the real DC (the screen). This avoids + * the problems with flickering. + */ + GetClientRect(hwndMain, &Rect); + bufferBitmap = CreateCompatibleBitmap(hdc, Rect.right-Rect.left+1, + Rect.bottom-Rect.top+1); + oldBitmap = SelectObject(hdcmem, bufferBitmap); + if (!appData.monoMode) { + SelectPalette(hdcmem, hPal, FALSE); + } + + /* Create clips for dragging */ + if (!fullrepaint) { + if (dragInfo.from.x >= 0) { + SquareToPos(dragInfo.from.y, dragInfo.from.x, &x, &y); + clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); + } + if (dragInfo.start.x >= 0) { + SquareToPos(dragInfo.start.y, dragInfo.start.x, &x, &y); + clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); + } + if (dragInfo.pos.x >= 0) { + x = dragInfo.pos.x - squareSize / 2; + y = dragInfo.pos.y - squareSize / 2; + clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); + } + if (dragInfo.lastpos.x >= 0) { + x = dragInfo.lastpos.x - squareSize / 2; + y = dragInfo.lastpos.y - squareSize / 2; + clips[num_clips++] = CreateRectRgn(x, y, x+squareSize, y+squareSize); + } + } + + /* Are we animating a move? + * If so, + * - remove the piece from the board (temporarely) + * - calculate the clipping region + */ + if (!fullrepaint) { + if (animInfo.piece != EmptySquare) { + board[animInfo.from.y][animInfo.from.x] = EmptySquare; + x = boardRect.left + animInfo.lastpos.x; + y = boardRect.top + animInfo.lastpos.y; + x2 = boardRect.left + animInfo.pos.x; + y2 = boardRect.top + animInfo.pos.y; + clips[num_clips++] = CreateRectRgn(MIN(x,x2), MIN(y,y2), MAX(x,x2)+squareSize, MAX(y,y2)+squareSize); + /* Slight kludge. The real problem is that after AnimateMove is + done, the position on the screen does not match lastDrawn. + This currently causes trouble only on e.p. captures in + atomic, where the piece moves to an empty square and then + explodes. The old and new positions both had an empty square + at the destination, but animation has drawn a piece there and + we have to remember to erase it. */ + lastDrawn[animInfo.to.y][animInfo.to.x] = animInfo.piece; + } + } + + /* No clips? Make sure we have fullrepaint set to TRUE */ + if (num_clips == 0) + fullrepaint = TRUE; + + /* Set clipping on the memory DC */ + if (!fullrepaint) { + SelectClipRgn(hdcmem, clips[0]); + for (x = 1; x < num_clips; x++) { + if (ExtSelectClipRgn(hdcmem, clips[x], RGN_OR) == ERROR) + abort(); // this should never ever happen! + } + } + + /* Do all the drawing to the memory DC */ + DrawGridOnDC(hdcmem); + DrawHighlightsOnDC(hdcmem); + DrawBoardOnDC(hdcmem, board, tmphdc); + + if(logoHeight) { + DrawLogoOnDC(hdc, leftLogoRect, flipClock ? &second : &first); + DrawLogoOnDC(hdc, rightLogoRect, flipClock ? &first : &second); + } + + if( appData.highlightMoveWithArrow ) { + DrawArrowHighlight(hdcmem); + } + + DrawCoordsOnDC(hdcmem); + + CopyBoard(lastDrawn, board); /* [HGM] Moved to here from end of routine, */ + /* to make sure lastDrawn contains what is actually drawn */ + + /* Put the dragged piece back into place and draw it (out of place!) */ + if (dragged_piece != EmptySquare) { + /* [HGM] or restack */ + if(dragInfo.from.x == BOARD_LEFT-2 ) + board[dragInfo.from.y][dragInfo.from.x+1]++; + else + if(dragInfo.from.x == BOARD_RGHT+1 ) + board[dragInfo.from.y][dragInfo.from.x-1]++; + board[dragInfo.from.y][dragInfo.from.x] = dragged_piece; + x = dragInfo.pos.x - squareSize / 2; + y = dragInfo.pos.y - squareSize / 2; + DrawPieceOnDC(hdcmem, dragged_piece, + ((int) dragged_piece < (int) BlackPawn), + (dragInfo.from.y + dragInfo.from.x) % 2, x, y, tmphdc); + } + + /* Put the animated piece back into place and draw it */ + if (animInfo.piece != EmptySquare) { + board[animInfo.from.y][animInfo.from.x] = animInfo.piece; + x = boardRect.left + animInfo.pos.x; + y = boardRect.top + animInfo.pos.y; + DrawPieceOnDC(hdcmem, animInfo.piece, + ((int) animInfo.piece < (int) BlackPawn), + (animInfo.from.y + animInfo.from.x) % 2, x, y, tmphdc); + } + + /* Release the bufferBitmap by selecting in the old bitmap + * and delete the memory DC + */ + SelectObject(hdcmem, oldBitmap); + DeleteDC(hdcmem); + + /* Set clipping on the target DC */ + if (!fullrepaint) { + SelectClipRgn(hdc, clips[0]); + for (x = 1; x < num_clips; x++) { + if (ExtSelectClipRgn(hdc, clips[x], RGN_OR) == ERROR) + abort(); // this should never ever happen! + } + } + + /* Copy the new bitmap onto the screen in one go. + * This way we avoid any flickering + */ + oldBitmap = SelectObject(tmphdc, bufferBitmap); + BitBlt(hdc, boardRect.left, boardRect.top, + boardRect.right - boardRect.left, + boardRect.bottom - boardRect.top, + tmphdc, boardRect.left, boardRect.top, SRCCOPY); + if(saveDiagFlag) { + BITMAP b; int i, j, m, w, wb, fac=0; char pData[1000000]; + BITMAPINFOHEADER bih; int color[16], nrColors=0; + + GetObject(bufferBitmap, sizeof(b), &b); + if(b.bmWidthBytes*b.bmHeight <= 990000) { + bih.biSize = sizeof(BITMAPINFOHEADER); + bih.biWidth = b.bmWidth; + bih.biHeight = b.bmHeight; + bih.biPlanes = 1; + bih.biBitCount = b.bmBitsPixel; + bih.biCompression = 0; + bih.biSizeImage = b.bmWidthBytes*b.bmHeight; + bih.biXPelsPerMeter = 0; + bih.biYPelsPerMeter = 0; + bih.biClrUsed = 0; + bih.biClrImportant = 0; + // fprintf(diagFile, "t=%d\nw=%d\nh=%d\nB=%d\nP=%d\nX=%d\n", + // b.bmType, b.bmWidth, b.bmHeight, b.bmWidthBytes, b.bmPlanes, b.bmBitsPixel); + GetDIBits(tmphdc,bufferBitmap,0,b.bmHeight,pData,(BITMAPINFO*)&bih,DIB_RGB_COLORS); + // fprintf(diagFile, "%8x\n", (int) pData); + + #if 1 + wb = b.bmWidthBytes; + // count colors + for(i=0; i>2; i++) { + int k = ((int*) pData)[i]; + for(j=0; j= 16) break; + color[j] = k; + if(j >= nrColors) nrColors = j+1; + } + if(j<16) { // 16 colors is enough. Compress to 4 bits per pixel + INT p = 0; + for(i=0; i>2); w+=2) { + int k = ((int*) pData)[(wb*i>>2) + w]; + for(j=0; j>2) + w + 1]; + for(m=0; m>5)<<2; + } + // write BITMAPFILEHEADER + fprintf(diagFile, "BM"); + fputDW(diagFile, wb*(b.bmHeight - boardRect.top + OUTER_MARGIN)+0x36 + (fac?64:0)); + fputDW(diagFile, 0); + fputDW(diagFile, 0x36 + (fac?64:0)); + // write BITMAPINFOHEADER + fputDW(diagFile, 40); + fputDW(diagFile, b.bmWidth); + fputDW(diagFile, b.bmHeight - boardRect.top + OUTER_MARGIN); + if(fac) fputDW(diagFile, 0x040001); // planes and bits/pixel + else fputDW(diagFile, 0x200001); // planes and bits/pixel + fputDW(diagFile, 0); + fputDW(diagFile, 0); + fputDW(diagFile, 0); + fputDW(diagFile, 0); + fputDW(diagFile, 0); + fputDW(diagFile, 0); + // write color table + if(fac) + for(i=0; i<16; i++) fputDW(diagFile, color[i]); + // write bitmap data + for(i=0; ihf); + ExtTextOut(hdc, messageRect.left, messageRect.top, + ETO_CLIPPED|ETO_OPAQUE, + &messageRect, messageText, strlen(messageText), NULL); + SelectObject(hdc, oldFont); + DisplayBothClocks(); + } + EndPaint(hwnd,&ps); + } + + return; + } + + + /* + * If the user selects on a border boundary, return -1; if off the board, + * return -2. Otherwise map the event coordinate to the square. + * The offset boardRect.left or boardRect.top must already have been + * subtracted from x. + */ + int + EventToSquare(int x) + { + if (x <= 0) + return -2; + if (x < lineGap) + return -1; + x -= lineGap; + if ((x % (squareSize + lineGap)) >= squareSize) + return -1; + x /= (squareSize + lineGap); + if (x >= BOARD_SIZE) + return -2; + return x; + } + + typedef struct { + char piece; + int command; + char* name; + } DropEnable; + + DropEnable dropEnables[] = { + { 'P', DP_Pawn, "Pawn" }, + { 'N', DP_Knight, "Knight" }, + { 'B', DP_Bishop, "Bishop" }, + { 'R', DP_Rook, "Rook" }, + { 'Q', DP_Queen, "Queen" }, + }; + + VOID + SetupDropMenu(HMENU hmenu) + { + int i, count, enable; + char *p; + extern char white_holding[], black_holding[]; + char item[MSG_SIZ]; + + for (i=0; i 0 || !appData.testLegality + /*!!temp:*/ || (gameInfo.variant == VariantCrazyhouse + && !appData.icsActive); + ModifyMenu(hmenu, dropEnables[i].command, + MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED) | MF_STRING, + dropEnables[i].command, item); + } + } + + static int fromX = -1, fromY = -1, toX, toY; + + /* Event handler for mouse messages */ + VOID + MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + int x, y; + POINT pt; + static int recursive = 0; + HMENU hmenu; + BOOLEAN needsRedraw = FALSE; + BOOLEAN saveAnimate; + BOOLEAN forceFullRepaint = IsFullRepaintPreferrable(); /* [AS] */ + static BOOLEAN sameAgain = FALSE, promotionChoice = FALSE; + ChessMove moveType; + + if (recursive) { + if (message == WM_MBUTTONUP) { + /* Hideous kludge to fool TrackPopupMenu into paying attention + to the middle button: we simulate pressing the left button too! + */ + PostMessage(hwnd, WM_LBUTTONDOWN, wParam, lParam); + PostMessage(hwnd, WM_LBUTTONUP, wParam, lParam); + } + return; + } + recursive++; + + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); + x = EventToSquare(pt.x - boardRect.left); + y = EventToSquare(pt.y - boardRect.top); + if (!flipView && y >= 0) { + y = BOARD_HEIGHT - 1 - y; + } + if (flipView && x >= 0) { + x = BOARD_WIDTH - 1 - x; + } + + switch (message) { + case WM_LBUTTONDOWN: + if(promotionChoice) { // we are waiting for a click to indicate promotion piece + promotionChoice = FALSE; // only one chance: if click not OK it is interpreted as cancel + if(appData.debugMode) fprintf(debugFP, "promotion click, x=%d, y=%d\n", x, y); + if(gameInfo.holdingsWidth && + (WhiteOnMove(currentMove) + ? x == BOARD_WIDTH-1 && y < gameInfo.holdingsSize && y > 0 + : x == 0 && y >= BOARD_HEIGHT - gameInfo.holdingsSize && y < BOARD_HEIGHT-1) ) { + // click in right holdings, for determining promotion piece + ChessSquare p = boards[currentMove][y][x]; + if(appData.debugMode) fprintf(debugFP, "square contains %d\n", (int)p); + if(p != EmptySquare) { + FinishMove(WhitePromotionQueen, fromX, fromY, toX, toY, ToLower(PieceToChar(p))); + fromX = fromY = -1; + break; + } + } + DrawPosition(FALSE, boards[currentMove]); + break; + } + ErrorPopDown(); + sameAgain = FALSE; + if (y == -2) { + /* Downclick vertically off board; check if on clock */ + if (PtInRect((LPRECT) &whiteRect, pt)) { + if (gameMode == EditPosition) { + SetWhiteToPlayEvent(); + } else if (gameMode == IcsPlayingBlack || + gameMode == MachinePlaysWhite) { + CallFlagEvent(); + } else if (gameMode == EditGame) { + AdjustClock((logoHeight > 0 ? flipView: flipClock), -1); + } + } else if (PtInRect((LPRECT) &blackRect, pt)) { + if (gameMode == EditPosition) { + SetBlackToPlayEvent(); + } else if (gameMode == IcsPlayingWhite || + gameMode == MachinePlaysBlack) { + CallFlagEvent(); + } else if (gameMode == EditGame) { + AdjustClock(!(logoHeight > 0 ? flipView: flipClock), -1); + } + } + if (!appData.highlightLastMove) { + ClearHighlights(); + DrawPosition(forceFullRepaint || FALSE, NULL); + } + fromX = fromY = -1; + dragInfo.start.x = dragInfo.start.y = -1; + dragInfo.from = dragInfo.start; + break; + } else if (x < 0 || y < 0 + /* [HGM] block clicks between board and holdings */ + || x == BOARD_LEFT-1 || x == BOARD_RGHT + || x == BOARD_LEFT-2 && y < BOARD_HEIGHT-gameInfo.holdingsSize + || x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize + /* EditPosition, empty square, or different color piece; + click-click move is possible */ + ) { + break; + } else if (fromX == x && fromY == y) { + /* Downclick on same square again */ + ClearHighlights(); + DrawPosition(forceFullRepaint || FALSE, NULL); + sameAgain = TRUE; + } else if (fromX != -1 && + x != BOARD_LEFT-2 && x != BOARD_RGHT+1 + ) { + /* Downclick on different square. */ + /* [HGM] if on holdings file, should count as new first click ! */ + { /* [HGM] now always do UserMoveTest(), and check colors there */ + toX = x; + toY = y; + /* [HGM] UserMoveEvent requires two calls now, + to make sure move is legal before showing promotion popup */ + moveType = UserMoveTest(fromX, fromY, toX, toY, NULLCHAR); + if(moveType == AmbiguousMove) { /* [HGM] Edit-Position move executed */ + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, boards[currentMove]); + break; + } else + if(moveType != ImpossibleMove) { + /* [HGM] We use PromotionToKnight in Shogi to indicate frorced promotion */ + if (moveType == WhitePromotionKnight || moveType == BlackPromotionKnight || + (moveType == WhitePromotionQueen || moveType == BlackPromotionQueen) && + appData.alwaysPromoteToQueen) { + FinishMove(moveType, fromX, fromY, toX, toY, 'q'); + if (!appData.highlightLastMove) { + ClearHighlights(); + DrawPosition(forceFullRepaint || FALSE, NULL); + } + } else + if (moveType == WhitePromotionQueen || moveType == BlackPromotionQueen ) { + SetHighlights(fromX, fromY, toX, toY); + DrawPosition(forceFullRepaint || FALSE, NULL); + /* [HGM] Popup calls FinishMove now. + If promotion to Q is legal, all are legal! */ + if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) + { ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX]; + // kludge to temporarily execute move on display, wthout promotng yet + promotionChoice = TRUE; + boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank + boards[currentMove][toY][toX] = p; + DrawPosition(FALSE, boards[currentMove]); + boards[currentMove][fromY][fromX] = p; // take back, but display stays + boards[currentMove][toY][toX] = q; + } else + PromotionPopup(hwnd); + } else { /* not a promotion */ + if (appData.animate || appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } else { + ClearHighlights(); + } + FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); + fromX = fromY = -1; + if (appData.animate && !appData.highlightLastMove) { + ClearHighlights(); + DrawPosition(forceFullRepaint || FALSE, NULL); + } + } + break; + } + if (gotPremove) { + /* [HGM] it seemed that braces were missing here */ + SetPremoveHighlights(fromX, fromY, toX, toY); + fromX = fromY = -1; + break; + } + } + ClearHighlights(); + DrawPosition(forceFullRepaint || FALSE, NULL); + } + /* First downclick, or restart on a square with same color piece */ + if (!frozen && OKToStartUserMove(x, y)) { + fromX = x; + fromY = y; + dragInfo.lastpos = pt; + dragInfo.from.x = fromX; + dragInfo.from.y = fromY; + dragInfo.start = dragInfo.from; + SetCapture(hwndMain); + } else { + fromX = fromY = -1; + dragInfo.start.x = dragInfo.start.y = -1; + dragInfo.from = dragInfo.start; + DrawPosition(forceFullRepaint || FALSE, NULL); /* [AS] */ + } + break; + + case WM_LBUTTONUP: + ReleaseCapture(); + if (fromX == -1) break; + if (x == fromX && y == fromY) { + dragInfo.from.x = dragInfo.from.y = -1; + /* Upclick on same square */ + if (sameAgain) { + /* Clicked same square twice: abort click-click move */ + fromX = fromY = -1; + gotPremove = 0; + ClearPremoveHighlights(); + } else { + /* First square clicked: start click-click move */ + SetHighlights(fromX, fromY, -1, -1); + } + DrawPosition(forceFullRepaint || FALSE, NULL); + } else if (dragInfo.from.x < 0 || dragInfo.from.y < 0) { + /* Errant click; ignore */ + break; + } else { + /* Finish drag move. */ + if (appData.debugMode) { + fprintf(debugFP, "release\n"); + } + dragInfo.from.x = dragInfo.from.y = -1; + toX = x; + toY = y; + saveAnimate = appData.animate; /* sorry, Hawk :) */ + appData.animate = appData.animate && !appData.animateDragging; + moveType = UserMoveTest(fromX, fromY, toX, toY, NULLCHAR); + if(moveType == AmbiguousMove) { /* [HGM] Edit-Position move executed */ + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, boards[currentMove]); + break; + } else + if(moveType != ImpossibleMove) { + /* [HGM] use move type to determine if move is promotion. + Knight is Shogi kludge for mandatory promotion, Queen means choice */ + if (moveType == WhitePromotionKnight || moveType == BlackPromotionKnight || + (moveType == WhitePromotionQueen || moveType == BlackPromotionQueen) && + appData.alwaysPromoteToQueen) + FinishMove(moveType, fromX, fromY, toX, toY, 'q'); + else + if (moveType == WhitePromotionQueen || moveType == BlackPromotionQueen ) { + DrawPosition(forceFullRepaint || FALSE, NULL); + if(gameInfo.variant == VariantSuper || gameInfo.variant == VariantGreat) + { ChessSquare p = boards[currentMove][fromY][fromX], q = boards[currentMove][toY][toX]; + // kludge to temporarily execute move on display, wthout promotng yet + promotionChoice = TRUE; + boards[currentMove][fromY][fromX] = EmptySquare; // move Pawn to 8th rank + boards[currentMove][toY][toX] = p; + DrawPosition(FALSE, boards[currentMove]); + boards[currentMove][fromY][fromX] = p; // take back, but display stays + boards[currentMove][toY][toX] = q; + break; + } else + PromotionPopup(hwnd); /* [HGM] Popup now calls FinishMove */ + } else FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR); + } + if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); + appData.animate = saveAnimate; + fromX = fromY = -1; + if (appData.highlightDragging && !appData.highlightLastMove) { + ClearHighlights(); + } + if (appData.animate || appData.animateDragging || + appData.highlightDragging || gotPremove) { + DrawPosition(forceFullRepaint || FALSE, NULL); + } + } + dragInfo.start.x = dragInfo.start.y = -1; + dragInfo.pos = dragInfo.lastpos = dragInfo.start; + break; + + case WM_MOUSEMOVE: + if ((appData.animateDragging || appData.highlightDragging) + && (wParam & MK_LBUTTON) + && dragInfo.from.x >= 0) + { + BOOL full_repaint = FALSE; + + sameAgain = FALSE; /* [HGM] if we drag something around, do keep square selected */ + if (appData.animateDragging) { + dragInfo.pos = pt; + } + if (appData.highlightDragging) { + SetHighlights(fromX, fromY, x, y); + if( IsDrawArrowEnabled() && (x < 0 || x >= BOARD_WIDTH || y < 0 || y >= BOARD_HEIGHT) ) { + full_repaint = TRUE; + } + } + + DrawPosition( full_repaint, NULL); + + dragInfo.lastpos = dragInfo.pos; + } + break; + ++ case WM_MOUSEWHEEL: // [DM] ++ /* Mouse Wheel is being rolled forward ++ * Play moves forward ++ */ ++ if((short)HIWORD(wParam) > 0 && currentMove < forwardMostMove) ForwardEvent(); ++ /* Mouse Wheel is being rolled backward ++ * Play moves backward ++ */ ++ if((short)HIWORD(wParam) < 0 && currentMove > backwardMostMove) BackwardEvent(); ++ break; ++ + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + ErrorPopDown(); + ReleaseCapture(); + fromX = fromY = -1; + dragInfo.pos.x = dragInfo.pos.y = -1; + dragInfo.start.x = dragInfo.start.y = -1; + dragInfo.from = dragInfo.start; + dragInfo.lastpos = dragInfo.pos; + if (appData.highlightDragging) { + ClearHighlights(); + } + if(y == -2) { + /* [HGM] right mouse button in clock area edit-game mode ups clock */ + if (PtInRect((LPRECT) &whiteRect, pt)) { + if (gameMode == EditGame) AdjustClock((logoHeight > 0 ? flipView: flipClock), 1); + } else if (PtInRect((LPRECT) &blackRect, pt)) { + if (gameMode == EditGame) AdjustClock(!(logoHeight > 0 ? flipView: flipClock), 1); + } + } + DrawPosition(TRUE, NULL); + + switch (gameMode) { + case EditPosition: + case IcsExamining: + if (x < 0 || y < 0) break; + fromX = x; + fromY = y; + if (message == WM_MBUTTONDOWN) { + buttonCount = 3; /* even if system didn't think so */ + if (wParam & MK_SHIFT) + MenuPopup(hwnd, pt, LoadMenu(hInst, "BlackPieceMenu"), -1); + else + MenuPopup(hwnd, pt, LoadMenu(hInst, "WhitePieceMenu"), -1); + } else { /* message == WM_RBUTTONDOWN */ + #if 0 + if (buttonCount == 3) { + if (wParam & MK_SHIFT) + MenuPopup(hwnd, pt, LoadMenu(hInst, "WhitePieceMenu"), -1); + else + MenuPopup(hwnd, pt, LoadMenu(hInst, "BlackPieceMenu"), -1); + } else { + MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1); + } + #else + /* Just have one menu, on the right button. Windows users don't + think to try the middle one, and sometimes other software steals + it, or it doesn't really exist. */ + if(gameInfo.variant != VariantShogi) + MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1); + else + MenuPopup(hwnd, pt, LoadMenu(hInst, "ShogiPieceMenu"), -1); + #endif + } + break; + case IcsPlayingWhite: + case IcsPlayingBlack: + case EditGame: + case MachinePlaysWhite: + case MachinePlaysBlack: + if (appData.testLegality && + gameInfo.variant != VariantBughouse && + gameInfo.variant != VariantCrazyhouse) break; + if (x < 0 || y < 0) break; + fromX = x; + fromY = y; + hmenu = LoadMenu(hInst, "DropPieceMenu"); + SetupDropMenu(hmenu); + MenuPopup(hwnd, pt, hmenu, -1); + break; + default: + break; + } + break; + } + + recursive--; + } + + /* Preprocess messages for buttons in main window */ + LRESULT CALLBACK + ButtonProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + int id = GetWindowLong(hwnd, GWL_ID); + int i, dir; + + for (i=0; i= 'A' && + PieceToChar(WhiteAngel) != '~' || + PieceToChar(BlackAngel) >= 'A' && + PieceToChar(BlackAngel) != '~' ) ? + SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, PB_Chancellor), + (PieceToChar(WhiteMarshall) >= 'A' && + PieceToChar(WhiteMarshall) != '~' || + PieceToChar(BlackMarshall) >= 'A' && + PieceToChar(BlackMarshall) != '~' ) ? + SW_SHOW : SW_HIDE); + /* [HGM] Hide B & R button in Shogi, use Q as promote, N as defer */ + ShowWindow(GetDlgItem(hDlg, PB_Rook), + gameInfo.variant != VariantShogi ? + SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, PB_Bishop), + gameInfo.variant != VariantShogi ? + SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDC_Yes), + gameInfo.variant == VariantShogi ? + SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDC_No), + gameInfo.variant == VariantShogi ? + SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDC_Centaur), + gameInfo.variant == VariantSuper ? + SW_SHOW : SW_HIDE); + return TRUE; + + case WM_COMMAND: /* message: received a command */ + switch (LOWORD(wParam)) { + case IDCANCEL: + EndDialog(hDlg, TRUE); /* Exit the dialog */ + ClearHighlights(); + DrawPosition(FALSE, NULL); + return TRUE; + case PB_King: + promoChar = gameInfo.variant == VariantSuper ? PieceToChar(BlackSilver) : PieceToChar(BlackKing); + break; + case PB_Queen: + promoChar = gameInfo.variant == VariantShogi ? '+' : PieceToChar(BlackQueen); + break; + case PB_Rook: + promoChar = PieceToChar(BlackRook); + break; + case PB_Bishop: + promoChar = PieceToChar(BlackBishop); + break; + case PB_Chancellor: + promoChar = PieceToChar(BlackMarshall); + break; + case PB_Archbishop: + promoChar = PieceToChar(BlackAngel); + break; + case PB_Knight: + promoChar = gameInfo.variant == VariantShogi ? '=' : PieceToChar(BlackKnight); + break; + default: + return FALSE; + } + EndDialog(hDlg, TRUE); /* Exit the dialog */ + /* [HGM] Call FinishMove rather than UserMoveEvent, as we + only show the popup when we are already sure the move is valid or + legal. We pass a faulty move type, but the kludge is that FinishMove + will figure out it is a promotion from the promoChar. */ + FinishMove(NormalMove, fromX, fromY, toX, toY, promoChar); + if (!appData.highlightLastMove) { + ClearHighlights(); + DrawPosition(FALSE, NULL); + } + return TRUE; + } + return FALSE; + } + + /* Pop up promotion dialog */ + VOID + PromotionPopup(HWND hwnd) + { + FARPROC lpProc; + + lpProc = MakeProcInstance((FARPROC)Promotion, hInst); + DialogBox(hInst, MAKEINTRESOURCE(DLG_PromotionKing), + hwnd, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + + /* Toggle ShowThinking */ + VOID + ToggleShowThinking() + { + appData.showThinking = !appData.showThinking; + ShowThinkingEvent(); + } + + VOID + LoadGameDialog(HWND hwnd, char* title) + { + UINT number = 0; + FILE *f; + char fileTitle[MSG_SIZ]; + f = OpenFileDialog(hwnd, "rb", "", + appData.oldSaveStyle ? "gam" : "pgn", + GAME_FILT, + title, &number, fileTitle, NULL); + if (f != NULL) { + cmailMsgLoaded = FALSE; + if (number == 0) { + int error = GameListBuild(f); + if (error) { + DisplayError("Cannot build game list", error); + } else if (!ListEmpty(&gameList) && + ((ListGame *) gameList.tailPred)->number > 1) { + GameListPopUp(f, fileTitle); + return; + } + GameListDestroy(); + number = 1; + } + LoadGame(f, number, fileTitle, FALSE); + } + } + + VOID + ChangedConsoleFont() + { + CHARFORMAT cfmt; + CHARRANGE tmpsel, sel; + MyFont *f = font[boardSize][CONSOLE_FONT]; + HWND hText = GetDlgItem(hwndConsole, OPT_ConsoleText); + HWND hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + PARAFORMAT paraf; + + cfmt.cbSize = sizeof(CHARFORMAT); + cfmt.dwMask = CFM_FACE|CFM_SIZE|CFM_CHARSET; + strcpy(cfmt.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName); + /* yHeight is expressed in twips. A twip is 1/20 of a font's point + * size. This was undocumented in the version of MSVC++ that I had + * when I wrote the code, but is apparently documented now. + */ + cfmt.yHeight = (int)(f->mfp.pointSize * 20.0 + 0.5); + cfmt.bCharSet = f->lf.lfCharSet; + cfmt.bPitchAndFamily = f->lf.lfPitchAndFamily; + SendMessage(hText, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &cfmt); + SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &cfmt); + /* Why are the following seemingly needed too? */ + SendMessage(hText, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM) &cfmt); + SendMessage(hInput, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM) &cfmt); + SendMessage(hText, EM_EXGETSEL, 0, (LPARAM)&sel); + tmpsel.cpMin = 0; + tmpsel.cpMax = -1; /*999999?*/ + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&tmpsel); + SendMessage(hText, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cfmt); + /* Trying putting this here too. It still seems to tickle a RichEdit + * bug: sometimes RichEdit indents the first line of a paragraph too. + */ + paraf.cbSize = sizeof(paraf); + paraf.dwMask = PFM_OFFSET | PFM_STARTINDENT; + paraf.dxStartIndent = 0; + paraf.dxOffset = WRAP_INDENT; + SendMessage(hText, EM_SETPARAFORMAT, 0, (LPARAM) ¶f); + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); + } + + /*---------------------------------------------------------------------------*\ + * + * Window Proc for main window + * + \*---------------------------------------------------------------------------*/ + + /* Process messages for main window, etc. */ + LRESULT CALLBACK + WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + FARPROC lpProc; + int wmId, wmEvent; + char *defName; + FILE *f; + UINT number; + char fileTitle[MSG_SIZ]; ++ char buf[MSG_SIZ]; + static SnapData sd; + + switch (message) { + + case WM_PAINT: /* message: repaint portion of window */ + PaintProc(hwnd); + break; + + case WM_ERASEBKGND: + if (IsIconic(hwnd)) { + /* Cheat; change the message */ + return (DefWindowProc(hwnd, WM_ICONERASEBKGND, wParam, lParam)); + } else { + return (DefWindowProc(hwnd, message, wParam, lParam)); + } + break; + + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + case WM_MOUSEMOVE: ++ case WM_MOUSEWHEEL: + MouseEvent(hwnd, message, wParam, lParam); + break; + + case WM_CHAR: + + if (appData.icsActive) { + if (wParam == '\t') { + if (GetKeyState(VK_SHIFT) < 0) { + /* shifted */ + HWND h = GetDlgItem(hwndConsole, OPT_ConsoleInput); + if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); + SetFocus(h); + } else { + /* unshifted */ + HWND h = GetDlgItem(hwndConsole, OPT_ConsoleText); + if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); + SetFocus(h); + } + } else { + HWND h = GetDlgItem(hwndConsole, OPT_ConsoleInput); + if (IsIconic(hwndConsole)) ShowWindow(hwndConsole, SW_RESTORE); + SetFocus(h); + SendMessage(h, message, wParam, lParam); + } + } else if (isalpha((char)wParam) || isdigit((char)wParam)) { + PopUpMoveDialog((char)wParam); + } + break; + + case WM_PALETTECHANGED: + if (hwnd != (HWND)wParam && !appData.monoMode) { + int nnew; + HDC hdc = GetDC(hwndMain); + SelectPalette(hdc, hPal, TRUE); + nnew = RealizePalette(hdc); + if (nnew > 0) { + paletteChanged = TRUE; + #if 0 + UpdateColors(hdc); + #else + InvalidateRect(hwnd, &boardRect, FALSE);/*faster!*/ + #endif + } + ReleaseDC(hwnd, hdc); + } + break; + + case WM_QUERYNEWPALETTE: + if (!appData.monoMode /*&& paletteChanged*/) { + int nnew; + HDC hdc = GetDC(hwndMain); + paletteChanged = FALSE; + SelectPalette(hdc, hPal, FALSE); + nnew = RealizePalette(hdc); + if (nnew > 0) { + InvalidateRect(hwnd, &boardRect, FALSE); + } + ReleaseDC(hwnd, hdc); + return TRUE; + } + return FALSE; + + case WM_COMMAND: /* message: command from application menu */ + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + + switch (wmId) { + case IDM_NewGame: + ResetGameEvent(); + AnalysisPopDown(); + break; + + case IDM_NewGameFRC: + if( NewGameFRC() == 0 ) { + ResetGameEvent(); + AnalysisPopDown(); + } + break; + + case IDM_NewVariant: + NewVariantPopup(hwnd); + break; + + case IDM_LoadGame: + LoadGameDialog(hwnd, "Load Game from File"); + break; + + case IDM_LoadNextGame: + ReloadGame(1); + break; + + case IDM_LoadPrevGame: + ReloadGame(-1); + break; + + case IDM_ReloadGame: + ReloadGame(0); + break; + + case IDM_LoadPosition: + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + Reset(FALSE, TRUE); + } + number = 1; + f = OpenFileDialog(hwnd, "rb", "", + appData.oldSaveStyle ? "pos" : "fen", + POSITION_FILT, + "Load Position from File", &number, fileTitle, NULL); + if (f != NULL) { + LoadPosition(f, number, fileTitle); + } + break; + + case IDM_LoadNextPosition: + ReloadPosition(1); + break; + + case IDM_LoadPrevPosition: + ReloadPosition(-1); + break; + + case IDM_ReloadPosition: + ReloadPosition(0); + break; + + case IDM_SaveGame: + defName = DefaultFileName(appData.oldSaveStyle ? "gam" : "pgn"); + f = OpenFileDialog(hwnd, "a", defName, + appData.oldSaveStyle ? "gam" : "pgn", + GAME_FILT, + "Save Game to File", NULL, fileTitle, NULL); + if (f != NULL) { + SaveGame(f, 0, ""); + } + break; + + case IDM_SavePosition: + defName = DefaultFileName(appData.oldSaveStyle ? "pos" : "fen"); + f = OpenFileDialog(hwnd, "a", defName, + appData.oldSaveStyle ? "pos" : "fen", + POSITION_FILT, + "Save Position to File", NULL, fileTitle, NULL); + if (f != NULL) { + SavePosition(f, 0, ""); + } + break; + + case IDM_SaveDiagram: + defName = "diagram"; + f = OpenFileDialog(hwnd, "wb", defName, + "bmp", + DIAGRAM_FILT, + "Save Diagram to File", NULL, fileTitle, NULL); + if (f != NULL) { + SaveDiagram(f); + } + break; + + case IDM_CopyGame: + CopyGameToClipboard(); + break; + + case IDM_PasteGame: + PasteGameFromClipboard(); + break; + + case IDM_CopyGameListToClipboard: + CopyGameListToClipboard(); + break; + + /* [AS] Autodetect FEN or PGN data */ + case IDM_PasteAny: + PasteGameOrFENFromClipboard(); + break; + + /* [AS] Move history */ + case IDM_ShowMoveHistory: + if( MoveHistoryIsUp() ) { + MoveHistoryPopDown(); + } + else { + MoveHistoryPopUp(); + } + break; + + /* [AS] Eval graph */ + case IDM_ShowEvalGraph: + if( EvalGraphIsUp() ) { + EvalGraphPopDown(); + } + else { + EvalGraphPopUp(); + } + break; + + /* [AS] Engine output */ + case IDM_ShowEngineOutput: + if( EngineOutputIsUp() ) { + EngineOutputPopDown(); + } + else { + EngineOutputPopUp(); + } + break; + + /* [AS] User adjudication */ + case IDM_UserAdjudication_White: + UserAdjudicationEvent( +1 ); + break; + + case IDM_UserAdjudication_Black: + UserAdjudicationEvent( -1 ); + break; + + case IDM_UserAdjudication_Draw: + UserAdjudicationEvent( 0 ); + break; + + /* [AS] Game list options dialog */ + case IDM_GameListOptions: + GameListOptions(); + break; + + case IDM_CopyPosition: + CopyFENToClipboard(); + break; + + case IDM_PastePosition: + PasteFENFromClipboard(); + break; + + case IDM_MailMove: + MailMoveEvent(); + break; + + case IDM_ReloadCMailMsg: + Reset(TRUE, TRUE); + ReloadCmailMsgEvent(FALSE); + break; + + case IDM_Minimize: + ShowWindow(hwnd, SW_MINIMIZE); + break; + + case IDM_Exit: + ExitEvent(0); + break; + + case IDM_MachineWhite: + MachineWhiteEvent(); + /* + * refresh the tags dialog only if it's visible + */ + if (gameMode == MachinePlaysWhite && IsWindowVisible(editTagsDialog)) { + char *tags; + tags = PGNTags(&gameInfo); + TagsPopUp(tags, CmailMsg()); + free(tags); + } + break; + + case IDM_MachineBlack: + MachineBlackEvent(); + /* + * refresh the tags dialog only if it's visible + */ + if (gameMode == MachinePlaysBlack && IsWindowVisible(editTagsDialog)) { + char *tags; + tags = PGNTags(&gameInfo); + TagsPopUp(tags, CmailMsg()); + free(tags); + } + break; + + case IDM_TwoMachines: + TwoMachinesEvent(); + /* + * refresh the tags dialog only if it's visible + */ + if (gameMode == TwoMachinesPlay && IsWindowVisible(editTagsDialog)) { + char *tags; + tags = PGNTags(&gameInfo); + TagsPopUp(tags, CmailMsg()); + free(tags); + } + break; + + case IDM_AnalysisMode: + if (!first.analysisSupport) { - char buf[MSG_SIZ]; + sprintf(buf, "%s does not support analysis", first.tidy); + DisplayError(buf, 0); + } else { ++ /* [DM] icsEngineAnlyze [HGM] Why is this front-end??? */ ++ if (appData.icsActive) { ++ if (gameMode != IcsObserving) { ++ sprintf(buf, "You are not observing a game"); ++ DisplayError(buf, 0); ++ /* secure check */ ++ if (appData.icsEngineAnalyze) { ++ if (appData.debugMode) ++ fprintf(debugFP, "Found unexpected active ICS engine analyze \n"); ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ break; ++ } ++ break; ++ } else { ++ /* if enable, user want disable icsEngineAnalyze */ ++ if (appData.icsEngineAnalyze) { ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ break; ++ } ++ appData.icsEngineAnalyze = TRUE; ++ if (appData.debugMode) fprintf(debugFP, "ICS engine analyze starting...\n"); ++ } ++ } + if (!appData.showThinking) ToggleShowThinking(); + AnalyzeModeEvent(); + } + break; + + case IDM_AnalyzeFile: + if (!first.analysisSupport) { + char buf[MSG_SIZ]; + sprintf(buf, "%s does not support analysis", first.tidy); + DisplayError(buf, 0); + } else { + if (!appData.showThinking) ToggleShowThinking(); + AnalyzeFileEvent(); + LoadGameDialog(hwnd, "Analyze Game from File"); + AnalysisPeriodicEvent(1); + } + break; + + case IDM_IcsClient: + IcsClientEvent(); + break; + + case IDM_EditGame: + EditGameEvent(); + break; + + case IDM_EditPosition: + EditPositionEvent(); + break; + + case IDM_Training: + TrainingEvent(); + break; + + case IDM_ShowGameList: + ShowGameListProc(); + break; + + case IDM_EditTags: + EditTagsProc(); + break; + + case IDM_EditComment: + if (commentDialogUp && editComment) { + CommentPopDown(); + } else { + EditCommentEvent(); + } + break; + + case IDM_Pause: + PauseEvent(); + break; + + case IDM_Accept: + AcceptEvent(); + break; + + case IDM_Decline: + DeclineEvent(); + break; + + case IDM_Rematch: + RematchEvent(); + break; + + case IDM_CallFlag: + CallFlagEvent(); + break; + + case IDM_Draw: + DrawEvent(); + break; + + case IDM_Adjourn: + AdjournEvent(); + break; + + case IDM_Abort: + AbortEvent(); + break; + + case IDM_Resign: + ResignEvent(); + break; + + case IDM_StopObserving: + StopObservingEvent(); + break; + + case IDM_StopExamining: + StopExaminingEvent(); + break; + + case IDM_TypeInMove: + PopUpMoveDialog('\000'); + break; + + case IDM_TypeInName: + PopUpNameDialog('\000'); + break; + + case IDM_Backward: + BackwardEvent(); + SetFocus(hwndMain); + break; + + case IDM_Forward: + ForwardEvent(); + SetFocus(hwndMain); + break; + + case IDM_ToStart: + ToStartEvent(); + SetFocus(hwndMain); + break; + + case IDM_ToEnd: + ToEndEvent(); + SetFocus(hwndMain); + break; + + case IDM_Revert: + RevertEvent(); + break; + + case IDM_TruncateGame: + TruncateGameEvent(); + break; + + case IDM_MoveNow: + MoveNowEvent(); + break; + + case IDM_RetractMove: + RetractMoveEvent(); + break; + + case IDM_FlipView: + flipView = !flipView; + DrawPosition(FALSE, NULL); + break; + + case IDM_FlipClock: + flipClock = !flipClock; + DisplayBothClocks(); + break; + + case IDM_GeneralOptions: + GeneralOptionsPopup(hwnd); + DrawPosition(TRUE, NULL); + break; + + case IDM_BoardOptions: + BoardOptionsPopup(hwnd); + break; + + case IDM_EnginePlayOptions: + EnginePlayOptionsPopup(hwnd); + break; + + case IDM_OptionsUCI: + UciOptionsPopup(hwnd); + break; + + case IDM_IcsOptions: + IcsOptionsPopup(hwnd); + break; + + case IDM_Fonts: + FontsOptionsPopup(hwnd); + break; + + case IDM_Sounds: + SoundOptionsPopup(hwnd); + break; + + case IDM_CommPort: + CommPortOptionsPopup(hwnd); + break; + + case IDM_LoadOptions: + LoadOptionsPopup(hwnd); + break; + + case IDM_SaveOptions: + SaveOptionsPopup(hwnd); + break; + + case IDM_TimeControl: + TimeControlOptionsPopup(hwnd); + break; + + case IDM_SaveSettings: + SaveSettings(settingsFileName); + break; + + case IDM_SaveSettingsOnExit: + saveSettingsOnExit = !saveSettingsOnExit; + (void) CheckMenuItem(GetMenu(hwndMain), IDM_SaveSettingsOnExit, + MF_BYCOMMAND|(saveSettingsOnExit ? + MF_CHECKED : MF_UNCHECKED)); + break; + + case IDM_Hint: + HintEvent(); + break; + + case IDM_Book: + BookEvent(); + break; + + case IDM_AboutGame: + AboutGameEvent(); + break; + + case IDM_Debug: + appData.debugMode = !appData.debugMode; + if (appData.debugMode) { + char dir[MSG_SIZ]; + GetCurrentDirectory(MSG_SIZ, dir); + SetCurrentDirectory(installDir); + debugFP = fopen(appData.nameOfDebugFile, "w"); + SetCurrentDirectory(dir); + setbuf(debugFP, NULL); + } else { + fclose(debugFP); + debugFP = NULL; + } + break; + + case IDM_HELPCONTENTS: + if (!WinHelp (hwnd, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS")) { + MessageBox (GetFocus(), + "Unable to activate help", + szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); + } + break; + + case IDM_HELPSEARCH: + if (!WinHelp(hwnd, "winboard.hlp", HELP_PARTIALKEY, (DWORD)(LPSTR)"")) { + MessageBox (GetFocus(), + "Unable to activate help", + szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); + } + break; + + case IDM_HELPHELP: + if(!WinHelp(hwnd, (LPSTR)NULL, HELP_HELPONHELP, 0)) { + MessageBox (GetFocus(), + "Unable to activate help", + szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); + } + break; + + case IDM_ABOUT: + lpProc = MakeProcInstance((FARPROC)About, hInst); + DialogBox(hInst, + (gameInfo.event && strcmp(gameInfo.event, "Easter Egg Hunt") == 0) ? + "AboutBox2" : "AboutBox", hwnd, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + break; + + case IDM_DirectCommand1: + AskQuestionEvent("Direct Command", + "Send to chess program:", "", "1"); + break; + case IDM_DirectCommand2: + AskQuestionEvent("Direct Command", + "Send to second chess program:", "", "2"); + break; + + case EP_WhitePawn: + EditPositionMenuEvent(WhitePawn, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteKnight: + EditPositionMenuEvent(WhiteKnight, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteBishop: + EditPositionMenuEvent(WhiteBishop, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteRook: + EditPositionMenuEvent(WhiteRook, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteQueen: + EditPositionMenuEvent(WhiteQueen, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteFerz: + EditPositionMenuEvent(WhiteFerz, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteWazir: + EditPositionMenuEvent(WhiteWazir, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteAlfil: + EditPositionMenuEvent(WhiteAlfil, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteCannon: + EditPositionMenuEvent(WhiteCannon, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteCardinal: + EditPositionMenuEvent(WhiteAngel, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteMarshall: + EditPositionMenuEvent(WhiteMarshall, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_WhiteKing: + EditPositionMenuEvent(WhiteKing, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackPawn: + EditPositionMenuEvent(BlackPawn, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackKnight: + EditPositionMenuEvent(BlackKnight, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackBishop: + EditPositionMenuEvent(BlackBishop, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackRook: + EditPositionMenuEvent(BlackRook, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackQueen: + EditPositionMenuEvent(BlackQueen, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackFerz: + EditPositionMenuEvent(BlackFerz, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackWazir: + EditPositionMenuEvent(BlackWazir, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackAlfil: + EditPositionMenuEvent(BlackAlfil, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackCannon: + EditPositionMenuEvent(BlackCannon, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackCardinal: + EditPositionMenuEvent(BlackAngel, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackMarshall: + EditPositionMenuEvent(BlackMarshall, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_BlackKing: + EditPositionMenuEvent(BlackKing, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_EmptySquare: + EditPositionMenuEvent(EmptySquare, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_ClearBoard: + EditPositionMenuEvent(ClearBoard, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_White: + EditPositionMenuEvent(WhitePlay, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_Black: + EditPositionMenuEvent(BlackPlay, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_Promote: + EditPositionMenuEvent(PromotePiece, fromX, fromY); + fromX = fromY = -1; + break; + + case EP_Demote: + EditPositionMenuEvent(DemotePiece, fromX, fromY); + fromX = fromY = -1; + break; + + case DP_Pawn: + DropMenuEvent(WhitePawn, fromX, fromY); + fromX = fromY = -1; + break; + + case DP_Knight: + DropMenuEvent(WhiteKnight, fromX, fromY); + fromX = fromY = -1; + break; + + case DP_Bishop: + DropMenuEvent(WhiteBishop, fromX, fromY); + fromX = fromY = -1; + break; + + case DP_Rook: + DropMenuEvent(WhiteRook, fromX, fromY); + fromX = fromY = -1; + break; + + case DP_Queen: + DropMenuEvent(WhiteQueen, fromX, fromY); + fromX = fromY = -1; + break; + + default: + return (DefWindowProc(hwnd, message, wParam, lParam)); + } + break; + + case WM_TIMER: + switch (wParam) { + case CLOCK_TIMER_ID: + KillTimer(hwnd, clockTimerEvent); /* Simulate one-shot timer as in X */ + clockTimerEvent = 0; + DecrementClocks(); /* call into back end */ + break; + case LOAD_GAME_TIMER_ID: + KillTimer(hwnd, loadGameTimerEvent); /* Simulate one-shot timer as in X*/ + loadGameTimerEvent = 0; + AutoPlayGameLoop(); /* call into back end */ + break; + case ANALYSIS_TIMER_ID: - if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && - appData.periodicUpdates) { ++ if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile ++ || appData.icsEngineAnalyze) && appData.periodicUpdates) { + AnalysisPeriodicEvent(0); + } else { + KillTimer(hwnd, analysisTimerEvent); + analysisTimerEvent = 0; + } + break; + case DELAYED_TIMER_ID: + KillTimer(hwnd, delayedTimerEvent); + delayedTimerEvent = 0; + delayedTimerCallback(); + break; + } + break; + + case WM_USER_Input: + InputEvent(hwnd, message, wParam, lParam); + break; + + /* [AS] Also move "attached" child windows */ + case WM_WINDOWPOSCHANGING: + if( hwnd == hwndMain && appData.useStickyWindows ) { + LPWINDOWPOS lpwp = (LPWINDOWPOS) lParam; + + if( ((lpwp->flags & SWP_NOMOVE) == 0) && ((lpwp->flags & SWP_NOSIZE) != 0) ) { + /* Window is moving */ + RECT rcMain; + + GetWindowRect( hwnd, &rcMain ); + + ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, moveHistoryDialog, &wpMoveHistory ); + ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, evalGraphDialog, &wpEvalGraph ); + ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, engineOutputDialog, &wpEngineOutput ); + } + } + break; + + /* [AS] Snapping */ + case WM_ENTERSIZEMOVE: + if(appData.debugMode) { fprintf(debugFP, "size-move\n"); } + if (hwnd == hwndMain) { + doingSizing = TRUE; + lastSizing = 0; + } + return OnEnterSizeMove( &sd, hwnd, wParam, lParam ); + break; + + case WM_SIZING: + if(appData.debugMode) { fprintf(debugFP, "sizing\n"); } + if (hwnd == hwndMain) { + lastSizing = wParam; + } + break; + + case WM_MOVING: + if(appData.debugMode) { fprintf(debugFP, "moving\n"); } + return OnMoving( &sd, hwnd, wParam, lParam ); + + case WM_EXITSIZEMOVE: + if(appData.debugMode) { fprintf(debugFP, "exit size-move, size = %d\n", squareSize); } + if (hwnd == hwndMain) { + RECT client; + doingSizing = FALSE; + InvalidateRect(hwnd, &boardRect, FALSE); + GetClientRect(hwnd, &client); + ResizeBoard(client.right, client.bottom, lastSizing); + lastSizing = 0; + if(appData.debugMode) { fprintf(debugFP, "square size = %d\n", squareSize); } + } + return OnExitSizeMove( &sd, hwnd, wParam, lParam ); + break; + + case WM_DESTROY: /* message: window being destroyed */ + PostQuitMessage(0); + break; + + case WM_CLOSE: + if (hwnd == hwndMain) { + ExitEvent(0); + } + break; + + default: /* Passes it on if unprocessed */ + return (DefWindowProc(hwnd, message, wParam, lParam)); + } + return 0; + } + + /*---------------------------------------------------------------------------*\ + * + * Misc utility routines + * + \*---------------------------------------------------------------------------*/ + + /* + * Decent random number generator, at least not as bad as Windows + * standard rand, which returns a value in the range 0 to 0x7fff. + */ + unsigned int randstate; + + int + myrandom(void) + { + randstate = randstate * 1664525 + 1013904223; + return (int) randstate & 0x7fffffff; + } + + void + mysrandom(unsigned int seed) + { + randstate = seed; + } + + + /* + * returns TRUE if user selects a different color, FALSE otherwise + */ + + BOOL + ChangeColor(HWND hwnd, COLORREF *which) + { + static BOOL firstTime = TRUE; + static DWORD customColors[16]; + CHOOSECOLOR cc; + COLORREF newcolor; + int i; + ColorClass ccl; + + if (firstTime) { + /* Make initial colors in use available as custom colors */ + /* Should we put the compiled-in defaults here instead? */ + i = 0; + customColors[i++] = lightSquareColor & 0xffffff; + customColors[i++] = darkSquareColor & 0xffffff; + customColors[i++] = whitePieceColor & 0xffffff; + customColors[i++] = blackPieceColor & 0xffffff; + customColors[i++] = highlightSquareColor & 0xffffff; + customColors[i++] = premoveHighlightColor & 0xffffff; + + for (ccl = (ColorClass) 0; ccl < NColorClasses && i < 16; ccl++) { + customColors[i++] = textAttribs[ccl].color; + } + while (i < 16) customColors[i++] = RGB(255, 255, 255); + firstTime = FALSE; + } + + cc.lStructSize = sizeof(cc); + cc.hwndOwner = hwnd; + cc.hInstance = NULL; + cc.rgbResult = (DWORD) (*which & 0xffffff); + cc.lpCustColors = (LPDWORD) customColors; + cc.Flags = CC_RGBINIT|CC_FULLOPEN; + + if (!ChooseColor(&cc)) return FALSE; + + newcolor = (COLORREF) (0x2000000 | cc.rgbResult); + if (newcolor == *which) return FALSE; + *which = newcolor; + return TRUE; + + /* + InitDrawingColors(); + InvalidateRect(hwnd, &boardRect, FALSE); + */ + } + + BOOLEAN + MyLoadSound(MySound *ms) + { + BOOL ok = FALSE; + struct stat st; + FILE *f; + + if (ms->data) free(ms->data); + ms->data = NULL; + + switch (ms->name[0]) { + case NULLCHAR: + /* Silence */ + ok = TRUE; + break; + case '$': + /* System sound from Control Panel. Don't preload here. */ + ok = TRUE; + break; + case '!': + if (ms->name[1] == NULLCHAR) { + /* "!" alone = silence */ + ok = TRUE; + } else { + /* Builtin wave resource. Error if not found. */ + HANDLE h = FindResource(hInst, ms->name + 1, "WAVE"); + if (h == NULL) break; + ms->data = (void *)LoadResource(hInst, h); + if (h == NULL) break; + ok = TRUE; + } + break; + default: + /* .wav file. Error if not found. */ + f = fopen(ms->name, "rb"); + if (f == NULL) break; + if (fstat(fileno(f), &st) < 0) break; + ms->data = malloc(st.st_size); + if (fread(ms->data, st.st_size, 1, f) < 1) break; + fclose(f); + ok = TRUE; + break; + } + if (!ok) { + char buf[MSG_SIZ]; + sprintf(buf, "Error loading sound %s", ms->name); + DisplayError(buf, GetLastError()); + } + return ok; + } + + BOOLEAN + MyPlaySound(MySound *ms) + { + BOOLEAN ok = FALSE; + switch (ms->name[0]) { + case NULLCHAR: + /* Silence */ + ok = TRUE; + break; + case '$': + /* System sound from Control Panel (deprecated feature). + "$" alone or an unset sound name gets default beep (still in use). */ + if (ms->name[1]) { + ok = PlaySound(ms->name + 1, NULL, SND_ALIAS|SND_ASYNC); + } + if (!ok) ok = MessageBeep(MB_OK); + break; + case '!': + /* Builtin wave resource, or "!" alone for silence */ + if (ms->name[1]) { + if (ms->data == NULL) return FALSE; + ok = PlaySound(ms->data, NULL, SND_MEMORY|SND_ASYNC); + } else { + ok = TRUE; + } + break; + default: + /* .wav file. Error if not found. */ + if (ms->data == NULL) return FALSE; + ok = PlaySound(ms->data, NULL, SND_MEMORY|SND_ASYNC); + break; + } + /* Don't print an error: this can happen innocently if the sound driver + is busy; for instance, if another instance of WinBoard is playing + a sound at about the same time. */ + #if 0 + if (!ok) { + char buf[MSG_SIZ]; + sprintf(buf, "Error playing sound %s", ms->name); + DisplayError(buf, GetLastError()); + } + #endif + return ok; + } + + + LRESULT CALLBACK + OldOpenFileHook(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + BOOL ok; + OPENFILENAME *ofn; + static UINT *number; /* gross that this is static */ + + switch (message) { + case WM_INITDIALOG: /* message: initialize dialog box */ + /* Center the dialog over the application window */ + ofn = (OPENFILENAME *) lParam; + if (ofn->Flags & OFN_ENABLETEMPLATE) { + number = (UINT *) ofn->lCustData; + SendMessage(GetDlgItem(hDlg, edt2), WM_SETTEXT, 0, (LPARAM) ""); + } else { + number = NULL; + } + CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); + return FALSE; /* Allow for further processing */ + + case WM_COMMAND: + if ((LOWORD(wParam) == IDOK) && (number != NULL)) { + *number = GetDlgItemInt(hDlg, OPT_IndexNumberOld, &ok, FALSE); + } + return FALSE; /* Allow for further processing */ + } + return FALSE; + } + + UINT APIENTRY + OpenFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) + { + static UINT *number; + OPENFILENAME *ofname; + OFNOTIFY *ofnot; + switch (uiMsg) { + case WM_INITDIALOG: + ofname = (OPENFILENAME *)lParam; + number = (UINT *)(ofname->lCustData); + break; + case WM_NOTIFY: + ofnot = (OFNOTIFY *)lParam; + if (ofnot->hdr.code == CDN_FILEOK) { + *number = GetDlgItemInt(hdlg, OPT_IndexNumber, NULL, FALSE); + } + break; + } + return 0; + } + + + FILE * + OpenFileDialog(HWND hwnd, char *write, char *defName, char *defExt, // [HGM] diag: type of 'write' now string + char *nameFilt, char *dlgTitle, UINT *number, + char fileTitle[MSG_SIZ], char fileName[MSG_SIZ]) + { + OPENFILENAME openFileName; + char buf1[MSG_SIZ]; + FILE *f; + + if (fileName == NULL) fileName = buf1; + if (defName == NULL) { + strcpy(fileName, "*."); + strcat(fileName, defExt); + } else { + strcpy(fileName, defName); + } + if (fileTitle) strcpy(fileTitle, ""); + if (number) *number = 0; + + openFileName.lStructSize = sizeof(OPENFILENAME); + openFileName.hwndOwner = hwnd; + openFileName.hInstance = (HANDLE) hInst; + openFileName.lpstrFilter = nameFilt; + openFileName.lpstrCustomFilter = (LPSTR) NULL; + openFileName.nMaxCustFilter = 0L; + openFileName.nFilterIndex = 1L; + openFileName.lpstrFile = fileName; + openFileName.nMaxFile = MSG_SIZ; + openFileName.lpstrFileTitle = fileTitle; + openFileName.nMaxFileTitle = fileTitle ? MSG_SIZ : 0; + openFileName.lpstrInitialDir = NULL; + openFileName.lpstrTitle = dlgTitle; + openFileName.Flags = OFN_PATHMUSTEXIST | OFN_HIDEREADONLY + | (write[0] != 'r' ? 0 : OFN_FILEMUSTEXIST) + | (number ? OFN_ENABLETEMPLATE | OFN_ENABLEHOOK: 0) + | (oldDialog ? 0 : OFN_EXPLORER); + openFileName.nFileOffset = 0; + openFileName.nFileExtension = 0; + openFileName.lpstrDefExt = defExt; + openFileName.lCustData = (LONG) number; + openFileName.lpfnHook = oldDialog ? + (LPOFNHOOKPROC) OldOpenFileHook : (LPOFNHOOKPROC) OpenFileHook; + openFileName.lpTemplateName = (LPSTR)(oldDialog ? 1536 : DLG_IndexNumber); + + if (write[0] != 'r' ? GetSaveFileName(&openFileName) : + GetOpenFileName(&openFileName)) { + /* open the file */ + f = fopen(openFileName.lpstrFile, write); + if (f == NULL) { + MessageBox(hwnd, "File open failed", NULL, + MB_OK|MB_ICONEXCLAMATION); + return NULL; + } + } else { + int err = CommDlgExtendedError(); + if (err != 0) DisplayError("Internal error in file dialog box", err); + return FALSE; + } + return f; + } + + + + VOID APIENTRY + MenuPopup(HWND hwnd, POINT pt, HMENU hmenu, UINT def) + { + HMENU hmenuTrackPopup; /* floating pop-up menu */ + + /* + * Get the first pop-up menu in the menu template. This is the + * menu that TrackPopupMenu displays. + */ + hmenuTrackPopup = GetSubMenu(hmenu, 0); + + SetMenuDefaultItem(hmenuTrackPopup, def, FALSE); + + /* + * TrackPopup uses screen coordinates, so convert the + * coordinates of the mouse click to screen coordinates. + */ + ClientToScreen(hwnd, (LPPOINT) &pt); + + /* Draw and track the floating pop-up menu. */ + TrackPopupMenu(hmenuTrackPopup, TPM_CENTERALIGN | TPM_RIGHTBUTTON, + pt.x, pt.y, 0, hwnd, NULL); + + /* Destroy the menu.*/ + DestroyMenu(hmenu); + } + + typedef struct { + HWND hDlg, hText; + int sizeX, sizeY, newSizeX, newSizeY; + HDWP hdwp; + } ResizeEditPlusButtonsClosure; + + BOOL CALLBACK + ResizeEditPlusButtonsCallback(HWND hChild, LPARAM lparam) + { + ResizeEditPlusButtonsClosure *cl = (ResizeEditPlusButtonsClosure *)lparam; + RECT rect; + POINT pt; + + if (hChild == cl->hText) return TRUE; + GetWindowRect(hChild, &rect); /* gives screen coords */ + pt.x = rect.left + (cl->newSizeX - cl->sizeX)/2; + pt.y = rect.top + cl->newSizeY - cl->sizeY; + ScreenToClient(cl->hDlg, &pt); + cl->hdwp = DeferWindowPos(cl->hdwp, hChild, NULL, + pt.x, pt.y, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER); + return TRUE; + } + + /* Resize a dialog that has a (rich) edit field filling most of + the top, with a row of buttons below */ + VOID + ResizeEditPlusButtons(HWND hDlg, HWND hText, int sizeX, int sizeY, int newSizeX, int newSizeY) + { + RECT rectText; + int newTextHeight, newTextWidth; + ResizeEditPlusButtonsClosure cl; + + /*if (IsIconic(hDlg)) return;*/ + if (newSizeX == sizeX && newSizeY == sizeY) return; + + cl.hdwp = BeginDeferWindowPos(8); + + GetWindowRect(hText, &rectText); /* gives screen coords */ + newTextWidth = rectText.right - rectText.left + newSizeX - sizeX; + newTextHeight = rectText.bottom - rectText.top + newSizeY - sizeY; + if (newTextHeight < 0) { + newSizeY += -newTextHeight; + newTextHeight = 0; + } + cl.hdwp = DeferWindowPos(cl.hdwp, hText, NULL, 0, 0, + newTextWidth, newTextHeight, SWP_NOZORDER|SWP_NOMOVE); + + cl.hDlg = hDlg; + cl.hText = hText; + cl.sizeX = sizeX; + cl.sizeY = sizeY; + cl.newSizeX = newSizeX; + cl.newSizeY = newSizeY; + EnumChildWindows(hDlg, ResizeEditPlusButtonsCallback, (LPARAM)&cl); + + EndDeferWindowPos(cl.hdwp); + } + + BOOL CenterWindowEx(HWND hwndChild, HWND hwndParent, int mode) + { + RECT rChild, rParent; + int wChild, hChild, wParent, hParent; + int wScreen, hScreen, xNew, yNew; + HDC hdc; + + /* Get the Height and Width of the child window */ + GetWindowRect (hwndChild, &rChild); + wChild = rChild.right - rChild.left; + hChild = rChild.bottom - rChild.top; + + /* Get the Height and Width of the parent window */ + GetWindowRect (hwndParent, &rParent); + wParent = rParent.right - rParent.left; + hParent = rParent.bottom - rParent.top; + + /* Get the display limits */ + hdc = GetDC (hwndChild); + wScreen = GetDeviceCaps (hdc, HORZRES); + hScreen = GetDeviceCaps (hdc, VERTRES); + ReleaseDC(hwndChild, hdc); + + /* Calculate new X position, then adjust for screen */ + xNew = rParent.left + ((wParent - wChild) /2); + if (xNew < 0) { + xNew = 0; + } else if ((xNew+wChild) > wScreen) { + xNew = wScreen - wChild; + } + + /* Calculate new Y position, then adjust for screen */ + if( mode == 0 ) { + yNew = rParent.top + ((hParent - hChild) /2); + } + else { + yNew = rParent.top + GetSystemMetrics( SM_CYCAPTION ) * 2 / 3; + } + + if (yNew < 0) { + yNew = 0; + } else if ((yNew+hChild) > hScreen) { + yNew = hScreen - hChild; + } + + /* Set it, and return */ + return SetWindowPos (hwndChild, NULL, + xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + } + + /* Center one window over another */ + BOOL CenterWindow (HWND hwndChild, HWND hwndParent) + { + return CenterWindowEx( hwndChild, hwndParent, 0 ); + } + + /*---------------------------------------------------------------------------*\ + * + * Startup Dialog functions + * + \*---------------------------------------------------------------------------*/ + void + InitComboStrings(HANDLE hwndCombo, char **cd) + { + SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); + + while (*cd != NULL) { + SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) *cd); + cd++; + } + } + + void + InitComboStringsFromOption(HANDLE hwndCombo, char *str) + { + char buf1[ARG_MAX]; + int len; + + if (str[0] == '@') { + FILE* f = fopen(str + 1, "r"); + if (f == NULL) { + DisplayFatalError(str + 1, errno, 2); + return; + } + len = fread(buf1, 1, sizeof(buf1)-1, f); + fclose(f); + buf1[len] = NULLCHAR; + str = buf1; + } + + SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); + + for (;;) { + char buf[MSG_SIZ]; + char *end = strchr(str, '\n'); + if (end == NULL) return; + memcpy(buf, str, end - str); + buf[end - str] = NULLCHAR; + SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) buf); + str = end + 1; + } + } + + void + SetStartupDialogEnables(HWND hDlg) + { + EnableWindow(GetDlgItem(hDlg, OPT_ChessEngineName), + IsDlgButtonChecked(hDlg, OPT_ChessEngine) || + appData.zippyPlay && IsDlgButtonChecked(hDlg, OPT_ChessServer)); + EnableWindow(GetDlgItem(hDlg, OPT_SecondChessEngineName), + IsDlgButtonChecked(hDlg, OPT_ChessEngine)); + EnableWindow(GetDlgItem(hDlg, OPT_ChessServerName), + IsDlgButtonChecked(hDlg, OPT_ChessServer)); + EnableWindow(GetDlgItem(hDlg, OPT_AdditionalOptions), + IsDlgButtonChecked(hDlg, OPT_AnyAdditional)); + EnableWindow(GetDlgItem(hDlg, IDOK), + IsDlgButtonChecked(hDlg, OPT_ChessEngine) || + IsDlgButtonChecked(hDlg, OPT_ChessServer) || + IsDlgButtonChecked(hDlg, OPT_View)); + } + + char * + QuoteForFilename(char *filename) + { + int dquote, space; + dquote = strchr(filename, '"') != NULL; + space = strchr(filename, ' ') != NULL; + if (dquote || space) { + if (dquote) { + return "'"; + } else { + return "\""; + } + } else { + return ""; + } + } + + VOID + InitEngineBox(HWND hDlg, HWND hwndCombo, char* nthcp, char* nthd, char* nthdir, char *nthnames) + { + char buf[MSG_SIZ]; + char *q; + + InitComboStringsFromOption(hwndCombo, nthnames); + q = QuoteForFilename(nthcp); + sprintf(buf, "%s%s%s", q, nthcp, q); + if (*nthdir != NULLCHAR) { + q = QuoteForFilename(nthdir); + sprintf(buf + strlen(buf), " /%s=%s%s%s", nthd, q, nthdir, q); + } + if (*nthcp == NULLCHAR) { + SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) 0, (LPARAM) 0); + } else if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) { + SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0); + SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf); + } + } + + LRESULT CALLBACK + StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + char buf[MSG_SIZ]; + HANDLE hwndCombo; + char *p; + + switch (message) { + case WM_INITDIALOG: + /* Center the dialog */ + CenterWindow (hDlg, GetDesktopWindow()); + /* Initialize the dialog items */ + InitEngineBox(hDlg, GetDlgItem(hDlg, OPT_ChessEngineName), + appData.firstChessProgram, "fd", appData.firstDirectory, + firstChessProgramNames); + InitEngineBox(hDlg, GetDlgItem(hDlg, OPT_SecondChessEngineName), + appData.secondChessProgram, "sd", appData.secondDirectory, + secondChessProgramNames); + hwndCombo = GetDlgItem(hDlg, OPT_ChessServerName); + InitComboStringsFromOption(hwndCombo, icsNames); + sprintf(buf, "%s /icsport=%s", appData.icsHost, appData.icsPort); + if (*appData.icsHelper != NULLCHAR) { + char *q = QuoteForFilename(appData.icsHelper); + sprintf(buf + strlen(buf), " /icshelper=%s%s%s", q, appData.icsHelper, q); + } + if (*appData.icsHost == NULLCHAR) { + SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) 0, (LPARAM) 0); + /*SendMessage(hwndCombo, CB_SHOWDROPDOWN, (WPARAM) TRUE, (LPARAM) 0); !!too soon */ + } else if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) { + SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0); + SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf); + } + + if (appData.icsActive) { + CheckDlgButton(hDlg, OPT_ChessServer, BST_CHECKED); + } + else if (appData.noChessProgram) { + CheckDlgButton(hDlg, OPT_View, BST_CHECKED); + } + else { + CheckDlgButton(hDlg, OPT_ChessEngine, BST_CHECKED); + } + + SetStartupDialogEnables(hDlg); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + if (IsDlgButtonChecked(hDlg, OPT_ChessEngine)) { + strcpy(buf, "/fcp="); + GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); + p = buf; + ParseArgs(StringGet, &p); + strcpy(buf, "/scp="); + GetDlgItemText(hDlg, OPT_SecondChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); + p = buf; + ParseArgs(StringGet, &p); + appData.noChessProgram = FALSE; + appData.icsActive = FALSE; + } else if (IsDlgButtonChecked(hDlg, OPT_ChessServer)) { + strcpy(buf, "/ics /icshost="); + GetDlgItemText(hDlg, OPT_ChessServerName, buf + strlen(buf), sizeof(buf) - strlen(buf)); + p = buf; + ParseArgs(StringGet, &p); + if (appData.zippyPlay) { + strcpy(buf, "/fcp="); + GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); + p = buf; + ParseArgs(StringGet, &p); + } + } else if (IsDlgButtonChecked(hDlg, OPT_View)) { + appData.noChessProgram = TRUE; + appData.icsActive = FALSE; + } else { + MessageBox(hDlg, "Choose an option, or cancel to exit", + "Option Error", MB_OK|MB_ICONEXCLAMATION); + return TRUE; + } + if (IsDlgButtonChecked(hDlg, OPT_AnyAdditional)) { + GetDlgItemText(hDlg, OPT_AdditionalOptions, buf, sizeof(buf)); + p = buf; + ParseArgs(StringGet, &p); + } + EndDialog(hDlg, TRUE); + return TRUE; + + case IDCANCEL: + ExitEvent(0); + return TRUE; + + case IDM_HELPCONTENTS: + if (!WinHelp (hDlg, "winboard.hlp", HELP_KEY,(DWORD)(LPSTR)"CONTENTS")) { + MessageBox (GetFocus(), + "Unable to activate help", + szAppName, MB_SYSTEMMODAL|MB_OK|MB_ICONHAND); + } + break; + + default: + SetStartupDialogEnables(hDlg); + break; + } + break; + } + return FALSE; + } + + /*---------------------------------------------------------------------------*\ + * + * About box dialog functions + * + \*---------------------------------------------------------------------------*/ + + /* Process messages for "About" dialog box */ + LRESULT CALLBACK + About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + switch (message) { + case WM_INITDIALOG: /* message: initialize dialog box */ + /* Center the dialog over the application window */ + CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER)); + SetDlgItemText(hDlg, ABOUTBOX_Version, programVersion); + return (TRUE); + + case WM_COMMAND: /* message: received a command */ + if (LOWORD(wParam) == IDOK /* "OK" box selected? */ + || LOWORD(wParam) == IDCANCEL) { /* System menu close command? */ + EndDialog(hDlg, TRUE); /* Exit the dialog */ + return (TRUE); + } + break; + } + return (FALSE); + } + + /*---------------------------------------------------------------------------*\ + * + * Comment Dialog functions + * + \*---------------------------------------------------------------------------*/ + + LRESULT CALLBACK + CommentDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static HANDLE hwndText = NULL; + int len, newSizeX, newSizeY, flags; + static int sizeX, sizeY; + char *str; + RECT rect; + MINMAXINFO *mmi; + + switch (message) { + case WM_INITDIALOG: /* message: initialize dialog box */ + /* Initialize the dialog items */ + hwndText = GetDlgItem(hDlg, OPT_CommentText); + SetDlgItemText(hDlg, OPT_CommentText, commentText); + EnableWindow(GetDlgItem(hDlg, OPT_CancelComment), editComment); + EnableWindow(GetDlgItem(hDlg, OPT_ClearComment), editComment); + EnableWindow(GetDlgItem(hDlg, OPT_EditComment), !editComment); + SendMessage(hwndText, EM_SETREADONLY, !editComment, 0); + SetWindowText(hDlg, commentTitle); + if (editComment) { + SetFocus(hwndText); + } else { + SetFocus(GetDlgItem(hDlg, IDOK)); + } + SendMessage(GetDlgItem(hDlg, OPT_CommentText), + WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf, + MAKELPARAM(FALSE, 0)); + /* Size and position the dialog */ + if (!commentDialog) { + commentDialog = hDlg; + flags = SWP_NOZORDER; + GetClientRect(hDlg, &rect); + sizeX = rect.right; + sizeY = rect.bottom; + if (commentX != CW_USEDEFAULT && commentY != CW_USEDEFAULT && + commentW != CW_USEDEFAULT && commentH != CW_USEDEFAULT) { + WINDOWPLACEMENT wp; + EnsureOnScreen(&commentX, &commentY); + wp.length = sizeof(WINDOWPLACEMENT); + wp.flags = 0; + wp.showCmd = SW_SHOW; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; + wp.rcNormalPosition.left = commentX; + wp.rcNormalPosition.right = commentX + commentW; + wp.rcNormalPosition.top = commentY; + wp.rcNormalPosition.bottom = commentY + commentH; + SetWindowPlacement(hDlg, &wp); + + GetClientRect(hDlg, &rect); + newSizeX = rect.right; + newSizeY = rect.bottom; + ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, + newSizeX, newSizeY); + sizeX = newSizeX; + sizeY = newSizeY; + } + } + return FALSE; + + case WM_COMMAND: /* message: received a command */ + switch (LOWORD(wParam)) { + case IDOK: + if (editComment) { + char *p, *q; + /* Read changed options from the dialog box */ + hwndText = GetDlgItem(hDlg, OPT_CommentText); + len = GetWindowTextLength(hwndText); + str = (char *) malloc(len + 1); + GetWindowText(hwndText, str, len + 1); + p = q = str; + while (*q) { + if (*q == '\r') + q++; + else + *p++ = *q++; + } + *p = NULLCHAR; + ReplaceComment(commentIndex, str); + free(str); + } + CommentPopDown(); + return TRUE; + + case IDCANCEL: + case OPT_CancelComment: + CommentPopDown(); + return TRUE; + + case OPT_ClearComment: + SetDlgItemText(hDlg, OPT_CommentText, ""); + break; + + case OPT_EditComment: + EditCommentEvent(); + return TRUE; + + default: + break; + } + break; + + case WM_SIZE: + newSizeX = LOWORD(lParam); + newSizeY = HIWORD(lParam); + ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, newSizeX, newSizeY); + sizeX = newSizeX; + sizeY = newSizeY; + break; + + case WM_GETMINMAXINFO: + /* Prevent resizing window too small */ + mmi = (MINMAXINFO *) lParam; + mmi->ptMinTrackSize.x = 100; + mmi->ptMinTrackSize.y = 100; + break; + } + return FALSE; + } + + VOID + EitherCommentPopUp(int index, char *title, char *str, BOOLEAN edit) + { + FARPROC lpProc; + char *p, *q; + + CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, edit ? MF_CHECKED : MF_UNCHECKED); + + if (str == NULL) str = ""; + p = (char *) malloc(2 * strlen(str) + 2); + q = p; + while (*str) { + if (*str == '\n') *q++ = '\r'; + *q++ = *str++; + } + *q = NULLCHAR; + if (commentText != NULL) free(commentText); + + commentIndex = index; + commentTitle = title; + commentText = p; + editComment = edit; + + if (commentDialog) { + SendMessage(commentDialog, WM_INITDIALOG, 0, 0); + if (!commentDialogUp) ShowWindow(commentDialog, SW_SHOW); + } else { + lpProc = MakeProcInstance((FARPROC)CommentDialog, hInst); + CreateDialog(hInst, MAKEINTRESOURCE(DLG_EditComment), + hwndMain, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + commentDialogUp = TRUE; + } + + + /*---------------------------------------------------------------------------*\ + * + * Type-in move dialog functions + * + \*---------------------------------------------------------------------------*/ + + LRESULT CALLBACK + TypeInMoveDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + char move[MSG_SIZ]; + HWND hInput; + ChessMove moveType; + int fromX, fromY, toX, toY; + char promoChar; + + switch (message) { + case WM_INITDIALOG: + move[0] = (char) lParam; + move[1] = NULLCHAR; + CenterWindowEx(hDlg, GetWindow(hDlg, GW_OWNER), 1 ); + hInput = GetDlgItem(hDlg, OPT_Move); + SetWindowText(hInput, move); + SetFocus(hInput); + SendMessage(hInput, EM_SETSEL, (WPARAM)9999, (LPARAM)9999); + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + if (gameMode != EditGame && currentMove != forwardMostMove && + gameMode != Training) { + DisplayMoveError("Displayed move is not current"); + } else { + GetDlgItemText(hDlg, OPT_Move, move, sizeof(move)); + if (ParseOneMove(move, gameMode == EditPosition ? blackPlaysFirst : currentMove, + &moveType, &fromX, &fromY, &toX, &toY, &promoChar)) { + if (gameMode != Training) + forwardMostMove = currentMove; + UserMoveEvent(fromX, fromY, toX, toY, promoChar); + } else { + DisplayMoveError("Could not parse move"); + } + } + EndDialog(hDlg, TRUE); + return TRUE; + case IDCANCEL: + EndDialog(hDlg, FALSE); + return TRUE; + default: + break; + } + break; + } + return FALSE; + } + + VOID + PopUpMoveDialog(char firstchar) + { + FARPROC lpProc; + + if ((gameMode == BeginningOfGame && !appData.icsActive) || + gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack || + gameMode == AnalyzeMode || gameMode == EditGame || + gameMode == EditPosition || gameMode == IcsExamining || + gameMode == IcsPlayingWhite || gameMode == IcsPlayingBlack || + gameMode == Training) { + lpProc = MakeProcInstance((FARPROC)TypeInMoveDialog, hInst); + DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_TypeInMove), + hwndMain, (DLGPROC)lpProc, (LPARAM)firstchar); + FreeProcInstance(lpProc); + } + } + + /*---------------------------------------------------------------------------*\ + * + * Type-in name dialog functions + * + \*---------------------------------------------------------------------------*/ + + LRESULT CALLBACK + TypeInNameDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + char move[MSG_SIZ]; + HWND hInput; + + switch (message) { + case WM_INITDIALOG: + move[0] = (char) lParam; + move[1] = NULLCHAR; + CenterWindowEx(hDlg, GetWindow(hDlg, GW_OWNER), 1 ); + hInput = GetDlgItem(hDlg, OPT_Name); + SetWindowText(hInput, move); + SetFocus(hInput); + SendMessage(hInput, EM_SETSEL, (WPARAM)9999, (LPARAM)9999); + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + GetDlgItemText(hDlg, OPT_Name, move, sizeof(move)); + appData.userName = strdup(move); + + EndDialog(hDlg, TRUE); + return TRUE; + case IDCANCEL: + EndDialog(hDlg, FALSE); + return TRUE; + default: + break; + } + break; + } + return FALSE; + } + + VOID + PopUpNameDialog(char firstchar) + { + FARPROC lpProc; + + lpProc = MakeProcInstance((FARPROC)TypeInNameDialog, hInst); + DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_TypeInName), + hwndMain, (DLGPROC)lpProc, (LPARAM)firstchar); + FreeProcInstance(lpProc); + } + + /*---------------------------------------------------------------------------*\ + * + * Error dialogs + * + \*---------------------------------------------------------------------------*/ + + /* Nonmodal error box */ + LRESULT CALLBACK ErrorDialog(HWND hDlg, UINT message, + WPARAM wParam, LPARAM lParam); + + VOID + ErrorPopUp(char *title, char *content) + { + FARPROC lpProc; + char *p, *q; + BOOLEAN modal = hwndMain == NULL; + + p = content; + q = errorMessage; + while (*p) { + if (*p == '\n') { + if (modal) { + *q++ = ' '; + p++; + } else { + *q++ = '\r'; + *q++ = *p++; + } + } else { + *q++ = *p++; + } + } + *q = NULLCHAR; + strncpy(errorTitle, title, sizeof(errorTitle)); + errorTitle[sizeof(errorTitle) - 1] = '\0'; + + if (modal) { + MessageBox(NULL, errorMessage, errorTitle, MB_OK|MB_ICONEXCLAMATION); + } else { + lpProc = MakeProcInstance((FARPROC)ErrorDialog, hInst); + CreateDialog(hInst, MAKEINTRESOURCE(DLG_Error), + hwndMain, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + } + + VOID + ErrorPopDown() + { + if (!appData.popupMoveErrors && moveErrorMessageUp) DisplayMessage("", ""); + if (errorDialog == NULL) return; + DestroyWindow(errorDialog); + errorDialog = NULL; + } + + LRESULT CALLBACK + ErrorDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + HANDLE hwndText; + RECT rChild; + + switch (message) { + case WM_INITDIALOG: + GetWindowRect(hDlg, &rChild); + + /* + SetWindowPos(hDlg, NULL, rChild.left, + rChild.top + boardRect.top - (rChild.bottom - rChild.top), + 0, 0, SWP_NOZORDER|SWP_NOSIZE); + */ + + /* + [AS] It seems that the above code wants to move the dialog up in the "caption + area" of the main window, but it uses the dialog height as an hard-coded constant, + and it doesn't work when you resize the dialog. + For now, just give it a default position. + */ + SetWindowPos(hDlg, NULL, boardRect.left+8, boardRect.top+8, 0, 0, SWP_NOZORDER|SWP_NOSIZE); + + errorDialog = hDlg; + SetWindowText(hDlg, errorTitle); + hwndText = GetDlgItem(hDlg, OPT_ErrorText); + SetDlgItemText(hDlg, OPT_ErrorText, errorMessage); + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + case IDCANCEL: + if (errorDialog == hDlg) errorDialog = NULL; + DestroyWindow(hDlg); + return TRUE; + + default: + break; + } + break; + } + return FALSE; + } + + #ifdef GOTHIC + HWND gothicDialog = NULL; + + LRESULT CALLBACK + GothicDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + HANDLE hwndText; + RECT rChild; + int height = GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYFRAME); + + switch (message) { + case WM_INITDIALOG: + GetWindowRect(hDlg, &rChild); + + SetWindowPos(hDlg, NULL, boardX, boardY-height, winWidth, height, + SWP_NOZORDER); + + /* + [AS] It seems that the above code wants to move the dialog up in the "caption + area" of the main window, but it uses the dialog height as an hard-coded constant, + and it doesn't work when you resize the dialog. + For now, just give it a default position. + */ + gothicDialog = hDlg; + SetWindowText(hDlg, errorTitle); + hwndText = GetDlgItem(hDlg, OPT_ErrorText); + SetDlgItemText(hDlg, OPT_ErrorText, errorMessage); + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + case IDCANCEL: + if (errorDialog == hDlg) errorDialog = NULL; + DestroyWindow(hDlg); + return TRUE; + + default: + break; + } + break; + } + return FALSE; + } + + VOID + GothicPopUp(char *title, VariantClass variant) + { + FARPROC lpProc; + char *p, *q; + BOOLEAN modal = hwndMain == NULL; + static char *lastTitle; + + strncpy(errorTitle, title, sizeof(errorTitle)); + errorTitle[sizeof(errorTitle) - 1] = '\0'; + + if(lastTitle != title && gothicDialog != NULL) { + DestroyWindow(gothicDialog); + gothicDialog = NULL; + } + if(variant != VariantNormal && gothicDialog == NULL) { + title = lastTitle; + lpProc = MakeProcInstance((FARPROC)GothicDialog, hInst); + CreateDialog(hInst, MAKEINTRESOURCE(DLG_Error), + hwndMain, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + } + #endif + + /*---------------------------------------------------------------------------*\ + * + * Ics Interaction console functions + * + \*---------------------------------------------------------------------------*/ + + #define HISTORY_SIZE 64 + static char *history[HISTORY_SIZE]; + int histIn = 0, histP = 0; + + VOID + SaveInHistory(char *cmd) + { + if (history[histIn] != NULL) { + free(history[histIn]); + history[histIn] = NULL; + } + if (*cmd == NULLCHAR) return; + history[histIn] = StrSave(cmd); + histIn = (histIn + 1) % HISTORY_SIZE; + if (history[histIn] != NULL) { + free(history[histIn]); + history[histIn] = NULL; + } + histP = histIn; + } + + char * + PrevInHistory(char *cmd) + { + int newhp; + if (histP == histIn) { + if (history[histIn] != NULL) free(history[histIn]); + history[histIn] = StrSave(cmd); + } + newhp = (histP - 1 + HISTORY_SIZE) % HISTORY_SIZE; + if (newhp == histIn || history[newhp] == NULL) return NULL; + histP = newhp; + return history[histP]; + } + + char * + NextInHistory() + { + if (histP == histIn) return NULL; + histP = (histP + 1) % HISTORY_SIZE; + return history[histP]; + } + + typedef struct { + char *item; + char *command; + BOOLEAN getname; + BOOLEAN immediate; + } IcsTextMenuEntry; + #define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1) + IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; + + void + ParseIcsTextMenu(char *icsTextMenuString) + { + int flags = 0; + IcsTextMenuEntry *e = icsTextMenuEntry; + char *p = icsTextMenuString; + while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { + free(e->item); + e->item = NULL; + if (e->command != NULL) { + free(e->command); + e->command = NULL; + } + e++; + } + e = icsTextMenuEntry; + while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) { + if (*p == ';' || *p == '\n') { + e->item = strdup("-"); + e->command = NULL; + p++; + } else if (*p == '-') { + e->item = strdup("-"); + e->command = NULL; + p++; + if (*p) p++; + } else { + char *q, *r, *s, *t; + char c; + q = strchr(p, ','); + if (q == NULL) break; + *q = NULLCHAR; + r = strchr(q + 1, ','); + if (r == NULL) break; + *r = NULLCHAR; + s = strchr(r + 1, ','); + if (s == NULL) break; + *s = NULLCHAR; + c = ';'; + t = strchr(s + 1, c); + if (t == NULL) { + c = '\n'; + t = strchr(s + 1, c); + } + if (t != NULL) *t = NULLCHAR; + e->item = strdup(p); + e->command = strdup(q + 1); + e->getname = *(r + 1) != '0'; + e->immediate = *(s + 1) != '0'; + *q = ','; + *r = ','; + *s = ','; + if (t == NULL) break; + *t = c; + p = t + 1; + } + e++; + } + } + + HMENU + LoadIcsTextMenu(IcsTextMenuEntry *e) + { + HMENU hmenu, h; + int i = 0; + hmenu = LoadMenu(hInst, "TextMenu"); + h = GetSubMenu(hmenu, 0); + while (e->item) { + if (strcmp(e->item, "-") == 0) { + AppendMenu(h, MF_SEPARATOR, 0, 0); + } else { + if (e->item[0] == '|') { + AppendMenu(h, MF_STRING|MF_MENUBARBREAK, + IDM_CommandX + i, &e->item[1]); + } else { + AppendMenu(h, MF_STRING, IDM_CommandX + i, e->item); + } + } + e++; + i++; + } + return hmenu; + } + + WNDPROC consoleTextWindowProc; + + void + CommandX(HWND hwnd, char *command, BOOLEAN getname, BOOLEAN immediate) + { + char buf[MSG_SIZ], name[MSG_SIZ]; + HWND hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + CHARRANGE sel; + + if (!getname) { + SetWindowText(hInput, command); + if (immediate) { + SendMessage(hInput, WM_CHAR, '\r', 0); + } else { + sel.cpMin = 999999; + sel.cpMax = 999999; + SendMessage(hInput, EM_EXSETSEL, 0, (LPARAM)&sel); + SetFocus(hInput); + } + return; + } + SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); + if (sel.cpMin == sel.cpMax) { + /* Expand to surrounding word */ + TEXTRANGE tr; + do { + tr.chrg.cpMax = sel.cpMin; + tr.chrg.cpMin = --sel.cpMin; + if (sel.cpMin < 0) break; + tr.lpstrText = name; + SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr); + } while (isalpha(name[0]) || isdigit(name[0]) || name[0] == '-'); + sel.cpMin++; + + do { + tr.chrg.cpMin = sel.cpMax; + tr.chrg.cpMax = ++sel.cpMax; + tr.lpstrText = name; + if (SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr) < 1) break; + } while (isalpha(name[0]) || isdigit(name[0]) || name[0] == '-'); + sel.cpMax--; + + if (sel.cpMax == sel.cpMin || sel.cpMax - sel.cpMin > MSG_SIZ/2) { + MessageBeep(MB_ICONEXCLAMATION); + return; + } + tr.chrg = sel; + tr.lpstrText = name; + SendMessage(hwnd, EM_GETTEXTRANGE, 0, (LPARAM) &tr); + } else { + if (sel.cpMax - sel.cpMin > MSG_SIZ/2) { + MessageBeep(MB_ICONEXCLAMATION); + return; + } + SendMessage(hwnd, EM_GETSELTEXT, 0, (LPARAM) name); + } + if (immediate) { + sprintf(buf, "%s %s", command, name); + SetWindowText(hInput, buf); + SendMessage(hInput, WM_CHAR, '\r', 0); + } else { + sprintf(buf, "%s %s ", command, name); /* trailing space */ + SetWindowText(hInput, buf); + sel.cpMin = 999999; + sel.cpMax = 999999; + SendMessage(hInput, EM_EXSETSEL, 0, (LPARAM)&sel); + SetFocus(hInput); + } + } + + LRESULT CALLBACK + ConsoleTextSubclass(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + HWND hInput; + CHARRANGE sel; + + switch (message) { + case WM_KEYDOWN: + if (!(GetKeyState(VK_CONTROL) & ~1)) break; + switch (wParam) { + case VK_PRIOR: + SendMessage(hwnd, EM_LINESCROLL, 0, -999999); + return 0; + case VK_NEXT: + sel.cpMin = 999999; + sel.cpMax = 999999; + SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); + SendMessage(hwnd, EM_SCROLLCARET, 0, 0); + return 0; + } + break; + case WM_CHAR: + if (wParam == '\t') { + if (GetKeyState(VK_SHIFT) < 0) { + /* shifted */ + if (IsIconic(hwndMain)) ShowWindow(hwndMain, SW_RESTORE); + if (buttonDesc[0].hwnd) { + SetFocus(buttonDesc[0].hwnd); + } else { + SetFocus(hwndMain); + } + } else { + /* unshifted */ + SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleInput)); + } + } else { + hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + SetFocus(hInput); + SendMessage(hInput, message, wParam, lParam); + } + return 0; + case WM_PASTE: + hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + SetFocus(hInput); + return SendMessage(hInput, message, wParam, lParam); + case WM_MBUTTONDOWN: + return SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); + case WM_RBUTTONDOWN: + if (!(GetKeyState(VK_SHIFT) & ~1)) { + /* Move selection here if it was empty */ + POINT pt; + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); + SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); + if (sel.cpMin == sel.cpMax) { + sel.cpMin = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM)&pt); /*doc is wrong*/ + sel.cpMax = sel.cpMin; + SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); + } + SendMessage(hwnd, EM_HIDESELECTION, FALSE, FALSE); + } + return 0; + case WM_RBUTTONUP: + if (GetKeyState(VK_SHIFT) & ~1) { + SendDlgItemMessage(hwndConsole, OPT_ConsoleText, + WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); + } else { + POINT pt; + HMENU hmenu = LoadIcsTextMenu(icsTextMenuEntry); + SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); + if (sel.cpMin == sel.cpMax) { + EnableMenuItem(hmenu, IDM_Copy, MF_BYCOMMAND|MF_GRAYED); + EnableMenuItem(hmenu, IDM_QuickPaste, MF_BYCOMMAND|MF_GRAYED); + } + if (!IsClipboardFormatAvailable(CF_TEXT)) { + EnableMenuItem(hmenu, IDM_Paste, MF_BYCOMMAND|MF_GRAYED); + } + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); + MenuPopup(hwnd, pt, hmenu, -1); + } + return 0; + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDM_QuickPaste: + { + SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); + if (sel.cpMin == sel.cpMax) { + MessageBeep(MB_ICONEXCLAMATION); + return 0; + } + SendMessage(hwnd, WM_COPY, 0, 0); + hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + SendMessage(hInput, WM_PASTE, 0, 0); + SetFocus(hInput); + return 0; + } + case IDM_Cut: + SendMessage(hwnd, WM_CUT, 0, 0); + return 0; + case IDM_Paste: + SendMessage(hwnd, WM_PASTE, 0, 0); + return 0; + case IDM_Copy: + SendMessage(hwnd, WM_COPY, 0, 0); + return 0; + default: + { + int i = LOWORD(wParam) - IDM_CommandX; + if (i >= 0 && i < ICS_TEXT_MENU_SIZE && + icsTextMenuEntry[i].command != NULL) { + CommandX(hwnd, icsTextMenuEntry[i].command, + icsTextMenuEntry[i].getname, + icsTextMenuEntry[i].immediate); + return 0; + } + } + break; + } + break; + } + return (*consoleTextWindowProc)(hwnd, message, wParam, lParam); + } + + WNDPROC consoleInputWindowProc; + + LRESULT CALLBACK + ConsoleInputSubclass(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + char buf[MSG_SIZ]; + char *p; + static BOOL sendNextChar = FALSE; + static BOOL quoteNextChar = FALSE; + InputSource *is = consoleInputSource; + CHARFORMAT cf; + CHARRANGE sel; + + switch (message) { + case WM_CHAR: + if (!appData.localLineEditing || sendNextChar) { + is->buf[0] = (CHAR) wParam; + is->count = 1; + SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); + sendNextChar = FALSE; + return 0; + } + if (quoteNextChar) { + buf[0] = (char) wParam; + buf[1] = NULLCHAR; + SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM) buf); + quoteNextChar = FALSE; + return 0; + } + switch (wParam) { + case '\r': /* Enter key */ + is->count = GetWindowText(hwnd, is->buf, INPUT_SOURCE_BUF_SIZE-1); + if (consoleEcho) SaveInHistory(is->buf); + is->buf[is->count++] = '\n'; + is->buf[is->count] = NULLCHAR; + SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); + if (consoleEcho) { + ConsoleOutput(is->buf, is->count, TRUE); + } else if (appData.localLineEditing) { + ConsoleOutput("\n", 1, TRUE); + } + /* fall thru */ + case '\033': /* Escape key */ + SetWindowText(hwnd, ""); + cf.cbSize = sizeof(CHARFORMAT); + cf.dwMask = CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT; + if (consoleEcho) { + cf.crTextColor = textAttribs[ColorNormal].color; + } else { + cf.crTextColor = COLOR_ECHOOFF; + } + cf.dwEffects = textAttribs[ColorNormal].effects; + SendMessage(hwnd, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); + return 0; + case '\t': /* Tab key */ + if (GetKeyState(VK_SHIFT) < 0) { + /* shifted */ + SetFocus(GetDlgItem(hwndConsole, OPT_ConsoleText)); + } else { + /* unshifted */ + if (IsIconic(hwndMain)) ShowWindow(hwndMain, SW_RESTORE); + if (buttonDesc[0].hwnd) { + SetFocus(buttonDesc[0].hwnd); + } else { + SetFocus(hwndMain); + } + } + return 0; + case '\023': /* Ctrl+S */ + sendNextChar = TRUE; + return 0; + case '\021': /* Ctrl+Q */ + quoteNextChar = TRUE; + return 0; + default: + break; + } + break; + case WM_KEYDOWN: + switch (wParam) { + case VK_UP: + GetWindowText(hwnd, buf, MSG_SIZ); + p = PrevInHistory(buf); + if (p != NULL) { + SetWindowText(hwnd, p); + sel.cpMin = 999999; + sel.cpMax = 999999; + SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); + return 0; + } + break; + case VK_DOWN: + p = NextInHistory(); + if (p != NULL) { + SetWindowText(hwnd, p); + sel.cpMin = 999999; + sel.cpMax = 999999; + SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); + return 0; + } + break; + case VK_HOME: + case VK_END: + if (!(GetKeyState(VK_CONTROL) & ~1)) break; + /* fall thru */ + case VK_PRIOR: + case VK_NEXT: + SendDlgItemMessage(hwndConsole, OPT_ConsoleText, message, wParam, lParam); + return 0; + } + break; + case WM_MBUTTONDOWN: + SendDlgItemMessage(hwndConsole, OPT_ConsoleText, + WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); + break; + case WM_RBUTTONUP: + if (GetKeyState(VK_SHIFT) & ~1) { + SendDlgItemMessage(hwndConsole, OPT_ConsoleText, + WM_COMMAND, MAKEWPARAM(IDM_QuickPaste, 0), 0); + } else { + POINT pt; + HMENU hmenu; + hmenu = LoadMenu(hInst, "InputMenu"); + SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel); + if (sel.cpMin == sel.cpMax) { + EnableMenuItem(hmenu, IDM_Copy, MF_BYCOMMAND|MF_GRAYED); + EnableMenuItem(hmenu, IDM_Cut, MF_BYCOMMAND|MF_GRAYED); + } + if (!IsClipboardFormatAvailable(CF_TEXT)) { + EnableMenuItem(hmenu, IDM_Paste, MF_BYCOMMAND|MF_GRAYED); + } + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); + MenuPopup(hwnd, pt, hmenu, -1); + } + return 0; + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDM_Undo: + SendMessage(hwnd, EM_UNDO, 0, 0); + return 0; + case IDM_SelectAll: + sel.cpMin = 0; + sel.cpMax = -1; /*999999?*/ + SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&sel); + return 0; + case IDM_Cut: + SendMessage(hwnd, WM_CUT, 0, 0); + return 0; + case IDM_Paste: + SendMessage(hwnd, WM_PASTE, 0, 0); + return 0; + case IDM_Copy: + SendMessage(hwnd, WM_COPY, 0, 0); + return 0; + } + break; + } + return (*consoleInputWindowProc)(hwnd, message, wParam, lParam); + } + + #define CO_MAX 100000 + #define CO_TRIM 1000 + + LRESULT CALLBACK + ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static SnapData sd; + static HWND hText, hInput, hFocus; + InputSource *is = consoleInputSource; + RECT rect; + static int sizeX, sizeY; + int newSizeX, newSizeY; + MINMAXINFO *mmi; + + switch (message) { + case WM_INITDIALOG: /* message: initialize dialog box */ + hwndConsole = hDlg; + hText = GetDlgItem(hDlg, OPT_ConsoleText); + hInput = GetDlgItem(hDlg, OPT_ConsoleInput); + SetFocus(hInput); + consoleTextWindowProc = (WNDPROC) + SetWindowLong(hText, GWL_WNDPROC, (LONG) ConsoleTextSubclass); + SendMessage(hText, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); + consoleInputWindowProc = (WNDPROC) + SetWindowLong(hInput, GWL_WNDPROC, (LONG) ConsoleInputSubclass); + SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); + Colorize(ColorNormal, TRUE); + SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &consoleCF); + ChangedConsoleFont(); + GetClientRect(hDlg, &rect); + sizeX = rect.right; + sizeY = rect.bottom; + if (consoleX != CW_USEDEFAULT && consoleY != CW_USEDEFAULT && + consoleW != CW_USEDEFAULT && consoleH != CW_USEDEFAULT) { + WINDOWPLACEMENT wp; + EnsureOnScreen(&consoleX, &consoleY); + wp.length = sizeof(WINDOWPLACEMENT); + wp.flags = 0; + wp.showCmd = SW_SHOW; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; + wp.rcNormalPosition.left = consoleX; + wp.rcNormalPosition.right = consoleX + consoleW; + wp.rcNormalPosition.top = consoleY; + wp.rcNormalPosition.bottom = consoleY + consoleH; + SetWindowPlacement(hDlg, &wp); + } ++#if 0 ++ // [HGM] Chessknight's change 2004-07-13 ++ else { /* Determine Defaults */ ++ WINDOWPLACEMENT wp; ++ consoleX = winWidth + 1; ++ consoleY = boardY; ++ consoleW = screenWidth - winWidth; ++ consoleH = winHeight; ++ EnsureOnScreen(&consoleX, &consoleY); ++ wp.length = sizeof(WINDOWPLACEMENT); ++ wp.flags = 0; ++ wp.showCmd = SW_SHOW; ++ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; ++ wp.rcNormalPosition.left = consoleX; ++ wp.rcNormalPosition.right = consoleX + consoleW; ++ wp.rcNormalPosition.top = consoleY; ++ wp.rcNormalPosition.bottom = consoleY + consoleH; ++ SetWindowPlacement(hDlg, &wp); ++ } ++#endif + return FALSE; + + case WM_SETFOCUS: + SetFocus(hInput); + return 0; + + case WM_CLOSE: + ExitEvent(0); + /* not reached */ + break; + + case WM_SIZE: + if (IsIconic(hDlg)) break; + newSizeX = LOWORD(lParam); + newSizeY = HIWORD(lParam); + if (sizeX != newSizeX || sizeY != newSizeY) { + RECT rectText, rectInput; + POINT pt; + int newTextHeight, newTextWidth; + GetWindowRect(hText, &rectText); + newTextWidth = rectText.right - rectText.left + newSizeX - sizeX; + newTextHeight = rectText.bottom - rectText.top + newSizeY - sizeY; + if (newTextHeight < 0) { + newSizeY += -newTextHeight; + newTextHeight = 0; + } + SetWindowPos(hText, NULL, 0, 0, + newTextWidth, newTextHeight, SWP_NOZORDER|SWP_NOMOVE); + GetWindowRect(hInput, &rectInput); /* gives screen coords */ + pt.x = rectInput.left; + pt.y = rectInput.top + newSizeY - sizeY; + ScreenToClient(hDlg, &pt); + SetWindowPos(hInput, NULL, + pt.x, pt.y, /* needs client coords */ + rectInput.right - rectInput.left + newSizeX - sizeX, + rectInput.bottom - rectInput.top, SWP_NOZORDER); + } + sizeX = newSizeX; + sizeY = newSizeY; + break; + + case WM_GETMINMAXINFO: + /* Prevent resizing window too small */ + mmi = (MINMAXINFO *) lParam; + mmi->ptMinTrackSize.x = 100; + mmi->ptMinTrackSize.y = 100; + break; + + /* [AS] Snapping */ + case WM_ENTERSIZEMOVE: + return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); + + case WM_SIZING: + return OnSizing( &sd, hDlg, wParam, lParam ); + + case WM_MOVING: + return OnMoving( &sd, hDlg, wParam, lParam ); + + case WM_EXITSIZEMOVE: + return OnExitSizeMove( &sd, hDlg, wParam, lParam ); + } + + return DefWindowProc(hDlg, message, wParam, lParam); + } + + + VOID + ConsoleCreate() + { + HWND hCons; + if (hwndConsole) return; + hCons = CreateDialog(hInst, szConsoleName, 0, NULL); + SendMessage(hCons, WM_INITDIALOG, 0, 0); + } + + + VOID + ConsoleOutput(char* data, int length, int forceVisible) + { + HWND hText; + int trim, exlen; + char *p, *q; + char buf[CO_MAX+1]; + POINT pEnd; + RECT rect; + static int delayLF = 0; + CHARRANGE savesel, sel; + + if (hwndConsole == NULL || length > CO_MAX-100 || length == 0) return; + p = data; + q = buf; + if (delayLF) { + *q++ = '\r'; + *q++ = '\n'; + delayLF = 0; + } + while (length--) { + if (*p == '\n') { + if (*++p) { + *q++ = '\r'; + *q++ = '\n'; + } else { + delayLF = 1; + } + } else if (*p == '\007') { + MyPlaySound(&sounds[(int)SoundBell]); + p++; + } else { + *q++ = *p++; + } + } + *q = NULLCHAR; + hText = GetDlgItem(hwndConsole, OPT_ConsoleText); + SendMessage(hText, EM_HIDESELECTION, TRUE, FALSE); + /* Save current selection */ + SendMessage(hText, EM_EXGETSEL, 0, (LPARAM)&savesel); + exlen = GetWindowTextLength(hText); + /* Find out whether current end of text is visible */ + SendMessage(hText, EM_GETRECT, 0, (LPARAM) &rect); + SendMessage(hText, EM_POSFROMCHAR, (WPARAM) &pEnd, exlen); + /* Trim existing text if it's too long */ + if (exlen + (q - buf) > CO_MAX) { + trim = (CO_TRIM > (q - buf)) ? CO_TRIM : (q - buf); + sel.cpMin = 0; + sel.cpMax = trim; + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); + SendMessage(hText, EM_REPLACESEL, 0, (LPARAM)""); + exlen -= trim; + savesel.cpMin -= trim; + savesel.cpMax -= trim; + if (exlen < 0) exlen = 0; + if (savesel.cpMin < 0) savesel.cpMin = 0; + if (savesel.cpMax < savesel.cpMin) savesel.cpMax = savesel.cpMin; + } + /* Append the new text */ + sel.cpMin = exlen; + sel.cpMax = exlen; + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); + SendMessage(hText, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&consoleCF); + SendMessage(hText, EM_REPLACESEL, 0, (LPARAM) buf); + if (forceVisible || exlen == 0 || + (rect.left <= pEnd.x && pEnd.x < rect.right && + rect.top <= pEnd.y && pEnd.y < rect.bottom)) { + /* Scroll to make new end of text visible if old end of text + was visible or new text is an echo of user typein */ + sel.cpMin = 9999999; + sel.cpMax = 9999999; + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); + SendMessage(hText, EM_HIDESELECTION, FALSE, FALSE); + SendMessage(hText, EM_SCROLLCARET, 0, 0); + SendMessage(hText, EM_HIDESELECTION, TRUE, FALSE); + } + if (savesel.cpMax == exlen || forceVisible) { + /* Move insert point to new end of text if it was at the old + end of text or if the new text is an echo of user typein */ + sel.cpMin = 9999999; + sel.cpMax = 9999999; + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&sel); + } else { + /* Restore previous selection */ + SendMessage(hText, EM_EXSETSEL, 0, (LPARAM)&savesel); + } + SendMessage(hText, EM_HIDESELECTION, FALSE, FALSE); + } + + /*---------*/ + + + void + DisplayHoldingsCount(HDC hdc, int x, int y, int rightAlign, int copyNumber) + { + char buf[100]; + char *str; + COLORREF oldFg, oldBg; + HFONT oldFont; + RECT rect; + + if(copyNumber > 1) sprintf(buf, "%d", copyNumber); else buf[0] = 0; + + oldFg = SetTextColor(hdc, RGB(255, 255, 255)); /* white */ + oldBg = SetBkColor(hdc, RGB(0, 0, 0)); /* black */ + oldFont = SelectObject(hdc, font[boardSize][CLOCK_FONT]->hf); + + rect.left = x; + rect.right = x + squareSize; + rect.top = y; + rect.bottom = y + squareSize; + str = buf; + + ExtTextOut(hdc, x + MESSAGE_LINE_LEFTMARGIN + + (rightAlign ? (squareSize*2)/3 : 0), + y, ETO_CLIPPED|ETO_OPAQUE, + &rect, str, strlen(str), NULL); + + (void) SetTextColor(hdc, oldFg); + (void) SetBkColor(hdc, oldBg); + (void) SelectObject(hdc, oldFont); + } + + void + DisplayAClock(HDC hdc, int timeRemaining, int highlight, + RECT *rect, char *color, char *flagFell) + { + char buf[100]; + char *str; + COLORREF oldFg, oldBg; + HFONT oldFont; + + if (appData.clockMode) { + if (tinyLayout) + sprintf(buf, "%c %s %s", color[0], TimeString(timeRemaining), flagFell); + else + sprintf(buf, "%s: %s %s", color, TimeString(timeRemaining), flagFell); + str = buf; + } else { + str = color; + } + + if (highlight) { + oldFg = SetTextColor(hdc, RGB(255, 255, 255)); /* white */ + oldBg = SetBkColor(hdc, RGB(0, 0, 0)); /* black */ + } else { + oldFg = SetTextColor(hdc, RGB(0, 0, 0)); /* black */ + oldBg = SetBkColor(hdc, RGB(255, 255, 255)); /* white */ + } + oldFont = SelectObject(hdc, font[boardSize][CLOCK_FONT]->hf); + + ExtTextOut(hdc, rect->left + MESSAGE_LINE_LEFTMARGIN, + rect->top, ETO_CLIPPED|ETO_OPAQUE, + rect, str, strlen(str), NULL); + + (void) SetTextColor(hdc, oldFg); + (void) SetBkColor(hdc, oldBg); + (void) SelectObject(hdc, oldFont); + } + + + int + DoReadFile(HANDLE hFile, char *buf, int count, DWORD *outCount, + OVERLAPPED *ovl) + { + int ok, err; + + /* [AS] */ + if( count <= 0 ) { + if (appData.debugMode) { + fprintf( debugFP, "DoReadFile: trying to read past end of buffer, overflow = %d\n", count ); + } + + return ERROR_INVALID_USER_BUFFER; + } + + ResetEvent(ovl->hEvent); + ovl->Offset = ovl->OffsetHigh = 0; + ok = ReadFile(hFile, buf, count, outCount, ovl); + if (ok) { + err = NO_ERROR; + } else { + err = GetLastError(); + if (err == ERROR_IO_PENDING) { + ok = GetOverlappedResult(hFile, ovl, outCount, TRUE); + if (ok) + err = NO_ERROR; + else + err = GetLastError(); + } + } + return err; + } + + int + DoWriteFile(HANDLE hFile, char *buf, int count, DWORD *outCount, + OVERLAPPED *ovl) + { + int ok, err; + + ResetEvent(ovl->hEvent); + ovl->Offset = ovl->OffsetHigh = 0; + ok = WriteFile(hFile, buf, count, outCount, ovl); + if (ok) { + err = NO_ERROR; + } else { + err = GetLastError(); + if (err == ERROR_IO_PENDING) { + ok = GetOverlappedResult(hFile, ovl, outCount, TRUE); + if (ok) + err = NO_ERROR; + else + err = GetLastError(); + } + } + return err; + } + + /* [AS] If input is line by line and a line exceed the buffer size, force an error */ + void CheckForInputBufferFull( InputSource * is ) + { + if( is->lineByLine && (is->next - is->buf) >= INPUT_SOURCE_BUF_SIZE ) { + /* Look for end of line */ + char * p = is->buf; + + while( p < is->next && *p != '\n' ) { + p++; + } + + if( p >= is->next ) { + if (appData.debugMode) { + fprintf( debugFP, "Input line exceeded buffer size (source id=%u)\n", is->id ); + } + + is->error = ERROR_BROKEN_PIPE; /* [AS] Just any non-successful code! */ + is->count = (DWORD) -1; + is->next = is->buf; + } + } + } + + DWORD + InputThread(LPVOID arg) + { + InputSource *is; + OVERLAPPED ovl; + + is = (InputSource *) arg; + ovl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + ovl.Internal = ovl.InternalHigh = ovl.Offset = ovl.OffsetHigh = 0; + while (is->hThread != NULL) { + is->error = DoReadFile(is->hFile, is->next, + INPUT_SOURCE_BUF_SIZE - (is->next - is->buf), + &is->count, &ovl); + if (is->error == NO_ERROR) { + is->next += is->count; + } else { + if (is->error == ERROR_BROKEN_PIPE) { + /* Correct for MS brain damage. EOF reading a pipe is not an error. */ + is->count = 0; + } else { + is->count = (DWORD) -1; + /* [AS] The (is->count <= 0) check below is not useful for unsigned values! */ + break; + } + } + + CheckForInputBufferFull( is ); + + SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); + + if( is->count == ((DWORD) -1) ) break; /* [AS] */ + + if (is->count <= 0) break; /* Quit on EOF or error */ + } + + CloseHandle(ovl.hEvent); + CloseHandle(is->hFile); + + if (appData.debugMode) { + fprintf( debugFP, "Input thread terminated (id=%u, error=%d, count=%d)\n", is->id, is->error, is->count ); + } + + return 0; + } + + + /* Windows 95 beta 2 won't let you do overlapped i/o on a console or pipe */ + DWORD + NonOvlInputThread(LPVOID arg) + { + InputSource *is; + char *p, *q; + int i; + char prev; + + is = (InputSource *) arg; + while (is->hThread != NULL) { + is->error = ReadFile(is->hFile, is->next, + INPUT_SOURCE_BUF_SIZE - (is->next - is->buf), + &is->count, NULL) ? NO_ERROR : GetLastError(); + if (is->error == NO_ERROR) { + /* Change CRLF to LF */ + if (is->next > is->buf) { + p = is->next - 1; + i = is->count + 1; + } else { + p = is->next; + i = is->count; + } + q = p; + prev = NULLCHAR; + while (i > 0) { + if (prev == '\r' && *p == '\n') { + *(q-1) = '\n'; + is->count--; + } else { + *q++ = *p; + } + prev = *p++; + i--; + } + *q = NULLCHAR; + is->next = q; + } else { + if (is->error == ERROR_BROKEN_PIPE) { + /* Correct for MS brain damage. EOF reading a pipe is not an error. */ + is->count = 0; + } else { + is->count = (DWORD) -1; + } + } + + CheckForInputBufferFull( is ); + + SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); + + if( is->count == ((DWORD) -1) ) break; /* [AS] */ + + if (is->count < 0) break; /* Quit on error */ + } + CloseHandle(is->hFile); + return 0; + } + + DWORD + SocketInputThread(LPVOID arg) + { + InputSource *is; + + is = (InputSource *) arg; + while (is->hThread != NULL) { + is->count = recv(is->sock, is->buf, INPUT_SOURCE_BUF_SIZE, 0); + if ((int)is->count == SOCKET_ERROR) { + is->count = (DWORD) -1; + is->error = WSAGetLastError(); + } else { + is->error = NO_ERROR; + is->next += is->count; + if (is->count == 0 && is->second == is) { + /* End of file on stderr; quit with no message */ + break; + } + } + SendMessage(hwndMain, WM_USER_Input, 0, (LPARAM) is); + + if( is->count == ((DWORD) -1) ) break; /* [AS] */ + + if (is->count <= 0) break; /* Quit on EOF or error */ + } + return 0; + } + + VOID + InputEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) + { + InputSource *is; + + is = (InputSource *) lParam; + if (is->lineByLine) { + /* Feed in lines one by one */ + char *p = is->buf; + char *q = p; + while (q < is->next) { + if (*q++ == '\n') { + (is->func)(is, is->closure, p, q - p, NO_ERROR); + p = q; + } + } + + /* Move any partial line to the start of the buffer */ + q = is->buf; + while (p < is->next) { + *q++ = *p++; + } + is->next = q; + + if (is->error != NO_ERROR || is->count == 0) { + /* Notify backend of the error. Note: If there was a partial + line at the end, it is not flushed through. */ + (is->func)(is, is->closure, is->buf, is->count, is->error); + } + } else { + /* Feed in the whole chunk of input at once */ + (is->func)(is, is->closure, is->buf, is->count, is->error); + is->next = is->buf; + } + } + + /*---------------------------------------------------------------------------*\ + * + * Menu enables. Used when setting various modes. + * + \*---------------------------------------------------------------------------*/ + + typedef struct { + int item; + int flags; + } Enables; + + VOID + SetMenuEnables(HMENU hmenu, Enables *enab) + { + while (enab->item > 0) { + (void) EnableMenuItem(hmenu, enab->item, enab->flags); + enab++; + } + } + + Enables gnuEnables[] = { + { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, + { IDM_IcsClient, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Accept, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Decline, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Rematch, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Adjourn, MF_BYCOMMAND|MF_GRAYED }, + { IDM_StopExamining, MF_BYCOMMAND|MF_GRAYED }, + { IDM_StopObserving, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Revert, MF_BYCOMMAND|MF_GRAYED }, + { -1, -1 } + }; + + Enables icsEnables[] = { + { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, - { IDM_AnalysisMode, MF_BYCOMMAND|MF_GRAYED }, ++ { IDM_AnalysisMode, MF_BYCOMMAND|MF_ENABLED }, + { IDM_AnalyzeFile, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TimeControl, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Hint, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Book, MF_BYCOMMAND|MF_GRAYED }, + { IDM_IcsOptions, MF_BYCOMMAND|MF_ENABLED }, + { -1, -1 } + }; + + #ifdef ZIPPY + Enables zippyEnables[] = { + { IDM_MoveNow, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Hint, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Book, MF_BYCOMMAND|MF_ENABLED }, + { -1, -1 } + }; + #endif + + Enables ncpEnables[] = { + { IDM_MailMove, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, + { IDM_AnalysisMode, MF_BYCOMMAND|MF_GRAYED }, + { IDM_AnalyzeFile, MF_BYCOMMAND|MF_GRAYED }, + { IDM_IcsClient, MF_BYCOMMAND|MF_GRAYED }, + { ACTION_POS, MF_BYPOSITION|MF_GRAYED }, + { IDM_Revert, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, + { IDM_RetractMove, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TimeControl, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Hint, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Book, MF_BYCOMMAND|MF_GRAYED }, + { -1, -1 } + }; + + Enables trainingOnEnables[] = { + { IDM_EditComment, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Pause, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Forward, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Backward, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ToEnd, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ToStart, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MoveNow, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TruncateGame, MF_BYCOMMAND|MF_GRAYED }, + { -1, -1 } + }; + + Enables trainingOffEnables[] = { + { IDM_EditComment, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Pause, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Forward, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Backward, MF_BYCOMMAND|MF_ENABLED }, + { IDM_ToEnd, MF_BYCOMMAND|MF_ENABLED }, + { IDM_ToStart, MF_BYCOMMAND|MF_ENABLED }, + { IDM_MoveNow, MF_BYCOMMAND|MF_ENABLED }, + { IDM_TruncateGame, MF_BYCOMMAND|MF_ENABLED }, + { -1, -1 } + }; + + /* These modify either ncpEnables or gnuEnables */ + Enables cmailEnables[] = { + { IDM_MailMove, MF_BYCOMMAND|MF_ENABLED }, + { IDM_ReloadCMailMsg, MF_BYCOMMAND|MF_ENABLED }, + { ACTION_POS, MF_BYPOSITION|MF_ENABLED }, + { IDM_CallFlag, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Draw, MF_BYCOMMAND|MF_ENABLED }, + { IDM_Adjourn, MF_BYCOMMAND|MF_GRAYED }, + { IDM_Abort, MF_BYCOMMAND|MF_GRAYED }, + { -1, -1 } + }; + + Enables machineThinkingEnables[] = { + { IDM_LoadGame, MF_BYCOMMAND|MF_GRAYED }, + { IDM_LoadNextGame, MF_BYCOMMAND|MF_GRAYED }, + { IDM_LoadPrevGame, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ReloadGame, MF_BYCOMMAND|MF_GRAYED }, + { IDM_PasteGame, MF_BYCOMMAND|MF_GRAYED }, + { IDM_LoadPosition, MF_BYCOMMAND|MF_GRAYED }, + { IDM_LoadNextPosition, MF_BYCOMMAND|MF_GRAYED }, + { IDM_LoadPrevPosition, MF_BYCOMMAND|MF_GRAYED }, + { IDM_ReloadPosition, MF_BYCOMMAND|MF_GRAYED }, + { IDM_PastePosition, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineWhite, MF_BYCOMMAND|MF_GRAYED }, + { IDM_MachineBlack, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TwoMachines, MF_BYCOMMAND|MF_GRAYED }, + { IDM_TypeInMove, MF_BYCOMMAND|MF_GRAYED }, + { IDM_RetractMove, MF_BYCOMMAND|MF_GRAYED }, + { -1, -1 } + }; + + Enables userThinkingEnables[] = { + { IDM_LoadGame, MF_BYCOMMAND|MF_ENABLED }, + { IDM_LoadNextGame, MF_BYCOMMAND|MF_ENABLED }, + { IDM_LoadPrevGame, MF_BYCOMMAND|MF_ENABLED }, + { IDM_ReloadGame, MF_BYCOMMAND|MF_ENABLED }, + { IDM_PasteGame, MF_BYCOMMAND|MF_ENABLED }, + { IDM_LoadPosition, MF_BYCOMMAND|MF_ENABLED }, + { IDM_LoadNextPosition, MF_BYCOMMAND|MF_ENABLED }, + { IDM_LoadPrevPosition, MF_BYCOMMAND|MF_ENABLED }, + { IDM_ReloadPosition, MF_BYCOMMAND|MF_ENABLED }, + { IDM_PastePosition, MF_BYCOMMAND|MF_ENABLED }, + { IDM_MachineWhite, MF_BYCOMMAND|MF_ENABLED }, + { IDM_MachineBlack, MF_BYCOMMAND|MF_ENABLED }, + { IDM_TwoMachines, MF_BYCOMMAND|MF_ENABLED }, + { IDM_TypeInMove, MF_BYCOMMAND|MF_ENABLED }, + { IDM_RetractMove, MF_BYCOMMAND|MF_ENABLED }, + { -1, -1 } + }; + + /*---------------------------------------------------------------------------*\ + * + * Front-end interface functions exported by XBoard. + * Functions appear in same order as prototypes in frontend.h. + * + \*---------------------------------------------------------------------------*/ + VOID + ModeHighlight() + { + static UINT prevChecked = 0; + static int prevPausing = 0; + UINT nowChecked; + + if (pausing != prevPausing) { + prevPausing = pausing; + (void) CheckMenuItem(GetMenu(hwndMain), IDM_Pause, + MF_BYCOMMAND|(pausing ? MF_CHECKED : MF_UNCHECKED)); + if (hwndPause) SetWindowText(hwndPause, pausing ? "C" : "P"); + } + + switch (gameMode) { + case BeginningOfGame: + if (appData.icsActive) + nowChecked = IDM_IcsClient; + else if (appData.noChessProgram) + nowChecked = IDM_EditGame; + else + nowChecked = IDM_MachineBlack; + break; + case MachinePlaysBlack: + nowChecked = IDM_MachineBlack; + break; + case MachinePlaysWhite: + nowChecked = IDM_MachineWhite; + break; + case TwoMachinesPlay: + nowChecked = IDM_TwoMachines; + break; + case AnalyzeMode: + nowChecked = IDM_AnalysisMode; + break; + case AnalyzeFile: + nowChecked = IDM_AnalyzeFile; + break; + case EditGame: + nowChecked = IDM_EditGame; + break; + case PlayFromGameFile: + nowChecked = IDM_LoadGame; + break; + case EditPosition: + nowChecked = IDM_EditPosition; + break; + case Training: + nowChecked = IDM_Training; + break; + case IcsPlayingWhite: + case IcsPlayingBlack: + case IcsObserving: + case IcsIdle: + nowChecked = IDM_IcsClient; + break; + default: + case EndOfGame: + nowChecked = 0; + break; + } + if (prevChecked != 0) + (void) CheckMenuItem(GetMenu(hwndMain), + prevChecked, MF_BYCOMMAND|MF_UNCHECKED); + if (nowChecked != 0) + (void) CheckMenuItem(GetMenu(hwndMain), + nowChecked, MF_BYCOMMAND|MF_CHECKED); + + if (nowChecked == IDM_LoadGame || nowChecked == IDM_Training) { + (void) EnableMenuItem(GetMenu(hwndMain), IDM_Training, + MF_BYCOMMAND|MF_ENABLED); + } else { + (void) EnableMenuItem(GetMenu(hwndMain), + IDM_Training, MF_BYCOMMAND|MF_GRAYED); + } + + prevChecked = nowChecked; ++ ++ /* [DM] icsEngineAnalyze - Do a sceure check too */ ++ if (appData.icsActive) { ++ if (appData.icsEngineAnalyze) { ++ (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, ++ MF_BYCOMMAND|MF_CHECKED); ++ } else { ++ (void) CheckMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, ++ MF_BYCOMMAND|MF_UNCHECKED); ++ } ++ } + } + + VOID + SetICSMode() + { + HMENU hmenu = GetMenu(hwndMain); + SetMenuEnables(hmenu, icsEnables); + EnableMenuItem(GetSubMenu(hmenu, OPTIONS_POS), ICS_POS, + MF_BYPOSITION|MF_ENABLED); + #ifdef ZIPPY + if (appData.zippyPlay) { + SetMenuEnables(hmenu, zippyEnables); ++ if (!appData.noChessProgram) /* [DM] icsEngineAnalyze */ ++ (void) EnableMenuItem(GetMenu(hwndMain), IDM_AnalysisMode, ++ MF_BYCOMMAND|MF_ENABLED); + } + #endif + } + + VOID + SetGNUMode() + { + SetMenuEnables(GetMenu(hwndMain), gnuEnables); + } + + VOID + SetNCPMode() + { + HMENU hmenu = GetMenu(hwndMain); + SetMenuEnables(hmenu, ncpEnables); + EnableMenuItem(GetSubMenu(hmenu, OPTIONS_POS), SOUNDS_POS, + MF_BYPOSITION|MF_GRAYED); + DrawMenuBar(hwndMain); + } + + VOID + SetCmailMode() + { + SetMenuEnables(GetMenu(hwndMain), cmailEnables); + } + + VOID + SetTrainingModeOn() + { + int i; + SetMenuEnables(GetMenu(hwndMain), trainingOnEnables); + for (i = 0; i < N_BUTTONS; i++) { + if (buttonDesc[i].hwnd != NULL) + EnableWindow(buttonDesc[i].hwnd, FALSE); + } + CommentPopDown(); + } + + VOID SetTrainingModeOff() + { + int i; + SetMenuEnables(GetMenu(hwndMain), trainingOffEnables); + for (i = 0; i < N_BUTTONS; i++) { + if (buttonDesc[i].hwnd != NULL) + EnableWindow(buttonDesc[i].hwnd, TRUE); + } + } + + + VOID + SetUserThinkingEnables() + { + SetMenuEnables(GetMenu(hwndMain), userThinkingEnables); + } + + VOID + SetMachineThinkingEnables() + { + HMENU hMenu = GetMenu(hwndMain); + int flags = MF_BYCOMMAND|MF_ENABLED; + + SetMenuEnables(hMenu, machineThinkingEnables); + + if (gameMode == MachinePlaysBlack) { + (void)EnableMenuItem(hMenu, IDM_MachineBlack, flags); + } else if (gameMode == MachinePlaysWhite) { + (void)EnableMenuItem(hMenu, IDM_MachineWhite, flags); + } else if (gameMode == TwoMachinesPlay) { + (void)EnableMenuItem(hMenu, IDM_TwoMachines, flags); + } + } + + + VOID + DisplayTitle(char *str) + { + char title[MSG_SIZ], *host; + if (str[0] != NULLCHAR) { + strcpy(title, str); + } else if (appData.icsActive) { + if (appData.icsCommPort[0] != NULLCHAR) + host = "ICS"; + else + host = appData.icsHost; + sprintf(title, "%s: %s", szTitle, host); + } else if (appData.noChessProgram) { + strcpy(title, szTitle); + } else { + strcpy(title, szTitle); + strcat(title, ": "); + strcat(title, first.tidy); + } + SetWindowText(hwndMain, title); + } + + + VOID + DisplayMessage(char *str1, char *str2) + { + HDC hdc; + HFONT oldFont; + int remain = MESSAGE_TEXT_MAX - 1; + int len; + + moveErrorMessageUp = FALSE; /* turned on later by caller if needed */ + messageText[0] = NULLCHAR; + if (*str1) { + len = strlen(str1); + if (len > remain) len = remain; + strncpy(messageText, str1, len); + messageText[len] = NULLCHAR; + remain -= len; + } + if (*str2 && remain >= 2) { + if (*str1) { + strcat(messageText, " "); + remain -= 2; + } + len = strlen(str2); + if (len > remain) len = remain; + strncat(messageText, str2, len); + } + messageText[MESSAGE_TEXT_MAX - 1] = NULLCHAR; + + if (IsIconic(hwndMain)) return; + hdc = GetDC(hwndMain); + oldFont = SelectObject(hdc, font[boardSize][MESSAGE_FONT]->hf); + ExtTextOut(hdc, messageRect.left, messageRect.top, ETO_CLIPPED|ETO_OPAQUE, + &messageRect, messageText, strlen(messageText), NULL); + (void) SelectObject(hdc, oldFont); + (void) ReleaseDC(hwndMain, hdc); + } + + VOID + DisplayError(char *str, int error) + { + char buf[MSG_SIZ*2], buf2[MSG_SIZ]; + int len; + + if (error == 0) { + strcpy(buf, str); + } else { + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, error, LANG_NEUTRAL, + (LPSTR) buf2, MSG_SIZ, NULL); + if (len > 0) { + sprintf(buf, "%s:\n%s", str, buf2); + } else { + ErrorMap *em = errmap; + while (em->err != 0 && em->err != error) em++; + if (em->err != 0) { + sprintf(buf, "%s:\n%s", str, em->msg); + } else { + sprintf(buf, "%s:\nError code %d", str, error); + } + } + } + + ErrorPopUp("Error", buf); + } + + + VOID + DisplayMoveError(char *str) + { + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, NULL); + if (appData.popupMoveErrors) { + ErrorPopUp("Error", str); + } else { + DisplayMessage(str, ""); + moveErrorMessageUp = TRUE; + } + } + + VOID + DisplayFatalError(char *str, int error, int exitStatus) + { + char buf[2*MSG_SIZ], buf2[MSG_SIZ]; + int len; + char *label = exitStatus ? "Fatal Error" : "Exiting"; + + if (error != 0) { + len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, error, LANG_NEUTRAL, + (LPSTR) buf2, MSG_SIZ, NULL); + if (len > 0) { + sprintf(buf, "%s:\n%s", str, buf2); + } else { + ErrorMap *em = errmap; + while (em->err != 0 && em->err != error) em++; + if (em->err != 0) { + sprintf(buf, "%s:\n%s", str, em->msg); + } else { + sprintf(buf, "%s:\nError code %d", str, error); + } + } + str = buf; + } + if (appData.debugMode) { + fprintf(debugFP, "%s: %s\n", label, str); + } + if (appData.popupExitMessage) { + (void) MessageBox(hwndMain, str, label, MB_OK| + (exitStatus ? MB_ICONSTOP : MB_ICONINFORMATION)); + } + ExitEvent(exitStatus); + } + + + VOID + DisplayInformation(char *str) + { + (void) MessageBox(hwndMain, str, "Information", MB_OK|MB_ICONINFORMATION); + } + + + VOID + DisplayNote(char *str) + { + ErrorPopUp("Note", str); + } + + + typedef struct { + char *title, *question, *replyPrefix; + ProcRef pr; + } QuestionParams; + + LRESULT CALLBACK + QuestionDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static QuestionParams *qp; + char reply[MSG_SIZ]; + int len, err; + + switch (message) { + case WM_INITDIALOG: + qp = (QuestionParams *) lParam; + CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); + SetWindowText(hDlg, qp->title); + SetDlgItemText(hDlg, OPT_QuestionText, qp->question); + SetFocus(GetDlgItem(hDlg, OPT_QuestionInput)); + return FALSE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + strcpy(reply, qp->replyPrefix); + if (*reply) strcat(reply, " "); + len = strlen(reply); + GetDlgItemText(hDlg, OPT_QuestionInput, reply + len, sizeof(reply) - len); + strcat(reply, "\n"); + OutputToProcess(qp->pr, reply, strlen(reply), &err); + EndDialog(hDlg, TRUE); + if (err) DisplayFatalError("Error writing to chess program", err, 1); + return TRUE; + case IDCANCEL: + EndDialog(hDlg, FALSE); + return TRUE; + default: + break; + } + break; + } + return FALSE; + } + + VOID + AskQuestion(char* title, char *question, char *replyPrefix, ProcRef pr) + { + QuestionParams qp; + FARPROC lpProc; + + qp.title = title; + qp.question = question; + qp.replyPrefix = replyPrefix; + qp.pr = pr; + lpProc = MakeProcInstance((FARPROC)QuestionDialog, hInst); + DialogBoxParam(hInst, MAKEINTRESOURCE(DLG_Question), + hwndMain, (DLGPROC)lpProc, (LPARAM)&qp); + FreeProcInstance(lpProc); + } + + /* [AS] Pick FRC position */ + LRESULT CALLBACK NewGameFRC_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static int * lpIndexFRC; + BOOL index_is_ok; + char buf[16]; + + switch( message ) + { + case WM_INITDIALOG: + lpIndexFRC = (int *) lParam; + + CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); + + SendDlgItemMessage( hDlg, IDC_NFG_Edit, EM_SETLIMITTEXT, sizeof(buf)-1, 0 ); + SetDlgItemInt( hDlg, IDC_NFG_Edit, *lpIndexFRC, TRUE ); + SendDlgItemMessage( hDlg, IDC_NFG_Edit, EM_SETSEL, 0, -1 ); + SetFocus(GetDlgItem(hDlg, IDC_NFG_Edit)); + + break; + + case WM_COMMAND: + switch( LOWORD(wParam) ) { + case IDOK: + *lpIndexFRC = GetDlgItemInt(hDlg, IDC_NFG_Edit, &index_is_ok, TRUE ); + EndDialog( hDlg, 0 ); + shuffleOpenings = TRUE; /* [HGM] shuffle: switch shuffling on for as long as we stay in current variant */ + return TRUE; + case IDCANCEL: + EndDialog( hDlg, 1 ); + return TRUE; + case IDC_NFG_Edit: + if( HIWORD(wParam) == EN_CHANGE ) { + GetDlgItemInt(hDlg, IDC_NFG_Edit, &index_is_ok, TRUE ); + + EnableWindow( GetDlgItem(hDlg, IDOK), index_is_ok ); + } + return TRUE; + case IDC_NFG_Random: + sprintf( buf, "%d", myrandom() ); /* [HGM] shuffle: no longer limit to 960 */ + SetDlgItemText(hDlg, IDC_NFG_Edit, buf ); + return TRUE; + } + + break; + } + + return FALSE; + } + + int NewGameFRC() + { + int result; + int index = appData.defaultFrcPosition; + FARPROC lpProc = MakeProcInstance( (FARPROC) NewGameFRC_Proc, hInst ); + + result = DialogBoxParam( hInst, MAKEINTRESOURCE(DLG_NewGameFRC), hwndMain, (DLGPROC)lpProc, (LPARAM)&index ); + + if( result == 0 ) { + appData.defaultFrcPosition = index; + } + + return result; + } + + /* [AS] Game list options */ + typedef struct { + char id; + char * name; + } GLT_Item; + + static GLT_Item GLT_ItemInfo[] = { + { GLT_EVENT, "Event" }, + { GLT_SITE, "Site" }, + { GLT_DATE, "Date" }, + { GLT_ROUND, "Round" }, + { GLT_PLAYERS, "Players" }, + { GLT_RESULT, "Result" }, + { GLT_WHITE_ELO, "White Rating" }, + { GLT_BLACK_ELO, "Black Rating" }, + { GLT_TIME_CONTROL,"Time Control" }, + { GLT_VARIANT, "Variant" }, + { GLT_OUT_OF_BOOK,PGN_OUT_OF_BOOK }, + { 0, 0 } + }; + + const char * GLT_FindItem( char id ) + { + const char * result = 0; + + GLT_Item * list = GLT_ItemInfo; + + while( list->id != 0 ) { + if( list->id == id ) { + result = list->name; + break; + } + + list++; + } + + return result; + } + + void GLT_AddToList( HWND hDlg, int iDlgItem, char id, int index ) + { + const char * name = GLT_FindItem( id ); + + if( name != 0 ) { + if( index >= 0 ) { + SendDlgItemMessage( hDlg, iDlgItem, LB_INSERTSTRING, index, (LPARAM) name ); + } + else { + SendDlgItemMessage( hDlg, iDlgItem, LB_ADDSTRING, 0, (LPARAM) name ); + } + } + } + + void GLT_TagsToList( HWND hDlg, char * tags ) + { + char * pc = tags; + + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_RESETCONTENT, 0, 0 ); + + while( *pc ) { + GLT_AddToList( hDlg, IDC_GameListTags, *pc, -1 ); + pc++; + } + + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_ADDSTRING, 0, (LPARAM) "\t --- Hidden tags ---" ); + + pc = GLT_ALL_TAGS; + + while( *pc ) { + if( strchr( tags, *pc ) == 0 ) { + GLT_AddToList( hDlg, IDC_GameListTags, *pc, -1 ); + } + pc++; + } + + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_SETCURSEL, 0, 0 ); + } + + char GLT_ListItemToTag( HWND hDlg, int index ) + { + char result = '\0'; + char name[128]; + + GLT_Item * list = GLT_ItemInfo; + + if( SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETTEXT, index, (LPARAM) name ) != LB_ERR ) { + while( list->id != 0 ) { + if( strcmp( list->name, name ) == 0 ) { + result = list->id; + break; + } + + list++; + } + } + + return result; + } + + void GLT_MoveSelection( HWND hDlg, int delta ) + { + int idx1 = (int) SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETCURSEL, 0, 0 ); + int idx2 = idx1 + delta; + int count = (int) SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETCOUNT, 0, 0 ); + + if( idx1 >=0 && idx1 < count && idx2 >= 0 && idx2 < count ) { + char buf[128]; + + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETTEXT, idx1, (LPARAM) buf ); + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_DELETESTRING, idx1, 0 ); + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_INSERTSTRING, idx2, (LPARAM) buf ); + SendDlgItemMessage( hDlg, IDC_GameListTags, LB_SETCURSEL, idx2, 0 ); + } + } + + LRESULT CALLBACK GameListOptions_Proc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static char glt[64]; + static char * lpUserGLT; + + switch( message ) + { + case WM_INITDIALOG: + lpUserGLT = (char *) lParam; + + strcpy( glt, lpUserGLT ); + + CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); + + /* Initialize list */ + GLT_TagsToList( hDlg, glt ); + + SetFocus( GetDlgItem(hDlg, IDC_GameListTags) ); + + break; + + case WM_COMMAND: + switch( LOWORD(wParam) ) { + case IDOK: + { + char * pc = lpUserGLT; + int idx = 0; + int cnt = (int) SendDlgItemMessage( hDlg, IDC_GameListTags, LB_GETCOUNT, 0, 0 ); + char id; + + do { + id = GLT_ListItemToTag( hDlg, idx ); + + *pc++ = id; + idx++; + } while( id != '\0' ); + } + EndDialog( hDlg, 0 ); + return TRUE; + case IDCANCEL: + EndDialog( hDlg, 1 ); + return TRUE; + + case IDC_GLT_Default: + strcpy( glt, GLT_DEFAULT_TAGS ); + GLT_TagsToList( hDlg, glt ); + return TRUE; + + case IDC_GLT_Restore: + strcpy( glt, lpUserGLT ); + GLT_TagsToList( hDlg, glt ); + return TRUE; + + case IDC_GLT_Up: + GLT_MoveSelection( hDlg, -1 ); + return TRUE; + + case IDC_GLT_Down: + GLT_MoveSelection( hDlg, +1 ); + return TRUE; + } + + break; + } + + return FALSE; + } + + int GameListOptions() + { + char glt[64]; + int result; + FARPROC lpProc = MakeProcInstance( (FARPROC) GameListOptions_Proc, hInst ); + + strcpy( glt, appData.gameListTags ); + + result = DialogBoxParam( hInst, MAKEINTRESOURCE(DLG_GameListOptions), hwndMain, (DLGPROC)lpProc, (LPARAM)glt ); + + if( result == 0 ) { + /* [AS] Memory leak here! */ + appData.gameListTags = strdup( glt ); + } + + return result; + } + + + VOID + DisplayIcsInteractionTitle(char *str) + { + char consoleTitle[MSG_SIZ]; + + sprintf(consoleTitle, "%s: %s", szConsoleTitle, str); + SetWindowText(hwndConsole, consoleTitle); + } + + void + DrawPosition(int fullRedraw, Board board) + { + HDCDrawPosition(NULL, (BOOLEAN) fullRedraw, board); + } + + + VOID + ResetFrontEnd() + { + fromX = fromY = -1; + if (dragInfo.pos.x != -1 || dragInfo.pos.y != -1) { + dragInfo.pos.x = dragInfo.pos.y = -1; + dragInfo.pos.x = dragInfo.pos.y = -1; + dragInfo.lastpos = dragInfo.pos; + dragInfo.start.x = dragInfo.start.y = -1; + dragInfo.from = dragInfo.start; + ReleaseCapture(); + DrawPosition(TRUE, NULL); + } + } + + + VOID + CommentPopUp(char *title, char *str) + { + HWND hwnd = GetActiveWindow(); + EitherCommentPopUp(0, title, str, FALSE); + SetActiveWindow(hwnd); + } + + VOID + CommentPopDown(void) + { + CheckMenuItem(GetMenu(hwndMain), IDM_EditComment, MF_UNCHECKED); + if (commentDialog) { + ShowWindow(commentDialog, SW_HIDE); + } + commentDialogUp = FALSE; + } + + VOID + EditCommentPopUp(int index, char *title, char *str) + { + EitherCommentPopUp(index, title, str, TRUE); + } + + + VOID + RingBell() + { + MyPlaySound(&sounds[(int)SoundMove]); + } + + VOID PlayIcsWinSound() + { + MyPlaySound(&sounds[(int)SoundIcsWin]); + } + + VOID PlayIcsLossSound() + { + MyPlaySound(&sounds[(int)SoundIcsLoss]); + } + + VOID PlayIcsDrawSound() + { + MyPlaySound(&sounds[(int)SoundIcsDraw]); + } + + VOID PlayIcsUnfinishedSound() + { + MyPlaySound(&sounds[(int)SoundIcsUnfinished]); + } + + VOID + PlayAlarmSound() + { + MyPlaySound(&sounds[(int)SoundAlarm]); + } + + + VOID + EchoOn() + { + HWND hInput; + consoleEcho = TRUE; + hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&consoleCF); + SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor); + } + + + VOID + EchoOff() + { + CHARFORMAT cf; + HWND hInput; + consoleEcho = FALSE; + hInput = GetDlgItem(hwndConsole, OPT_ConsoleInput); + /* This works OK: set text and background both to the same color */ + cf = consoleCF; + cf.crTextColor = COLOR_ECHOOFF; + SendMessage(hInput, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); + SendMessage(hInput, EM_SETBKGNDCOLOR, FALSE, cf.crTextColor); + } + + /* No Raw()...? */ + + void Colorize(ColorClass cc, int continuation) + { + currentColorClass = cc; + consoleCF.dwMask = CFM_COLOR|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT; + consoleCF.crTextColor = textAttribs[cc].color; + consoleCF.dwEffects = textAttribs[cc].effects; + if (!continuation) MyPlaySound(&textAttribs[cc].sound); + } + + char * + UserName() + { + static char buf[MSG_SIZ]; + DWORD bufsiz = MSG_SIZ; + + if(appData.userName != NULL && appData.userName[0] != 0) { + return appData.userName; /* [HGM] username: prefer name selected by user over his system login */ + } + if (!GetUserName(buf, &bufsiz)) { + /*DisplayError("Error getting user name", GetLastError());*/ + strcpy(buf, "User"); + } + return buf; + } + + char * + HostName() + { + static char buf[MSG_SIZ]; + DWORD bufsiz = MSG_SIZ; + + if (!GetComputerName(buf, &bufsiz)) { + /*DisplayError("Error getting host name", GetLastError());*/ + strcpy(buf, "Unknown"); + } + return buf; + } + + + int + ClockTimerRunning() + { + return clockTimerEvent != 0; + } + + int + StopClockTimer() + { + if (clockTimerEvent == 0) return FALSE; + KillTimer(hwndMain, clockTimerEvent); + clockTimerEvent = 0; + return TRUE; + } + + void + StartClockTimer(long millisec) + { + clockTimerEvent = SetTimer(hwndMain, (UINT) CLOCK_TIMER_ID, + (UINT) millisec, NULL); + } + + void + DisplayWhiteClock(long timeRemaining, int highlight) + { + HDC hdc; - hdc = GetDC(hwndMain); + char *flag = whiteFlag && gameMode == TwoMachinesPlay ? "(!)" : ""; + ++ if(appData.noGUI) return; ++ hdc = GetDC(hwndMain); + if (!IsIconic(hwndMain)) { + DisplayAClock(hdc, timeRemaining, highlight, + (logoHeight > 0 ? flipView: flipClock) ? &blackRect : &whiteRect, "White", flag); + } + if (highlight && iconCurrent == iconBlack) { + iconCurrent = iconWhite; + PostMessage(hwndMain, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); + if (IsIconic(hwndMain)) { + DrawIcon(hdc, 2, 2, iconCurrent); + } + } + (void) ReleaseDC(hwndMain, hdc); + if (hwndConsole) + PostMessage(hwndConsole, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); + } + + void + DisplayBlackClock(long timeRemaining, int highlight) + { + HDC hdc; + char *flag = blackFlag && gameMode == TwoMachinesPlay ? "(!)" : ""; + ++ if(appData.noGUI) return; + hdc = GetDC(hwndMain); + if (!IsIconic(hwndMain)) { + DisplayAClock(hdc, timeRemaining, highlight, + (logoHeight > 0 ? flipView: flipClock) ? &whiteRect : &blackRect, "Black", flag); + } + if (highlight && iconCurrent == iconWhite) { + iconCurrent = iconBlack; + PostMessage(hwndMain, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); + if (IsIconic(hwndMain)) { + DrawIcon(hdc, 2, 2, iconCurrent); + } + } + (void) ReleaseDC(hwndMain, hdc); + if (hwndConsole) + PostMessage(hwndConsole, WM_SETICON, (WPARAM) TRUE, (LPARAM) iconCurrent); + } + + + int + LoadGameTimerRunning() + { + return loadGameTimerEvent != 0; + } + + int + StopLoadGameTimer() + { + if (loadGameTimerEvent == 0) return FALSE; + KillTimer(hwndMain, loadGameTimerEvent); + loadGameTimerEvent = 0; + return TRUE; + } + + void + StartLoadGameTimer(long millisec) + { + loadGameTimerEvent = SetTimer(hwndMain, (UINT) LOAD_GAME_TIMER_ID, + (UINT) millisec, NULL); + } + + void + AutoSaveGame() + { + char *defName; + FILE *f; + char fileTitle[MSG_SIZ]; + + defName = DefaultFileName(appData.oldSaveStyle ? "gam" : "pgn"); + f = OpenFileDialog(hwndMain, "a", defName, + appData.oldSaveStyle ? "gam" : "pgn", + GAME_FILT, + "Save Game to File", NULL, fileTitle, NULL); + if (f != NULL) { + SaveGame(f, 0, ""); + fclose(f); + } + } + + + void + ScheduleDelayedEvent(DelayedEventCallback cb, long millisec) + { + if (delayedTimerEvent != 0) { + if (appData.debugMode) { + fprintf(debugFP, "ScheduleDelayedEvent: event already scheduled\n"); + } + KillTimer(hwndMain, delayedTimerEvent); + delayedTimerEvent = 0; + delayedTimerCallback(); + } + delayedTimerCallback = cb; + delayedTimerEvent = SetTimer(hwndMain, (UINT) DELAYED_TIMER_ID, + (UINT) millisec, NULL); + } + + DelayedEventCallback + GetDelayedEvent() + { + if (delayedTimerEvent) { + return delayedTimerCallback; + } else { + return NULL; + } + } + + void + CancelDelayedEvent() + { + if (delayedTimerEvent) { + KillTimer(hwndMain, delayedTimerEvent); + delayedTimerEvent = 0; + } + } + + DWORD GetWin32Priority(int nice) + { // [HGM] nice: translate Unix nice() value to indows priority class. (Code stolen from Polyglot 1.4w11) + /* + REALTIME_PRIORITY_CLASS 0x00000100 + HIGH_PRIORITY_CLASS 0x00000080 + ABOVE_NORMAL_PRIORITY_CLASS 0x00008000 + NORMAL_PRIORITY_CLASS 0x00000020 + BELOW_NORMAL_PRIORITY_CLASS 0x00004000 + IDLE_PRIORITY_CLASS 0x00000040 + */ + if (nice < -15) return 0x00000080; + if (nice < 0) return 0x00008000; + if (nice == 0) return 0x00000020; + if (nice < 15) return 0x00004000; + return 0x00000040; + } + + /* Start a child process running the given program. + The process's standard output can be read from "from", and its + standard input can be written to "to". + Exit with fatal error if anything goes wrong. + Returns an opaque pointer that can be used to destroy the process + later. + */ + int + StartChildProcess(char *cmdLine, char *dir, ProcRef *pr) + { + #define BUFSIZE 4096 + + HANDLE hChildStdinRd, hChildStdinWr, + hChildStdoutRd, hChildStdoutWr; + HANDLE hChildStdinWrDup, hChildStdoutRdDup; + SECURITY_ATTRIBUTES saAttr; + BOOL fSuccess; + PROCESS_INFORMATION piProcInfo; + STARTUPINFO siStartInfo; + ChildProc *cp; + char buf[MSG_SIZ]; + DWORD err; + + if (appData.debugMode) { + fprintf(debugFP, "StartChildProcess (dir=\"%s\") %s\n", dir, cmdLine); + } + + *pr = NoProc; + + /* Set the bInheritHandle flag so pipe handles are inherited. */ + saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); + saAttr.bInheritHandle = TRUE; + saAttr.lpSecurityDescriptor = NULL; + + /* + * The steps for redirecting child's STDOUT: + * 1. Create anonymous pipe to be STDOUT for child. + * 2. Create a noninheritable duplicate of read handle, + * and close the inheritable read handle. + */ + + /* Create a pipe for the child's STDOUT. */ + if (! CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0)) { + return GetLastError(); + } + + /* Duplicate the read handle to the pipe, so it is not inherited. */ + fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd, + GetCurrentProcess(), &hChildStdoutRdDup, 0, + FALSE, /* not inherited */ + DUPLICATE_SAME_ACCESS); + if (! fSuccess) { + return GetLastError(); + } + CloseHandle(hChildStdoutRd); + + /* + * The steps for redirecting child's STDIN: + * 1. Create anonymous pipe to be STDIN for child. + * 2. Create a noninheritable duplicate of write handle, + * and close the inheritable write handle. + */ + + /* Create a pipe for the child's STDIN. */ + if (! CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0)) { + return GetLastError(); + } + + /* Duplicate the write handle to the pipe, so it is not inherited. */ + fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdinWr, + GetCurrentProcess(), &hChildStdinWrDup, 0, + FALSE, /* not inherited */ + DUPLICATE_SAME_ACCESS); + if (! fSuccess) { + return GetLastError(); + } + CloseHandle(hChildStdinWr); + + /* Arrange to (1) look in dir for the child .exe file, and + * (2) have dir be the child's working directory. Interpret + * dir relative to the directory WinBoard loaded from. */ + GetCurrentDirectory(MSG_SIZ, buf); + SetCurrentDirectory(installDir); + SetCurrentDirectory(dir); + + /* Now create the child process. */ + + siStartInfo.cb = sizeof(STARTUPINFO); + siStartInfo.lpReserved = NULL; + siStartInfo.lpDesktop = NULL; + siStartInfo.lpTitle = NULL; + siStartInfo.dwFlags = STARTF_USESTDHANDLES; + siStartInfo.cbReserved2 = 0; + siStartInfo.lpReserved2 = NULL; + siStartInfo.hStdInput = hChildStdinRd; + siStartInfo.hStdOutput = hChildStdoutWr; + siStartInfo.hStdError = hChildStdoutWr; + + fSuccess = CreateProcess(NULL, + cmdLine, /* command line */ + NULL, /* process security attributes */ + NULL, /* primary thread security attrs */ + TRUE, /* handles are inherited */ + DETACHED_PROCESS|CREATE_NEW_PROCESS_GROUP, + NULL, /* use parent's environment */ + NULL, + &siStartInfo, /* STARTUPINFO pointer */ + &piProcInfo); /* receives PROCESS_INFORMATION */ + + err = GetLastError(); + SetCurrentDirectory(buf); /* return to prev directory */ + if (! fSuccess) { + return err; + } + + if (appData.niceEngines){ // [HGM] nice: adjust engine proc priority + if(appData.debugMode) fprintf(debugFP, "nice engine proc to %d\n", appData.niceEngines); + SetPriorityClass(piProcInfo.hProcess, GetWin32Priority(appData.niceEngines)); + } + + /* Close the handles we don't need in the parent */ + CloseHandle(piProcInfo.hThread); + CloseHandle(hChildStdinRd); + CloseHandle(hChildStdoutWr); + + /* Prepare return value */ + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPReal; + cp->hProcess = piProcInfo.hProcess; + cp->pid = piProcInfo.dwProcessId; + cp->hFrom = hChildStdoutRdDup; + cp->hTo = hChildStdinWrDup; + + *pr = (void *) cp; + + /* Klaus Friedel says that this Sleep solves a problem under Windows + 2000 where engines sometimes don't see the initial command(s) + from WinBoard and hang. I don't understand how that can happen, + but the Sleep is harmless, so I've put it in. Others have also + reported what may be the same problem, so hopefully this will fix + it for them too. */ + Sleep(500); + + return NO_ERROR; + } + + + void + DestroyChildProcess(ProcRef pr, int/*boolean*/ signal) + { + ChildProc *cp; int result; + + cp = (ChildProc *) pr; + if (cp == NULL) return; + + switch (cp->kind) { + case CPReal: + /* TerminateProcess is considered harmful, so... */ + CloseHandle(cp->hTo); /* Closing this will give the child an EOF and hopefully kill it */ + if (cp->hFrom) CloseHandle(cp->hFrom); /* if NULL, InputThread will close it */ + /* The following doesn't work because the chess program + doesn't "have the same console" as WinBoard. Maybe + we could arrange for this even though neither WinBoard + nor the chess program uses a console for stdio? */ + /*!!if (signal) GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, cp->pid);*/ + + /* [AS] Special termination modes for misbehaving programs... */ + if( signal == 9 ) { + result = TerminateProcess( cp->hProcess, 0 ); + + if ( appData.debugMode) { + fprintf( debugFP, "Terminating process %u, result=%d\n", cp->pid, result ); + } + } + else if( signal == 10 ) { + DWORD dw = WaitForSingleObject( cp->hProcess, 3*1000 ); // Wait 3 seconds at most + + if( dw != WAIT_OBJECT_0 ) { + result = TerminateProcess( cp->hProcess, 0 ); + + if ( appData.debugMode) { + fprintf( debugFP, "Process %u still alive after timeout, killing... result=%d\n", cp->pid, result ); + } + + } + } + + CloseHandle(cp->hProcess); + break; + + case CPComm: + if (cp->hFrom) CloseHandle(cp->hFrom); + break; + + case CPSock: + closesocket(cp->sock); + WSACleanup(); + break; + + case CPRcmd: + if (signal) send(cp->sock2, "\017", 1, 0); /* 017 = 15 = SIGTERM */ + closesocket(cp->sock); + closesocket(cp->sock2); + WSACleanup(); + break; + } + free(cp); + } + + void + InterruptChildProcess(ProcRef pr) + { + ChildProc *cp; + + cp = (ChildProc *) pr; + if (cp == NULL) return; + switch (cp->kind) { + case CPReal: + /* The following doesn't work because the chess program + doesn't "have the same console" as WinBoard. Maybe + we could arrange for this even though neither WinBoard + nor the chess program uses a console for stdio */ + /*!!GenerateConsoleCtrlEvent(CTRL_C_EVENT, cp->pid);*/ + break; + + case CPComm: + case CPSock: + /* Can't interrupt */ + break; + + case CPRcmd: + send(cp->sock2, "\002", 1, 0); /* 2 = SIGINT */ + break; + } + } + + + int + OpenTelnet(char *host, char *port, ProcRef *pr) + { + char cmdLine[MSG_SIZ]; + + if (port[0] == NULLCHAR) { + sprintf(cmdLine, "%s %s", appData.telnetProgram, host); + } else { + sprintf(cmdLine, "%s %s %s", appData.telnetProgram, host, port); + } + return StartChildProcess(cmdLine, "", pr); + } + + + /* Code to open TCP sockets */ + + int + OpenTCP(char *host, char *port, ProcRef *pr) + { + ChildProc *cp; + int err; + SOCKET s; + struct sockaddr_in sa, mysa; + struct hostent FAR *hp; + unsigned short uport; + WORD wVersionRequested; + WSADATA wsaData; + + /* Initialize socket DLL */ + wVersionRequested = MAKEWORD(1, 1); + err = WSAStartup(wVersionRequested, &wsaData); + if (err != 0) return err; + + /* Make socket */ + if ((s = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { + err = WSAGetLastError(); + WSACleanup(); + return err; + } + + /* Bind local address using (mostly) don't-care values. + */ + memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); + mysa.sin_family = AF_INET; + mysa.sin_addr.s_addr = INADDR_ANY; + uport = (unsigned short) 0; + mysa.sin_port = htons(uport); + if (bind(s, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) + == SOCKET_ERROR) { + err = WSAGetLastError(); + WSACleanup(); + return err; + } + + /* Resolve remote host name */ + memset((char *) &sa, 0, sizeof(struct sockaddr_in)); + if (!(hp = gethostbyname(host))) { + unsigned int b0, b1, b2, b3; + + err = WSAGetLastError(); + + if (sscanf(host, "%u.%u.%u.%u", &b0, &b1, &b2, &b3) == 4) { + hp = (struct hostent *) calloc(1, sizeof(struct hostent)); + hp->h_addrtype = AF_INET; + hp->h_length = 4; + hp->h_addr_list = (char **) calloc(2, sizeof(char *)); + hp->h_addr_list[0] = (char *) malloc(4); + hp->h_addr_list[0][0] = (char) b0; + hp->h_addr_list[0][1] = (char) b1; + hp->h_addr_list[0][2] = (char) b2; + hp->h_addr_list[0][3] = (char) b3; + } else { + WSACleanup(); + return err; + } + } + sa.sin_family = hp->h_addrtype; + uport = (unsigned short) atoi(port); + sa.sin_port = htons(uport); + memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); + + /* Make connection */ + if (connect(s, (struct sockaddr *) &sa, + sizeof(struct sockaddr_in)) == SOCKET_ERROR) { + err = WSAGetLastError(); + WSACleanup(); + return err; + } + + /* Prepare return value */ + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPSock; + cp->sock = s; + *pr = (ProcRef *) cp; + + return NO_ERROR; + } + + int + OpenCommPort(char *name, ProcRef *pr) + { + HANDLE h; + COMMTIMEOUTS ct; + ChildProc *cp; + char fullname[MSG_SIZ]; + + if (*name != '\\') + sprintf(fullname, "\\\\.\\%s", name); + else + strcpy(fullname, name); + + h = CreateFile(name, GENERIC_READ | GENERIC_WRITE, + 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + if (h == (HANDLE) -1) { + return GetLastError(); + } + hCommPort = h; + + if (!SetCommState(h, (LPDCB) &dcb)) return GetLastError(); + + /* Accumulate characters until a 100ms pause, then parse */ + ct.ReadIntervalTimeout = 100; + ct.ReadTotalTimeoutMultiplier = 0; + ct.ReadTotalTimeoutConstant = 0; + ct.WriteTotalTimeoutMultiplier = 0; + ct.WriteTotalTimeoutConstant = 0; + if (!SetCommTimeouts(h, (LPCOMMTIMEOUTS) &ct)) return GetLastError(); + + /* Prepare return value */ + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPComm; + cp->hFrom = h; + cp->hTo = h; + *pr = (ProcRef *) cp; + + return NO_ERROR; + } + + int + OpenLoopback(ProcRef *pr) + { + DisplayFatalError("Not implemented", 0, 1); + return NO_ERROR; + } + + + int + OpenRcmd(char* host, char* user, char* cmd, ProcRef* pr) + { + ChildProc *cp; + int err; + SOCKET s, s2, s3; + struct sockaddr_in sa, mysa; + struct hostent FAR *hp; + unsigned short uport; + WORD wVersionRequested; + WSADATA wsaData; + int fromPort; + char stderrPortStr[MSG_SIZ]; + + /* Initialize socket DLL */ + wVersionRequested = MAKEWORD(1, 1); + err = WSAStartup(wVersionRequested, &wsaData); + if (err != 0) return err; + + /* Resolve remote host name */ + memset((char *) &sa, 0, sizeof(struct sockaddr_in)); + if (!(hp = gethostbyname(host))) { + unsigned int b0, b1, b2, b3; + + err = WSAGetLastError(); + + if (sscanf(host, "%u.%u.%u.%u", &b0, &b1, &b2, &b3) == 4) { + hp = (struct hostent *) calloc(1, sizeof(struct hostent)); + hp->h_addrtype = AF_INET; + hp->h_length = 4; + hp->h_addr_list = (char **) calloc(2, sizeof(char *)); + hp->h_addr_list[0] = (char *) malloc(4); + hp->h_addr_list[0][0] = (char) b0; + hp->h_addr_list[0][1] = (char) b1; + hp->h_addr_list[0][2] = (char) b2; + hp->h_addr_list[0][3] = (char) b3; + } else { + WSACleanup(); + return err; + } + } + sa.sin_family = hp->h_addrtype; + uport = (unsigned short) 514; + sa.sin_port = htons(uport); + memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); + + /* Bind local socket to unused "privileged" port address + */ + s = INVALID_SOCKET; + memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); + mysa.sin_family = AF_INET; + mysa.sin_addr.s_addr = INADDR_ANY; + for (fromPort = 1023;; fromPort--) { + if (fromPort < 0) { + WSACleanup(); + return WSAEADDRINUSE; + } + if (s == INVALID_SOCKET) { + if ((s = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { + err = WSAGetLastError(); + WSACleanup(); + return err; + } + } + uport = (unsigned short) fromPort; + mysa.sin_port = htons(uport); + if (bind(s, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) + == SOCKET_ERROR) { + err = WSAGetLastError(); + if (err == WSAEADDRINUSE) continue; + WSACleanup(); + return err; + } + if (connect(s, (struct sockaddr *) &sa, + sizeof(struct sockaddr_in)) == SOCKET_ERROR) { + err = WSAGetLastError(); + if (err == WSAEADDRINUSE) { + closesocket(s); + s = -1; + continue; + } + WSACleanup(); + return err; + } + break; + } + + /* Bind stderr local socket to unused "privileged" port address + */ + s2 = INVALID_SOCKET; + memset((char *) &mysa, 0, sizeof(struct sockaddr_in)); + mysa.sin_family = AF_INET; + mysa.sin_addr.s_addr = INADDR_ANY; + for (fromPort = 1023;; fromPort--) { + if (fromPort == prevStderrPort) continue; // don't reuse port + if (fromPort < 0) { + (void) closesocket(s); + WSACleanup(); + return WSAEADDRINUSE; + } + if (s2 == INVALID_SOCKET) { + if ((s2 = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { + err = WSAGetLastError(); + closesocket(s); + WSACleanup(); + return err; + } + } + uport = (unsigned short) fromPort; + mysa.sin_port = htons(uport); + if (bind(s2, (struct sockaddr *) &mysa, sizeof(struct sockaddr_in)) + == SOCKET_ERROR) { + err = WSAGetLastError(); + if (err == WSAEADDRINUSE) continue; + (void) closesocket(s); + WSACleanup(); + return err; + } + if (listen(s2, 1) == SOCKET_ERROR) { + err = WSAGetLastError(); + if (err == WSAEADDRINUSE) { + closesocket(s2); + s2 = INVALID_SOCKET; + continue; + } + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + break; + } + prevStderrPort = fromPort; // remember port used + sprintf(stderrPortStr, "%d", fromPort); + + if (send(s, stderrPortStr, strlen(stderrPortStr) + 1, 0) == SOCKET_ERROR) { + err = WSAGetLastError(); + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + + if (send(s, UserName(), strlen(UserName()) + 1, 0) == SOCKET_ERROR) { + err = WSAGetLastError(); + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + if (*user == NULLCHAR) user = UserName(); + if (send(s, user, strlen(user) + 1, 0) == SOCKET_ERROR) { + err = WSAGetLastError(); + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + if (send(s, cmd, strlen(cmd) + 1, 0) == SOCKET_ERROR) { + err = WSAGetLastError(); + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + + if ((s3 = accept(s2, NULL, NULL)) == INVALID_SOCKET) { + err = WSAGetLastError(); + (void) closesocket(s); + (void) closesocket(s2); + WSACleanup(); + return err; + } + (void) closesocket(s2); /* Stop listening */ + + /* Prepare return value */ + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPRcmd; + cp->sock = s; + cp->sock2 = s3; + *pr = (ProcRef *) cp; + + return NO_ERROR; + } + + + InputSourceRef + AddInputSource(ProcRef pr, int lineByLine, + InputCallback func, VOIDSTAR closure) + { + InputSource *is, *is2 = NULL; + ChildProc *cp = (ChildProc *) pr; + + is = (InputSource *) calloc(1, sizeof(InputSource)); + is->lineByLine = lineByLine; + is->func = func; + is->closure = closure; + is->second = NULL; + is->next = is->buf; + if (pr == NoProc) { + is->kind = CPReal; + consoleInputSource = is; + } else { + is->kind = cp->kind; + /* + [AS] Try to avoid a race condition if the thread is given control too early: + we create all threads suspended so that the is->hThread variable can be + safely assigned, then let the threads start with ResumeThread. + */ + switch (cp->kind) { + case CPReal: + is->hFile = cp->hFrom; + cp->hFrom = NULL; /* now owned by InputThread */ + is->hThread = + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) NonOvlInputThread, + (LPVOID) is, CREATE_SUSPENDED, &is->id); + break; + + case CPComm: + is->hFile = cp->hFrom; + cp->hFrom = NULL; /* now owned by InputThread */ + is->hThread = + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) InputThread, + (LPVOID) is, CREATE_SUSPENDED, &is->id); + break; + + case CPSock: + is->sock = cp->sock; + is->hThread = + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, + (LPVOID) is, CREATE_SUSPENDED, &is->id); + break; + + case CPRcmd: + is2 = (InputSource *) calloc(1, sizeof(InputSource)); + *is2 = *is; + is->sock = cp->sock; + is->second = is2; + is2->sock = cp->sock2; + is2->second = is2; + is->hThread = + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, + (LPVOID) is, CREATE_SUSPENDED, &is->id); + is2->hThread = + CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) SocketInputThread, + (LPVOID) is2, CREATE_SUSPENDED, &is2->id); + break; + } + + if( is->hThread != NULL ) { + ResumeThread( is->hThread ); + } + + if( is2 != NULL && is2->hThread != NULL ) { + ResumeThread( is2->hThread ); + } + } + + return (InputSourceRef) is; + } + + void + RemoveInputSource(InputSourceRef isr) + { + InputSource *is; + + is = (InputSource *) isr; + is->hThread = NULL; /* tell thread to stop */ + CloseHandle(is->hThread); + if (is->second != NULL) { + is->second->hThread = NULL; + CloseHandle(is->second->hThread); + } + } + + + int + OutputToProcess(ProcRef pr, char *message, int count, int *outError) + { + DWORD dOutCount; + int outCount = SOCKET_ERROR; + ChildProc *cp = (ChildProc *) pr; + static OVERLAPPED ovl; + + if (pr == NoProc) { + ConsoleOutput(message, count, FALSE); + return count; + } + + if (ovl.hEvent == NULL) { + ovl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + } + ovl.Internal = ovl.InternalHigh = ovl.Offset = ovl.OffsetHigh = 0; + + switch (cp->kind) { + case CPSock: + case CPRcmd: + outCount = send(cp->sock, message, count, 0); + if (outCount == SOCKET_ERROR) { + *outError = WSAGetLastError(); + } else { + *outError = NO_ERROR; + } + break; + + case CPReal: + if (WriteFile(((ChildProc *)pr)->hTo, message, count, + &dOutCount, NULL)) { + *outError = NO_ERROR; + outCount = (int) dOutCount; + } else { + *outError = GetLastError(); + } + break; + + case CPComm: + *outError = DoWriteFile(((ChildProc *)pr)->hTo, message, count, + &dOutCount, &ovl); + if (*outError == NO_ERROR) { + outCount = (int) dOutCount; + } + break; + } + return outCount; + } + + int + OutputToProcessDelayed(ProcRef pr, char *message, int count, int *outError, + long msdelay) + { + /* Ignore delay, not implemented for WinBoard */ + return OutputToProcess(pr, message, count, outError); + } + + + void + CmailSigHandlerCallBack(InputSourceRef isr, VOIDSTAR closure, + char *buf, int count, int error) + { + DisplayFatalError("Not implemented", 0, 1); + } + + /* see wgamelist.c for Game List functions */ + /* see wedittags.c for Edit Tags functions */ + + + VOID + ICSInitScript() + { + FILE *f; + char buf[MSG_SIZ]; + char *dummy; + + if (SearchPath(installDir, appData.icsLogon, NULL, MSG_SIZ, buf, &dummy)) { + f = fopen(buf, "r"); + if (f != NULL) { + ProcessICSInitScript(f); + fclose(f); + } + } + } + + + VOID + StartAnalysisClock() + { + if (analysisTimerEvent) return; + analysisTimerEvent = SetTimer(hwndMain, (UINT) ANALYSIS_TIMER_ID, + (UINT) 2000, NULL); + } + + LRESULT CALLBACK + AnalysisDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) + { + static HANDLE hwndText; + RECT rect; + static int sizeX, sizeY; + int newSizeX, newSizeY, flags; + MINMAXINFO *mmi; + + switch (message) { + case WM_INITDIALOG: /* message: initialize dialog box */ + /* Initialize the dialog items */ + hwndText = GetDlgItem(hDlg, OPT_AnalysisText); + SetWindowText(hDlg, analysisTitle); + SetDlgItemText(hDlg, OPT_AnalysisText, analysisText); + /* Size and position the dialog */ + if (!analysisDialog) { + analysisDialog = hDlg; + flags = SWP_NOZORDER; + GetClientRect(hDlg, &rect); + sizeX = rect.right; + sizeY = rect.bottom; + if (analysisX != CW_USEDEFAULT && analysisY != CW_USEDEFAULT && + analysisW != CW_USEDEFAULT && analysisH != CW_USEDEFAULT) { + WINDOWPLACEMENT wp; + EnsureOnScreen(&analysisX, &analysisY); + wp.length = sizeof(WINDOWPLACEMENT); + wp.flags = 0; + wp.showCmd = SW_SHOW; + wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0; + wp.rcNormalPosition.left = analysisX; + wp.rcNormalPosition.right = analysisX + analysisW; + wp.rcNormalPosition.top = analysisY; + wp.rcNormalPosition.bottom = analysisY + analysisH; + SetWindowPlacement(hDlg, &wp); + + GetClientRect(hDlg, &rect); + newSizeX = rect.right; + newSizeY = rect.bottom; + ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, + newSizeX, newSizeY); + sizeX = newSizeX; + sizeY = newSizeY; + } + } + return FALSE; + + case WM_COMMAND: /* message: received a command */ + switch (LOWORD(wParam)) { + case IDCANCEL: ++ if (appData.icsActive && appData.icsEngineAnalyze) { /* [DM] icsEngineAnalyze */ ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ return TRUE; ++ } + EditGameEvent(); + return TRUE; + default: + break; + } + break; + + case WM_SIZE: + newSizeX = LOWORD(lParam); + newSizeY = HIWORD(lParam); + ResizeEditPlusButtons(hDlg, hwndText, sizeX, sizeY, newSizeX, newSizeY); + sizeX = newSizeX; + sizeY = newSizeY; + break; + + case WM_GETMINMAXINFO: + /* Prevent resizing window too small */ + mmi = (MINMAXINFO *) lParam; + mmi->ptMinTrackSize.x = 100; + mmi->ptMinTrackSize.y = 100; + break; + } + return FALSE; + } + + VOID + AnalysisPopUp(char* title, char* str) + { + FARPROC lpProc; + char *p, *q; + + /* [AS] */ + EngineOutputPopUp(); + return; + + if (str == NULL) str = ""; + p = (char *) malloc(2 * strlen(str) + 2); + q = p; + while (*str) { + if (*str == '\n') *q++ = '\r'; + *q++ = *str++; + } + *q = NULLCHAR; + if (analysisText != NULL) free(analysisText); + analysisText = p; + + if (analysisDialog) { + SetWindowText(analysisDialog, title); + SetDlgItemText(analysisDialog, OPT_AnalysisText, analysisText); + ShowWindow(analysisDialog, SW_SHOW); + } else { + analysisTitle = title; + lpProc = MakeProcInstance((FARPROC)AnalysisDialog, hInst); + CreateDialog(hInst, MAKEINTRESOURCE(DLG_Analysis), + hwndMain, (DLGPROC)lpProc); + FreeProcInstance(lpProc); + } + analysisDialogUp = TRUE; + } + + VOID + AnalysisPopDown() + { + if (analysisDialog) { + ShowWindow(analysisDialog, SW_HIDE); + } + analysisDialogUp = FALSE; + } + + + VOID + SetHighlights(int fromX, int fromY, int toX, int toY) + { + highlightInfo.sq[0].x = fromX; + highlightInfo.sq[0].y = fromY; + highlightInfo.sq[1].x = toX; + highlightInfo.sq[1].y = toY; + } + + VOID + ClearHighlights() + { + highlightInfo.sq[0].x = highlightInfo.sq[0].y = + highlightInfo.sq[1].x = highlightInfo.sq[1].y = -1; + } + + VOID + SetPremoveHighlights(int fromX, int fromY, int toX, int toY) + { + premoveHighlightInfo.sq[0].x = fromX; + premoveHighlightInfo.sq[0].y = fromY; + premoveHighlightInfo.sq[1].x = toX; + premoveHighlightInfo.sq[1].y = toY; + } + + VOID + ClearPremoveHighlights() + { + premoveHighlightInfo.sq[0].x = premoveHighlightInfo.sq[0].y = + premoveHighlightInfo.sq[1].x = premoveHighlightInfo.sq[1].y = -1; + } + + VOID + ShutDownFrontEnd() + { + if (saveSettingsOnExit) SaveSettings(settingsFileName); + DeleteClipboardTempFiles(); + } + + void + BoardToTop() + { + if (IsIconic(hwndMain)) + ShowWindow(hwndMain, SW_RESTORE); + + SetActiveWindow(hwndMain); + } + + /* + * Prototypes for animation support routines + */ + static void ScreenSquare(int column, int row, POINT * pt); + static void Tween( POINT * start, POINT * mid, POINT * finish, int factor, + POINT frames[], int * nFrames); + + + #define kFactor 4 + + void + AnimateMove(board, fromX, fromY, toX, toY) + Board board; + int fromX; + int fromY; + int toX; + int toY; + { + ChessSquare piece; + POINT start, finish, mid; + POINT frames[kFactor * 2 + 1]; + int nFrames, n; + + if (!appData.animate) return; + if (doingSizing) return; + if (fromY < 0 || fromX < 0) return; + piece = board[fromY][fromX]; + if (piece >= EmptySquare) return; + + ScreenSquare(fromX, fromY, &start); + ScreenSquare(toX, toY, &finish); + + /* All pieces except knights move in straight line */ + if (piece != WhiteKnight && piece != BlackKnight) { + mid.x = start.x + (finish.x - start.x) / 2; + mid.y = start.y + (finish.y - start.y) / 2; + } else { + /* Knight: make diagonal movement then straight */ + if (abs(toY - fromY) < abs(toX - fromX)) { + mid.x = start.x + (finish.x - start.x) / 2; + mid.y = finish.y; + } else { + mid.x = finish.x; + mid.y = start.y + (finish.y - start.y) / 2; + } + } + + /* Don't use as many frames for very short moves */ + if (abs(toY - fromY) + abs(toX - fromX) <= 2) + Tween(&start, &mid, &finish, kFactor - 1, frames, &nFrames); + else + Tween(&start, &mid, &finish, kFactor, frames, &nFrames); + + animInfo.from.x = fromX; + animInfo.from.y = fromY; + animInfo.to.x = toX; + animInfo.to.y = toY; + animInfo.lastpos = start; + animInfo.piece = piece; + for (n = 0; n < nFrames; n++) { + animInfo.pos = frames[n]; + DrawPosition(FALSE, NULL); + animInfo.lastpos = animInfo.pos; + Sleep(appData.animSpeed); + } + animInfo.pos = finish; + DrawPosition(FALSE, NULL); + animInfo.piece = EmptySquare; + } + + /* Convert board position to corner of screen rect and color */ + + static void + ScreenSquare(column, row, pt) + int column; int row; POINT * pt; + { + if (flipView) { + pt->x = lineGap + ((BOARD_WIDTH-1)-column) * (squareSize + lineGap); + pt->y = lineGap + row * (squareSize + lineGap); + } else { + pt->x = lineGap + column * (squareSize + lineGap); + pt->y = lineGap + ((BOARD_HEIGHT-1)-row) * (squareSize + lineGap); + } + } + + /* Generate a series of frame coords from start->mid->finish. + The movement rate doubles until the half way point is + reached, then halves back down to the final destination, + which gives a nice slow in/out effect. The algorithmn + may seem to generate too many intermediates for short + moves, but remember that the purpose is to attract the + viewers attention to the piece about to be moved and + then to where it ends up. Too few frames would be less + noticeable. */ + + static void + Tween(start, mid, finish, factor, frames, nFrames) + POINT * start; POINT * mid; + POINT * finish; int factor; + POINT frames[]; int * nFrames; + { + int n, fraction = 1, count = 0; + + /* Slow in, stepping 1/16th, then 1/8th, ... */ + for (n = 0; n < factor; n++) + fraction *= 2; + for (n = 0; n < factor; n++) { + frames[count].x = start->x + (mid->x - start->x) / fraction; + frames[count].y = start->y + (mid->y - start->y) / fraction; + count ++; + fraction = fraction / 2; + } + + /* Midpoint */ + frames[count] = *mid; + count ++; + + /* Slow out, stepping 1/2, then 1/4, ... */ + fraction = 2; + for (n = 0; n < factor; n++) { + frames[count].x = finish->x - (finish->x - mid->x) / fraction; + frames[count].y = finish->y - (finish->y - mid->y) / fraction; + count ++; + fraction = fraction * 2; + } + *nFrames = count; + } + + void + HistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current ) + { + #if 0 + char buf[256]; + + sprintf( buf, "HistorySet: first=%d, last=%d, current=%d (%s)\n", + first, last, current, current >= 0 ? movelist[current] : "n/a" ); + + OutputDebugString( buf ); + #endif + + MoveHistorySet( movelist, first, last, current, pvInfoList ); + + EvalGraphSet( first, last, current, pvInfoList ); + } + + void SetProgramStats( FrontEndProgramStats * stats ) + { + #if 0 + char buf[1024]; + + sprintf( buf, "SetStats for %d: depth=%d, nodes=%lu, score=%5.2f, time=%5.2f, pv=%s\n", + stats->which, stats->depth, stats->nodes, stats->score / 100.0, stats->time / 100.0, stats->pv == 0 ? "n/a" : stats->pv ); + + OutputDebugString( buf ); + #endif + + EngineOutputUpdate( stats ); + } diff --cc winboard/winboard.rc index 3b54cf7,eb7ee05..0759e9f --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@@ -675,9 -1005,18 +1005,18 @@@ EN // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_WHITE_14 ICON DISCARDABLE "bitmaps\\white_14.ico" -ICON_BLACK ICON DISCARDABLE "bitmaps\\icon_ob.ico" -ICON_BOARD ICON DISCARDABLE "bitmaps\\board.ico" -ICON_WHITE ICON DISCARDABLE "bitmaps\\icon_whi.ico" -IDI_BLACK_14 ICON DISCARDABLE "bitmaps\\black_14.ico" -IDI_PONDER_14 ICON DISCARDABLE "bitmaps\\ponder_14.ico" -IDI_TRANS_14 ICON DISCARDABLE "bitmaps\\trans_14.ico" -IDI_CLOCK_14 ICON DISCARDABLE "bitmaps\\clock_14.ico" -IDI_UNKNOWN_14 ICON DISCARDABLE "bitmaps\\unknown_14.ico" -IDI_BALOON_14 ICON DISCARDABLE "bitmaps\\baloon_14.ico" -IDI_ANALYZE_14 ICON DISCARDABLE "bitmaps\\analyze_14.ico" -IDI_ANALYZE2_14 ICON DISCARDABLE "bitmaps\\analyze2_14.ico" ++IDI_WHITE_14 ICON DISCARDABLE "bitmaps/white_14.ico" +ICON_BLACK ICON DISCARDABLE "bitmaps/icon_ob.ico" +ICON_BOARD ICON DISCARDABLE "bitmaps/board.ico" +ICON_WHITE ICON DISCARDABLE "bitmaps/icon_whi.ico" ++IDI_BLACK_14 ICON DISCARDABLE "bitmaps/black_14.ico" ++IDI_PONDER_14 ICON DISCARDABLE "bitmaps/ponder_14.ico" ++IDI_TRANS_14 ICON DISCARDABLE "bitmaps/trans_14.ico" ++IDI_CLOCK_14 ICON DISCARDABLE "bitmaps/clock_14.ico" ++IDI_UNKNOWN_14 ICON DISCARDABLE "bitmaps/unknown_14.ico" ++IDI_BALOON_14 ICON DISCARDABLE "bitmaps/baloon_14.ico" ++IDI_ANALYZE_14 ICON DISCARDABLE "bitmaps/analyze_14.ico" ++IDI_ANALYZE2_14 ICON DISCARDABLE "bitmaps/analyze2_14.ico" ///////////////////////////////////////////////////////////////////////////// // @@@ -959,332 -1377,587 +1377,584 @@@ EN // Bitmap // -P21O BITMAP MOVEABLE PURE "bitmaps\\p21o.bmp" -N21O BITMAP MOVEABLE PURE "bitmaps\\n21o.bmp" -B21O BITMAP MOVEABLE PURE "bitmaps\\b21o.bmp" -R21O BITMAP MOVEABLE PURE "bitmaps\\r21o.bmp" -K21O BITMAP MOVEABLE PURE "bitmaps\\k21o.bmp" -Q21O BITMAP MOVEABLE PURE "bitmaps\\q21o.bmp" -P21S BITMAP MOVEABLE PURE "bitmaps\\p21s.bmp" -N21S BITMAP MOVEABLE PURE "bitmaps\\n21s.bmp" -B21S BITMAP MOVEABLE PURE "bitmaps\\b21s.bmp" -R21S BITMAP MOVEABLE PURE "bitmaps\\r21s.bmp" -Q21S BITMAP MOVEABLE PURE "bitmaps\\q21s.bmp" -K21S BITMAP MOVEABLE PURE "bitmaps\\k21s.bmp" -P21W BITMAP MOVEABLE PURE "bitmaps\\p21w.bmp" -N21W BITMAP MOVEABLE PURE "bitmaps\\n21w.bmp" -B21W BITMAP MOVEABLE PURE "bitmaps\\b21w.bmp" -R21W BITMAP MOVEABLE PURE "bitmaps\\r21w.bmp" -Q21W BITMAP MOVEABLE PURE "bitmaps\\q21w.bmp" -K21W BITMAP MOVEABLE PURE "bitmaps\\k21w.bmp" -P25O BITMAP MOVEABLE PURE "bitmaps\\p25o.bmp" -N25O BITMAP MOVEABLE PURE "bitmaps\\n25o.bmp" -B25O BITMAP MOVEABLE PURE "bitmaps\\b25o.bmp" -R25O BITMAP MOVEABLE PURE "bitmaps\\r25o.bmp" -Q25O BITMAP MOVEABLE PURE "bitmaps\\q25o.bmp" -K25O BITMAP MOVEABLE PURE "bitmaps\\k25o.bmp" -P25S BITMAP MOVEABLE PURE "bitmaps\\p25s.bmp" -N25S BITMAP MOVEABLE PURE "bitmaps\\n25s.bmp" -B25S BITMAP MOVEABLE PURE "bitmaps\\b25s.bmp" -R25S BITMAP MOVEABLE PURE "bitmaps\\r25s.bmp" -Q25S BITMAP MOVEABLE PURE "bitmaps\\q25s.bmp" -K25S BITMAP MOVEABLE PURE "bitmaps\\k25s.bmp" -P25W BITMAP MOVEABLE PURE "bitmaps\\p25w.bmp" -N25W BITMAP MOVEABLE PURE "bitmaps\\n25w.bmp" -B25W BITMAP MOVEABLE PURE "bitmaps\\b25w.bmp" -R25W BITMAP MOVEABLE PURE "bitmaps\\r25w.bmp" -Q25W BITMAP MOVEABLE PURE "bitmaps\\q25w.bmp" -K25W BITMAP MOVEABLE PURE "bitmaps\\k25w.bmp" -P29O BITMAP MOVEABLE PURE "bitmaps\\p29o.bmp" -N29O BITMAP MOVEABLE PURE "bitmaps\\n29o.bmp" -B29O BITMAP MOVEABLE PURE "bitmaps\\b29o.bmp" -R29O BITMAP MOVEABLE PURE "bitmaps\\r29o.bmp" -Q29O BITMAP MOVEABLE PURE "bitmaps\\q29o.bmp" -K29O BITMAP MOVEABLE PURE "bitmaps\\k29o.bmp" -P29S BITMAP MOVEABLE PURE "bitmaps\\p29s.bmp" -N29S BITMAP MOVEABLE PURE "bitmaps\\n29s.bmp" -B29S BITMAP MOVEABLE PURE "bitmaps\\b29s.bmp" -R29S BITMAP MOVEABLE PURE "bitmaps\\r29s.bmp" -Q29S BITMAP MOVEABLE PURE "bitmaps\\q29s.bmp" -K29S BITMAP MOVEABLE PURE "bitmaps\\k29s.bmp" -P29W BITMAP MOVEABLE PURE "bitmaps\\p29w.bmp" -N29W BITMAP MOVEABLE PURE "bitmaps\\n29w.bmp" -B29W BITMAP MOVEABLE PURE "bitmaps\\b29w.bmp" -R29W BITMAP MOVEABLE PURE "bitmaps\\r29w.bmp" -Q29W BITMAP MOVEABLE PURE "bitmaps\\q29w.bmp" -K29W BITMAP MOVEABLE PURE "bitmaps\\k29w.bmp" -P33O BITMAP MOVEABLE PURE "bitmaps\\p33o.bmp" -N33O BITMAP MOVEABLE PURE "bitmaps\\n33o.bmp" -B33O BITMAP MOVEABLE PURE "bitmaps\\b33o.bmp" -R33O BITMAP MOVEABLE PURE "bitmaps\\r33o.bmp" -Q33O BITMAP MOVEABLE PURE "bitmaps\\q33o.bmp" -K33O BITMAP MOVEABLE PURE "bitmaps\\k33o.bmp" -P33S BITMAP MOVEABLE PURE "bitmaps\\p33s.bmp" -N33S BITMAP MOVEABLE PURE "bitmaps\\n33s.bmp" -B33S BITMAP MOVEABLE PURE "bitmaps\\b33s.bmp" -R33S BITMAP MOVEABLE PURE "bitmaps\\r33s.bmp" -Q33S BITMAP MOVEABLE PURE "bitmaps\\q33s.bmp" -K33S BITMAP MOVEABLE PURE "bitmaps\\k33s.bmp" -P33W BITMAP MOVEABLE PURE "bitmaps\\p33w.bmp" -N33W BITMAP MOVEABLE PURE "bitmaps\\n33w.bmp" -B33W BITMAP MOVEABLE PURE "bitmaps\\b33w.bmp" -R33W BITMAP MOVEABLE PURE "bitmaps\\r33w.bmp" -Q33W BITMAP MOVEABLE PURE "bitmaps\\q33w.bmp" -K33W BITMAP MOVEABLE PURE "bitmaps\\k33w.bmp" -P37O BITMAP MOVEABLE PURE "bitmaps\\p37o.bmp" -N37O BITMAP MOVEABLE PURE "bitmaps\\n37o.bmp" -B37O BITMAP MOVEABLE PURE "bitmaps\\b37o.bmp" -R37O BITMAP MOVEABLE PURE "bitmaps\\r37o.bmp" -Q37O BITMAP MOVEABLE PURE "bitmaps\\q37o.bmp" -K37O BITMAP MOVEABLE PURE "bitmaps\\k37o.bmp" -P37S BITMAP MOVEABLE PURE "bitmaps\\p37s.bmp" -N37S BITMAP MOVEABLE PURE "bitmaps\\n37s.bmp" -B37S BITMAP MOVEABLE PURE "bitmaps\\b37s.bmp" -R37S BITMAP MOVEABLE PURE "bitmaps\\r37s.bmp" -Q37S BITMAP MOVEABLE PURE "bitmaps\\q37s.bmp" -K37S BITMAP MOVEABLE PURE "bitmaps\\k37s.bmp" -P37W BITMAP MOVEABLE PURE "bitmaps\\p37w.bmp" -N37W BITMAP MOVEABLE PURE "bitmaps\\n37w.bmp" -B37W BITMAP MOVEABLE PURE "bitmaps\\b37w.bmp" -R37W BITMAP MOVEABLE PURE "bitmaps\\r37w.bmp" -Q37W BITMAP MOVEABLE PURE "bitmaps\\q37w.bmp" -K37W BITMAP MOVEABLE PURE "bitmaps\\k37w.bmp" -P40O BITMAP MOVEABLE PURE "bitmaps\\p40o.bmp" -N40O BITMAP MOVEABLE PURE "bitmaps\\n40o.bmp" -B40O BITMAP MOVEABLE PURE "bitmaps\\b40o.bmp" -R40O BITMAP MOVEABLE PURE "bitmaps\\r40o.bmp" -Q40O BITMAP MOVEABLE PURE "bitmaps\\q40o.bmp" -K40O BITMAP MOVEABLE PURE "bitmaps\\k40o.bmp" -P40S BITMAP MOVEABLE PURE "bitmaps\\p40s.bmp" -N40S BITMAP MOVEABLE PURE "bitmaps\\n40s.bmp" -B40S BITMAP MOVEABLE PURE "bitmaps\\b40s.bmp" -R40S BITMAP MOVEABLE PURE "bitmaps\\r40s.bmp" -Q40S BITMAP MOVEABLE PURE "bitmaps\\q40s.bmp" -K40S BITMAP MOVEABLE PURE "bitmaps\\k40s.bmp" -P40W BITMAP MOVEABLE PURE "bitmaps\\p40w.bmp" -N40W BITMAP MOVEABLE PURE "bitmaps\\n40w.bmp" -B40W BITMAP MOVEABLE PURE "bitmaps\\b40w.bmp" -R40W BITMAP MOVEABLE PURE "bitmaps\\r40w.bmp" -Q40W BITMAP MOVEABLE PURE "bitmaps\\q40w.bmp" -K40W BITMAP MOVEABLE PURE "bitmaps\\k40w.bmp" -P45O BITMAP MOVEABLE PURE "bitmaps\\p45o.bmp" -N45O BITMAP MOVEABLE PURE "bitmaps\\n45o.bmp" -B45O BITMAP MOVEABLE PURE "bitmaps\\b45o.bmp" -R45O BITMAP MOVEABLE PURE "bitmaps\\r45o.bmp" -Q45O BITMAP MOVEABLE PURE "bitmaps\\q45o.bmp" -K45O BITMAP MOVEABLE PURE "bitmaps\\k45o.bmp" -P45S BITMAP MOVEABLE PURE "bitmaps\\p45s.bmp" -N45S BITMAP MOVEABLE PURE "bitmaps\\n45s.bmp" -B45S BITMAP MOVEABLE PURE "bitmaps\\b45s.bmp" -R45S BITMAP MOVEABLE PURE "bitmaps\\r45s.bmp" -Q45S BITMAP MOVEABLE PURE "bitmaps\\q45s.bmp" -K45S BITMAP MOVEABLE PURE "bitmaps\\k45s.bmp" -P45W BITMAP MOVEABLE PURE "bitmaps\\p45w.bmp" -N45W BITMAP MOVEABLE PURE "bitmaps\\n45w.bmp" -B45W BITMAP MOVEABLE PURE "bitmaps\\b45w.bmp" -R45W BITMAP MOVEABLE PURE "bitmaps\\r45w.bmp" -Q45W BITMAP MOVEABLE PURE "bitmaps\\q45w.bmp" -K45W BITMAP MOVEABLE PURE "bitmaps\\k45w.bmp" -P49O BITMAP MOVEABLE PURE "bitmaps\\p49o.bmp" -N49O BITMAP MOVEABLE PURE "bitmaps\\n49o.bmp" -B49O BITMAP MOVEABLE PURE "bitmaps\\b49o.bmp" -R49O BITMAP MOVEABLE PURE "bitmaps\\r49o.bmp" -Q49O BITMAP MOVEABLE PURE "bitmaps\\q49o.bmp" -K49O BITMAP MOVEABLE PURE "bitmaps\\k49o.bmp" -P49S BITMAP MOVEABLE PURE "bitmaps\\p49s.bmp" -N49S BITMAP MOVEABLE PURE "bitmaps\\n49s.bmp" -B49S BITMAP MOVEABLE PURE "bitmaps\\b49s.bmp" -R49S BITMAP MOVEABLE PURE "bitmaps\\r49s.bmp" -Q49S BITMAP MOVEABLE PURE "bitmaps\\q49s.bmp" -K49S BITMAP MOVEABLE PURE "bitmaps\\k49s.bmp" -P49W BITMAP MOVEABLE PURE "bitmaps\\p49w.bmp" -N49W BITMAP MOVEABLE PURE "bitmaps\\n49w.bmp" -B49W BITMAP MOVEABLE PURE "bitmaps\\b49w.bmp" -R49W BITMAP MOVEABLE PURE "bitmaps\\r49w.bmp" -Q49W BITMAP MOVEABLE PURE "bitmaps\\q49w.bmp" -K49W BITMAP MOVEABLE PURE "bitmaps\\k49w.bmp" -P54O BITMAP MOVEABLE PURE "bitmaps\\p54o.bmp" -N54O BITMAP MOVEABLE PURE "bitmaps\\n54o.bmp" -B54O BITMAP MOVEABLE PURE "bitmaps\\b54o.bmp" -R54O BITMAP MOVEABLE PURE "bitmaps\\r54o.bmp" -Q54O BITMAP MOVEABLE PURE "bitmaps\\q54o.bmp" -K54O BITMAP MOVEABLE PURE "bitmaps\\k54o.bmp" -P54S BITMAP MOVEABLE PURE "bitmaps\\p54s.bmp" -N54S BITMAP MOVEABLE PURE "bitmaps\\n54s.bmp" -B54S BITMAP MOVEABLE PURE "bitmaps\\b54s.bmp" -R54S BITMAP MOVEABLE PURE "bitmaps\\r54s.bmp" -Q54S BITMAP MOVEABLE PURE "bitmaps\\q54s.bmp" -K54S BITMAP MOVEABLE PURE "bitmaps\\k54s.bmp" -P54W BITMAP MOVEABLE PURE "bitmaps\\p54w.bmp" -N54W BITMAP MOVEABLE PURE "bitmaps\\n54w.bmp" -B54W BITMAP MOVEABLE PURE "bitmaps\\b54w.bmp" -R54W BITMAP MOVEABLE PURE "bitmaps\\r54w.bmp" -Q54W BITMAP MOVEABLE PURE "bitmaps\\q54w.bmp" -K54W BITMAP MOVEABLE PURE "bitmaps\\k54w.bmp" -P58O BITMAP MOVEABLE PURE "bitmaps\\p58o.bmp" -N58O BITMAP MOVEABLE PURE "bitmaps\\n58o.bmp" -B58O BITMAP MOVEABLE PURE "bitmaps\\b58o.bmp" -R58O BITMAP MOVEABLE PURE "bitmaps\\r58o.bmp" -Q58O BITMAP MOVEABLE PURE "bitmaps\\q58o.bmp" -K58O BITMAP MOVEABLE PURE "bitmaps\\k58o.bmp" -P58S BITMAP MOVEABLE PURE "bitmaps\\p58s.bmp" -N58S BITMAP MOVEABLE PURE "bitmaps\\n58s.bmp" -B58S BITMAP MOVEABLE PURE "bitmaps\\b58s.bmp" -R58S BITMAP MOVEABLE PURE "bitmaps\\r58s.bmp" -Q58S BITMAP MOVEABLE PURE "bitmaps\\q58s.bmp" -K58S BITMAP MOVEABLE PURE "bitmaps\\k58s.bmp" -P58W BITMAP MOVEABLE PURE "bitmaps\\p58w.bmp" -N58W BITMAP MOVEABLE PURE "bitmaps\\n58w.bmp" -B58W BITMAP MOVEABLE PURE "bitmaps\\b58w.bmp" -R58W BITMAP MOVEABLE PURE "bitmaps\\r58w.bmp" -Q58W BITMAP MOVEABLE PURE "bitmaps\\q58w.bmp" -K58W BITMAP MOVEABLE PURE "bitmaps\\k58w.bmp" -P64O BITMAP MOVEABLE PURE "bitmaps\\p64o.bmp" -N64O BITMAP MOVEABLE PURE "bitmaps\\n64o.bmp" -B64O BITMAP MOVEABLE PURE "bitmaps\\b64o.bmp" -R64O BITMAP MOVEABLE PURE "bitmaps\\r64o.bmp" -Q64O BITMAP MOVEABLE PURE "bitmaps\\q64o.bmp" -K64O BITMAP MOVEABLE PURE "bitmaps\\k64o.bmp" -P64S BITMAP MOVEABLE PURE "bitmaps\\p64s.bmp" -N64S BITMAP MOVEABLE PURE "bitmaps\\n64s.bmp" -B64S BITMAP MOVEABLE PURE "bitmaps\\b64s.bmp" -R64S BITMAP MOVEABLE PURE "bitmaps\\r64s.bmp" -Q64S BITMAP MOVEABLE PURE "bitmaps\\q64s.bmp" -K64S BITMAP MOVEABLE PURE "bitmaps\\k64s.bmp" -P64W BITMAP MOVEABLE PURE "bitmaps\\p64w.bmp" -N64W BITMAP MOVEABLE PURE "bitmaps\\n64w.bmp" -B64W BITMAP MOVEABLE PURE "bitmaps\\b64w.bmp" -R64W BITMAP MOVEABLE PURE "bitmaps\\r64w.bmp" -Q64W BITMAP MOVEABLE PURE "bitmaps\\q64w.bmp" -K64W BITMAP MOVEABLE PURE "bitmaps\\k64w.bmp" -P72O BITMAP MOVEABLE PURE "bitmaps\\p72o.bmp" -N72O BITMAP MOVEABLE PURE "bitmaps\\n72o.bmp" -B72O BITMAP MOVEABLE PURE "bitmaps\\b72o.bmp" -R72O BITMAP MOVEABLE PURE "bitmaps\\r72o.bmp" -Q72O BITMAP MOVEABLE PURE "bitmaps\\q72o.bmp" -K72O BITMAP MOVEABLE PURE "bitmaps\\k72o.bmp" -P72S BITMAP MOVEABLE PURE "bitmaps\\p72s.bmp" -N72S BITMAP MOVEABLE PURE "bitmaps\\n72s.bmp" -B72S BITMAP MOVEABLE PURE "bitmaps\\b72s.bmp" -R72S BITMAP MOVEABLE PURE "bitmaps\\r72s.bmp" -Q72S BITMAP MOVEABLE PURE "bitmaps\\q72s.bmp" -K72S BITMAP MOVEABLE PURE "bitmaps\\k72s.bmp" -P72W BITMAP MOVEABLE PURE "bitmaps\\p72w.bmp" -N72W BITMAP MOVEABLE PURE "bitmaps\\n72w.bmp" -B72W BITMAP MOVEABLE PURE "bitmaps\\b72w.bmp" -R72W BITMAP MOVEABLE PURE "bitmaps\\r72w.bmp" -Q72W BITMAP MOVEABLE PURE "bitmaps\\q72w.bmp" -K72W BITMAP MOVEABLE PURE "bitmaps\\k72w.bmp" -P80O BITMAP MOVEABLE PURE "bitmaps\\p80o.bmp" -N80O BITMAP MOVEABLE PURE "bitmaps\\n80o.bmp" -B80O BITMAP MOVEABLE PURE "bitmaps\\b80o.bmp" -R80O BITMAP MOVEABLE PURE "bitmaps\\r80o.bmp" -Q80O BITMAP MOVEABLE PURE "bitmaps\\q80o.bmp" -K80O BITMAP MOVEABLE PURE "bitmaps\\k80o.bmp" -P80S BITMAP MOVEABLE PURE "bitmaps\\p80s.bmp" -N80S BITMAP MOVEABLE PURE "bitmaps\\n80s.bmp" -B80S BITMAP MOVEABLE PURE "bitmaps\\b80s.bmp" -R80S BITMAP MOVEABLE PURE "bitmaps\\r80s.bmp" -Q80S BITMAP MOVEABLE PURE "bitmaps\\q80s.bmp" -K80S BITMAP MOVEABLE PURE "bitmaps\\k80s.bmp" -P80W BITMAP MOVEABLE PURE "bitmaps\\p80w.bmp" -N80W BITMAP MOVEABLE PURE "bitmaps\\n80w.bmp" -B80W BITMAP MOVEABLE PURE "bitmaps\\b80w.bmp" -R80W BITMAP MOVEABLE PURE "bitmaps\\r80w.bmp" -Q80W BITMAP MOVEABLE PURE "bitmaps\\q80w.bmp" -K80W BITMAP MOVEABLE PURE "bitmaps\\k80w.bmp" -P87O BITMAP MOVEABLE PURE "bitmaps\\p87o.bmp" -N87O BITMAP MOVEABLE PURE "bitmaps\\n87o.bmp" -B87O BITMAP MOVEABLE PURE "bitmaps\\b87o.bmp" -R87O BITMAP MOVEABLE PURE "bitmaps\\r87o.bmp" -Q87O BITMAP MOVEABLE PURE "bitmaps\\q87o.bmp" -K87O BITMAP MOVEABLE PURE "bitmaps\\k87o.bmp" -P87S BITMAP MOVEABLE PURE "bitmaps\\p87s.bmp" -N87S BITMAP MOVEABLE PURE "bitmaps\\n87s.bmp" -B87S BITMAP MOVEABLE PURE "bitmaps\\b87s.bmp" -R87S BITMAP MOVEABLE PURE "bitmaps\\r87s.bmp" -Q87S BITMAP MOVEABLE PURE "bitmaps\\q87s.bmp" -K87S BITMAP MOVEABLE PURE "bitmaps\\k87s.bmp" -P87W BITMAP MOVEABLE PURE "bitmaps\\p87w.bmp" -N87W BITMAP MOVEABLE PURE "bitmaps\\n87w.bmp" -B87W BITMAP MOVEABLE PURE "bitmaps\\b87w.bmp" -R87W BITMAP MOVEABLE PURE "bitmaps\\r87w.bmp" -Q87W BITMAP MOVEABLE PURE "bitmaps\\q87w.bmp" -K87W BITMAP MOVEABLE PURE "bitmaps\\k87w.bmp" -P95O BITMAP MOVEABLE PURE "bitmaps\\p95o.bmp" -N95O BITMAP MOVEABLE PURE "bitmaps\\n95o.bmp" -B95O BITMAP MOVEABLE PURE "bitmaps\\b95o.bmp" -R95O BITMAP MOVEABLE PURE "bitmaps\\r95o.bmp" -Q95O BITMAP MOVEABLE PURE "bitmaps\\q95o.bmp" -K95O BITMAP MOVEABLE PURE "bitmaps\\k95o.bmp" -P95S BITMAP MOVEABLE PURE "bitmaps\\p95s.bmp" -N95S BITMAP MOVEABLE PURE "bitmaps\\n95s.bmp" -B95S BITMAP MOVEABLE PURE "bitmaps\\b95s.bmp" -R95S BITMAP MOVEABLE PURE "bitmaps\\r95s.bmp" -Q95S BITMAP MOVEABLE PURE "bitmaps\\q95s.bmp" -K95S BITMAP MOVEABLE PURE "bitmaps\\k95s.bmp" -P95W BITMAP MOVEABLE PURE "bitmaps\\p95w.bmp" -N95W BITMAP MOVEABLE PURE "bitmaps\\n95w.bmp" -B95W BITMAP MOVEABLE PURE "bitmaps\\b95w.bmp" -R95W BITMAP MOVEABLE PURE "bitmaps\\r95w.bmp" -Q95W BITMAP MOVEABLE PURE "bitmaps\\q95w.bmp" -K95W BITMAP MOVEABLE PURE "bitmaps\\k95w.bmp" -P108O BITMAP MOVEABLE PURE "bitmaps\\p108o.bmp" -N108O BITMAP MOVEABLE PURE "bitmaps\\n108o.bmp" -B108O BITMAP MOVEABLE PURE "bitmaps\\b108o.bmp" -R108O BITMAP MOVEABLE PURE "bitmaps\\r108o.bmp" -Q108O BITMAP MOVEABLE PURE "bitmaps\\q108o.bmp" -K108O BITMAP MOVEABLE PURE "bitmaps\\k108o.bmp" -P108S BITMAP MOVEABLE PURE "bitmaps\\p108s.bmp" -N108S BITMAP MOVEABLE PURE "bitmaps\\n108s.bmp" -B108S BITMAP MOVEABLE PURE "bitmaps\\b108s.bmp" -R108S BITMAP MOVEABLE PURE "bitmaps\\r108s.bmp" -Q108S BITMAP MOVEABLE PURE "bitmaps\\q108s.bmp" -K108S BITMAP MOVEABLE PURE "bitmaps\\k108s.bmp" -P108W BITMAP MOVEABLE PURE "bitmaps\\p108w.bmp" -N108W BITMAP MOVEABLE PURE "bitmaps\\n108w.bmp" -B108W BITMAP MOVEABLE PURE "bitmaps\\b108w.bmp" -R108W BITMAP MOVEABLE PURE "bitmaps\\r108w.bmp" -Q108W BITMAP MOVEABLE PURE "bitmaps\\q108w.bmp" -K108W BITMAP MOVEABLE PURE "bitmaps\\k108w.bmp" -P116O BITMAP MOVEABLE PURE "bitmaps\\p116o.bmp" -N116O BITMAP MOVEABLE PURE "bitmaps\\n116o.bmp" -B116O BITMAP MOVEABLE PURE "bitmaps\\b116o.bmp" -R116O BITMAP MOVEABLE PURE "bitmaps\\r116o.bmp" -Q116O BITMAP MOVEABLE PURE "bitmaps\\q116o.bmp" -K116O BITMAP MOVEABLE PURE "bitmaps\\k116o.bmp" -P116S BITMAP MOVEABLE PURE "bitmaps\\p116s.bmp" -N116S BITMAP MOVEABLE PURE "bitmaps\\n116s.bmp" -B116S BITMAP MOVEABLE PURE "bitmaps\\b116s.bmp" -R116S BITMAP MOVEABLE PURE "bitmaps\\r116s.bmp" -Q116S BITMAP MOVEABLE PURE "bitmaps\\q116s.bmp" -K116S BITMAP MOVEABLE PURE "bitmaps\\k116s.bmp" -P116W BITMAP MOVEABLE PURE "bitmaps\\p116w.bmp" -N116W BITMAP MOVEABLE PURE "bitmaps\\n116w.bmp" -B116W BITMAP MOVEABLE PURE "bitmaps\\b116w.bmp" -R116W BITMAP MOVEABLE PURE "bitmaps\\r116w.bmp" -Q116W BITMAP MOVEABLE PURE "bitmaps\\q116w.bmp" -K116W BITMAP MOVEABLE PURE "bitmaps\\k116w.bmp" -P129O BITMAP MOVEABLE PURE "bitmaps\\p129o.bmp" -N129O BITMAP MOVEABLE PURE "bitmaps\\n129o.bmp" -B129O BITMAP MOVEABLE PURE "bitmaps\\b129o.bmp" -R129O BITMAP MOVEABLE PURE "bitmaps\\r129o.bmp" -Q129O BITMAP MOVEABLE PURE "bitmaps\\q129o.bmp" -K129O BITMAP MOVEABLE PURE "bitmaps\\k129o.bmp" -P129S BITMAP MOVEABLE PURE "bitmaps\\p129s.bmp" -N129S BITMAP MOVEABLE PURE "bitmaps\\n129s.bmp" -B129S BITMAP MOVEABLE PURE "bitmaps\\b129s.bmp" -R129S BITMAP MOVEABLE PURE "bitmaps\\r129s.bmp" -Q129S BITMAP MOVEABLE PURE "bitmaps\\q129s.bmp" -K129S BITMAP MOVEABLE PURE "bitmaps\\k129s.bmp" -P129W BITMAP MOVEABLE PURE "bitmaps\\p129w.bmp" -N129W BITMAP MOVEABLE PURE "bitmaps\\n129w.bmp" -B129W BITMAP MOVEABLE PURE "bitmaps\\b129w.bmp" -R129W BITMAP MOVEABLE PURE "bitmaps\\r129w.bmp" -Q129W BITMAP MOVEABLE PURE "bitmaps\\q129w.bmp" -K129W BITMAP MOVEABLE PURE "bitmaps\\k129w.bmp" -GALACTIC BITMAP MOVEABLE PURE "bitmaps\\galactic.bmp" -TIM BITMAP MOVEABLE PURE "bitmaps\\tim.bmp" +P21O BITMAP MOVEABLE PURE "bitmaps/p21o.bmp" +N21O BITMAP MOVEABLE PURE "bitmaps/n21o.bmp" +B21O BITMAP MOVEABLE PURE "bitmaps/b21o.bmp" +R21O BITMAP MOVEABLE PURE "bitmaps/r21o.bmp" +K21O BITMAP MOVEABLE PURE "bitmaps/k21o.bmp" +Q21O BITMAP MOVEABLE PURE "bitmaps/q21o.bmp" +P21S BITMAP MOVEABLE PURE "bitmaps/p21s.bmp" +N21S BITMAP MOVEABLE PURE "bitmaps/n21s.bmp" +B21S BITMAP MOVEABLE PURE "bitmaps/b21s.bmp" +R21S BITMAP MOVEABLE PURE "bitmaps/r21s.bmp" +Q21S BITMAP MOVEABLE PURE "bitmaps/q21s.bmp" +K21S BITMAP MOVEABLE PURE "bitmaps/k21s.bmp" +P21W BITMAP MOVEABLE PURE "bitmaps/p21w.bmp" +N21W BITMAP MOVEABLE PURE "bitmaps/n21w.bmp" +B21W BITMAP MOVEABLE PURE "bitmaps/b21w.bmp" +R21W BITMAP MOVEABLE PURE "bitmaps/r21w.bmp" +Q21W BITMAP MOVEABLE PURE "bitmaps/q21w.bmp" +K21W BITMAP MOVEABLE PURE "bitmaps/k21w.bmp" +P25O BITMAP MOVEABLE PURE "bitmaps/p25o.bmp" +N25O BITMAP MOVEABLE PURE "bitmaps/n25o.bmp" +B25O BITMAP MOVEABLE PURE "bitmaps/b25o.bmp" +R25O BITMAP MOVEABLE PURE "bitmaps/r25o.bmp" +Q25O BITMAP MOVEABLE PURE "bitmaps/q25o.bmp" +K25O BITMAP MOVEABLE PURE "bitmaps/k25o.bmp" +P25S BITMAP MOVEABLE PURE "bitmaps/p25s.bmp" +N25S BITMAP MOVEABLE PURE "bitmaps/n25s.bmp" +B25S BITMAP MOVEABLE PURE "bitmaps/b25s.bmp" +R25S BITMAP MOVEABLE PURE "bitmaps/r25s.bmp" +Q25S BITMAP MOVEABLE PURE "bitmaps/q25s.bmp" +K25S BITMAP MOVEABLE PURE "bitmaps/k25s.bmp" +P25W BITMAP MOVEABLE PURE "bitmaps/p25w.bmp" +N25W BITMAP MOVEABLE PURE "bitmaps/n25w.bmp" +B25W BITMAP MOVEABLE PURE "bitmaps/b25w.bmp" +R25W BITMAP MOVEABLE PURE "bitmaps/r25w.bmp" +Q25W BITMAP MOVEABLE PURE "bitmaps/q25w.bmp" +K25W BITMAP MOVEABLE PURE "bitmaps/k25w.bmp" +P29O BITMAP MOVEABLE PURE "bitmaps/p29o.bmp" +N29O BITMAP MOVEABLE PURE "bitmaps/n29o.bmp" +B29O BITMAP MOVEABLE PURE "bitmaps/b29o.bmp" +R29O BITMAP MOVEABLE PURE "bitmaps/r29o.bmp" +Q29O BITMAP MOVEABLE PURE "bitmaps/q29o.bmp" +K29O BITMAP MOVEABLE PURE "bitmaps/k29o.bmp" +P29S BITMAP MOVEABLE PURE "bitmaps/p29s.bmp" +N29S BITMAP MOVEABLE PURE "bitmaps/n29s.bmp" +B29S BITMAP MOVEABLE PURE "bitmaps/b29s.bmp" +R29S BITMAP MOVEABLE PURE "bitmaps/r29s.bmp" +Q29S BITMAP MOVEABLE PURE "bitmaps/q29s.bmp" +K29S BITMAP MOVEABLE PURE "bitmaps/k29s.bmp" +P29W BITMAP MOVEABLE PURE "bitmaps/p29w.bmp" +N29W BITMAP MOVEABLE PURE "bitmaps/n29w.bmp" +B29W BITMAP MOVEABLE PURE "bitmaps/b29w.bmp" +R29W BITMAP MOVEABLE PURE "bitmaps/r29w.bmp" +Q29W BITMAP MOVEABLE PURE "bitmaps/q29w.bmp" +K29W BITMAP MOVEABLE PURE "bitmaps/k29w.bmp" +P33O BITMAP MOVEABLE PURE "bitmaps/p33o.bmp" +N33O BITMAP MOVEABLE PURE "bitmaps/n33o.bmp" +B33O BITMAP MOVEABLE PURE "bitmaps/b33o.bmp" +R33O BITMAP MOVEABLE PURE "bitmaps/r33o.bmp" +Q33O BITMAP MOVEABLE PURE "bitmaps/q33o.bmp" +K33O BITMAP MOVEABLE PURE "bitmaps/k33o.bmp" +P33S BITMAP MOVEABLE PURE "bitmaps/p33s.bmp" +N33S BITMAP MOVEABLE PURE "bitmaps/n33s.bmp" +B33S BITMAP MOVEABLE PURE "bitmaps/b33s.bmp" +R33S BITMAP MOVEABLE PURE "bitmaps/r33s.bmp" +Q33S BITMAP MOVEABLE PURE "bitmaps/q33s.bmp" +K33S BITMAP MOVEABLE PURE "bitmaps/k33s.bmp" +P33W BITMAP MOVEABLE PURE "bitmaps/p33w.bmp" +N33W BITMAP MOVEABLE PURE "bitmaps/n33w.bmp" +B33W BITMAP MOVEABLE PURE "bitmaps/b33w.bmp" +R33W BITMAP MOVEABLE PURE "bitmaps/r33w.bmp" +Q33W BITMAP MOVEABLE PURE "bitmaps/q33w.bmp" +K33W BITMAP MOVEABLE PURE "bitmaps/k33w.bmp" +P37O BITMAP MOVEABLE PURE "bitmaps/p37o.bmp" +N37O BITMAP MOVEABLE PURE "bitmaps/n37o.bmp" +B37O BITMAP MOVEABLE PURE "bitmaps/b37o.bmp" +R37O BITMAP MOVEABLE PURE "bitmaps/r37o.bmp" +Q37O BITMAP MOVEABLE PURE "bitmaps/q37o.bmp" +K37O BITMAP MOVEABLE PURE "bitmaps/k37o.bmp" +P37S BITMAP MOVEABLE PURE "bitmaps/p37s.bmp" +N37S BITMAP MOVEABLE PURE "bitmaps/n37s.bmp" +B37S BITMAP MOVEABLE PURE "bitmaps/b37s.bmp" +R37S BITMAP MOVEABLE PURE "bitmaps/r37s.bmp" +Q37S BITMAP MOVEABLE PURE "bitmaps/q37s.bmp" +K37S BITMAP MOVEABLE PURE "bitmaps/k37s.bmp" +P37W BITMAP MOVEABLE PURE "bitmaps/p37w.bmp" +N37W BITMAP MOVEABLE PURE "bitmaps/n37w.bmp" +B37W BITMAP MOVEABLE PURE "bitmaps/b37w.bmp" +R37W BITMAP MOVEABLE PURE "bitmaps/r37w.bmp" +Q37W BITMAP MOVEABLE PURE "bitmaps/q37w.bmp" +K37W BITMAP MOVEABLE PURE "bitmaps/k37w.bmp" +P40O BITMAP MOVEABLE PURE "bitmaps/p40o.bmp" +N40O BITMAP MOVEABLE PURE "bitmaps/n40o.bmp" +B40O BITMAP MOVEABLE PURE "bitmaps/b40o.bmp" +R40O BITMAP MOVEABLE PURE "bitmaps/r40o.bmp" +Q40O BITMAP MOVEABLE PURE "bitmaps/q40o.bmp" +K40O BITMAP MOVEABLE PURE "bitmaps/k40o.bmp" +P40S BITMAP MOVEABLE PURE "bitmaps/p40s.bmp" +N40S BITMAP MOVEABLE PURE "bitmaps/n40s.bmp" +B40S BITMAP MOVEABLE PURE "bitmaps/b40s.bmp" +R40S BITMAP MOVEABLE PURE "bitmaps/r40s.bmp" +Q40S BITMAP MOVEABLE PURE "bitmaps/q40s.bmp" +K40S BITMAP MOVEABLE PURE "bitmaps/k40s.bmp" +P40W BITMAP MOVEABLE PURE "bitmaps/p40w.bmp" +N40W BITMAP MOVEABLE PURE "bitmaps/n40w.bmp" +B40W BITMAP MOVEABLE PURE "bitmaps/b40w.bmp" +R40W BITMAP MOVEABLE PURE "bitmaps/r40w.bmp" +Q40W BITMAP MOVEABLE PURE "bitmaps/q40w.bmp" +K40W BITMAP MOVEABLE PURE "bitmaps/k40w.bmp" +P45O BITMAP MOVEABLE PURE "bitmaps/p45o.bmp" +N45O BITMAP MOVEABLE PURE "bitmaps/n45o.bmp" +B45O BITMAP MOVEABLE PURE "bitmaps/b45o.bmp" +R45O BITMAP MOVEABLE PURE "bitmaps/r45o.bmp" +Q45O BITMAP MOVEABLE PURE "bitmaps/q45o.bmp" +K45O BITMAP MOVEABLE PURE "bitmaps/k45o.bmp" +P45S BITMAP MOVEABLE PURE "bitmaps/p45s.bmp" +N45S BITMAP MOVEABLE PURE "bitmaps/n45s.bmp" +B45S BITMAP MOVEABLE PURE "bitmaps/b45s.bmp" +R45S BITMAP MOVEABLE PURE "bitmaps/r45s.bmp" +Q45S BITMAP MOVEABLE PURE "bitmaps/q45s.bmp" +K45S BITMAP MOVEABLE PURE "bitmaps/k45s.bmp" +P45W BITMAP MOVEABLE PURE "bitmaps/p45w.bmp" +N45W BITMAP MOVEABLE PURE "bitmaps/n45w.bmp" +B45W BITMAP MOVEABLE PURE "bitmaps/b45w.bmp" +R45W BITMAP MOVEABLE PURE "bitmaps/r45w.bmp" +Q45W BITMAP MOVEABLE PURE "bitmaps/q45w.bmp" +K45W BITMAP MOVEABLE PURE "bitmaps/k45w.bmp" +P49O BITMAP MOVEABLE PURE "bitmaps/p49o.bmp" +N49O BITMAP MOVEABLE PURE "bitmaps/n49o.bmp" +B49O BITMAP MOVEABLE PURE "bitmaps/b49o.bmp" +R49O BITMAP MOVEABLE PURE "bitmaps/r49o.bmp" +Q49O BITMAP MOVEABLE PURE "bitmaps/q49o.bmp" +K49O BITMAP MOVEABLE PURE "bitmaps/k49o.bmp" +P49S BITMAP MOVEABLE PURE "bitmaps/p49s.bmp" +N49S BITMAP MOVEABLE PURE "bitmaps/n49s.bmp" +B49S BITMAP MOVEABLE PURE "bitmaps/b49s.bmp" +R49S BITMAP MOVEABLE PURE "bitmaps/r49s.bmp" +Q49S BITMAP MOVEABLE PURE "bitmaps/q49s.bmp" +K49S BITMAP MOVEABLE PURE "bitmaps/k49s.bmp" +P49W BITMAP MOVEABLE PURE "bitmaps/p49w.bmp" +N49W BITMAP MOVEABLE PURE "bitmaps/n49w.bmp" +B49W BITMAP MOVEABLE PURE "bitmaps/b49w.bmp" +R49W BITMAP MOVEABLE PURE "bitmaps/r49w.bmp" +Q49W BITMAP MOVEABLE PURE "bitmaps/q49w.bmp" +K49W BITMAP MOVEABLE PURE "bitmaps/k49w.bmp" +P54O BITMAP MOVEABLE PURE "bitmaps/p54o.bmp" +N54O BITMAP MOVEABLE PURE "bitmaps/n54o.bmp" +B54O BITMAP MOVEABLE PURE "bitmaps/b54o.bmp" +R54O BITMAP MOVEABLE PURE "bitmaps/r54o.bmp" +Q54O BITMAP MOVEABLE PURE "bitmaps/q54o.bmp" +K54O BITMAP MOVEABLE PURE "bitmaps/k54o.bmp" +P54S BITMAP MOVEABLE PURE "bitmaps/p54s.bmp" +N54S BITMAP MOVEABLE PURE "bitmaps/n54s.bmp" +B54S BITMAP MOVEABLE PURE "bitmaps/b54s.bmp" +R54S BITMAP MOVEABLE PURE "bitmaps/r54s.bmp" +Q54S BITMAP MOVEABLE PURE "bitmaps/q54s.bmp" +K54S BITMAP MOVEABLE PURE "bitmaps/k54s.bmp" +P54W BITMAP MOVEABLE PURE "bitmaps/p54w.bmp" +N54W BITMAP MOVEABLE PURE "bitmaps/n54w.bmp" +B54W BITMAP MOVEABLE PURE "bitmaps/b54w.bmp" +R54W BITMAP MOVEABLE PURE "bitmaps/r54w.bmp" +Q54W BITMAP MOVEABLE PURE "bitmaps/q54w.bmp" +K54W BITMAP MOVEABLE PURE "bitmaps/k54w.bmp" +P58O BITMAP MOVEABLE PURE "bitmaps/p58o.bmp" +N58O BITMAP MOVEABLE PURE "bitmaps/n58o.bmp" +B58O BITMAP MOVEABLE PURE "bitmaps/b58o.bmp" +R58O BITMAP MOVEABLE PURE "bitmaps/r58o.bmp" +Q58O BITMAP MOVEABLE PURE "bitmaps/q58o.bmp" +K58O BITMAP MOVEABLE PURE "bitmaps/k58o.bmp" +P58S BITMAP MOVEABLE PURE "bitmaps/p58s.bmp" +N58S BITMAP MOVEABLE PURE "bitmaps/n58s.bmp" +B58S BITMAP MOVEABLE PURE "bitmaps/b58s.bmp" +R58S BITMAP MOVEABLE PURE "bitmaps/r58s.bmp" +Q58S BITMAP MOVEABLE PURE "bitmaps/q58s.bmp" +K58S BITMAP MOVEABLE PURE "bitmaps/k58s.bmp" +P58W BITMAP MOVEABLE PURE "bitmaps/p58w.bmp" +N58W BITMAP MOVEABLE PURE "bitmaps/n58w.bmp" +B58W BITMAP MOVEABLE PURE "bitmaps/b58w.bmp" +R58W BITMAP MOVEABLE PURE "bitmaps/r58w.bmp" +Q58W BITMAP MOVEABLE PURE "bitmaps/q58w.bmp" +K58W BITMAP MOVEABLE PURE "bitmaps/k58w.bmp" +P64O BITMAP MOVEABLE PURE "bitmaps/p64o.bmp" +N64O BITMAP MOVEABLE PURE "bitmaps/n64o.bmp" +B64O BITMAP MOVEABLE PURE "bitmaps/b64o.bmp" +R64O BITMAP MOVEABLE PURE "bitmaps/r64o.bmp" +Q64O BITMAP MOVEABLE PURE "bitmaps/q64o.bmp" +K64O BITMAP MOVEABLE PURE "bitmaps/k64o.bmp" +P64S BITMAP MOVEABLE PURE "bitmaps/p64s.bmp" +N64S BITMAP MOVEABLE PURE "bitmaps/n64s.bmp" +B64S BITMAP MOVEABLE PURE "bitmaps/b64s.bmp" +R64S BITMAP MOVEABLE PURE "bitmaps/r64s.bmp" +Q64S BITMAP MOVEABLE PURE "bitmaps/q64s.bmp" +K64S BITMAP MOVEABLE PURE "bitmaps/k64s.bmp" +P64W BITMAP MOVEABLE PURE "bitmaps/p64w.bmp" +N64W BITMAP MOVEABLE PURE "bitmaps/n64w.bmp" +B64W BITMAP MOVEABLE PURE "bitmaps/b64w.bmp" +R64W BITMAP MOVEABLE PURE "bitmaps/r64w.bmp" +Q64W BITMAP MOVEABLE PURE "bitmaps/q64w.bmp" +K64W BITMAP MOVEABLE PURE "bitmaps/k64w.bmp" +P72O BITMAP MOVEABLE PURE "bitmaps/p72o.bmp" +N72O BITMAP MOVEABLE PURE "bitmaps/n72o.bmp" +B72O BITMAP MOVEABLE PURE "bitmaps/b72o.bmp" +R72O BITMAP MOVEABLE PURE "bitmaps/r72o.bmp" +Q72O BITMAP MOVEABLE PURE "bitmaps/q72o.bmp" +K72O BITMAP MOVEABLE PURE "bitmaps/k72o.bmp" +P72S BITMAP MOVEABLE PURE "bitmaps/p72s.bmp" +N72S BITMAP MOVEABLE PURE "bitmaps/n72s.bmp" +B72S BITMAP MOVEABLE PURE "bitmaps/b72s.bmp" +R72S BITMAP MOVEABLE PURE "bitmaps/r72s.bmp" +Q72S BITMAP MOVEABLE PURE "bitmaps/q72s.bmp" +K72S BITMAP MOVEABLE PURE "bitmaps/k72s.bmp" +P72W BITMAP MOVEABLE PURE "bitmaps/p72w.bmp" +N72W BITMAP MOVEABLE PURE "bitmaps/n72w.bmp" +B72W BITMAP MOVEABLE PURE "bitmaps/b72w.bmp" +R72W BITMAP MOVEABLE PURE "bitmaps/r72w.bmp" +Q72W BITMAP MOVEABLE PURE "bitmaps/q72w.bmp" +K72W BITMAP MOVEABLE PURE "bitmaps/k72w.bmp" +P80O BITMAP MOVEABLE PURE "bitmaps/p80o.bmp" +N80O BITMAP MOVEABLE PURE "bitmaps/n80o.bmp" +B80O BITMAP MOVEABLE PURE "bitmaps/b80o.bmp" +R80O BITMAP MOVEABLE PURE "bitmaps/r80o.bmp" +Q80O BITMAP MOVEABLE PURE "bitmaps/q80o.bmp" +K80O BITMAP MOVEABLE PURE "bitmaps/k80o.bmp" +P80S BITMAP MOVEABLE PURE "bitmaps/p80s.bmp" +N80S BITMAP MOVEABLE PURE "bitmaps/n80s.bmp" +B80S BITMAP MOVEABLE PURE "bitmaps/b80s.bmp" +R80S BITMAP MOVEABLE PURE "bitmaps/r80s.bmp" +Q80S BITMAP MOVEABLE PURE "bitmaps/q80s.bmp" +K80S BITMAP MOVEABLE PURE "bitmaps/k80s.bmp" +P80W BITMAP MOVEABLE PURE "bitmaps/p80w.bmp" +N80W BITMAP MOVEABLE PURE "bitmaps/n80w.bmp" +B80W BITMAP MOVEABLE PURE "bitmaps/b80w.bmp" +R80W BITMAP MOVEABLE PURE "bitmaps/r80w.bmp" +Q80W BITMAP MOVEABLE PURE "bitmaps/q80w.bmp" +K80W BITMAP MOVEABLE PURE "bitmaps/k80w.bmp" +P87O BITMAP MOVEABLE PURE "bitmaps/p87o.bmp" +N87O BITMAP MOVEABLE PURE "bitmaps/n87o.bmp" +B87O BITMAP MOVEABLE PURE "bitmaps/b87o.bmp" +R87O BITMAP MOVEABLE PURE "bitmaps/r87o.bmp" +Q87O BITMAP MOVEABLE PURE "bitmaps/q87o.bmp" +K87O BITMAP MOVEABLE PURE "bitmaps/k87o.bmp" +P87S BITMAP MOVEABLE PURE "bitmaps/p87s.bmp" +N87S BITMAP MOVEABLE PURE "bitmaps/n87s.bmp" +B87S BITMAP MOVEABLE PURE "bitmaps/b87s.bmp" +R87S BITMAP MOVEABLE PURE "bitmaps/r87s.bmp" +Q87S BITMAP MOVEABLE PURE "bitmaps/q87s.bmp" +K87S BITMAP MOVEABLE PURE "bitmaps/k87s.bmp" +P87W BITMAP MOVEABLE PURE "bitmaps/p87w.bmp" +N87W BITMAP MOVEABLE PURE "bitmaps/n87w.bmp" +B87W BITMAP MOVEABLE PURE "bitmaps/b87w.bmp" +R87W BITMAP MOVEABLE PURE "bitmaps/r87w.bmp" +Q87W BITMAP MOVEABLE PURE "bitmaps/q87w.bmp" +K87W BITMAP MOVEABLE PURE "bitmaps/k87w.bmp" +P95O BITMAP MOVEABLE PURE "bitmaps/p95o.bmp" +N95O BITMAP MOVEABLE PURE "bitmaps/n95o.bmp" +B95O BITMAP MOVEABLE PURE "bitmaps/b95o.bmp" +R95O BITMAP MOVEABLE PURE "bitmaps/r95o.bmp" +Q95O BITMAP MOVEABLE PURE "bitmaps/q95o.bmp" +K95O BITMAP MOVEABLE PURE "bitmaps/k95o.bmp" +P95S BITMAP MOVEABLE PURE "bitmaps/p95s.bmp" +N95S BITMAP MOVEABLE PURE "bitmaps/n95s.bmp" +B95S BITMAP MOVEABLE PURE "bitmaps/b95s.bmp" +R95S BITMAP MOVEABLE PURE "bitmaps/r95s.bmp" +Q95S BITMAP MOVEABLE PURE "bitmaps/q95s.bmp" +K95S BITMAP MOVEABLE PURE "bitmaps/k95s.bmp" +P95W BITMAP MOVEABLE PURE "bitmaps/p95w.bmp" +N95W BITMAP MOVEABLE PURE "bitmaps/n95w.bmp" +B95W BITMAP MOVEABLE PURE "bitmaps/b95w.bmp" +R95W BITMAP MOVEABLE PURE "bitmaps/r95w.bmp" +Q95W BITMAP MOVEABLE PURE "bitmaps/q95w.bmp" +K95W BITMAP MOVEABLE PURE "bitmaps/k95w.bmp" +P108O BITMAP MOVEABLE PURE "bitmaps/p108o.bmp" +N108O BITMAP MOVEABLE PURE "bitmaps/n108o.bmp" +B108O BITMAP MOVEABLE PURE "bitmaps/b108o.bmp" +R108O BITMAP MOVEABLE PURE "bitmaps/r108o.bmp" +Q108O BITMAP MOVEABLE PURE "bitmaps/q108o.bmp" +K108O BITMAP MOVEABLE PURE "bitmaps/k108o.bmp" +P108S BITMAP MOVEABLE PURE "bitmaps/p108s.bmp" +N108S BITMAP MOVEABLE PURE "bitmaps/n108s.bmp" +B108S BITMAP MOVEABLE PURE "bitmaps/b108s.bmp" +R108S BITMAP MOVEABLE PURE "bitmaps/r108s.bmp" +Q108S BITMAP MOVEABLE PURE "bitmaps/q108s.bmp" +K108S BITMAP MOVEABLE PURE "bitmaps/k108s.bmp" +P108W BITMAP MOVEABLE PURE "bitmaps/p108w.bmp" +N108W BITMAP MOVEABLE PURE "bitmaps/n108w.bmp" +B108W BITMAP MOVEABLE PURE "bitmaps/b108w.bmp" +R108W BITMAP MOVEABLE PURE "bitmaps/r108w.bmp" +Q108W BITMAP MOVEABLE PURE "bitmaps/q108w.bmp" +K108W BITMAP MOVEABLE PURE "bitmaps/k108w.bmp" +P116O BITMAP MOVEABLE PURE "bitmaps/p116o.bmp" +N116O BITMAP MOVEABLE PURE "bitmaps/n116o.bmp" +B116O BITMAP MOVEABLE PURE "bitmaps/b116o.bmp" +R116O BITMAP MOVEABLE PURE "bitmaps/r116o.bmp" +Q116O BITMAP MOVEABLE PURE "bitmaps/q116o.bmp" +K116O BITMAP MOVEABLE PURE "bitmaps/k116o.bmp" +P116S BITMAP MOVEABLE PURE "bitmaps/p116s.bmp" +N116S BITMAP MOVEABLE PURE "bitmaps/n116s.bmp" +B116S BITMAP MOVEABLE PURE "bitmaps/b116s.bmp" +R116S BITMAP MOVEABLE PURE "bitmaps/r116s.bmp" +Q116S BITMAP MOVEABLE PURE "bitmaps/q116s.bmp" +K116S BITMAP MOVEABLE PURE "bitmaps/k116s.bmp" +P116W BITMAP MOVEABLE PURE "bitmaps/p116w.bmp" +N116W BITMAP MOVEABLE PURE "bitmaps/n116w.bmp" +B116W BITMAP MOVEABLE PURE "bitmaps/b116w.bmp" +R116W BITMAP MOVEABLE PURE "bitmaps/r116w.bmp" +Q116W BITMAP MOVEABLE PURE "bitmaps/q116w.bmp" +K116W BITMAP MOVEABLE PURE "bitmaps/k116w.bmp" +P129O BITMAP MOVEABLE PURE "bitmaps/p129o.bmp" +N129O BITMAP MOVEABLE PURE "bitmaps/n129o.bmp" +B129O BITMAP MOVEABLE PURE "bitmaps/b129o.bmp" +R129O BITMAP MOVEABLE PURE "bitmaps/r129o.bmp" +Q129O BITMAP MOVEABLE PURE "bitmaps/q129o.bmp" +K129O BITMAP MOVEABLE PURE "bitmaps/k129o.bmp" +P129S BITMAP MOVEABLE PURE "bitmaps/p129s.bmp" +N129S BITMAP MOVEABLE PURE "bitmaps/n129s.bmp" +B129S BITMAP MOVEABLE PURE "bitmaps/b129s.bmp" +R129S BITMAP MOVEABLE PURE "bitmaps/r129s.bmp" +Q129S BITMAP MOVEABLE PURE "bitmaps/q129s.bmp" +K129S BITMAP MOVEABLE PURE "bitmaps/k129s.bmp" +P129W BITMAP MOVEABLE PURE "bitmaps/p129w.bmp" +N129W BITMAP MOVEABLE PURE "bitmaps/n129w.bmp" +B129W BITMAP MOVEABLE PURE "bitmaps/b129w.bmp" +R129W BITMAP MOVEABLE PURE "bitmaps/r129w.bmp" +Q129W BITMAP MOVEABLE PURE "bitmaps/q129w.bmp" +K129W BITMAP MOVEABLE PURE "bitmaps/k129w.bmp" +GALACTIC BITMAP MOVEABLE PURE "bitmaps/galactic.bmp" +TIM BITMAP MOVEABLE PURE "bitmaps/tim.bmp" + // [HGM] Some fairy symbols: -E72O BITMAP MOVEABLE PURE "bitmaps\\e72o.bmp" -A72O BITMAP MOVEABLE PURE "bitmaps\\a72o.bmp" -AA72O BITMAP MOVEABLE PURE "bitmaps\\as72o.bmp" -C72O BITMAP MOVEABLE PURE "bitmaps\\c72o.bmp" -CV72O BITMAP MOVEABLE PURE "bitmaps\\cv72o.bmp" -F72O BITMAP MOVEABLE PURE "bitmaps\\f72o.bmp" -M72O BITMAP MOVEABLE PURE "bitmaps\\m72o.bmp" -W72O BITMAP MOVEABLE PURE "bitmaps\\w72o.bmp" -O72O BITMAP MOVEABLE PURE "bitmaps\\o72o.bmp" -U72O BITMAP MOVEABLE PURE "bitmaps\\u72o.bmp" -H72O BITMAP MOVEABLE PURE "bitmaps\\h72o.bmp" -G72O BITMAP MOVEABLE PURE "bitmaps\\g72o.bmp" -V72O BITMAP MOVEABLE PURE "bitmaps\\v72o.bmp" -S72O BITMAP MOVEABLE PURE "bitmaps\\s72o.bmp" -L72O BITMAP MOVEABLE PURE "bitmaps\\l72o.bmp" -DK72O BITMAP MOVEABLE PURE "bitmaps\\dk72o.bmp" -WP72O BITMAP MOVEABLE PURE "bitmaps\\wp72o.bmp" -WN72O BITMAP MOVEABLE PURE "bitmaps\\wn72o.bmp" -WL72O BITMAP MOVEABLE PURE "bitmaps\\wl72o.bmp" -WS72O BITMAP MOVEABLE PURE "bitmaps\\ws72o.bmp" -E72S BITMAP MOVEABLE PURE "bitmaps\\e72s.bmp" -A72S BITMAP MOVEABLE PURE "bitmaps\\a72s.bmp" -AA72S BITMAP MOVEABLE PURE "bitmaps\\as72s.bmp" -C72S BITMAP MOVEABLE PURE "bitmaps\\c72s.bmp" -CV72S BITMAP MOVEABLE PURE "bitmaps\\cv72s.bmp" -F72S BITMAP MOVEABLE PURE "bitmaps\\f72s.bmp" -M72S BITMAP MOVEABLE PURE "bitmaps\\m72s.bmp" -W72S BITMAP MOVEABLE PURE "bitmaps\\w72s.bmp" -O72S BITMAP MOVEABLE PURE "bitmaps\\o72s.bmp" -U72S BITMAP MOVEABLE PURE "bitmaps\\u72s.bmp" -H72S BITMAP MOVEABLE PURE "bitmaps\\h72s.bmp" -G72S BITMAP MOVEABLE PURE "bitmaps\\g72s.bmp" -V72S BITMAP MOVEABLE PURE "bitmaps\\v72s.bmp" -S72S BITMAP MOVEABLE PURE "bitmaps\\s72s.bmp" -L72S BITMAP MOVEABLE PURE "bitmaps\\l72s.bmp" -DK72S BITMAP MOVEABLE PURE "bitmaps\\dk72s.bmp" -WP72S BITMAP MOVEABLE PURE "bitmaps\\wp72s.bmp" -WN72S BITMAP MOVEABLE PURE "bitmaps\\wn72s.bmp" -WL72S BITMAP MOVEABLE PURE "bitmaps\\wl72s.bmp" -WS72S BITMAP MOVEABLE PURE "bitmaps\\ws72s.bmp" -E72W BITMAP MOVEABLE PURE "bitmaps\\e72w.bmp" -A72W BITMAP MOVEABLE PURE "bitmaps\\a72w.bmp" -AA72W BITMAP MOVEABLE PURE "bitmaps\\as72w.bmp" -C72W BITMAP MOVEABLE PURE "bitmaps\\c72w.bmp" -CV72W BITMAP MOVEABLE PURE "bitmaps\\cv72w.bmp" -F72W BITMAP MOVEABLE PURE "bitmaps\\f72w.bmp" -M72W BITMAP MOVEABLE PURE "bitmaps\\m72w.bmp" -W72W BITMAP MOVEABLE PURE "bitmaps\\w72w.bmp" -O72W BITMAP MOVEABLE PURE "bitmaps\\o72w.bmp" -U72W BITMAP MOVEABLE PURE "bitmaps\\u72w.bmp" -H72W BITMAP MOVEABLE PURE "bitmaps\\h72w.bmp" -G72W BITMAP MOVEABLE PURE "bitmaps\\g72w.bmp" -V72W BITMAP MOVEABLE PURE "bitmaps\\v72w.bmp" -S72W BITMAP MOVEABLE PURE "bitmaps\\s72w.bmp" -L72W BITMAP MOVEABLE PURE "bitmaps\\l72w.bmp" -DK72W BITMAP MOVEABLE PURE "bitmaps\\dk72w.bmp" -E49O BITMAP MOVEABLE PURE "bitmaps\\e49o.bmp" -A49O BITMAP MOVEABLE PURE "bitmaps\\a49o.bmp" -AA49O BITMAP MOVEABLE PURE "bitmaps\\as49o.bmp" -C49O BITMAP MOVEABLE PURE "bitmaps\\c49o.bmp" -CV49O BITMAP MOVEABLE PURE "bitmaps\\cv49o.bmp" -F49O BITMAP MOVEABLE PURE "bitmaps\\f49o.bmp" -M49O BITMAP MOVEABLE PURE "bitmaps\\m49o.bmp" -W49O BITMAP MOVEABLE PURE "bitmaps\\w49o.bmp" -O49O BITMAP MOVEABLE PURE "bitmaps\\o49o.bmp" -U49O BITMAP MOVEABLE PURE "bitmaps\\u49o.bmp" -H49O BITMAP MOVEABLE PURE "bitmaps\\h49o.bmp" -G49O BITMAP MOVEABLE PURE "bitmaps\\g49o.bmp" -V49O BITMAP MOVEABLE PURE "bitmaps\\v49o.bmp" -S49O BITMAP MOVEABLE PURE "bitmaps\\s49o.bmp" -L49O BITMAP MOVEABLE PURE "bitmaps\\l49o.bmp" -DK49O BITMAP MOVEABLE PURE "bitmaps\\dk49o.bmp" -WP49O BITMAP MOVEABLE PURE "bitmaps\\wp49o.bmp" -WN49O BITMAP MOVEABLE PURE "bitmaps\\wn49o.bmp" -WL49O BITMAP MOVEABLE PURE "bitmaps\\wl49o.bmp" -WS49O BITMAP MOVEABLE PURE "bitmaps\\ws49o.bmp" -E49S BITMAP MOVEABLE PURE "bitmaps\\e49s.bmp" -A49S BITMAP MOVEABLE PURE "bitmaps\\a49s.bmp" -AA49S BITMAP MOVEABLE PURE "bitmaps\\as49s.bmp" -C49S BITMAP MOVEABLE PURE "bitmaps\\c49s.bmp" -CV49S BITMAP MOVEABLE PURE "bitmaps\\cv49s.bmp" -F49S BITMAP MOVEABLE PURE "bitmaps\\f49s.bmp" -M49S BITMAP MOVEABLE PURE "bitmaps\\m49s.bmp" -W49S BITMAP MOVEABLE PURE "bitmaps\\w49s.bmp" -O49S BITMAP MOVEABLE PURE "bitmaps\\o49s.bmp" -U49S BITMAP MOVEABLE PURE "bitmaps\\u49s.bmp" -H49S BITMAP MOVEABLE PURE "bitmaps\\h49s.bmp" -G49S BITMAP MOVEABLE PURE "bitmaps\\g49s.bmp" -V49S BITMAP MOVEABLE PURE "bitmaps\\v49s.bmp" -S49S BITMAP MOVEABLE PURE "bitmaps\\s49s.bmp" -L49S BITMAP MOVEABLE PURE "bitmaps\\l49s.bmp" -DK49S BITMAP MOVEABLE PURE "bitmaps\\dk49s.bmp" -WP49S BITMAP MOVEABLE PURE "bitmaps\\wp49s.bmp" -WN49S BITMAP MOVEABLE PURE "bitmaps\\wn49s.bmp" -WL49S BITMAP MOVEABLE PURE "bitmaps\\wl49s.bmp" -WS49S BITMAP MOVEABLE PURE "bitmaps\\ws49s.bmp" -E49W BITMAP MOVEABLE PURE "bitmaps\\e49w.bmp" -A49W BITMAP MOVEABLE PURE "bitmaps\\a49w.bmp" -AA49W BITMAP MOVEABLE PURE "bitmaps\\as49w.bmp" -C49W BITMAP MOVEABLE PURE "bitmaps\\c49w.bmp" -CV49W BITMAP MOVEABLE PURE "bitmaps\\cv49w.bmp" -F49W BITMAP MOVEABLE PURE "bitmaps\\f49w.bmp" -M49W BITMAP MOVEABLE PURE "bitmaps\\m49w.bmp" -W49W BITMAP MOVEABLE PURE "bitmaps\\w49w.bmp" -O49W BITMAP MOVEABLE PURE "bitmaps\\o49w.bmp" -U49W BITMAP MOVEABLE PURE "bitmaps\\u49w.bmp" -H49W BITMAP MOVEABLE PURE "bitmaps\\h49w.bmp" -G49W BITMAP MOVEABLE PURE "bitmaps\\g49w.bmp" -V49W BITMAP MOVEABLE PURE "bitmaps\\v49w.bmp" -S49W BITMAP MOVEABLE PURE "bitmaps\\s49w.bmp" -L49W BITMAP MOVEABLE PURE "bitmaps\\l49w.bmp" -DK49W BITMAP MOVEABLE PURE "bitmaps\\dk49w.bmp" -A33O BITMAP MOVEABLE PURE "bitmaps\\a33o.bmp" -AA33O BITMAP MOVEABLE PURE "bitmaps\\as33o.bmp" -C33O BITMAP MOVEABLE PURE "bitmaps\\c33o.bmp" -CV33O BITMAP MOVEABLE PURE "bitmaps\\cv33o.bmp" -V33O BITMAP MOVEABLE PURE "bitmaps\\v33o.bmp" -E33O BITMAP MOVEABLE PURE "bitmaps\\e33o.bmp" -F33O BITMAP MOVEABLE PURE "bitmaps\\f33o.bmp" -H33O BITMAP MOVEABLE PURE "bitmaps\\h33o.bmp" -G33O BITMAP MOVEABLE PURE "bitmaps\\g33o.bmp" -L33O BITMAP MOVEABLE PURE "bitmaps\\l33o.bmp" -W33O BITMAP MOVEABLE PURE "bitmaps\\w33o.bmp" -M33O BITMAP MOVEABLE PURE "bitmaps\\m33o.bmp" -O33O BITMAP MOVEABLE PURE "bitmaps\\o33o.bmp" -DK33O BITMAP MOVEABLE PURE "bitmaps\\dk33o.bmp" -A33W BITMAP MOVEABLE PURE "bitmaps\\a33w.bmp" -AA33W BITMAP MOVEABLE PURE "bitmaps\\as33w.bmp" -C33W BITMAP MOVEABLE PURE "bitmaps\\c33w.bmp" -CV33W BITMAP MOVEABLE PURE "bitmaps\\cv33w.bmp" -V33W BITMAP MOVEABLE PURE "bitmaps\\v33w.bmp" -E33W BITMAP MOVEABLE PURE "bitmaps\\e33w.bmp" -F33W BITMAP MOVEABLE PURE "bitmaps\\f33w.bmp" -H33W BITMAP MOVEABLE PURE "bitmaps\\h33w.bmp" -G33W BITMAP MOVEABLE PURE "bitmaps\\g33w.bmp" -L33W BITMAP MOVEABLE PURE "bitmaps\\l33w.bmp" -W33W BITMAP MOVEABLE PURE "bitmaps\\w33w.bmp" -M33W BITMAP MOVEABLE PURE "bitmaps\\m33w.bmp" -O33W BITMAP MOVEABLE PURE "bitmaps\\o33w.bmp" -DK33W BITMAP MOVEABLE PURE "bitmaps\\dk33w.bmp" -A33S BITMAP MOVEABLE PURE "bitmaps\\a33s.bmp" -AA33S BITMAP MOVEABLE PURE "bitmaps\\as33s.bmp" -C33S BITMAP MOVEABLE PURE "bitmaps\\c33s.bmp" -CV33S BITMAP MOVEABLE PURE "bitmaps\\cv33s.bmp" -V33S BITMAP MOVEABLE PURE "bitmaps\\v33s.bmp" -E33S BITMAP MOVEABLE PURE "bitmaps\\e33s.bmp" -F33S BITMAP MOVEABLE PURE "bitmaps\\f33s.bmp" -H33S BITMAP MOVEABLE PURE "bitmaps\\h33s.bmp" -G33S BITMAP MOVEABLE PURE "bitmaps\\g33s.bmp" -L33S BITMAP MOVEABLE PURE "bitmaps\\l33s.bmp" -W33S BITMAP MOVEABLE PURE "bitmaps\\w33s.bmp" -M33S BITMAP MOVEABLE PURE "bitmaps\\m33s.bmp" -O33S BITMAP MOVEABLE PURE "bitmaps\\o33s.bmp" -DK33S BITMAP MOVEABLE PURE "bitmaps\\dk33s.bmp" - -A37O BITMAP MOVEABLE PURE "bitmaps\\a37o.bmp" -L37O BITMAP MOVEABLE PURE "bitmaps\\l37o.bmp" -C37O BITMAP MOVEABLE PURE "bitmaps\\c37o.bmp" -CV37O BITMAP MOVEABLE PURE "bitmaps\\cv37o.bmp" -A40O BITMAP MOVEABLE PURE "bitmaps\\a40o.bmp" -L40O BITMAP MOVEABLE PURE "bitmaps\\l40o.bmp" -C40O BITMAP MOVEABLE PURE "bitmaps\\c40o.bmp" -CV40O BITMAP MOVEABLE PURE "bitmaps\\cv40o.bmp" -A45O BITMAP MOVEABLE PURE "bitmaps\\a45o.bmp" -L45O BITMAP MOVEABLE PURE "bitmaps\\l45o.bmp" -C45O BITMAP MOVEABLE PURE "bitmaps\\c45o.bmp" -CV45O BITMAP MOVEABLE PURE "bitmaps\\cv45o.bmp" -A54O BITMAP MOVEABLE PURE "bitmaps\\a54o.bmp" -L54O BITMAP MOVEABLE PURE "bitmaps\\l54o.bmp" -C54O BITMAP MOVEABLE PURE "bitmaps\\c54o.bmp" -CV54O BITMAP MOVEABLE PURE "bitmaps\\cv54o.bmp" -V54O BITMAP MOVEABLE PURE "bitmaps\\v54o.bmp" -A58O BITMAP MOVEABLE PURE "bitmaps\\a58o.bmp" -L58O BITMAP MOVEABLE PURE "bitmaps\\l58o.bmp" -C58O BITMAP MOVEABLE PURE "bitmaps\\c58o.bmp" -CV58O BITMAP MOVEABLE PURE "bitmaps\\cv58o.bmp" -A64O BITMAP MOVEABLE PURE "bitmaps\\a64o.bmp" -L64O BITMAP MOVEABLE PURE "bitmaps\\l64o.bmp" -C64O BITMAP MOVEABLE PURE "bitmaps\\c64o.bmp" -CV64O BITMAP MOVEABLE PURE "bitmaps\\cv64o.bmp" -A37W BITMAP MOVEABLE PURE "bitmaps\\a37w.bmp" -L37W BITMAP MOVEABLE PURE "bitmaps\\l37w.bmp" -C37W BITMAP MOVEABLE PURE "bitmaps\\c37w.bmp" -CV37W BITMAP MOVEABLE PURE "bitmaps\\cv37w.bmp" -A40W BITMAP MOVEABLE PURE "bitmaps\\a40w.bmp" -L40W BITMAP MOVEABLE PURE "bitmaps\\l40w.bmp" -C40W BITMAP MOVEABLE PURE "bitmaps\\c40w.bmp" -CV40W BITMAP MOVEABLE PURE "bitmaps\\cv40w.bmp" -A45W BITMAP MOVEABLE PURE "bitmaps\\a45w.bmp" -L45W BITMAP MOVEABLE PURE "bitmaps\\l45w.bmp" -C45W BITMAP MOVEABLE PURE "bitmaps\\c45w.bmp" -CV45W BITMAP MOVEABLE PURE "bitmaps\\cv45w.bmp" -A54W BITMAP MOVEABLE PURE "bitmaps\\a54w.bmp" -L54W BITMAP MOVEABLE PURE "bitmaps\\l54w.bmp" -C54W BITMAP MOVEABLE PURE "bitmaps\\c54w.bmp" -CV54W BITMAP MOVEABLE PURE "bitmaps\\cv54w.bmp" -V54W BITMAP MOVEABLE PURE "bitmaps\\v54w.bmp" -A58W BITMAP MOVEABLE PURE "bitmaps\\a58w.bmp" -L58W BITMAP MOVEABLE PURE "bitmaps\\l58w.bmp" -C58W BITMAP MOVEABLE PURE "bitmaps\\c58w.bmp" -CV58W BITMAP MOVEABLE PURE "bitmaps\\cv58w.bmp" -A64W BITMAP MOVEABLE PURE "bitmaps\\a64w.bmp" -L64W BITMAP MOVEABLE PURE "bitmaps\\l64w.bmp" -C64W BITMAP MOVEABLE PURE "bitmaps\\c64w.bmp" -CV64W BITMAP MOVEABLE PURE "bitmaps\\cv64w.bmp" -A37S BITMAP MOVEABLE PURE "bitmaps\\a37s.bmp" -L37S BITMAP MOVEABLE PURE "bitmaps\\l37s.bmp" -C37S BITMAP MOVEABLE PURE "bitmaps\\c37s.bmp" -CV37S BITMAP MOVEABLE PURE "bitmaps\\cv37s.bmp" -A40S BITMAP MOVEABLE PURE "bitmaps\\a40s.bmp" -L40S BITMAP MOVEABLE PURE "bitmaps\\l40s.bmp" -C40S BITMAP MOVEABLE PURE "bitmaps\\c40s.bmp" -CV40S BITMAP MOVEABLE PURE "bitmaps\\cv40s.bmp" -A45S BITMAP MOVEABLE PURE "bitmaps\\a45s.bmp" -L45S BITMAP MOVEABLE PURE "bitmaps\\l45s.bmp" -C45S BITMAP MOVEABLE PURE "bitmaps\\c45s.bmp" -CV45S BITMAP MOVEABLE PURE "bitmaps\\cv45s.bmp" -A54S BITMAP MOVEABLE PURE "bitmaps\\a54s.bmp" -L54S BITMAP MOVEABLE PURE "bitmaps\\l54s.bmp" -C54S BITMAP MOVEABLE PURE "bitmaps\\c54s.bmp" -CV54S BITMAP MOVEABLE PURE "bitmaps\\cv54s.bmp" -V54S BITMAP MOVEABLE PURE "bitmaps\\v54s.bmp" -A58S BITMAP MOVEABLE PURE "bitmaps\\a58s.bmp" -L58S BITMAP MOVEABLE PURE "bitmaps\\l58s.bmp" -C58S BITMAP MOVEABLE PURE "bitmaps\\c58s.bmp" -CV58S BITMAP MOVEABLE PURE "bitmaps\\cv58s.bmp" -A64S BITMAP MOVEABLE PURE "bitmaps\\a64s.bmp" -L64S BITMAP MOVEABLE PURE "bitmaps\\l64s.bmp" -C64S BITMAP MOVEABLE PURE "bitmaps\\c64s.bmp" -CV64S BITMAP MOVEABLE PURE "bitmaps\\cv64s.bmp" - -SP58O BITMAP MOVEABLE PURE "shogibitmaps\\sp58o.bmp" -SN58O BITMAP MOVEABLE PURE "shogibitmaps\\sn58o.bmp" -SB58O BITMAP MOVEABLE PURE "shogibitmaps\\sb58o.bmp" -SR58O BITMAP MOVEABLE PURE "shogibitmaps\\sr58o.bmp" -SL58O BITMAP MOVEABLE PURE "shogibitmaps\\sl58o.bmp" -SK58O BITMAP MOVEABLE PURE "shogibitmaps\\sk58o.bmp" -SF58O BITMAP MOVEABLE PURE "shogibitmaps\\sf58o.bmp" -SW58O BITMAP MOVEABLE PURE "shogibitmaps\\sw58o.bmp" -SU58O BITMAP MOVEABLE PURE "shogibitmaps\\su58o.bmp" -SH58O BITMAP MOVEABLE PURE "shogibitmaps\\sh58o.bmp" -SA58O BITMAP MOVEABLE PURE "shogibitmaps\\sa58o.bmp" -SC58O BITMAP MOVEABLE PURE "shogibitmaps\\sc58o.bmp" -SG58O BITMAP MOVEABLE PURE "shogibitmaps\\sg58o.bmp" -SS58O BITMAP MOVEABLE PURE "shogibitmaps\\ss58o.bmp" -SP58W BITMAP MOVEABLE PURE "shogibitmaps\\sp58w.bmp" -SN58W BITMAP MOVEABLE PURE "shogibitmaps\\sn58w.bmp" -SR58W BITMAP MOVEABLE PURE "shogibitmaps\\sr58w.bmp" -SL58W BITMAP MOVEABLE PURE "shogibitmaps\\sl58w.bmp" -SK58W BITMAP MOVEABLE PURE "shogibitmaps\\sk58w.bmp" -SW58W BITMAP MOVEABLE PURE "shogibitmaps\\sw58w.bmp" - -KING45C BITMAP MOVEABLE PURE "shogibitmaps\\king.bmp" -AMAZON50C BITMAP MOVEABLE PURE "shogibitmaps\\bamazon.bmp" ++E72O BITMAP MOVEABLE PURE "bitmaps/e72o.bmp" ++A72O BITMAP MOVEABLE PURE "bitmaps/a72o.bmp" ++AA72O BITMAP MOVEABLE PURE "bitmaps/as72o.bmp" ++C72O BITMAP MOVEABLE PURE "bitmaps/c72o.bmp" ++CV72O BITMAP MOVEABLE PURE "bitmaps/cv72o.bmp" ++F72O BITMAP MOVEABLE PURE "bitmaps/f72o.bmp" ++M72O BITMAP MOVEABLE PURE "bitmaps/m72o.bmp" ++W72O BITMAP MOVEABLE PURE "bitmaps/w72o.bmp" ++O72O BITMAP MOVEABLE PURE "bitmaps/o72o.bmp" ++U72O BITMAP MOVEABLE PURE "bitmaps/u72o.bmp" ++H72O BITMAP MOVEABLE PURE "bitmaps/h72o.bmp" ++G72O BITMAP MOVEABLE PURE "bitmaps/g72o.bmp" ++V72O BITMAP MOVEABLE PURE "bitmaps/v72o.bmp" ++S72O BITMAP MOVEABLE PURE "bitmaps/s72o.bmp" ++L72O BITMAP MOVEABLE PURE "bitmaps/l72o.bmp" ++DK72O BITMAP MOVEABLE PURE "bitmaps/dk72o.bmp" ++WP72O BITMAP MOVEABLE PURE "bitmaps/wp72o.bmp" ++WN72O BITMAP MOVEABLE PURE "bitmaps/wn72o.bmp" ++WL72O BITMAP MOVEABLE PURE "bitmaps/wl72o.bmp" ++WS72O BITMAP MOVEABLE PURE "bitmaps/ws72o.bmp" ++E72S BITMAP MOVEABLE PURE "bitmaps/e72s.bmp" ++A72S BITMAP MOVEABLE PURE "bitmaps/a72s.bmp" ++AA72S BITMAP MOVEABLE PURE "bitmaps/as72s.bmp" ++C72S BITMAP MOVEABLE PURE "bitmaps/c72s.bmp" ++CV72S BITMAP MOVEABLE PURE "bitmaps/cv72s.bmp" ++F72S BITMAP MOVEABLE PURE "bitmaps/f72s.bmp" ++M72S BITMAP MOVEABLE PURE "bitmaps/m72s.bmp" ++W72S BITMAP MOVEABLE PURE "bitmaps/w72s.bmp" ++O72S BITMAP MOVEABLE PURE "bitmaps/o72s.bmp" ++U72S BITMAP MOVEABLE PURE "bitmaps/u72s.bmp" ++H72S BITMAP MOVEABLE PURE "bitmaps/h72s.bmp" ++G72S BITMAP MOVEABLE PURE "bitmaps/g72s.bmp" ++V72S BITMAP MOVEABLE PURE "bitmaps/v72s.bmp" ++S72S BITMAP MOVEABLE PURE "bitmaps/s72s.bmp" ++L72S BITMAP MOVEABLE PURE "bitmaps/l72s.bmp" ++DK72S BITMAP MOVEABLE PURE "bitmaps/dk72s.bmp" ++WP72S BITMAP MOVEABLE PURE "bitmaps/wp72s.bmp" ++WN72S BITMAP MOVEABLE PURE "bitmaps/wn72s.bmp" ++WL72S BITMAP MOVEABLE PURE "bitmaps/wl72s.bmp" ++WS72S BITMAP MOVEABLE PURE "bitmaps/ws72s.bmp" ++E72W BITMAP MOVEABLE PURE "bitmaps/e72w.bmp" ++A72W BITMAP MOVEABLE PURE "bitmaps/a72w.bmp" ++AA72W BITMAP MOVEABLE PURE "bitmaps/as72w.bmp" ++C72W BITMAP MOVEABLE PURE "bitmaps/c72w.bmp" ++CV72W BITMAP MOVEABLE PURE "bitmaps/cv72w.bmp" ++F72W BITMAP MOVEABLE PURE "bitmaps/f72w.bmp" ++M72W BITMAP MOVEABLE PURE "bitmaps/m72w.bmp" ++W72W BITMAP MOVEABLE PURE "bitmaps/w72w.bmp" ++O72W BITMAP MOVEABLE PURE "bitmaps/o72w.bmp" ++U72W BITMAP MOVEABLE PURE "bitmaps/u72w.bmp" ++H72W BITMAP MOVEABLE PURE "bitmaps/h72w.bmp" ++G72W BITMAP MOVEABLE PURE "bitmaps/g72w.bmp" ++V72W BITMAP MOVEABLE PURE "bitmaps/v72w.bmp" ++S72W BITMAP MOVEABLE PURE "bitmaps/s72w.bmp" ++L72W BITMAP MOVEABLE PURE "bitmaps/l72w.bmp" ++DK72W BITMAP MOVEABLE PURE "bitmaps/dk72w.bmp" ++E49O BITMAP MOVEABLE PURE "bitmaps/e49o.bmp" ++A49O BITMAP MOVEABLE PURE "bitmaps/a49o.bmp" ++AA49O BITMAP MOVEABLE PURE "bitmaps/as49o.bmp" ++C49O BITMAP MOVEABLE PURE "bitmaps/c49o.bmp" ++CV49O BITMAP MOVEABLE PURE "bitmaps/cv49o.bmp" ++F49O BITMAP MOVEABLE PURE "bitmaps/f49o.bmp" ++M49O BITMAP MOVEABLE PURE "bitmaps/m49o.bmp" ++W49O BITMAP MOVEABLE PURE "bitmaps/w49o.bmp" ++O49O BITMAP MOVEABLE PURE "bitmaps/o49o.bmp" ++U49O BITMAP MOVEABLE PURE "bitmaps/u49o.bmp" ++H49O BITMAP MOVEABLE PURE "bitmaps/h49o.bmp" ++G49O BITMAP MOVEABLE PURE "bitmaps/g49o.bmp" ++V49O BITMAP MOVEABLE PURE "bitmaps/v49o.bmp" ++S49O BITMAP MOVEABLE PURE "bitmaps/s49o.bmp" ++L49O BITMAP MOVEABLE PURE "bitmaps/l49o.bmp" ++DK49O BITMAP MOVEABLE PURE "bitmaps/dk49o.bmp" ++WP49O BITMAP MOVEABLE PURE "bitmaps/wp49o.bmp" ++WN49O BITMAP MOVEABLE PURE "bitmaps/wn49o.bmp" ++WL49O BITMAP MOVEABLE PURE "bitmaps/wl49o.bmp" ++WS49O BITMAP MOVEABLE PURE "bitmaps/ws49o.bmp" ++E49S BITMAP MOVEABLE PURE "bitmaps/e49s.bmp" ++A49S BITMAP MOVEABLE PURE "bitmaps/a49s.bmp" ++AA49S BITMAP MOVEABLE PURE "bitmaps/as49s.bmp" ++C49S BITMAP MOVEABLE PURE "bitmaps/c49s.bmp" ++CV49S BITMAP MOVEABLE PURE "bitmaps/cv49s.bmp" ++F49S BITMAP MOVEABLE PURE "bitmaps/f49s.bmp" ++M49S BITMAP MOVEABLE PURE "bitmaps/m49s.bmp" ++W49S BITMAP MOVEABLE PURE "bitmaps/w49s.bmp" ++O49S BITMAP MOVEABLE PURE "bitmaps/o49s.bmp" ++U49S BITMAP MOVEABLE PURE "bitmaps/u49s.bmp" ++H49S BITMAP MOVEABLE PURE "bitmaps/h49s.bmp" ++G49S BITMAP MOVEABLE PURE "bitmaps/g49s.bmp" ++V49S BITMAP MOVEABLE PURE "bitmaps/v49s.bmp" ++S49S BITMAP MOVEABLE PURE "bitmaps/s49s.bmp" ++L49S BITMAP MOVEABLE PURE "bitmaps/l49s.bmp" ++DK49S BITMAP MOVEABLE PURE "bitmaps/dk49s.bmp" ++WP49S BITMAP MOVEABLE PURE "bitmaps/wp49s.bmp" ++WN49S BITMAP MOVEABLE PURE "bitmaps/wn49s.bmp" ++WL49S BITMAP MOVEABLE PURE "bitmaps/wl49s.bmp" ++WS49S BITMAP MOVEABLE PURE "bitmaps/ws49s.bmp" ++E49W BITMAP MOVEABLE PURE "bitmaps/e49w.bmp" ++A49W BITMAP MOVEABLE PURE "bitmaps/a49w.bmp" ++AA49W BITMAP MOVEABLE PURE "bitmaps/as49w.bmp" ++C49W BITMAP MOVEABLE PURE "bitmaps/c49w.bmp" ++CV49W BITMAP MOVEABLE PURE "bitmaps/cv49w.bmp" ++F49W BITMAP MOVEABLE PURE "bitmaps/f49w.bmp" ++M49W BITMAP MOVEABLE PURE "bitmaps/m49w.bmp" ++W49W BITMAP MOVEABLE PURE "bitmaps/w49w.bmp" ++O49W BITMAP MOVEABLE PURE "bitmaps/o49w.bmp" ++U49W BITMAP MOVEABLE PURE "bitmaps/u49w.bmp" ++H49W BITMAP MOVEABLE PURE "bitmaps/h49w.bmp" ++G49W BITMAP MOVEABLE PURE "bitmaps/g49w.bmp" ++V49W BITMAP MOVEABLE PURE "bitmaps/v49w.bmp" ++S49W BITMAP MOVEABLE PURE "bitmaps/s49w.bmp" ++L49W BITMAP MOVEABLE PURE "bitmaps/l49w.bmp" ++DK49W BITMAP MOVEABLE PURE "bitmaps/dk49w.bmp" ++A33O BITMAP MOVEABLE PURE "bitmaps/a33o.bmp" ++AA33O BITMAP MOVEABLE PURE "bitmaps/as33o.bmp" ++C33O BITMAP MOVEABLE PURE "bitmaps/c33o.bmp" ++CV33O BITMAP MOVEABLE PURE "bitmaps/cv33o.bmp" ++V33O BITMAP MOVEABLE PURE "bitmaps/v33o.bmp" ++E33O BITMAP MOVEABLE PURE "bitmaps/e33o.bmp" ++F33O BITMAP MOVEABLE PURE "bitmaps/f33o.bmp" ++H33O BITMAP MOVEABLE PURE "bitmaps/h33o.bmp" ++G33O BITMAP MOVEABLE PURE "bitmaps/g33o.bmp" ++L33O BITMAP MOVEABLE PURE "bitmaps/l33o.bmp" ++W33O BITMAP MOVEABLE PURE "bitmaps/w33o.bmp" ++M33O BITMAP MOVEABLE PURE "bitmaps/m33o.bmp" ++O33O BITMAP MOVEABLE PURE "bitmaps/o33o.bmp" ++DK33O BITMAP MOVEABLE PURE "bitmaps/dk33o.bmp" ++A33W BITMAP MOVEABLE PURE "bitmaps/a33w.bmp" ++AA33W BITMAP MOVEABLE PURE "bitmaps/as33w.bmp" ++C33W BITMAP MOVEABLE PURE "bitmaps/c33w.bmp" ++CV33W BITMAP MOVEABLE PURE "bitmaps/cv33w.bmp" ++V33W BITMAP MOVEABLE PURE "bitmaps/v33w.bmp" ++E33W BITMAP MOVEABLE PURE "bitmaps/e33w.bmp" ++F33W BITMAP MOVEABLE PURE "bitmaps/f33w.bmp" ++H33W BITMAP MOVEABLE PURE "bitmaps/h33w.bmp" ++G33W BITMAP MOVEABLE PURE "bitmaps/g33w.bmp" ++L33W BITMAP MOVEABLE PURE "bitmaps/l33w.bmp" ++W33W BITMAP MOVEABLE PURE "bitmaps/w33w.bmp" ++M33W BITMAP MOVEABLE PURE "bitmaps/m33w.bmp" ++O33W BITMAP MOVEABLE PURE "bitmaps/o33w.bmp" ++DK33W BITMAP MOVEABLE PURE "bitmaps/dk33w.bmp" ++A33S BITMAP MOVEABLE PURE "bitmaps/a33s.bmp" ++AA33S BITMAP MOVEABLE PURE "bitmaps/as33s.bmp" ++C33S BITMAP MOVEABLE PURE "bitmaps/c33s.bmp" ++CV33S BITMAP MOVEABLE PURE "bitmaps/cv33s.bmp" ++V33S BITMAP MOVEABLE PURE "bitmaps/v33s.bmp" ++E33S BITMAP MOVEABLE PURE "bitmaps/e33s.bmp" ++F33S BITMAP MOVEABLE PURE "bitmaps/f33s.bmp" ++H33S BITMAP MOVEABLE PURE "bitmaps/h33s.bmp" ++G33S BITMAP MOVEABLE PURE "bitmaps/g33s.bmp" ++L33S BITMAP MOVEABLE PURE "bitmaps/l33s.bmp" ++W33S BITMAP MOVEABLE PURE "bitmaps/w33s.bmp" ++M33S BITMAP MOVEABLE PURE "bitmaps/m33s.bmp" ++O33S BITMAP MOVEABLE PURE "bitmaps/o33s.bmp" ++DK33S BITMAP MOVEABLE PURE "bitmaps/dk33s.bmp" ++ ++A37O BITMAP MOVEABLE PURE "bitmaps/a37o.bmp" ++L37O BITMAP MOVEABLE PURE "bitmaps/l37o.bmp" ++C37O BITMAP MOVEABLE PURE "bitmaps/c37o.bmp" ++CV37O BITMAP MOVEABLE PURE "bitmaps/cv37o.bmp" ++A40O BITMAP MOVEABLE PURE "bitmaps/a40o.bmp" ++L40O BITMAP MOVEABLE PURE "bitmaps/l40o.bmp" ++C40O BITMAP MOVEABLE PURE "bitmaps/c40o.bmp" ++CV40O BITMAP MOVEABLE PURE "bitmaps/cv40o.bmp" ++A45O BITMAP MOVEABLE PURE "bitmaps/a45o.bmp" ++L45O BITMAP MOVEABLE PURE "bitmaps/l45o.bmp" ++C45O BITMAP MOVEABLE PURE "bitmaps/c45o.bmp" ++CV45O BITMAP MOVEABLE PURE "bitmaps/cv45o.bmp" ++A54O BITMAP MOVEABLE PURE "bitmaps/a54o.bmp" ++L54O BITMAP MOVEABLE PURE "bitmaps/l54o.bmp" ++C54O BITMAP MOVEABLE PURE "bitmaps/c54o.bmp" ++CV54O BITMAP MOVEABLE PURE "bitmaps/cv54o.bmp" ++V54O BITMAP MOVEABLE PURE "bitmaps/v54o.bmp" ++A58O BITMAP MOVEABLE PURE "bitmaps/a58o.bmp" ++L58O BITMAP MOVEABLE PURE "bitmaps/l58o.bmp" ++C58O BITMAP MOVEABLE PURE "bitmaps/c58o.bmp" ++CV58O BITMAP MOVEABLE PURE "bitmaps/cv58o.bmp" ++A64O BITMAP MOVEABLE PURE "bitmaps/a64o.bmp" ++L64O BITMAP MOVEABLE PURE "bitmaps/l64o.bmp" ++C64O BITMAP MOVEABLE PURE "bitmaps/c64o.bmp" ++CV64O BITMAP MOVEABLE PURE "bitmaps/cv64o.bmp" ++A37W BITMAP MOVEABLE PURE "bitmaps/a37w.bmp" ++L37W BITMAP MOVEABLE PURE "bitmaps/l37w.bmp" ++C37W BITMAP MOVEABLE PURE "bitmaps/c37w.bmp" ++CV37W BITMAP MOVEABLE PURE "bitmaps/cv37w.bmp" ++A40W BITMAP MOVEABLE PURE "bitmaps/a40w.bmp" ++L40W BITMAP MOVEABLE PURE "bitmaps/l40w.bmp" ++C40W BITMAP MOVEABLE PURE "bitmaps/c40w.bmp" ++CV40W BITMAP MOVEABLE PURE "bitmaps/cv40w.bmp" ++A45W BITMAP MOVEABLE PURE "bitmaps/a45w.bmp" ++L45W BITMAP MOVEABLE PURE "bitmaps/l45w.bmp" ++C45W BITMAP MOVEABLE PURE "bitmaps/c45w.bmp" ++CV45W BITMAP MOVEABLE PURE "bitmaps/cv45w.bmp" ++A54W BITMAP MOVEABLE PURE "bitmaps/a54w.bmp" ++L54W BITMAP MOVEABLE PURE "bitmaps/l54w.bmp" ++C54W BITMAP MOVEABLE PURE "bitmaps/c54w.bmp" ++CV54W BITMAP MOVEABLE PURE "bitmaps/cv54w.bmp" ++V54W BITMAP MOVEABLE PURE "bitmaps/v54w.bmp" ++A58W BITMAP MOVEABLE PURE "bitmaps/a58w.bmp" ++L58W BITMAP MOVEABLE PURE "bitmaps/l58w.bmp" ++C58W BITMAP MOVEABLE PURE "bitmaps/c58w.bmp" ++CV58W BITMAP MOVEABLE PURE "bitmaps/cv58w.bmp" ++A64W BITMAP MOVEABLE PURE "bitmaps/a64w.bmp" ++L64W BITMAP MOVEABLE PURE "bitmaps/l64w.bmp" ++C64W BITMAP MOVEABLE PURE "bitmaps/c64w.bmp" ++CV64W BITMAP MOVEABLE PURE "bitmaps/cv64w.bmp" ++A37S BITMAP MOVEABLE PURE "bitmaps/a37s.bmp" ++L37S BITMAP MOVEABLE PURE "bitmaps/l37s.bmp" ++C37S BITMAP MOVEABLE PURE "bitmaps/c37s.bmp" ++CV37S BITMAP MOVEABLE PURE "bitmaps/cv37s.bmp" ++A40S BITMAP MOVEABLE PURE "bitmaps/a40s.bmp" ++L40S BITMAP MOVEABLE PURE "bitmaps/l40s.bmp" ++C40S BITMAP MOVEABLE PURE "bitmaps/c40s.bmp" ++CV40S BITMAP MOVEABLE PURE "bitmaps/cv40s.bmp" ++A45S BITMAP MOVEABLE PURE "bitmaps/a45s.bmp" ++L45S BITMAP MOVEABLE PURE "bitmaps/l45s.bmp" ++C45S BITMAP MOVEABLE PURE "bitmaps/c45s.bmp" ++CV45S BITMAP MOVEABLE PURE "bitmaps/cv45s.bmp" ++A54S BITMAP MOVEABLE PURE "bitmaps/a54s.bmp" ++L54S BITMAP MOVEABLE PURE "bitmaps/l54s.bmp" ++C54S BITMAP MOVEABLE PURE "bitmaps/c54s.bmp" ++CV54S BITMAP MOVEABLE PURE "bitmaps/cv54s.bmp" ++V54S BITMAP MOVEABLE PURE "bitmaps/v54s.bmp" ++A58S BITMAP MOVEABLE PURE "bitmaps/a58s.bmp" ++L58S BITMAP MOVEABLE PURE "bitmaps/l58s.bmp" ++C58S BITMAP MOVEABLE PURE "bitmaps/c58s.bmp" ++CV58S BITMAP MOVEABLE PURE "bitmaps/cv58s.bmp" ++A64S BITMAP MOVEABLE PURE "bitmaps/a64s.bmp" ++L64S BITMAP MOVEABLE PURE "bitmaps/l64s.bmp" ++C64S BITMAP MOVEABLE PURE "bitmaps/c64s.bmp" ++CV64S BITMAP MOVEABLE PURE "bitmaps/cv64s.bmp" ++ ++SP58O BITMAP MOVEABLE PURE "shogibitmaps/sp58o.bmp" ++SN58O BITMAP MOVEABLE PURE "shogibitmaps/sn58o.bmp" ++SB58O BITMAP MOVEABLE PURE "shogibitmaps/sb58o.bmp" ++SR58O BITMAP MOVEABLE PURE "shogibitmaps/sr58o.bmp" ++SL58O BITMAP MOVEABLE PURE "shogibitmaps/sl58o.bmp" ++SK58O BITMAP MOVEABLE PURE "shogibitmaps/sk58o.bmp" ++SF58O BITMAP MOVEABLE PURE "shogibitmaps/sf58o.bmp" ++SW58O BITMAP MOVEABLE PURE "shogibitmaps/sw58o.bmp" ++SU58O BITMAP MOVEABLE PURE "shogibitmaps/su58o.bmp" ++SH58O BITMAP MOVEABLE PURE "shogibitmaps/sh58o.bmp" ++SA58O BITMAP MOVEABLE PURE "shogibitmaps/sa58o.bmp" ++SC58O BITMAP MOVEABLE PURE "shogibitmaps/sc58o.bmp" ++SG58O BITMAP MOVEABLE PURE "shogibitmaps/sg58o.bmp" ++SS58O BITMAP MOVEABLE PURE "shogibitmaps/ss58o.bmp" ++SP58W BITMAP MOVEABLE PURE "shogibitmaps/sp58w.bmp" ++SN58W BITMAP MOVEABLE PURE "shogibitmaps/sn58w.bmp" ++SR58W BITMAP MOVEABLE PURE "shogibitmaps/sr58w.bmp" ++SL58W BITMAP MOVEABLE PURE "shogibitmaps/sl58w.bmp" ++SK58W BITMAP MOVEABLE PURE "shogibitmaps/sk58w.bmp" ++SW58W BITMAP MOVEABLE PURE "shogibitmaps/sw58w.bmp" #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@@ -1321,39 -1994,38 +1991,38 @@@ EN // WAVE // - DING WAVE DISCARDABLE "../sounds/ding1.wav" - CHING WAVE DISCARDABLE "../sounds/ching.wav" - CLICK WAVE DISCARDABLE "../sounds/click.wav" - CYMBAL WAVE DISCARDABLE "../sounds/cymbal.wav" - DRIP WAVE DISCARDABLE "../sounds/drip.wav" - GONG WAVE DISCARDABLE "../sounds/gong.wav" - BEEPBEEP WAVE DISCARDABLE "../sounds/honkhonk.wav" - LASER WAVE DISCARDABLE "../sounds/laser.wav" - PENALTY WAVE DISCARDABLE "../sounds/penalty.wav" - PHONE WAVE DISCARDABLE "../sounds/phone.wav" - POP WAVE DISCARDABLE "../sounds/pop.wav" - POP2 WAVE DISCARDABLE "../sounds/pop2.wav" - SLAP WAVE DISCARDABLE "../sounds/slap.wav" - SQUEAK WAVE DISCARDABLE "../sounds/squeak.wav" - SWISH WAVE DISCARDABLE "../sounds/swish.wav" - THUD WAVE DISCARDABLE "../sounds/thud.wav" - WHIPCRACK WAVE DISCARDABLE "../sounds/whipcrak.wav" - MOVE WAVE DISCARDABLE "../sounds/move.wav" - ALARM WAVE DISCARDABLE "../sounds/alarm.wav" - CHALLENGE WAVE DISCARDABLE "../sounds/challenge.wav" - CHANNEL WAVE DISCARDABLE "../sounds/channel.wav" - CHANNEL1 WAVE DISCARDABLE "../sounds/channel1.wav" - DRAW WAVE DISCARDABLE "../sounds/draw.wav" - KIBITZ WAVE DISCARDABLE "../sounds/kibitz.wav" - LOSE WAVE DISCARDABLE "../sounds/lose.wav" - REQUEST WAVE DISCARDABLE "../sounds/request.wav" - SEEK WAVE DISCARDABLE "../sounds/seek.wav" - SHOUT WAVE DISCARDABLE "../sounds/shout.wav" - SSHOUT WAVE DISCARDABLE "../sounds/sshout.wav" - TELL WAVE DISCARDABLE "../sounds/tell.wav" - UNFINISHED WAVE DISCARDABLE "../sounds/unfinished.wav" - WIN WAVE DISCARDABLE "../sounds/win.wav" - -DING WAVE DISCARDABLE "sounds\\ding1.wav" -CHING WAVE DISCARDABLE "sounds\\ching.wav" -CLICK WAVE DISCARDABLE "sounds\\click.wav" -CYMBAL WAVE DISCARDABLE "sounds\\cymbal.wav" -DRIP WAVE DISCARDABLE "sounds\\drip.wav" -GONG WAVE DISCARDABLE "sounds\\gong.wav" -BEEPBEEP WAVE DISCARDABLE "sounds\\honkhonk.wav" -LASER WAVE DISCARDABLE "sounds\\laser.wav" -PENALTY WAVE DISCARDABLE "sounds\\penalty.wav" -PHONE WAVE DISCARDABLE "sounds\\phone.wav" -POP WAVE DISCARDABLE "sounds\\pop.wav" -POP2 WAVE DISCARDABLE "sounds\\pop2.wav" -SLAP WAVE DISCARDABLE "sounds\\slap.wav" -SQUEAK WAVE DISCARDABLE "sounds\\squeak.wav" -SWISH WAVE DISCARDABLE "sounds\\swish.wav" -THUD WAVE DISCARDABLE "sounds\\thud.wav" -WHIPCRACK WAVE DISCARDABLE "sounds\\whipcrak.wav" -MOVE WAVE DISCARDABLE "sounds\\move.wav" -ALARM WAVE DISCARDABLE "sounds\\alarm.wav" -CHALLENGE WAVE DISCARDABLE "sounds\\challenge.wav" -CHANNEL WAVE DISCARDABLE "sounds\\channel.wav" -CHANNEL1 WAVE DISCARDABLE "sounds\\channel1.wav" -DRAW WAVE DISCARDABLE "sounds\\draw.wav" -KIBITZ WAVE DISCARDABLE "sounds\\kibitz.wav" -LOSE WAVE DISCARDABLE "sounds\\lose.wav" -REQUEST WAVE DISCARDABLE "sounds\\request.wav" -SEEK WAVE DISCARDABLE "sounds\\seek.wav" -SHOUT WAVE DISCARDABLE "sounds\\shout.wav" -SSHOUT WAVE DISCARDABLE "sounds\\sshout.wav" -TELL WAVE DISCARDABLE "sounds\\tell.wav" -UNFINISHED WAVE DISCARDABLE "sounds\\unfinished.wav" -WIN WAVE DISCARDABLE "sounds\\win.wav" ++DING WAVE DISCARDABLE "sounds/ding1.wav" ++CHING WAVE DISCARDABLE "sounds/ching.wav" ++CLICK WAVE DISCARDABLE "sounds/click.wav" ++CYMBAL WAVE DISCARDABLE "sounds/cymbal.wav" ++DRIP WAVE DISCARDABLE "sounds/drip.wav" ++GONG WAVE DISCARDABLE "sounds/gong.wav" ++BEEPBEEP WAVE DISCARDABLE "sounds/honkhonk.wav" ++LASER WAVE DISCARDABLE "sounds/laser.wav" ++PENALTY WAVE DISCARDABLE "sounds/penalty.wav" ++PHONE WAVE DISCARDABLE "sounds/phone.wav" ++POP WAVE DISCARDABLE "sounds/pop.wav" ++POP2 WAVE DISCARDABLE "sounds/pop2.wav" ++SLAP WAVE DISCARDABLE "sounds/slap.wav" ++SQUEAK WAVE DISCARDABLE "sounds/squeak.wav" ++SWISH WAVE DISCARDABLE "sounds/swish.wav" ++THUD WAVE DISCARDABLE "sounds/thud.wav" ++WHIPCRACK WAVE DISCARDABLE "sounds/whipcrak.wav" ++MOVE WAVE DISCARDABLE "sounds/move.wav" ++ALARM WAVE DISCARDABLE "sounds/alarm.wav" ++CHALLENGE WAVE DISCARDABLE "sounds/challenge.wav" ++CHANNEL WAVE DISCARDABLE "sounds/channel.wav" ++CHANNEL1 WAVE DISCARDABLE "sounds/channel1.wav" ++DRAW WAVE DISCARDABLE "sounds/draw.wav" ++KIBITZ WAVE DISCARDABLE "sounds/kibitz.wav" ++LOSE WAVE DISCARDABLE "sounds/lose.wav" ++REQUEST WAVE DISCARDABLE "sounds/request.wav" ++SEEK WAVE DISCARDABLE "sounds/seek.wav" ++SHOUT WAVE DISCARDABLE "sounds/shout.wav" ++SSHOUT WAVE DISCARDABLE "sounds/sshout.wav" ++TELL WAVE DISCARDABLE "sounds/tell.wav" ++UNFINISHED WAVE DISCARDABLE "sounds/unfinished.wav" ++WIN WAVE DISCARDABLE "sounds/win.wav" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// diff --cc winboard/winboard.rtf index 63afc92,2fdaec7..4b757c6 --- a/winboard/winboard.rtf +++ b/winboard/winboard.rtf @@@ -1,2411 -1,2024 +1,2143 @@@ - {\rtf1\ansi\ansicpg1252\uc1\deff4\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} - {\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Helvetica{\*\falt Arial};} - {\f5\fmodern\fcharset0\fprq1{\*\panose 02070409020205020404}Courier{\*\falt Courier New};}{\f6\froman\fcharset0\fprq2{\*\panose 02020603040505020304}Tms Rmn;}{\f7\fswiss\fcharset0\fprq2{\*\panose 020b0604020202030204}Helv;} - {\f8\froman\fcharset0\fprq2{\*\panose 02040503060506020304}New York;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;} - {\f11\froman\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt \'82\'6c\'82\'72 \'96\'be\'92\'a9};}{\f12\fnil\fcharset129\fprq1{\*\panose 02030600000101010101}Batang{\*\falt \'b9\'d9\'c5\'c1};} - {\f13\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt \'cb\'ce\'cc\'e5};}{\f14\fnil\fcharset136\fprq2{\*\panose 02020300000000000000}PMingLiU{\*\falt \'b7\'73\'b2\'d3\'a9\'fa\'c5\'e9};} - {\f15\fmodern\fcharset128\fprq1{\*\panose 020b0609070205080204}MS Gothic{\*\falt \'82\'6c\'82\'72 \'83\'53\'83\'56\'83\'62\'83\'4e};}{\f16\fmodern\fcharset129\fprq1{\*\panose 020b0600000101010101}Dotum{\*\falt \'b5\'b8\'bf\'f2};} - {\f17\fmodern\fcharset134\fprq1{\*\panose 02010600030101010101}SimHei{\*\falt \'ba\'da\'cc\'e5};}{\f18\fmodern\fcharset136\fprq1{\*\panose 02020309000000000000}MingLiU{\*\falt \'b2\'d3\'a9\'fa\'c5\'e9};} - {\f19\froman\fcharset128\fprq1{\*\panose 02020609040305080305}Mincho{\*\falt \'96\'be\'92\'a9};}{\f20\froman\fcharset129\fprq1{\*\panose 020b0600000101010101}Gulim{\*\falt \'b1\'bc\'b8\'b2};} - {\f21\froman\fcharset0\fprq2{\*\panose 02040604050505020304}Century;}{\f22\froman\fcharset222\fprq2{\*\panose 02020603050405020304}Angsana New;}{\f23\froman\fcharset222\fprq2{\*\panose 020b0304020202020204}Cordia New;} - {\f24\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Mangal;}{\f25\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Latha;}{\f26\froman\fcharset0\fprq2{\*\panose 010a0502050306030303}Sylfaen;} - {\f27\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Vrinda;}{\f28\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Raavi;}{\f29\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Shruti;} - {\f30\froman\fcharset1\fprq2{\*\panose 00000400000000000000}Sendnya;}{\f31\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Gautami;}{\f32\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Tunga;} - {\f33\froman\fcharset1\fprq2{\*\panose 00000000000000000000}Estrangella Edessa;}{\f34\fswiss\fcharset128\fprq2{\*\panose 020b0604020202020204}Arial Unicode MS;}{\f35\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;} - {\f36\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f37\fswiss\fcharset0\fprq0{\*\panose 00000000000000000000}Univers (WN);}{\f38\froman\fcharset0\fprq0{\*\panose 00000000000000000000}CG Times (WN);} - {\f39\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Marlett;}{\f40\fmodern\fcharset0\fprq1{\*\panose 020b0609040504020204}Lucida Console;}{\f41\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020204}Lucida Sans Unicode;} - {\f42\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f43\fswiss\fcharset0\fprq2{\*\panose 020b0a04020102020204}Arial Black;}{\f44\fscript\fcharset0\fprq2{\*\panose 030f0702030302020204}Comic Sans MS;} - {\f45\fswiss\fcharset0\fprq2{\*\panose 020b0806030902050204}Impact;}{\f46\froman\fcharset0\fprq2{\*\panose 02040502050405020303}Georgia;}{\f47\fswiss\fcharset0\fprq2{\*\panose 020b0603020102020204}Franklin Gothic Medium;} - {\f48\froman\fcharset0\fprq2{\*\panose 02040502050505030304}Palatino Linotype;}{\f49\fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS;}{\f50\froman\fcharset2\fprq2{\*\panose 05030102010509060703}Webdings;} - {\f51\fscript\fcharset0\fprq2 Estrangelo Edessa;}{\f52\fnil\fcharset0\fprq2 MV Boli;}{\f53\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Microsoft Sans Serif;}{\f54\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;} - {\f55\fswiss\fcharset128\fprq2{\*\panose 020b0604020202020204}@Arial Unicode MS;}{\f56\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}{\f57\froman\fcharset0\fprq2{\*\panose 02050604050505020204}Bookman Old Style;} - {\f58\fswiss\fcharset0\fprq2{\*\panose 020b0502020202020204}Century Gothic;}{\f59\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f60\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;} - {\f61\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Outlook;}{\f62\fscript\fcharset0\fprq2{\*\panose 03010101010201010101}Monotype Corsiva;}{\f63\froman\fcharset2\fprq2{\*\panose 05020102010507070707}Wingdings 2;} - {\f64\froman\fcharset2\fprq2{\*\panose 05040102010807070707}Wingdings 3;}{\f65\froman\fcharset2\fprq2{\*\panose 05050102010205020202}MT Extra;}{\f66\fswiss\fcharset0\fprq2{\*\panose 020b0604040002020204}CA Chess;} - {\f67\fswiss\fcharset2\fprq2{\*\panose 050b0600000000000000}ISDiagram;}{\f68\fswiss\fcharset2\fprq2{\*\panose 050b0600000000000000}CADiagram;}{\f69\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Alfonso-X;} - {\f70\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Chess Adventurer;}{\f71\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Chess Cases;}{\f72\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess Marroquin;} - {\f73\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Condal;}{\f74\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Harlequin;}{\f75\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Kingdom;} - {\f76\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Leipzig;}{\f77\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Line;}{\f78\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Chess Lucena;} - {\f79\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Magnetic;}{\f80\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Mark;}{\f81\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess Maya;} - {\f82\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Merida Fatx;}{\f83\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Merida;}{\f84\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Millennia-D;} - {\f85\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess Miscel;}{\f86\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Motif;}{\f87\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Mediaeval;} - {\f88\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Smart;}{\f89\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Traveller Standard;}{\f90\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess;} - {\f91\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess Usual;}{\f92\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Chess Utrecht;}{\f93\fnil\fcharset2\fprq2{\*\panose 05000502060100000001}Mathematica1;} - {\f94\froman\fcharset2\fprq2{\*\panose 05060400030100000101}Mathematica1Mono;}{\f95\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica2;}{\f96\fnil\fcharset2\fprq2{\*\panose 05000400030000000000}Mathematica2Mono;} - {\f97\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica3;}{\f98\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica3Mono;}{\f99\fnil\fcharset2\fprq2{\*\panose 05010400040101000101}Mathematica4;} - {\f100\fnil\fcharset2\fprq2{\*\panose 05010400040101000101}Mathematica4Mono;}{\f101\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica5;}{\f102\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica5Mono;} - {\f103\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica6;}{\f104\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica6Mono;}{\f105\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica7;} - {\f106\fnil\fcharset2\fprq2{\*\panose 00000400000000000000}Mathematica7Mono;}{\f107\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Bookup;}{\f108\fswiss\fcharset0\fprq2{\*\panose 020b0803020104020203}Chessmaster9000;} - {\f109\fswiss\fcharset0\fprq2{\*\panose 020b0500000000000000}FigurineCB AriesSP;}{\f110\fnil\fcharset0\fprq1{\*\panose 00000500000000000000}FigurineCB LetterSP;}{\f111\froman\fcharset0\fprq2{\*\panose 02020500000000000000}FigurineCB TimeSP;} - {\f112\fnil\fcharset0\fprq2{\*\panose 05000000000000000000}DiagramTTFritz;}{\f113\fmodern\fcharset2\fprq1{\*\panose 02020509000000000000}FigurineCrrCB;}{\f114\froman\fcharset2\fprq2{\*\panose 02020500000000000000}FigurineTmsCB;} - {\f115\fmodern\fcharset0\fprq1{\*\panose 020b0609020202020204}HE_TERMINAL;}{\f116\fswiss\fcharset0\fprq2{\*\panose 020b7200000000000000}Digiface;}{\f117\fnil\fcharset0\fprq2{\*\panose 00000400000000000000}Sydnie;} - {\f118\froman\fcharset238\fprq2 Times New Roman CE;}{\f119\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f121\froman\fcharset161\fprq2 Times New Roman Greek;}{\f122\froman\fcharset162\fprq2 Times New Roman Tur;} - {\f123\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f124\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f125\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f126\froman\fcharset163\fprq2 Times New Roman (Vietnamese);} - {\f128\fswiss\fcharset238\fprq2 Arial CE;}{\f129\fswiss\fcharset204\fprq2 Arial Cyr;}{\f131\fswiss\fcharset161\fprq2 Arial Greek;}{\f132\fswiss\fcharset162\fprq2 Arial Tur;}{\f133\fswiss\fcharset177\fprq2 Arial (Hebrew);} - {\f134\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f135\fswiss\fcharset186\fprq2 Arial Baltic;}{\f136\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f138\fmodern\fcharset238\fprq1 Courier New CE;}{\f139\fmodern\fcharset204\fprq1 Courier New Cyr;} - {\f141\fmodern\fcharset161\fprq1 Courier New Greek;}{\f142\fmodern\fcharset162\fprq1 Courier New Tur;}{\f143\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f144\fmodern\fcharset178\fprq1 Courier New (Arabic);} - {\f145\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f146\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f158\fswiss\fcharset238\fprq2 Helvetica CE{\*\falt Arial};}{\f159\fswiss\fcharset204\fprq2 Helvetica Cyr{\*\falt Arial};} - {\f161\fswiss\fcharset161\fprq2 Helvetica Greek{\*\falt Arial};}{\f162\fswiss\fcharset162\fprq2 Helvetica Tur{\*\falt Arial};}{\f163\fswiss\fcharset177\fprq2 Helvetica (Hebrew){\*\falt Arial};} - {\f164\fswiss\fcharset178\fprq2 Helvetica (Arabic){\*\falt Arial};}{\f165\fswiss\fcharset186\fprq2 Helvetica Baltic{\*\falt Arial};}{\f166\fswiss\fcharset163\fprq2 Helvetica (Vietnamese){\*\falt Arial};}{\f328\froman\fcharset238\fprq2 Century CE;} - {\f329\froman\fcharset204\fprq2 Century Cyr;}{\f331\froman\fcharset161\fprq2 Century Greek;}{\f332\froman\fcharset162\fprq2 Century Tur;}{\f335\froman\fcharset186\fprq2 Century Baltic;}{\f378\froman\fcharset238\fprq2 Sylfaen CE;} - {\f379\froman\fcharset204\fprq2 Sylfaen Cyr;}{\f381\froman\fcharset161\fprq2 Sylfaen Greek;}{\f382\froman\fcharset162\fprq2 Sylfaen Tur;}{\f385\froman\fcharset186\fprq2 Sylfaen Baltic;}{\f460\fswiss\fcharset0\fprq2 Arial Unicode MS Western;} - {\f458\fswiss\fcharset238\fprq2 Arial Unicode MS CE;}{\f459\fswiss\fcharset204\fprq2 Arial Unicode MS Cyr;}{\f461\fswiss\fcharset161\fprq2 Arial Unicode MS Greek;}{\f462\fswiss\fcharset162\fprq2 Arial Unicode MS Tur;} - {\f463\fswiss\fcharset177\fprq2 Arial Unicode MS (Hebrew);}{\f464\fswiss\fcharset178\fprq2 Arial Unicode MS (Arabic);}{\f465\fswiss\fcharset186\fprq2 Arial Unicode MS Baltic;}{\f466\fswiss\fcharset163\fprq2 Arial Unicode MS (Vietnamese);} - {\f467\fswiss\fcharset222\fprq2 Arial Unicode MS (Thai);}{\f468\fswiss\fcharset238\fprq2 Tahoma CE;}{\f469\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f471\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f472\fswiss\fcharset162\fprq2 Tahoma Tur;} - {\f473\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f474\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f475\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f476\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f477\fswiss\fcharset222\fprq2 Tahoma (Thai);} - {\f518\fmodern\fcharset238\fprq1 Lucida Console CE;}{\f519\fmodern\fcharset204\fprq1 Lucida Console Cyr;}{\f521\fmodern\fcharset161\fprq1 Lucida Console Greek;}{\f522\fmodern\fcharset162\fprq1 Lucida Console Tur;} - {\f528\fswiss\fcharset238\fprq2 Lucida Sans Unicode CE;}{\f529\fswiss\fcharset204\fprq2 Lucida Sans Unicode Cyr;}{\f531\fswiss\fcharset161\fprq2 Lucida Sans Unicode Greek;}{\f532\fswiss\fcharset162\fprq2 Lucida Sans Unicode Tur;} - {\f533\fswiss\fcharset177\fprq2 Lucida Sans Unicode (Hebrew);}{\f538\fswiss\fcharset238\fprq2 Verdana CE;}{\f539\fswiss\fcharset204\fprq2 Verdana Cyr;}{\f541\fswiss\fcharset161\fprq2 Verdana Greek;}{\f542\fswiss\fcharset162\fprq2 Verdana Tur;} - {\f545\fswiss\fcharset186\fprq2 Verdana Baltic;}{\f546\fswiss\fcharset163\fprq2 Verdana (Vietnamese);}{\f548\fswiss\fcharset238\fprq2 Arial Black CE;}{\f549\fswiss\fcharset204\fprq2 Arial Black Cyr;}{\f551\fswiss\fcharset161\fprq2 Arial Black Greek;} - {\f552\fswiss\fcharset162\fprq2 Arial Black Tur;}{\f555\fswiss\fcharset186\fprq2 Arial Black Baltic;}{\f558\fscript\fcharset238\fprq2 Comic Sans MS CE;}{\f559\fscript\fcharset204\fprq2 Comic Sans MS Cyr;} - {\f561\fscript\fcharset161\fprq2 Comic Sans MS Greek;}{\f562\fscript\fcharset162\fprq2 Comic Sans MS Tur;}{\f565\fscript\fcharset186\fprq2 Comic Sans MS Baltic;}{\f568\fswiss\fcharset238\fprq2 Impact CE;}{\f569\fswiss\fcharset204\fprq2 Impact Cyr;} - {\f571\fswiss\fcharset161\fprq2 Impact Greek;}{\f572\fswiss\fcharset162\fprq2 Impact Tur;}{\f575\fswiss\fcharset186\fprq2 Impact Baltic;}{\f578\froman\fcharset238\fprq2 Georgia CE;}{\f579\froman\fcharset204\fprq2 Georgia Cyr;} - {\f581\froman\fcharset161\fprq2 Georgia Greek;}{\f582\froman\fcharset162\fprq2 Georgia Tur;}{\f585\froman\fcharset186\fprq2 Georgia Baltic;}{\f588\fswiss\fcharset238\fprq2 Franklin Gothic Medium CE;} - {\f589\fswiss\fcharset204\fprq2 Franklin Gothic Medium Cyr;}{\f591\fswiss\fcharset161\fprq2 Franklin Gothic Medium Greek;}{\f592\fswiss\fcharset162\fprq2 Franklin Gothic Medium Tur;}{\f595\fswiss\fcharset186\fprq2 Franklin Gothic Medium Baltic;} - {\f598\froman\fcharset238\fprq2 Palatino Linotype CE;}{\f599\froman\fcharset204\fprq2 Palatino Linotype Cyr;}{\f601\froman\fcharset161\fprq2 Palatino Linotype Greek;}{\f602\froman\fcharset162\fprq2 Palatino Linotype Tur;} - {\f605\froman\fcharset186\fprq2 Palatino Linotype Baltic;}{\f606\froman\fcharset163\fprq2 Palatino Linotype (Vietnamese);}{\f608\fswiss\fcharset238\fprq2 Trebuchet MS CE;}{\f609\fswiss\fcharset204\fprq2 Trebuchet MS Cyr;} - {\f611\fswiss\fcharset161\fprq2 Trebuchet MS Greek;}{\f612\fswiss\fcharset162\fprq2 Trebuchet MS Tur;}{\f615\fswiss\fcharset186\fprq2 Trebuchet MS Baltic;}{\f648\fswiss\fcharset238\fprq2 Microsoft Sans Serif CE;} - {\f649\fswiss\fcharset204\fprq2 Microsoft Sans Serif Cyr;}{\f651\fswiss\fcharset161\fprq2 Microsoft Sans Serif Greek;}{\f652\fswiss\fcharset162\fprq2 Microsoft Sans Serif Tur;}{\f653\fswiss\fcharset177\fprq2 Microsoft Sans Serif (Hebrew);} - {\f654\fswiss\fcharset178\fprq2 Microsoft Sans Serif (Arabic);}{\f655\fswiss\fcharset186\fprq2 Microsoft Sans Serif Baltic;}{\f656\fswiss\fcharset163\fprq2 Microsoft Sans Serif (Vietnamese);}{\f657\fswiss\fcharset222\fprq2 Microsoft Sans Serif (Thai);} - {\f658\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f659\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f661\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f662\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f665\fswiss\fcharset186\fprq2 Arial Narrow Baltic;} - {\f670\fswiss\fcharset0\fprq2 @Arial Unicode MS Western;}{\f668\fswiss\fcharset238\fprq2 @Arial Unicode MS CE;}{\f669\fswiss\fcharset204\fprq2 @Arial Unicode MS Cyr;}{\f671\fswiss\fcharset161\fprq2 @Arial Unicode MS Greek;} - {\f672\fswiss\fcharset162\fprq2 @Arial Unicode MS Tur;}{\f673\fswiss\fcharset177\fprq2 @Arial Unicode MS (Hebrew);}{\f674\fswiss\fcharset178\fprq2 @Arial Unicode MS (Arabic);}{\f675\fswiss\fcharset186\fprq2 @Arial Unicode MS Baltic;} - {\f676\fswiss\fcharset163\fprq2 @Arial Unicode MS (Vietnamese);}{\f677\fswiss\fcharset222\fprq2 @Arial Unicode MS (Thai);}{\f678\froman\fcharset238\fprq2 Book Antiqua CE;}{\f679\froman\fcharset204\fprq2 Book Antiqua Cyr;} - {\f681\froman\fcharset161\fprq2 Book Antiqua Greek;}{\f682\froman\fcharset162\fprq2 Book Antiqua Tur;}{\f685\froman\fcharset186\fprq2 Book Antiqua Baltic;}{\f688\froman\fcharset238\fprq2 Bookman Old Style CE;} - {\f689\froman\fcharset204\fprq2 Bookman Old Style Cyr;}{\f691\froman\fcharset161\fprq2 Bookman Old Style Greek;}{\f692\froman\fcharset162\fprq2 Bookman Old Style Tur;}{\f695\froman\fcharset186\fprq2 Bookman Old Style Baltic;} - {\f698\fswiss\fcharset238\fprq2 Century Gothic CE;}{\f699\fswiss\fcharset204\fprq2 Century Gothic Cyr;}{\f701\fswiss\fcharset161\fprq2 Century Gothic Greek;}{\f702\fswiss\fcharset162\fprq2 Century Gothic Tur;} - {\f705\fswiss\fcharset186\fprq2 Century Gothic Baltic;}{\f708\froman\fcharset238\fprq2 Garamond CE;}{\f709\froman\fcharset204\fprq2 Garamond Cyr;}{\f711\froman\fcharset161\fprq2 Garamond Greek;}{\f712\froman\fcharset162\fprq2 Garamond Tur;} - {\f715\froman\fcharset186\fprq2 Garamond Baltic;}{\f718\fswiss\fcharset238\fprq2 Haettenschweiler CE;}{\f719\fswiss\fcharset204\fprq2 Haettenschweiler Cyr;}{\f721\fswiss\fcharset161\fprq2 Haettenschweiler Greek;} - {\f722\fswiss\fcharset162\fprq2 Haettenschweiler Tur;}{\f725\fswiss\fcharset186\fprq2 Haettenschweiler Baltic;}{\f738\fscript\fcharset238\fprq2 Monotype Corsiva CE;}{\f739\fscript\fcharset204\fprq2 Monotype Corsiva Cyr;} - {\f741\fscript\fcharset161\fprq2 Monotype Corsiva Greek;}{\f742\fscript\fcharset162\fprq2 Monotype Corsiva Tur;}{\f745\fscript\fcharset186\fprq2 Monotype Corsiva Baltic;}{\f779\fswiss\fcharset204\fprq2 CA Chess Cyr;} - {\f782\fswiss\fcharset162\fprq2 CA Chess Tur;}{\f1268\fmodern\fcharset238\fprq1 HE_TERMINAL CE;}{\f1269\fmodern\fcharset204\fprq1 HE_TERMINAL Cyr;}{\f1271\fmodern\fcharset161\fprq1 HE_TERMINAL Greek;}{\f1272\fmodern\fcharset162\fprq1 HE_TERMINAL Tur;} - {\f1275\fmodern\fcharset186\fprq1 HE_TERMINAL Baltic;}{\f1291\fnil\fcharset161\fprq2 Sydnie Greek;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0; - \red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{ - \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0 - \nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext26 heading 1;}{\s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0 - \nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 2;}{\s3\ql \li120\ri0\sb120\sa60\sl-240\slmult0 - \nowidctlpar\faauto\outlinelevel2\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 3;}{\s4\ql \fi-245\li360\ri0\sb120\sa60\sl-240\slmult0 - \nowidctlpar\faauto\outlinelevel3\adjustright\rin0\lin360\itap0 \f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon2 \snext4 heading 4;}{\s5\ql \li120\ri0\sb80\sl-240\slmult0 - \keepn\nowidctlpar\faauto\outlinelevel4\adjustright\rin0\lin120\itap0 \f4\fs20\ul\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 5;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\* - \ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv - \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\*\cs15 \additive \f4\fs18\up6\lang1033\langfe0\langnp1033\langfenp0 - \sbasedon10 \ssemihidden footnote reference;}{\s16\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \ssemihidden footnote text;}{ - \s17\ql \li360\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 Normal Indent;}{\s18\ql \fi-240\li600\ri0\sb60\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin600\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext18 Jli;}{\s19\ql \li120\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin120\itap0 - \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext19 Ex;}{\s20\ql \li120\ri0\sb160\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext29 Sa1;}{ - \s21\ql \fi-240\li360\ri0\sl-240\slmult0\nowidctlpar\tx360\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext22 Lb1;}{\s22\ql \fi-240\li360\ri0\sb60\sl-240\slmult0\nowidctlpar - \tx360\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext22 Lb2;}{\s23\ql \li360\ri0\sb60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext22 Lp1;}{\s24\ql \fi-1800\li1920\ri0\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1920\faauto\adjustright\rin0\lin1920\itap0 - \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext25 Th;}{\s25\ql \fi-1800\li1920\ri0\sb60\sl-240\slmult0\nowidctlpar\tx1920\faauto\adjustright\rin0\lin1920\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext25 Tp;}{ - \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal 2;}{\s27\ql \li120\ri0\sb120\sa120\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 bitmap;}{\s28\ql \li120\ri0\sb120\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext29 Sa2;}{ - \s29\ql \fi-240\li360\ri0\sb60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext29 Jl;}{\s30\ql \li120\ri0\sa60\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext30 *body;}{\s31\ql \li120\ri0\sa60\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \b\f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext31 *heading;}{ - \s32\ql \li120\ri0\sa60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext32 para;}{ - \s33\ql \fi-280\li400\ri0\sa60\nowidctlpar\faauto\adjustright\rin0\lin400\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext33 jump;}{\s34\ql \fi-280\li400\ri0\sa60\nowidctlpar\tx400\faauto\adjustright\rin0\lin400\itap0 - \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext34 list bullet;}{\s35\ql \fi-280\li600\ri0\sa60\nowidctlpar\faauto\adjustright\rin0\lin600\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - \sbasedon30 \snext35 jump indent;}{\s36\ql \li120\ri0\sa60\sl-40\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \faauto\adjustright\rin0\lin120\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - \sbasedon30 \snext36 table rule;}{\s37\ql \fi-280\li400\ri0\sa60\nowidctlpar\tqr\tx280\tx400\faauto\adjustright\rin0\lin400\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext37 list number;}{ - \s38\ql \li120\ri0\sb100\sa60\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \b\f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon31 \snext33 see also;}{\s39\ql \li400\ri0\sa60\nowidctlpar\faauto\adjustright\rin0\lin400\itap0 - \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext39 para indent;}{\s40\ql \fi-1800\li1920\ri0\nowidctlpar\tx1920\faauto\adjustright\rin0\lin1920\itap0 \b\f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - \sbasedon31 \snext36 table head;}{\s41\ql \fi-1800\li1920\ri0\sa60\nowidctlpar\tx1920\faauto\adjustright\rin0\lin1920\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext41 table text;}{ - \s42\ql \li120\ri0\sb120\sa60\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f37\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext35 see also 2;}{\s43\ql \li120\ri0\sa60\keep\nowidctlpar - \tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin120\itap0 \f5\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon30 \snext43 code;}{\s44\ql \li0\ri0\sl-120\slmult0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 - \f38\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext32 *spacing;}{\s45\ql \li0\ri0\sl-120\slmult0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \f38\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon44 \snext45 s6;}{ - \s46\qj \li360\ri0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext46 Help Text;}{\s47\ql \li115\ri0\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw - \brdrs\brdrw15\brsp20 \faauto\adjustright\rin0\lin115\itap0 \f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon24 \snext25 Th2;}{\s48\ql \li115\ri0\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw - \brdrs\brdrw15\brsp20 \faauto\adjustright\rin0\lin115\itap0 \b\f36\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon24 \snext25 Th3;}{\s49\ql \li115\ri0\sb200\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin115\itap0 - \f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 Normal 3;}{\s50\ql \fi-1800\li1915\ri0\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 - \tx1915\faauto\adjustright\rin0\lin1915\itap0 \b\f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext51 Thh;}{\s51\ql \fi-1800\li1915\ri0\sb60\sl-240\slmult0\nowidctlpar\tx1915\faauto\adjustright\rin0\lin1915\itap0 - \f36\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext51 Tph;}{\s52\ql \li288\ri-432\sb80\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\faauto\adjustright\rin-432\lin288\itap0 - \f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext52 unixman1;}{\s53\ql \li1440\ri-432\sb80\sa240\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\faauto\adjustright\rin-432\lin1440\itap0 - \f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext53 unixman2;}{\s54\ql \li115\ri-432\sb80\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\faauto\adjustright\rin-432\lin115\itap0 - \f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon52 \snext54 unixman0;}{\s55\ql \li288\ri-432\sb80\sa240\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\faauto\adjustright\rin-432\lin288\itap0 - \f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon52 \snext55 unixman1a;}{\s56\ql \li115\ri0\sa60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin115\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - \sbasedon2 \snext56 heading 2a;}{\s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext57 \ssemihidden endnote text;}{\*\cs58 \additive \super - \sbasedon10 \ssemihidden endnote reference;}{\*\cs59 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\*\cs60 \additive \ul\cf12 \sbasedon10 FollowedHyperlink;}{\s61\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \cbpat9 - \f35\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext61 \ssemihidden Document Map;}{\s62\ql \li480\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin480\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - \sbasedon0 \snext62 Body Text 2;}{\s63\ql \fi-720\li1440\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin1440\itap0 \f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext63 Body Text Indent 2;}{ - \s64\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\tqc\tx4320\tqr\tx8640\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext64 header;}{\s65\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar - \tqc\tx4320\tqr\tx8640\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext65 footer;}}{\*\listtable{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid74976790}{\list\listtemplateid1194359366\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0 - \leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li840\jclisttab\tx840\lin840 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360 - \levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext - \leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619 - \'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;} - \f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160 - \jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel - \levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid127211164} - {\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid349260549} - {\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname - ;}\listid470094698}{\list\listtemplateid1071169284\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace480\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;} - \loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li960\jclisttab\tx960\lin960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 - \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280 - \jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid549345042}{\list\listtemplateid-1293263420\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat0\levelspace480\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li960\jclisttab\tx960\lin960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617 - \'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;} - \f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440 - \jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid582227701}{\list\listtemplateid67698703 - \listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid640160996}{\list\listtemplateid663130248 - \listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li840\jclisttab\tx840\lin840 }{\listlevel\levelnfc23 - \levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0 - {\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621 - \'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers - ;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880 - \jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 } - {\listname ;}\listid661159799}{\list\listtemplateid925396262\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace480\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;} - \loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li1320\jclisttab\tx1320\lin1320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 - \fi-360\li1920\jclisttab\tx1920\lin1920 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2640 - \jclisttab\tx2640\lin2640 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3360\jclisttab\tx3360\lin3360 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li4080\jclisttab\tx4080\lin4080 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4800\jclisttab\tx4800\lin4800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5520\jclisttab\tx5520\lin5520 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li6240\jclisttab\tx6240\lin6240 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6960\jclisttab\tx6960\lin6960 }{\listname ;}\listid726879981}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid768165129}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid781152802}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid903878531}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1002394966}{\list\listtemplateid966323306\listhybrid{\listlevel\levelnfc0\levelnfcn0 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567631\'02\'00.;}{\levelnumbers\'01;}\fbias0 \fi-360\li960\jclisttab\tx960\lin960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480 - \levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619 - \'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;} - \f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160 - \jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel - \levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid1012344447} - {\list\listtemplateid-740231724\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li840 - \jclisttab\tx840\lin840 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel - \levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 - {\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext - \leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619 - \'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;} - \f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1016536351}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext - \'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1021513731}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext - \'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1099714113}{\list\listtemplateid1792708928\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace480\levelindent0 - {\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li960\jclisttab\tx960\lin960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621 - \'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li1680\jclisttab\tx1680\lin1680 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers - ;}\f3\fbias0 \fi-360\li2400\jclisttab\tx2400\lin2400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3120 - \jclisttab\tx3120\lin3120 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li3840\jclisttab\tx3840\lin3840 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4560\jclisttab\tx4560\lin4560 }{\listlevel\levelnfc23 - \levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5280\jclisttab\tx5280\lin5280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6000\jclisttab\tx6000\lin6000 }{\listname ;}\listid1186401388}{\list\listtemplateid1017133748\listhybrid - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 - \levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext - \leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621 - \'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;} - \f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760 - \jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 } - {\listname ;}\listid1218279756}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 } - {\listname ;}\listid1240552867}{\list\listtemplateid-1468488322\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;} - \loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li840\jclisttab\tx840\lin840 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 - \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280 - \jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace0\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext - \leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid1315254643}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1332292840}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 - \levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1358388700}{\list\listtemplateid-1329583724\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li840\jclisttab\tx840\lin840 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext - \leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617 - \'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;} - \f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440 - \jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 } - {\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid1379353406}{\list\listtemplateid67698689 - \listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid1405952460} - {\list\listtemplateid53755796\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace480\levelindent0{\leveltext\leveltemplateid278924574\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li960 - \jclisttab\tx960\lin960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1560\jclisttab\tx1560\lin1560 }{\listlevel - \levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2280\jclisttab\tx2280\lin2280 }{\listlevel\levelnfc23\levelnfcn23 - \leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3000\jclisttab\tx3000\lin3000 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 - \levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3720\jclisttab\tx3720\lin3720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace480\levelindent0{\leveltext\leveltemplateid67567621\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4440\jclisttab\tx4440\lin4440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0 - {\leveltext\leveltemplateid67567617\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5160\jclisttab\tx5160\lin5160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext - \leveltemplateid67567619\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5880\jclisttab\tx5880\lin5880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace480\levelindent0{\leveltext\leveltemplateid67567621 - \'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6600\jclisttab\tx6600\lin6600 }{\listname ;}\listid1410883026}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 - \levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid2025940873}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 - \levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listname ;}\listid2044863907}}{\*\listoverridetable{\listoverride\listid2025940873\listoverridecount0\ls1}{\listoverride\listid1002394966 - \listoverridecount0\ls2}{\listoverride\listid470094698\listoverridecount0\ls3}{\listoverride\listid1099714113\listoverridecount0\ls4}{\listoverride\listid1358388700\listoverridecount0\ls5}{\listoverride\listid2044863907\listoverridecount0\ls6} - {\listoverride\listid640160996\listoverridecount0\ls7}{\listoverride\listid768165129\listoverridecount0\ls8}{\listoverride\listid903878531\listoverridecount0\ls9}{\listoverride\listid781152802\listoverridecount0\ls10}{\listoverride\listid1240552867 - \listoverridecount0\ls11}{\listoverride\listid640160996\listoverridecount0\ls12}{\listoverride\listid349260549\listoverridecount0\ls13}{\listoverride\listid1021513731\listoverridecount0\ls14}{\listoverride\listid1405952460\listoverridecount0\ls15} - {\listoverride\listid1332292840\listoverridecount0\ls16}{\listoverride\listid1379353406\listoverridecount0\ls17}{\listoverride\listid127211164\listoverridecount0\ls18}{\listoverride\listid1218279756\listoverridecount0\ls19}{\listoverride\listid1315254643 - \listoverridecount0\ls20}{\listoverride\listid1016536351\listoverridecount0\ls21}{\listoverride\listid726879981\listoverridecount0\ls22}{\listoverride\listid1410883026\listoverridecount0\ls23}{\listoverride\listid1186401388\listoverridecount0\ls24} - {\listoverride\listid582227701\listoverridecount0\ls25}{\listoverride\listid1012344447\listoverridecount0\ls26}{\listoverride\listid549345042\listoverridecount0\ls27}{\listoverride\listid661159799\listoverridecount0\ls28}}{\*\revtbl {Unknown;}{Tim Mann;}}{\*\rsidtbl \rsid554055 - \rsid1917627\rsid1970434\rsid2034212\rsid2905661\rsid5181777\rsid5509124\rsid6300227\rsid8148268\rsid8617368\rsid9591700\rsid10710588\rsid13306221\rsid13566167\rsid14960742\rsid15335631\rsid15476870\rsid15672773\rsid15759832\rsid16412848} - {\*\generator Microsoft Word 10.0.5522;}{\info{\title + $ # KWinBoard: Chessboard for Windows}{\author TRIO}{\operator mioli}{\creatim\yr2003\mo10\dy25\hr23\min40}{\revtim\yr2004\mo6\dy30\hr14\min9}{\printim\yr1997\mo4\dy22\hr23\min5}{\version17} - {\edmins21}{\nofpages58}{\nofwords13377}{\nofchars76254}{\*\company DEC SRC}{\nofcharsws89453}{\vern16495}}\margl1417\margr1417\margt1417\margb1134 - \widowctrl\endnotes\aendnotes\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind4\viewscale100\nolnhtadjtbl\rsidroot2905661 \fet1 - {\*\aftnsep \pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid15759832 \chftnsep - \par }}\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4 - \pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (} - {\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0 - \nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\fs20\super\insrsid1970434 +{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Contents}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Contents}}K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Contents}}}{\i\f1\fs32\insrsid1970434 WinBoard}{\f1\fs32\insrsid1970434 - : Chessboard for Windows - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Description}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Description}}}{\f1\insrsid1970434 Description - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\i\f1\insrsid1970434 WinBoard}{\f1\insrsid1970434 - is a graphical user interface for chess. It displays a chessboard on the screen, accepts moves made with the mouse, and loads and saves game files in standard chess notation. WinBoard serves as a front-end for many different services, including: - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls3\adjustright\rin0\lin480\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\i\f1\insrsid1970434 Chess engines}{\f1\insrsid1970434 - that run on your PC. You can play a game against an engine, set up arbitrary positions, force variations, or watch a game between two engines. }{\i\f1\insrsid1970434 GNU Chess}{\f1\insrsid1970434 - is supplied with WinBoard, and over 100 other free chess engines are available separately. Of these, Crafty is the most popular. See }{\f1\uldb\insrsid1970434 Installing Chess Engines}{\v\f1\insrsid1970434 InstallingChessEngines}{\f1\insrsid1970434 - for instructions on installing additional chess engines. - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls3\adjustright\rin0\lin480\itap0 {\b\i\f1\insrsid1970434 Chess servers}{\b\f1\insrsid1970434 }{\f1\insrsid1970434 on the Internet. You can play against other - Internet Chess Server (ICS) users, observe games they are playing, review games in the ICS libraries, chat, }{\f1\insrsid2905661 analyze observe games with a }{\f1\insrsid15672773 chess program}{\f1\insrsid2905661 , }{\f1\insrsid1970434 - and more. WinBoard can also be used to run an automated computer player on the ICS, but this feature is for advanced users only and is subject to some caveats; see the separate file zippy.README for information. - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls3\adjustright\rin0\lin480\itap0 {\b\i\f1\insrsid1970434 The Web}{\f1\insrsid1970434 and your own saved games. You can use WinBoard as a helper application to view files in your Web browser or the Explorer. You can use it - to keep track of email postal games, browse games off the net, or review games you have saved. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 Getting Started}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 GettingStarted}}}{\f1\insrsid1970434 Getting Started - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - WinBoard starts up in one of three major modes: chess engine mode, ICS client mode, or game viewer mode. Yo - u cannot change modes while WinBoard is running, but you can access all the game viewer features directly from the other two modes. Also, you can start WinBoard several times to get multiple chessboard windows running in any combination of modes. - \par }\pard\plain \s20\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 You will - usually run WinBoard by choosing an item from the Windows Start menu that runs it in the mode you want. If you just double-click on WinBoard.exe, you get a startup dialog asking which mode you want. If you choose chess engine mode, you can then select fro - m the installed engines; if you choose ICS client mode, you can then select from a list of known chess servers. More advanced users can }{\uldb\insrsid1970434 customize}{\v\insrsid1970434 icsNames}{\insrsid1970434 these lists or type in WinBoard }{ - \uldb\insrsid1970434 command line options}{\v\insrsid1970434 Options}{\insrsid1970434 directly. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 After starting WinBoard, you can make }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 move}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 move}}}{ - \f1\insrsid1970434 moves in several different ways. To move by dragging, press the left mouse button while the cursor is on one of your pieces, move the cursor to another square, and release the button. You can also move by clicking the left mouse button - once (press and release) over one of your pieces, moving the cursor to another square, and clicking again. You drop new pieces on the board (when applicable) by selecting from a context menu. Press the right mouse button over a square to bring up the men - u - ; no menu will come up in modes where dropping a new piece is not permitted. You can also make moves by typing them in standard algebraic chess notation. Either a dialog box will pop up for you to type into, or in ICS mode, your typing will be redirected - into the ICS interaction window. - \par When WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 is iconized, its }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 icon}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 icon}}}{\f1\insrsid1970434 icon is a white knight if it is White's turn to move, a black knight if it is Black's turn. - \par }{\f1\insrsid2905661 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0\pararsid2905661 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid2905661 K{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid2905661 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 Getting Started}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid2905661 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 - GettingStarted}}}{\insrsid2905661 Internet Chess Server}{\insrsid15476870 : }{\insrsid2905661 Analyze observe}{\insrsid15672773 d}{\insrsid2905661 games}{\insrsid1970434 with a chess}{\insrsid15672773 engine.}{\insrsid2905661 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid15335631 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid8148268 WinB}{\f1\insrsid1970434\charrsid1970434 oard support}{ - \f1\insrsid15759832 s}{\f1\insrsid1970434\charrsid1970434 ana}{\f1\insrsid1970434 lyz}{\f1\insrsid15759832 ing}{\f1\insrsid1970434 a}{\f1\insrsid15759832 n}{\f1\insrsid1970434 ob}{\f1\insrsid8617368 serve}{\f1\insrsid15759832 d}{\f1\insrsid8617368 - game }{\f1\insrsid15759832 using}{\f1\insrsid8617368 a chess}{\f1\insrsid15759832 engine, such as Crafty}{\f1\insrsid8617368 .}{\f1\insrsid10710588 At the moment there are some}{\f1\insrsid8617368 limitations }{\f1\insrsid15759832 of }{ - \f1\insrsid8617368 this function:}{\f1\insrsid15335631 - \par {\listtext\pard\plain\f3\fs20\insrsid8617368 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li840\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx840\faauto\ls28\adjustright\rin0\lin840\itap0\pararsid554055 {\f1\insrsid8617368 - You can only analyze one game at }{\f1\insrsid15759832 a}{\f1\insrsid8617368 time. - \par {\listtext\pard\plain\f3\fs20\insrsid15476870 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li840\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx840\faauto\ls28\adjustright\rin0\lin840\itap0\pararsid15335631 {\f1\insrsid15476870 Y}{ - \f1\insrsid8617368 ou must activate the analy}{\f1\insrsid15759832 sis mode}{\f1\insrsid15672773 for each new}{\f1\insrsid8617368 game. - \par {\listtext\pard\plain\f3\fs20\insrsid8617368 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li840\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx840\faauto\ls28\adjustright\rin0\lin840\itap0\pararsid6300227 {\f1\insrsid8617368 - You can only analyze observe}{\f1\insrsid15759832 d}{\f1\insrsid8617368 games. - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid554055 {\f1\insrsid6300227 - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid15476870 {\b\f1\insrsid9591700 To use this function }{\b\f1\insrsid15476870 you need a }{\b\f1\insrsid8148268 chess}{\b\f1\insrsid15759832 engine}{ - \b\f1\insrsid8148268 that support}{\b\f1\insrsid15759832 s}{\b\f1\insrsid8148268 }{\b\f1\insrsid15759832 the }{\b\f1\insrsid8148268 WinB}{\b\f1\insrsid15759832 oard protocol.}{\b\f1\insrsid15476870 - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid8148268 {\b\f1\insrsid15476870 You mus}{\b\f1\insrsid5181777 t start the}{\b\f1\insrsid15476870 }{\b\f1\insrsid15672773 WinBoard }{\b\f1\insrsid15476870 - with }{\b\f1\insrsid2034212 the }{\b\f1\insrsid15476870 Zippy}{\b\f1\insrsid2034212 option}{\b\f1\insrsid15672773 (/zp)}{\f1\insrsid15476870\charrsid6300227 . Please read}{\f1\insrsid8148268\charrsid6300227 zippy.Readme for more}{\b\f1\insrsid8148268 - }{\f1\insrsid8148268\charrsid6300227 details and take a look to}{\b\f1\insrsid8148268 }{\f1\uldb\insrsid8148268 Installing Chess Engines}{\v\f1\insrsid8148268 InstallingChessEngines}{\f1\insrsid8148268 for more instructions.}{\f1\insrsid2034212 - - \par }{\f1\insrsid5181777 - \par }{\i\f1\insrsid5181777\charrsid1917627 Quick syntax example to start WinBoard with a chess}{\i\f1\insrsid14960742 engine}{\i\f1\insrsid5181777\charrsid1917627 : - \par Winboard.exe /zp /fcp /fd /ics /ics - host - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid1917627 {\v\f1\insrsid8148268 InstallingChessEngines}{\b\f1\insrsid8148268\charrsid1917627 - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0\pararsid8148268 {\insrsid15672773 After logging in to}{\insrsid1970434 a}{\insrsid15672773 n}{\insrsid1970434 Internet Chess Server}{\insrsid8617368 (ICS) you }{ - \insrsid15672773 must first}{\insrsid8617368 }{\insrsid15759832 choose}{\insrsid8617368 }{\insrsid15759832 a game to}{\insrsid8617368 observe}{\insrsid15672773 .}{\insrsid8617368\charrsid15476870 }{\insrsid15672773 Then you can}{ - \insrsid8617368\charrsid15476870 enable }{\insrsid15672773 \'93Analysis Mode\'94 }{\insrsid15476870 under \'93Mode Menu\'94. }{\insrsid15672773 To disable the analysis}{\insrsid8148268 just }{\insrsid15672773 c}{\insrsid8148268 lick this mode again.}{ - \insrsid13306221 - \par }\pard \ql \li0\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0\pararsid8148268 {\insrsid2905661\charrsid2905661 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Additional Information - \par }\pard\plain \s29\ql \fi-240\li360\ri0\sb60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\uldb\insrsid1970434 Menus}{\v\f1\uldb\insrsid1970434 Menus}{ - \f1\uldb\insrsid1970434 - \par Shortcut Buttons}{\v\f1\uldb\insrsid1970434 Buttons}{\f1\uldb\insrsid1970434 - \par Command Line Options}{\v\f1\insrsid1970434 Options}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Initialization Files}{\v\f1\uldb\insrsid1970434 Files}{\f1\uldb\insrsid1970434 - \par Installing Chess Engines}{\v\f1\uldb\insrsid1970434 InstallingChessEngines}{\f1\uldb\insrsid1970434 - \par Firewalls}{\v\f1\insrsid1970434 Firewalls}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Limitations}{\v\f1\insrsid1970434 Limitations}{\f1\uldb\insrsid1970434 - \par Authors}{\v\f1\insrsid1970434 Authors}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Copyright}{\v\f1\insrsid1970434 Copyright}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Frequently Asked Questions}{\v\f1\insrsid1970434 !ExecFile(FAQ.html)}{\f1\insrsid1970434 - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Menus}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Menus}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Menus}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 MENUS - \par }\pard\plain \s29\ql \fi-240\li360\ri0\sb60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\uldb\insrsid1970434 File Menu}{\v\f1\insrsid1970434 FileMenu}{\f1\insrsid1970434 - - \par }{\f1\uldb\insrsid1970434 Mode Menu}{\v\f1\insrsid1970434 ModeMenu}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Action Menu}{\v\f1\insrsid1970434 ActionMenu}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Step Menu}{\v\f1\insrsid1970434 StepMenu}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Options Menu}{\v\f1\insrsid1970434 OptionsMenu}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Help Menu}{\v\f1\insrsid1970434 HelpMenu}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 ICS Interaction Context Menu}{\v\f1\insrsid1970434 ICSInteractionContextMenu}{\f1\insrsid1970434 - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 File Menu}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 FileMenu}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 File Menu}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 File Menu - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Reset}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Reset}}}{\f1\insrsid1970434 Reset - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Resets WinBoard and the chess engine (if any) to the beginning of a new chess game. In Internet Chess Server mode, clears the current state of WinBoard, then resynchronizes with ICS by sending a }{\b\f1\insrsid1970434 refresh }{\f1\insrsid1970434 - command. If you want to stop playing, observing, or examining a game on ICS, use an appropriate command from the }{\f1\uldb\insrsid1970434 Action}{\v\f1\insrsid1970434 ActionMenu}{\f1\insrsid1970434 menu, not Reset. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadGame}}}{\f1\insrsid1970434 Load Game - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Plays a game from a record file. A popup dialog prompts you for the filename. If the file contains more than one game, a second popup dialog displays a list of games (with information drawn from their PGN tags, if any), and you can select the one you want - . - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The game file parser will accept PGN (portable game notation), or in fact almost any file that contains moves in algebraic notation. Notation of the form }{\i\f1\insrsid1970434 P@f7}{\f1\insrsid1970434 - is accepted for piece-drops in bughouse games; this is a nonstandard extension to PGN. If the fi - le includes a PGN position (FEN tag), or a WinBoard position diagram bracketed by "[--" and "--]" before the first move, the game starts from that position. Text enclosed in parentheses, square brackets, or curly braces is assumed to be commentary and is - displayed in a pop-up window. Any other text in the file is ignored. PGN variations (enclosed in parentheses) are treated as comments; WinBoard is not able to walk variation trees. The nonstandard PGN tag }{\f2\insrsid1970434 [Variant "varname"]}{ - \f1\insrsid1970434 functions similarly to the }{\f1\uldb\insrsid1970434 variant}{\f1\uldb\insrsid15672773 }{\v\f1\insrsid1970434 variant }{\f1\insrsid1970434 - command-line option, allowing games in certain chess variants to be loaded. There is also a heuristic to recognize chess variants from the }{\f2\insrsid1970434 Event}{\f1\insrsid1970434 - tag, by looking for the strings that the Internet Chess Servers put there when saving variant ("wild") games. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Next Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadNextGame}}}{\f1\insrsid1970434 Load Next Game - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Loads the next game from the last game record file you loaded. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Previous Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadPreviousGame}}}{\f1\insrsid1970434 - Load Previous Game - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Loads the previous game from the last game record file you loaded. Not - available if the last game was loaded from a pipe. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Reload Same Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ReloadSameGame}}}{\f1\insrsid1970434 - Reload Same Game - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Reloads the last game you loaded. Not available if the last game was loaded from a pipe. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Save Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SaveGame}}}{\f1\insrsid1970434 Save Game - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Appends a record of the current game to a file. A popup dialog prompts you for the filename. If the game did not begin with the standard starting position, the game file includes the starting position used. Game files are saved in the PGN (portable game n - otation) format, unless the }{\f1\uldb\insrsid1970434 oldSaveStyle}{\v\f1\insrsid1970434 oldSaveStyle}{\f1\insrsid1970434 option is True, in which case they are saved in an older format that is specific to WinBoard}{\i\f1\insrsid1970434 .}{ - \f1\insrsid1970434 Both formats are human-readable, and both can be read back by the Load Game command. Notation of the form }{\i\f1\insrsid1970434 P@f7}{\f1\insrsid1970434 - is generated for piece-drops in bughouse games; this is a nonstandard extension to PGN. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Copy Game To Clipboard}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 CopyGameToClipboard}}}{ - \f1\insrsid1970434 Copy Game To Clipboard - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 - Copies the record of the current game to the Windows clipboard in PGN (portable game notation) format. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Paste Game From Clipboard}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PasteGameFromClipboard}}}{ - \f1\insrsid1970434 Paste Game From Clipboard - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 Plays a game from the Windows clipboard.}{\f1\insrsid1970434 See }{ - \f1\uldb\insrsid1970434 Load Game}{\v\f1\insrsid1970434 LoadGame}{\f1\insrsid1970434 for a discussion of game file format and parser behavior.}{\insrsid1970434 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Position}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadPosition}}}{\f1\insrsid1970434 Load Position - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Sets up a position from a position file. A popup dialog prompts you for the filename. Position files must be in FEN (Forsythe-Edwards notation), or in the format that the }{\f1\uldb\insrsid1970434 Save Position}{\f1\insrsid1970434 command writes when }{ - \f1\uldb\insrsid1970434 oldSaveStyle}{\v\f1\insrsid1970434 oldSaveStyle}{\f1\insrsid1970434 is turned on. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Next Position}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadNextPosition}}}{\f1\insrsid1970434 - Load Next Position - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Loads the next position from the last position file you loaded. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Previous Position}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadPreviousPosition}}}{ - \f1\insrsid1970434 Load Previous Position - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Loads the previous position from the last position file you - loaded. Not available if the last position was loaded from a pipe. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Reload Same Position}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ReloadSamePosition}}}{ - \f1\insrsid1970434 Reload Same Position - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Reloads the last position you loaded. Not available if the last position was loaded from a pipe. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Save Position}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SavePosition}}}{\f1\insrsid1970434 Save Position - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Appends a diagram of the current position to a file. A popup dialog prompts you for the filename. Positions are saved in FEN (Forsythe-Edwards notation) format, unless the }{\f1\uldb\insrsid1970434 oldSaveStyle}{\v\f1\insrsid1970434 oldSaveStyle}{ - \f1\insrsid1970434 option is True, in which case they are saved in an older, human-readable format that is specific to WinBoard}{\i\f1\insrsid1970434 .}{\f1\insrsid1970434 - Both formats can be read back by the Load Position command; however, currently Load Position can load only the first position in a file. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Copy Position Clipboard}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 CopyPositionToClipboard}}}{ - \f1\insrsid1970434 Copy Position To Clipboard - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Places a diagram of the current position (in Forsythe-Edwards notation) into the Windows clipboard. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Paste Position Clipboard}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PastePositionFromClipboard}}}{ - \f1\insrsid1970434 Paste Position From Clipboard - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets up a position from - the Windows clipboard. Position must be in FEN (Forsythe-Edwards notation). Puts WinBoard into }{\f1\uldb\insrsid1970434 Edit Game}{\v\f1\insrsid1970434 EditGame}{\f1\insrsid1970434 mode if it was not there already. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Exit}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 Exit}}}{\f1\insrsid1970434 Exit - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Exits from WinBoard. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 Mode Menu}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 ModeMenu}}${\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 $}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 Mode Menu}}+{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{\f1\fs20\insrsid1970434 Mode Menu - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Machine White}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 MachineWhite}}}{\f1\insrsid1970434 Machine White - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Forces the chess engine to play white. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Machine Black}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 MachineBlack}}}{\f1\insrsid1970434 Machine Black - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Forces the chess engine to play black. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Two Machines}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 TwoMachines}}}{\f1\insrsid1970434 Two Machines - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Starts a game between two chess engines. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Analysis Mode}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AnalysisMode}}}{\f1\insrsid1970434 Analysis Mode - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - In this mode, you can make moves for both sides on the board. After each move, the chess engine will think about possible replies and display its analysis in a separate window. This feature currently works only if Crafty is the chess engine. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Analyze File}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AnalyzeFile}}}{\f1\insrsid1970434 Analyze File - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - In this mode, you can load a game from a file, and the chess engine will analyze each move as in Analysis Mode. This feature currently works only if Crafty is the chess engine. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 ICS Client}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ICSClient}}}{\f1\insrsid1970434 ICS Client - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - This is the normal mode when WinBoard is connected to a chess server. If you have moved into Edit Game or Edit Position mode, you can select this option to get out. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - When you run WinBoard in ICS mode, it starts up a console window in which you can type comm - ands and receive text responses from the chess server. You can use the standard Windows editing keys to edit your command line before pressing Enter. The console window keeps a history of the last few commands you typed. Press the up-arrow key to go back - to a previous command; press the down-arrow key to go forward again to a later command. Press the right mouse button in the output area for a }{\f1\uldb\insrsid1970434 context menu}{\v\f1\insrsid1970434 ICSInteractionContextMenu}{\f1\insrsid1970434 - of editing commands and ICS command shortcuts. - \par Some useful ICS commands include }{\b\f1\insrsid1970434 who}{\f1\insrsid1970434 to see who is logged on, }{\b\f1\insrsid1970434 games}{\f1\insrsid1970434 to see what games are being played, }{\b\f1\insrsid1970434 match}{\f1\insrsid1970434 - to challenge another player to a game, }{\b\f1\insrsid1970434 observe}{\f1\insrsid1970434 to observe an ongoing game, }{\b\f1\insrsid1970434 examine}{\f1\insrsid1970434 or }{\b\f1\insrsid1970434 smoves}{\f1\insrsid1970434 - to review a recently completed game, and of course }{\b\f1\insrsid1970434 help}{\f1\insrsid1970434 . - \par Whenever you ask to observe an ongoing game, review a completed game, or resume an adjourned game, WinBoard retrieves and parses the list of past moves from the ICS, so you can review them with }{\f1\uldb\insrsid1970434 Forward}{\v\f1\insrsid1970434 - Forward}{\f1\insrsid1970434 and }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{\f1\insrsid1970434 or save them with }{\f1\uldb\insrsid1970434 Save Game}{\v\f1\insrsid1970434 SaveGame}{\f1\insrsid1970434 . - \par Some special ICS Client features are activated when you are in }{\b\f1\insrsid1970434 examine}{\f1\insrsid1970434 or }{\b\f1\insrsid1970434 bsetup }{\f1\insrsid1970434 mode on ICS. See the descriptions of the menu commands }{\f1\uldb\insrsid1970434 - Forward}{\v\f1\insrsid1970434 Forward}{\f1\insrsid1970434 , }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{\f1\insrsid1970434 , }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{\f1\insrsid1970434 , and }{ - \f1\uldb\insrsid1970434 Stop Examining}{\v\f1\insrsid1970434 StopExamining}{\f1\insrsid1970434 below. You can also issue the ICS position-editing comma - nds with the mouse. Move pieces by dragging with the left mouse button, or by left-clicking once on the starting square and once on the ending square. Press the right mouse button over a square for a context menu that lets you drop a new piece, empty the - s - quare, or clear the board. Click on the White or Black clock to set the side to play. You cannot set the side to play or drag pieces to arbitrary squares while examining on ICC, but you can do so in bsetup mode on FICS. You can also make moves by typing t - hem into the ICS window; you may have to do this occasionally if you are playing a chess variant whose rules WinBoard does not understand, such as Fischer Random. - \par If you are playing a bughouse game on the ICS, a list of the offboard pieces that each player - holds is shown in the window title bar. To drop an offboard piece, press the right mouse button over an empty square to bring up a context menu. To observe your partner's games, start a second copy of WinBoard, log in as a guest, and use the ICS }{ - \b\f1\insrsid1970434 follow}{\f1\insrsid1970434 or }{\b\f1\insrsid1970434 pfollow}{\f1\insrsid1970434 command in the new window. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Edit Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 EditGame}}}{\f1\insrsid1970434 Edit Game - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Allows you to make moves for both Black and White, and to change moves after backing up with the }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{\f1\insrsid1970434 command. The clocks do not run. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - In chess engine mode, the chess engine continues to check moves for legality but does not participate in the game. You can bring the chess engine back into the game by selecting }{\f1\uldb\insrsid1970434 Machine White}{\v\f1\insrsid1970434 MachineWhite}{ - \f1\insrsid1970434 , }{\f1\uldb\insrsid1970434 Machine Black}{\v\f1\insrsid1970434 MachineBlack}{\f1\insrsid1970434 , or }{\f1\uldb\insrsid1970434 Two Machines}{\v\f1\insrsid1970434 TwoMachines}{\f1\insrsid1970434 . - \par In ICS mode, the moves are not sent to the ICS: Edit Game takes WinBoard out of ICS Client mode and lets you edit games locally. If you want to edit a game on ICS in a way that other ICS users can see, use the ICS }{\b\f1\insrsid1970434 examine}{ - \f1\insrsid1970434 command or start an ICS match against yourself. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Edit Position}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 EditPosition}}}{\f1\insrsid1970434 Edit Position - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Lets you set up an arbitrary board position. Use the left mouse button to drag pieces to new squares, or to delete a piece by dragging it off the board or dragging an empty square on top of - it. To drop a new piece on a square, press the right mouse button over the square. This brings up a menu of pieces. Additional menu choices let you empty the square or clear the board. You can set the side to play next by clicking on the White or Black in - dicator at the top of the screen. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Selecting Edit Position causes WinBoard}{\i\f1\insrsid1970434 }{ - \f1\insrsid1970434 to discard all remembered moves in the current game. - \par In ICS mode, change made to the position by Edit Position are not sent to the ICS: Edit Position takes WinBoard out of ICS Client - mode and lets you edit positions locally. If you want to edit positions on ICS in a way that other ICS users can see, use the ICS }{\b\f1\insrsid1970434 examine}{\f1\insrsid1970434 command, or start an ICS match against yourself. (See also }{ - \f1\uldb\insrsid1970434 ICS Client}{\v\f1\insrsid1970434 ICSClient}{\f1\insrsid1970434 above.) - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Training}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Training}}}{\f1\insrsid1970434 Training - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 - Training mode lets you interactively guess the moves of a game for one of the players. While in Training mode, the navigation buttons are disabled. You guess the next move of the game by playing the move on the board (or using the }{\uldb\insrsid1970434 - Type In Move}{\v\uldb\insrsid1970434 TypeInMove}{\insrsid1970434 command). If the move played matches the next move of the game, the move is accepted and the opponent\rquote - s response is autoplayed. If the move played is incorrect, an error message is displayed. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Show Game List}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ShowGameList}}}{\f1\insrsid1970434 Show Game List - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Shows or hides the list of games generated by the last }{ - \f1\uldb\insrsid1970434 Load Game}{\v\f1\insrsid1970434 LoadGame}{\f1\insrsid1970434 command. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Edit Tags}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 EditTags}}}{\f1\insrsid1970434 Edit Tags - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Lets you edit the PGN (portable game notation) tags for the current game. After editing, the tags must still conform to the PGN tag syntax: - \par }\pard\plain \s43\ql \li520\ri0\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\insrsid1970434 \line ::= - \line \line ::= [ ]\line ::= \line ::= - \par }\pard\plain \s20\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 See the PGN Standard for full details. Here is an example: - \par }\pard\plain \s43\ql \li520\ri0\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\insrsid1970434 \line [Event "Portoroz Interzonal"]\line - [Site "Portoroz, Yugoslavia"]\line [Date "1958.08.16"]\line [Round "8"]\line [White "Robert J. Fischer"]\line [Black "Bent Larsen"]\line [Result "1-0"] - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Any characters that do not match this syntax are silently ignored. Note that the PGN standard requires all games to have at least the seven tags shown above. Any that you omit will be filled in by WinBoard with }{\f2\insrsid1970434 "?"}{ - \f1\insrsid1970434 (unknown value) or }{\f2\insrsid1970434 "-"}{\f1\insrsid1970434 (inapplicable value). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Edit Comment}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 EditComment}}}{\f1\insrsid1970434 Edit Comment - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Adds or modifies a comment on the current position. Comments are saved by }{ - \f1\uldb\insrsid1970434 Save Game}{\v\f1\insrsid1970434 SaveGame}{\f1\insrsid1970434 and are displayed by }{\f1\uldb\insrsid1970434 Load Game}{\v\f1\insrsid1970434 LoadGame}{\f1\insrsid1970434 , }{\f1\uldb\insrsid1970434 Forward}{\v\f1\insrsid1970434 - Forward}{\f1\insrsid1970434 , and }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{\f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Pause}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Pause}}}{\f1\insrsid1970434 Pause - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Pauses updates to the board, and if you are playing against a local chess engine, also pauses your clock. To continue, select Pause again, and the display will automatically update to the latest position. The }{\b\f1\insrsid1970434 P}{\f1\insrsid1970434 - (or }{\b\f1\insrsid1970434 C}{\f1\insrsid1970434 ) button is equivalent to selecting Pause. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If you select Pause when you are playing{\*\bkmkstart WHATSelSavT} - {\*\bkmkend WHATSelSavT} {\*\bkmkstart fWHATtopic}against{\*\bkmkend fWHATtopic} a chess engine and it is not your move, the chess engine\rquote - s clock will continue to run and it will eventually make a move, at which point both clocks will stop. Since board updates are paused, however, you will not see the move until you exit from Pause mode (or select }{\f1\uldb\insrsid1970434 Forward}{ - \v\f1\insrsid1970434 Forward}{\f1\insrsid1970434 ). This behavior is meant to simulate adjournment with a sealed move. - \par If you select Pause while you are in }{\b\f1\insrsid1970434 examine}{\f1\insrsid1970434 mode on ICS, you can step backward and forward in the current history of the examined game without affecting the other examiners or observers. Select Pa - use again to reconnect yourself to the current state of the game on ICS. - \par If you select Pause while you are loading a game, the game stops loading. You can load more moves one at a time by selecting }{\f1\uldb\insrsid1970434 Forward}{\v\f1\insrsid1970434 Forward}{\f1\insrsid1970434 , or resume automatic loading by selecting P - ause again. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Action Menu}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ActionMenu}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Action Menu}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 Action Menu - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Most of these commands are available in chess server mode only. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Accept}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Accept}}}{\f1\insrsid1970434 Accept - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Accepts a pending match offer. If there is more than one offer pending, you will have to type in a more specific command instead of using this menu choice. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Decline}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Decline}}}{\f1\insrsid1970434 Decline - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Declines a pending offer (match, draw, etc.). If there is more than o - ne offer pending, you will have to type in a more specific command instead of using this menu choice. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Rematch}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Rematch}}}{\f1\insrsid1970434 Rematch - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Issues the ICS }{\b\f1\insrsid1970434 rematch}{\f1\insrsid1970434 - command, which asks for another game against your last opponent with the same time control and rule set. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Call Flag}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 CallFlag}}}{\f1\insrsid1970434 Call Flag - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Calls your opponent's flag, claiming a win on time, or claiming a draw if you are both out of time. You can also call your opponent's flag by clicking on his clock. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Draw}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Draw}}}{\f1\insrsid1970434 Draw - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Offers a draw to your oppone - nt, accepts a pending draw offer from your opponent, or claims a draw by repetition or the 50-move rule, as appropriate. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Adjourn}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Adjourn}}}{\f1\insrsid1970434 Adjourn - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Asks your opponent to agree to adjourning the current game, or agrees to a pending adjournment offer from your opponent. You continue an adjourned ICS game by challenging the same player again with the ICS }{\b\f1\insrsid1970434 match}{\f1\insrsid1970434 - command. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Abort}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Abort}}}{\f1\insrsid1970434 Abort - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Asks your - opponent to agree to abort the current game, or agrees to a pending abort offer from your opponent. An aborted ICS game ends immediately without affecting either player's rating. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Resign}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Resign}}}{\f1\insrsid1970434 Resign - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Resigns the game to your opponent. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Stop Observing}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 StopObserving}}}{\f1\insrsid1970434 Stop Observing - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Ends your participation in observing a game, by issuing the ICS }{ - \b\f1\insrsid1970434 unobserve}{\f1\insrsid1970434 command. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Stop Examining}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 StopExamining}}}{\f1\insrsid1970434 Stop Examining - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Ends your participation in examining a game, by issuing the ICS }{ - \b\f1\insrsid1970434 unexamine}{\f1\insrsid1970434 command. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Step Menu}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 StepMenu}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Step Menu}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 Step Menu - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Type In Move}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 TypeInMove}}}{\f1\insrsid1970434 Type In Move - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Pops up a dialog box, into which you can type moves in standard algebraic chess notation. (You can also get this dialog box by simply starting to type over the chessboard, except in ICS mode, where such typing is redirected into the ICS interaction window - .) - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Backward}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Backward}}}{\f1\insrsid1970434 Backward - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Steps backward through a series of remembered moves. The }{ - \b\f1\insrsid1970434 <}{\f1\insrsid1970434 button is equivalent to selecting Backward.In most modes, Backward only lets you look back at old positions; it does not retract moves. This is the case if you a - re playing against a chess engine, playing or observing a game on the ICS, or loading a game. If you select Backward in any of these situations, you will not be allowed to make a different move. Use }{\f1\uldb\insrsid1970434 Retract Move}{ - \v\f1\insrsid1970434 RetractMove}{\f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 Edit Game}{\v\f1\insrsid1970434 EditGame}{\f1\insrsid1970434 if you want to change past moves. - \par If you are examining a game on the ICS, the behavior of Backward depends on whether WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 is in }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{\f1\insrsid1970434 - mode. If Pause mode is off, Backward issues the ICS command}{\b\f1\insrsid1970434 backward}{\f1\insrsid1970434 , which backs up everyone's view of the game and allows - you to make a different move. If Pause mode is on, Backward only backs up your local view. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Forward}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Forward}}}{\f1\insrsid1970434 Forward - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Steps forward through a series of remembered moves (undoing the effect of }{ - \f1\uldb\insrsid1970434 Backward}{\v\f1\uldb\insrsid1970434 Backward}{\f1\insrsid1970434 ) or through a game file. The }{\b\f1\insrsid1970434 >}{\f1\insrsid1970434 button is equivalent. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If you are examining a game on the ICS, the behavior of Forward depends on whether WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 is in }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{\f1\insrsid1970434 - mode. If Pause mode is off, Forward issues the ICS command}{\b\f1\insrsid1970434 forward}{\f1\insrsid1970434 - , which moves everyone's view of the game forward along the current line. If Pause mode is on, Forward only moves your local view forward, and it will not go past the position the game was in when you paused. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Back to Start}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 BacktoStart}}}{\f1\insrsid1970434 Back to Start - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Jumps backward to the first remembered position in the game. The }{ - \b\f1\insrsid1970434 << }{\f1\insrsid1970434 button is equivalent. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - In most modes, Back to Start only lets you look back at old positions; it does not retract moves. This is the case if you are playing against a chess engine, playing - or observing a game on the ICS, or loading a game. If you select Back to Start in any of these situations, you will not be allowed to make a different move. Use }{\f1\uldb\insrsid1970434 Retract Move}{\v\f1\insrsid1970434 RetractMove}{\f1\insrsid1970434 - or }{\f1\uldb\insrsid1970434 Edit Game}{\v\f1\insrsid1970434 EditGame}{\f1\insrsid1970434 if you want to change past moves; or use }{\f1\uldb\insrsid1970434 Reset}{\v\f1\insrsid1970434 Reset}{\f1\insrsid1970434 to start a new game. - \par If you are examining a game on the ICS, the behavior of Back to Start depends on whether WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 is in }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{\f1\insrsid1970434 - mode. If Pause mode is off, Backward issues the ICS command }{\b\f1\insrsid1970434 backward 999999}{\f1\insrsid1970434 , which backs up everyone's view of the gam - e to the start and allows you to make different moves. If Pause mode is on, Back to Start only backs up your local view. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Forward to End}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ForwardtoEnd}}}{\f1\insrsid1970434 Forward to End - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Jumps forward to the last position in the game. The }{\b\f1\insrsid1970434 >>}{ - \f1\insrsid1970434 button is equivalent. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If you a - re examining a game on the ICS, the behavior of Forward to End depends on whether WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 is in }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{\f1\insrsid1970434 - mode. If Pause mode is off, Forward to End issues the ICS command }{\b\f1\insrsid1970434 forward 999999}{\f1\insrsid1970434 , which moves everyone's view of the game forward to the end of the - current line. If Pause mode is on, Forward to End only moves your local view forward, and it will not go past the position the game was in when you paused. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Revert}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Revert}}}{\f1\insrsid1970434 Revert - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If you are examining a game on the ICS, issues the ICS command }{ - \b\f1\insrsid1970434 revert}{\f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Truncate Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 TruncateGame}}}{\f1\insrsid1970434 Truncate Game - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Discards all remembered moves of the game beyond the current position. Puts WinBoard into }{\f1\uldb\insrsid1970434 Edit Game}{\v\f1\insrsid1970434 EditGame}{\f1\insrsid1970434 mode if it was not there already. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Move Now}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 MoveNow}}}{\f1\insrsid1970434 Move Now - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Forces the chess engine to move immediately. May not work with all chess engines. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Retract Move}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 RetractMove}}}{\f1\insrsid1970434 Retract Move - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Retracts your last move. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 In chess engine mode, you can do this only after the chess engine has - replied to your move. If the chess engine is still thinking, use }{\f1\uldb\insrsid1970434 Move Now}{\v\f1\insrsid1970434 MoveNow}{\f1\insrsid1970434 first. - \par In ICS mode, Retract Move issues the command }{\b\f1\insrsid1970434 takeback 1 }{\f1\insrsid1970434 or }{\b\f1\insrsid1970434 takeback 2}{\f1\insrsid1970434 , depending on whether it is your opponent's move or yours. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Options Menu}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 OptionsMenu}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Options Menu}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 Options Menu - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Flip View}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 FlipView}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Flip View}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Inverts your view of the chessboard. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If you are playing a game on the ICS, the board is always oriented at the start of the game so that your pawns move from the bottom of the window towards the top. Otherwise, the starting position is determined by the }{\f1\uldb\insrsid1970434 flipView}{ - \v\f1\insrsid1970434 flipViewOption}{\f1\insrsid1970434 command line option. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\ul\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 General Options}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 GeneralOptions}}}{\f1\ul\insrsid1970434 General}{ - \f1\insrsid1970434 - \par }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 Always On Top}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 AlwaysOnTop}}}{\f1\insrsid1970434 Always On Top - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is on, WinBoard sets its chessboard to be a }{ - \i\f1\insrsid1970434 topmost}{\f1\insrsid1970434 window, meaning that it always appears on top of all ordinary windows on the screen. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Always Queen}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AlwaysQueen}}}{\f1\insrsid1970434 Always Queen - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Always Queen is off, WinBoard brings up a dialog box whe - never you move a pawn to the last rank, asking what piece you want to promote it to. If the option is on, your pawns are always promoted to queens. Your opponent can still underpromote, however. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Animate Dragging}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AnimateDragging}}}{\f1\insrsid1970434 - Animate Dragging - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If A - nimate Dragging is on while you are dragging a piece with the mouse, an image of the piece follows the mouse cursor. If Animate Dragging is off, there is no visual feedback while you are - \par dragging a piece, but if Animate Moving is on, the move will be animated when it is complete. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Animate Moving}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AnimateMoving}}}{\f1\insrsid1970434 Animate Moving - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Animate Mo - ving is on, all piece moves are animated. An image of the piece is shown moving from the old square to the new square when the move is completed (unless the move was already animated by Animate Dragging). If Animate Moving is off, a moved piece instantly - disappears from its old square and reappears on its new square when the move is complete. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Auto Flag}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AutoflagCmd}}}{\f1\insrsid1970434 Auto Flag - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is on and one player runs out of time before the other, WinBoard will automatically call his flag, claiming a win on time. In ICS mode, Auto Flag will only call your opponent's flag, not yours, and the ICS may award you a draw instead of a - win if you have insufficient mating material. On most chess servers, you can now do}{\b\f1\insrsid1970434 set autoflag 1 }{\f1\insrsid1970434 - instead and have the server call the flag. In local chess engine mode, WinBoard may call either player's flag and will not take material into account. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 Auto Flip View}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 AutoFlipView}}}{\b\insrsid1970434 Auto Flip View - \par }{\insrsid1970434 If this option is on when you}{\f1\insrsid1970434 start a game, the board will be automatically oriented so that your pawns move from the bottom of the window towards the top.}{\insrsid1970434 - \par }{\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{ - \insrsid15759832 Auto Raise Board}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{ - \insrsid15759832 AutoRaiseBoard}}}{\b\insrsid1970434 Auto Raise Board - \par }{\insrsid1970434 If this}{\v\insrsid1970434 autoFlipViewOption}{\insrsid1970434 option is on, whenever a new game begins, the chessboard window will be deiconized (if necessary) and raised to the top of the stack of windows on your screen. - \par }\pard\plain \s2\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 Blindfold}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 BlindfoldCmd}}}{\insrsid1970434 Blindfold - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 If Blindfold is on, WinBoard dis - plays a blank board. Moves can still be entered with the mouse, either by dragging the (invisible) piece or clicking the starting and ending square. You can also enter your move by typing it on the keyboard}{\f1\insrsid1970434 .}{\insrsid1970434 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Highlight Dragging}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 HighlightDragging}}}{\f1\insrsid1970434 High - light Dragging - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Highlight Dragging is on while you are dragging a piece with the mouse, the starting square and the square that the mouse cursor is over are highlighted. This option works even if Animate Dragging is off. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Highlight Last Move}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 HighlightLastMove}}}{\f1\insrsid1970434 - Highlight Last Move - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Highlight Last Move is on, after a move is made, the starting and ending squares remain highlighted. In addition, after you use }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{\f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 - Back to Start}{\v\f1\insrsid1970434 BackToStart}{\f1\insrsid1970434 , the starting and ending squares of the last move to be }{\i\f1\insrsid1970434 unmade}{\f1\insrsid1970434 are highlighted. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Periodic Updates}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PeriodicUpdatesCmd}}}{\f1\insrsid1970434 - Periodic Updates - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Periodic Updates is - on, the Analysis window is updated every two seconds. If not, it is updated only when the best move found changes. The Analysis window currently works only with Crafty, and Periodic Updates may not work with all versions of Crafty. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Ponder Next Move}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 PonderNextMoveCmd}}}{\f1\insrsid1970434 Ponder Next Move - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is off, the chess engine will think only when it is on move. If the option is on, the engine will also think while waiting for you to make your move. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Popup Exit Message}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PopupExitMessageCmd}}}{\f1\insrsid1970434 - Popup Exit Message - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is on, when WinBoard wants to display a message just before exiting, it brings up a modal dialog box and waits for you to click OK before exiting. If the option is off, WinBoard prints exits immediately without showing the message. If }{ - \f1\uldb\insrsid1970434 debugMode}{\v\f1\insrsid1970434 debugMode}{\f1\insrsid1970434 is on, however, the message will appear in the debug log. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Popup Move Errors}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PopupMoveErrorsCmd}}}{\f1\insrsid1970434 - Popup Move Errors - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is off, when you make an error in moving (such as attempting an illegal move or moving the wrong co - lor piece), the error message is displayed in the message area. If the option is on, move errors are displayed in small popup windows like other errors. You can dismiss an error popup either by clicking its OK button or by clicking anywhere on the board, - including downclicking to start a move. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Show Button Bar}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ShowButtonBarCmd}}}{\f1\insrsid1970434 - Show Button Bar - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Show Button Bar is on, WinBoard displays on-screen }{\f1\uldb\insrsid1970434 - buttons}{\v\f1\insrsid1970434 BUTTONS}{\f1\insrsid1970434 to step forward, backward, or pause the game. If it is off, the buttons are hidden, making the message line wider. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Show Coords}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ShowCoordsCmd}}}{\f1\insrsid1970434 Show Coords - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Show Coords is on, WinBoard displays algebraic coordinates along the board's left and bottom edges. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Show Thinking}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ShowThinkingCmd}}}{\f1\insrsid1970434 Show Thinking - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is set, WinBoard displays the chess engine\rquote - s current search depth and its notion of the score and best line of play from the current position as it is thinking. The score indicates how many pawns ahead (or if negat - ive, behind) the engine thinks it is. In matches between two machines, the score is prefixed by W or B to indicate whether it is showing White's thinking or Black's. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Test Legality}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 TestLegalityCmd}}}{\f1\insrsid1970434 Test Legality - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Test Legality is on, WinBoard tests whether the moves you enter with the mouse or read from game files are legal, and displays an error if they are not. Turn this option off if you are playing a chess variant that WinBoard does not understand. (Bughous - e, suicide, and wild variants where the king may castle after starting on the }{\b\f1\insrsid1970434 d}{\f1\insrsid1970434 file are generally supported with Test Legality on.) - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\ul\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 Board Options}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 BoardOptions}}}{\f1\ul\insrsid1970434 Board - \par }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 Board Size}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 BoardSizeCmd}}}{\f1\insrsid1970434 Board Size - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Determines how large the board will be and - what fonts and piece bitmaps will be used. On a Titanic board the piece bitmaps are 129x129 pixels, on Colossal 116x116, Giant 108x108, Huge 95x95, Big 87x87, Large 80x80, Bulky 72x72, Medium 64x64, Moderate 58x58, Average 54x54, Middling 49x49, Mediocre - 45x45, Small 40x40, Slim 37x37, Petite 33x33, Dinky 29x29, Teeny 25x25, and Tiny 21x21. The smaller boards have no system menu, but you can minimize or close them from the File menu. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 You can also change the board size by dragging the window edges or corners - with the mouse. The board will snap to the largest size that fits into the area you outline. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Board Colors}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 BoardColors}}}{\f1\insrsid1970434 Board Colors - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you change the colors WinBoard is using to draw the board and pieces. - - \par }\pard\plain \s5\ql \li115\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\outlinelevel4\adjustright\rin0\lin115\itap0 \f4\fs20\ul\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\insrsid1970434 - \par }{\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{ - \insrsid15759832 ICS Options}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{ - \insrsid15759832 ICSOptions}}}{\b\insrsid1970434 ICS - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Auto Comment}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AutoCommentCmd}}}{\f1\insrsid1970434 Auto Comment - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Auto Comment is on, any remarks made on ICS while you are observing or playing a game are recorded as a comment on the current move. This includes remarks made with the ICS commands }{\b\f1\insrsid1970434 say, tell, whisper, }{\f1\insrsid1970434 and }{ - \b\f1\insrsid1970434 kibitz}{\f1\insrsid1970434 . Limitation: remarks that you type yourself are not - \par recognized; WinBoard scans only the output from ICS, not the input you type to it. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Auto Observe}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AutobsCmd}}}{\f1\insrsid1970434 Auto Observe - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Auto Observe is on and you add a player to your }{\b\f1\insrsid1970434 - gnotify}{\f1\insrsid1970434 list on ICS, WinBoard will automatically observe all of that player's games, unless you are doing something else (such as observing or playing a game of your own) when one starts. On most chess servers, you can now do }{ - \b\f1\insrsid1970434 follow }{\b\i\f1\insrsid1970434 player}{\f1\insrsid1970434 instead, and the server will automatically observe all of }{\b\i\f1\insrsid1970434 player\rquote s}{\f1\insrsid1970434 games. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Get Move List}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 GetMoveListCmd}}}{\f1\insrsid1970434 Get Move List - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Get Move List is on, whenever WinBoard}{\i\f1\insrsid1970434 }{ - \f1\insrsid1970434 receives the first board of a new ICS game (or a different ICS game from the one it is currently displaying), it - retrieves the list of past moves from the server. You can then review the moves with the Forward and Backward commands or save them with Save Game. You might want to turn off this option if you are observing several blitz games at once, to keep from wasti - ng time and network bandwidth fetching the move lists over and over. If you turn this option on while a game is in progress, WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 immediately fetches the current move list. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Local Line Editing}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LocalLineEditing}}}{\f1\insrsid1970434 - Local Line Editing - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Local Line Editing is }{\b\f1\insrsid1970434 on}{\f1\insrsid1970434 - , your machine handles echoing, backspacing, etc., for the characters that you type into the ICS Interaction window. Output is forwarded to the ICS only when you hit Enter.The Enter key produces a newline character, also known as Ctrl+J, \\ - n, LF, linefeed, or decimal ASCII code 10. In this mode you can force a control character into the edit buffer by preceding it with Ctrl+Q (\'93quote\'94); however, the edit buffer will not accept certain control characters even when they are quoted in - this way. You can force a control character to be sent immediately to ICS, bypassing the edit buffer, by preceding it with Ctrl+S (\'93send\'94). - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - WinBoard keeps a history of lines you recently typed in Local Line Editing mode. You can bring back old lines by pressing the cursor up key in the text entry box. Press the cursor down key to go back down to newer lines. - \par If Local Line Editing is }{\b\f1\insrsid1970434 off}{\f1\insrsid1970434 , all characters are sent to ICS as you type them. The Enter key produces a carriage return character, also known as Ctrl+M, \\ - r, CR, or decimal ASCII code 13. Use Ctrl+Backspace if you need the ASCII DEL character. You can enter any character code by holding down the Alt key and typing its decimal value (always beginning with 0) on the numeric keypad; this is a little-known s - tandard feature of Windows. - \par In both modes, if WinBoard}{\i\f1\insrsid1970434 \rquote s }{\f1\insrsid1970434 internal telnet protocol implementation is active, it translates all \\n characters to the standard telnet end-of-line sequence \\r\\ - n just before sending them out to ICS; see }{\f1\uldb\insrsid1970434 telnetProgram}{\v\f1\insrsid1970434 telnetProgram}{\f1\insrsid1970434 . - \par It is generally not a good idea to turn off this option while connected to ICS. If you are tempted to do so because everything you type is being echoed an extra time, see the paragraph about extra echoes under }{\f1\uldb\insrsid1970434 LIMITATIONS}{ - \v\f1\insrsid1970434 LIMITATIONS}{\f1\insrsid1970434 below. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Quiet Play}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 QuietPlayCmd}}}{\f1\insrsid1970434 Quiet Play - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If Quiet Play is on, WinBoard will automatically issue an ICS }{ - \b\f1\insrsid1970434 set shout 0}{\f1\insrsid1970434 command whenever you start a game and a }{\b\f1\insrsid1970434 set shout 1}{\f1\insrsid1970434 command whenever you finish one. Thus you will not be distracted by shouts from other ICS users while - playing. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Premove}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 PremoveCmd}}}{\f1\insrsid1970434 Premove - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 - Premove allows you to play a move on the board before you have received your opponent\rquote s move. This move is highlighted on the board using the }{\uldb\insrsid1970434 Premove Highlight}{\v\uldb\insrsid1970434 premoveHighlightColor}{\insrsid1970434 - color, and is sent to the ICS as soon as your opponent\rquote s move is received. To cancel a premove, either click twice on the piece that was premoved or premove an illegal move. - \par This group of controls allows you to set the following options: }{\uldb\insrsid1970434 premove}{\v\insrsid1970434 premove}{\insrsid1970434 , }{\uldb\insrsid1970434 premoveWhite}{\v\insrsid1970434 premoveWhite}{\insrsid1970434 , }{\uldb\insrsid1970434 - premoveWhiteText}{\v\insrsid1970434 premoveWhiteText}{\insrsid1970434 , }{\uldb\insrsid1970434 premoveBlack}{\v\insrsid1970434 premoveBlack}{\insrsid1970434 , }{\uldb\insrsid1970434 premoveBlackText}{\v\insrsid1970434 premoveBlackText}{\insrsid1970434 . - - \par }\pard\plain \s2\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 ICS Alarm}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 ICSAlarm}}}{\insrsid1970434 ICS Alarm - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 When }{\b\insrsid1970434 icsAlarm}{\insrsid1970434 is set to True, the }{ - \uldb\insrsid1970434 alarm sound}{\v\insrsid1970434 soundIcsAlarm}{\insrsid1970434 is played when your clock counts down to }{\uldb\insrsid1970434 icsAlarmTime}{\v\insrsid1970434 icsAlarmTime}{\insrsid1970434 - seconds. For ICS games with time controls that include an increment, the alarm will sound each time the clock counts down to the }{\uldb\insrsid1970434 icsAlarmTime}{\v\insrsid1970434 icsAlarmTime}{\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 ICS Interaction Colors}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ICSInteractionColors}}}{ - \f1\insrsid1970434 ICS Interaction Colors - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you ch - ange the colors and type styles that WinBoard uses to distinguish between different types of messages in the ICS Interaction window. The types distinguished are: shout, sshout, channel 1 tell, other channel tell, kibitz (or whisper), personal tell (or new - message notification), challenge, request (including abort, adjourn, draw, pause, and takeback), seek, and normal (all other messages). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Fonts}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Fonts}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Fonts}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Lets you change the fonts WinBoard is using. The clock font, message font and coordinates font are specific to each board size. The tags font, comments font and ICS Interaction font are not dependent on the current size of the board. The \'93 - Revert to Defaults\'94 button will reset the clock font, message font and coordinates font for the current board size, and will set the tags font, message font and Ics Interaction font for all board sizes. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Sounds}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Sounds}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Sounds}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you change the sounds that WinBoard plays for various events. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Move Sound}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 MoveSound}}}{\f1\insrsid1970434 - If the Move sound is on, WinBoard alerts - you by playing a sound after each of your opponent's moves (or after every move if you are observing a game on the Internet Chess Server). The sound is not played after moves you make or moves read from a saved game file. If you turn on the Move sound wh - en using WinBoard with the Internet Chess Server, you will probably want to give the }{\b\f1\insrsid1970434 set bell 0}{\f1\insrsid1970434 command to the ICS. Otherwise the ICS will send a bell character after every move (not just yours), cau - sing WinBoard to play the ICS Bell sound too. Alternatively, you could turn off the ICS Bell sound in WinBoard, but that might cause you to miss ICS alerts for other interesting events. - \par The other sound events correspond directly to the types of messages that the }{\f1\uldb\insrsid1970434 ICS Interaction Colors}{\v\f1\insrsid1970434 ICSInteractionColors}{\f1\insrsid1970434 option knows how to colorize. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Communications}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Communications}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Communications}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you change the communication port parameters when the }{ - \f1\uldb\insrsid1970434 internetChessServerComPort}{\v\f1\insrsid1970434 internetChessServerComPort}{\f1\insrsid1970434 option is in use. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 LoadGameOptns}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Load Game}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you change options used while loading games (}{\f1\uldb\insrsid1970434 - timeDelay}{\v\f1\insrsid1970434 timeDelay}{\f1\insrsid1970434 option). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Save Game}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SaveGameOptns}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Save Game}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Lets you change options used for saving games (}{\f1\uldb\insrsid1970434 - autoSaveGames}{\v\f1\insrsid1970434 autoSaveGames}{\f1\insrsid1970434 , }{\f1\uldb\insrsid1970434 oldSaveStyle}{\v\f1\insrsid1970434 oldSaveStyle}{\f1\insrsid1970434 , and }{\f1\uldb\insrsid1970434 saveGameFile}{\v\f1\insrsid1970434 saveGameFile}{ - \f1\insrsid1970434 options). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Time Control}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 TimeControlCmd}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Time Control}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Lets you change the time control to be used in games against a chess engine. Two types of timing are available. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 With conventional chess clocks, each player begins with his clock set to the }{ - \f1\uldb\insrsid1970434 timeControl}{\v\f1\insrsid1970434 timeControl}{\f1\insrsid1970434 period. When both players have made }{\f1\uldb\insrsid1970434 movesPerSession}{\v\f1\insrsid1970434 movesPerSession}{\f1\insrsid1970434 - moves, a new time control period begins. The time in the new period is added to whatever time the players have left on their clocks. - \par With incremental clocks, each player is given an initial time allotment, and a }{\f1\uldb\insrsid1970434 timeIncrement}{\v\f1\insrsid1970434 timeIncrement}{\f1\insrsid1970434 is added to his - clock after every move. The increment may be zero, in which case the entire game must be finished within the initial time allotment. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Save Settings Now}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SaveSettings}}}{\f1\insrsid1970434 }{ - \f1\ul\insrsid1970434 Save Settings Now}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Save the current option settings to a file, along with the current - window sizes and positions, to be automatically reloaded next time WinBoard is run. See }{\f1\uldb\insrsid1970434 Settings}{\v\f1\insrsid1970434 Settings}{\f1\insrsid1970434 for the fine points. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Save Settings on Exit}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SaveSettingsOnExit}}}{ - \f1\insrsid1970434 }{\f1\ul\insrsid1970434 Save Settings on Exit}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is on, the current settings are automatically - saved when WinBoard exits, as with Save Settings Now. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Help Menu}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 HelpMenu}}}{ - \b0\f1\fs18\up6\insrsid1970434 }{\cs58\f1\fs20\super\insrsid1970434 ${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Help Menu}}+{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{\f1\fs20\insrsid1970434 Help Menu - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Help Contents}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 HelpContents}}}{\f1\insrsid1970434 Help Contents - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Brings up this help file, starting at the Contents page. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Search for Help on}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 SearchHelp}}}{\f1\insrsid1970434 Help Index - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Brings up this help file, starting at the Index/Find dialog. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 How to Use Help}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 HelpHelp}}}{\f1\insrsid1970434 How to Use Help - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Brings up the standard help file that explains how to use Windows Help. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Hint}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Hint}}}{\f1\insrsid1970434 Hint - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Displays a move hint from the chess engine. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Book}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Book}}}{\f1\insrsid1970434 Book - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Displays a list of possible moves from the chess engine\rquote - s opening book. The first column gives moves, the second column gives one possible response for each move, and the third column shows - the number of lines in the book that include the move from the first column. If you select this option and nothing happens, the engine is out of its book or does not support the book command. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 About WinBoard}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 AboutWinBoard}}}{\f1\insrsid1970434 About WinBoard - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Displays the WinBoard version number. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 - ICS Interaction Context Menu}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 ICSInteractionContextMenu}}}{\b0\f1\fs18\up6\insrsid1970434 }{\cs58\f1\fs20\super\insrsid1970434 ${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 ICS Interaction Context Menu}}+{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{\f1\fs20\insrsid1970434 ICS Interaction Context Menu - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - To see this menu, press the right mouse button anywhere in the output (upper) pane of the ICS Interaction window. Pressing the right mouse button in the input (lower) pane gives a standard editing context menu, not described here. Use the }{ - \b\f1\insrsid1970434 help}{\f1\insrsid1970434 command on ICS to learn what these commands mean. - \par You can customize the lower part of this menu (below the Paste option) by setting the }{\f1\uldb\insrsid1970434 icsMenu}{\v\f1\insrsid1970434 icsMenu}{\f1\insrsid1970434 option. The easiest way to accomplish this is to edit your }{ - \f1\uldb\insrsid1970434 settings file}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 with Notepad or another plain text editor. Sorry, there is no graphical user interface for customizing the menu. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Copy and Paste}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 CopyAndPaste}}}{\f1\insrsid1970434 Copy and Paste - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Copies the current selection to the clipboard, then pastes it to the input box. As a shortcut to this function, you can press the middle mouse button (if you have one), or Shift plus the right mouse button. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Copy}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Copy}}}{\f1\insrsid1970434 Copy - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Copies the current selection to the clipboard. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Paste}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Paste}}}{\f1\insrsid1970434 Paste - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Pastes the clipboard contents to the input box. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Who}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Who}}}{\f1\insrsid1970434 Who - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93who\'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 - to ICS. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Players}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Players}}}{\f1\insrsid1970434 Players - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93players\'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 - to ICS. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Games}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Games}}}{\f1\insrsid1970434 Games - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93games\'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 - to ICS. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Sought}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Sought}}}{\f1\insrsid1970434 Sought - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93sought\'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 - to ICS. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Tell}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Tell}}}{\f1\insrsid1970434 Tell (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Inserts \'93tell }{\i\f1\insrsid1970434 name }{\f1\insrsid1970434 \'94}{ - \b\i\f1\insrsid1970434 }{\f1\insrsid1970434 into the input box. The string }{\i\f1\insrsid1970434 name }{\f1\insrsid1970434 is the current selection if it is not empty. Otherwise }{\i\f1\insrsid1970434 name }{\f1\insrsid1970434 - is the word surrounding the mouse position, where a \'93word\'94 is a string of letters, digits, or hyphens (-), such as an ICS user handle or game number. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Message}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Message}}}{\f1\insrsid1970434 Message (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Inserts \'93message }{\i\f1\insrsid1970434 name }{\f1\insrsid1970434 \'94}{ - \b\i\f1\insrsid1970434 }{\f1\insrsid1970434 into the input box, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Finger}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Finger}}}{\f1\insrsid1970434 Finger (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93finger }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 - \'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 to ICS, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Vars}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Vars}}}{\f1\insrsid1970434 Vars (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93vars }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 \'94} - {\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 to ICS, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Observe}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Observe}}}{\f1\insrsid1970434 Observe (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93observe }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 - \'94}{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 to ICS, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. Here }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 can be either a user handle or a game number. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Match}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Match}}}{\f1\insrsid1970434 Match (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93match }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 \'94 - }{\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 to ICS, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Play}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 Play}}}{\f1\insrsid1970434 Play (name) - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sends the command \'93play }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 \'94} - {\b\i\f1\insrsid1970434 }{\f1\insrsid1970434 to ICS, where }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 is as defined above. Here }{\i\f1\insrsid1970434 name}{\f1\insrsid1970434 can be either a user handle or a seek ad number. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Buttons}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Buttons}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Buttons}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \b0\f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 BUTTONS - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Back to Start}}}{\f1\insrsid1970434 << - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Same as }{\f1\uldb\insrsid1970434 Back to Start}{\v\f1\insrsid1970434 - BacktoStart}{\f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Backward}}}{\f1\insrsid1970434 < - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Same as }{\f1\uldb\insrsid1970434 Backward}{\v\f1\insrsid1970434 Backward}{ - \f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Pause}}}{\f1\insrsid1970434 P - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Same as }{\f1\uldb\insrsid1970434 Pause}{\v\f1\insrsid1970434 Pause}{ - \f1\insrsid1970434 . The button label changes to }{\b\f1\insrsid1970434 C}{\f1\insrsid1970434 while WinBoard is pausing. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Forward}}}{\f1\insrsid1970434 > - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Same as }{\f1\uldb\insrsid1970434 Forward}{\v\f1\insrsid1970434 Forward}{ - \f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Forward to End}}}{\f1\insrsid1970434 >> - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Same as }{\f1\uldb\insrsid1970434 Forward to End}{\v\f1\insrsid1970434 - ForwardtoEnd}{\f1\insrsid1970434 . - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Command Line Options}} - K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Options}}}{ - \f1\fs20\insrsid1970434 }{\cs58\f1\fs20\super\insrsid1970434 #{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Options}}}{\f1\fs20\insrsid1970434 }{\cs58\f1\fs20\super\insrsid1970434 ${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Command Line Options}}}{\f1\fs20\insrsid1970434 }{\cs58\f1\fs20\super\insrsid1970434 +{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{\f1\fs20\insrsid1970434 - COMMAND LINE OPTIONS - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - All WinBoard options can be set either on the command line (if you start WinBoard by typing into an MSDOS Prompt box), in the Properties/Shortcut/Target box of a Windows shortcut, in a }{\f1\uldb\insrsid1970434 settings file}{\v\f1\insrsid1970434 settings - }{\f1\insrsid1970434 , or in the Additional Options box of the WinBoard startup dialog. Exactly the same syntax is used in all four places. Most options can also be set from the menus and saved using }{\f1\uldb\insrsid1970434 Save Settings Now}{ - \v\f1\insrsid1970434 SaveSettings}{\f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 Save Settings on Exit}{\v\f1\insrsid1970434 SaveSettingsOnExit}{\f1\insrsid1970434 , so most people will not need to read this section. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Most options have two names, a long one that is easy to read and a short one that is easy to type. To turn on a boolean (true/false) option }{\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 - , you can just give its short name preceded by a minus sign or slash (-}{\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 or /}{\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 ); to turn one off, prefix the short name by an \'93x\'94 or an extra minus sign (-x} - {\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 or /-}{\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 - ). To set any other kind of option, or to set a boolean option using its long name, give the value after the name, separated by a space, colon, or equal sign. (-}{\i\f1\insrsid1970434 opt}{\f1\insrsid1970434 23 or /}{\i\f1\insrsid1970434 option}{ - \f1\insrsid1970434 :true). If a string option contains spaces or special characters, enclose it in double quotes and use the \\ quoting convention of C to name the special characters. Alternatively, you can enclose a string value in curly braces (/opt=\{ - string\}), as long as the value does not contain a closing curly brace. If a filename option contains spaces, enclose it in either single or double quotes. In filename options, the \\ - character is not treated specially, so use single quotes around the outside of the value if it has double quotes inside (and vice versa). - \par When you start WinBoard, it will pop up the Startup dialog box unless you provide sufficient options on the command line for WinBoard to determine which major mode to be in and what engines to use or chess se - rver to connect to. To bypass this box, you must at minimum give one of the three options }{\f1\uldb\insrsid1970434 /cp}{\v\f1\insrsid1970434 cp}{\f1\insrsid1970434 , /}{\f1\uldb\insrsid1970434 ics}{\v\f1\insrsid1970434 ics}{\f1\insrsid1970434 , or /}{ - \f1\uldb\insrsid1970434 ncp}{\v\f1\insrsid1970434 ncp}{\f1\insrsid1970434 . If you give the /cp option, you must also give the /}{\f1\uldb\insrsid1970434 fcp}{\v\f1\insrsid1970434 fcp}{\f1\insrsid1970434 and /}{\f1\uldb\insrsid1970434 scp}{ - \v\f1\insrsid1970434 scp}{\f1\insrsid1970434 options. If you give the /ics option, you must also give the /}{\f1\uldb\insrsid1970434 icshost}{\v\f1\insrsid1970434 icshost}{\f1\insrsid1970434 option. - \par }\pard\plain \s29\ql \fi-240\li360\ri0\sb60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin360\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\uldb\insrsid1970434 Chess Engine Options}{\v\f1\insrsid1970434 ChessEngineOptions}{ - \f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Internet Chess Server Options}{\v\f1\insrsid1970434 InternetChessServerOptions}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Load and Save Options}{\v\f1\insrsid1970434 LoadAndSaveOptions}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 User Interface Options}{\v\f1\insrsid1970434 UserInterfaceOptions}{\f1\insrsid1970434 - \par }{\f1\uldb\insrsid1970434 Other Options}{\v\f1\insrsid1970434 OtherOptions}{\f1\insrsid1970434 - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Chess Engine Options}} - ${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Chess Engine Options} - }#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ChessEngineOptions}} - +{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 Chess Engine Options - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 cp}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 cp}}}{\f1\insrsid1970434 /cp}{\b0\f1\insrsid1970434 - or}{\f1\insrsid1970434 /xcp}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 chessProgram}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 chessProgram}}}{\f1\insrsid1970434 /chessProgram }{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If true, puts WinBoard in chess engine mode. In this mode, you can play against a chess program running on your PC or use it as an analysis partner. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 tc}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 tc}}}{\f1\insrsid1970434 /tc }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 timeControl}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 timeControl}}}{\f1\insrsid1970434 /timeControl }{\i\f1\insrsid1970434 minutes[:seconds] - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Each player begins with his clock set to the timeControl period. Default: 5 minutes. The additional options movesPerSession and timeIncrement are mutually exclusive. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 mps}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 mps}}}{\f1\insrsid1970434 /mps }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 movesPerSession}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 movesPerSession}}}{\f1\insrsid1970434 /movesPerSession }{\i\f1\insrsid1970434 moves}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - When both players have made movesPerSession moves, a new timeControl period is added to both clocks. Default: 40 moves. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 inc}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 inc}}}{\f1\insrsid1970434 /inc }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 timeIncrement}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 timeIncrement}}}{\f1\insrsid1970434 /timeIncrement }{\i\f1\insrsid1970434 seconds - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is specified, movesPerSession is ignored. Instead, after each player's move, timeIncrement seconds are added to his clock. Use -timeIncrement 0 if you want to require the e - ntire game to be played in one timeControl period, with no increment. Default: -1, which specifies movesPerSession mode. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 clock }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 clock }}}{\f1\insrsid1970434 /clock }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xclock}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 clockMode}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 clockMode}}}{\f1\insrsid1970434 /clockMode }{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 De - termines whether or not to display the chess clocks. If clockMode is False, the clocks are not shown, but the side that is to play next is still highlighted. Also, unless searchTime is set, the chess engine still keeps track of the clock time and uses it - to determine how fast to make its moves. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 st}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 st}}}{\f1\insrsid1970434 /st }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 searchTime }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 searchTime }}}{\f1\insrsid1970434 /searchTime }{\i\f1\insrsid1970434 minutes[:seconds]}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Tells the chess engine to spend at most the given amount of time searching for each of its moves. Without this option, the engine choos - es its search time based on the number of moves and amount of time remaining until the next time control. Setting this option also sets clockMode to False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 sd}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 sd}}}{\f1\insrsid1970434 /depth }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 searchDepth}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 searchDepth}}}{\f1\insrsid1970434 /searchDepth }{\i\f1\insrsid1970434 number}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Tells the chess engine to - look ahead at most the given number of moves when searching for a move to make. Without this option, the engine chooses its search depth based on the number of moves and amount of time remaining until the next time control. With the option, the engine wil - l cut off its search early if it reaches the specified depth. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 - K}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 ponder}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 ponder}}}{\f1\insrsid1970434 /ponder}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xponder}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 K}{ - \f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 ponderNextMove}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\nowidctlpar\faauto\pnrdate0\pnrnot1\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\cf0\revised\super\revauth1\revdttm-1506646559\insrsid15759832 #}{\f1\cf0\revised\revauth1\revdttm-1506646559\insrsid15759832 ponderNextMove}}}{\f1\insrsid1970434 /ponderNextMove }{ - \i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Ponder Next Move}{\v\f1\insrsid1970434 - ponderNextMoveCmd}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 thinking}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 thinking}}}{\f1\insrsid1970434 /thinking}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xthinking}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 showThinking}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 showThinking}}}{\f1\insrsid1970434 /showThinking }{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Show Thinking}{\v\f1\insrsid1970434 - showThinkingCmd}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 periodic }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 periodic}}}{\f1\insrsid1970434 /periodic }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xperiodic}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 periodicUpdates}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 periodicUpdates}}}{\f1\insrsid1970434 /periodicUpdates }{\i\f1\insrsid1970434 true|false - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Periodic Updates}{\v\f1\insrsid1970434 - periodicUpdatesCmd}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 mg }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 mg }}}{\f1\insrsid1970434 /mg }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 matchGames }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 matchGames}}}{\f1\insrsid1970434 /matchGames }{\i\f1\insrsid1970434 n - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Automatically runs an }{\b\i\f1\insrsid1970434 n}{\i\f1\insrsid1970434 -}{ - \f1\insrsid1970434 game match between two chess engines, with alternating colors. If the }{\f1\uldb\insrsid1970434 loadGameFile}{\v\f1\insrsid1970434 loadGameFile}{\f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 loadPositionFile}{\v\f1\insrsid1970434 - loadPositionFile}{\f1\insrsid1970434 option is set, WinBoard will start each game with the given opening moves or the given position; otherwise, the games will start with the standard initial chess position. If the }{\f1\uldb\insrsid1970434 saveGameFile} - {\v\f1\insrsid1970434 saveGameFile}{\f1\insrsid1970434 option is set, a move record for the match will be appended to the specified file. If the }{\f1\uldb\insrsid1970434 savePositionFile}{\v\f1\insrsid1970434 savePositionFile}{\f1\insrsid1970434 - option is set, the final position reached in each game of the match will be appended to the specified file. When the match is over, WinBoard will display the match score and exit. Default: 0 (do not run a match). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 mm }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 mm }}}{\f1\insrsid1970434 /mm }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xmm}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 matchMode }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 matchMode }}}{\f1\insrsid1970434 /matchMode }{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Provided for backward compatibility. If true and matchGames=0, sets matchGames=1. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 fd}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 fd }}}{\f1\insrsid1970434 /fd }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstDirectory}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstDirectory}}}{\f1\insrsid1970434 /firstDirectory }{\i\f1\insrsid1970434 dir\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 sd}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 sd }}}{\f1\insrsid1970434 /sd }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondDirectory}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondDirectory}}}{\f1\insrsid1970434 /secondDirectory }{\i\f1\insrsid1970434 dir}{\cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 - \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 fcp }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 fcp }}}{\f1\insrsid1970434 /fcp }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstChessProgram }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstChessProgram }}}{\f1\insrsid1970434 /firstChessProgram }{\i\f1\insrsid1970434 command\line }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 scp }}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 scp }}}{ - \f1\insrsid1970434 /scp }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondChessProgram }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondChessProgram }}}{\f1\insrsid1970434 /secondChessProgram }{\i\f1\insrsid1970434 command}{\cs58\f1\super\insrsid1970434 }{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Names of the chess engines and working directories in which they are to be run. The second chess engine is started only in Two Machines (match) mode. These arguments are parsed as filenames; that is, the \\ - character is interpreted literally, not as a C-style escape. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 The }{\i\f1\insrsid1970434 dir}{\f1\insrsid1970434 - argument specifies the initial working directory for the chess engine. It should usually be the directory where the engine and its working files are installed. If }{\i\f1\insrsid1970434 dir}{\f1\insrsid1970434 - is not an absolute pathname, it is interpreted relative to the directory from which WinBoard.exe itself was loaded. The }{\i\f1\insrsid1970434 dir}{\f1\insrsid1970434 - argument is ignored if the chess engine is being run on a remote machine (see firstHost and secondHost below). The default value for }{\i\f1\insrsid1970434 dir }{\f1\insrsid1970434 - "", meaning that the chess engine is expected to be installed in the same directory as WinBoard. - \par The }{\i\f1\insrsid1970434 command}{\f1\insrsid1970434 argument is actually the command line to the chess engine, so if the engine itself needs command line arguments, you can include them by enclosing }{\i\f1\insrsid1970434 command}{\f1\insrsid1970434 - in single or double quotes. If the engine name or an engine argument has a space in it, use single quotes around the whole }{\i\f1\insrsid1970434 command, }{\f1\insrsid1970434 and inside them use double quotes around each item that contains spaces. - If the engine name has more than one period in it (for example, }{\f2\insrsid1970434 QChess1.5.exe}{\f1\insrsid1970434 ), you must include the "}{\f2\insrsid1970434 .exe}{\f1\insrsid1970434 - " extension; otherwise you can leave it out. The default value for }{\i\f1\insrsid1970434 command}{\f1\insrsid1970434 is "", which brings up the startup dialog to ask which engines you want. - \par Examples: - \par }\pard\plain \s19\ql \fi-518\li1036\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin1036\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\insrsid1970434 WinBoard /cp /fd="C:\\ - Program Files\\Crafty" /fcp=WCrafty-15.12.exe /scp=GNUChess - \par WinBoard /cp /fd="C:\\Miracle Games" /fcp='"Miracle Chess.exe" /wow' /scp=GNUChess - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 fh }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 fh }}}{\f1\insrsid1970434 /fh }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstHost }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstHost }}}{\f1\insrsid1970434 /firstHost }{\i\f1\insrsid1970434 host\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 sh }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 sh }}}{\f1\insrsid1970434 /sh }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondHost }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondHost }}}{\f1\insrsid1970434 /secondHost }{\i\f1\insrsid1970434 host}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Hosts on which the chess engines are to run. The default for each is "localhost". If you specify another host, WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 uses }{\f1\uldb\insrsid1970434 rsh}{\v\f1\insrsid1970434 rsh}{\f1\insrsid1970434 - to run the chess program there. The /fd and /sd flags do not work in co - njunction with these flags; if you need a remote chess engine to run somewhere other than your default login directory on the remote machine, you will have to include a "cd" command in the argument to /fcp or /scp. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 initString}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 initString}}}{\f1\insrsid1970434 /firstInitString } - {\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /initString }{\i\f1\insrsid1970434 string\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondInitString}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondInitString}}}{\f1\insrsid1970434 /secondInitString }{\i\f1\insrsid1970434 string}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 The strings that are sent to initialize the chess engines. Default: "new\\ - nrandom\\n". The "\\n" sequences represent newlines. You can type "\\n" on the command line or in a }{\f1\uldb\insrsid1970434 settings file}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 , and WinBoard will convert it to a newline. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 All chess engines require the "new" command to start a new game. - \par You can remove the "random" command if you like; including it causes GNU Chess to randomize it - s move selection slightly so that it doesn't play the same moves in every game. Even without "random", GNU Chess randomizes its choice of moves from its opening book. You can also try adding other commands to the initString; see the GNU Chess documentati - {\*\bkmkstart _Hlt386545814}o{\*\bkmkstart _Hlt386567280}{\*\bkmkend _Hlt386545814}n{\*\bkmkend _Hlt386567280} (gnuchess.txt) for details. Crafty ignores the "random" command; see its documentation for the commands it accepts. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 initString}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 initString}}}{\f1\insrsid1970434 - /firstComputerString }{\i\f1\insrsid1970434 string\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondInitString}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondInitString}}}{\f1\insrsid1970434 /secondComputerString }{\i\f1\insrsid1970434 string}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If the chess engine is playing against another computer program (whether locally or on a chess server), by default the command "computer\\n" is sent to it. Some chess engines change their playing style when they recei - ve this command. If you do not want the engine to know when it is playing another computer, you can set the string to "". - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 fb }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 fb }}}{\f1\insrsid1970434 /fb }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xfb}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstPlaysBlack }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstPlaysBlack}}}{\f1\insrsid1970434 /firstPlaysBlack }{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - In games between two chess programs, the firstChessProgram normally plays white. (This is a change from earlier versions of WinBoard.) If this option is True, firstChessProgram plays black. In a multi-game match, this option affects the colors only for th - e first game; they still alternate in subsequent games. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 reuse}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 reuse}}}{\f1\insrsid1970434 /reuse}{ - \cs58\f1\super\insrsid1970434 }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xreuse}{\b0\f1\insrsid1970434 , or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 reuseFirst}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 reuseFirst}}}{\f1\insrsid1970434 /reuseFirst}{\i\f1\insrsid1970434 true|false\line }{ - \cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 reuse2}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 reuse2}}}{\f1\insrsid1970434 /reuse2}{\cs58\f1\super\insrsid1970434 }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xreuse2}{\b0\f1\insrsid1970434 , or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 reuseSecond}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 reuseSecond}}}{\f1\insrsid1970434 /reuseSecond}{ - \i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is True (the default), WinBoard}{\i\f1\insrsid1970434 }{ - \f1\insrsid1970434 uses the same chess engine process repeatedly when playing multiple games. If the option is False, WinBoard kills off the chess engine after every game and starts a fresh one for the next game. Starting a fresh chess engi - ne can be slow, so it is not recommended. However, some chess engines may not work properly when reused, such as versions of Crafty earlier than 12.0. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstProtocolVersion}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstProtocolVersion}}}{ - \f1\insrsid1970434 /firstProtocolVersion }{\i\f1\insrsid1970434 ver\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondProtocolVersion}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondProtocolVersion}}}{\f1\insrsid1970434 /secondProtocolVersion }{\i\f1\insrsid1970434 - ver}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - This option specifies which version of the chess engine communication protocol to use. By default, version-number is 2. In version 1, the "protover" command is not sent to the engine; since version 1 is a s - ubset of version 2, nothing else changes. Other values for version-number are not supported. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 + - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 - Internet Chess Server Options}}${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 $}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 Internet Chess Server Options}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 InternetChessServerOptions}}}{\f1\fs20\insrsid1970434 Internet Chess Server Options - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 ics }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 ics }}}{\f1\insrsid1970434 /ics }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xics}{ - \b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerMode}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerMode}}}{\f1\insrsid1970434 /internetChessServerMode}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Connect with an Internet Chess Server to play chess against its other users, observe games they are playing, or review games that have recently finished. See }{\f1\uldb\insrsid1970434 ICS Client}{\v\f1\insrsid1970434 ICSClient}{\f1\insrsid1970434 - Default: False. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - You can create a script file containing ICS commands that WinBoard will type in for you whenever you connect to the ICS. See }{\f1\uldb\insrsid1970434 ICS Logon}{\v\f1\insrsid1970434 ICSLogon}{\f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icshost }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icshost }}}{\f1\insrsid1970434 /icshost }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerHost }}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerHost }}}{\f1\insrsid1970434 /internetChessServerHost }{\i\f1\insrsid1970434 hostname}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The host name or numeric address of the Internet Chess Server to connect to when in ICS mode. The default is the empty string, which causes WinBoard to pop up a menu of known ICS sites. The file ics-address{\*\bkmkstart _Hlt386546221}e - {\*\bkmkend _Hlt386546221}s.txt in the WinBoard distribution gives slightly more information on these sites. It includes their numeric addresses, which you can use if your site does not have a working name server. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icsport }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icsport }}}{\f1\insrsid1970434 /icsport }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerPort }}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 internetChessServerPort }}}{ - \f1\insrsid1970434 /internetChessServerPort }{\i\f1\insrsid1970434 portnumber}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The port number to use when connecting to a chess server in ICS mode. Default: 5000. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 via }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 via }}}{\f1\insrsid1970434 /icshelper }{ - \i\f1\insrsid1970434 program}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 An external helper program used to communicate with the chess server. Typically - }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 timestamp}}}{\i\f1\insrsid1970434 timestamp}{\f1\insrsid1970434 for the ICC (chessclub.com) or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 timeseal}}}{\i\f1\insrsid1970434 timeseal}{\f1\insrsid1970434 - for FICS (freechess.org, eics.daimi.aau.dk, etc.). This option is shorthand for \'93/useTelnet /telnetProgram }{\i\f1\insrsid1970434 program}{\f1\insrsid1970434 \'94}{\b\f1\insrsid1970434 . - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 telnet}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 telnet}}}{\f1\insrsid1970434 /telnet}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xtelnet}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 useTelnet}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 useTelnet}}}{\f1\insrsid1970434 /useTelnet}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 This option is poorly named; it should be called }{\b\f1\insrsid1970434 - /useHelper}{\f1\insrsid1970434 . If set to True, it instructs WinBoard to use an external helper program to communicate - with the ICS, as specified by the telnetProgram option. The external program must be a pure console application that can communicate with WinBoard through pipes; the Windows telnet application is not suitable. If the option is False (the default), WinBoar - d communicates with the ICS by opening a Winsock TCP socket and using its own internal implementation of the telnet protocol. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 gateway}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 gateway}}}{\f1\insrsid1970434 /gateway }{ - \i\f1\insrsid1970434 hostname}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is set to a host name, WinBoard uses }{\f1\uldb\insrsid1970434 - rsh}{\v\f1\insrsid1970434 rsh}{\f1\insrsid1970434 to run the telnetProgram remotely on the given host to communicate with the Internet Chess Server instead of using its own internal implementation of the telnet protocol. See the }{ - \f1\uldb\insrsid1970434 FIREWALLS}{\v\f1\insrsid1970434 FIREWALLS}{\f1\insrsid1970434 section below for an explanation of when this option is useful. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 telnetProgram}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 telnetProgram}}}{\f1\insrsid1970434 /telnetProgram } - {\i\f1\insrsid1970434 program}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 This option is poorly named; it should be called }{\b\f1\insrsid1970434 - /helperProgram}{\f1\insrsid1970434 . It gives the name of the remote or external helper program to be used with the gateway or useTelnet option. The default is "tel - net". The telnet program is invoked with the value of internetChessServer as the first argument and the value of internetChessServerPort as the second argument on its command line. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 icscom }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 icscom }}}{\f1\insrsid1970434 /icscom }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 internetChessServerComPort }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 internetChessServerComPort }}}{\f1\insrsid1970434 /internetChessServerComPort }{ - \i\f1\insrsid1970434 name}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is set, WinBoard communicates with the Internet Chess Server using a serial communication port instead of a network connection. Use this option if your machine is not connected to a networ - k (not even via SLIP or PPP), but you do have Internet access through another machine by dialing in using a modem or by connecting directly to a serial terminal port. Example: - \par }\pard\plain \s19\ql \li120\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin120\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\insrsid1970434 WinBoard /ics /icscom:com1 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 After you start WinBoard in this way, type whatever m - odem commands are necessary to dial out to your Internet provider and log in. You may need to turn off }{\f1\uldb\insrsid1970434 Local Line Editing}{\v\f1\insrsid1970434 LocalLineEditing}{\f1\insrsid1970434 - on the Options menu while typing commands to the modem, but turn it on again afterwards. Then telnet to the ICS, using a command like "telnet chessclub.com 5000". Important: See the paragraph in the }{\f1\uldb\insrsid1970434 LIMITATIONS}{ - \v\f1\insrsid1970434 LIMITATIONS}{\f1\insrsid1970434 section below about extra echoes. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 comPortSettings }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 comPortSettings }}}{\f1\insrsid1970434 /comPortSettings}{\b0\f1\insrsid1970434 }{\i\f1\insrsid1970434 \'93dataRate,dataBits,parity,stopBits,flow\'94 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - This option allows serial port parameters to be set from the command line or a settings file. The values are simply filled in to the }{\f1\uldb\insrsid1970434 Communications}{\v\f1\insrsid1970434 Communications}{\f1\insrsid1970434 dialog. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icslogon }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 icslogon }}}{\f1\insrsid1970434 /icslogon }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerLogonScript }}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 internetChessServerLogonScript }}}{\f1\insrsid1970434 /internetChessServerLogonScript }{ - \i\f1\insrsid1970434 filename - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 This option lets you change the name used for the }{\f1\uldb\insrsid1970434 - ICS Logon}{\v\f1\insrsid1970434 ICSLogon}{\f1\insrsid1970434 file. Default: "ICS.ini". The filename is interpreted relative to WinBoard's installation directory (the directory containing WinBoard.exe). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autocomm }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autocomm }}}{\f1\insrsid1970434 /autocomm }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xautocomm}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoComment }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoComment }}}{\f1\insrsid1970434 - /autoComment}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Auto Comment}{\v\f1\insrsid1970434 - AutoCommentCmd}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoflag }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoflag }}}{\f1\insrsid1970434 /autoflag}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xautoflag}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoCallFlag }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autoCallFlag }}}{\f1\insrsid1970434 - /autoCallFlag}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Auto Flag}{\v\f1\uldb\insrsid1970434 AutoFlag - }{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autobs }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 autobs }}}{\f1\insrsid1970434 /autobs}{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xautobs}{ - \b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 autoObserve }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 autoObserveCmd }}}{\f1\insrsid1970434 /autoObserve}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Auto Observe}{\v\f1\insrsid1970434 - autoObserveCmd}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 moves }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 moves }}}{\f1\insrsid1970434 /moves}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xmoves}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 getMoveList }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 getMoveList }}}{\f1\insrsid1970434 /getMoveList}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Get Move List}{\v\f1\insrsid1970434 - getMoveListCmd}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 edit}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 edit}}}{\f1\insrsid1970434 /edit}{ - \cs58\f1\super\insrsid1970434 }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xedit}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 localLineEditing}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 localLineEditingOption}}}{\f1\insrsid1970434 - /localLineEditing}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Local Line Editing}{\v\f1\insrsid1970434 - localLineEditing}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 quiet }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 quiet }}}{\f1\insrsid1970434 /quiet }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xquiet}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 quietPlay }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 quietPlay }}}{\f1\insrsid1970434 /quietPlay}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Quiet Play}{\v\f1\insrsid1970434 quietPlayCmd - }{\f1\insrsid1970434 option. Default: False - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 blindfold (option)}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 opt_blindfold }}}{\f1\insrsid1970434 /blindfold }{ - \i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Blindfold}{\v\f1\insrsid1970434 BlindfoldCmd} - {\f1\insrsid1970434 option. Default: False - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 pre}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 pre}}}{\f1\insrsid1970434 /pre }{\b0\f1\insrsid1970434 or} - {\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\super\insrsid15759832 K}{\insrsid15759832 xpre}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\super\insrsid15759832 #}{\insrsid15759832 xpre}}}{\f1\insrsid1970434 /xpre}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premove (option)}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premove}}}{\f1\insrsid1970434 /premove}{\i\f1\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Premove}{\v\f1\insrsid1970434 PremoveCmd}{ - \f1\insrsid1970434 option. If set to True, the premove feature is enabled. If set to False, premove is disabled and the other }{\f1\uldb\insrsid1970434 Premove}{\v\f1\insrsid1970434 PremoveCmd}{\f1\insrsid1970434 settings are ignored. Default: False. - - \par }\pard\plain \s2\ql \li115\ri0\sb120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 preWhite}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 preWhite}}}{\f1\insrsid1970434 /prewhite }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 xpreWhite}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 xpreWhite}}}{\f1\insrsid1970434 /xprewhite}{\b0\f1\insrsid1970434 , or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premoveWhite}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premoveWhite}}}{\f1\insrsid1970434 /premoveWhite}{ - \i\f1\insrsid1970434 true|false - \par }\pard \s2\ql \li115\ri0\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premoveWhiteText}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premoveWhiteText}}}{\f1\insrsid1970434 /premoveWhiteText}{\i\f1\insrsid1970434 movetext - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If }{\b\f1\insrsid1970434 premoveWhite}{\f1\insrsid1970434 - is set to True and you are playing white in an ICS game, the text specified by the }{\b\f1\insrsid1970434 premoveWhiteText}{\f1\insrsid1970434 option is sent to the ICS as soon as the game starts. These options can be set from the }{ - \f1\uldb\insrsid1970434 Premove}{\v\f1\insrsid1970434 PremoveCmd}{\f1\insrsid1970434 section of the }{\f1\uldb\insrsid1970434 ICS Options}{\v\f1\uldb\insrsid1970434 ICSOptions}{\f1\insrsid1970434 dialog box. The default for }{\b\f1\insrsid1970434 - premoveWhite}{\f1\insrsid1970434 is False. - \par }\pard\plain \s2\ql \li115\ri0\sb120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 preBlack}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 preBlack}}}{\f1\insrsid1970434 /preblack }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 xpreBlack}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 xpreBlack}}}{\f1\insrsid1970434 /xpreblack}{\b0\f1\insrsid1970434 , or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premoveBlack}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premoveBlack}}}{\f1\insrsid1970434 /premoveBlack}{ - \i\f1\insrsid1970434 true|false - \par }\pard \s2\ql \li115\ri0\sa120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premoveBlackText}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premoveBlackText}}}{\f1\insrsid1970434 /premoveBlackText}{\i\f1\insrsid1970434 movetext - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If }{\b\f1\insrsid1970434 premoveBlack}{\f1\insrsid1970434 - is set to True and you are playing black in an ICS game, the text specified by the }{\b\f1\insrsid1970434 premoveBlackText}{\f1\insrsid1970434 - option is sent to the ICS as soon as the first move is received from your opponent, even if you make a different premove on the board before the first white move is received. These options can be set from the }{\f1\uldb\insrsid1970434 Premove}{ - \v\f1\insrsid1970434 PremoveCmd}{\f1\insrsid1970434 section of the }{\f1\uldb\insrsid1970434 ICS Options}{\v\f1\uldb\insrsid1970434 ICSOptions}{\f1\insrsid1970434 dialog box. The default for }{\b\f1\insrsid1970434 premoveBlack}{\f1\insrsid1970434 - is False. - \par }\pard\plain \ql \li115\ri0\sb120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 alarm}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 alarm}}}{\b\insrsid1970434 /alarm }{\insrsid1970434 or}{ - \b\insrsid1970434 }{\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\super\insrsid15759832 K}{\insrsid15759832 xalarm}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\super\insrsid15759832 #}{\insrsid15759832 xalarm}}}{\b\insrsid1970434 /xalarm}{\insrsid1970434 , or }{\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 icsAlarm}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 icsAlarm}}}{\b\insrsid1970434 /icsAlarm }{\b\i\insrsid1970434 true|false}{\b\insrsid1970434 - - \par }\pard \ql \li115\ri0\sa120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 {\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 icsAlarmTime}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 icsAlarmTime}}}{\b\insrsid1970434 /icsAlarmTime }{\b\i\insrsid1970434 milliseconds - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 {\insrsid1970434 When }{\b\insrsid1970434 icsAlarm}{\insrsid1970434 is set to True, the }{\uldb\insrsid1970434 alarm sound}{\v\insrsid1970434 soundIcsAlarm}{ - \insrsid1970434 is played when your clock counts down to }{\b\insrsid1970434 icsAlarmTime}{\insrsid1970434 seconds. For ICS games with time controls that include an increment, the alarm will sound each time the clock counts down to the }{ - \b\insrsid1970434 icsAlarmTime}{\insrsid1970434 . The }{\b\insrsid1970434 icsAlarmTime}{\insrsid1970434 can be set by selecting }{\uldb\insrsid1970434 ICS Alarm}{\v\insrsid1970434 ICSAlarm}{\insrsid1970434 from the }{\uldb\insrsid1970434 ICS options}{ - \v\uldb\insrsid1970434 ICSOptions}{\insrsid1970434 dialog. The default is 5 seconds. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 + - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Load and Save Options} - }${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 - Load and Save Options}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 LoadandSaveOptions}}}{\b0\f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 Load and Save Options - \par }\pard\plain \s2\ql \li115\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 lgf }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 lgf }}}{\f1\insrsid1970434 /lgf }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 loadGameFile }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 loadGameFile }}}{\f1\insrsid1970434 /loadGameFile }{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 \line }{ - \cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 lgi }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 lgi }}}{\f1\insrsid1970434 /lgi }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 loadGameIndex }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 loadGameIndex }}}{\f1\insrsid1970434 /loadGameIndex }{\i\f1\insrsid1970434 N}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If loadGameFile is set, WinBoard reads the specified game file at startup. You can leave out the name of this option and - give just the file name, which is handy if you want to configure WinBoard as a game viewer with a browser such as the Windows Explorer or Netscape. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies th - e standard input. If there is more than one game in the file, WinBoard pops up a menu of the available games, with entries based on their PGN tags. If loadGameIndex is set to }{\i\f1\insrsid1970434 N, }{\f1\insrsid1970434 the menu is suppressed and the }{ - \i\f1\insrsid1970434 N}{\f1\insrsid1970434 th game found in the file is loaded immediately. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 td }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 td }}}{\f1\insrsid1970434 /td }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 timeDelay }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 timeDelay }}}{\f1\insrsid1970434 /timeDelay }{\i\f1\insrsid1970434 seconds}{\f1\insrsid1970434 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Time delay between moves during }{\f1\uldb\insrsid1970434 Load Game}{ - \v\f1\insrsid1970434 LoadGame}{\f1\insrsid1970434 . Fractional seconds are allowed; try 0.4. A time delay value of -1 tells WinBoard not to step through game files automatically. Default: 1 second. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 sgf }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 sgf }}}{\f1\insrsid1970434 /sgf }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 saveGameFile }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 saveGameFile }}}{\f1\insrsid1970434 /saveGameFile }{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is set, Wi - nBoard appends a record of every game played to the specified file. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies the standard output. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 autosave }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 autosave }}}{\f1\insrsid1970434 /autosave}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xautosave}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 autoSaveGames }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 autoSaveGames }}}{\f1\insrsid1970434 /autoSaveGames}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is True, at the end of every game WinBoard prompts you for a filename and appends a record of the game to the file you specify. Ignored if saveGameFile is set. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 lpf}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 lpf}}}{\f1\insrsid1970434 /lpf }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 loadPositionFile }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 loadPositionFile }}}{\f1\insrsid1970434 /loadPositionFile }{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 \line }{ - \cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 lpi }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 lpi }}}{\f1\insrsid1970434 /lpi }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 loadPositionIndex }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 loadPositionIndex }}}{\f1\insrsid1970434 /loadPositionIndex }{\i\f1\insrsid1970434 N}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If loadPositionFile is set, WinBoard loads the specified position file at startup. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies the standard input. If loadPositionIndex is set to }{ - \i\f1\insrsid1970434 N}{\f1\insrsid1970434 , the }{\i\f1\insrsid1970434 N}{\f1\insrsid1970434 th position found in the file is loaded; otherwise the first is loaded. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 spf }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 spf }}}{\f1\insrsid1970434 /spf }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 savePositionFile }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 savePositionFile }}}{\f1\insrsid1970434 /savePositionFile }{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is set, WinBoard appends the final position reached in every game played to the specified file. The filename is interpreted relative to WinBoard's initial working directory. The file name "-" specifies the standard output. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 oldsave }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 oldsave }}}{\f1\insrsid1970434 /oldsave }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xoldsave}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 oldSaveStyle }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 oldSaveStyle }}}{\f1\insrsid1970434 /oldSaveStyle}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is False (the default), WinBoard saves games in PGN (portable game notation) and positions in FEN (Forsythe-Edwards notation). If the option is True, a save style that is compatible with older versions of WinBoard (and of xboard) is used in - stead. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 + - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 User Interface Options - }}${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 - User Interface Options}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 UserInterfaceOptions}}}{\b0\f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 User Interface Options - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 top}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 top}}}{\f1\insrsid1970434 /top }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xtop}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 alwaysOnTop}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 alwaysOnTopOpt}}}{\f1\insrsid1970434 /alwaysOnTop}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Always On Top}{\v\f1\insrsid1970434 - AlwaysOnTop}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 queen}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 queen}}}{\f1\insrsid1970434 /queen}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xqueen}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 alwaysPromoteToQueen}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 alwaysPromoteToQueen}}}{\f1\insrsid1970434 - /alwaysPromoteToQueen}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Always Queen}{\v\f1\insrsid1970434 - AlwaysQueen}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 drag}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 drag}}}{\f1\insrsid1970434 /drag}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xdrag}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 animateDragging}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 animateDraggingOpt}}}{\f1\insrsid1970434 /animateDragging}{\i\f1\insrsid1970434 - true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Animate Dragging}{\v\f1\insrsid1970434 - animateDragging}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 animate}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 animate}}}{\f1\insrsid1970434 /animate }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xanimate}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 animateMoving}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 animateMovingOpt}}}{\f1\insrsid1970434 /animateMoving}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Animate Moving}{\v\f1\insrsid1970434 - animateMoving}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 flip}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 flip}}}{\f1\insrsid1970434 /flip }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xflip}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 flipView}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 flipViewOption}}}{\f1\insrsid1970434 /flipView}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If Auto Flip View is not set, or if you are observing but not participating in a game, then the positioning of the b - oard at the start of each game depends on the flipView option. If flipView is False (the default), the board is positioned so that the white pawns move from the bottom to the top; if True, the black pawns move from the bottom to the top. In any case, the - }{\f1\uldb\insrsid1970434 Flip View}{\v\f1\insrsid1970434 FlipView}{\f1\insrsid1970434 menu command can be used to flip the board after the game starts - \par }\pard\plain \ql \li115\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin115\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 autoflip}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 autoflip}}}{\b\insrsid1970434 /autoflip}{\insrsid1970434 - or }{\b\insrsid1970434 /xautoflip}{\insrsid1970434 , or }{\cs58\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 autoFlipView}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 autoFlipViewOption}}}{\b\insrsid1970434 /autoFlipView }{\b\i\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Auto Flip View}{\v\f1\insrsid1970434 - AutoFlipView}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \ql \li115\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin115\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\b\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 autoraise}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 autoraise}}}{\b\insrsid1970434 /autoraise}{ - \insrsid1970434 or }{\b\insrsid1970434 /xautoraise}{\insrsid1970434 , or }{\cs58\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 autoRaiseBoardOption}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 autoRaiseBoardOption}}}{\b\insrsid1970434 /autoRaiseBoard }{\b\i\insrsid1970434 true|false - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Auto Raise Board}{\v\f1\insrsid1970434 - AutoFlipView}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 highdrag}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 highdrag}}}{\f1\insrsid1970434 /highdrag }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xhighdrag}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 highlightDragging\tab \tab }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 highlightDraggingOpt}}}{\f1\insrsid1970434 - /highlightDragging }{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Highlight Dragging}{\v\f1\insrsid1970434 - highlightDragging}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 highlight}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 highlight}}}{\f1\insrsid1970434 /highlight }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xhighlight}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 highlightLastMove}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 highlightLastMoveOpt}}}{\f1\insrsid1970434 /highlightLastMove}{\i\f1\insrsid1970434 - true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Highlight Last Move}{\v\f1\insrsid1970434 - highlightLastMoveOpt}{\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 popup}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 popup}}}{\f1\insrsid1970434 /exit}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xexit}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 popupMoveErrors}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 popupMoveErrorsOpt}}}{\f1\insrsid1970434 /popupExitMessage}{\i\f1\insrsid1970434 - true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Popup Exit Message}{\v\f1\insrsid1970434 - popupExitMessageCmd}{\f1\insrsid1970434 menu option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 popup}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 popup}}}{\f1\insrsid1970434 /popup}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xpopup}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 popupMoveErrors}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 popupMoveErrorsOpt}}}{\f1\insrsid1970434 /popupMoveErrors}{\i\f1\insrsid1970434 - true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Popup Move Errors}{\v\f1\insrsid1970434 - popupMoveErrorsCmd}{\f1\insrsid1970434 menu option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 coords }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 coords }}}{\f1\insrsid1970434 /coords }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xcoords}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 showCoords}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 showCoords}}}{\f1\insrsid1970434 /showCoords}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Show Coords}{\v\f1\insrsid1970434 showCoords} - {\f1\insrsid1970434 option. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 legal }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 legal }}}{\f1\insrsid1970434 /legal }{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xlegal}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 testLegality }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 testLegality }}}{\f1\insrsid1970434 /testLegality}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Test Legality}{\v\f1\insrsid1970434 - testLegalityCmd}{\f1\insrsid1970434 option. Default: True. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 size }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 size }}}{\f1\insrsid1970434 /size }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 boardSize }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 boardSize }}}{\f1\insrsid1970434 /boardSize }{\i\f1\insrsid1970434 sizename}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the }{\f1\uldb\insrsid1970434 Board Size}{\v\f1\insrsid1970434 BoardSizeCmd - }{\f1\insrsid1970434 option. Also chooses which board size any following Font options will affect. The default is the largest size that will fit on your screen. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 wpc}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 wpc}}}{\f1\insrsid1970434 /wpc}{\b0\f1\insrsid1970434 or - }{\cs58\b0\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 whitePieceColor}}}{\cs58\f1\super\insrsid1970434 #{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 whitePieceColor}}}{\f1\insrsid1970434 /whitePieceColor }{\i\f1\insrsid1970434 color\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 bpc}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 bpc}}}{\f1\insrsid1970434 /bpc }{\b0\f1\insrsid1970434 or }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 blackPieceColor}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 blackPieceColor}}}{ - \f1\insrsid1970434 /blackPieceColor }{\i\f1\insrsid1970434 color\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 lsc}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 lsc}}}{\f1\insrsid1970434 /lsc }{\b0\f1\insrsid1970434 or}{\i\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 lightSquareColor}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 lightSquareColor}}}{\f1\insrsid1970434 - /lightSquareColor }{\i\f1\insrsid1970434 color}{\cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 dsc}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 dsc}}}{\f1\insrsid1970434 /dsc }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{ - \cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 darkSquareColor}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 darkSquareColor}}}{\f1\insrsid1970434 /darkSquareColor }{\i\f1\insrsid1970434 color}{\cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Color specifications for white pieces, black pieces, light squares, - and dark squares. Colors can be specified only by red/green/blue intensity, either in hexadecimal (as }{\i\f1\insrsid1970434 #rrggbb}{\f1\insrsid1970434 ) or in decimal (as }{\i\f1\insrsid1970434 rrr,ggg,bbb}{\f1\insrsid1970434 - ). In the latter format, you must enclose the string in quotation marks if you leave spaces after the commas. The defaults are respectively #FFFFCC, #202020, #C8C365, and #77A26D. Available on the }{\f1\uldb\insrsid1970434 Board Colors}{ - \v\f1\insrsid1970434 BoardColors}{\f1\insrsid1970434 section of the }{\f1\uldb\insrsid1970434 Board Options}{\v\f1\insrsid1970434 BoardOptions}{\f1\insrsid1970434 dialog. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If you are using a }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 grayscale}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 grayscale}}}{\f1\insrsid1970434 - grayscale monitor, try setting the colors to: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\fs20\insrsid1970434 -whitePieceColor:#FFFFFF\line - -blackPieceColor:#000000\line -lightSquareColor:#CCCCCC\line -darkSquareColor:#999999 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 hsc}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 hsc}}}{\f1\insrsid1970434 /hsc }{\b0\f1\insrsid1970434 or} - {\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 highlightSquareColor}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 - {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 highlightSquareColor}}}{\f1\insrsid1970434 /highlightSquareColor }{\i\f1\insrsid1970434 color}{\cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 K}{\insrsid15759832 phc}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\super\insrsid15759832 #}{\insrsid15759832 phc}}}{\f1\insrsid1970434 /phc }{ - \b0\f1\insrsid1970434 or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 premoveHighlightColor}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 premoveHighlightColor}}}{\f1\insrsid1970434 /premoveHighlightColor }{\i\f1\insrsid1970434 color}{\cs58\f1\super\insrsid1970434 }{ - \f1\insrsid1970434 - \par }{\b0\f1\insrsid1970434 Color specifications for the }{\b0\f1\uldb\insrsid1970434 Highlight Last Move}{\b0\v\f1\insrsid1970434 HighlightLastMove}{\b0\f1\insrsid1970434 and }{\b0\f1\uldb\insrsid1970434 Premove}{\b0\v\f1\insrsid1970434 PremoveCmd}{ - \b0\f1\insrsid1970434 options, respectively. Colors can be specified only by red/green/blue intensity, either in hexadecimal (as }{\b0\i\f1\insrsid1970434 #rrggbb}{\b0\f1\insrsid1970434 ) or in decimal (as }{\b0\i\f1\insrsid1970434 rrr,ggg,bbb}{ - \b0\f1\insrsid1970434 ). In the latter format, you must enclose the string in quotation marks if you leave spaces after the commas. The defaults are respectively #FFFF00 and #FF0000, respectively. - \par }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 mono }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 mono }}}{\f1\insrsid1970434 /mono}{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xmono}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 monoMode}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 monoMode}}}{ - \f1\insrsid1970434 /monoMode}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Determines whether WinBoard displays its pieces and squares in black and white (True) or color (False, the default). Available in the }{\f1\uldb\insrsid1970434 Board Colors}{\v\f1\insrsid1970434 BoardColors}{\f1\insrsid1970434 section of the }{ - \f1\uldb\insrsid1970434 Board Options}{\v\f1\insrsid1970434 BoardOptions}{\f1\insrsid1970434 dialog. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorShout}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorShout}}}{\f1\insrsid1970434 /colorShout}{ - \i\f1\insrsid1970434 \'93effects color\'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorSShout}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorSShout}}}{\f1\insrsid1970434 /colorSShout }{\i\f1\insrsid1970434 \'93effects color\'94\line }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorChannel1}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorChannel1}}}{ - \f1\insrsid1970434 /colorChannel1 }{\i\f1\insrsid1970434 \'93effects color\'94}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorChannel}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorChannel}}}{\f1\insrsid1970434 /colorChannel }{\i\f1\insrsid1970434 \'93effects color - \'94}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorKibitz}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorKibitz}}}{\f1\insrsid1970434 /colorKibitz }{\i\f1\insrsid1970434 \'93effects color\'94}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorTell}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorTell}}}{\f1\insrsid1970434 /colorTell }{ - \i\f1\insrsid1970434 \'93effects color\'94}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorChallenge}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorChallenge}}}{\f1\insrsid1970434 /colorChallenge }{\i\f1\insrsid1970434 \'93effects color\'94}{\f1\insrsid1970434 \line }{ - \cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 colorRequest}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 colorRequest}}}{\f1\insrsid1970434 /colorRequest }{\i\f1\insrsid1970434 \'93effects color\'94}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorSeek}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorSeek}}}{\f1\insrsid1970434 /colorSeek }{\i\f1\insrsid1970434 \'93effects color\'94}{ - \f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorNormal}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorNormal}}}{\f1\insrsid1970434 /colorNormal }{\i\f1\insrsid1970434 \'93effects color\'94 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Select colors and effects to colorize messages in the ICS Interaction window. The effects may be any combination of }{\b\f1\insrsid1970434 b}{\f1\insrsid1970434 old, }{\b\f1\insrsid1970434 i}{\f1\insrsid1970434 talic, }{\b\f1\insrsid1970434 u}{ - \f1\insrsid1970434 nderline, and }{\b\f1\insrsid1970434 s}{\f1\insrsid1970434 trikeout. Colors are specified as for squares and pieces. Available on the }{\f1\uldb\insrsid1970434 ICS Interaction Colors}{\v\f1\insrsid1970434 ICSInteractionColors}{ - \f1\insrsid1970434 section of the }{\f1\uldb\insrsid1970434 ICS Options}{\v\f1\insrsid1970434 ICSOptions}{\f1\insrsid1970434 dialog. Limitation: On 256 color displays, Windows chooses the nearest solid color from the system - palette, which will not always be close to the color you selected. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorBackground}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorBackground}}}{\f1\insrsid1970434 - /colorBackground }{\i\f1\insrsid1970434 color - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the background color for the ICS Interaction window. Available on the }{ - \f1\uldb\insrsid1970434 ICS Interaction Colors}{\v\f1\insrsid1970434 ICSInteractionColors}{\f1\insrsid1970434 section of the }{\f1\uldb\insrsid1970434 ICS Options}{\v\f1\insrsid1970434 ICSOptions}{\f1\insrsid1970434 dialog. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorize}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorize}}}{\f1\insrsid1970434 /colorize}{ - \cs58\f1\super\insrsid1970434 }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xcolorize}{\b0\f1\insrsid1970434 , or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 colorizeMessages}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 colorizeMessages}}}{\f1\insrsid1970434 /colorizeMessages}{\i\f1\insrsid1970434 - true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If True, WinBoard colorizes messages in the ICS Interaction window with the colors listed above. Default: True. Available in the }{\f1\uldb\insrsid1970434 ICS Interaction Colors}{\v\f1\insrsid1970434 ICSInteractionColors}{\f1\insrsid1970434 - section of the }{\f1\uldb\insrsid1970434 ICS Options}{\v\f1\insrsid1970434 ICSOptions}{\f1\insrsid1970434 dialog. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 clockFont}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 clockFont}}}{\f1\insrsid1970434 /clockFont \'93}{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 messageFont}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 messageFont}}}{\f1\insrsid1970434 - /messageFont \'93}{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 coordFont}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 coordFont}}}{\f1\insrsid1970434 /coordFont \'93}{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 tagsFont}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 tagsFont}}}{\f1\insrsid1970434 /tagsFont \'93 - }{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 commentFont}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 commentFont}}}{\f1\insrsid1970434 /commentFont \'93 - }{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 icsFont}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 icsFont}}}{\f1\insrsid1970434 /icsFont \'93}{\i\f1\insrsid1970434 fontname:size effects}{\f1\insrsid1970434 \'94 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The fonts used respectively for the clocks, the message display line, rank and file coordinate labels, the Edit Tags dialog, the Edit Comment dialog, and the ICS Interaction wi - ndow. These options may be given more than once. Each occurrence affects the fonts for the current board size; that is, the size given in the last preceding /boardSize option, if any, or else the default size. The font size may contain a decimal point, an - d the effects may be any combination of }{\b\f1\insrsid1970434 b}{\f1\insrsid1970434 old, }{\b\f1\insrsid1970434 i}{\f1\insrsid1970434 talic, }{\b\f1\insrsid1970434 u}{\f1\insrsid1970434 nderline, and }{\b\f1\insrsid1970434 s}{\f1\insrsid1970434 - trikeout. Example: }{\f2\fs16\insrsid1970434 /clockFont="Arial:20.0 bi".}{\f1\insrsid1970434 Available on the }{\f1\uldb\insrsid1970434 Fonts}{\v\f1\insrsid1970434 Fonts}{\f1\insrsid1970434 menu.}{\f2\fs16\insrsid1970434 - \par }\pard\plain \s2\ql \li115\ri0\sb120\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundShout}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundShout}}}{\insrsid1970434 /soundShout}{ - \i\insrsid1970434 sound\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundSShout}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundSShout}}}{\insrsid1970434 /soundSShout }{\i\insrsid1970434 sound\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundChannel1}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundChannel1}}}{\insrsid1970434 /soundChannel1 }{\i\insrsid1970434 sound}{ - \insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundChannel}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundChannel}}}{\insrsid1970434 /soundChannel }{\i\insrsid1970434 sound}{\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundKibitz}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundKibitz}}}{\insrsid1970434 /soundKibitz }{\i\insrsid1970434 sound}{\insrsid1970434 - \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{ - \f1\insrsid15759832 soundTell}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 soundTell}}}{\insrsid1970434 /soundTell }{\i\insrsid1970434 sound}{\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundChallenge}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundChallenge}}}{\insrsid1970434 /soundChallenge }{\i\insrsid1970434 sound}{ - \insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundRequest}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundRequest}}}{\insrsid1970434 /soundRequest }{\i\insrsid1970434 sound}{\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundMove}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundMove}}}{\insrsid1970434 /soundMove }{\i\insrsid1970434 sound}{ - \cs58\f1\super\insrsid1970434 }{\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundBell}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundBell}}}{\insrsid1970434 /soundBell }{\i\insrsid1970434 sound}{\cs58\f1\super\insrsid1970434 }{\insrsid1970434 - \par }\pard \s2\ql \li115\ri0\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundIcsWin}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundIcsWin}}}{\f1\insrsid1970434 /soundIcsWin }{\i\f1\insrsid1970434 sound}{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundIcsLoss}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundIcsLoss}}}{ - \f1\insrsid1970434 /soundIcsLoss }{\i\f1\insrsid1970434 sound}{\cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundIcsDraw}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundIcsDraw}}}{\f1\insrsid1970434 /soundIcsDraw }{\i\f1\insrsid1970434 sound}{ - \cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 \line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundIcsUnfinished}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundIcsUnfinished}}}{\f1\insrsid1970434 /soundIcsUnfinished }{\i\f1\insrsid1970434 sound}{\cs58\f1\super\insrsid1970434 }{ - \f1\insrsid1970434 - \par }\pard \s2\ql \li115\ri0\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin115\itap0 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 soundIcsAlarm}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 soundIcsAlarm}}}{\f1\insrsid1970434 /soundIcsAlarm }{\i\f1\insrsid1970434 sound}{ - \cs58\f1\super\insrsid1970434 }{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Associate sounds with WinBoard events. Most of the events are the same ones - that cause text colorization. In addition, }{\b\f1\insrsid1970434 soundMove}{\f1\insrsid1970434 is played if a chess engine or another player makes a move. }{\b\f1\insrsid1970434 SoundBell}{\f1\insrsid1970434 - is played if the chess server sends an ASCII BEL character (Ctrl+G). Available on the }{\f1\uldb\insrsid1970434 Sounds}{\v\f1\insrsid1970434 Sounds}{\f1\insrsid1970434 menu. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\insrsid1970434 SoundIcsWin}{\insrsid1970434 , }{\b\insrsid1970434 soundIcsLoss}{ - \insrsid1970434 , }{\b\insrsid1970434 soundIcsDraw}{\insrsid1970434 and }{\b\insrsid1970434 soundIcsUnfinished}{\insrsid1970434 are played at the conclusion of an ICS game. The result of the game determines which sound is played. - \par }{\b\insrsid1970434 SoundIcsAlarm}{\insrsid1970434 is played when your game clock counts down to }{\uldb\insrsid1970434 icsAlarmTime}{\v\uldb\insrsid1970434 icsAlarmTime}{\insrsid1970434 . - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480\faauto\adjustright\rin0\lin120\itap0 {\f1\insrsid1970434 The }{\i\f1\insrsid1970434 sound}{\f1\insrsid1970434 argument may be one of the following: - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls2\adjustright\rin0\lin480\itap0 {\f1\insrsid1970434 The name of a }{\f2\insrsid1970434 .wav}{\f1\insrsid1970434 file. The filename is interpreted relative to WinBoard's installation directory (the directory containing WinBoard.exe). - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls2\adjustright\rin0\lin480\itap0 {\f2\insrsid1970434 $}{\f1\insrsid1970434 , indicating the default system sound. - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls2\adjustright\rin0\lin480\itap0 {\f2\insrsid1970434 !}{\f1\insrsid1970434 followed by the name of a built-in WinBoard wave resource. - \par {\pntext\pard\plain\f3\fs20\insrsid1970434 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang {\pntxtb \'b7}} - \faauto\ls2\adjustright\rin0\lin480\itap0 {\f2\insrsid1970434 !}{\f1\insrsid1970434 alone, or \'93\'94 (empty string), indicating silence. - \par }\pard \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 {\f1\insrsid1970434 The default for soundMove and soundBell is }{\f2\insrsid1970434 $}{\f1\insrsid1970434 , while the others default to silence. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 icsMenu}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 icsMenu}}}{\f1\insrsid1970434 /icsMenu=\{}{ - \i\f1\insrsid1970434 entries}{\f1\insrsid1970434 \} }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /icsMenu=@}{\i\f1\insrsid1970434 filename - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 This option lets you customize the right-button }{\f1\uldb\insrsid1970434 - context menu}{\v\f1\insrsid1970434 ICSInteractionContextMenu}{\f1\insrsid1970434 that is available in the upper (output) pane of the ICS - Interaction window. It consists of a list of menu entries, one per line. If the option value starts with an @ sign, it is the name of a file that contains the entries. Each entry contains either four fields separated by commas or the single character }{ - \f2\insrsid1970434 "-"}{\f1\insrsid1970434 . The fields are: - \par {\pntext\pard\plain\f4\fs20\insrsid1970434 \hich\af4\dbch\af0\loch\f4 1.\tab}}\pard\plain \ql \fi-360\li480\ri0\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang {\pntxta .}} - \faauto\ls14\adjustright\rin0\lin480\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 The menu text. If this field begins with }{\f2\insrsid1970434 "|"}{\insrsid1970434 , the item begins a new column in the menu and the }{ - \f2\insrsid1970434 "|"}{\insrsid1970434 is not shown. If this field contains an }{\f2\insrsid1970434 "&"}{\insrsid1970434 , the character after the ampersand is underlined in the menu and acts as a keyboard shortcut - for the item when the menu is displayed. Do not assign the same shortcut key to two different menu items. - \par {\pntext\pard\plain\s26 \f1\fs20\insrsid1970434 \hich\af1\dbch\af0\loch\f1 2.\tab}}\pard\plain \s26\ql \fi-360\li480\ri0\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang {\pntxta .}} - \faauto\ls14\adjustright\rin0\lin480\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Text to insert into the input pane. The text cannot include a comma. You can use ICS aliases to get around this limitation. - \par {\pntext\pard\plain\s26 \f1\fs20\insrsid1970434 \hich\af1\dbch\af0\loch\f1 3.\tab}}\pard \s26\ql \fi-360\li480\ri0\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang {\pntxta .}} - \faauto\ls14\adjustright\rin0\lin480\itap0 {\f1\insrsid1970434 A flag (1 or 0) saying whether to insert a space and }{\i\f1\insrsid1970434 name }{\f1\insrsid1970434 (see }{\f1\uldb\insrsid1970434 above}{\v\f1\insrsid1970434 Tell}{\f1\insrsid1970434 - ) after the text. If you set this flag, you might also want to put "(name)" into the menu text as a memory aid. - \par {\pntext\pard\plain\s26 \f1\fs20\insrsid1970434 \hich\af1\dbch\af0\loch\f1 4.\tab}}\pard \s26\ql \fi-360\li480\ri0\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang {\pntxta .}} - \faauto\ls14\adjustright\rin0\lin480\itap0 {\f1\insrsid1970434 A flag (1 or 0) saying whether the result should be sent immediately to ICS or left in the input pane for further editing. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 The entry }{\f2\insrsid1970434 "-"}{\insrsid1970434 - produces a separator line in the menu. The top three menu entries are always }{\b\insrsid1970434 Copy and Paste}{\insrsid1970434 , }{\b\insrsid1970434 Copy}{\insrsid1970434 , and }{\b\insrsid1970434 Paste}{\insrsid1970434 - , but you have full control over the rest of the menu. - \par }{\f1\insrsid1970434 The default menu is: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\fs20\insrsid1970434 \endash \line &Who,who,0,1\line - Playe&rs,players,0,1\line &Games,games,0,1\line &Sought,sought,0,1\line |&Tell (name),tell,1,0\line M&essage (name),message,1,0\line \endash \line &Finger (name),finger,1,1\line &Vars (name),vars,1,1\line &Observe (name),observe,1,1\line - &Match (name),match,1,1\line Pl&ay (name),play,1,1 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 There is no graphical user in - terface to set this option. To change it, edit your }{\f1\uldb\insrsid1970434 settings}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 file with a plain text editor such as Notepad. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 icsNames}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 icsNames}}}{\f1\insrsid1970434 /icsNames=\{}{ - \i\f1\insrsid1970434 names}{\f1\insrsid1970434 \} }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /icsNames=@}{\i\f1\insrsid1970434 filename - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 This option lets you customize the drop-down list of ICS names that ap - pears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepends the te - xt \'94/ics /icsHost=\'94 and adds the result to the command-line options. There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb\insrsid1970434 settings}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 - file with a plain text editor such as Notepad. - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 firstChessProgramNames}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 firstChessProgramNames}}}{ - \f1\insrsid1970434 /firstChessProgramNames=\{}{\i\f1\insrsid1970434 names}{\f1\insrsid1970434 \} }{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /firstChessProgramNames="@}{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 " - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - This option lets you customize the first drop-down list of chess engine names that appears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains th - e strings. When you select a string from the drop-down list, WinBoard prepends the text \'94/cp /firstChessProgram=\'94 and adds the result to the command-line options. - \par - \par There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb\insrsid1970434 settings}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 file with a plain text editor such as Notepad. Example: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\insrsid1970434 /firstChessProgramNames=\{GNUChess - \line WCrafty-15_11 /fd="C:\\Program Files\\Crafty"\line ArasanX /fd="C:\\Program Files\\Arasan\\Arasan 4.1"\line "EXchess xb" /fd=C:\\EXchess\line Comet-WB /fd=C:\\Comet\line \} - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 secondChessProgramNames}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 secondChessProgramNames}}}{ - \f1\insrsid1970434 /secondChessProgramNames=\{}{\i\f1\insrsid1970434 names}{\f1\insrsid1970434 \}}{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /secondChessProgramNames="@}{\i\f1\insrsid1970434 filename}{\f1\insrsid1970434 "}{\i\f1\insrsid1970434 - - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - This option lets you customize the second drop-down list of chess engine names that appears in the WinBoard startup dialog. It consists of a lis - t of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepends the text \'94/cp /secondChessProgram=\'94 - and adds the result to the command-line options. - \par - \par There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb\insrsid1970434 settings}{\v\f1\insrsid1970434 settings}{\f1\insrsid1970434 file with a plain text editor such as Notepad. Example: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 /secondChessProgramNames=\{GNUChess - \line WCrafty-15_11 /sd="C:\\\\Program Files\\\\Crafty\\"\line ArasanX /sd="C:\\Program Files\\Arasan\\Arasan 4.1"\line "EXchess xb" /sd=C:\\EXchess\line Comet-WB /sd=C:\\Comet\line \}}{\f1\insrsid1970434 - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xy coordinates of board}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xy}}}{\f1\insrsid1970434 /x=}{ - \i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /y=}{\i\f1\insrsid1970434 ycoord - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the initial location of the board window, giving the screen - coordinates of the upper left-hand corner. Both arguments must be given together. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xywh coordinates of Analysis window}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xywh}}}{ - \f1\insrsid1970434 /analysisX=}{\i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /analysisY=}{\i\f1\insrsid1970434 ycoord}{\f1\insrsid1970434 /analysisW=}{\i\f1\insrsid1970434 width}{\f1\insrsid1970434 /analysisH=}{\i\f1\insrsid1970434 height - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets the initial location and size of the Analysis wi - ndow, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xywh coordinates of Comment window}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xywh}}}{ - \f1\insrsid1970434 /commentX=}{\i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /commentY=}{\i\f1\insrsid1970434 ycoord}{\f1\insrsid1970434 /commentW=}{\i\f1\insrsid1970434 width}{\f1\insrsid1970434 /commentH=}{\i\f1\insrsid1970434 height - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Set - s the initial location and size of the Comment window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xywh coordinates of Game List window}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xywh}}}{ - \f1\insrsid1970434 /gameListX=}{\i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /gameListY=}{\i\f1\insrsid1970434 ycoord}{\f1\insrsid1970434 /gameListW=}{\i\f1\insrsid1970434 width}{\f1\insrsid1970434 /gameListH=}{\i\f1\insrsid1970434 height - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Sets the initial location and size of the Game List window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xywh coordinates of ICS Interaction window}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xywh}}}{ - \f1\insrsid1970434 /icsX=}{\i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /icsY=}{\i\f1\insrsid1970434 ycoord}{\f1\insrsid1970434 /icsW=}{\i\f1\insrsid1970434 width}{\f1\insrsid1970434 /icsH=}{\i\f1\insrsid1970434 height - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Sets the initial location and size of the ICS Interaction window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 xywh coordinates of Tags window}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 xywh}}}{\f1\insrsid1970434 /tagsX=}{ - \i\f1\insrsid1970434 xcoord }{\f1\insrsid1970434 /tagsY=}{\i\f1\insrsid1970434 ycoord}{\f1\insrsid1970434 /tagsW=}{\i\f1\insrsid1970434 width}{\f1\insrsid1970434 /tagsH=}{\i\f1\insrsid1970434 height - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Sets - the initial location and size of the Tags window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 + - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Other Options}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Other Options}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 OtherOptions}}}{\b0\f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 Other Options - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 ncp }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 ncp }}}{\f1\insrsid1970434 /ncp}{\b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xncp}{ - \b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 K}{\f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 noChessProgram}}#{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\lang1031\langfe1033\super\langnp1031\insrsid15759832\charrsid2905661 #}{ - \f1\lang1031\langfe1033\langnp1031\insrsid15759832\charrsid2905661 noChessProgram}}}{\f1\insrsid1970434 /noChessProgram}{\i\f1\insrsid1970434 true|false}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If this option is True, WinBoard acts as a passive chessboard; it does not start a chess program or connect to ICS. This option also sets clockMode to False. Default: False. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 mode}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 mode}}}{\f1\insrsid1970434 /mode}{ - \b0\f1\insrsid1970434 or }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 initialMode}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 initialMode}}}{\f1\insrsid1970434 /initialMode }{\i\f1\insrsid1970434 modename - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 If this option is given, WinBoard selects the given }{\i\f1\insrsid1970434 - modename}{\f1\insrsid1970434 from the }{\f1\uldb\insrsid1970434 Mode menu}{\v\f1\insrsid1970434 ModeMenu }{\f1\insrsid1970434 after starting and (if applicable) processing the }{\f1\uldb\insrsid1970434 loadGameFile}{\v\f1\insrsid1970434 loadGameFile }{ - \f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 loadPositionFile}{\v\f1\insrsid1970434 loadPositionFile }{\f1\insrsid1970434 option. Default: "". Other supported values are TwoMachines, - AnalyzeFile, Analysis, MachineWhite, MachineBlack, EditGame, EditPosition, and Training. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 variant}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 variant}}}{\f1\insrsid1970434 /variant}{ - \b0\f1\insrsid1970434 }{\i\f1\insrsid1970434 varname}{\f1\insrsid1970434 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 - Activates preliminary, partial support for playing chess variants against a local engine or editing variant games. This flag is not needed in ICS mode. Recognized variant names are: - \par normal\tab Normal chess\line wildcastle\tab Shuffle chess, king can castle from d file\line nocastle\tab Shuffle chess, no castling allowed\line fischerandom\tab Fischer Random shuffle chess\line bughouse\tab Bughouse, ICC/FICS rules\line crazyhouse\tab - Crazyhouse, ICC/FICS rules\line losers \tab Lose all pieces or get mated (ICC wild 17)\line suicide\tab Lose all pieces including king (FICS)\line giveaway\tab Try to have no legal moves (ICC wild 26)\line twokings\tab Weird ICC wild 9\line kriegspiel - \tab Opponent's pieces are invisible\line atomic \tab Capturing piece explodes (ICC wild 27)\line 3check\tab Win by giving check 3 times (ICC wild 25) - \par In the shuffle variants, WinBoard does - not shuffle the pieces, but you can do it by hand using Edit Position. Some variants are supported only in ICS mode, including fischerandom, bughouse, and kriegspiel. The winning/drawing conditions in crazyhouse (offboard interposition on mate), losers, s - uicide, giveaway, atomic, and 3check are not fully understood. In crazyhouse, WinBoard does not yet keep track of offboard pieces. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 debug}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 debug}}}{\f1\insrsid1970434 /debug}{ - \b0\f1\insrsid1970434 or }{\f1\insrsid1970434 /xdebug}{\b0\f1\insrsid1970434 ,}{\f1\insrsid1970434 }{\b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 debugMode}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0 - \nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 debugMode}}}{\f1\insrsid1970434 /debugMode}{\i\f1\insrsid1970434 true|false}{ - \f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Writes debugging information to the file \'93WinBoard.debug\'94 - , including all commands sent to the chess engine, all output received from it, and all commands sent to ICS. You can press Ctrl+Alt+F12 to turn this option on or off while WinBoard is running. Each time you turn it on, any existing de - bug file is overwritten. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 rsh }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 rsh }}}{\f1\insrsid1970434 /rsh }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 remoteShell }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 remoteShell }}}{\f1\insrsid1970434 /remoteShell }{\i\f1\insrsid1970434 shellname}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Name of the command used to run programs remotely. If this option is not given, WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 uses its own built-in implementation of the Unix }{\i\f1\insrsid1970434 rcmd}{\f1\insrsid1970434 protoco - l (the protocol used by }{\i\f1\insrsid1970434 rsh}{\f1\insrsid1970434 ). - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 ruser }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ruser }}}{\f1\insrsid1970434 /ruser }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 remoteUser }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 remoteUser }}}{\f1\insrsid1970434 /remoteUser }{\i\f1\insrsid1970434 username}{\f1\insrsid1970434 - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - User name on the remote system when running programs with the remoteShell. The default is your local user name. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 ini }}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ini }}}{\f1\insrsid1970434 /ini }{ - \b0\f1\insrsid1970434 or}{\f1\insrsid1970434 }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 settingsFile }}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 settingsFile }}}{\f1\insrsid1970434 /settingsFile }{\i\f1\insrsid1970434 filename\line }{\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt - \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 at sign}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 atsign }}}{\f1\insrsid1970434 @ }{ - \i\f1\insrsid1970434 file-name - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 See }{\f1\uldb\insrsid1970434 Settings}{\v\f1\insrsid1970434 Settings}{ - \f1\insrsid1970434 . - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Initialization files}} - K{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Files}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Files}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Files}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs20\insrsid1970434 INITIALIZATION FILES - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Settings }}}{\f1\fs18\up6\insrsid1970434 }{ - \cs58\f1\super\insrsid1970434 #{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{ - \f1\insrsid15759832 Settings }}}{\f1\insrsid1970434 Settings - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 When WinBoard starts up, it reads option settings from a file named }{ - \i\insrsid1970434 WinBoard.ini }{\insrsid1970434 in its installation directory (the directory containing WinBoard.exe). Options in this file have the same format as }{\uldb\insrsid1970434 command line options}{\v\insrsid1970434 Options}{\insrsid1970434 - , except that they do not all have to be on a single line. You can put a comment in a settings file by preceding it with a semicolon (}{\f2\insrsid1970434 ;}{\insrsid1970434 ). - \par The WinBoard.ini file is read before the command line is processed, so any options you give on the command line override options in the file. - \par }{\f1\insrsid1970434 If WinBoard encounters a /}{\f1\uldb\insrsid1970434 settingsFile}{\v\f1\insrsid1970434 settingsFile}{\f1\insrsid1970434 }{\i\f1\insrsid1970434 filename }{\f1\insrsid1970434 or }{\f1\uldb\insrsid1970434 @}{\v\f1\insrsid1970434 atsign} - {\i\f1\insrsid1970434 filename }{\f1\insrsid1970434 option while reading settings (whether from the command line or a file), it reads more settings from the given file before reading the next option. - \par The }{\f1\uldb\insrsid1970434 Save Settings Now}{\v\f1\insrsid1970434 SaveSettings}{\f1\insrsid1970434 menu command writes the current values of most options to a file. In addition, settings are saved automatically when WinBoard exits if }{ - \f1\uldb\insrsid1970434 Save Settings on Exit}{\v\f1\insrsid1970434 SaveSettingsOnExit}{\f1\insrsid1970434 is checked. The settings are written to the last file named in a /settingsFile command, if any; otherwise to WinBoard.ini}{\i\f1\insrsid1970434 .}{ - \f1\insrsid1970434 The @ option does not affect which file settings are saved to. - \par Warning: Because Save Settings overwrites the last settings file (usually WinBoard.ini) and only saves a subset of WinBoard's options, you should not - add settings of more options to such a file with a text editor. If you do this, your additional options will be lost on the next Save Settings. You can change the values of existing settings freely, using Notepad or any plain text editor. Be careful not t - o do this while WinBoard is running, however, unless you know that Save Settings on Exit is off. Otherwise all your changes will be overwritten and lost when WinBoard exits. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid1970434 K{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 ICS Logon}}#{\footnote\ftnalt \pard\plain - \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 ICSLogon}}}{\f1\insrsid1970434 ICS Logon - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Whenever WinBoard connects to the Internet Ches - s Server, if it finds a file called }{\i\f1\insrsid1970434 ICS.ini }{\f1\insrsid1970434 in its installation directory}{\i\f1\insrsid1970434 ,}{\f1\insrsid1970434 - it feeds the file's contents to the ICS as commands. Usually the first two lines of the file should be your ICS user name and password. You can specify a different name instead of }{\i\f1\insrsid1970434 ICS.ini}{\f1\insrsid1970434 by using the }{ - \f1\uldb\insrsid1970434 icslogon}{\v\f1\insrsid1970434 icslogon}{\f1\insrsid1970434 command line option. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 - Installing Chess Engines}}${\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{ - \f1\insrsid15759832 Installing Chess Engines}}#{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 { - \cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 InstallingChessEngines}}+{\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 - \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{\f1\fs20\insrsid1970434 INSTALLING CHESS ENGINES - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Introduction - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 WinBoard is capable of operating with many different chess engines. - You can play chess against a compatible engine, set up matches between two engines, or (advanced users only) run an automated computer player on an ICS. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Typically, the main difficulty in installing a new chess engine for use by WinBoard comes in getting the engine itself running and setting its options appropriately. The connection to WinBoard is relatively straightforward. - \par WinBoard-compatible chess engines are Win32 command line programs that you can run by hand in an MS-DOS Prompt box and type human-reada - ble commands to. WinBoard connects to an engine simply by starting the engine up in the background and communicating with it through a pair of pipes. Therefore the basic procedure for installing an engine is: - \par }\pard\plain \s20\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 1. Get a copy of the engine and any supporting files it needs. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - 2. Install and configure the engine as a command-line program by following the instructions that come with it. Try it out by running it from the command line in an MS-DOS Prompt box and make sure it works. - \par 3. Optional, but recommended: Try out the WinBoard plus engine combination by running WinBoard with the proper command line arguments in an MS-DOS Prompt box. - \par 4. Create a shortcut on your desktop or Start menu to run the engine with WinBoard. - \par 5. Optionally edit your WinBoard.ini file to add the engine to the drop-down lists on WinBoard's startup dialog. - \par This document cannot explain steps 1 and 2 in detail for all engines, but we will take you through all five steps in outline, using Crafty as an example. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Example: Crafty - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 1. Choose a directory to put Crafty in. We'll use }{\f2\insrsid1970434 C:\\ - Program Files\\Crafty}{\f1\insrsid1970434 in this example. Download your copy of Crafty into this directory from its author's FTP site, }{\f2\insrsid1970434 ftp://ftp.cis.uab.edu/pub/hyatt}{\f1\insrsid1970434 . At this writing, you will ne - ed at least the following files: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\fs20\insrsid1970434 read.me\line v15/crafty.doc - \line v15/crafty.faq\line v15/wcrafty-15.*.exe}{\f1\fs20\insrsid1970434 (where * is replaced by the largest number there)\line }{\f2\fs20\insrsid1970434 common/start.zip}{\fs20\insrsid1970434 \line }{\f2\fs20\insrsid1970434 common/medium.zip}{ - \fs20\insrsid1970434 }{\f1\fs20\insrsid1970434 (or another book). - \par }\pard\plain \s16\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - 2. The first three files are documentation that you can read with a text editor. Read the read.me file first and follow the instructions carefully. This will take some time. Do not write to the author of WinBoard if you have trouble with the instructions - in the Crafty read.me. Try running Crafty from an MS-DOS Prompt box and make sure it works before you go on. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 3. Optional, but recommended: In an MS-DOS Prompt box,}{\insrsid1970434 }{ - \f2\insrsid1970434 cd }{\f1\insrsid1970434 to the directory where WinBoard is installed, typically }{\f2\insrsid1970434 "C:\\Program Files\\WinBoard"}{\f1\insrsid1970434 . Then - type the following command line. Use the actual name of the wcrafty file you downloaded, not an }{\f2\insrsid1970434 *}{\f1\insrsid1970434 - , and if your browser changed the first period to an underscore when you downloaded the file, make that change in the command line too. - \par }\pard\plain \s63\ql \fi-720\li1440\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin1440\itap0 \f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 WinBoard /cp /fcp=WCrafty-15.* /fd="C:\\Program Files\\ - Crafty" /scp=WCrafty-15.* /sd="C:\\Program Files\\Crafty" - \par }\pard\plain \s16\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - WinBoard should start up, with Crafty running as its chess engine. Check that you can play chess against Crafty. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 4. To make a shortcut or Start menu entry for Crafty: Rig - ht-click on the desktop and select New/Shortcut. Use the Browse button to find your winboard.exe file and get its name into the Command Line box. (It usually will be "C:\\Program Files\\WinBoard\\ - winboard.exe".) Click in the Command Line box and hit the End key to go to the end. Add the following to the end of the command line, }{\i\f1\insrsid1970434 after}{\f1\insrsid1970434 - the closing quotation mark. Use the actual name of the wcrafty file you downloaded, not an }{\f2\insrsid1970434 *}{\f1\insrsid1970434 , and if your browser changed the first period to an underscore when you downloaded the - file, make that change in the command line too. - \par }\pard\plain \s63\ql \fi-720\li1440\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin1440\itap0 \f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1970434 /cp /fcp=WCrafty-15.* /fd="C:\\Program Files\\Crafty" \line - /scp=WCrafty-15.* /sd="C:\\Program Files\\Crafty" - \par }\pard\plain \s62\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Press Next, choose a name for the shortcut, and press Finish. You can now use this shortcut to run WinBoard with Crafty. Double-click it to check that it works. You can drag or copy the shortcut into your Start menu if you like. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 5. To add Crafty as an option in the WinBoard Startup dialog, edit your }{ - \f1\uldb\insrsid1970434 WinBoard.ini file}{\v\f1\insrsid1970434 Settings}{\f1\insrsid1970434 with Notepad or another plain text editor, carefully following the example shown under }{\f1\uldb\insrsid1970434 /firstChessProgramNames}{\v\f1\insrsid1970434 - firstChessProgramNames}{\f1\insrsid1970434 above. - \par }\pard\plain \s2\ql \li120\ri0\sb120\sa60\sl-240\slmult0\nowidctlpar\faauto\outlinelevel1\adjustright\rin0\lin120\itap0 \b\f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 For more information - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - If you would like to run an automated computer player on the ICS, see the separate file }{\f2\insrsid1970434 zippy.README}{\f1\insrsid1970434 . If you would like to write your own engine to interface to WinBoard, see the separate file }{ - \f2\insrsid1970434 engine-intf.html}{\f1\insrsid1970434 , and join the mailing list mentioned there. Both files are included in the WinBoard distribution. You might also want to get the source code for WinBoard. It is available from - the author's Web page, http://www.tim-mann.org/chess.html}{\f2\insrsid1970434 .}{\f1\insrsid1970434 - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Firewalls}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Firewalls}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Firewalls}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 FIREWALLS - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 By default, "WinBoard /ics"}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - communicates wit - h an Internet Chess Server by opening a TCP socket directly from the machine it is running on to the ICS. If there is a firewall between your machine and the ICS, this won't work. Here are some recipes for getting around common kinds of firewalls using sp - ecial options to WinBoard}{\i\f1\insrsid1970434 .}{\f1\insrsid1970434 Important: See the paragraph in the }{\f1\uldb\insrsid1970434 LIMITATIONS}{\v\f1\insrsid1970434 LIMITATIONS}{\f1\insrsid1970434 section below about extra echoes. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Suppose that you can't telnet directly to ICS, but you can telnet to a firewall host, log in, and then telnet from there to ICS. Let's say the firewall is called fire.wall.com. Set command-line options as follows: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\fs20\insrsid1970434 - WinBoard -ics -icshost fire.wall.com -icsport 23 - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Then when you run WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - in ICS mode, you will be prompted to log in to the firewall host. (This works because port 23 is the s - tandard telnet login service.) Do so, then telnet to ICS, using a command like "telnet chessclub.com 5000", or whatever command the firewall provides for telnetting to port 5000. - \par If your firewall lets you telnet (or rlogin) to remote hosts, but doesn't let - you telnet to port 5000, you will have to find some other host outside the firewall that does let you do this, and hop through it. For instance, suppose you have an account at foo.edu. Follow the recipe above, but instead of typing "telnet chessclub.com - 5000" to the firewall, type "telnet foo.edu" (or "rlogin foo.edu"), log in there, and then type "telnet chessclub.com 5000". - \par Exception: chessclub.com itself lets you connect to the chess server on the default telnet port (23), which is what you get if you don\rquote t specify a port to the telnet program. But the other chess servers don\rquote t allow this. - \par Suppose that you can't telnet directly to ICS, but you can use rsh to run programs on a firewall host, and that host can telnet to ICS. Let's say the firewall is called rsh.wall.com. Set command-line options as follows: - \par }\pard\plain \s19\ql \li520\ri0\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\faauto\adjustright\rin0\lin520\itap0 \f5\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f2\fs20\insrsid1970434 - WinBoard -ics -gateway rsh.wall.com -icshost chessclub.com - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Then when you run WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - in ICS mode, it will connect to the ICS by using rsh to run the command "telnet chessclub.com 5000" on host rsh.wall.com. - \par ICC timestamp and FICS timeseal do not work through many}{\b\f1\insrsid1970434 }{\f1\insrsid1970434 - firewalls. You can use them only if your firewall gives a clean TCP connection with a full 8-bit wide path. If your firewall allows you to get out only by running a special telnet program, you - can't use timestamp or timeseal across it. But if you have access to a computer just outside your firewall, and you have much lower netlag when talking to that computer than to the ICS, it might be worthwhile running timestamp there. Follow the instructio - ns above for hopping through a host outside the firewall (foo.edu in the example), but run timestamp or timeseal on that host instead of telnet. - \par }\pard\plain \s20\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Suppose that you have a SOCKS firewall that requires you to go through some extra level of authentication, but a - fter that will give you a clean 8-bit wide TCP connection to the chess server. In that case, if you are using timestamp or timeseal, you need to somehow socksify it; if not, you need to socksify WinBoard itself. Socksification is beyond the scope of this - document, but see the SOCKS Web site at http://www.socks.nec.com/how2socksify.html. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Limitations}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Limitations}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Limitations}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 LIMITATIONS - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - is a Win32 application. It runs only on Windows NT and Windows 95. It does not work on Windows 3.11 or earlier, even with the Win32s compatibility package. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\i\f1\insrsid1970434 CMail, }{\f1\insrsid1970434 - the companion program to xboard for playing electronic mail correspondence chess, has not been ported to Win32. - \par There is no way for two people running copies of WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 to play each other without going through the Internet Chess Server. - \par Under some circumstances, your ICS password may be echoed when you log on. - \par If you are connecting to the ICS by - running telnet, timestamp, or timeseal on an Internet provider host, you may find that each line you type is echoed back an extra time after you hit Enter. You can probably turn this echo off. If your Internet provider is a Unix system, type "}{ - \f2\insrsid1970434 stty -echo}{\f1\insrsid1970434 " after you log in to the provider but before you run telnet, timestamp, or timeseal. In addition, you may need to type the sequence \'93}{\f2\insrsid1970434 Ctrl+Q Ctrl+E Enter}{\f1\insrsid1970434 \'93 - after you have finished logging in to ICS. On VMS, type \'93}{\f2\insrsid1970434 set terminal /noecho /nowrap}{\f1\insrsid1970434 \'94, and after you telnet to the ICS, type \'93}{\f2\insrsid1970434 Ctrl+Q Ctrl+] Enter set mode char Enter Enter}{ - \f1\insrsid1970434 \'94. It is a good idea to turn off the extra remote echo if you can, because otherwise it can get interleaved with output from the ICS and confuse WinBoard's parsing routines. Don\rquote t just turn off }{\f1\uldb\insrsid1970434 - Local Line Editing}{\v\f1\insrsid1970434 localLineEditing}{\f1\insrsid1970434 so that you see only the remote echo and not the local one; that will make the interleaving problem worse. - \par The game parser recognizes only algebraic notation. - \par The internal move legality tester does not look at the game history, so in some cases it misses illegal castling or en passant captures. It permits castling with the king on the }{\b\f1\insrsid1970434 d}{\f1\insrsid1970434 - file because this is possible in some "wild 1" games on ICS. It does not check piece drops in bughouse to see if you actually hold t - he piece you are trying to drop. However, if you attempt an illegal move when using a chess engine or the ICS, WinBoard will accept the error message that comes back, undo the move, and let you try another. - \par FEN positions saved by WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 do not include correct information about whether castling or en passant are legal. - \par }\pard\plain \s20\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The mate detector does not understand that non-contact mate is not really mate in bughouse. The only problem this causes while playing is minor: a "#" (mate indicator) character will show up - after a non-contact mating move in the move list. WinBoard will not assume the game is over at that point. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - Edit Game mode always uses non-bughouse rules. Although you can load and edit games that contain piece drops, the piece menus are not active, so you cannot insert piece drops. Also, WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - thinks an edited game is over when a mating move is inserted, even if the mate is non-contact. - \par Fischer Random castling is not understood. You can probably play Fischer Random successfully on ICS by typing castli - ng moves into the ICS Interaction window, but they will not be animated correctly, and saved games will not be loaded correctly if castling occurs. - \par The }{\f1\uldb\insrsid1970434 ICS logon}{\v\f1\insrsid1970434 ICSLogon}{\f1\insrsid1970434 file does not work properly when you connect to ICS through a Unix gateway host by setting }{\f1\uldb\insrsid1970434 icsPort}{\v\f1\insrsid1970434 icsPort}{ - \f1\insrsid1970434 to 23. The Unix login process apparently discards type-ahead. - \par Some WinBoard functions may not work with versions of GNU Chess earlier than 4.0, patchlevel 77. The current version of WinBoard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 works best with Crafty version 15.11 or later. - \par Also see the ToDo file included with the distribution for many other possible bugs, limitations, and ideas for improvement that have been suggested. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Authors}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Authors}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Authors}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 AUTHORS AND CONTRIBUTORS - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 WinBoard is partly based on }{\i\f1\insrsid1970434 xboard}{\f1\insrsid1970434 - , a chessboard program for Unix and the X Window System. Tim Mann has been responsible for all versions of WinBoard,}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 and for xboard versions 1.3 and beyond. - \par Mark Williams added many features to WinBoard 4.1.0, including copy/paste, premove, icsAlarm, auto - FlipView, training mode, auto raise, and blindfold. Hugh Fischer added piece animation to xboard, and Henrik Gram added it to WinBoard. Frank McIngvale contributed many xboard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 - user interface improvements and improved Crafty support. Jochen Wiedmann ported xboard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 to the Amiga, creating }{\i\f1\insrsid1970434 AmyBoard}{\f1\insrsid1970434 - , and converted the documentation to texinfo. Elmar Bartel contributed the new piece bitmaps for version 3.2. Evan Welsh wrote }{\i\f1\insrsid1970434 CMail. }{\f1\insrsid1970434 - John Chanak contributed the initial implementation of ICS mode. The default color scheme was adapted from Wayne Christopher's }{\i\f1\insrsid1970434 XChess }{\f1\insrsid1970434 program. Chris Sears and Dan Sears wrote the original xboard}{ - \i\f1\insrsid1970434 . }{\f1\insrsid1970434 They were responsible for xboard}{\i\f1\insrsid1970434 }{\f1\insrsid1970434 versions 1.0 through 1.2. - \par Send bug reports to . Please run WinBoard with the /debug option and include the output from the resulting WinBoard.debug file in your message. - \par }\pard\plain \s1\ql \li120\ri0\sb280\sa120\sl-320\slmult0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin120\itap0 \b\f4\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid1970434 \page }{\cs58\f1\fs20\super\insrsid1970434 K - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 K}{\f1\insrsid15759832 Copyright}}# - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 #}{\f1\insrsid15759832 Copyright}}$ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 $}{\f1\insrsid15759832 Copyright}}+ - {\footnote\ftnalt \pard\plain \s57\ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs58\f1\super\insrsid15759832 +}{\f1\insrsid15759832 main}}}{ - \f1\fs18\up6\insrsid1970434 }{\f1\fs20\insrsid1970434 COPYRIGHT - \par }\pard\plain \s26\ql \li120\ri0\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. \line - Enhancements Copyright 1992-2003 Free Software Foundation, Inc. - \par }\pard\plain \ql \li120\ri0\sb80\sl-240\slmult0\nowidctlpar\faauto\adjustright\rin0\lin120\itap0 \f4\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\insrsid1970434 - The following terms apply to Digital Equipment Corporation's copyright interest in WinBoard: - \par All Rights Reserved - \par Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereb - y granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to - distribution of the software without specific, written prior permission. - \par DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, IND - IRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - \par The following terms apply to the enhanced version of WinBoard distributed by the Free Software Foundation: - \par 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 of the License, or (at your option) any later version. - \par 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. - \par You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + {\rtf1\ansi\ansicpg1252\uc1 \deff5\deflang1033\deflangfe1043{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} + {\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f4\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times;} -{\f5\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Helvetica{\*\falt Arial};}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier;}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva;} ++{\f5\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Helvetica{\*\falt Arial};}{\f6\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Courier{\*\falt Courier New};}{\f7\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Geneva;} + {\f8\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Tms Rmn;}{\f9\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Helv;}{\f10\froman\fcharset0\fprq2{\*\panose 00000000000000000000}MS Serif;} -{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York;}{\f13\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;} -{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f15\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f16\froman\fcharset128\fprq1{\*\panose 00000000000000000000}Mincho{\*\falt ??};} -{\f17\fnil\fcharset129\fprq1{\*\panose 00000000000000000000}Batang{\*\falt ??};}{\f18\fnil\fcharset134\fprq2{\*\panose 00000000000000000000}SimSun{\*\falt ??};}{\f19\fnil\fcharset136\fprq2{\*\panose 00000000000000000000}PMingLiU{\*\falt ????};} -{\f20\fmodern\fcharset128\fprq1{\*\panose 00000000000000000000}Gothic{\*\falt ?????};}{\f21\fmodern\fcharset129\fprq1{\*\panose 00000000000000000000}Dotum{\*\falt ??};}{\f22\fmodern\fcharset134\fprq1{\*\panose 00000000000000000000}SimHei{\*\falt ??};} -{\f23\fmodern\fcharset136\fprq1{\*\panose 00000000000000000000}MingLiU{\*\falt ???};}{\f24\froman\fcharset128\fprq1{\*\panose 00000000000000000000}MS Mincho{\*\falt ?? ??};}{\f25\froman\fcharset129\fprq1{\*\panose 00000000000000000000}Gulim{\*\falt ??};} -{\f26\fmodern\fcharset128\fprq1{\*\panose 00000000000000000000}MS Gothic{\*\falt ?? ????};}{\f27\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Century;}{\f28\fswiss\fcharset0\fprq0{\*\panose 00000000000000000000}Univers (WN);} -{\f29\froman\fcharset0\fprq0{\*\panose 00000000000000000000}CG Times (WN);}{\f30\froman\fcharset177\fprq2{\*\panose 00000000000000000000}Times New Roman (Hebrew);}{\f31\froman\fcharset178\fprq2{\*\panose 00000000000000000000}Times New Roman (Arabic);} -{\f32\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Arial (Hebrew);}{\f33\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Arial (Arabic);}{\f34\fmodern\fcharset177\fprq1{\*\panose 00000000000000000000}Courier New (Hebrew);} -{\f35\fmodern\fcharset178\fprq1{\*\panose 00000000000000000000}Courier New (Arabic);}{\f36\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Tahoma (Hebrew);}{\f37\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Tahoma (Arabic);} -{\f38\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Fixedsys;}{\f39\fmodern\fcharset255\fprq1{\*\panose 00000000000000000000}Terminal;}{\f40\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Small Fonts;} -{\f41\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Marlett;}{\f42\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}News Gothic MT;}{\f43\fscript\fcharset0\fprq2{\*\panose 00000000000000000000}Lucida Handwriting;} -{\f44\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020204}Lucida Sans;}{\f45\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020204}Lucida Sans Unicode;}{\f46\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Book Antiqua;} -{\f47\fswiss\fcharset0\fprq2{\*\panose 020b0502020202020204}Century Gothic;}{\f48\fmodern\fcharset0\fprq2{\*\panose 02010509020102010303}OCR A Extended;}{\f49\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Calisto MT;} -{\f50\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Abadi MT Condensed Light;}{\f51\fswiss\fcharset0\fprq2{\*\panose 020e0705020206020404}Copperplate Gothic Bold;} -{\f52\fswiss\fcharset0\fprq2{\*\panose 020e0507020206020404}Copperplate Gothic Light;}{\f53\fdecor\fcharset0\fprq2{\*\panose 04040403030d02020704}Matisse ITC;}{\f54\fdecor\fcharset0\fprq2{\*\panose 04020404030d07020202}Tempus Sans ITC;} -{\f55\fdecor\fcharset0\fprq2{\*\panose 00000000000000000000}Westminster;}{\f56\fmodern\fcharset0\fprq1{\*\panose 020b0609040504020204}Lucida Console;}{\f57\fswiss\fcharset0\fprq2{\*\panose 020b0a04020102020204}Arial Black;} -{\f58\fscript\fcharset0\fprq2{\*\panose 030f0702030302020204}Comic Sans MS;}{\f59\fswiss\fcharset0\fprq2{\*\panose 020b0806030902050204}Impact;}{\f60\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;} -{\f61\froman\fcharset2\fprq2{\*\panose 05030102010509060703}Webdings;}{\f62\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}OCR-A II;}{\f63\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}OCR B MT;} -{\f64\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II;}{\f65\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II Condensed;}{\f66\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}QuickType II Mono;} -{\f67\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II Pi;}{\f68\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f69\froman\fcharset0\fprq2{\*\panose 02050604050505020204}Bookman Old Style;} -{\f70\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f71\fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS;}{\f72\froman\fcharset2\fprq2{\*\panose 05050102010205020202}MT Extra;} -{\f73\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Lucida Sans Unicode (Hebrew);}{\f74\froman\fcharset238\fprq2{\*\panose 00000000000000000000}Book Antiqua CE;}{\f75\froman\fcharset204\fprq2{\*\panose 00000000000000000000}Book Antiqua Cyr;} -{\f76\froman\fcharset161\fprq2{\*\panose 00000000000000000000}Book Antiqua Greek;}{\f77\froman\fcharset162\fprq2{\*\panose 00000000000000000000}Book Antiqua Tur;}{\f78\froman\fcharset186\fprq2{\*\panose 00000000000000000000}Book Antiqua Baltic;} -{\f79\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Czec;}{\f80\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Engl;}{\f81\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Fren;} -{\f82\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Germ;}{\f83\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Ital;}{\f84\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Span;} -{\f85\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Swed;}{\f86\froman\fcharset0\fprq2{\*\panose 02040502050405020303}Georgia;}{\f87\fswiss\fcharset0\fprq2{\*\panose 020b0603020102020204}Franklin Gothic Medium;} -{\f88\froman\fcharset0\fprq2{\*\panose 02040502050505030304}Palatino Linotype;}{\f89\fscript\fcharset0\fprq2 Estrangelo Edessa;}{\f90\fnil\fcharset0\fprq2 Gautami;}{\f91\fnil\fcharset0\fprq2 Latha;}{\f92\fnil\fcharset0\fprq2 Mangal;} -{\f93\fnil\fcharset0\fprq2 MV Boli;}{\f94\fnil\fcharset0\fprq2 Raavi;}{\f95\fnil\fcharset0\fprq2 Shruti;}{\f96\fnil\fcharset0\fprq2 Tunga;}{\f97\froman\fcharset0\fprq2{\*\panose 010a0502050306030303}Sylfaen;} -{\f98\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Microsoft Sans Serif;}{\f99\froman\fcharset0\fprq2{\*\panose 02060603020205020403}Rockwell;}{\f100\froman\fcharset0\fprq2{\*\panose 02060903040505020403}Rockwell Extra Bold;} -{\f101\fscript\fcharset0\fprq2{\*\panose 03090702030407020403}Mistral;}{\f102\fdecor\fcharset0\fprq2{\*\panose 04020505051007020d02}Blackadder ITC;}{\f103\fscript\fcharset0\fprq2{\*\panose 03070402050302030203}Bradley Hand ITC;} -{\f104\fdecor\fcharset0\fprq2{\*\panose 04040404050702020202}Curlz MT;}{\f105\fscript\fcharset0\fprq2{\*\panose 030303020407070d0804}Edwardian Script ITC;}{\f106\froman\fcharset0\fprq2{\*\panose 02090707080505020304}Engravers MT;} -{\f107\fswiss\fcharset0\fprq2{\*\panose 020b0805030504020804}Eras Demi ITC;}{\f108\fswiss\fcharset0\fprq2{\*\panose 020b0402030504020804}Eras Light ITC;}{\f109\fswiss\fcharset0\fprq2{\*\panose 020b0504020202050204}Eurostile;} -{\f110\fdecor\fcharset0\fprq2{\*\panose 04060505060202020a04}Felix Titling;}{\f111\fswiss\fcharset0\fprq2{\*\panose 020b0503020102020204}Franklin Gothic Book;}{\f112\fswiss\fcharset0\fprq2{\*\panose 020b0703020102020204}Franklin Gothic Demi;} -{\f113\fswiss\fcharset0\fprq2{\*\panose 020b0606030402020204}Franklin Gothic Medium Cond;}{\f114\fswiss\fcharset0\fprq2{\*\panose 020b0903020102020204}Franklin Gothic Heavy;} -{\f115\fswiss\fcharset0\fprq2{\*\panose 020b0706030402020204}Franklin Gothic Demi Cond;}{\f116\fscript\fcharset0\fprq2{\*\panose 03020402040607040605}French Script MT;}{\f117\fscript\fcharset0\fprq2{\*\panose 03050502040202030202}Kristen ITC;} -{\f118\fswiss\fcharset0\fprq2{\*\panose 020e0502030308020204}Maiandra GD;}{\f119\fscript\fcharset0\fprq2{\*\panose 03070502060502030205}Papyrus;}{\f120\froman\fcharset0\fprq2{\*\panose 02020502060401020303}Perpetua;} -{\f121\fscript\fcharset0\fprq2{\*\panose 03020602050506090804}Vivaldi;}{\f122\froman\fcharset2\fprq2{\*\panose 05020102010507070707}Wingdings 2;}{\f123\froman\fcharset2\fprq2{\*\panose 05040102010807070707}Wingdings 3;} -{\f124\fdecor\fcharset0\fprq2{\*\panose 04090605060d06020702}Jokerman;}{\f125\fdecor\fcharset0\fprq2{\*\panose 04040403040a02020202}Juice ITC;}{\f126\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Reference 1;} -{\f127\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}MS Reference 2;}{\f128\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}MS Reference Sans Serif;}{\f129\fnil\fcharset2\fprq2{\*\panose 05000500000000000000}MS Reference Specialty;} -{\f130\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;}{\f131\fnil\fcharset2\fprq2{\*\panose 01010601010101010101}Monotype Sorts;}{\f132\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Outlook;} -{\f133\froman\fcharset0\fprq2{\*\panose 02020503030404060203}Kartika;}{\f134\fnil\fcharset0\fprq2{\*\panose 01010600010101010101}Vrinda;}{\f135\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}WinboardF;} -{\f136\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}Franklin Gothic Medium Cond Gre;}{\f137\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Franklin Gothic Medium Cond Bal;} -{\f138\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Franklin Gothic Demi Cond Balti;}{\f139\froman\fcharset238\fprq2 Times New Roman CE;}{\f140\froman\fcharset204\fprq2 Times New Roman Cyr;} -{\f142\froman\fcharset161\fprq2 Times New Roman Greek;}{\f143\froman\fcharset162\fprq2 Times New Roman Tur;}{\f144\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f145\fswiss\fcharset238\fprq2 Arial CE;}{\f146\fswiss\fcharset204\fprq2 Arial Cyr;} -{\f148\fswiss\fcharset161\fprq2 Arial Greek;}{\f149\fswiss\fcharset162\fprq2 Arial Tur;}{\f150\fswiss\fcharset186\fprq2 Arial Baltic;}{\f151\fmodern\fcharset238\fprq1 Courier New CE;}{\f152\fmodern\fcharset204\fprq1 Courier New Cyr;} -{\f154\fmodern\fcharset161\fprq1 Courier New Greek;}{\f155\fmodern\fcharset162\fprq1 Courier New Tur;}{\f156\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f163\froman\fcharset238\fprq2 Times CE;}{\f164\froman\fcharset204\fprq2 Times Cyr;} -{\f166\froman\fcharset161\fprq2 Times Greek;}{\f167\froman\fcharset162\fprq2 Times Tur;}{\f168\froman\fcharset186\fprq2 Times Baltic;}{\f169\fswiss\fcharset238\fprq2 Helvetica CE{\*\falt Arial};} -{\f170\fswiss\fcharset204\fprq2 Helvetica Cyr{\*\falt Arial};}{\f172\fswiss\fcharset161\fprq2 Helvetica Greek{\*\falt Arial};}{\f173\fswiss\fcharset162\fprq2 Helvetica Tur{\*\falt Arial};}{\f174\fswiss\fcharset186\fprq2 Helvetica Baltic{\*\falt Arial};} -{\f229\fswiss\fcharset238\fprq2 Tahoma CE;}{\f230\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f232\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f233\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f234\fswiss\fcharset186\fprq2 Tahoma Baltic;} -{\f409\fswiss\fcharset238\fprq2 Lucida Sans Unicode CE;}{\f410\fswiss\fcharset204\fprq2 Lucida Sans Unicode Cyr;}{\f412\fswiss\fcharset161\fprq2 Lucida Sans Unicode Greek;}{\f413\fswiss\fcharset162\fprq2 Lucida Sans Unicode Tur;} -{\f421\fswiss\fcharset238\fprq2 Century Gothic CE;}{\f422\fswiss\fcharset204\fprq2 Century Gothic Cyr;}{\f424\fswiss\fcharset161\fprq2 Century Gothic Greek;}{\f425\fswiss\fcharset162\fprq2 Century Gothic Tur;} -{\f426\fswiss\fcharset186\fprq2 Century Gothic Baltic;}{\f475\fmodern\fcharset238\fprq1 Lucida Console CE;}{\f476\fmodern\fcharset204\fprq1 Lucida Console Cyr;}{\f478\fmodern\fcharset161\fprq1 Lucida Console Greek;} -{\f479\fmodern\fcharset162\fprq1 Lucida Console Tur;}{\f481\fswiss\fcharset238\fprq2 Arial Black CE;}{\f482\fswiss\fcharset204\fprq2 Arial Black Cyr;}{\f484\fswiss\fcharset161\fprq2 Arial Black Greek;}{\f485\fswiss\fcharset162\fprq2 Arial Black Tur;} -{\f486\fswiss\fcharset186\fprq2 Arial Black Baltic;}{\f487\fscript\fcharset238\fprq2 Comic Sans MS CE;}{\f488\fscript\fcharset204\fprq2 Comic Sans MS Cyr;}{\f490\fscript\fcharset161\fprq2 Comic Sans MS Greek;} -{\f491\fscript\fcharset162\fprq2 Comic Sans MS Tur;}{\f492\fscript\fcharset186\fprq2 Comic Sans MS Baltic;}{\f493\fswiss\fcharset238\fprq2 Impact CE;}{\f494\fswiss\fcharset204\fprq2 Impact Cyr;}{\f496\fswiss\fcharset161\fprq2 Impact Greek;} -{\f497\fswiss\fcharset162\fprq2 Impact Tur;}{\f498\fswiss\fcharset186\fprq2 Impact Baltic;}{\f499\fswiss\fcharset238\fprq2 Verdana CE;}{\f500\fswiss\fcharset204\fprq2 Verdana Cyr;}{\f502\fswiss\fcharset161\fprq2 Verdana Greek;} -{\f503\fswiss\fcharset162\fprq2 Verdana Tur;}{\f504\fswiss\fcharset186\fprq2 Verdana Baltic;}{\f547\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f548\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f550\fswiss\fcharset161\fprq2 Arial Narrow Greek;} -{\f551\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f552\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}{\f553\froman\fcharset238\fprq2 Bookman Old Style CE;}{\f554\froman\fcharset204\fprq2 Bookman Old Style Cyr;} -{\f556\froman\fcharset161\fprq2 Bookman Old Style Greek;}{\f557\froman\fcharset162\fprq2 Bookman Old Style Tur;}{\f558\froman\fcharset186\fprq2 Bookman Old Style Baltic;}{\f559\froman\fcharset238\fprq2 Garamond CE;} -{\f560\froman\fcharset204\fprq2 Garamond Cyr;}{\f562\froman\fcharset161\fprq2 Garamond Greek;}{\f563\froman\fcharset162\fprq2 Garamond Tur;}{\f564\froman\fcharset186\fprq2 Garamond Baltic;}{\f565\fswiss\fcharset238\fprq2 Trebuchet MS CE;} -{\f566\fswiss\fcharset204\fprq2 Trebuchet MS Cyr;}{\f568\fswiss\fcharset161\fprq2 Trebuchet MS Greek;}{\f569\fswiss\fcharset162\fprq2 Trebuchet MS Tur;}{\f570\fswiss\fcharset186\fprq2 Trebuchet MS Baltic;}{\f655\froman\fcharset238\fprq2 Georgia CE;} -{\f656\froman\fcharset204\fprq2 Georgia Cyr;}{\f658\froman\fcharset161\fprq2 Georgia Greek;}{\f659\froman\fcharset162\fprq2 Georgia Tur;}{\f660\froman\fcharset186\fprq2 Georgia Baltic;}{\f661\fswiss\fcharset238\fprq2 Franklin Gothic Medium CE;} -{\f662\fswiss\fcharset204\fprq2 Franklin Gothic Medium Cyr;}{\f664\fswiss\fcharset161\fprq2 Franklin Gothic Medium Greek;}{\f665\fswiss\fcharset162\fprq2 Franklin Gothic Medium Tur;}{\f666\fswiss\fcharset186\fprq2 Franklin Gothic Medium Baltic;} -{\f667\froman\fcharset238\fprq2 Palatino Linotype CE;}{\f668\froman\fcharset204\fprq2 Palatino Linotype Cyr;}{\f670\froman\fcharset161\fprq2 Palatino Linotype Greek;}{\f671\froman\fcharset162\fprq2 Palatino Linotype Tur;} -{\f672\froman\fcharset186\fprq2 Palatino Linotype Baltic;}{\f721\froman\fcharset238\fprq2 Sylfaen CE;}{\f722\froman\fcharset204\fprq2 Sylfaen Cyr;}{\f724\froman\fcharset161\fprq2 Sylfaen Greek;}{\f725\froman\fcharset162\fprq2 Sylfaen Tur;} -{\f726\froman\fcharset186\fprq2 Sylfaen Baltic;}{\f727\fswiss\fcharset238\fprq2 Microsoft Sans Serif CE;}{\f728\fswiss\fcharset204\fprq2 Microsoft Sans Serif Cyr;}{\f730\fswiss\fcharset161\fprq2 Microsoft Sans Serif Greek;} -{\f731\fswiss\fcharset162\fprq2 Microsoft Sans Serif Tur;}{\f732\fswiss\fcharset186\fprq2 Microsoft Sans Serif Baltic;}{\f733\froman\fcharset238\fprq2 Rockwell CE;}{\f745\fscript\fcharset238\fprq2 Mistral CE;}{\f746\fscript\fcharset204\fprq2 Mistral Cyr;} -{\f748\fscript\fcharset161\fprq2 Mistral Greek;}{\f749\fscript\fcharset162\fprq2 Mistral Tur;}{\f750\fscript\fcharset186\fprq2 Mistral Baltic;}{\f805\fswiss\fcharset238\fprq2 Franklin Gothic Book CE;} -{\f806\fswiss\fcharset204\fprq2 Franklin Gothic Book Cyr;}{\f808\fswiss\fcharset161\fprq2 Franklin Gothic Book Greek;}{\f809\fswiss\fcharset162\fprq2 Franklin Gothic Book Tur;}{\f810\fswiss\fcharset186\fprq2 Franklin Gothic Book Baltic;} -{\f811\fswiss\fcharset238\fprq2 Franklin Gothic Demi CE;}{\f812\fswiss\fcharset204\fprq2 Franklin Gothic Demi Cyr;}{\f814\fswiss\fcharset161\fprq2 Franklin Gothic Demi Greek;}{\f815\fswiss\fcharset162\fprq2 Franklin Gothic Demi Tur;} -{\f816\fswiss\fcharset186\fprq2 Franklin Gothic Demi Baltic;}{\f817\fswiss\fcharset238\fprq2 Franklin Gothic Medium Cond CE;}{\f818\fswiss\fcharset204\fprq2 Franklin Gothic Medium Cond Cyr;} -{\f820\fswiss\fcharset161\fprq2 Franklin Gothic Medium Cond Greek;}{\f821\fswiss\fcharset162\fprq2 Franklin Gothic Medium Cond Tur;}{\f822\fswiss\fcharset186\fprq2 Franklin Gothic Medium Cond Baltic;} -{\f823\fswiss\fcharset238\fprq2 Franklin Gothic Heavy CE;}{\f824\fswiss\fcharset204\fprq2 Franklin Gothic Heavy Cyr;}{\f826\fswiss\fcharset161\fprq2 Franklin Gothic Heavy Greek;}{\f827\fswiss\fcharset162\fprq2 Franklin Gothic Heavy Tur;} -{\f828\fswiss\fcharset186\fprq2 Franklin Gothic Heavy Baltic;}{\f829\fswiss\fcharset238\fprq2 Franklin Gothic Demi Cond CE;}{\f830\fswiss\fcharset204\fprq2 Franklin Gothic Demi Cond Cyr;}{\f832\fswiss\fcharset161\fprq2 Franklin Gothic Demi Cond Greek;} -{\f833\fswiss\fcharset162\fprq2 Franklin Gothic Demi Cond Tur;}{\f834\fswiss\fcharset186\fprq2 Franklin Gothic Demi Cond Baltic;}{\f907\fswiss\fcharset238\fprq2 MS Reference Sans Serif CE;}{\f908\fswiss\fcharset204\fprq2 MS Reference Sans Serif Cyr;} -{\f910\fswiss\fcharset161\fprq2 MS Reference Sans Serif Greek;}{\f911\fswiss\fcharset162\fprq2 MS Reference Sans Serif Tur;}{\f912\fswiss\fcharset186\fprq2 MS Reference Sans Serif Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255; -\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0; -\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext0 Normal;}{\s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\adjustright \b\f5\cgrid -\sbasedon0 \snext26 heading 1;}{\s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \b\f5\fs20\cgrid \sbasedon0 \snext0 heading 2;}{\s3\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext0 heading 3;}{ -\s4\fi-245\li360\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \f11\fs20\cgrid \sbasedon2 \snext4 heading 4;}{\s5\li120\sb80\sl-240\slmult0\keepn\nowidctlpar\outlinelevel4\adjustright \f5\fs20\ul\cgrid \sbasedon0 \snext0 heading 5;}{\* -\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive \f5\fs18\up6\lang1033 \sbasedon10 footnote reference;}{\s16\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext0 footnote text;}{\s17\li360\sb80\sl-240\slmult0 -\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext0 Normal Indent;}{\s18\fi-240\li600\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext18 Jli;}{\s19\li120\sb60\sl-240\slmult0\keep\nowidctlpar ++{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f12\froman\fcharset0\fprq2{\*\panose 00000000000000000000}New York{\*\falt Times New Roman};}{\f13\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}System;} ++{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f15\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f16\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ??};} ++{\f17\froman\fcharset0\fprq0{\*\panose 00000000000000000000}??;}{\f18\fswiss\fcharset0\fprq0{\*\panose 00000000000000000000}BookAntiqua-Bold;}{\f19\fswiss\fcharset0\fprq0{\*\panose 00000000000000000000}BookAntiqua;} ++{\f20\froman\fcharset0\fprq0{\*\panose 00000000000000000000}Minion-Regular;}{\f21\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Calibri;}{\f22\froman\fcharset0\fprq0{\*\panose 00000000000000000000}TimesNewRoman;} ++{\f23\froman\fcharset0\fprq0{\*\panose 00000000000000000000}TimesNewRoman,Italic;}{\f24\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Cambria Math;}{\f25\fmodern\fcharset255\fprq1{\*\panose 00000000000000000000}Terminal;} ++{\f26\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}Fixedsys;}{\f27\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Small Fonts;}{\f28\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Czec;} ++{\f29\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Engl;}{\f30\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Fren;}{\f31\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Germ;} ++{\f32\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Ital;}{\f33\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Span;}{\f34\fdecor\fcharset2\fprq1{\*\panose 00000000000000000000}WST_Swed;} ++{\f35\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Marlett;}{\f36\fmodern\fcharset0\fprq1{\*\panose 020b0609040504020204}Lucida Console;}{\f37\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020204}Lucida Sans Unicode;} ++{\f38\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f39\fswiss\fcharset0\fprq2{\*\panose 020b0a04020102020204}Arial Black;}{\f40\fscript\fcharset0\fprq2{\*\panose 030f0702030302020204}Comic Sans MS;} ++{\f41\fswiss\fcharset0\fprq2{\*\panose 020b0806030902050204}Impact;}{\f42\froman\fcharset0\fprq2{\*\panose 02040502050405020303}Georgia;}{\f43\fswiss\fcharset0\fprq2{\*\panose 020b0603020102020204}Franklin Gothic Medium;} ++{\f44\froman\fcharset0\fprq2{\*\panose 02040502050505030304}Palatino Linotype;}{\f45\fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS;}{\f46\froman\fcharset2\fprq2{\*\panose 05030102010509060703}Webdings;} ++{\f47\fscript\fcharset0\fprq2 Estrangelo Edessa;}{\f48\fnil\fcharset0\fprq2 Gautami;}{\f49\fnil\fcharset0\fprq2 Latha;}{\f50\fnil\fcharset0\fprq2 Mangal;}{\f51\fnil\fcharset0\fprq2 MV Boli;}{\f52\fnil\fcharset0\fprq2 Raavi;} ++{\f53\fnil\fcharset0\fprq2 Shruti;}{\f54\fnil\fcharset0\fprq2 Tunga;}{\f55\froman\fcharset0\fprq2{\*\panose 010a0502050306030303}Sylfaen;}{\f56\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Microsoft Sans Serif;} ++{\f57\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f58\froman\fcharset0\fprq2{\*\panose 02060603020205020403}Rockwell;}{\f59\froman\fcharset0\fprq2{\*\panose 02060903040505020403}Rockwell Extra Bold;} ++{\f60\fscript\fcharset0\fprq2{\*\panose 03090702030407020403}Mistral;}{\f61\fdecor\fcharset0\fprq2{\*\panose 04020505051007020d02}Blackadder ITC;}{\f62\fscript\fcharset0\fprq2{\*\panose 03070402050302030203}Bradley Hand ITC;} ++{\f63\fswiss\fcharset0\fprq2{\*\panose 020e0705020206020404}Copperplate Gothic Bold;}{\f64\fswiss\fcharset0\fprq2{\*\panose 020e0507020206020404}Copperplate Gothic Light;}{\f65\fdecor\fcharset0\fprq2{\*\panose 04040404050702020202}Curlz MT;} ++{\f66\fscript\fcharset0\fprq2{\*\panose 030303020407070d0804}Edwardian Script ITC;}{\f67\froman\fcharset0\fprq2{\*\panose 02090707080505020304}Engravers MT;}{\f68\fswiss\fcharset0\fprq2{\*\panose 020b0805030504020804}Eras Demi ITC;} ++{\f69\fswiss\fcharset0\fprq2{\*\panose 020b0402030504020804}Eras Light ITC;}{\f70\fswiss\fcharset0\fprq2{\*\panose 020b0504020202050204}Eurostile;}{\f71\fdecor\fcharset0\fprq2{\*\panose 04060505060202020a04}Felix Titling;} ++{\f72\fswiss\fcharset0\fprq2{\*\panose 020b0503020102020204}Franklin Gothic Book;}{\f73\fswiss\fcharset0\fprq2{\*\panose 020b0703020102020204}Franklin Gothic Demi;}{\f74\fswiss\fcharset0\fprq2{\*\panose 020b0606030402020204}Franklin Gothic Medium Cond;} ++{\f75\fswiss\fcharset0\fprq2{\*\panose 020b0903020102020204}Franklin Gothic Heavy;}{\f76\fswiss\fcharset0\fprq2{\*\panose 020b0706030402020204}Franklin Gothic Demi Cond;}{\f77\fscript\fcharset0\fprq2{\*\panose 03020402040607040605}French Script MT;} ++{\f78\fswiss\fcharset0\fprq2{\*\panose 020b0502020202020204}Century Gothic;}{\f79\fscript\fcharset0\fprq2{\*\panose 03050502040202030202}Kristen ITC;}{\f80\fswiss\fcharset0\fprq2{\*\panose 020b0602030504020204}Lucida Sans;} ++{\f81\fswiss\fcharset0\fprq2{\*\panose 020e0502030308020204}Maiandra GD;}{\f82\fdecor\fcharset0\fprq2{\*\panose 04040403030d02020704}Matisse ITC;}{\f83\fscript\fcharset0\fprq2{\*\panose 03070502060502030205}Papyrus;} ++{\f84\froman\fcharset0\fprq2{\*\panose 02020502060401020303}Perpetua;}{\f85\fdecor\fcharset0\fprq2{\*\panose 04020404030d07020202}Tempus Sans ITC;}{\f86\fscript\fcharset0\fprq2{\*\panose 03020602050506090804}Vivaldi;} ++{\f87\froman\fcharset2\fprq2{\*\panose 05020102010507070707}Wingdings 2;}{\f88\froman\fcharset2\fprq2{\*\panose 05040102010807070707}Wingdings 3;}{\f89\fdecor\fcharset0\fprq2{\*\panose 04090605060d06020702}Jokerman;} ++{\f90\fdecor\fcharset0\fprq2{\*\panose 04040403040a02020202}Juice ITC;}{\f91\fmodern\fcharset0\fprq2{\*\panose 02010509020102010303}OCR A Extended;}{\f92\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Reference 1;} ++{\f93\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}MS Reference 2;}{\f94\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}MS Reference Sans Serif;}{\f95\fnil\fcharset2\fprq2{\*\panose 05000500000000000000}MS Reference Specialty;} ++{\f96\froman\fcharset2\fprq2{\*\panose 05050102010205020202}MT Extra;}{\f97\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;}{\f98\froman\fcharset0\fprq2{\*\panose 02050604050505020204}Bookman Old Style;} ++{\f99\fnil\fcharset2\fprq2{\*\panose 01010601010101010101}Monotype Sorts;}{\f100\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f101\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}MS Outlook;} ++{\f102\froman\fcharset0\fprq2{\*\panose 02020503030404060203}Kartika;}{\f103\fnil\fcharset0\fprq2{\*\panose 01010600010101010101}Vrinda;}{\f104\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}WinboardF;} ++{\f105\fswiss\fcharset2\fprq2{\*\panose 020b0603050302020204}Chess Mark;}{\f106\fnil\fcharset0\fprq2{\*\panose 02000500000000000000}Superchess;}{\f107\fswiss\fcharset0\fprq2{\*\panose 020b0603050302020204}Tasc Chess Figurine;} ++{\f108\fnil\fcharset0\fprq1{\*\panose 02010603010101010101}XIANGQI;}{\f109\fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt ?? ??};}{\f110\fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}@MS Mincho;} ++{\f111\froman\fcharset128\fprq2{\*\panose 02020600040205080304}MS PMincho;}{\f112\froman\fcharset128\fprq2{\*\panose 02020600040205080304}@MS PMincho;}{\f113\fmodern\fcharset128\fprq1{\*\panose 020b0609070205080204}MS Gothic{\*\falt ?? ????};} ++{\f114\fmodern\fcharset128\fprq1{\*\panose 020b0609070205080204}@MS Gothic;}{\f115\fswiss\fcharset128\fprq2{\*\panose 020b0600070205080204}MS PGothic;}{\f116\fswiss\fcharset128\fprq2{\*\panose 020b0600070205080204}@MS PGothic;} ++{\f117\fswiss\fcharset128\fprq2{\*\panose 020b0600070205080204}MS UI Gothic;}{\f118\fswiss\fcharset128\fprq2{\*\panose 020b0600070205080204}@MS UI Gothic;}{\f119\fswiss\fcharset129\fprq2{\*\panose 020b0600000101010101}Gulim{\*\falt ??};} ++{\f120\fswiss\fcharset129\fprq2{\*\panose 020b0600000101010101}@Gulim;}{\f121\fmodern\fcharset129\fprq1{\*\panose 020b0609000101010101}GulimChe;}{\f122\fmodern\fcharset129\fprq1{\*\panose 020b0609000101010101}@GulimChe;} ++{\f123\fswiss\fcharset129\fprq2{\*\panose 020b0600000101010101}Dotum{\*\falt ??};}{\f124\fswiss\fcharset129\fprq2{\*\panose 020b0600000101010101}@Dotum;}{\f125\fmodern\fcharset129\fprq1{\*\panose 020b0609000101010101}DotumChe;} ++{\f126\fmodern\fcharset129\fprq1{\*\panose 020b0609000101010101}@DotumChe;}{\f127\froman\fcharset129\fprq2{\*\panose 02030600000101010101}Batang{\*\falt ??};}{\f128\froman\fcharset129\fprq2{\*\panose 02030600000101010101}@Batang;} ++{\f129\fmodern\fcharset129\fprq1{\*\panose 02030609000101010101}BatangChe;}{\f130\fmodern\fcharset129\fprq1{\*\panose 02030609000101010101}@BatangChe;}{\f131\froman\fcharset129\fprq2{\*\panose 02030600000101010101}Gungsuh;} ++{\f132\froman\fcharset129\fprq2{\*\panose 02030600000101010101}@Gungsuh;}{\f133\fmodern\fcharset129\fprq1{\*\panose 02030609000101010101}GungsuhChe;}{\f134\fmodern\fcharset129\fprq1{\*\panose 02030609000101010101}@GungsuhChe;} ++{\f135\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;}{\f136\fmodern\fcharset134\fprq1{\*\panose 02010609030101010101}NSimSun;}{\f137\fmodern\fcharset134\fprq1{\*\panose 02010609030101010101}@NSimSun;} ++{\f138\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimHei{\*\falt ??};}{\f139\fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimHei;}{\f140\fmodern\fcharset136\fprq1{\*\panose 02020309000000000000}MingLiU{\*\falt ???};} ++{\f141\fmodern\fcharset136\fprq1{\*\panose 02020309000000000000}@MingLiU;}{\f142\froman\fcharset136\fprq2{\*\panose 02020300000000000000}PMingLiU{\*\falt ????};}{\f143\froman\fcharset136\fprq2{\*\panose 02020300000000000000}@PMingLiU;} ++{\f144\froman\fcharset128\fprq1{\*\panose 00000000000000000000}Mincho{\*\falt ??};}{\f145\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Century;}{\f146\froman\fcharset222\fprq2{\*\panose 00000000000000000000}Angsana New;} ++{\f147\froman\fcharset222\fprq2{\*\panose 00000000000000000000}Cordia New;}{\f148\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Sendnya;}{\f149\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Estrangella Edessa;} ++{\f150\fswiss\fcharset128\fprq2{\*\panose 00000000000000000000}Arial Unicode MS;}{\f151\fswiss\fcharset0\fprq0{\*\panose 00000000000000000000}Univers (WN);}{\f152\froman\fcharset0\fprq0{\*\panose 00000000000000000000}CG Times (WN);} ++{\f153\fswiss\fcharset128\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS;}{\f154\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Book Antiqua;}{\f155\fscript\fcharset0\fprq2{\*\panose 00000000000000000000}Monotype Corsiva;} ++{\f156\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}CA Chess;}{\f157\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}ISDiagram;}{\f158\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}CADiagram;} ++{\f159\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Alfonso-X;}{\f160\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Adventurer;}{\f161\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Cases;} ++{\f162\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Marroquin;}{\f163\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Condal;}{\f164\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Harlequin;} ++{\f165\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Kingdom;}{\f166\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Leipzig;}{\f167\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Line;} ++{\f168\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Lucena;}{\f169\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Magnetic;}{\f170\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Maya;} ++{\f171\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Merida Fatx;}{\f172\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Merida;}{\f173\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Millennia-D;} ++{\f174\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Miscel;}{\f175\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Motif;}{\f176\fswiss\fcharset2\fprq2{\*\panose 00000000000000000000}Chess Mediaeval;} ++{\f177\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Smart;}{\f178\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Traveller Standard;}{\f179\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess;} ++{\f180\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Usual;}{\f181\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chess Utrecht;}{\f182\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica1;} ++{\f183\froman\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica1Mono;}{\f184\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica2;}{\f185\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica2Mono;} ++{\f186\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica3;}{\f187\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica3Mono;}{\f188\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica4;} ++{\f189\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica4Mono;}{\f190\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica5;}{\f191\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica5Mono;} ++{\f192\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica6;}{\f193\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica6Mono;}{\f194\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica7;} ++{\f195\fnil\fcharset2\fprq2{\*\panose 00000000000000000000}Mathematica7Mono;}{\f196\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Bookup;}{\f197\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Chessmaster9000;} ++{\f198\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}FigurineCB AriesSP;}{\f199\fnil\fcharset0\fprq1{\*\panose 00000000000000000000}FigurineCB LetterSP;}{\f200\froman\fcharset0\fprq2{\*\panose 00000000000000000000}FigurineCB TimeSP;} ++{\f201\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}DiagramTTFritz;}{\f202\fmodern\fcharset2\fprq1{\*\panose 00000000000000000000}FigurineCrrCB;}{\f203\froman\fcharset2\fprq2{\*\panose 00000000000000000000}FigurineTmsCB;} ++{\f204\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}HE_TERMINAL;}{\f205\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Digiface;}{\f206\fnil\fcharset0\fprq2{\*\panose 00000000000000000000}Sydnie;} ++{\f207\froman\fcharset177\fprq2{\*\panose 00000000000000000000}Times New Roman (Hebrew);}{\f208\froman\fcharset178\fprq2{\*\panose 00000000000000000000}Times New Roman (Arabic);} ++{\f209\froman\fcharset163\fprq2{\*\panose 00000000000000000000}Times New Roman (Vietnamese);}{\f210\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Arial (Hebrew);}{\f211\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Arial (Arabic);} ++{\f212\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Arial (Vietnamese);}{\f213\fmodern\fcharset177\fprq1{\*\panose 00000000000000000000}Courier New (Hebrew);}{\f214\fmodern\fcharset178\fprq1{\*\panose 00000000000000000000}Courier New (Arabic);} ++{\f215\fmodern\fcharset163\fprq1{\*\panose 00000000000000000000}Courier New (Vietnamese);}{\f216\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Helvetica (Hebrew){\*\falt Arial};} ++{\f217\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Helvetica (Arabic){\*\falt Arial};}{\f218\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Helvetica (Vietnamese){\*\falt Arial};} ++{\f219\froman\fcharset238\fprq2{\*\panose 00000000000000000000}Century CE;}{\f220\froman\fcharset204\fprq2{\*\panose 00000000000000000000}Century Cyr;}{\f221\froman\fcharset161\fprq2{\*\panose 00000000000000000000}Century Greek;} ++{\f222\froman\fcharset162\fprq2{\*\panose 00000000000000000000}Century Tur;}{\f223\froman\fcharset186\fprq2{\*\panose 00000000000000000000}Century Baltic;}{\f224\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Arial Unicode MS Western;} ++{\f225\fswiss\fcharset238\fprq2{\*\panose 00000000000000000000}Arial Unicode MS CE;}{\f226\fswiss\fcharset204\fprq2{\*\panose 00000000000000000000}Arial Unicode MS Cyr;} ++{\f227\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}Arial Unicode MS Greek;}{\f228\fswiss\fcharset162\fprq2{\*\panose 00000000000000000000}Arial Unicode MS Tur;} ++{\f229\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Arial Unicode MS (Hebrew);}{\f230\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Arial Unicode MS (Arabic);} ++{\f231\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Arial Unicode MS Baltic;}{\f232\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Arial Unicode MS (Vietnamese);} ++{\f233\fswiss\fcharset222\fprq2{\*\panose 00000000000000000000}Arial Unicode MS (Thai);}{\f234\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Tahoma (Hebrew);}{\f235\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Tahoma (Arabic);} ++{\f236\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Tahoma (Vietnamese);}{\f237\fswiss\fcharset222\fprq2{\*\panose 00000000000000000000}Tahoma (Thai);}{\f238\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Lucida Sans Unicode (Hebrew);} ++{\f239\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Verdana (Vietnamese);}{\f240\froman\fcharset163\fprq2{\*\panose 00000000000000000000}Palatino Linotype (Vietnamese);} ++{\f241\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}Microsoft Sans Serif (Hebrew);}{\f242\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}Microsoft Sans Serif (Arabic);} ++{\f243\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}Microsoft Sans Serif (Vietnames;}{\f244\fswiss\fcharset222\fprq2{\*\panose 00000000000000000000}Microsoft Sans Serif (Thai);} ++{\f245\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS Western;}{\f246\fswiss\fcharset238\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS CE;} ++{\f247\fswiss\fcharset204\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS Cyr;}{\f248\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS Greek;} ++{\f249\fswiss\fcharset162\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS Tur;}{\f250\fswiss\fcharset177\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS (Hebrew);} ++{\f251\fswiss\fcharset178\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS (Arabic);}{\f252\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS Baltic;} ++{\f253\fswiss\fcharset163\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS (Vietnamese);}{\f254\fswiss\fcharset222\fprq2{\*\panose 00000000000000000000}@Arial Unicode MS (Thai);} ++{\f255\froman\fcharset238\fprq2{\*\panose 00000000000000000000}Book Antiqua CE;}{\f256\froman\fcharset204\fprq2{\*\panose 00000000000000000000}Book Antiqua Cyr;}{\f257\froman\fcharset161\fprq2{\*\panose 00000000000000000000}Book Antiqua Greek;} ++{\f258\froman\fcharset162\fprq2{\*\panose 00000000000000000000}Book Antiqua Tur;}{\f259\froman\fcharset186\fprq2{\*\panose 00000000000000000000}Book Antiqua Baltic;}{\f260\fswiss\fcharset238\fprq2{\*\panose 00000000000000000000}Haettenschweiler CE;} ++{\f261\fswiss\fcharset204\fprq2{\*\panose 00000000000000000000}Haettenschweiler Cyr;}{\f262\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}Haettenschweiler Greek;} ++{\f263\fswiss\fcharset162\fprq2{\*\panose 00000000000000000000}Haettenschweiler Tur;}{\f264\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Haettenschweiler Baltic;} ++{\f265\fscript\fcharset238\fprq2{\*\panose 00000000000000000000}Monotype Corsiva CE;}{\f266\fscript\fcharset204\fprq2{\*\panose 00000000000000000000}Monotype Corsiva Cyr;} ++{\f267\fscript\fcharset161\fprq2{\*\panose 00000000000000000000}Monotype Corsiva Greek;}{\f268\fscript\fcharset162\fprq2{\*\panose 00000000000000000000}Monotype Corsiva Tur;} ++{\f269\fscript\fcharset186\fprq2{\*\panose 00000000000000000000}Monotype Corsiva Baltic;}{\f270\fswiss\fcharset204\fprq2{\*\panose 00000000000000000000}CA Chess Cyr;}{\f271\fswiss\fcharset162\fprq2{\*\panose 00000000000000000000}CA Chess Tur;} ++{\f272\fmodern\fcharset238\fprq1{\*\panose 00000000000000000000}HE_TERMINAL CE;}{\f273\fmodern\fcharset204\fprq1{\*\panose 00000000000000000000}HE_TERMINAL Cyr;}{\f274\fmodern\fcharset161\fprq1{\*\panose 00000000000000000000}HE_TERMINAL Greek;} ++{\f275\fmodern\fcharset162\fprq1{\*\panose 00000000000000000000}HE_TERMINAL Tur;}{\f276\fmodern\fcharset186\fprq1{\*\panose 00000000000000000000}HE_TERMINAL Baltic;}{\f277\fnil\fcharset161\fprq2{\*\panose 00000000000000000000}Sydnie Greek;} ++{\f278\fmodern\fcharset128\fprq1{\*\panose 00000000000000000000}Gothic{\*\falt ?????};}{\f279\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}News Gothic MT;}{\f280\fscript\fcharset0\fprq2{\*\panose 00000000000000000000}Lucida Handwriting;} ++{\f281\froman\fcharset0\fprq2{\*\panose 00000000000000000000}Calisto MT;}{\f282\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Abadi MT Condensed Light;}{\f283\fdecor\fcharset0\fprq2{\*\panose 00000000000000000000}Westminster;} ++{\f284\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}OCR-A II;}{\f285\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}OCR B MT;}{\f286\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II;} ++{\f287\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II Condensed;}{\f288\fmodern\fcharset0\fprq1{\*\panose 00000000000000000000}QuickType II Mono;}{\f289\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}QuickType II Pi;} ++{\f290\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}Franklin Gothic Medium Cond Gre;}{\f291\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Franklin Gothic Medium Cond Bal;} ++{\f292\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Franklin Gothic Demi Cond Balti;}{\f293\froman\fcharset238\fprq0{\*\panose 00000000000000000000}?? CE;}{\f294\froman\fcharset162\fprq0{\*\panose 00000000000000000000}?? Tur;} ++{\f295\fswiss\fcharset238\fprq2{\*\panose 00000000000000000000}Calibri CE;}{\f296\fswiss\fcharset204\fprq2{\*\panose 00000000000000000000}Calibri Cyr;}{\f297\fswiss\fcharset161\fprq2{\*\panose 00000000000000000000}Calibri Greek;} ++{\f298\fswiss\fcharset162\fprq2{\*\panose 00000000000000000000}Calibri Tur;}{\f299\fswiss\fcharset186\fprq2{\*\panose 00000000000000000000}Calibri Baltic;}{\f300\froman\fcharset238\fprq2{\*\panose 00000000000000000000}Cambria Math CE;} ++{\f301\froman\fcharset204\fprq2{\*\panose 00000000000000000000}Cambria Math Cyr;}{\f302\froman\fcharset161\fprq2{\*\panose 00000000000000000000}Cambria Math Greek;}{\f303\froman\fcharset162\fprq2{\*\panose 00000000000000000000}Cambria Math Tur;} ++{\f304\froman\fcharset186\fprq2{\*\panose 00000000000000000000}Cambria Math Baltic;}{\f305\froman\fcharset238\fprq2 Times New Roman CE;}{\f306\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f308\froman\fcharset161\fprq2 Times New Roman Greek;} ++{\f309\froman\fcharset162\fprq2 Times New Roman Tur;}{\f310\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f311\fswiss\fcharset238\fprq2 Arial CE;}{\f312\fswiss\fcharset204\fprq2 Arial Cyr;}{\f314\fswiss\fcharset161\fprq2 Arial Greek;} ++{\f315\fswiss\fcharset162\fprq2 Arial Tur;}{\f316\fswiss\fcharset186\fprq2 Arial Baltic;}{\f317\fmodern\fcharset238\fprq1 Courier New CE;}{\f318\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f320\fmodern\fcharset161\fprq1 Courier New Greek;} ++{\f321\fmodern\fcharset162\fprq1 Courier New Tur;}{\f322\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f329\froman\fcharset238\fprq2 Times CE;}{\f330\froman\fcharset204\fprq2 Times Cyr;}{\f332\froman\fcharset161\fprq2 Times Greek;} ++{\f333\froman\fcharset162\fprq2 Times Tur;}{\f334\froman\fcharset186\fprq2 Times Baltic;}{\f335\fswiss\fcharset238\fprq2 Helvetica CE{\*\falt Arial};}{\f336\fswiss\fcharset204\fprq2 Helvetica Cyr{\*\falt Arial};} ++{\f338\fswiss\fcharset161\fprq2 Helvetica Greek{\*\falt Arial};}{\f339\fswiss\fcharset162\fprq2 Helvetica Tur{\*\falt Arial};}{\f340\fswiss\fcharset186\fprq2 Helvetica Baltic{\*\falt Arial};}{\f395\fswiss\fcharset238\fprq2 Tahoma CE;} ++{\f396\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f398\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f399\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f400\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f403\fnil\fcharset0\fprq2 SimSun{\*\falt ??};} ++{\f521\fmodern\fcharset238\fprq1 Lucida Console CE;}{\f522\fmodern\fcharset204\fprq1 Lucida Console Cyr;}{\f524\fmodern\fcharset161\fprq1 Lucida Console Greek;}{\f525\fmodern\fcharset162\fprq1 Lucida Console Tur;} ++{\f527\fswiss\fcharset238\fprq2 Lucida Sans Unicode CE;}{\f528\fswiss\fcharset204\fprq2 Lucida Sans Unicode Cyr;}{\f530\fswiss\fcharset161\fprq2 Lucida Sans Unicode Greek;}{\f531\fswiss\fcharset162\fprq2 Lucida Sans Unicode Tur;} ++{\f533\fswiss\fcharset238\fprq2 Verdana CE;}{\f534\fswiss\fcharset204\fprq2 Verdana Cyr;}{\f536\fswiss\fcharset161\fprq2 Verdana Greek;}{\f537\fswiss\fcharset162\fprq2 Verdana Tur;}{\f538\fswiss\fcharset186\fprq2 Verdana Baltic;} ++{\f539\fswiss\fcharset238\fprq2 Arial Black CE;}{\f540\fswiss\fcharset204\fprq2 Arial Black Cyr;}{\f542\fswiss\fcharset161\fprq2 Arial Black Greek;}{\f543\fswiss\fcharset162\fprq2 Arial Black Tur;}{\f544\fswiss\fcharset186\fprq2 Arial Black Baltic;} ++{\f545\fscript\fcharset238\fprq2 Comic Sans MS CE;}{\f546\fscript\fcharset204\fprq2 Comic Sans MS Cyr;}{\f548\fscript\fcharset161\fprq2 Comic Sans MS Greek;}{\f549\fscript\fcharset162\fprq2 Comic Sans MS Tur;} ++{\f550\fscript\fcharset186\fprq2 Comic Sans MS Baltic;}{\f551\fswiss\fcharset238\fprq2 Impact CE;}{\f552\fswiss\fcharset204\fprq2 Impact Cyr;}{\f554\fswiss\fcharset161\fprq2 Impact Greek;}{\f555\fswiss\fcharset162\fprq2 Impact Tur;} ++{\f556\fswiss\fcharset186\fprq2 Impact Baltic;}{\f557\froman\fcharset238\fprq2 Georgia CE;}{\f558\froman\fcharset204\fprq2 Georgia Cyr;}{\f560\froman\fcharset161\fprq2 Georgia Greek;}{\f561\froman\fcharset162\fprq2 Georgia Tur;} ++{\f562\froman\fcharset186\fprq2 Georgia Baltic;}{\f563\fswiss\fcharset238\fprq2 Franklin Gothic Medium CE;}{\f564\fswiss\fcharset204\fprq2 Franklin Gothic Medium Cyr;}{\f566\fswiss\fcharset161\fprq2 Franklin Gothic Medium Greek;} ++{\f567\fswiss\fcharset162\fprq2 Franklin Gothic Medium Tur;}{\f568\fswiss\fcharset186\fprq2 Franklin Gothic Medium Baltic;}{\f569\froman\fcharset238\fprq2 Palatino Linotype CE;}{\f570\froman\fcharset204\fprq2 Palatino Linotype Cyr;} ++{\f572\froman\fcharset161\fprq2 Palatino Linotype Greek;}{\f573\froman\fcharset162\fprq2 Palatino Linotype Tur;}{\f574\froman\fcharset186\fprq2 Palatino Linotype Baltic;}{\f575\fswiss\fcharset238\fprq2 Trebuchet MS CE;} ++{\f576\fswiss\fcharset204\fprq2 Trebuchet MS Cyr;}{\f578\fswiss\fcharset161\fprq2 Trebuchet MS Greek;}{\f579\fswiss\fcharset162\fprq2 Trebuchet MS Tur;}{\f580\fswiss\fcharset186\fprq2 Trebuchet MS Baltic;}{\f635\froman\fcharset238\fprq2 Sylfaen CE;} ++{\f636\froman\fcharset204\fprq2 Sylfaen Cyr;}{\f638\froman\fcharset161\fprq2 Sylfaen Greek;}{\f639\froman\fcharset162\fprq2 Sylfaen Tur;}{\f640\froman\fcharset186\fprq2 Sylfaen Baltic;}{\f641\fswiss\fcharset238\fprq2 Microsoft Sans Serif CE;} ++{\f642\fswiss\fcharset204\fprq2 Microsoft Sans Serif Cyr;}{\f644\fswiss\fcharset161\fprq2 Microsoft Sans Serif Greek;}{\f645\fswiss\fcharset162\fprq2 Microsoft Sans Serif Tur;}{\f646\fswiss\fcharset186\fprq2 Microsoft Sans Serif Baltic;} ++{\f647\fswiss\fcharset238\fprq2 Arial Narrow CE;}{\f648\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f650\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f651\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f652\fswiss\fcharset186\fprq2 Arial Narrow Baltic;} ++{\f653\froman\fcharset238\fprq2 Rockwell CE;}{\f665\fscript\fcharset238\fprq2 Mistral CE;}{\f666\fscript\fcharset204\fprq2 Mistral Cyr;}{\f668\fscript\fcharset161\fprq2 Mistral Greek;}{\f669\fscript\fcharset162\fprq2 Mistral Tur;} ++{\f670\fscript\fcharset186\fprq2 Mistral Baltic;}{\f737\fswiss\fcharset238\fprq2 Franklin Gothic Book CE;}{\f738\fswiss\fcharset204\fprq2 Franklin Gothic Book Cyr;}{\f740\fswiss\fcharset161\fprq2 Franklin Gothic Book Greek;} ++{\f741\fswiss\fcharset162\fprq2 Franklin Gothic Book Tur;}{\f742\fswiss\fcharset186\fprq2 Franklin Gothic Book Baltic;}{\f743\fswiss\fcharset238\fprq2 Franklin Gothic Demi CE;}{\f744\fswiss\fcharset204\fprq2 Franklin Gothic Demi Cyr;} ++{\f746\fswiss\fcharset161\fprq2 Franklin Gothic Demi Greek;}{\f747\fswiss\fcharset162\fprq2 Franklin Gothic Demi Tur;}{\f748\fswiss\fcharset186\fprq2 Franklin Gothic Demi Baltic;}{\f749\fswiss\fcharset238\fprq2 Franklin Gothic Medium Cond CE;} ++{\f750\fswiss\fcharset204\fprq2 Franklin Gothic Medium Cond Cyr;}{\f752\fswiss\fcharset161\fprq2 Franklin Gothic Medium Cond Greek;}{\f753\fswiss\fcharset162\fprq2 Franklin Gothic Medium Cond Tur;} ++{\f754\fswiss\fcharset186\fprq2 Franklin Gothic Medium Cond Baltic;}{\f755\fswiss\fcharset238\fprq2 Franklin Gothic Heavy CE;}{\f756\fswiss\fcharset204\fprq2 Franklin Gothic Heavy Cyr;}{\f758\fswiss\fcharset161\fprq2 Franklin Gothic Heavy Greek;} ++{\f759\fswiss\fcharset162\fprq2 Franklin Gothic Heavy Tur;}{\f760\fswiss\fcharset186\fprq2 Franklin Gothic Heavy Baltic;}{\f761\fswiss\fcharset238\fprq2 Franklin Gothic Demi Cond CE;}{\f762\fswiss\fcharset204\fprq2 Franklin Gothic Demi Cond Cyr;} ++{\f764\fswiss\fcharset161\fprq2 Franklin Gothic Demi Cond Greek;}{\f765\fswiss\fcharset162\fprq2 Franklin Gothic Demi Cond Tur;}{\f766\fswiss\fcharset186\fprq2 Franklin Gothic Demi Cond Baltic;}{\f773\fswiss\fcharset238\fprq2 Century Gothic CE;} ++{\f774\fswiss\fcharset204\fprq2 Century Gothic Cyr;}{\f776\fswiss\fcharset161\fprq2 Century Gothic Greek;}{\f777\fswiss\fcharset162\fprq2 Century Gothic Tur;}{\f778\fswiss\fcharset186\fprq2 Century Gothic Baltic;} ++{\f869\fswiss\fcharset238\fprq2 MS Reference Sans Serif CE;}{\f870\fswiss\fcharset204\fprq2 MS Reference Sans Serif Cyr;}{\f872\fswiss\fcharset161\fprq2 MS Reference Sans Serif Greek;}{\f873\fswiss\fcharset162\fprq2 MS Reference Sans Serif Tur;} ++{\f874\fswiss\fcharset186\fprq2 MS Reference Sans Serif Baltic;}{\f893\froman\fcharset238\fprq2 Bookman Old Style CE;}{\f894\froman\fcharset204\fprq2 Bookman Old Style Cyr;}{\f896\froman\fcharset161\fprq2 Bookman Old Style Greek;} ++{\f897\froman\fcharset162\fprq2 Bookman Old Style Tur;}{\f898\froman\fcharset186\fprq2 Bookman Old Style Baltic;}{\f905\froman\fcharset238\fprq2 Garamond CE;}{\f906\froman\fcharset204\fprq2 Garamond Cyr;}{\f908\froman\fcharset161\fprq2 Garamond Greek;} ++{\f909\froman\fcharset162\fprq2 Garamond Tur;}{\f910\froman\fcharset186\fprq2 Garamond Baltic;}{\f945\fnil\fcharset162\fprq2 Superchess Tur;}{\f961\fmodern\fcharset0\fprq1 MS Mincho{\*\falt ?? ??};} ++{\f959\fmodern\fcharset238\fprq1 MS Mincho CE{\*\falt ?? ??};}{\f960\fmodern\fcharset204\fprq1 MS Mincho Cyr{\*\falt ?? ??};}{\f962\fmodern\fcharset161\fprq1 MS Mincho Greek{\*\falt ?? ??};}{\f963\fmodern\fcharset162\fprq1 MS Mincho Tur{\*\falt ?? ??};} ++{\f964\fmodern\fcharset186\fprq1 MS Mincho Baltic{\*\falt ?? ??};}{\f967\fmodern\fcharset0\fprq1 @MS Mincho;}{\f965\fmodern\fcharset238\fprq1 @MS Mincho CE;}{\f966\fmodern\fcharset204\fprq1 @MS Mincho Cyr;} ++{\f968\fmodern\fcharset161\fprq1 @MS Mincho Greek;}{\f969\fmodern\fcharset162\fprq1 @MS Mincho Tur;}{\f970\fmodern\fcharset186\fprq1 @MS Mincho Baltic;}{\f973\froman\fcharset0\fprq2 MS PMincho;}{\f971\froman\fcharset238\fprq2 MS PMincho CE;} ++{\f972\froman\fcharset204\fprq2 MS PMincho Cyr;}{\f974\froman\fcharset161\fprq2 MS PMincho Greek;}{\f975\froman\fcharset162\fprq2 MS PMincho Tur;}{\f976\froman\fcharset186\fprq2 MS PMincho Baltic;}{\f979\froman\fcharset0\fprq2 @MS PMincho;} ++{\f977\froman\fcharset238\fprq2 @MS PMincho CE;}{\f978\froman\fcharset204\fprq2 @MS PMincho Cyr;}{\f980\froman\fcharset161\fprq2 @MS PMincho Greek;}{\f981\froman\fcharset162\fprq2 @MS PMincho Tur;}{\f982\froman\fcharset186\fprq2 @MS PMincho Baltic;} ++{\f985\fmodern\fcharset0\fprq1 MS Gothic{\*\falt ?? ????};}{\f983\fmodern\fcharset238\fprq1 MS Gothic CE{\*\falt ?? ????};}{\f984\fmodern\fcharset204\fprq1 MS Gothic Cyr{\*\falt ?? ????};}{\f986\fmodern\fcharset161\fprq1 MS Gothic Greek{\*\falt ?? ????};} ++{\f987\fmodern\fcharset162\fprq1 MS Gothic Tur{\*\falt ?? ????};}{\f988\fmodern\fcharset186\fprq1 MS Gothic Baltic{\*\falt ?? ????};}{\f991\fmodern\fcharset0\fprq1 @MS Gothic;}{\f989\fmodern\fcharset238\fprq1 @MS Gothic CE;} ++{\f990\fmodern\fcharset204\fprq1 @MS Gothic Cyr;}{\f992\fmodern\fcharset161\fprq1 @MS Gothic Greek;}{\f993\fmodern\fcharset162\fprq1 @MS Gothic Tur;}{\f994\fmodern\fcharset186\fprq1 @MS Gothic Baltic;}{\f997\fswiss\fcharset0\fprq2 MS PGothic;} ++{\f995\fswiss\fcharset238\fprq2 MS PGothic CE;}{\f996\fswiss\fcharset204\fprq2 MS PGothic Cyr;}{\f998\fswiss\fcharset161\fprq2 MS PGothic Greek;}{\f999\fswiss\fcharset162\fprq2 MS PGothic Tur;}{\f1000\fswiss\fcharset186\fprq2 MS PGothic Baltic;} ++{\f1003\fswiss\fcharset0\fprq2 @MS PGothic;}{\f1001\fswiss\fcharset238\fprq2 @MS PGothic CE;}{\f1002\fswiss\fcharset204\fprq2 @MS PGothic Cyr;}{\f1004\fswiss\fcharset161\fprq2 @MS PGothic Greek;}{\f1005\fswiss\fcharset162\fprq2 @MS PGothic Tur;} ++{\f1006\fswiss\fcharset186\fprq2 @MS PGothic Baltic;}{\f1009\fswiss\fcharset0\fprq2 MS UI Gothic;}{\f1007\fswiss\fcharset238\fprq2 MS UI Gothic CE;}{\f1008\fswiss\fcharset204\fprq2 MS UI Gothic Cyr;}{\f1010\fswiss\fcharset161\fprq2 MS UI Gothic Greek;} ++{\f1011\fswiss\fcharset162\fprq2 MS UI Gothic Tur;}{\f1012\fswiss\fcharset186\fprq2 MS UI Gothic Baltic;}{\f1015\fswiss\fcharset0\fprq2 @MS UI Gothic;}{\f1013\fswiss\fcharset238\fprq2 @MS UI Gothic CE;}{\f1014\fswiss\fcharset204\fprq2 @MS UI Gothic Cyr;} ++{\f1016\fswiss\fcharset161\fprq2 @MS UI Gothic Greek;}{\f1017\fswiss\fcharset162\fprq2 @MS UI Gothic Tur;}{\f1018\fswiss\fcharset186\fprq2 @MS UI Gothic Baltic;}{\f1021\fswiss\fcharset0\fprq2 Gulim{\*\falt ??};} ++{\f1019\fswiss\fcharset238\fprq2 Gulim CE{\*\falt ??};}{\f1020\fswiss\fcharset204\fprq2 Gulim Cyr{\*\falt ??};}{\f1022\fswiss\fcharset161\fprq2 Gulim Greek{\*\falt ??};}{\f1023\fswiss\fcharset162\fprq2 Gulim Tur{\*\falt ??};} ++{\f1024\fswiss\fcharset186\fprq2 Gulim Baltic{\*\falt ??};}{\f1027\fswiss\fcharset0\fprq2 @Gulim;}{\f1025\fswiss\fcharset238\fprq2 @Gulim CE;}{\f1026\fswiss\fcharset204\fprq2 @Gulim Cyr;}{\f1028\fswiss\fcharset161\fprq2 @Gulim Greek;} ++{\f1029\fswiss\fcharset162\fprq2 @Gulim Tur;}{\f1030\fswiss\fcharset186\fprq2 @Gulim Baltic;}{\f1033\fmodern\fcharset0\fprq1 GulimChe;}{\f1031\fmodern\fcharset238\fprq1 GulimChe CE;}{\f1032\fmodern\fcharset204\fprq1 GulimChe Cyr;} ++{\f1034\fmodern\fcharset161\fprq1 GulimChe Greek;}{\f1035\fmodern\fcharset162\fprq1 GulimChe Tur;}{\f1036\fmodern\fcharset186\fprq1 GulimChe Baltic;}{\f1039\fmodern\fcharset0\fprq1 @GulimChe;}{\f1037\fmodern\fcharset238\fprq1 @GulimChe CE;} ++{\f1038\fmodern\fcharset204\fprq1 @GulimChe Cyr;}{\f1040\fmodern\fcharset161\fprq1 @GulimChe Greek;}{\f1041\fmodern\fcharset162\fprq1 @GulimChe Tur;}{\f1042\fmodern\fcharset186\fprq1 @GulimChe Baltic;}{\f1045\fswiss\fcharset0\fprq2 Dotum{\*\falt ??};} ++{\f1043\fswiss\fcharset238\fprq2 Dotum CE{\*\falt ??};}{\f1044\fswiss\fcharset204\fprq2 Dotum Cyr{\*\falt ??};}{\f1046\fswiss\fcharset161\fprq2 Dotum Greek{\*\falt ??};}{\f1047\fswiss\fcharset162\fprq2 Dotum Tur{\*\falt ??};} ++{\f1048\fswiss\fcharset186\fprq2 Dotum Baltic{\*\falt ??};}{\f1051\fswiss\fcharset0\fprq2 @Dotum;}{\f1049\fswiss\fcharset238\fprq2 @Dotum CE;}{\f1050\fswiss\fcharset204\fprq2 @Dotum Cyr;}{\f1052\fswiss\fcharset161\fprq2 @Dotum Greek;} ++{\f1053\fswiss\fcharset162\fprq2 @Dotum Tur;}{\f1054\fswiss\fcharset186\fprq2 @Dotum Baltic;}{\f1057\fmodern\fcharset0\fprq1 DotumChe;}{\f1055\fmodern\fcharset238\fprq1 DotumChe CE;}{\f1056\fmodern\fcharset204\fprq1 DotumChe Cyr;} ++{\f1058\fmodern\fcharset161\fprq1 DotumChe Greek;}{\f1059\fmodern\fcharset162\fprq1 DotumChe Tur;}{\f1060\fmodern\fcharset186\fprq1 DotumChe Baltic;}{\f1063\fmodern\fcharset0\fprq1 @DotumChe;}{\f1061\fmodern\fcharset238\fprq1 @DotumChe CE;} ++{\f1062\fmodern\fcharset204\fprq1 @DotumChe Cyr;}{\f1064\fmodern\fcharset161\fprq1 @DotumChe Greek;}{\f1065\fmodern\fcharset162\fprq1 @DotumChe Tur;}{\f1066\fmodern\fcharset186\fprq1 @DotumChe Baltic;}{\f1069\froman\fcharset0\fprq2 Batang{\*\falt ??};} ++{\f1067\froman\fcharset238\fprq2 Batang CE{\*\falt ??};}{\f1068\froman\fcharset204\fprq2 Batang Cyr{\*\falt ??};}{\f1070\froman\fcharset161\fprq2 Batang Greek{\*\falt ??};}{\f1071\froman\fcharset162\fprq2 Batang Tur{\*\falt ??};} ++{\f1072\froman\fcharset186\fprq2 Batang Baltic{\*\falt ??};}{\f1075\froman\fcharset0\fprq2 @Batang;}{\f1073\froman\fcharset238\fprq2 @Batang CE;}{\f1074\froman\fcharset204\fprq2 @Batang Cyr;}{\f1076\froman\fcharset161\fprq2 @Batang Greek;} ++{\f1077\froman\fcharset162\fprq2 @Batang Tur;}{\f1078\froman\fcharset186\fprq2 @Batang Baltic;}{\f1081\fmodern\fcharset0\fprq1 BatangChe;}{\f1079\fmodern\fcharset238\fprq1 BatangChe CE;}{\f1080\fmodern\fcharset204\fprq1 BatangChe Cyr;} ++{\f1082\fmodern\fcharset161\fprq1 BatangChe Greek;}{\f1083\fmodern\fcharset162\fprq1 BatangChe Tur;}{\f1084\fmodern\fcharset186\fprq1 BatangChe Baltic;}{\f1087\fmodern\fcharset0\fprq1 @BatangChe;}{\f1085\fmodern\fcharset238\fprq1 @BatangChe CE;} ++{\f1086\fmodern\fcharset204\fprq1 @BatangChe Cyr;}{\f1088\fmodern\fcharset161\fprq1 @BatangChe Greek;}{\f1089\fmodern\fcharset162\fprq1 @BatangChe Tur;}{\f1090\fmodern\fcharset186\fprq1 @BatangChe Baltic;}{\f1093\froman\fcharset0\fprq2 Gungsuh;} ++{\f1091\froman\fcharset238\fprq2 Gungsuh CE;}{\f1092\froman\fcharset204\fprq2 Gungsuh Cyr;}{\f1094\froman\fcharset161\fprq2 Gungsuh Greek;}{\f1095\froman\fcharset162\fprq2 Gungsuh Tur;}{\f1096\froman\fcharset186\fprq2 Gungsuh Baltic;} ++{\f1099\froman\fcharset0\fprq2 @Gungsuh;}{\f1097\froman\fcharset238\fprq2 @Gungsuh CE;}{\f1098\froman\fcharset204\fprq2 @Gungsuh Cyr;}{\f1100\froman\fcharset161\fprq2 @Gungsuh Greek;}{\f1101\froman\fcharset162\fprq2 @Gungsuh Tur;} ++{\f1102\froman\fcharset186\fprq2 @Gungsuh Baltic;}{\f1105\fmodern\fcharset0\fprq1 GungsuhChe;}{\f1103\fmodern\fcharset238\fprq1 GungsuhChe CE;}{\f1104\fmodern\fcharset204\fprq1 GungsuhChe Cyr;}{\f1106\fmodern\fcharset161\fprq1 GungsuhChe Greek;} ++{\f1107\fmodern\fcharset162\fprq1 GungsuhChe Tur;}{\f1108\fmodern\fcharset186\fprq1 GungsuhChe Baltic;}{\f1111\fmodern\fcharset0\fprq1 @GungsuhChe;}{\f1109\fmodern\fcharset238\fprq1 @GungsuhChe CE;}{\f1110\fmodern\fcharset204\fprq1 @GungsuhChe Cyr;} ++{\f1112\fmodern\fcharset161\fprq1 @GungsuhChe Greek;}{\f1113\fmodern\fcharset162\fprq1 @GungsuhChe Tur;}{\f1114\fmodern\fcharset186\fprq1 @GungsuhChe Baltic;}{\f1117\fnil\fcharset0\fprq2 @SimSun;}{\f1123\fmodern\fcharset0\fprq1 NSimSun;} ++{\f1129\fmodern\fcharset0\fprq1 @NSimSun;}{\f1147\fmodern\fcharset0\fprq1 MingLiU{\*\falt ???};}{\f1153\fmodern\fcharset0\fprq1 @MingLiU;}{\f1159\froman\fcharset0\fprq2 PMingLiU{\*\falt ????};}{\f1165\froman\fcharset0\fprq2 @PMingLiU;}} ++{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; ++\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext0 Normal;}{\s1\li120\sb280\sa120\sl-320\slmult0 ++\nowidctlpar\adjustright \b\f5\cgrid \sbasedon0 \snext26 heading 1;}{\s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \b\f5\fs20\cgrid \sbasedon0 \snext0 heading 2;}{\s3\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid ++\sbasedon0 \snext0 heading 3;}{\s4\fi-245\li360\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \f11\fs20\cgrid \sbasedon2 \snext4 heading 4;}{\s5\li120\sb80\sl-240\slmult0\keepn\nowidctlpar\outlinelevel4\adjustright \f5\fs20\ul\cgrid ++\sbasedon0 \snext0 heading 5;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive \f5\fs18\up6\lang1033 \sbasedon10 footnote reference;}{\s16\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext0 footnote text;}{ ++\s17\li360\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext0 Normal Indent;}{\s18\fi-240\li600\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext18 Jli;}{\s19\li120\sb60\sl-240\slmult0\keep\nowidctlpar + \tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid \snext19 Ex;}{\s20\li120\sb160\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext29 Sa1;}{\s21\fi-240\li360\sl-240\slmult0\nowidctlpar\tx360\adjustright \f5\fs20\cgrid \snext22 Lb1;}{ + \s22\fi-240\li360\sb60\sl-240\slmult0\nowidctlpar\tx360\adjustright \f5\fs20\cgrid \snext22 Lb2;}{\s23\li360\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext22 Lp1;}{\s24\fi-1800\li1920\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb + \brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1920\adjustright \b\f5\fs20\cgrid \snext25 Th;}{\s25\fi-1800\li1920\sb60\sl-240\slmult0\nowidctlpar\tx1920\adjustright \f5\fs20\cgrid \snext25 Tp;}{\s26\li120\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid \snext0 Normal 2;}{\s27\li120\sb120\sa120\nowidctlpar\adjustright \f5\fs20\cgrid \snext0 bitmap;}{\s28\li120\sb120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \snext29 Sa2;}{\s29\fi-240\li360\sb60\sl-240\slmult0 -\nowidctlpar\adjustright \f5\fs20\cgrid \snext29 Jl;}{\s30\li120\sa60\nowidctlpar\adjustright \f28\fs20\cgrid \snext30 *body;}{\s31\li120\sa60\nowidctlpar\adjustright \b\f28\fs20\cgrid \snext31 *heading;}{\s32\li120\sa60\sl-240\slmult0 -\nowidctlpar\adjustright \f28\fs20\cgrid \sbasedon30 \snext32 para;}{\s33\fi-280\li400\sa60\nowidctlpar\adjustright \f28\fs20\cgrid \sbasedon30 \snext33 jump;}{\s34\fi-280\li400\sa60\nowidctlpar\tx400\adjustright \f28\fs20\cgrid \sbasedon30 \snext34 -list bullet;}{\s35\fi-280\li600\sa60\nowidctlpar\adjustright \f28\fs20\cgrid \sbasedon30 \snext35 jump indent;}{\s36\li120\sa60\sl-40\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \adjustright \f28\fs20\cgrid -\sbasedon30 \snext36 table rule;}{\s37\fi-280\li400\sa60\nowidctlpar\tqr\tx280\tx400\adjustright \f28\fs20\cgrid \sbasedon30 \snext37 list number;}{\s38\li120\sb100\sa60\nowidctlpar\adjustright \b\f28\fs20\cgrid \sbasedon31 \snext33 see also;}{ -\s39\li400\sa60\nowidctlpar\adjustright \f28\fs20\cgrid \sbasedon30 \snext39 para indent;}{\s40\fi-1800\li1920\nowidctlpar\tx1920\adjustright \b\f28\fs20\cgrid \sbasedon31 \snext36 table head;}{\s41\fi-1800\li1920\sa60\nowidctlpar\tx1920\adjustright -\f28\fs20\cgrid \sbasedon30 \snext41 table text;}{\s42\li120\sb120\sa60\nowidctlpar\adjustright \f28\fs20\cgrid \sbasedon30 \snext35 see also 2;}{\s43\li120\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs20\cgrid -\sbasedon30 \snext43 code;}{\s44\sl-120\slmult0\nowidctlpar\adjustright \f29\fs20\cgrid \snext32 *spacing;}{\s45\sl-120\slmult0\nowidctlpar\adjustright \f29\fs20\cgrid \sbasedon44 \snext45 s6;}{\s46\qj\li360\nowidctlpar\adjustright \f5\cgrid ++\nowidctlpar\adjustright \f5\fs20\cgrid \snext29 Jl;}{\s30\li120\sa60\nowidctlpar\adjustright \f151\fs20\cgrid \snext30 *body;}{\s31\li120\sa60\nowidctlpar\adjustright \b\f151\fs20\cgrid \snext31 *heading;}{\s32\li120\sa60\sl-240\slmult0 ++\nowidctlpar\adjustright \f151\fs20\cgrid \sbasedon30 \snext32 para;}{\s33\fi-280\li400\sa60\nowidctlpar\adjustright \f151\fs20\cgrid \sbasedon30 \snext33 jump;}{\s34\fi-280\li400\sa60\nowidctlpar\tx400\adjustright \f151\fs20\cgrid \sbasedon30 \snext34 ++list bullet;}{\s35\fi-280\li600\sa60\nowidctlpar\adjustright \f151\fs20\cgrid \sbasedon30 \snext35 jump indent;}{\s36\li120\sa60\sl-40\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \adjustright \f151\fs20\cgrid ++\sbasedon30 \snext36 table rule;}{\s37\fi-280\li400\sa60\nowidctlpar\tqr\tx280\tx400\adjustright \f151\fs20\cgrid \sbasedon30 \snext37 list number;}{\s38\li120\sb100\sa60\nowidctlpar\adjustright \b\f151\fs20\cgrid \sbasedon31 \snext33 see also;}{ ++\s39\li400\sa60\nowidctlpar\adjustright \f151\fs20\cgrid \sbasedon30 \snext39 para indent;}{\s40\fi-1800\li1920\nowidctlpar\tx1920\adjustright \b\f151\fs20\cgrid \sbasedon31 \snext36 table head;}{\s41\fi-1800\li1920\sa60\nowidctlpar\tx1920\adjustright ++\f151\fs20\cgrid \sbasedon30 \snext41 table text;}{\s42\li120\sb120\sa60\nowidctlpar\adjustright \f151\fs20\cgrid \sbasedon30 \snext35 see also 2;}{\s43\li120\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs20\cgrid ++\sbasedon30 \snext43 code;}{\s44\sl-120\slmult0\nowidctlpar\adjustright \f152\fs20\cgrid \snext32 *spacing;}{\s45\sl-120\slmult0\nowidctlpar\adjustright \f152\fs20\cgrid \sbasedon44 \snext45 s6;}{\s46\qj\li360\nowidctlpar\adjustright \f5\cgrid + \sbasedon0 \snext46 Help Text;}{\s47\li115\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \adjustright \f11\fs20\cgrid \sbasedon24 \snext25 Th2;}{\s48\li115\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb + \brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \adjustright \b\f11\fs16\cgrid \sbasedon24 \snext25 Th3;}{\s49\li115\sb200\sl-240\slmult0\nowidctlpar\adjustright \f11\fs20\cgrid \sbasedon0 \snext0 Normal 3;}{ + \s50\fi-1800\li1915\sb120\sa40\sl-240\slmult0\nowidctlpar\brdrb\brdrs\brdrw15\brsp20 \brdrbtw\brdrs\brdrw15\brsp20 \tx1915\adjustright \b\f11\fs20\cgrid \sbasedon0 \snext51 Thh;}{\s51\fi-1800\li1915\sb60\sl-240\slmult0\nowidctlpar\tx1915\adjustright + \f11\fs20\cgrid \sbasedon0 \snext51 Tph;}{\s52\li288\ri-432\sb80\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\adjustright \f5\cgrid \sbasedon0 \snext52 unixman1;}{\s53\li1440\ri-432\sb80\sa240\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\adjustright + \f5\cgrid \sbasedon0 \snext53 unixman2;}{\s54\li115\ri-432\sb80\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\adjustright \f5\cgrid \sbasedon52 \snext54 unixman0;}{\s55\li288\ri-432\sb80\sa240\sl-240\slmult0\nowidctlpar\tx288\tx864\tx1440\adjustright + \f5\cgrid \sbasedon52 \snext55 unixman1a;}{\s56\li115\sa60\sl-240\slmult0\nowidctlpar\adjustright \b\f5\fs20\cgrid \sbasedon2 \snext56 heading 2a;}{\s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext57 endnote text;}{\* + \cs58 \additive \super \sbasedon10 endnote reference;}{\*\cs59 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\*\cs60 \additive \ul\cf12 \sbasedon10 FollowedHyperlink;}{\s61\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \cbpat9 \f15\fs20\cgrid + \sbasedon0 \snext61 Document Map;}{\s62\li480\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid \sbasedon0 \snext62 Body Text 2;}{\s63\fi-720\li1440\sb80\sl-240\slmult0\nowidctlpar\adjustright \f2\fs20\cgrid \sbasedon0 \snext63 + Body Text Indent 2;}{\s64\li120\sb80\sl-240\slmult0\nowidctlpar\tqc\tx4320\tqr\tx8640\adjustright \f5\fs20\cgrid \sbasedon0 \snext64 header;}{\s65\li120\sb80\sl-240\slmult0\nowidctlpar\tqc\tx4320\tqr\tx8640\adjustright \f5\fs20\cgrid \sbasedon0 \snext65 + footer;}{\s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid \sbasedon0 \snext66 Body Text Indent 3;}}{\*\listtable{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0 + \levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid74976790}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext + \'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid349260549}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers + ;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid470094698}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360 + \jclisttab\tx360 }{\listname ;}\listid640160996}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 } + {\listname ;}\listid768165129}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid781152802} + {\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid903878531}{\list\listtemplateid67698689 + \listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1002394966}{\list\listtemplateid67698703\listsimple + {\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1021513731}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0 + \leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1099714113}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0 + \levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1240552867}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0 + \levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1332292840}{\list\listtemplateid67698703\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext + \'02\'00.;}{\levelnumbers\'01;}\fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1358388700}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext + \'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1405952460}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext + \'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid2025940873}{\list\listtemplateid67698689\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext + \'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid2044863907}}{\*\listoverridetable{\listoverride\listid2025940873\listoverridecount0\ls1}{\listoverride\listid1002394966\listoverridecount0\ls2} + {\listoverride\listid470094698\listoverridecount0\ls3}{\listoverride\listid1099714113\listoverridecount0\ls4}{\listoverride\listid1358388700\listoverridecount0\ls5}{\listoverride\listid2044863907\listoverridecount0\ls6}{\listoverride\listid640160996 + \listoverridecount0\ls7}{\listoverride\listid768165129\listoverridecount0\ls8}{\listoverride\listid903878531\listoverridecount0\ls9}{\listoverride\listid781152802\listoverridecount0\ls10}{\listoverride\listid1240552867\listoverridecount0\ls11} + {\listoverride\listid640160996\listoverridecount0\ls12}{\listoverride\listid349260549\listoverridecount0\ls13}{\listoverride\listid1021513731\listoverridecount0\ls14}{\listoverride\listid1405952460\listoverridecount0\ls15}{\listoverride\listid1332292840 -\listoverridecount0\ls16}}{\*\revtbl {Unknown;}{Tim Mann;}}{\info{\title + $ # KWinBoard: Chessboard for Windows}{\author TRIO}{\operator hgm}{\creatim\yr2003\mo10\dy25\hr23\min40}{\revtim\yr2008\mo8\dy11\hr19\min22}{\printim\yr1997\mo4\dy22\hr23\min5}{\version22}{\edmins659} ++\listoverridecount0\ls16}}{\*\revtbl {Unknown;}{Tim Mann;}}{\info{\title + $ # KWinBoard: Chessboard for Windows}{\author TRIO}{\operator hgm}{\creatim\yr2003\mo10\dy25\hr23\min40}{\revtim\yr2009\mo4\dy15\hr17\min22}{\printim\yr1997\mo4\dy22\hr23\min5}{\version26}{\edmins745} + {\nofpages76}{\nofwords17127}{\nofchars-32766}{\*\company DEC SRC}{\nofcharsws0}{\vern73}}\margl1417\margr1417\margt1417\margb1417 + \widowctrl\endnotes\aendnotes\hyphhotz425\ftnnrlc\aftnnar\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\viewkind4\viewscale100 \fet1{\*\aftnsep \pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\chftnsep + + \par }}\sectd \linex0\headery709\footery709\colsx709\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4 + \pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (} + {\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid { + \cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 Contents}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Contents}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Contents}}}{\i\f1\fs32 WinBoard}{\f1\fs32 : Chessboard for Windows + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \par }\pard\plain \s2\li119\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\f1\cf11 An updated description with the release of version 4.3.14 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\f1\cf11 \tab \tab \tab \ldblquote For the ultimate WinBoard Experience\rdblquote -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 New features since WinBoard 4.2.7 that are implemented in Allessandro Scotti\rquote s WinBoard_x are highlighted in red. }{\f1\cf11 -New features in the WinBoard 4.3.xx series by H.G. Muller are highlighted in green.}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 New features since WinBoard 4.2.7 that are implemented in Allessandro Scotti\rquote s WinBoard_x are highlighted in red. }{\f1\cf11 New ++features in the WinBoard 4.3.xx series by H.G. Muller are highlighted in green}{\f1\cf2 , that in the unified 4.4 series in blue}{\f1\cf11 .}{\f1 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Description}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Description}}}{\f1 Description -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\i\f1 WinBoard}{\f1 is a g -raphical user interface for chess. It displays a chessboard on the screen, accepts moves made with the mouse, and loads and saves game files in standard chess notation. WinBoard serves as a front-end for many different services, including: ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\i\f1 WinBoard}{\f1 is a graphical user interface for chess. It displays a chessboard on the screen, accepts moves made with the mou ++se, and loads and saves game files in standard chess notation. WinBoard serves as a front-end for many different services, including: + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard\plain \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls3\adjustright + \f5\fs20\cgrid {\b\i\f1 Chess engines}{\f1 that run on your PC. You can play a game against an engine, set up arbitrary positions, force variations, or watch a game between two engines. }{\i\f1\cf11 Fairy-Max}{\f1 is supplied with WinBoard }{\f1\cf11 + 4.3.14}{\f1 , and over 100 other free chess engines are available separately. Of these, Crafty is the most popular. See }{\f1\uldb Installing Chess Engines}{\v\f1 InstallingChessEngines}{\f1 for instructions on installing additional chess engines. + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls3\adjustright {\b\i\f1 -Chess servers}{\b\f1 }{\f1 on the Internet. You can play against other Internet Chess Server (ICS) users, observe games they - are playing, review games in the ICS libraries, chat, and more. WinBoard can also be used to run an automated computer player on the ICS, but this feature is for advanced users only and is subject to some caveats; see the separate file zippy.README for i -nformation. ++Chess servers}{\b\f1 }{\f1 on the Internet. You can play against other Internet Chess Server (ICS) users, observe games they are playing, review games in the ICS libraries, chat, }{\f1\cf2 analyze observed games with a chess program}{\f1 , and more. Wi ++nBoard can also be used to run an automated computer player on the ICS, but this feature is for advanced users only and is subject to some caveats; see the separate file zippy.README for information. + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls3\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls3\adjustright {\b\i\f1 + The Web}{\f1 and your own saved games. You can use WinBoard as a helper application to view files in your Web browser or the Explorer. You can use it to keep track of email postal games, browse games off the net, or review games you have saved. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ Getting Started}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ GettingStarted}}}{\f1 Getting Started -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -WinBoard starts up in one of three major modes: chess engine mode, ICS client mode, or game viewer mode. You cannot change modes while WinBoard is running, but you can access all the game viewer features d -irectly from the other two modes. Also, you can start WinBoard several times to get multiple chessboard windows running in any combination of modes. -\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {You will usually run WinBoard by choosing an item from the Windows Start menu that runs it in the mode you -want. If you just double-click on WinBoard.exe, you get a startup dialog asking which mode you want. If you choose chess engine mode, you can then select from the installed engines; if you choose ICS client mode, you can then select from a list of known c -hess servers. More advanced users can }{\uldb customize}{\v icsNames}{ these lists or type in WinBoard }{\uldb command line options}{\v Options}{ directly. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard starts up in one of three major modes: chess ++engine mode, ICS client mode, or game viewer mode. You cannot change modes while WinBoard is running, but you can access all the game viewer features directly from the other two modes. Also, you can start WinBoard several times to get multiple chessboard ++windows running in any combination of modes. ++\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { ++You will usually run WinBoard by choosing an item from the Windows Start menu that runs it in the mode you want. If you just double-click on WinBoard.exe, you get a startup dialog asking which mode you want. If y ++ou choose chess engine mode, you can then select from the installed engines; if you choose ICS client mode, you can then select from a list of known chess servers. More advanced users can }{\uldb customize}{\v icsNames}{ these lists or type in WinBoard }{ ++\uldb command line options}{\v Options}{ directly. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 After starting WinBoard, you can make }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { -\cs58\f1\super K}{\f1 move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 move}}}{\f1 moves in several different ways. To move by dragging, press the left mouse bu -tton while the cursor is on one of your pieces, move the cursor to another square, and release the button. You can also move by clicking the left mouse button once (press and release) over one of your pieces, moving the cursor to another square, and click -i -ng again. You drop new pieces on the board (when applicable) by selecting from a context menu. Press the right mouse button over a square to bring up the menu; no menu will come up in modes where dropping a new piece is not permitted. You can also make mo -ves by typing them in standard algebraic chess notation. Either a dialog box will pop up for you to type into, or in ICS mode, your typing will be redirected into the ICS interaction window. ++\cs58\f1\super K}{\f1 move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 move}}}{\f1 ++moves in several different ways. To move by dragging, press the left mouse button while the cursor is on one of your pieces, move the cursor to another square, and release the button. You can also ++ move by clicking the left mouse button once (press and release) over one of your pieces, moving the cursor to another square, and clicking again. You drop new pieces on the board (when applicable) by selecting from a context menu. Press the right mouse b ++u ++tton over a square to bring up the menu; no menu will come up in modes where dropping a new piece is not permitted. You can also make moves by typing them in standard algebraic chess notation. Either a dialog box will pop up for you to type into, or in IC ++S mode, your typing will be redirected into the ICS interaction window. + \par When WinBoard}{\i\f1 }{\f1 is iconized, its }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icon}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icon}}}{\f1 icon is a white knight if it is White's turn to move, a black knight if it is Black's turn. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\f1 Additional Information + \par }\pard\plain \s29\fi-240\li360\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\uldb Menus}{\v\f1\uldb Menus}{\f1\uldb + \par Shortcut Buttons}{\v\f1\uldb Buttons}{\f1\uldb + \par Command Line Options}{\v\f1 Options}{\f1 + \par }{\f1\uldb Initialization Files}{\v\f1\uldb Files}{\f1\uldb + \par Installing Chess Engines}{\v\f1\uldb InstallingChessEngines}{\f1\uldb + \par Firewalls}{\v\f1 Firewalls}{\f1 + \par }{\f1\uldb Limitations}{\v\f1 Limitations}{\f1\uldb + \par Authors}{\v\f1 Authors}{\f1 + \par }{\f1\uldb Copyright}{\v\f1 Copyright}{\f1 + \par }{\f1\uldb Frequently Asked Questions}{\v\f1 !ExecFile(FAQ.html)}{\f1 + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Menus}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Menus}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 Menus}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 MENUS + \par }\pard\plain \s29\fi-240\li360\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\uldb File Menu}{\v\f1 FileMenu}{\f1 + \par }{\f1\uldb Mode Menu}{\v\f1 ModeMenu}{\f1 + \par }{\f1\uldb Action Menu}{\v\f1 ActionMenu}{\f1 + \par }{\f1\uldb Step Menu}{\v\f1 StepMenu}{\f1 + \par }{\f1\uldb Options Menu}{\v\f1 OptionsMenu}{\f1 + \par }{\f1\uldb Help Menu}{\v\f1 HelpMenu}{\f1 + \par }{\f1\uldb ICS Interaction Context Menu}{\v\f1 ICSInteractionContextMenu}{\f1 + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 File Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 FileMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 File Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs18\up6 }{\f1\fs20 File Menu + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 New Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 NewGame}}}{\f1\cf6 New Game (former }{\f1 Reset}{\f1\cf6 ) -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Resets WinBoard and the chess engine (if any) to the beginning of a new chess game. In Internet Chess Server mode, clears the current state of WinBoard, then resynchronizes with ICS by sending a }{\b\f1 refresh }{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Resets WinBoard and the chess engine (if any) to the beginning of ++ a new chess game. In Internet Chess Server mode, clears the current state of WinBoard, then resynchronizes with ICS by sending a }{\b\f1 refresh }{\f1 + command. If you want to stop playing, observing, or examining a game on ICS, use an appropriate command from the }{\f1\uldb Action}{\v\f1 ActionMenu}{\f1 menu, not }{\f1\cf6 New Game}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 New Shuffle Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 NewShuffleGame}}}{\f1\cf11 New Shuffle Game -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Brings you to a dialog box where you can enter the number of an opening setup for shuffle variants like - FRC, or ask for a random number. After pressing OK, a new game is set up, using this position. The chosen position will continue to be used on every subsequent \ldblquote New Game\rdblquote , }{\f1\cf11 -even if you are playing a variant that normally is not shuffled, until you select a new variant through the \ldblquote New Variant\'85\rdblquote menu.}{\f1\cf6 If you enter \ldblquote -1\rdblquote - for the position number, new random number is drawn before every game. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 The type of shuffling that is done in - reaction to a given position number obeys restrictions that depend on the selected variant. In variants that allow castling, Kings remain on the central files, Rooks in the corners. In games with FRC-style castlings, the King starts between the Rooks, bu -t - apart from that they could be anywhere. In games without castling, there are no restrictions on King and Rook placement. Pairs of color-bound pieces (such as Bishops) will be placed on oppositely colored squares. In ICS mode this feature has no effect, a -s the ICS determines the starting position. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 ++Brings you to a dialog box where you can enter the number of an opening setup for shuffle variants like FRC, or ask for a random number. After pressing OK, a new game is set up, using this position. The c ++hosen position will continue to be used on every subsequent \ldblquote New Game\rdblquote , }{\f1\cf11 even if you are playing a variant that normally is not shuffled, until you select a new variant through the \ldblquote New Variant\'85\rdblquote menu.} ++{\f1\cf6 If you enter \ldblquote -1\rdblquote for the position number, new random number is drawn before every game. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 ++The type of shuffling that is done in reaction to a given position number obeys restrictions that depend on the selected variant. In variants that allow castling, Kings remain on the central files, Rooks in the corners. I ++n games with FRC-style castlings, the King starts between the Rooks, but apart from that they could be anywhere. In games without castling, there are no restrictions on King and Rook placement. Pairs of color-bound pieces (such as Bishops) will be placed ++on oppositely colored squares. In ICS mode this feature has no effect, as the ICS determines the starting position. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 New Variant}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 NewVariant}}}{\f1\cf11 New Variant + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Select a new variant. There are controls to enter a board width, board height and holdings size, but normally you leave them at \lquote -1\rquote -, which means the default value for the - selected variant will be used (e.g. 8x8 for normal Chess, 9x10 for xiangqi, 10x8 for capablanca, holdings for 5 pieces in crazyhouse). You can set a deviating value for each of the three parameters (e.g. to play a crazyhouse version of xiangqi or capabla -nca you would set the holdings to 6 or 7). If the board width deviates from the default, the game will start with an empty board. ++, which means the default value for the selected variant will be used (e.g. 8x8 for normal Chess, 9x10 for xiangqi, 10x8 for capablanca, holdings for 5 pieces in crazyhouse). You can set a deviating value for each of the three parameters (e.g. to pla ++y a crazyhouse version of xiangqi or capablanca you would set the holdings to 6 or 7). If the board width deviates from the default, the game will start with an empty board. + \par The variant will remain in force until you select a new one; i.e. subsequent \ldblquote New Game\rdblquote commands will start a new game of the same variant. In ICS mode this command has no effect, as the ICS determines which variant will be played. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Load Game} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadGame}}}{\f1 Load Game -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Plays a game from a record file. A popup dialog prompts you for the filename. If the file contains more than one g -ame, a second popup dialog displays a list of games (with information drawn from their PGN tags, if any), and you can select the one you want. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Plays a game from a record file. A popup dialog prompts you for the filename. If the file co ++ntains more than one game, a second popup dialog displays a list of games (with information drawn from their PGN tags, if any), and you can select the one you want. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The game file parser will accept PGN (portable game notation), or in fact almost any file that contains moves in algebraic notation. Notation of the form }{\i\f1 P@f7}{ -\f1 is accepted for piece-drops in bughouse games; this is a nonstandard extension to PGN. If the file includes a PGN position (FEN tag), or a WinBoard position diagram bracketed by "[--" and "--]" before the first - move, the game starts from that position. Text enclosed in parentheses, square brackets, or curly braces is assumed to be commentary and is displayed in a pop-up window. Any other text in the file is ignored. PGN variations (enclosed in parentheses) are -treated as comments; WinBoard is not able to walk variation trees. The nonstandard PGN tag }{\f2 [Variant "varname"]}{\f1 functions similarly to the }{\f1\uldb variant}{\v\f1 variant }{\f1 ++\f1 is accepted for piece-drops in bughouse games; this is a nonstandard extension to PGN. If the file includes a PGN position (FEN tag), or a WinBoard position diagram bracketed by "[--" and ++"--]" before the first move, the game starts from that position. Text enclosed in parentheses, square brackets, or curly braces is assumed to be commentary and is displayed in a pop-up window. Any other text in the file is ignored. PGN variations (enclose ++d in parentheses) are treated as comments; WinBoard is not able to walk variation trees. The nonstandard PGN tag }{\f2 [Variant "varname"]}{\f1 functions similarly to the }{\f1\uldb variant}{\v\f1 variant }{\f1 + command-line option, allowing games in certain chess variants to be loaded. There is also a heuristic to recognize chess variants from the }{\f2 Event}{\f1 + tag, by looking for the strings that the Internet Chess Servers put there when saving variant ("wild") games. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Load Next Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadNextGame}}}{\f1 Load Next Game + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Loads the next game from the last game record file you loaded. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Load Previous Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadPreviousGame}}}{\f1 Load Previous Game + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Loads the previous game from the last game record file you loaded. Not available if the last game was loaded from a pipe. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Reload Same Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ReloadSameGame}}}{\f1 Reload Same Game + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Reloads the last game you loaded. Not available if the last game was loaded from a pipe. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Save Game} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SaveGame}}}{\f1 Save Game -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Appends a record of the current game to a file. A popup dialog prompts you for the filename. If the game did not begin with the sta -ndard starting position, the game file includes the starting position used. Game files are saved in the PGN (portable game notation) format, unless the }{\f1\uldb oldSaveStyle}{\v\f1 oldSaveStyle}{\f1 - option is True, in which case they are saved in an older format that is specific to WinBoard}{\i\f1 .}{\f1 Both formats are human-readable, and both can be read back by the Load Game command. Notation of the form }{\i\f1 P@f7}{\f1 - is generated for piece-drops in bughouse games; this is a nonstandard extension to PGN. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Appends a record of the current game to a file. A popup dialog prompts you for the filename. If the game did not begin with the standard starting position, the game file includes the starting position used. Game files are saved in the PGN (portable ++ game notation) format, unless the }{\f1\uldb oldSaveStyle}{\v\f1 oldSaveStyle}{\f1 option is True, in which case they are saved in an older format that is specific to WinBoard}{\i\f1 .}{\f1 ++ Both formats are human-readable, and both can be read back by the Load Game command. Notation of the form }{\i\f1 P@f7}{\f1 is generated for piece-drops in bughouse games; this is a nonstandard extension to PGN. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Copy Game To Clipboard}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 CopyGameToClipboard}}}{\f1 Copy Game To Clipboard + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Copies the record of the current game to the Windows clipboard in PGN (portable game notation) format. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Paste Game From Clipboard}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PasteGameFromClipboard}}}{\f1 Paste Game From Clipboard + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Plays a game from the Windows clipboard.}{\f1 See }{\f1\uldb Load Game}{\v\f1 LoadGame}{\f1 for a discussion of game file format and parser behavior.}{ + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Load Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadPosition}}}{\f1 Load Position + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets up a position from a position file. A popup dialog prompts you for the filename. Position files must be in FEN (Forsythe-Edwards notation), or in the format that the } + {\f1\uldb Save Position}{\f1 command writes when }{\f1\uldb oldSaveStyle}{\v\f1 oldSaveStyle}{\f1 is turned on. }{\f1\cf11 -Note that many variants require an extension of the original FEN standard. WinBoard tries to be as universal as possible in understanding F -ENs when different standards are raound, but has to make a choice when writing them. In FRC is uses Shredder-FEN (Haha castling notation) , but it understands KQkq as the outermost Rook, so it also reads X-FEN. In Crazyhouse / Bughouse it appends the hold -i -ngs immediately behind the board info between brackets [], but on input it also understands bFEN (which puts it behind a slash / as if it were an extra board rank). It uses a tilde ~ behind a piece to indicate it is really a promoted Pawn (like bFEN). In -Shogi the holdings are printed like in Crazyhouse, but promoted pieces are represented by a plus sign + before the letter of the original piece. Letters used for the pieces can be set with the /pieceToCharTable command-line option.}{\f1 ++Note that many variants require an extension of the original FEN standard. WinBoard tries to be as universal as possible in underst ++anding FENs when different standards are raound, but has to make a choice when writing them. In FRC is uses Shredder-FEN (Haha castling notation) , but it understands KQkq as the outermost Rook, so it also reads X-FEN. In Crazyhouse / Bughouse it appends ++t ++he holdings immediately behind the board info between brackets [], but on input it also understands bFEN (which puts it behind a slash / as if it were an extra board rank). It uses a tilde ~ behind a piece to indicate it is really a promoted Pawn (like bF ++EN). In Shogi the holdings are printed like in Crazyhouse, but promoted pieces are represented by a plus sign + before the letter of the original piece. Letters used for the pieces can be set with the /pieceToCharTable command-line option.}{\f1 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Load Next Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadNextPosition}}}{\f1 Load Next Position + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Loads the next position from the last position file you loaded. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Load Previous Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadPreviousPosition}}}{\f1 Load Previous Position + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Loads the previous position from the last position file you loaded. Not available if the last position was loaded from a pipe. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Reload Same Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ReloadSamePosition}}}{\f1 Reload Same Position + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Reloads the last position you loaded. Not available if the last position was loaded from a pipe. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Save Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SavePosition}}}{\f1 Save Position + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Appends a diagram of the current position to a file. A popup dialog prompts you for the filename. Positions are saved in FEN (Forsythe-Edwards notation) format, unless the + }{\f1\uldb oldSaveStyle}{\v\f1 oldSaveStyle}{\f1 option is True, in which case they are saved in an older, human-readable format that is specific to WinBoard}{\i\f1 .}{\f1 + Both formats can be read back by the Load Position command; however, currently Load Position can load only the first position in a file. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Save Diagram}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 Save Diagram}}}{\f1\cf11 Save Diagram + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Writes the current board display as a bitmap file. With this command you can use WinBoard as a diagram generator. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Copy Position Clipboard}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 CopyPositionToClipboard}}}{\f1 Copy Position To Clipboard + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Places a diagram of the current position (in Forsythe-Edwards notation) into the Windows clipboard. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Paste Position Clipboard}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PastePositionFromClipboard}}}{\f1 Paste Position From Clipboard + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets up a position from the Windows clipboard. Position must be in FEN (Forsythe-Edwards notation). Puts WinBoard into }{\f1\uldb Edit Game}{\v\f1 EditGame}{\f1 + mode if it was not there already. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Exit}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Exit}}}{\f1 Exit + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Exits from WinBoard. -\par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{ -\f1 Mode Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ModeMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { ++\par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\b\f1\super K} ++{\f1 Mode Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ModeMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 Mode Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 Mode Menu + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Machine White}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 MachineWhite}}}{\f1 Machine White + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Forces the chess engine to play white. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Machine Black}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 MachineBlack}}}{\f1 Machine Black + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Forces the chess engine to play black. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Two Machines}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 TwoMachines}}}{\f1 Two Machines + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Starts a game between two chess engines. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Machine Both}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 Machine Both}}}{\f1\cf11 Machine Both -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -A single chess engine plays itself. Mainly useful for pseudo-engines, that are in fact communication links to another machine, where you want to observe a game that is being played. (E.g. the gothic-chess.com server). This command is not implemented yet -(version 4.3.14). ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 A single chess engine plays itself. Ma ++inly useful for pseudo-engines, that are in fact communication links to another machine, where you want to observe a game that is being played. (E.g. the gothic-chess.com server). This command is not implemented yet (version 4.3.14). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Analysis Mode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AnalysisMode}}}{\f1 Analysis Mode -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -In this mode, you can make moves for both sides on the board. After each move, the chess engine will think about possible replies and display its analysis in a separate window. Crafty was th -e first engine to support this feature, but by now there are many others that support it as well. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In th ++is mode, you can make moves for both sides on the board. After each move, the chess engine will think about possible replies and display its analysis in a separate window. Crafty was the first engine to support this feature, but by now there are many othe ++rs that support it as well. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf2 From WinBoard 4.4 on this function can also be invoked in \lquote zippy mode\rquote ++, i.e. when you are logged on to an ICS with an engine loaded. In that case it is not your own moves that the engine analyzes, but the moves that are played in ++ a game on the ICS that you are observing. You must start observing before you start the analysis mode! See the file zippy.README for how to connect to an ICS and a chess engine running on your local computer at the same time. (Basically this amounts to a ++dding the /zp command-line option in addition to all options you would need for connecting to the ICS, as well as those needed for running the chess engine.) + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Analyze File}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AnalyzeFile}}}{\f1 Analyze File -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In this mode, you can load a game from a file, and the chess engine will analyze each move as in Analysis Mode. C -rafty was the first engine to support this feature, but by now there are many others that support it as well. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In this mode, you can load a game from a file, and the chess engine will analyze ea ++ch move as in Analysis Mode. Crafty was the first engine to support this feature, but by now there are many others that support it as well. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ICS Client + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ICSClient}}}{\f1 ICS Client + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This is the normal mode when WinBoard is connected to a chess server. If you have moved into Edit Game or Edit Position mode, you can select this option to get out. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 When you run WinBoard in ICS mode, it starts up a console window in which you can type comm -ands and receive text responses from the chess server. You can use the standard Windows editing keys to edit your command line before pressing Enter. The console window keeps a history of the last few commands you typed. Press the up-arrow key to go back -to a previous command; press the down-arrow key to go forward again to a later command. Press the right mouse button in the output area for a }{\f1\uldb context menu}{\v\f1 ICSInteractionContextMenu}{\f1 of editing commands and ICS command shortcuts. - ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++When you run WinBoard in ICS mode, it starts up a console window in which you can type commands and receive text responses from the chess server. You can use the standard Windows editing keys t ++o edit your command line before pressing Enter. The console window keeps a history of the last few commands you typed. Press the up-arrow key to go back to a previous command; press the down-arrow key to go forward again to a later command. Press the righ ++t mouse button in the output area for a }{\f1\uldb context menu}{\v\f1 ICSInteractionContextMenu}{\f1 of editing commands and ICS command shortcuts. + \par Some useful ICS commands include }{\b\f1 who}{\f1 to see who is logged on, }{\b\f1 games}{\f1 to see what games are being played, }{\b\f1 match}{\f1 to challenge another player to a game, }{\b\f1 observe}{\f1 to observe an ongoing game, }{\b\f1 + examine}{\f1 or }{\b\f1 smoves}{\f1 to review a recently completed game, and of course }{\b\f1 help}{\f1 . + \par Whenever you ask to observe an ongoing game, review a completed game, or resume an adjourned game, WinBoard retrieves and parses the list of past moves from the ICS, so you can review them with }{\f1\uldb Forward}{\v\f1 Forward}{\f1 and }{\f1\uldb + Backward}{\v\f1 Backward}{\f1 or save them with }{\f1\uldb Save Game}{\v\f1 SaveGame}{\f1 . + \par Some special ICS Client features are activated when you are in }{\b\f1 examine}{\f1 or }{\b\f1 bsetup }{\f1 mode on ICS. See the descriptions of the menu commands }{\f1\uldb Forward}{\v\f1 Forward}{\f1 , }{\f1\uldb Backward}{\v\f1 Backward}{\f1 , }{ -\f1\uldb Pause}{\v\f1 Pause}{\f1 , and }{\f1\uldb Stop Examining}{\v\f1 StopExamining}{\f1 below. You can also issue the I -CS position-editing commands with the mouse. Move pieces by dragging with the left mouse button, or by left-clicking once on the starting square and once on the ending square. Press the right mouse button over a square for a context menu that lets you dro -p - a new piece, empty the square, or clear the board. Click on the White or Black clock to set the side to play. You cannot set the side to play or drag pieces to arbitrary squares while examining on ICC, but you can do so in bsetup mode on FICS. You can al -so make moves by typing them into the ICS window; you may have to do this occasionally if you are playing a chess variant whose rules WinBoard does not understand, such as Fischer Random. -\par If you are playing a bughouse game on the ICS, a list of the offboard - pieces that each player holds is shown in the window title bar. To drop an offboard piece, press the right mouse button over an empty square to bring up a context menu. To observe your partner's games, start a second copy of WinBoard, log in as a guest, -and use the ICS }{\b\f1 follow}{\f1 or }{\b\f1 pfollow}{\f1 command in the new window. ++\f1\uldb Pause}{\v\f1 Pause}{\f1 , and }{\f1\uldb Stop Examining}{\v\f1 StopExamining}{\f1 below. You can also issue the ICS position-editing commands with the mouse. Move pieces by dragging with the left mouse button, or by left-clicking once on th ++e starting square and once on the ending square. Press the right mouse button over a square for a context menu that lets you drop a new piece, empty the square, or clear the board. Click on the White or Black clock to set the side to play. You cannot set ++t ++he side to play or drag pieces to arbitrary squares while examining on ICC, but you can do so in bsetup mode on FICS. You can also make moves by typing them into the ICS window; you may have to do this occasionally if you are playing a chess variant whose ++ rules WinBoard does not understand, such as Fischer Random. ++\par If you are playing a bughouse game on the ICS, a list of the offboard pieces that each player holds is shown in the window title bar. To drop an offboard piece, press the right mouse button over a ++n empty square to bring up a context menu. To observe your partner's games, start a second copy of WinBoard, log in as a guest, and use the ICS }{\b\f1 follow}{\f1 or }{\b\f1 pfollow}{\f1 command in the new window. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Edit Game} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 EditGame}}}{\f1 Edit Game + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Allows you to make moves for both Black and White, and to change moves after backing up with the }{\f1\uldb Backward}{\v\f1 Backward}{\f1 + command. The clocks do not run, but you can adjust their reading by clicking on them. A left-click subtracts one minute, a right-click adds one minute. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In chess engine mode, the chess engine continues to check moves for legality but does not participate in the game. You can bring the chess engine back - into the game by selecting }{\f1\uldb Machine White}{\v\f1 MachineWhite}{\f1 , }{\f1\uldb Machine Black}{\v\f1 MachineBlack}{\f1 , or }{\f1\uldb Two Machines}{\v\f1 TwoMachines}{\f1 . ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In chess engine mode, the chess engine conti ++nues to check moves for legality but does not participate in the game. You can bring the chess engine back into the game by selecting }{\f1\uldb Machine White}{\v\f1 MachineWhite}{\f1 , }{\f1\uldb Machine Black}{\v\f1 MachineBlack}{\f1 , or }{\f1\uldb ++Two Machines}{\v\f1 TwoMachines}{\f1 . + \par In ICS mode, the moves are not sent to the ICS: Edit Game takes WinBoard out of ICS Client mode and lets you edit games locally. If you want to edit a game on ICS in a way that other ICS users can see, use the ICS }{\b\f1 examine}{\f1 + command or start an ICS match against yourself. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Edit Position}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 EditPosition}}}{\f1 Edit Position -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you set up an arbitrary board position. Use the left mouse button to drag piece -s to new squares, or to delete a piece by dragging it off the board or dragging an empty square on top of it. To drop a new piece on a square, press the right mouse button over the square. This brings up a menu of pieces. Additional menu choices let you e -mpty the square or clear the board. You can set the side to play next by clicking on the White or Black indicator at the top of the screen. }{\f1\cf11 The pop-up menu also contains options to \lquote promote\rquote or \lquote demote\rquote - the piece currently in the square. (In variants like C -razyhouse a piece has a different representation when it is a promoted Pawn rater than an original piece.) This allows you to create some of the not-so-common pieces (e.g. a Unicorn is a promoted King, a Commoner is a demoted King).}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you ++set up an arbitrary board position. Use the left mouse button to drag pieces to new squares, or to delete a piece by dragging it off the board or dragging an empty square on top of it. To drop a new piece on a square, press the right mouse button over the ++ square. This brings up a menu of pieces. Additional menu choices let you empty the square or clear the board. You can set the side to play next by clicking on the White or Black indicator at the top of the screen. }{\f1\cf11 ++The pop-up menu also contains options to \lquote promote\rquote or \lquote demote\rquote ++ the piece currently in the square. (In variants like Crazyhouse a piece has a different representation when it is a promoted Pawn rater than an original piece.) This allows you to create some of the not-so-common pieces (e.g. a Unicorn ++ is a promoted King, a Commoner is a demoted King).}{\f1 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Selecting Edit Position causes WinBoard}{\i\f1 }{\f1 to discard all remembered moves in the current game. -\par In ICS mode, change made to the position by Edit Position are not sent to the ICS: Edit Position takes WinBoard out of ICS Client mode and lets you edit positions locally. If you want to - edit positions on ICS in a way that other ICS users can see, use the ICS }{\b\f1 examine}{\f1 command, or start an ICS match against yourself. (See also }{\f1\uldb ICS Client}{\v\f1 ICSClient}{\f1 above.) ++\par In ICS mode, change made to the position by Edit Position are not sent to the ICS: Edit Position takes WinBoard ++ out of ICS Client mode and lets you edit positions locally. If you want to edit positions on ICS in a way that other ICS users can see, use the ICS }{\b\f1 examine}{\f1 command, or start an ICS match against yourself. (See also }{\f1\uldb ICS Client}{ ++\v\f1 ICSClient}{\f1 above.) + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Show Engine Output}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Show Engine Output}}}{\f1\cf6 Show Engine Output + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 Open a new window dedicated to showing the thinking output of the engine(s), as controlled by \ldblquote Show Thinking\rdblquote . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Show Evaluation Graph}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Show Evaluation Graph}}}{\f1\cf6 Show Evaluation Graph + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 Open a new window dedicated to displaying a graph, representing the development of the engine score(s) from the current game over time. (Needs \ldblquote show Thinking + \rdblquote to be enabled in order to work. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Show Game List}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ShowGameList}}}{\f1 Show Game List + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Shows or hides the list of games generated by the last }{\f1\uldb Load Game}{\v\f1 LoadGame}{\f1 command. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Show Move History}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Show Move History}}}{\f1\cf6 Show Move History + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 Open a new window dedicated to showing the game currently in progress. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Training}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Training}}}{\f1 Training -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Training mode lets you interactively guess the moves of a game for one of the players. While -in Training mode, the navigation buttons are disabled. You guess the next move of the game by playing the move on the board (or using the }{\uldb Type In Move}{\v\uldb TypeInMove}{ - command). If the move played matches the next move of the game, the move is accepted and the opponent\rquote s response is autoplayed. If the move played is incorrect, an error message is displayed. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { ++Training mode lets you interactively guess the moves of a game for one of the players. While in Training mode, the navigation buttons are disabled. You guess the next move of the game by playing the move on the board (or using the }{\uldb Type In Move}{ ++\v\uldb TypeInMove}{ command). If the move played matches the next move of the game, the move is accepted and the opponent\rquote s response is autoplayed. If the move played is incorrect, an error message is displayed. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Edit Tags} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 EditTags}}}{\f1 Edit Tags + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you edit the PGN (portable game notation) tags for the current game. After editing, the tags must still conform to the PGN tag syntax: + \par }\pard\plain \s43\li520\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs20\cgrid {\f2 \line ::= \line \line ::= [ ]\line + ::= \line ::= + \par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 See the PGN Standard for full details. Here is an example: + \par }\pard\plain \s43\li520\sa60\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs20\cgrid {\f2 \line [Event "Portoroz Interzonal"]\line [Site "Portoroz, Yugoslavia"]\line [Date "1958.08.16"]\line [Round "8"]\line + [White "Robert J. Fischer"]\line [Black "Bent Larsen"]\line [Result "1-0"] -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Any characters that do not match this syntax are silently ignored. Note that the PGN standard requires -all games to have at least the seven tags shown above. Any that you omit will be filled in by WinBoard with }{\f2 "?"}{\f1 (unknown value) or }{\f2 "-"}{\f1 (inapplicable value). ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Any ++characters that do not match this syntax are silently ignored. Note that the PGN standard requires all games to have at least the seven tags shown above. Any that you omit will be filled in by WinBoard with }{\f2 "?"}{\f1 (unknown value) or }{\f2 "-"}{ ++\f1 (inapplicable value). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Edit Comment}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 EditComment}}}{\f1 Edit Comment + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Adds or modifies a comment on the current position. Comments are saved by }{\f1\uldb Save Game}{\v\f1 SaveGame}{\f1 and are displayed by }{\f1\uldb Load Game}{\v\f1 + LoadGame}{\f1 , }{\f1\uldb Forward}{\v\f1 Forward}{\f1 , and }{\f1\uldb Backward}{\v\f1 Backward}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Enter Username}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 EnterUsername}}}{\f1\cf11 Enter Username + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 Allows you to type the name of the human player, which will appear in the PGN header and in the window title. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Pause}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Pause}}}{\f1 Pause -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Pauses updates to the board, and if you are playing against a local chess engine, also pauses your clock. To cont -inue, select Pause again, and the display will automatically update to the latest position. The }{\b\f1 P}{\f1 (or }{\b\f1 C}{\f1 ) button is equivalent to selecting Pause. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you select Pause when you are playing{\*\bkmkstart WHATSelSavT}{\*\bkmkend WHATSelSavT} {\*\bkmkstart fWHATtopic}against{\*\bkmkend fWHATtopic} a chess engine and -it is not your move, the chess engine\rquote -s clock will continue to run and it will eventually make a move, at which point both clocks will stop. Since board updates are paused, however, you will not see the move until you exit from Pause mode (or select }{\f1\uldb Forward}{\v\f1 Forward}{\f1 -). This behavior is meant to simulate adjournment with a sealed move. -\par If you select Pause while you are in }{\b\f1 examine}{\f1 mode on ICS, you can step backward and forward in the current history of the examined game without affecting the other examiners or o -bservers. Select Pause again to reconnect yourself to the current state of the game on ICS. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Pauses updates to the board, and if you are playing against a local chess engine, also pauses your clock. To continue, select Pause again, and the display will automatically update to the latest position. The }{\b\f1 P}{\f1 (or }{\b\f1 C}{\f1 ++) button is equivalent to selecting Pause. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you select Pause when you are playing{\*\bkmkstart WHATSelSavT}{\*\bkmkend WHATSelSavT} {\*\bkmkstart fWHATtopic}against{\*\bkmkend fWHATtopic} ++ a chess engine and it is not your move, the chess engine\rquote s clock will continue to run and it will eventually make a move, at which point ++both clocks will stop. Since board updates are paused, however, you will not see the move until you exit from Pause mode (or select }{\f1\uldb Forward}{\v\f1 Forward}{\f1 ). This behavior is meant to simulate adjournment with a sealed move. ++\par If you select Pause while you are in }{\b\f1 examine}{\f1 ++ mode on ICS, you can step backward and forward in the current history of the examined game without affecting the other examiners or observers. Select Pause again to reconnect yourself to the current state of the game on ICS. + \par If you select Pause while you are loading a game, the game stops loading. You can load more moves one at a time by selecting }{\f1\uldb Forward}{\v\f1 Forward}{\f1 , or resume automatic loading by selecting Pause again. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Action Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ActionMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Action Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 Action Menu + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Most of these commands are available in chess server mode only. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Accept}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Accept}}}{\f1 Accept + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Accepts a pending match offer. If there is more than one offer pending, you will have to type in a more specific command instead of using this menu choice. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Decline}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Decline}}}{\f1 Decline + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Declines a pending offer (match, draw, etc.). If there is more than one offer pending, you will have to type in a more specific command instead of using this menu choice. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Rematch}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Rematch}}}{\f1 Rematch + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Issues the ICS }{\b\f1 rematch}{\f1 command, which asks for another game against your last opponent with the same time control and rule set. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Call Flag} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 CallFlag}}}{\f1 Call Flag + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Calls your opponent's flag, claiming a win on time, or claiming a draw if you are both out of time. You can also call your opponent's flag by clicking on his clock. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Draw}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Draw}}}{\f1 Draw + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Offers a draw to your opponent, accepts a pending draw offer from your opponent, or claims a draw by repetition or the 50-move rule, as appropriate. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Adjourn}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Adjourn}}}{\f1 Adjourn -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Asks your opponent to agree to adjourning the current game, or agrees to a pending adjournment offer from your opponent. You continue an adjourne -d ICS game by challenging the same player again with the ICS }{\b\f1 match}{\f1 command. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Asks your opponent to agree to adjourning the current game, or agrees to a pending adjournment offer from your opponent. You continue an adjourned ICS game by challenging the same player again with the ICS }{\b\f1 match}{\f1 command. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Abort}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Abort}}}{\f1 Abort -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Asks your opponent to agree to abort the current game, or agrees to a pending abort offer from your opponent. An aborted ICS game ends immediately without -affecting either player's rating. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Asks your opponent to agree to abort the current game, or agrees to a pending abort offer from your opponent. An aborted ICS game ends immediately without affecting either player's rating. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Resign}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Resign}}}{\f1 Resign + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Resigns the game to your opponent. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Stop Observing}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 StopObserving}}}{\f1 Stop Observing + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Ends your participation in observing a game, by issuing the ICS }{\b\f1 unobserve}{\f1 command. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Stop Examining}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 StopExamining}}}{\f1 Stop Examining + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Ends your participation in observing a game, by issuing the ICS }{\b\f1 unobserve}{\f1 command. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Adjudicate To White}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicateToWhite}}}{\f1\cf6 Adjudicate To White + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 End the current game and stop participating engine. The result will appear in the PGN as a win for white. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Adjudicate To Black}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicateToBlack}}}{\f1\cf6 Adjudicate To Black + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Same as above, but game will appear as a win for black. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Adjudicate Draw}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicateDraw}}}{\f1\cf6 Adjudicate Draw + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Same as above, but game will appear as a draw. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20\cf6 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super K}{\f1 Step Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 StepMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Step Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 Step Menu + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Type In Move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 TypeInMove}}}{\f1 Type In Move -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Pops up a dialog box, into which you can type moves in standard algebraic chess notation. (You can also get this dialog box by simply starting to type over t -he chessboard, except in ICS mode, where such typing is redirected into the ICS interaction window.) ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Pops up a dialog box, into which you can type moves in standard algebraic chess notation. (You can also get this dialog box by simply starting to type over the chessboard, except in ICS mode, where such typing is redirected into the ICS interaction ++ window.) + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Backward}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Backward}}}{\f1 Backward -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Steps backward through a series of remembered moves. The }{\b\f1 <}{\f1 button is equivalent to selecting Backward.In most modes, Back -ward only lets you look back at old positions; it does not retract moves. This is the case if you are playing against a chess engine, playing or observing a game on the ICS, or loading a game. If you select Backward in any of these situations, you will no -t be allowed to make a different move. Use }{\f1\uldb Retract Move}{\v\f1 RetractMove}{\f1 or }{\f1\uldb Edit Game}{\v\f1 EditGame}{\f1 if you want to change past moves. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Steps backward through a series of remembered moves. The }{\b\f1 <}{\f1 ++ button is equivalent to selecting Backward.In most modes, Backward only lets you look back at old positions; it does not retract moves. This is the case if you are playing aga ++inst a chess engine, playing or observing a game on the ICS, or loading a game. If you select Backward in any of these situations, you will not be allowed to make a different move. Use }{\f1\uldb Retract Move}{\v\f1 RetractMove}{\f1 or }{\f1\uldb ++Edit Game}{\v\f1 EditGame}{\f1 if you want to change past moves. + \par If you are examining a game on the ICS, the behavior of Backward depends on whether WinBoard}{\i\f1 }{\f1 is in }{\f1\uldb Pause}{\v\f1 Pause}{\f1 mode. If Pause mode is off, Backward issues the ICS command}{\b\f1 backward}{\f1 + , which backs up everyone's view of the game and allows you to make a different move. If Pause mode is on, Backward only backs up your local view. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Forward}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Forward}}}{\f1 Forward + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Steps forward through a series of remembered moves (undoing the effect of }{\f1\uldb Backward}{\v\f1\uldb Backward}{\f1 ) or through a game file. The }{\b\f1 >}{\f1 + button is equivalent. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are examining a game on the ICS, the behavior of Forward depends on whether WinBoard}{\i\f1 }{\f1 is in }{\f1\uldb Pause}{\v\f1 Pause}{\f1 - mode. If Pause mode is off, Forward issues the ICS command}{\b\f1 forward}{\f1 -, which moves everyone's view of the game forward along the current line. If Pause mode is on, Forward only moves your local view forward, and it will not go past the position the game was in when you paused. ++ mode. If Pause mode is off, Forward issues the ICS command}{\b\f1 forward}{\f1 , which moves everyone's view of the game forward along the current line. If Pause mode is on, Forward on ++ly moves your local view forward, and it will not go past the position the game was in when you paused. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Back to Start}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 BacktoStart}}}{\f1 Back to Start + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Jumps backward to the first remembered position in the game. The }{\b\f1 << }{\f1 button is equivalent. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In most mod -es, Back to Start only lets you look back at old positions; it does not retract moves. This is the case if you are playing against a chess engine, playing or observing a game on the ICS, or loading a game. If you select Back to Start in any of these situa -tions, you will not be allowed to make a different move. Use }{\f1\uldb Retract Move}{\v\f1 RetractMove}{\f1 or }{\f1\uldb Edit Game}{\v\f1 EditGame}{\f1 if you want to change past moves; or use }{\f1\uldb New Game}{\v\f1 NewGame}{\f1 - to start a new game. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In most modes, Back to Start only lets you lo ++ok back at old positions; it does not retract moves. This is the case if you are playing against a chess engine, playing or observing a game on the ICS, or loading a game. If you select Back to Start in any of these situations, you will not be allowed to ++make a different move. Use }{\f1\uldb Retract Move}{\v\f1 RetractMove}{\f1 or }{\f1\uldb Edit Game}{\v\f1 EditGame}{\f1 if you want to change past moves; or use }{\f1\uldb New Game}{\v\f1 NewGame}{\f1 to start a new game. + \par If you are examining a game on the ICS, the behavior of Back to Start depends on whether WinBoard}{\i\f1 }{\f1 is in }{\f1\uldb Pause}{\v\f1 Pause}{\f1 mode. If Pause mode is off, Backward issues the ICS command }{\b\f1 backward 999999}{\f1 + , which backs up everyone's view of the game to the start and allows you to make different moves. If Pause mode is on, Back to Start only backs up your local view. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Forward to End}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ForwardtoEnd}}}{\f1 Forward to End + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Jumps forward to the last position in the game. The }{\b\f1 >>}{\f1 button is equivalent. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are examining a game on the ICS, the behavior of Forward to End depends on whether WinBoard}{\i\f1 }{\f1 is in }{\f1\uldb Pause}{\v\f1 Pause}{\f1 + mode. If Pause mode is off, Forward to End issues the ICS command }{\b\f1 forward 999999}{\f1 + , which moves everyone's view of the game forward to the end of the current line. If Pause mode is on, Forward to End only moves your local view forward, and it will not go past the position the game was in when you paused. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Revert}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Revert}}}{\f1 Revert + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are examining a game on the ICS, issues the ICS command }{\b\f1 revert}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Truncate Game}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 TruncateGame}}}{\f1 Truncate Game + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Discards all remembered moves of the game beyond the current position. Puts WinBoard into }{\f1\uldb Edit Game}{\v\f1 EditGame}{\f1 mode if it was not there already. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Move Now}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 MoveNow}}}{\f1 Move Now + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Forces the chess engine to move immediately. May not work with all chess engines. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Retract Move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 RetractMove}}}{\f1 Retract Move + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Retracts your last move. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In chess engine mode, you can do this only after the chess engine has replied to your move. If the chess engine is still thinking, use }{\f1\uldb Move Now}{\v\f1 MoveNow}{ + \f1 first. + \par In ICS mode, Retract Move issues the command }{\b\f1 takeback 1 }{\f1 or }{\b\f1 takeback 2}{\f1 , depending on whether it is your opponent's move or yours. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Options Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 OptionsMenu}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Options Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 Options Menu + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Flip View} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 FlipView}}}{\f1 }{\f1\ul Flip View}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Inverts your view of the chessboard. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are pla -ying a game on the ICS, the board is always oriented at the start of the game so that your pawns move from the bottom of the window towards the top. Otherwise, the starting position is determined by the }{\f1\uldb flipView}{\v\f1 flipViewOption}{\f1 - command line option. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are playing a game on the ICS, the b ++oard is always oriented at the start of the game so that your pawns move from the bottom of the window towards the top. Otherwise, the starting position is determined by the }{\f1\uldb flipView}{\v\f1 flipViewOption}{\f1 command line option. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\ul\cf11 Swap Clocks}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\ul\cf11 Swap Clocks}}}{\f1\cf11 }{\f1\ul\cf11 Swap Clocks}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -Interchanges the position of the white and black clocks on the screen. Intended for manually-operated computer-computer games, where the monitor is standing to the side of the playing board, to make sure that the operator -sees the time of his own machine on his side of the table. Note that it is possible to adjust the clocks in steps of one minute, by left- (decrement) or right-clicking (increment) it with the mouse in \ldblquote Edit Game\rdblquote ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Interchanges the positi ++on of the white and black clocks on the screen. Intended for manually-operated computer-computer games, where the monitor is standing to the side of the playing board, to make sure that the operator sees the time of his own machine on his side of the tabl ++e. Note that it is possible to adjust the clocks in steps of one minute, by left- (decrement) or right-clicking (increment) it with the mouse in \ldblquote Edit Game\rdblquote + mode. (Clicking the clocks in other modes is interpreted as claiming the flag.) + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\ul\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ + General Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ GeneralOptions}}}{\f1\ul General}{\f1 + \par }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Always On Top}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AlwaysOnTop}}}{\f1 Always On Top + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is on, WinBoard sets its chessboard to be a }{\i\f1 topmost}{\f1 window, meaning that it always appears on top of all ordinary windows on the screen. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Always Queen}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AlwaysQueen}}}{\f1 Always Queen -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -If Always Queen is off, WinBoard brings up a dialog box whenever you move a pawn to the last rank, asking what piece you want to promote it to. If the option is on, your pawns are always promoted to queens. Your opponent can still underpromote, however. - ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Always Queen is off, WinBoard brings up a dialog box whenever you move a pawn ++to the last rank, asking what piece you want to promote it to. If the option is on, your pawns are always promoted to queens. Your opponent can still underpromote, however. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Animate Dragging}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AnimateDragging}}}{\f1 Animate Dragging -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Animate Dragging is on while yo -u are dragging a piece with the mouse, an image of the piece follows the mouse cursor. If Animate Dragging is off, there is no visual feedback while you are ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Animate Dragging is on while you are dragging a piece with t ++he mouse, an image of the piece follows the mouse cursor. If Animate Dragging is off, there is no visual feedback while you are + \par dragging a piece, but if Animate Moving is on, the move will be animated when it is complete. -\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 An -imate Moving}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AnimateMoving}}}{\f1 Animate Moving -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -If Animate Moving is on, all piece moves are animated. An image of the piece is shown moving from the old square to the new square when the move is completed (unless the move was already animated by Animate Dr -agging). If Animate Moving is off, a moved piece instantly disappears from its old square and reappears on its new square when the move is complete. ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ++ Animate Moving}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AnimateMoving}}}{\f1 Animate Moving ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Animate Movin ++g is on, all piece moves are animated. An image of the piece is shown moving from the old square to the new square when the move is completed (unless the move was already animated by Animate Dragging). If Animate Moving is off, a moved piece instantly di ++sappears from its old square and reappears on its new square when the move is complete. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Auto Flag} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AutoflagCmd}}}{\f1 Auto Flag -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is on and one player runs out of time before the othe -r, WinBoard will automatically call his flag, claiming a win on time. In ICS mode, Auto Flag will only call your opponent's flag, not yours, and the ICS may award you a draw instead of a win if you have insufficient mating material. On most chess servers, - you can now do}{\b\f1 set autoflag 1 }{\f1 instead and have the server call the flag. In local chess engine mode, WinBoard may call either player's flag and will not take material into account. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is on and one player runs out of time before the other, WinBoard will automatically call his flag, claiming a win on time. In ICS mode, Auto ++Flag will only call your opponent's flag, not yours, and the ICS may award you a draw instead of a win if you have insufficient mating material. On most chess servers, you can now do}{\b\f1 set autoflag 1 }{\f1 ++instead and have the server call the flag. In local chess engine mode, WinBoard may call either player's flag and will not take material into account. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ Auto Flip View}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ AutoFlipView}}}{\b Auto Flip View + \par }{If this option is on when you}{\f1 start a game, the board will be automatically oriented so that your pawns move from the bottom of the window towards the top.}{ + \par }{\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ Auto Raise Board}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\super #}{ AutoRaiseBoard}}}{\b Auto Raise Board + \par }{If this}{\v autoFlipViewOption}{ option is on, whenever a new game begins, the chessboard window will be deiconized (if necessary) and raised to the top of the stack of windows on your screen. + \par }\pard\plain \s2\li120\sb80\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ Blindfold}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ BlindfoldCmd}}}{Blindfold -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {If Blindfold is on, WinBoard displays a blank board. Moves can still be entered with the mouse, eith -er by dragging the (invisible) piece or clicking the starting and ending square. You can also enter your move by typing it on the keyboard}{\f1 .}{ -\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 - Highlight Dragging}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HighlightDragging}}}{\f1 Highlight Dragging -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Highlight Dragging is on while you are dragging a -piece with the mouse, the starting square and the square that the mouse cursor is over are highlighted. This option works even if Animate Dragging is off. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {If Blindfold is on, WinBoar ++d displays a blank board. Moves can still be entered with the mouse, either by dragging the (invisible) piece or clicking the starting and ending square. You can also enter your move by typing it on the keyboard}{\f1 .}{ ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Highli ++ght Dragging}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HighlightDragging}}}{\f1 Highlight Dragging ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Highlight Dragging ++ is on while you are dragging a piece with the mouse, the starting square and the square that the mouse cursor is over are highlighted. This option works even if Animate Dragging is off. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Extended PGN Info}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 ExtendedPGNInfo}}}{\f1\cf6 Extended PGN Info -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 The PGN will contai -n the engine search depth, score and time for each move where the depth is non-zero, as a comment behind the move if this option is on. Works only when \ldblquote Show Thinking\rdblquote is enabled. The recorded time is the time reported by the engine. - ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 The PGN will contain the engine search depth, sc ++ore and time for each move where the depth is non-zero, as a comment behind the move if this option is on. Works only when \ldblquote Show Thinking\rdblquote is enabled. The recorded time is the time reported by the engine. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Extra Info In Move History}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 ExtraInfoInMoveHistory}}}{\f1\cf6 Extra Info In Move History + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Same as above, but in move-history window. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Highlight Last Move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HighlightLastMove}}}{\f1 Highlight Last Move + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Highlight Last Move is on, after a move is made, the starting and ending squares remain highlighted. In addition, after you use }{\f1\uldb Backward}{\v\f1 Backward}{\f1 + or }{\f1\uldb Back to Start}{\v\f1 BackToStart}{\f1 , the starting and ending squares of the last move to be }{\i\f1 unmade}{\f1 are highlighted. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Periodic Updates}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PeriodicUpdatesCmd}}}{\f1 Periodic Updates + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + If Periodic Updates is on, the Analysis window is updated every two seconds. If not, it is updated only when the best move found changes. The Analysis window currently works only with Crafty, and Periodic Updates may not work with all versions of Crafty. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Ponder Next Move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 PonderNextMoveCmd}}}{\f1 Ponder Next Move + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is off, the chess engine will think only when it is on move. If the option is on, the engine will also think while waiting for you to make your move. -\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 - Popup Exit Message}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PopupExitMessageCmd}}}{\f1 Popup Exit Message ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Popup Ex ++it Message}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PopupExitMessageCmd}}}{\f1 Popup Exit Message + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + If this option is on, when WinBoard wants to display a message just before exiting, it brings up a modal dialog box and waits for you to click OK before exiting. If the option is off, WinBoard prints exits immediately without showing the message. If }{ + \f1\uldb debugMode}{\v\f1 debugMode}{\f1 is on, however, the message will appear in the debug log. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Popup Move Errors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PopupMoveErrorsCmd}}}{\f1 Popup Move Errors -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is off, when you make an error in moving (such as attempting an illegal move - or moving the wrong color piece), the error message is displayed in the message area. If the option is on, move errors are displayed in small popup windows like other errors. You can dismiss an error popup either by clicking its OK button or by clicking -anywhere on the board, including downclicking to start a move. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is off, when you make an error in moving (such as attempting an illegal move or moving the wrong color piece), the error message is d ++isplayed in the message area. If the option is on, move errors are displayed in small popup windows like other errors. You can dismiss an error popup either by clicking its OK button or by clicking anywhere on the board, including downclicking to start a ++move. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Show Button Bar}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ShowButtonBarCmd}}}{\f1 Show Button Bar + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Show Button Bar is on, WinBoard displays on-screen }{\f1\uldb buttons}{\v\f1 BUTTONS}{\f1 + to step forward, backward, or pause the game. If it is off, the buttons are hidden, making the message line wider. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Show Coords}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ShowCoordsCmd}}}{\f1 Show Coords + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Show Coords is on, WinBoard displays algebraic coordinates along the board's left and bottom edges. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Show Thinking}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ShowThinkingCmd}}}{\f1 Show Thinking + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set, WinBoard displays the chess engine\rquote -s current search depth and its notion of the score and best line of play from the current position as it is thinking. The score indicates -how many pawns ahead (or if negative, behind) the engine thinks it is. In matches between two machines, the score is prefixed by W or B to indicate whether it is showing White's thinking or Black's. ++s current search depth and its notion of the score and best line of play from the current position as it is th ++inking. The score indicates how many pawns ahead (or if negative, behind) the engine thinks it is. In matches between two machines, the score is prefixed by W or B to indicate whether it is showing White's thinking or Black's. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Test Legality}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 TestLegalityCmd}}}{\f1 Test Legality -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Tes -t Legality is on, WinBoard tests whether the moves you enter with the mouse or read from game files are legal, and displays an error if they are not. Turn this option off if you are playing a chess variant that WinBoard does not understand. (Bughouse, sui -cide, and wild variants where the king may castle after starting on the }{\b\f1 d}{\f1 file are generally supported with Test Legality on. }{\f1\cf11 -The same holds for variants with non-FIDE pieces, like shatranj, xangqi, shogi, gothic, capablanca, courier, knightmate: WinBoard k -nows how all pieces occurring in those variants move. Falcon, cylinder and berolina are only partly supported, though, and the latter two should definitely be played with legality testing off, and falcon uses a wildcard piece for the Falcons, so it consid -ers any move of them legal, but might miss checkmates that involve a Falcon. So you should not play it with claim verification switched on.}{\f1 ) ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Test Lega ++lity is on, WinBoard tests whether the moves you enter with the mouse or read from game files are legal, and displays an error if they are not. Turn this option off if you are playing a chess variant that WinBoard does not understand. (Bughouse, suicide, ++and wild variants where the king may castle after starting on the }{\b\f1 d}{\f1 file are generally supported with Test Legality on. }{\f1\cf11 ++The same holds for variants with non-FIDE pieces, like shatranj, xangqi, shogi, gothic, capablanca, courier, knightmate: WinBoard knows h ++ow all pieces occurring in those variants move. Falcon, cylinder and berolina are only partly supported, though, and the latter two should definitely be played with legality testing off, and falcon uses a wildcard piece for the Falcons, so it considers an ++y move of them legal, but might miss checkmates that involve a Falcon. So you should not play it with claim verification switched on.}{\f1 ) + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Hide Thinking From Human}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 HideThinkingFromHuman}}}{\f1\cf6 Hide Thinking From Human + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 An alternative to suppressing the Thinking Output in the display above the board by switching \ldblquote Show Thinking\rdblquote + off, but doing it in a way that still allows the extended PGN info to be recorded. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Highlight Move With Arrow}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 HighlightMoveWithArrow}}}{\f1\cf6 Highlight Move With Arrow + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 A big, fat arrow is drawn between the start and target field of the last move, so you cannot possibly miss it. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\ul\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ Board Options} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ BoardOptions}}}{\f1\ul Board + \par }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Board Size}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid + {\cs58\f1\super #}{\f1 BoardSizeCmd}}}{\f1 Board Size -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Determines how large the board will be and w -hat fonts and piece bitmaps will be used. On a Titanic board the piece bitmaps are 129x129 pixels, on Colossal 116x116, Giant 108x108, Huge 95x95, Big 87x87, Large 80x80, Bulky 72x72, Medium 64x64, Moderate 58x58, Average 54x54, Middling 49x49, Mediocre 4 -5x45, Small 40x40, Slim 37x37, Petite 33x33, Dinky 29x29, Teeny 25x25, and Tiny 21x21. The smaller boards have no system menu, but you can minimize or close them from the File menu. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Determines how large the board will be and what fonts and piece bitmaps will be used. On a Titanic board the piece bitmaps are 129x129 pixels, on Colossal 116x116, Giant 108x108, Huge 95x95, Big 87x87, Large 80x80, Bulky 72x72, Medium 64x64, Moderate ++ 58x58, Average 54x54, Middling 49x49, Mediocre 45x45, Small 40x40, Slim 37x37, Petite 33x33, Dinky 29x29, Teeny 25x25, and Tiny 21x21. The smaller boards have no system menu, but you can minimize or close them from the File menu. + \par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 You can also change the board size by dragging the window edges or corners with the mouse. The board will snap to the largest size that fits into the area you outline. + -\par }{\cf11 Note that only sizes Bulky, Middling and to a lesser extent Petite have built-in bitmaps - for the non-FIDE- pieces. Archbishop, Chancellor and the wildcard Lance exist in all sizes from Petite to Bulky, though. In size Moderate, variant shogi uses the traditional Japanese piece representation.}{\f1\cf11 ++\par }{\cf11 Note that only sizes Bulky, Middling and to a lesser extent Petite have built-in bitmaps for the non-FIDE- pieces ++. Archbishop, Chancellor and the wildcard Lance exist in all sizes from Petite to Bulky, though. In size Moderate, variant shogi uses the traditional Japanese piece representation.}{\f1\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Board Colors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 BoardColors}}}{\f1 Board Colors + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the colors WinBoard is using to draw the board and pieces. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 All White}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 AllWhite}}}{\f1\cf11 All White -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Uses the representation of the white pieces (a filled-in black outline) also for the black pieces (where you can fill them with another color to disti -nguish them). If you do not choose a very dark color for the black pieces, they look very ugly without outline, and using this option can fix that. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 ++Uses the representation of the white pieces (a filled-in black outline) also for the black pieces (where you can fill them with another color to distinguish them). If you do not choose a very dark color for the black pieces, th ++ey look very ugly without outline, and using this option can fix that. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Flip Black}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 FlipBlack}}}{\f1\cf11 Flip Black + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Displays the black pieces upside down (or the white pieces in \ldblquote Flip View\rdblquote + ). This is useful in Shogi, when you want to use the traditional Japanese representation of the pieces. + \par }\pard\plain \s5\li115\sb80\sl-240\slmult0\nowidctlpar\outlinelevel4\adjustright \f5\fs20\ul\cgrid {\b + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\ul\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{ + \f1\ul\cf6 Engine}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\ul\cf6 Engine}}}{\f1\ul\cf6 Engine + \par }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 Ponder Next Move}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 PonderNextMove}}}{\f1\cf6 Ponder Next Move,}{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super K}{\f1 }{\f1\cf6 Show Thinking}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 ShowThinking}}}{\f1\cf6 Show Thinking, }{\cs58\f1\cf6\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 Hide Thinking From Human}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 HideThinkingFromHuman}}}{\f1\cf6 Hide Thinking from Human and }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{ + \f1 }{\f1\cf6 Periodic Updates}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 PeriodicUpdates}}}{\f1\cf6 Periodic Updates + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Duplicates of the controls in the \ldblquote General\rdblquote option menu. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Adjudicate Draw Moves}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicateDrawMoves}}}{\f1\cf6 Adjudicate Draw Moves -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -Adjudicate a draw after the given number of moves, to prevent games from dragging on forever if two engines in a dead-drawn position, conspire to avoid 50-move draws. This and the folowing options are only active in \ldblquote Two Machines\rdblquote mo -de. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Adjudicate a draw after the given number of moves, to prevent games ++ from dragging on forever if two engines in a dead-drawn position, conspire to avoid 50-move draws. This and the folowing options are only active in \ldblquote Two Machines\rdblquote mode. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Adjudicate Loss Threshold}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicateLossThreshold}}}{\f1\cf6 Adjudicate Loss Threshold + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Adjudicate the game as a loss when both engines agree that the (negative) score is below the given threshold for the duration of 6 consecutive plies. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Verify Claims}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 VerifyClaims}}}{\f1\cf11 Verify Claims + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Verify result claims made by engines when they terminate the game. If needed, correct the results to a loss for the engine making the false claim. Needs \ldblquote + Test Legality\rdblquote to be on in order to work. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Detect Mates}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 DetectMates}}}{\f1\cf11 Detect Mates + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 + Let WinBoard detect checkmate and stalemate, even before the engine gets the chance to claim it. Useful with buggy engines, that exit without a claim, or just hang. Needs \ldblquote Test Legality\rdblquote to be on in order to work. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Draw If Insufficient Material}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 DrawIfInsufficientMaterial}}}{\f1\cf11 Draw If Insufficient Material + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 + If this option is on, WinBoard will recognize KBKB positions with equally colored Bishops, KBK, KNK, and KK positions as draws, even before the engine can claim them. Needs \ldblquote Test Legality\rdblquote to be on in order to work. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 Adjudicate Trivial Draws}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 AdjudicateTrivialDraws}}}{\f1\cf11 Adjudicate Trivial Draws -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If this option is on, KBKB (with B on unlike color), KBKN, KNKN, KNNK, KRKR and KQKQ positions will be adjudicated draw after 6 ply. For KQKQ this is - not really sound, and in the future it might be taken out of this option. But as long as tablebase adjudications are not implemented, it seems best to group this end-game with the trivial draws. Needs \ldblquote Test Legality\rdblquote - to be on in order to work. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 ++If this option is on, KBKB (with B on unlike color), KBKN, KNKN, KNNK, KRKR and KQKQ positions will be adjudicated draw after 6 ply. For KQKQ this is not really sound, and in the future it might be taken out of ++ this option. But as long as tablebase adjudications are not implemented, it seems best to group this end-game with the trivial draws. Needs \ldblquote Test Legality\rdblquote to be on in order to work. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 N-Move Rule}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 N-MoveRule}}}{\f1\cf11 N-Move Rule -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -Here you can set the number of reversible moves (non-pawn, non-capture) after which WinBoard should adjudicate a game as draw. Engine draw claims are always consider ed valid after 50 moves (in the context of \ldblquote Verify Claims\rdblquote ) -, but you can set a different value here to either give the engine more leeway if it wants to play on, or test its claiming capabilities, or set it to a smaller value if you are impatient. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Here you can set the number of reversible moves (non-pawn ++, non-capture) after which WinBoard should adjudicate a game as draw. Engine draw claims are always consider ed valid after 50 moves (in the context of \ldblquote Verify Claims\rdblquote ++), but you can set a different value here to either give the engine more leeway if it wants to play on, or test its claiming capabilities, or set it to a smaller value if you are impatient. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 N-Fold Repetition Rule}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 N-FoldRepetitionRule}}}{\f1\cf11 N-Fold Repetition Rule -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -Here you can set the number of repetitions of the same position that should occur in order for WinBoard to adjudicate the game as draw. Engine draw claims are always consider ed valid after 3 repetitions (in the context of \ldblquote Verify Claims -\rdblquote ) , but you can set a different value here to either give the engine more leeway if it wants to play on, or test its claiming capabilities, or set it to 2 if you are impatient. (Do not set it to 1!) ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Here you can set the number of repetitions of the same position that should occur in order for WinBoard to adjudicate the game as ++ draw. Engine draw claims are always consider ed valid after 3 repetitions (in the context of \ldblquote Verify Claims\rdblquote ++) , but you can set a different value here to either give the engine more leeway if it wants to play on, or test its claiming capabilities, or set it to 2 if you are impatient. (Do not set it to 1!) + \par }\pard\plain \s5\li115\sb80\sl-240\slmult0\nowidctlpar\outlinelevel4\adjustright \f5\fs20\ul\cgrid {\b + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\ul\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{ + \f1\ul\cf6 UCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\ul\cf6 UCI}}}{\f1\ul\cf6 UCI + \par }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 Polyglot Directory}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 PolyglotDirectory}}}{\f1\cf6 Polyglot Directory + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 + If WinBoard knows where to find Polyglot, you can install UCI engines as if they were WinBoard engines, and WinBoard will automatically invoke Polyglot as an adapter to run them. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 Hash Size}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 HashSize}}}{\f1\cf6 Hash Size, }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 EGTB Path}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 + EGTBPath}}}{\f1\cf6 EGTB Path, }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 EGTB Cache Size}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 EGTBCacheSize}}}{\f1\cf6 EGTB Cache Size, }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 Opening Book}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 OpeningBook}}}{\f1\cf6 Opening Book -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 These are options that UCI engines expect to be specified. If future extensions of WinBoard protocol allow native WinBoard - engines to request similar information, it might be used for these engines as well. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 ++These are options that UCI engines expect to be specified. If future extensions of WinBoard protocol allow native WinBoard engines to request similar information, it might be used for these engines as well. + \par }\pard\plain \s5\li115\sb80\sl-240\slmult0\nowidctlpar\outlinelevel4\adjustright \f5\fs20\ul\cgrid {\b + \par }{\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ ICS Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\super #}{ ICSOptions}}}{\b ICS + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Auto Comment}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AutoCommentCmd}}}{\f1 Auto Comment -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Auto C -omment is on, any remarks made on ICS while you are observing or playing a game are recorded as a comment on the current move. This includes remarks made with the ICS commands }{\b\f1 say, tell, whisper, }{\f1 and }{\b\f1 kibitz}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++If Auto Comment is on, any remarks made on ICS while you are observing or playing a game are recorded as a comment on the current move. This includes remarks made with the ICS commands }{\b\f1 say, tell, whisper, }{\f1 and }{\b\f1 kibitz}{\f1 + . Limitation: remarks that you type yourself are not + \par recognized; WinBoard scans only the output from ICS, not the input you type to it. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Auto Observe}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AutobsCmd}}}{\f1 Auto Observe -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Auto Observe is on and you add a player to your }{\b\f1 gnotify}{\f1 list on ICS, WinBoard will automatically observe all of that player -'s games, unless you are doing something else (such as observing or playing a game of your own) when one starts. On most chess servers, you can now do }{\b\f1 follow }{\b\i\f1 player}{\f1 instead, and the server will automatically observe all of }{ -\b\i\f1 player\rquote s}{\f1 games. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Auto Observe is on and you add a player to your }{\b\f1 gnotify}{\f1 list on ICS, WinBoard will automatically ob ++serve all of that player's games, unless you are doing something else (such as observing or playing a game of your own) when one starts. On most chess servers, you can now do }{\b\f1 follow }{\b\i\f1 player}{\f1 ++ instead, and the server will automatically observe all of }{\b\i\f1 player\rquote s}{\f1 games. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Get Move List}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 GetMoveListCmd}}}{\f1 Get Move List + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Get Move List is on, whenever WinBoard}{\i\f1 }{\f1 -receives the first board of a new ICS game (or a different ICS game from the one it is currently displaying), it retrieves the list of past moves from the server. You can then revie -w the moves with the Forward and Backward commands or save them with Save Game. You might want to turn off this option if you are observing several blitz games at once, to keep from wasting time and network bandwidth fetching the move lists over and over. - If you turn this option on while a game is in progress, WinBoard}{\i\f1 }{\f1 immediately fetches the current move list. ++receives the first board of a new ICS game (or a different ICS game from the one it is currently displaying), it retrieves the list of past moves from the server. You can then review the mov ++es with the Forward and Backward commands or save them with Save Game. You might want to turn off this option if you are observing several blitz games at once, to keep from wasting time and network bandwidth fetching the move lists over and over. If you t ++urn this option on while a game is in progress, WinBoard}{\i\f1 }{\f1 immediately fetches the current move list. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Local Line Editing}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LocalLineEditing}}}{\f1 Local Line Editing -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Local Line Editing is }{\b\f1 on}{\f1 , your machine handles echoing, backspacing, etc., for the -characters that you type into the ICS Interaction window. Output is forwarded to the ICS only when you hit Enter.The Enter key produces a newline character, also known as Ctrl+J, \\ ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Local Line Editing is }{\b\f1 on}{\f1 , your machine handles echoing, backspacing, etc., for the characters that you type into the ICS Interaction ++ window. Output is forwarded to the ICS only when you hit Enter.The Enter key produces a newline character, also known as Ctrl+J, \\ + n, LF, linefeed, or decimal ASCII code 10. In this mode you can force a control character into the edit buffer by preceding it with Ctrl+Q (\ldblquote quote\rdblquote + ); however, the edit buffer will not accept certain control characters even when they are quoted in this way. You can force a control character to be sent immediately to ICS, bypassing the edit buffer, by preceding it with Ctrl+S (\ldblquote send + \rdblquote ). + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + WinBoard keeps a history of lines you recently typed in Local Line Editing mode. You can bring back old lines by pressing the cursor up key in the text entry box. Press the cursor down key to go back down to newer lines. -\par If Local Line Editing is }{\b\f1 off}{\f1 , all characters are sent to ICS as you type them. The Enter key produces a carriage return character, also known as Ctrl+M, \\r, CR, or decimal ASCII code 13. Use Ctrl+Backspace if you need the ASCII DEL char -acter. You can enter any character code by holding down the Alt key and typing its decimal value (always beginning with 0) on the numeric keypad; this is a little-known standard feature of Windows. ++\par If Local Line Editing is }{\b\f1 off}{\f1 , all characters are sent to ICS as you type them. The Enter key produces a carriage return character, also known as Ctrl+M, \\ ++r, CR, or decimal ASCII code 13. Use Ctrl+Backspace if you need the ASCII DEL character. You can enter any character code by holdin ++g down the Alt key and typing its decimal value (always beginning with 0) on the numeric keypad; this is a little-known standard feature of Windows. + \par In both modes, if WinBoard}{\i\f1 \rquote s }{\f1 internal telnet protocol implementation is active, it translates all \\n characters to the standard telnet end-of-line sequence \\r\\n just before sending them out to ICS; see }{\f1\uldb telnetProgram}{ + \v\f1 telnetProgram}{\f1 . + \par It is generally not a good idea to turn off this option while connected to ICS. If you are tempted to do so because everything you type is being echoed an extra time, see the paragraph about extra echoes under }{\f1\uldb LIMITATIONS}{\v\f1 LIMITATIONS}{ + \f1 below. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Quiet Play + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 QuietPlayCmd}}}{\f1 Quiet Play -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Quiet Play is on, WinBoard will automatically issue an ICS }{\b\f1 set shout 0}{\f1 command whenever you start a game and a }{\b\f1 set shout 1}{\f1 - command whenever you finish one. Thus you will not be distracted by shouts from other ICS users while playing. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Quiet Play is on, WinBoard will automatically issue an ICS }{\b\f1 set shout 0}{\f1 command whenever you start a game and a }{\b\f1 set shout 1}{\f1 command w ++henever you finish one. Thus you will not be distracted by shouts from other ICS users while playing. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Premove}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 PremoveCmd}}}{\f1 Premove + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Premove allows you to play a move on the board before you have received your opponent\rquote s move. This move is highlighted on the board using the }{\uldb Premove Highlight + }{\v\uldb premoveHighlightColor}{ color, and is sent to the ICS as soon as your opponent\rquote s move is received. To cancel a premove, either click twice on the piece that was premoved or premove an illegal move. + \par This group of controls allows you to set the following options: }{\uldb premove}{\v premove}{, }{\uldb premoveWhite}{\v premoveWhite}{, }{\uldb premoveWhiteText}{\v premoveWhiteText}{, }{\uldb premoveBlack}{\v premoveBlack}{, }{\uldb premoveBlackText}{\v + premoveBlackText}{. + \par }\pard\plain \s2\li120\sb80\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ ICS Alarm}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ ICSAlarm}}}{ICS Alarm + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {When }{\b icsAlarm}{ is set to True, the }{\uldb alarm sound}{\v soundIcsAlarm}{ is played when your clock counts down to }{\uldb icsAlarmTime}{\v icsAlarmTime}{ + seconds. For ICS games with time controls that include an increment, the alarm will sound each time the clock counts down to the }{\uldb icsAlarmTime}{\v icsAlarmTime}{. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + ICS Interaction Colors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ICSInteractionColors}}}{\f1 ICS Interaction Colors -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the colors and type styles that WinBoard uses to distinguish -between different types of messages in the ICS Interaction window. The types distinguished are: shout, sshout, channel 1 tell, other channel tell, kibitz (or whisper), personal tell (or new message notification), challenge, request (including abort, adjou -rn, draw, pause, and takeback), seek, and normal (all other messages). ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the colors and type ++styles that WinBoard uses to distinguish between different types of messages in the ICS Interaction window. The types distinguished are: shout, sshout, channel 1 tell, other channel tell, kibitz (or whisper), personal tell (or new message notification), c ++hallenge, request (including abort, adjourn, draw, pause, and takeback), seek, and normal (all other messages). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Fonts}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Fonts}}}{\f1 }{\f1\ul Fonts}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the fonts WinBoard is using. The clock font, message font and coordinates font are specific to each board size. The tags font, comments font an -d ICS Interaction font are not dependent on the current size of the board. The \ldblquote Revert to Defaults\rdblquote ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the fonts WinBoard is using. The clock font, message font and coordinates font are specific to each board size. The ta ++gs font, comments font and ICS Interaction font are not dependent on the current size of the board. The \ldblquote Revert to Defaults\rdblquote + button will reset the clock font, message font and coordinates font for the current board size, and will set the tags font, message font and Ics Interaction font for all board sizes. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Sounds}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Sounds}}}{\f1 }{\f1\ul Sounds}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the sounds that WinBoard plays for various events. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Move Sound}}#{\footnote\ftnalt -\pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 MoveSound}}}{\f1 If the Move sound is on, WinBoard alerts you by playing a sound after each of your opponent's moves (or af -ter every move if you are observing a game on the Internet Chess Server). The sound is not played after moves you make or moves read from a saved game file. If you turn on the Move sound when using WinBoard with the Internet Chess Server, you will probabl -y want to give the }{\b\f1 set bell 0}{\f1 - command to the ICS. Otherwise the ICS will send a bell character after every move (not just yours), causing WinBoard to play the ICS Bell sound too. Alternatively, you could turn off the ICS Bell sound in WinBoard, but that mig -ht cause you to miss ICS alerts for other interesting events. ++\pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 MoveSound}}}{\f1 If the Move sound is on, WinBoard alerts you by playing a sound after each of your opponent's moves (or after every move if ++you are observing a game on the Internet Chess Server). The sound is not played after moves you make or moves read from a saved game file. If you turn on the Move sound when using WinBoard with the Internet Chess Server, you will probably want to give the ++ }{\b\f1 set bell 0}{\f1 ++ command to the ICS. Otherwise the ICS will send a bell character after every move (not just yours), causing WinBoard to play the ICS Bell sound too. Alternatively, you could turn off the ICS Bell sound in WinBoard, but that might cause you to mi ++ss ICS alerts for other interesting events. + \par The other sound events correspond directly to the types of messages that the }{\f1\uldb ICS Interaction Colors}{\v\f1 ICSInteractionColors}{\f1 option knows how to colorize. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Sounds}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Sounds}}}{\f1 }{\f1\ul Game List}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you select which information is displayed in the Game List window. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Communications}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Communications}}}{\f1 }{\f1\ul Communications}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the communication port parameters when the }{\f1\uldb internetChessServerComPort}{\v\f1 internetChessServerComPort}{\f1 option is in use. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Load Game} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadGameOptns}}}{\f1 }{\f1\ul Load Game}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change options used while loading games (}{\f1\uldb timeDelay}{\v\f1 timeDelay}{\f1 option). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Save Game} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SaveGameOptns}}}{\f1 }{\f1\ul Save Game}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change options used for saving games (}{\f1\uldb autoSaveGames}{\v\f1 autoSaveGames}{\f1 , }{\f1\uldb oldSaveStyle}{\v\f1 oldSaveStyle}{\f1 , and }{\f1\uldb + saveGameFile}{\v\f1 saveGameFile}{\f1 options). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Time Control}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 TimeControlCmd}}}{\f1 }{\f1\ul Time Control}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Lets you change the time control to be used in games against a chess engine. Two types of timing are available. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 With conventional chess clocks, each player begins with his clock set to the }{\f1\uldb timeControl}{\v\f1 timeControl}{\f1 period. When both players have made }{ + \f1\uldb movesPerSession}{\v\f1 movesPerSession}{\f1 moves, a new time control period begins. The time in the new period is added to whatever time the players have left on their clocks. -\par With incremental clocks, each player is given an initial time allotment, and a }{\f1\uldb timeIncrement}{\v\f1 timeIncrement}{\f1 - is added to his clock after every move. The increment may be zero, in which case the entire game must be finished within the initial time allotment. ++\par With incremental clocks, each player is given an initial time allotment, and a }{\f1\uldb timeIncrement}{\v\f1 timeIncrement}{\f1 is added to his clock after every move. The increment may be zero, in which ++ case the entire game must be finished within the initial time allotment. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Save Settings Now}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SaveSettings}}}{\f1 }{\f1\ul Save Settings Now}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Save the current option settings to a file, along with the current window sizes and positions, to be automatically reloaded next time WinBoard is run. See }{\f1\uldb -Settings}{\v\f1 Settings}{\f1 for the fine points. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Save the current option settings to a file, along with the current window sizes and positions, to be automatically reloaded next time WinBoard is run. See }{\f1\uldb Settin ++gs}{\v\f1 Settings}{\f1 for the fine points. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Save Settings on Exit}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SaveSettingsOnExit}}}{\f1 }{\f1\ul Save Settings on Exit}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is on, the current settings are automatically saved when WinBoard exits, as with Save Settings Now. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Help Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HelpMenu}}}{\b0\f1\fs18\up6 }{\cs58\f1\fs20\super ${\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Help Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 + Help Menu + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Help Contents}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HelpContents}}}{\f1 Help Contents + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Brings up this help file, starting at the Contents page. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Search for Help on}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 SearchHelp}}}{\f1 Help Index + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Brings up this help file, starting at the Index/Find dialog. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + How to Use Help}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 HelpHelp}}}{\f1 How to Use Help + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Brings up the standard help file that explains how to use Windows Help. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Hint}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Hint}}}{\f1 Hint + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Displays a move hint from the chess engine. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Book}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Book}}}{\f1 Book -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Displays a list of possible moves from the chess engine\rquote s opening book. The first column gives moves, the sec -ond column gives one possible response for each move, and the third column shows the number of lines in the book that include the move from the first column. If you select this option and nothing happens, the engine is out of its book or does not support -the book command. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Displays a list of possible moves from the chess engine\rquote ++s opening book. The first column gives moves, the second column gives one possible response for each move, and the third column shows the number of lines in the book that include the move from the first column. If you selec ++t this option and nothing happens, the engine is out of its book or does not support the book command. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + About WinBoard}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 AboutWinBoard}}}{\f1 About WinBoard + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Displays the WinBoard version number. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 ICS Interaction Context Menu}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ICSInteractionContextMenu}}}{\b0\f1\fs18\up6 }{\cs58\f1\fs20\super ${\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 ICS Interaction Context Menu}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +} + {\f1 main}}}{\f1\fs20 ICS Interaction Context Menu -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -To see this menu, press the right mouse button anywhere in the output (upper) pane of the ICS Interaction window. Pressing the right mouse button in the input (lower) pane gives a standard editing context menu, not described here. Use the }{\b\f1 help}{ -\f1 command on ICS to learn what these commands mean. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 To see this menu, press the right mouse button anywhere in the ++ output (upper) pane of the ICS Interaction window. Pressing the right mouse button in the input (lower) pane gives a standard editing context menu, not described here. Use the }{\b\f1 help}{\f1 command on ICS to learn what these commands mean. + \par You can customize the lower part of this menu (below the Paste option) by setting the }{\f1\uldb icsMenu}{\v\f1 icsMenu}{\f1 option. The easiest way to accomplish this is to edit your }{\f1\uldb settings file}{\v\f1 settings}{\f1 + with Notepad or another plain text editor. Sorry, there is no graphical user interface for customizing the menu. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Copy and Paste}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 CopyAndPaste}}}{\f1 Copy and Paste -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Copies the current selection to the clipboard, then pastes it to the input box. As a shortcut to this function, you can press the - middle mouse button (if you have one), or Shift plus the right mouse button. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Copies the current selection to the clipboard, then pastes it to the input box. As a shortcut to this function, you can press the middle mouse button (if you have one), or Shift plus the right mouse button. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Copy}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Copy}}}{\f1 Copy + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Copies the current selection to the clipboard. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Paste}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Paste}}}{\f1 Paste + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Pastes the clipboard contents to the input box. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Who}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 Who}}}{\f1 Who + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote who\rdblquote }{\b\i\f1 }{\f1 to ICS. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Players}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 Players}}}{\f1 Players + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote players\rdblquote }{\b\i\f1 }{\f1 to ICS. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Games}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 Games}}}{\f1 Games + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote games\rdblquote }{\b\i\f1 }{\f1 to ICS. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Sought}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 Sought}}}{\f1 Sought + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote sought\rdblquote }{\b\i\f1 }{\f1 to ICS. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Tell}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Tell}}}{\f1 Tell (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Inserts \ldblquote tell }{\i\f1 name }{\f1 \rdblquote }{\b\i\f1 }{\f1 into the input box. The string }{\i\f1 name }{\f1 + is the current selection if it is not empty. Otherwise }{\i\f1 name }{\f1 is the word surrounding the mouse position, where a \ldblquote word\rdblquote is a string of letters, digits, or hyphens (-), such as an ICS user handle or game number. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Message}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Message}}}{\f1 Message (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Inserts \ldblquote message }{\i\f1 name }{\f1 \rdblquote }{\b\i\f1 }{\f1 into the input box, where }{\i\f1 name}{\f1 is as defined above. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Finger}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Finger}}}{\f1 Finger (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote finger }{\i\f1 name}{\f1 \rdblquote }{\b\i\f1 }{\f1 to ICS, where }{\i\f1 name}{\f1 is as defined above. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Vars}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Vars}}}{\f1 Vars (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote vars }{\i\f1 name}{\f1 \rdblquote }{\b\i\f1 }{\f1 to ICS, where }{\i\f1 name}{\f1 is as defined above. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Observe}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Observe}}}{\f1 Observe (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote observe }{\i\f1 name}{\f1 \rdblquote }{\b\i\f1 }{\f1 to ICS, where }{\i\f1 name}{\f1 is as defined above. Here }{\i\f1 name}{\f1 + can be either a user handle or a game number. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Match}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Match}}}{\f1 Match (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote match }{\i\f1 name}{\f1 \rdblquote }{\b\i\f1 }{\f1 to ICS, where }{\i\f1 name}{\f1 is as defined above. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 Play}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 Play}}}{\f1 Play (name) + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sends the command \ldblquote play }{\i\f1 name}{\f1 \rdblquote }{\b\i\f1 }{\f1 to ICS, where }{\i\f1 name}{\f1 is as defined above. Here }{\i\f1 name}{\f1 + can be either a user handle or a seek ad number. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Buttons}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Buttons}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 Buttons}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\b0\f1\fs18\up6 }{\f1\fs20 BUTTONS + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Back to Start}}}{\f1 << + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Same as }{\f1\uldb Back to Start}{\v\f1 BacktoStart}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Backward}} + }{\f1 < + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Same as }{\f1\uldb Backward}{\v\f1 Backward}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Pause}}}{ + \f1 P + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Same as }{\f1\uldb Pause}{\v\f1 Pause}{\f1 . The button label changes to }{\b\f1 C}{\f1 while WinBoard is pausing. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Forward}}} + {\f1 > + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Same as }{\f1\uldb Forward}{\v\f1 Forward}{\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + Forward to End}}}{\f1 >> + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Same as }{\f1\uldb Forward to End}{\v\f1 ForwardtoEnd}{\f1 . + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Command Line Options}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Options}}}{\f1\fs20 }{\cs58\f1\fs20\super #{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Options}}}{\f1\fs20 }{\cs58\f1\fs20\super ${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $ + }{\f1 Command Line Options}}}{\f1\fs20 }{\cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 COMMAND LINE OPTIONS -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 All WinBoard options can be set either on -the command line (if you start WinBoard by typing into an MSDOS Prompt box), in the Properties/Shortcut/Target box of a Windows shortcut, in a }{\f1\uldb settings file}{\v\f1 settings}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 All WinBoard options can be set either on the command line (if you star ++t WinBoard by typing into an MSDOS Prompt box), in the Properties/Shortcut/Target box of a Windows shortcut, in a }{\f1\uldb settings file}{\v\f1 settings}{\f1 + , or in the Additional Options box of the WinBoard startup dialog. Exactly the same syntax is used in all four places. Most options can also be set from the menus and saved using }{\f1\uldb Save Settings Now}{\v\f1 SaveSettings}{\f1 or }{\f1\uldb + Save Settings on Exit}{\v\f1 SaveSettingsOnExit}{\f1 , so most people will not need to read this section. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Most options have two names, a long one that is easy to read and a short one that is easy to type. To turn on a boolean (true/false) option }{\i\f1 opt}{\f1 + , you can just give its short name preceded by a minus sign or slash (-}{\i\f1 opt}{\f1 or /}{\i\f1 opt}{\f1 ); to turn one off, prefix the short name by an \ldblquote x\rdblquote or an extra minus sign (-x}{\i\f1 opt}{\f1 or /-}{\i\f1 opt}{\f1 -). To set any other kind of option, or to set a boolean option using its long name, give the value after the name, separated by a space, colon, or equal sign. (-}{\i\f1 opt}{\f1 23 or /}{\i\f1 option}{\f1 :true). If a string - option contains spaces or special characters, enclose it in double quotes and use the \\ quoting convention of C to name the special characters. Alternatively, you can enclose a string value in curly braces (/opt=\{string\} ++). To set any other kind of option, or to set a boolean option using its long name, give the value after the name, separated by a space, colon, or equal sign. (-}{\i\f1 opt}{\f1 23 or /}{\i\f1 option}{\f1 ++:true). If a string option contains spaces or special characters, enclose it in double quotes and use the \\ quoting convention of C to name the special characters. Alternatively, you can enclose a string value in curly braces (/opt=\{string\} + ), as long as the value does not contain a closing curly brace. If a filename option contains spaces, enclose it in either single or double quotes. In filename options, the \\ + character is not treated specially, so use single quotes around the outside of the value if it has double quotes inside (and vice versa). -\par When you start WinBoard, it will pop up the Startup dialog box unless you provide sufficient options on the command line for WinBoard to determine which major mode to be in and what engines to use or chess server to connect to. To byp -ass this box, you must at minimum give one of the three options }{\f1\uldb /cp}{\v\f1 cp}{\f1 , /}{\f1\uldb ics}{\v\f1 ics}{\f1 , or /}{\f1\uldb ncp}{\v\f1 ncp}{\f1 . If you give the /cp option, you must also give the /}{\f1\uldb fcp}{\v\f1 fcp}{\f1 - and /}{\f1\uldb scp}{\v\f1 scp}{\f1 options. If you give the /ics option, you must also give the /}{\f1\uldb icshost}{\v\f1 icshost}{\f1 option. ++\par When you start WinBoard, it will pop up the Startup ++ dialog box unless you provide sufficient options on the command line for WinBoard to determine which major mode to be in and what engines to use or chess server to connect to. To bypass this box, you must at minimum give one of the three options }{ ++\f1\uldb /cp}{\v\f1 cp}{\f1 , /}{\f1\uldb ics}{\v\f1 ics}{\f1 , or /}{\f1\uldb ncp}{\v\f1 ncp}{\f1 . If you give the /cp option, you must also give the /}{\f1\uldb fcp}{\v\f1 fcp}{\f1 and /}{\f1\uldb scp}{\v\f1 scp}{\f1 ++ options. If you give the /ics option, you must also give the /}{\f1\uldb icshost}{\v\f1 icshost}{\f1 option. + \par }\pard\plain \s29\fi-240\li360\sb60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\uldb Chess Engine Options}{\v\f1 ChessEngineOptions}{\f1 + \par }{\f1\uldb UCI Engine Support !NEW!}{\v\f1 UCIEngineSupport}{\f1 + \par }{\f1\uldb Internet Chess Server Options}{\v\f1 InternetChessServerOptions}{\f1 + \par }{\f1\uldb Load and Save Options}{\v\f1 LoadAndSaveOptions}{\f1 + \par }{\f1\uldb User Interface Options}{\v\f1 UserInterfaceOptions}{\f1 + \par }{\f1\uldb Adjudication Options !NEW!}{\v\f1 AdjudicationOptions}{\f1 + \par }{\f1\uldb Other Options}{\v\f1 OtherOptions}{\f1 + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Chess Engine Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Chess Engine Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ChessEngineOptions}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 Chess Engine Options + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 cp}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 cp}}}{\f1 /cp}{\b0\f1 or}{\f1 /xcp}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 chessProgram}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 chessProgram}}}{\f1 + /chessProgram }{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If true, puts WinBoard in chess engine mode. In this mode, you can play against a chess program running on your PC or use it as an analysis partner. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 tc}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 tc}}}{\f1 /tc }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 timeControl}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 timeControl}}}{\f1 /timeControl }{\i\f1 + minutes[:seconds] + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Each player begins with his clock set to the timeControl period. Default: 5 minutes. The additional options movesPerSession and timeIncrement are mutually exclusive. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 mps}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 mps}}}{\f1 /mps }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 movesPerSession}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 movesPerSession}}}{\f1 /movesPerSession }{\i\f1 + moves}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 When both players have made movesPerSession moves, a new timeControl period is added to both clocks. Default: 40 moves. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 inc}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 inc}}}{\f1 /inc }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 timeIncrement}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 timeIncrement}}}{\f1 /timeIncrement }{\i\f1 seconds + -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is specified, movesPerSession is ignored. Instead, a -fter each player's move, timeIncrement seconds are added to his clock. Use -timeIncrement 0 if you want to require the entire game to be played in one timeControl period, with no increment. Default: -1, which specifies movesPerSession mode. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is specified, movesPerSession is ignored. Instead, after each player's move, timeIncrement seconds are added to his clock. Use -timeIncrement 0 ++if you want to require the entire game to be played in one timeControl period, with no increment. Default: -1, which specifies movesPerSession mode. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 clock }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 clock }}}{\f1 /clock }{\b0\f1 or }{\f1 /xclock}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 clockMode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 clockMode}}}{\f1 + /clockMode }{\i\f1 true|false -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Determines whether or not to display the chess clocks. If clockMode is False, the clocks are not shown, but the side that is to play next is still highlighted. Also, unless search -Time is set, the chess engine still keeps track of the clock time and uses it to determine how fast to make its moves. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Determines whether or not to display the chess clocks. If ++ clockMode is False, the clocks are not shown, but the side that is to play next is still highlighted. Also, unless searchTime is set, the chess engine still keeps track of the clock time and uses it to determine how fast to make its moves. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 st}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 st}}}{\f1 /st }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 searchTime }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 searchTime }}}{\f1 /searchTime }{\i\f1 + minutes[:seconds]}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Tells the chess engine to spend at most the given amount of time searching for each of its moves. Without this option, the engine chooses its search time based on the number of moves and amount of time remaining until the next time control. Setting this o -ption also sets clockMode to False. ++Tells the chess engine to spend at most the given amount of time searching for each of its moves. Without this option, the engine chooses its search time based on the number of moves and amount of time remaining until the next t ++ime control. Setting this option also sets clockMode to False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 sd}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 sd}}}{\f1 /depth }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 searchDepth}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 searchDepth}}}{\f1 /searchDepth }{\i\f1 number}{\f1 + -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Tells the chess engine to look ahead at most the given number of moves when searching for a move to make. Without this option, the engine chooses i -ts search depth based on the number of moves and amount of time remaining until the next time control. With the option, the engine will cut off its search early if it reaches the specified depth. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Tells the chess engine to look ahead at most the given number of moves when searching for a move to make. Without this option, the engine chooses its search ++depth based on the number of moves and amount of time remaining until the next time control. With the option, the engine will cut off its search early if it reaches the specified depth. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 firstNPS}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 firstNPS}}}{\f1\cf11 /firstNPS }{\i\f1\cf11 number}{\f1\cf11 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf11 secondNPS}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 secondNPS}}}{\f1\cf11 /secondNPS }{\i\f1\cf11 number}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -Tells the chess engine to use an internal time standard based on its node count, rather then wall-clock time, to make its time decisions. The time in virtual seconds should be obtained by dividing the node count through the given }{\i\f1\cf11 number}{ -\f1\cf11 , like the number was a rate in nodes per second. WinBoard will manage the clocks in accordance with this, relying on the number of nodes reported by the engine in its thinking output. If }{\i\f1\cf11 number}{\f1\cf11 - equals zero, it can obviously bnot be used to conver -t nodes to seconds, and the time reported by the engine is used to decrement the WinBoard clock. The engine is supposed to report in CPU time it uses, rather than wall-clock time in this mode. Tis option can provide fairer conditions fo engine-engine matc -hes on heavily loaded machines, or with very fast games (where the wall clock is too inaccurate). \ldblquote Show Thinking\rdblquote must be on for this option to work. Not many engines might support this yet! ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Tells the chess engine to use ++ an internal time standard based on its node count, rather then wall-clock time, to make its time decisions. The time in virtual seconds should be obtained by dividing the node count through the given }{\i\f1\cf11 number}{\f1\cf11 ++, like the number was a rate in nodes per second. WinBoard will manage the clocks in accordance with this, relying on the number of nodes reported by the engine in its thinking output. If }{\i\f1\cf11 number}{\f1\cf11 ++ equals zero, it can obviously bnot be used to convert nodes to seconds, and the time reported by the engine is ++ used to decrement the WinBoard clock. The engine is supposed to report in CPU time it uses, rather than wall-clock time in this mode. Tis option can provide fairer conditions fo engine-engine matches on heavily loaded machines, or with very fast games (w ++here the wall clock is too inaccurate). \ldblquote Show Thinking\rdblquote must be on for this option to work. Not many engines might support this yet! + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 firstTimeOdds}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 firstTimeOdds}}}{\f1\cf11 /firstTimeOdds }{\i\f1\cf11 factor}{\f1\cf11 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf11 secondTimeOdds}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 secondTimeOdds}}}{\f1\cf11 /secondTimeOdds }{\i\f1\cf11 factor}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Reduces the time given to the mentioned engine by the given }{\i\f1\cf11 factor}{\f1\cf11 -. If pondering is off, the effect is indistinguishable from what would happen if the engine was running on a }{\i\f1\cf11 factor}{\f1\cf11 times slower machine. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Reduces the time given to the mentioned engine by the given }{\i\f1\cf11 factor}{\f1\cf11 . If po ++ndering is off, the effect is indistinguishable from what would happen if the engine was running on a }{\i\f1\cf11 factor}{\f1\cf11 times slower machine. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 }{\f1\cf11 timeOddsMode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 }{\f1\cf11 timeOddsMode}}}{\f1\cf11 /timeOddsMode }{\i\f1\cf11 mode -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -This option determines how the case is handled when both engines have a time-odds handicap. If mode=1, the engine that gets the most time will always get the nominal time, as specified by the time-control options, and its opponent\rquote -s time is normalized similarly. If mode=0, both play with reduced time. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 This option determines how the case is handled when both engines have a time-odds handicap. If mode=1, ++the engine that gets the most time will always get the nominal time, as specified by the time-control options, and its opponent\rquote s time is normalized similarly. If mode=0, both play with reduced time. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 ponder}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid { + \cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 ponder}}}{\f1 /ponder}{\b0\f1 or }{\f1 /xponder}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid {\cs58\f1\revised\super\revauth1\revdttm-1506646559 K}{\f1\revised\revauth1\revdttm-1506646559 ponderNextMove}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\pnrnot1\adjustright \f5\fs20\cgrid {\cs58\f1\revised\super\revauth1\revdttm-1506646559 #}{\f1\revised\revauth1\revdttm-1506646559 ponderNextMove}}}{\f1 /ponderNextMove }{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Ponder Next Move}{\v\f1 ponderNextMoveCmd}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 thinking}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 thinking}}}{\f1 /thinking}{\b0\f1 or }{\f1 /xthinking}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 showThinking}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + showThinking}}}{\f1 /showThinking }{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Show Thinking}{\v\f1 showThinkingCmd}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 periodic } + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 periodic}}}{\f1 /periodic }{\b0\f1 or }{\f1 /xperiodic}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 periodicUpdates}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 periodicUpdates}}}{ + \f1 /periodicUpdates }{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Periodic Updates}{\v\f1 periodicUpdatesCmd}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 mg }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 mg }}}{\f1 /mg }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 matchGames }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 matchGames}}}{\f1 /matchGames }{\i\f1 n + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Automatically runs an }{\b\i\f1 n}{\i\f1 -}{\f1 game match between two chess engines, with alternating colors. If the }{\f1\uldb loadGameFile}{\v\f1 loadGameFile}{\f1 or } + {\f1\uldb loadPositionFile}{\v\f1 loadPositionFile}{\f1 option is set, WinBoard will start each game with the given opening moves or the given position; otherwise, the games will start with the standard initial chess position. If the }{\f1\uldb + saveGameFile}{\v\f1 saveGameFile}{\f1 option is set, a move record for the match will be appended to the specified file. If the }{\f1\uldb savePositionFile}{\v\f1 savePositionFile}{\f1 + option is set, the final position reached in each game of the match will be appended to the specified file. When the match is over, WinBoard will display the match score and exit. Default: 0 (do not run a match). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 mm }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 mm }}}{\f1 /mm }{\b0\f1 or }{\f1 /xmm}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 matchMode }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 matchMode }}}{\f1 + /matchMode }{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Provided for backward compatibility. If true and matchGames=0, sets matchGames=1. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 matchPause}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 matchPause}}}{\f1\cf11 /matchPause }{\i\f1\cf11 number}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Sets the length of the pause between games in match mode to }{\i\f1\cf11 number}{\f1\cf11 msec. Default value is 10000, i.e. 10 sec. (If this pause i -s too short, engines not implementing \lquote ping\rquote will sometimes send the last move of their previous game only when a new game has started, at which time the move is illegal, and causes them to forfeit the game.) ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Sets the length of the pause between games in match mode to }{\i\f1\cf11 number}{\f1\cf11 msec. Default value is 1000 ++0, i.e. 10 sec. (If this pause is too short, engines not implementing \lquote ping\rquote will sometimes send the last move of their previous game only when a new game has started, at which time the move is illegal, and causes them to forfeit the game.) ++ + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 fd}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 fd }}}{\f1 /fd }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 firstDirectory}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 firstDirectory}}}{\f1 /firstDirectory }{\i\f1 dir + \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 sd}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 sd }}}{\f1 /sd }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 secondDirectory}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 secondDirectory}}}{\f1 /secondDirectory }{\i\f1 dir}{\cs58\f1\super }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf11 fcp }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf11\super #}{\f1\cf11 fcp }}}{\f1 /fcp }{\b0\f1 or}{\f1 }{ + \cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf11\super K}{\f1\cf11 firstChessProgram }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf11\super #}{\f1\cf11 firstChessProgram }}}{\f1 /firstChessProgram }{\i\f1 command\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\cf11\super K}{\f1\cf11 scp }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf11\super #}{\f1\cf11 scp }}}{\f1 /scp }{\b0\f1 or}{\f1 }{\cs58\f1\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf11\super K}{\f1\cf11 secondChessProgram }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\cf11\super #}{\f1\cf11 secondChessProgram}{\f1 }}}{\f1 /secondChessProgram }{\i\f1 command}{\cs58\f1\super }{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Names of the chess engines and working directories in which they are to be run. The second chess engine is started only in Two Machines (match) mode. These arguments are parsed as filenames; that is, the \\ - character is interpreted literally, not as a C-style escape. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The }{\i\f1 dir}{\f1 - argument specifies the initial working directory for the chess engine. It should usually be the directory where the engine and its working files are installed. If }{\i\f1 dir}{\f1 - is not an absolute pathname, it is interpreted relative to the directory from which WinBoard.exe itself was loaded. The }{\i\f1 dir}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Names of the chess engines and working directories in which they are to be run. The second chess engine is started only ++ in Two Machines (match) mode. These arguments are parsed as filenames; that is, the \\ character is interpreted literally, not as a C-style escape. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The }{\i\f1 dir}{\f1 argument specifies the initial working directory for the chess engine. It should usually be the dire ++ctory where the engine and its working files are installed. If }{\i\f1 dir}{\f1 is not an absolute pathname, it is interpreted relative to the directory from which WinBoard.exe itself was loaded. The }{\i\f1 dir}{\f1 + argument is ignored if the chess engine is being run on a remote machine (see firstHost and secondHost below). The default value for }{\i\f1 dir }{\f1 "", meaning that the chess engine is expected to be installed in the same directory as WinBoard. + \par The }{\i\f1 command}{\f1 argument is actually the command line to the chess engine, so if the engine itself needs command line arguments, you can include them by enclosing }{\i\f1 command}{\f1 - in single or double quotes. If the engine name or an engine argument has a space in it, use single quotes around the whole }{\i\f1 command, }{\f1 and inside them use double quotes around each item that contains spaces. If the engine name has more than o -ne period in it (for example, }{\f2 QChess1.5.exe}{\f1 ), you must include the "}{\f2 .exe}{\f1 " extension; otherwise you can leave it out. The default value for }{\i\f1 command}{\f1 ++ in single or double quotes. If the engine name or an engine argument has a space in it, use single quotes around the whole }{\i\f1 command, }{\f1 and inside them use double quotes around eac ++h item that contains spaces. If the engine name has more than one period in it (for example, }{\f2 QChess1.5.exe}{\f1 ), you must include the "}{\f2 .exe}{\f1 " extension; otherwise you can leave it out. The default value for }{\i\f1 command}{\f1 + is "", which brings up the startup dialog to ask which engines you want. + \par Examples: + \par }\pard\plain \s19\fi-518\li1036\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2 WinBoard /cp /fd="C:\\Program Files\\Crafty" /fcp=WCrafty-15.12.exe /scp=GNUChess + \par WinBoard /cp /fd="C:\\Miracle Games" /fcp='"Miracle Chess.exe" /wow' /scp=GNUChess -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 The basic rule is thus that what is inside the quotes delimiting the argument to /fcp and /scp, all goes to the engine, -and is ignored by WinBoard. WinBoard 4.3.13 and later, however, knows an exception to this: If, within the quotes, the word WBopt appears, everything that follows this word will be interpreted as a WinBoard argument, in stead of being passed to the engine ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 The basic rule is thus that what is inside the quotes del ++imiting the argument to /fcp and /scp, all goes to the engine, and is ignored by WinBoard. WinBoard 4.3.13 and later, however, knows an exception to this: If, within the quotes, the word WBopt appears, everything that follows this word will be interpreted + -on startup of the latter. (The WBopt itself is also not passed to the engine.) This possibility of hiding WinBoard arguments in the engine command is provided in order to create options that follow the engine in a tournament, when a tournament manager lik -e PSWBTM is used to invoke WinBoard. Because, in order to apply to a given engine, some options need to know if they apply to first or second engine, which might vary during the tournament, options hidden inside the engine command-line can contain -\lquote %s\rquote which will be replaced at the time the option is used by \lquote first\rquote or \lquote second\rquote , as applicable. ++as a WinBoard argument, in stead of being passed to the engine on startup of the latter. (The WBopt itself is also not passed to the engine.) This possibility of hiding WinBoard arguments in the engine command is provided in order to create options that f ++o ++llow the engine in a tournament, when a tournament manager like PSWBTM is used to invoke WinBoard. Because, in order to apply to a given engine, some options need to know if they apply to first or second engine, which might vary during the tournament, opt ++ions hidden inside the engine command-line can contain \lquote %s\rquote which will be replaced at the time the option is used by \lquote first\rquote or \lquote second\rquote , as applicable. + \par Examples: + \par }\pard\plain \s19\fi-518\li1036\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\cf11 WinBoard /cp /fd="C:\\Engines\\Crafty" /fcp=\rdblquote WCrafty-15.12 WBopt /%sTimeOdds=2\rdblquote /scp=GNUChess + + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Meaning that Crafty will have to play with half the time GNUChess will get. + \par }\pard\plain \s19\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 fh }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 fh }}}{\f1 /fh }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 firstHost }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 firstHost }}}{\f1 /firstHost }{\i\f1 host\line }{ + \cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 sh }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 sh }}}{\f1 /sh }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 secondHost }}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 secondHost }}}{\f1 /secondHost }{\i\f1 host}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Hosts on which the chess engines are to run. The default for each is "localhost". If you specify another host, WinBoard}{\i\f1 }{\f1 uses }{\f1\uldb rsh}{\v\f1 rsh}{\f1 - to run the chess program there. The /fd and /sd flags do not work in conjunction wi -th these flags; if you need a remote chess engine to run somewhere other than your default login directory on the remote machine, you will have to include a "cd" command in the argument to /fcp or /scp. ++ to run the chess program there. The /fd and /sd flags do not work in conjunction with these flags; if you need a remote chess engine to run somewhere other than your default login directory on the remote machine, you will have to include a "cd" c ++ommand in the argument to /fcp or /scp. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 initString + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 initString}}}{\f1 /firstInitString }{\b0\f1 or }{\f1 /initString }{\i\f1 string\line }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 secondInitString}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + secondInitString}}}{\f1 /secondInitString }{\i\f1 string}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The strings that are sent to initialize the chess engines. Default: "new\\nrandom\\n". The "\\n" sequences represent newlines. You can type "\\ -n" on the command line or in a }{\f1\uldb settings file}{\v\f1 settings}{\f1 , and WinBoard will convert it to a newline. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The strings that are sent to initialize the chess engines. Default: "new\\nrandom\\n". The "\\n" sequences represent newlines. You can type "\\n" on t ++he command line or in a }{\f1\uldb settings file}{\v\f1 settings}{\f1 , and WinBoard will convert it to a newline. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 All chess engines require the "new" command to start a new game. -\par You can remove the "random" command if you like; including it causes GNU Chess to randomize its move selection slightly so that it - doesn't play the same moves in every game. Even without "random", GNU Chess randomizes its choice of moves from its opening book. You can also try adding other commands to the initString; see the GNU Chess documentati{\*\bkmkstart _Hlt386545814}o -{\*\bkmkstart _Hlt386567280}{\*\bkmkend _Hlt386545814}n{\*\bkmkend _Hlt386567280} (gnuchess.txt) for details. Crafty ignores the "random" command; see its documentation for the commands it accepts. ++\par You can remove the "random" command if you like; including it causes GNU Chess to randomize its move ++selection slightly so that it doesn't play the same moves in every game. Even without "random", GNU Chess randomizes its choice of moves from its opening book. You can also try adding other commands to the initString; see the GNU Chess documentati ++{\*\bkmkstart _Hlt386545814}o{\*\bkmkstart _Hlt386567280}{\*\bkmkend _Hlt386545814}n{\*\bkmkend _Hlt386567280} (gnuchess.txt) for details. Crafty ignores the "random" command; see its documentation for the commands it accepts. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 initString + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 initString}}}{\f1 /firstComputerString }{\i\f1 string\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 secondInitString}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 secondInitString}} + }{\f1 /secondComputerString }{\i\f1 string}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If the chess engine is playing against another computer program (whether locally or on a chess server), by default the command "computer\\ + n" is sent to it. Some chess engines change their playing style when they receive this command. If you do not want the engine to know when it is playing another computer, you can set the string to "". -\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid { -Note that the computer string is sent to the engine after most other initialization commands, and is thus ideal for hiding a WinBoard-protocol command in that should be s -ent only to one engine, when the WinBoard option that normally specifies this command cannot be differentiated by engine, but s always sent to both engines. E.g. if you want one of the engines to ponder, and the other not. Because it is sent last, in can -overrule earlier commands. ++\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {N ++ote that the computer string is sent to the engine after most other initialization commands, and is thus ideal for hiding a WinBoard-protocol command in that should be sent only to one engine, when the WinBoard option that normally specifies this command ++cannot be differentiated by engine, but s always sent to both engines. E.g. if you want one of the engines to ponder, and the other not. Because it is sent last, in can overrule earlier commands. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 fb }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 fb }}}{\f1 /fb }{\b0\f1 or }{\f1 /xfb}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 firstPlaysBlack }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 firstPlaysBlack}}} + {\f1 /firstPlaysBlack }{\i\f1 true|false -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In games between two chess programs, the firstChessProgram normally plays white. (This is a change from earlier versions of WinBoar -d.) If this option is True, firstChessProgram plays black. In a multi-game match, this option affects the colors only for the first game; they still alternate in subsequent games. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 In games be ++tween two chess programs, the firstChessProgram normally plays white. (This is a change from earlier versions of WinBoard.) If this option is True, firstChessProgram plays black. In a multi-game match, this option affects the colors only for the first gam ++e; they still alternate in subsequent games. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 reuse}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 reuse}}}{\f1 /reuse}{\cs58\f1\super }{\b0\f1 or }{\f1 /xreuse}{\b0\f1 , or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 reuseFirst}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 reuseFirst}}}{\f1 + /reuseFirst}{\i\f1 true|false\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 reuse2}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 reuse2}}}{\f1 /reuse2}{\cs58\f1\super }{\b0\f1 or }{\f1 /xreuse2}{\b0\f1 , or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 reuseSecond}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 reuseSecond}}}{\f1 /reuseSecond}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is True (the default), WinBoard}{\i\f1 }{\f1 uses the same chess engine process repeatedly when playing multipl -e games. If the option is False, WinBoard kills off the chess engine after every game and starts a fresh one for the next game. Starting a fresh chess engine can be slow, so it is not recommended. However, some chess engines may not work properly when reu -sed, such as versions of Crafty earlier than 12.0. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is True (the default), WinBoard}{\i\f1 }{\f1 uses the same chess engine process repeatedly when playing multi ++ple games. If the option is False, WinBoard kills off the chess engine after every game and starts a fresh one for the next game. Starting a fresh chess engine can be slow, so it is not recommended. However, some chess engines may not work properly when r ++eused, such as versions of Crafty earlier than 12.0. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + firstProtocolVersion}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 firstProtocolVersion}}}{\f1 /firstProtocolVersion }{\i\f1 ver\line }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 secondProtocolVersion}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + secondProtocolVersion}}}{\f1 /secondProtocolVersion }{\i\f1 ver}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option specifies which version of the chess engine - communication protocol to use. By default, version-number is 2. In version 1, the "protover" command is not sent to the engine; since version 1 is a subset of version 2, nothing else changes. Other values for version-number are not supported. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option specifies which version of the chess engine communication protocol to use. By default, version-number is 2. In version 1, the "protover ++" command is not sent to the engine; since version 1 is a subset of version 2, nothing else changes. Other values for version-number are not supported. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 firstScoreAbs}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 firstScoreAbs}}}{\f1\cf6 /firstScoreAbs}{\i\f1\cf6 true|false\line }{\cs58\f1\cf6\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 secondScoreAbs}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 }{\f1\cf6 secondScoreAbs}}}{\f1\cf6 /secondScoreAbs}{\i\f1\cf6 true|false -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If this option is true, the score reported by the engine is taken to be that in favor of white, even when the engine plays black. Important when -winboard uses the score for adjudications, or in PGN reporting. This can be a useful option in combination with WBopt in the engine command-line, see under /fcp.}{\cf6 ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If this option is true, the score reported by t ++he engine is taken to be that in favor of white, even when the engine plays black. Important when winboard uses the score for adjudications, or in PGN reporting. This can be a useful option in combination with WBopt in the engine command-line, see under / ++fcp.}{\cf6 ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf2\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ ++\f1\cf6 niceEngines}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 niceEngines}}}{\f1\cf2 /niceEngines}{\i\f1\cf2 priority ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf2 ++This option allows you to lower the priority of the engine processes, so that the generally insatiable hunger for CPU time of chess engines does not interfere so much with smooth operation of WinBoard (or the rest of your system ++). Try priority = 10 or even 20 to lower the priority of the engines. Negative values could increase the engine priority, which is not recommended.}{\cf6 ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf2\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ ++\f1\cf6 firstOptions}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 firstOptions}}}{\f1\cf2 /firstOptions}{\i\f1\cf2 string\line }{\cs58\f1\cf2\super K ++{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 secondOptions}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { ++\cs58\f1\super #}{\f1 }{\f1\cf6 secondOptions}}}{\f1\cf2 /secondOptions}{\i\f1\cf2 string ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf2 The given string is a comma-separated list of (option name, option value) pairs, like for instance like: \ldblquote style Karpov, blunder rate 0\rdblquote ++. If the options announced by the engine at startup through the feature commands of WinBoard protocol matches one of the option names (i.e. \ldblquote style\rdblquote or \ldblquote blunder rate\rdblquote , it would be set to the given value (i.e. ++\ldblquote Karpov\rdblquote or 0) through a corresponding option command to the engine. This provided that the type of the value (text or numeric) matches as well.}{\cf6 + \par }{ + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\cf6\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 UCI Engine Support}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 }{\f1\cf6 UCI Engine Support}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 UCIEngineSupport}}}{ + \f1\fs20\cf6 UCI Engine Support + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + fUCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 fUCI}{\f1 }}}{\f1\cf6 /fUCI }{\b0\f1\cf6 or}{\f1\cf6 }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 firstIsUCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 + firstIsUCI}}}{\f1\cf6 /firstIsUCI}{\i\f1\cf6 true|false}{\f1\cf6 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 sUCI}{\f1 }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 sUCI}{\f1 }}}{\f1\cf6 /sUCI }{\b0\f1\cf6 or}{\f1\cf6 }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 secondIsUCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 + secondIsUCI}}}{\f1\cf6 /secondIsUCI}{\i\f1\cf6 true|false}{\f1\cf6 -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Indicates if the mentioned engine executable file is an UCI engine,}{\v\cf6 ICSLogon}{\cf6 and should be run - with the aid of the Polyglot adapter rather than directly. WinBoard will then pass the other UCI options and engine name to Polyglot through a .ini temporary file ceated for the purpose. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Indicates if the mentioned engine executable file is an UCI engine,}{\v\cf6 ICSLogon}{\cf6 ++ and should be run with the aid of the Polyglot adapter rather than directly. WinBoard will then pass the other UCI options and engine name to Polyglot through a .ini temporary file ceated for the purpose. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 PolyglotDir}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 PolyglotDir}{\f1 }}}{\f1\cf6 /PolyglotDir }{\i\f1\cf6 filename}{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Gives the name of the folder in which Polyglot is installed}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 usePolyglotBook}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 usePolyglotBook}{\f1 }}}{\f1\cf6 /usePolyglotBook }{\i\f1\cf6 true|false}{\f1\cf6 + + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Specifies if the Polygot book should be used}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 PolyglotBook}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 PolyglotBook}{\f1 }}}{\f1\cf6 /PolyglotBook }{\i\f1\cf6 filename}{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Gives the filename of the opening book that Polyglot should use}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + fNoOwnBookUCI}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 fNoOwnBookUCI}{\f1 }}}{\f1\cf6 /fNoOwnBookUCI }{\b0\f1\cf6 or}{\f1\cf6 }{\cs58\f1\cf6\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 firstHasOwnBookUCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid + {\cs58\f1\super #}{\f1 }{\f1\cf6 firstHasOwnBookUCI}}}{\f1\cf6 /firstHasOwnBookUCI}{\i\f1\cf6 true|false}{\f1\cf6 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 sNoOwnBookUCI}{\f1 }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 sNoOwnBookUCI}{\f1 }}}{\f1\cf6 /sNoOwnBookUCI }{\b0\f1\cf6 or}{\f1\cf6 }{\cs58\f1\cf6\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 secondHasOwnBookUCI}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super # + }{\f1 }{\f1\cf6 secondHasOwnBookUCI}}}{\f1\cf6 /secondHasOwnBookUCI}{\i\f1\cf6 true|false}{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Indicates if the mentioned engine lacks an opening book or not}{\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 defaultHashSize}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 defaultHashSize}{\f1 }}}{\f1\cf6 /defaultHashSize }{\i\f1\cf6 number}{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the size of the hash table to }{\i\f1\cf6 number}{\f1\cf6 MegaBytes}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 defaultCacheSizeEGTB}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 defaultCacheSizeEGTB}{\f1 }}}{\f1\cf6 /defaultCacheSizeEGTB }{\i\f1\cf6 number}{ + \f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the size of the EGTB cache to }{\i\f1\cf6 number}{\f1\cf6 MegaBytes}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 defaultPathEGTB}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 defaultPathEGTB}{\f1 }}}{\f1\cf6 /defaultPathEGTB }{\i\f1\cf6 filename}{\f1\cf6 + + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Gives the name of the folder where the end-game tablebases are installed}{\v\f1\cf6 ICSLogon}{\f1\cf6 . + \par }{ + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Internet Chess Server Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Internet Chess Server Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 InternetChessServerOptions}}}{ + \f1\fs20 Internet Chess Server Options + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ics }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ics }}}{\f1 /ics }{\b0\f1 or }{\f1 /xics}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 internetChessServerMode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + internetChessServerMode}}}{\f1 /internetChessServerMode}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Connect with an Internet Chess Server to play chess against its other users, observe games they are playing, or review games that have recently finished. See }{\f1\uldb + ICS Client}{\v\f1 ICSClient}{\f1 Default: False. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 You can create a script file containing ICS commands that WinBoard will type in for you whenever you connect to the ICS. See }{\f1\uldb ICS Logon}{\v\f1 ICSLogon}{\f1 . + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icshost }} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icshost }}}{\f1 /icshost }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 internetChessServerHost }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 internetChessServerHost }}}{\f1 + /internetChessServerHost }{\i\f1 hostname}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -The host name or numeric address of the Internet Chess Server to connect to when in ICS mode. The default is the empty string, which causes WinBoard to pop up a menu of known ICS sites. The file ics-address{\*\bkmkstart _Hlt386546221}e ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The ++host name or numeric address of the Internet Chess Server to connect to when in ICS mode. The default is the empty string, which causes WinBoard to pop up a menu of known ICS sites. The file ics-address{\*\bkmkstart _Hlt386546221}e + {\*\bkmkend _Hlt386546221}s.txt in the WinBoard distribution gives slightly more information on these sites. It includes their numeric addresses, which you can use if your site does not have a working name server. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icsport }} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icsport }}}{\f1 /icsport }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 internetChessServerPort }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 internetChessServerPort }}}{\f1 + /internetChessServerPort }{\i\f1 portnumber}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The port number to use when connecting to a chess server in ICS mode. Default: 5000. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 via }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 via }}}{\f1 /icshelper }{\i\f1 program}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 An external helper program used to communicate with the chess server. Typically }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 timestamp}}}{\i\f1 timestamp}{\f1 for the ICC (chessclub.com) or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super K}{\f1 timeseal}}}{\i\f1 timeseal}{\f1 for FICS (freechess.org, eics.daimi.aau.dk, etc.). This option is shorthand for \ldblquote /useTelnet /telnetProgram }{\i\f1 program}{\f1 \rdblquote }{\b\f1 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 telnet}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 telnet}}}{\f1 /telnet}{\b0\f1 or }{\f1 /xtelnet}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 useTelnet}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 useTelnet}}}{\f1 + /useTelnet}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option is poorly named; it should be called }{\b\f1 /useHelper}{\f1 . If set to True, it instructs WinBo -ard to use an external helper program to communicate with the ICS, as specified by the telnetProgram option. The external program must be a pure console application that can communicate with WinBoard through pipes; the Windows telnet application is not su -itable. If the option is False (the default), WinBoard communicates with the ICS by opening a Winsock TCP socket and using its own internal implementation of the telnet protocol. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option is poorly named; it should be called }{\b\f1 /useHelper}{\f1 ++. If set to True, it instructs WinBoard to use an external helper program to communicate with the ICS, as specified ++ by the telnetProgram option. The external program must be a pure console application that can communicate with WinBoard through pipes; the Windows telnet application is not suitable. If the option is False (the default), WinBoard communicates with the IC ++S by opening a Winsock TCP socket and using its own internal implementation of the telnet protocol. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 gateway}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 gateway}}}{\f1 /gateway }{\i\f1 hostname}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set to a host name, WinBoard uses }{\f1\uldb rsh}{\v\f1 rsh}{\f1 - to run the telnetProgram remotely on the given host to communicate with the Internet Chess Server instead of using its own internal implementation of the telnet protocol. See the }{\f1\uldb FIREWALLS}{\v\f1 FIREWALLS}{\f1 - section below for an explanation of when this option is useful. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set to a host name, WinBoard uses }{\f1\uldb rsh}{\v\f1 rsh}{\f1 to run the telnetProgram remotely on the given host to communicate with the In ++ternet Chess Server instead of using its own internal implementation of the telnet protocol. See the }{\f1\uldb FIREWALLS}{\v\f1 FIREWALLS}{\f1 section below for an explanation of when this option is useful. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + telnetProgram}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 telnetProgram}}}{\f1 /telnetProgram }{\i\f1 program}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option is poorly named; it should be called }{\b\f1 /helperProgram}{\f1 -. It gives the name of the remote or external helper program to be used with the gateway or useTelnet option. - The default is "telnet". The telnet program is invoked with the value of internetChessServer as the first argument and the value of internetChessServerPort as the second argument on its command line. ++. It gives the name of the remote or external helper program to be used with the gateway or useTelnet option. The default is "telnet". The telnet program is invoked with the value of internetChessServer as the first argument and the value o ++f internetChessServerPort as the second argument on its command line. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icscom }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icscom }}}{\f1 /icscom }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 internetChessServerComPort }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 internetChessServerComPort }}}{\f1 + /internetChessServerComPort }{\i\f1 name}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -If this option is set, WinBoard communicates with the Internet Chess Server using a serial communication port instead of a network connection. Use this option if your machine is not c -onnected to a network (not even via SLIP or PPP), but you do have Internet access through another machine by dialing in using a modem or by connecting directly to a serial terminal port. Example: ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set, WinBoard communicates with the Internet Chess Server using a serial communication port instead of a network connect ++ion. Use this option if your machine is not connected to a network (not even via SLIP or PPP), but you do have Internet access through another machine by dialing in using a modem or by connecting directly to a serial terminal port. Example: + \par }\pard\plain \s19\li120\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2 WinBoard /ics /icscom:com1 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 After you start WinBoard in this way, type whatever modem commands are necessary to dial out to your Internet provider and log in. You may need to turn off }{\f1\uldb + Local Line Editing}{\v\f1 LocalLineEditing}{\f1 on the Options menu while typing commands to the modem, but turn it on again afterwards. Then telnet to the ICS, using a command like "telnet chessclub.com 5000". Important: See the paragraph in the }{ + \f1\uldb LIMITATIONS}{\v\f1 LIMITATIONS}{\f1 section below about extra echoes. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + comPortSettings }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 comPortSettings }}}{\f1 /comPortSettings}{\b0\f1 }{\i\f1 \ldblquote dataRate,dataBits,parity,stopBits,flow + \rdblquote + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option allows serial port parameters to be set from the command line or a settings file. The values are simply filled in to the }{\f1\uldb Communications}{\v\f1 + Communications}{\f1 dialog. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icslogon } + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icslogon }}}{\f1 /icslogon }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 internetChessServerLogonScript }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 internetChessServerLogonScript }} + }{\f1 /internetChessServerLogonScript }{\i\f1 filename + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you change the name used for the }{\f1\uldb ICS Logon}{\v\f1 ICSLogon}{\f1 + file. Default: "ICS.ini". The filename is interpreted relative to WinBoard's installation directory (the directory containing WinBoard.exe). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autocomm } + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 autocomm }}}{\f1 /autocomm }{\b0\f1 or }{\f1 /xautocomm}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autoComment }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 autoComment }}}{\f1 + /autoComment}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Auto Comment}{\v\f1 AutoCommentCmd}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autoflag } + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 autoflag }}}{\f1 /autoflag}{\b0\f1 or }{\f1 /xautoflag}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autoCallFlag }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + autoCallFlag }}}{\f1 /autoCallFlag}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Auto Flag}{\v\f1\uldb AutoFlag}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autobs }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 autobs }}}{\f1 /autobs}{\b0\f1 or }{\f1 /xautobs}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autoObserve }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + autoObserveCmd }}}{\f1 /autoObserve}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Auto Observe}{\v\f1 autoObserveCmd}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 autoKibitz}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 autoKibitz}{\f1 }}}{\f1\cf11 /autoKibitz -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Kibitzes the engines last thinking output (depth, score, time, speed, PV) to the ICS in zippy mode. Show Thinking must be on for this option to work. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Kibitzes the engines last thinking output (depth, score, time, speed, PV) to the ICS in zippy mode. Show Thinking must be on for this option to work. }{\f1\cf2 ++Also diverts similar kibitz information of an opponent engine that is playing you through the ICS to the engine-output window, as if the engine was playing locally.}{\f1\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 moves }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 moves }}}{\f1 /moves}{\b0\f1 or }{\f1 /xmoves}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 getMoveList }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 getMoveList }}}{\f1 + /getMoveList}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Get Move List}{\v\f1 getMoveListCmd}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 edit}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 edit}}}{\f1 /edit}{\cs58\f1\super }{\b0\f1 or }{\f1 /xedit}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 localLineEditing}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 localLineEditingOption}}}{\f1 /localLineEditing}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Local Line Editing}{\v\f1 localLineEditing}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 quiet }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 quiet }}}{\f1 /quiet }{\b0\f1 or }{\f1 /xquiet}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 quietPlay }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 quietPlay }}}{\f1 + /quietPlay}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Quiet Play}{\v\f1 quietPlayCmd}{\f1 option. Default: False + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + blindfold (option)}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 opt_blindfold }}}{\f1 /blindfold }{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Blindfold}{\v\f1 BlindfoldCmd}{\f1 option. Default: False + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ pre}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ pre}}}{\f1 /pre }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\super K}{ xpre}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ xpre}}}{\f1 /xpre}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premove (option)}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 premove}}}{\f1 + /premove}{\i\f1 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Premove}{\v\f1 PremoveCmd}{\f1 option. If set to True, the premove feature is enabled. If set to False, premove is disabled and the other }{\f1\uldb + Premove}{\v\f1 PremoveCmd}{\f1 settings are ignored. Default: False. + \par }\pard\plain \s2\li115\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ preWhite}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ preWhite}}}{\f1 /prewhite }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ xpreWhite}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ xpreWhite}}}{\f1 /xprewhite}{\b0\f1 , or }{\cs58\f1\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premoveWhite}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + #}{\f1 premoveWhite}}}{\f1 /premoveWhite}{\i\f1 true|false + \par }\pard \s2\li115\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premoveWhiteText}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 premoveWhiteText}}}{\f1 /premoveWhiteText}{\i\f1 movetext + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If }{\b\f1 premoveWhite}{\f1 is set to True and you are playing white in an ICS game, the text specified by the }{\b\f1 premoveWhiteText}{\f1 + option is sent to the ICS as soon as the game starts. These options can be set from the }{\f1\uldb Premove}{\v\f1 PremoveCmd}{\f1 section of the }{\f1\uldb ICS Options}{\v\f1\uldb ICSOptions}{\f1 dialog box. The default for }{\b\f1 premoveWhite}{\f1 + is False. + \par }\pard\plain \s2\li115\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ preBlack}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ preBlack}}}{\f1 /preblack }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ xpreBlack}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ xpreBlack}}}{\f1 /xpreblack}{\b0\f1 , or }{\cs58\f1\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premoveBlack}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + #}{\f1 premoveBlack}}}{\f1 /premoveBlack}{\i\f1 true|false + \par }\pard \s2\li115\sa120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premoveBlackText}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 premoveBlackText}}}{\f1 /premoveBlackText}{\i\f1 movetext + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If }{\b\f1 premoveBlack}{\f1 is set to True and you are playing black in an ICS game, the text specified by the }{\b\f1 premoveBlackText}{\f1 + option is sent to the ICS as soon as the first move is received from your opponent, even if you make a different premove on the board before the first white move is received. These options can be set from the }{\f1\uldb Premove}{\v\f1 PremoveCmd}{\f1 + section of the }{\f1\uldb ICS Options}{\v\f1\uldb ICSOptions}{\f1 dialog box. The default for }{\b\f1 premoveBlack}{\f1 is False. + \par }\pard\plain \li115\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \f5\fs20\cgrid {\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ alarm}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ alarm}}}{\b /alarm }{or}{\b }{\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\super K}{ xalarm}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ xalarm}}}{\b /xalarm}{, or }{\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ icsAlarm}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ icsAlarm}}}{\b /icsAlarm }{\b\i true|false}{\b + \par }\pard \li115\sa120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ icsAlarmTime}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ icsAlarmTime}}}{\b /icsAlarmTime }{\b\i milliseconds + \par }\pard \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright {When }{\b icsAlarm}{ is set to True, the }{\uldb alarm sound}{\v soundIcsAlarm}{ is played when your clock counts down to }{\b icsAlarmTime}{ + seconds. For ICS games with time controls that include an increment, the alarm will sound each time the clock counts down to the }{\b icsAlarmTime}{. The }{\b icsAlarmTime}{ can be set by selecting }{\uldb ICS Alarm}{\v ICSAlarm}{ from the }{\uldb + ICS options}{\v\uldb ICSOptions}{ dialog. The default is 5 seconds. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Load and Save Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Load and Save Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 LoadandSaveOptions}}}{\b0\f1\fs18\up6 }{\f1\fs20 + Load and Save Options + \par }\pard\plain \s2\li115\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 lgf }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 lgf }}}{\f1 /lgf }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 loadGameFile }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 loadGameFile }}}{\f1 /loadGameFile }{\i\f1 + filename}{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 lgi }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 lgi }}}{\f1 /lgi }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 loadGameIndex }}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 loadGameIndex }}}{\f1 /loadGameIndex }{\i\f1 N}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If loadGameFile is set, WinBoard reads the specified game file at startup. You can leave out the name of this option and -give just the file name, which is handy if you want to configure WinBoard as a game viewer with a browser such as the Windows Explorer or Netscape. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies th -e standard input. If there is more than one game in the file, WinBoard pops up a menu of the available games, with entries based on their PGN tags. If loadGameIndex is set to }{\i\f1 N, }{\f1 the menu is suppressed and the }{\i\f1 N}{\f1 -th game found in the file is loaded immediately. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If loadGameFile is set, WinBoard reads the specified game file at startup. Yo ++u can leave out the name of this option and give just the file name, which is handy if you want to configure WinBoard as a game viewer with a browser such as the Windows Explorer or Netscape. The filename is interpreted relative to WinBoard's initial work ++ing directory. The filename "-" specifies the standard input. If there is more than one game in the file, WinBoard pops up a menu of the available games, with entries based on their PGN tags. If loadGameIndex is set to }{\i\f1 N, }{\f1 ++the menu is suppressed and the }{\i\f1 N}{\f1 th game found in the file is loaded immediately. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 td }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 td }}}{\f1 /td }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 timeDelay }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 timeDelay }}}{\f1 /timeDelay }{\i\f1 seconds}{\f1 + + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Time delay between moves during }{\f1\uldb Load Game}{\v\f1 LoadGame}{\f1 + . Fractional seconds are allowed; try 0.4. A time delay value of -1 tells WinBoard not to step through game files automatically. Default: 1 second. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 sgf }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 sgf }}}{\f1 /sgf }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 saveGameFile }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 saveGameFile }}}{\f1 /saveGameFile }{\i\f1 + filename}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set, WinBoard appends a record of every game played to the specified file. The filename is interpre -ted relative to WinBoard's initial working directory. The filename "-" specifies the standard output. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++If this option is set, WinBoard appends a record of every game played to the specified file. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies the standard output. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autosave } + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 autosave }}}{\f1 /autosave}{\b0\f1 or }{\f1 /xautosave}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 autoSaveGames }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + autoSaveGames }}}{\f1 /autoSaveGames}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is True, at the end o -f every game WinBoard prompts you for a filename and appends a record of the game to the file you specify. Ignored if saveGameFile is set. Default: False. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++If this option is True, at the end of every game WinBoard prompts you for a filename and appends a record of the game to the file you specify. Ignored if saveGameFile is set. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 lpf}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 lpf}}}{\f1 /lpf }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 loadPositionFile }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 loadPositionFile }}}{\f1 /loadPositionFile }{ + \i\f1 filename}{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 lpi }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 lpi }}}{\f1 /lpi }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + loadPositionIndex }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 loadPositionIndex }}}{\f1 /loadPositionIndex }{\i\f1 N}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -If loadPositionFile is set, WinBoard loads the specified position file at startup. The filename is interpreted relative to WinBoard's initial working directory. The filename "-" specifies the standard input. If loadPositionIndex is set to }{\i\f1 N}{\f1 -, the }{\i\f1 N}{\f1 th position found in the file is loaded; otherwise the first is loaded. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If loadPositionFile is set, WinBoard loads the specified position file at startup. The filename is interpreted relative to WinBoard's initial working directory. The f ++ilename "-" specifies the standard input. If loadPositionIndex is set to }{\i\f1 N}{\f1 , the }{\i\f1 N}{\f1 th position found in the file is loaded; otherwise the first is loaded. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 spf }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 spf }}}{\f1 /spf }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 savePositionFile }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 savePositionFile }}}{\f1 /savePositionFile }{ + \i\f1 filename}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option -is set, WinBoard appends the final position reached in every game played to the specified file. The filename is interpreted relative to WinBoard's initial working directory. The file name "-" specifies the standard output. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is set, WinBoard appends the final position rea ++ched in every game played to the specified file. The filename is interpreted relative to WinBoard's initial working directory. The file name "-" specifies the standard output. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 pgnExtendedInfo}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 pgnExtendedInfo}{\f1 }}}{\f1\cf6 /pgnExtendedInfo }{\i\f1\cf6 true|false}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If this option is set, WinBoard saves depth, score and time used for each move that the engine found as a comment in the PGN file. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 pgnEventHeader}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 pgnEventHeader}{\f1 }}}{\f1\cf6 /pgnEventHeader }{\i\f1\cf6 string}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the name used in the PGN event tag to }{\i\f1\cf6 string}{\f1\cf6 . + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 saveOutOfBookInfo}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 saveOutOfBookInfo}}}{\f1\cf6 /saveOutOfBookInfo }{\i\f1\cf6 true|false}{\f1\cf6 + + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Include the information on how the engine(s) game out of its opening book in a special \lquote annotator\rquote tag with the PGN file. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 oldsave }} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 oldsave }}}{\f1 /oldsave }{\b0\f1 or }{\f1 /xoldsave}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 oldSaveStyle }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 oldSaveStyle }}}{\f1 + /oldSaveStyle}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is False (the default), WinBoard saves games in PGN (portable game notation) and positions in FEN (Forsythe-Edwards notation). If the optio -n is True, a save style that is compatible with older versions of WinBoard (and of xboard) is used instead. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is False (the default), WinBoard saves games in PGN (portable game notation) and positions in FEN (Forsythe-Edwards notation). ++ If the option is True, a save style that is compatible with older versions of WinBoard (and of xboard) is used instead. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 debug}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 debug}}}{\f1 /debug}{\b0\f1 or }{\f1 /xdebug}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 debugMode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 debugMode}}}{\f1 + /debugMode}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Writes debugging information to the file \ldblquote WinBoard.debug\rdblquote -, including all commands sent to the chess engine, all output received from it, and all commands sent to ICS. You can press Ctrl+Alt+F12 to turn this option on or off while WinBoard is running. Each time you turn it on, any existing debug file is overwrit -ten. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Writes debugging information to the file \ldblquote WinBoard.debug\rdblquote , including all commands sen ++t to the chess engine, all output received from it, and all commands sent to ICS. You can press Ctrl+Alt+F12 to turn this option on or off while WinBoard is running. Each time you turn it on, any existing debug file is overwritten. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 debugFile}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 debugFile}{\f1 }}}{\f1\cf6 /debugFile}{\cs58\f1\cf6\super }{\f1\cf6 }{\i\f1\cf6 filename}{ + \f1\cf6 }{\b0\f1\cf6 or}{\f1\cf6 }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 nameOfDebugFile}{\f1 }}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 nameOfDebugFile}{\f1 }}}{\f1\cf6 /nameOfDebugFile}{\i\f1\cf6 filename}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the name of the file to which WinBoard saves debug information (including all communication to and from the engines). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 engineDebugOutput}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 engineDebugOutput}{\f1 }}}{\f1\cf11 /engineDebugOutput}{\cs58\f1\cf11\super }{ + \f1\cf11 }{\i\f1\cf11 number}{\f1\cf11 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Specifies how WinBoard should handle unsollicited output from the engine, with respect to saing it in the debug file. The output is further (hopefully) ignored. If }{ -\i\f1\cf11 numbe}{\f1\cf11 r=0, WinBoard rfrains from writing such spurious output to the debug file. If}{\i\f1\cf11 numbe}{\f1\cf11 r=1, all engine output is written faithfully to the debug file. If }{\i\f1\cf11 numbe}{\f1\cf11 -r=2, any protocol-violating line is prefixed with a \lquote #\rquote character, as the engine itself should have done if it wanted to submit info for inclusion in the debug file. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 -This option is provided for the benefit of applications that use the debug file as a source of informtion, such as the broadcater of live games TLCV / TLCS. Such applications can be protected from spurious engine output that might otherwise confuse them. - ++\i\f1\cf11 numbe}{\f1\cf11 r=0, WinBoard rfrains from writing such spurious output to the debug file. If}{\i\f1\cf11 numbe}{\f1\cf11 r=1, all engine output is written faithfully to the debug file. If }{\i\f1\cf11 numbe}{\f1\cf11 r= ++2, any protocol-violating line is prefixed with a \lquote #\rquote character, as the engine itself should have done if it wanted to submit info for inclusion in the debug file. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 This option is provided for the benefit of applications that use the debug file as a source ++of informtion, such as the broadcater of live games TLCV / TLCS. Such applications can be protected from spurious engine output that might otherwise confuse them. + \par }{ + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 User Interface Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 User Interface Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 UserInterfaceOptions}}}{\b0\f1\fs18\up6 }{\f1\fs20 + User Interface Options ++\par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf2\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super K}{\f1\cf2 ++firstLogo}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super #}{\f1\cf2 firstLogo}}}{\f1\cf2 /firstLogo }{\i\f1\cf2 filename}{\f1\cf2 ++\par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf2\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super K}{\f1\cf2 secondLogo}}# ++{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super #}{\f1\cf2 secondLogo}}}{\f1\cf2 /secondLogo }{\i\f1\cf2 filename}{\f1\cf2 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf2 The appearence o ++f either of these options causes WinBoard to reserve space for displaying logos on both sides of the clocks. Normally the first logo goes left, the second right, unless the option \lquote swap clocks\rquote is in effect. The }{\i\f1\cf2 filename}{ ++\f1\cf2 must refer to a bitmap file (.bmp) containing a logo for the particular player (usually a 130x65 or 100x50 bitmap, which will be scaled to the height of two clock lines.) ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf2\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super K}{ ++\f1\cf2 autoLogo}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\cf2\super #}{\f1\cf2 autoLogo}}}{\f1\cf2 /autoLogo}{\i\f1\cf2 true|false}{\f1\cf2 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf2 When true, causes WinBoard to automatically supply a logo for the first and second chess program, by looking for a fie named logo.bmp in the engine directory (spe ++cified by the /fd or /sd option), and then displays it ike this file was given as an argument to the /firstLog or /secondLogo option. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 hideThinkingFromHuman}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 hideThinkingFromHuman}}}{\f1\cf6 /hideThinkingFromHuman}{\i\f1\cf6 true|false}{\f1\cf6 + -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -Prevents the engine thinking output to appear in the display, without necessitating to suppress the sending of this information altogether (so it can still appear in the PGN). ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Preven ++ts the engine thinking output to appear in the display, without necessitating to suppress the sending of this information altogether (so it can still appear in the PGN). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 top}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 top}}}{\f1 /top }{\b0\f1 or }{\f1 /xtop}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 alwaysOnTop}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 alwaysOnTopOpt}}}{\f1 + /alwaysOnTop}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Always On Top}{\v\f1 AlwaysOnTop}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 queen}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 queen}}}{\f1 /queen}{\b0\f1 or }{\f1 /xqueen}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 alwaysPromoteToQueen}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + alwaysPromoteToQueen}}}{\f1 /alwaysPromoteToQueen}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Always Queen}{\v\f1 AlwaysQueen}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 drag}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 drag}}}{\f1 /drag}{\b0\f1 or }{\f1 /xdrag}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 animateDragging}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 animateDraggingOpt} + }}{\f1 /animateDragging}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Animate Dragging}{\v\f1 animateDragging}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 animate}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 animate}}}{\f1 /animate }{\b0\f1 or }{\f1 /xanimate}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 animateMoving}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 animateMovingOpt}}}{ + \f1 /animateMoving}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Animate Moving}{\v\f1 animateMoving}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 flip}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 flip}}}{\f1 /flip }{\b0\f1 or }{\f1 /xflip}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 flipView}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 flipViewOption}}}{\f1 + /flipView}{\i\f1 true|false}{\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Auto Flip View is not set, or if you are observing but not participating in a -game, then the positioning of the board at the start of each game depends on the flipView option. If flipView is False (the default), the board is positioned so that the white pawns move from the bottom to the top; if True, the black pawns move from the -bottom to the top. In any case, the }{\f1\uldb Flip View}{\v\f1 FlipView}{\f1 menu command can be used to flip the board after the game starts ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If Auto Flip View is not set, or if you are observing but not participating in a game, then the ++ positioning of the board at the start of each game depends on the flipView option. If flipView is False (the default), the board is positioned so that the white pawns move from the bottom to the top; if True, the black pawns move from the bottom to the ++top. In any case, the }{\f1\uldb Flip View}{\v\f1 FlipView}{\f1 menu command can be used to flip the board after the game starts + \par }\pard\plain \li115\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ autoflip}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ autoflip}}}{\b /autoflip}{ or }{\b /xautoflip}{, or }{\cs58\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\super K}{ autoFlipView}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ autoFlipViewOption}}}{\b /autoFlipView }{\b\i true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Auto Flip View}{\v\f1 AutoFlipView}{\f1 option. Default: True. + \par }\pard\plain \li115\sb120\sa60\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\b\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ autoraise}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ autoraise}}}{\b /autoraise}{ or }{\b /xautoraise}{, or }{\cs58\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\super K}{ autoRaiseBoardOption}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ autoRaiseBoardOption}}}{\b /autoRaiseBoard }{\b\i true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Auto Raise Board}{\v\f1 AutoFlipView}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 highdrag}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 highdrag}}}{\f1 /highdrag }{\b0\f1 or }{\f1 /xhighdrag}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 highlightDragging\tab \tab }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + highlightDraggingOpt}}}{\f1 /highlightDragging }{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Highlight Dragging}{\v\f1 highlightDragging}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 highlight} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 highlight}}}{\f1 /highlight }{\b0\f1 or }{\f1 /xhighlight}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 highlightLastMove}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + highlightLastMoveOpt}}}{\f1 /highlightLastMove}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Highlight Last Move}{\v\f1 highlightLastMoveOpt}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 popup}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 popup}}}{\f1 /exit}{\b0\f1 or }{\f1 /xexit}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 popupMoveErrors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 popupMoveErrorsOpt} + }}{\f1 /popupExitMessage}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Popup Exit Message}{\v\f1 popupExitMessageCmd}{\f1 menu option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 popup}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 popup}}}{\f1 /popup}{\b0\f1 or }{\f1 /xpopup}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 popupMoveErrors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 popupMoveErrorsOpt} + }}{\f1 /popupMoveErrors}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Popup Move Errors}{\v\f1 popupMoveErrorsCmd}{\f1 menu option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 coords }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 coords }}}{\f1 /coords }{\b0\f1 or }{\f1 /xcoords}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 showCoords}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 showCoords}}}{\f1 + /showCoords}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Show Coords}{\v\f1 showCoords}{\f1 option. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 legal }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 legal }}}{\f1 /legal }{\b0\f1 or }{\f1 /xlegal}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 testLegality }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 testLegality }}}{\f1 + /testLegality}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Test Legality}{\v\f1 testLegalityCmd}{\f1 option. Default: True. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 size }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 size }}}{\f1 /size }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 boardSize }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 boardSize }}}{\f1 /boardSize }{\i\f1 sizename}{\f1 + -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Board Size}{\v\f1 BoardSizeCmd}{\f1 option. Also chooses which board size any following Font options will affect. The defa -ult is the largest size that will fit on your screen. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the }{\f1\uldb Board Size}{\v\f1 BoardSizeCmd}{\f1 ++ option. Also chooses which board size any following Font options will affect. The default is the largest size that will fit on your screen. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ wpc}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ wpc}}}{\f1 /wpc}{\b0\f1 or }{\cs58\b0\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 whitePieceColor}}}{\cs58\f1\super #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 whitePieceColor}}}{\f1 /whitePieceColor }{\i\f1 color + \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ bpc}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\super #}{ bpc}}}{\f1 /bpc }{\b0\f1 or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 blackPieceColor}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 blackPieceColor}}}{\f1 /blackPieceColor }{\i\f1 color\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ lsc}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ lsc}}}{\f1 /lsc }{\b0\f1 or}{\i\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 lightSquareColor}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + lightSquareColor}}}{\f1 /lightSquareColor }{\i\f1 color}{\cs58\f1\super }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ dsc}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ dsc}}}{\f1 /dsc }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super K}{\f1 darkSquareColor}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 darkSquareColor}}}{\f1 /darkSquareColor }{\i\f1 color}{\cs58\f1\super }{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Color specifications for white pieces, black pieces, light squares, and dark squares. Colors can be specified only by red/green/blue intensity, either in hexadecimal (as }{ -\i\f1 #rrggbb}{\f1 ) or in decimal (as }{\i\f1 rrr,ggg,bbb}{\f1 ). In the latter format, you must enclose the st -ring in quotation marks if you leave spaces after the commas. The defaults are respectively #FFFFCC, #202020, #C8C365, and #77A26D. Available on the }{\f1\uldb Board Colors}{\v\f1 BoardColors}{\f1 section of the }{\f1\uldb Board Options}{\v\f1 -BoardOptions}{\f1 dialog. ++\i\f1 #rrggbb}{\f1 ) or in decimal (as }{\i\f1 rrr,ggg,bbb}{\f1 ). In the latter format, you must enclose the string in quotation marks if you leave spaces after the commas. The defaults are respective ++ly #FFFFCC, #202020, #C8C365, and #77A26D. Available on the }{\f1\uldb Board Colors}{\v\f1 BoardColors}{\f1 section of the }{\f1\uldb Board Options}{\v\f1 BoardOptions}{\f1 dialog. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you are using a }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 grayscale} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 grayscale}}}{\f1 grayscale monitor, try setting the colors to: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 -whitePieceColor:#FFFFFF\line -blackPieceColor:#000000\line -lightSquareColor:#CCCCCC\line -darkSquareColor:#999999 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ hsc}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ hsc}}}{\f1 /hsc }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 highlightSquareColor}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 highlightSquareColor}}}{\f1 /highlightSquareColor }{\i\f1 color}{ + \cs58\f1\super }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ phc}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\super #}{ phc}}}{\f1 /phc }{\b0\f1 or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 premoveHighlightColor}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 premoveHighlightColor}}}{\f1 /premoveHighlightColor }{\i\f1 color}{\cs58\f1\super }{\f1 -\par }{\b0\f1 Color specifications for the }{\b0\f1\uldb Highlight Last Move}{\b0\v\f1 HighlightLastMove}{\b0\f1 and }{\b0\f1\uldb Premove}{\b0\v\f1 PremoveCmd}{\b0\f1 options, respectively. Colors can be sp -ecified only by red/green/blue intensity, either in hexadecimal (as }{\b0\i\f1 #rrggbb}{\b0\f1 ) or in decimal (as }{\b0\i\f1 rrr,ggg,bbb}{\b0\f1 ++\par }{\b0\f1 Color specifications for the }{\b0\f1\uldb Highlight Last Move}{\b0\v\f1 HighlightLastMove}{\b0\f1 and }{\b0\f1\uldb Premove}{\b0\v\f1 PremoveCmd}{\b0\f1 options, respectively. Colors can be ++specified only by red/green/blue intensity, either in hexadecimal (as }{\b0\i\f1 #rrggbb}{\b0\f1 ) or in decimal (as }{\b0\i\f1 rrr,ggg,bbb}{\b0\f1 + ). In the latter format, you must enclose the string in quotation marks if you leave spaces after the commas. The defaults are respectively #FFFF00 and #FF0000, respectively. + \par }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 mono }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 mono }}}{\f1 /mono}{\b0\f1 or }{\f1 /xmono}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 monoMode}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 monoMode}}}{\f1 /monoMode}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Determines whether WinBoard displays its pieces and squares in black and white (True) or color (False, the default). Available in the }{\f1\uldb Board Colors}{\v\f1 + BoardColors}{\f1 section of the }{\f1\uldb Board Options}{\v\f1 BoardOptions}{\f1 dialog. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 flipBlack}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 flipBlack}{\f1 }}}{\f1\cf11 /flipBlack}{\i\f1\cf11 true|false}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Determines whether WinBoard displays the black pieces upside down (or the white pieces in Flip View). Useful with Shogi with the traditional Jap -anese pieces, which are not distinguished by color but by orientation. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 ++Determines whether WinBoard displays the black pieces upside down (or the white pieces in Flip View). Useful with Shogi with the traditional Japanese pieces, which are not distinguished by color but by orientation. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 allWhite}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 allWhite}{\f1 }}}{\f1\cf11 /allWhite}{\i\f1\cf11 true|false}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Determines whether the white piece bitmaps will be used to display black pieces. The white pieces have a dark outline, which the black pi -eces lack. This makes the latter look vague if the color you give them is not very dark. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 ++Determines whether the white piece bitmaps will be used to display black pieces. The white pieces have a dark outline, which the black pieces lack. This makes the latter look vague if the color you give them is not very dark. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 renderPiecesWithFont}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 renderPiecesWithFont}{\f1 }}}{\f1\cf6 /renderPiecesWithFont }{\i\f1\cf6 fontname} + {\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 + Uses the named true-type font to render the pieces, rather than the built-in bitmaps. The font must be installed on your computer. If the name starts with a * it is ignored, allowing you to easily disable a font temporarily in the whinboard.ini file. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 fontPieceToCharTable}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 fontPieceToCharTable}{\f1 }}}{\f1\cf6 /fontPieceToCharTable }{\i\f1\cf6 + characterstring}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 + If font-based rendering of the pieces is used, this table specifies which character of the font alphabet should be used for which piece. The format of the character strings is the same as that of the argument of /pieceToCharTable. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 fontPieceSize}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 fontPieceSize}{\f1 }}}{\f1\cf6 /fontPieceSize }{\i\f1\cf6 number}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 The number gives the size of the piece, as a percentage of the square size. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{\f1\cf6 + fontPieceBackColorWhite}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\cf6 fontPieceBackColorWhite}}}{\f1\cf6 /fontPieceBackColorWhite }{\i\f1\cf6 color\line }{ + \cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{\f1\cf6 fontPieceForeColorWhite}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\cf6 fontPieceForeColorWhite}}}{\f1\cf6 /fontPieceForeColorWhite }{\i\f1\cf6 color\line }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{\f1\cf6 fontPieceBackColorBlack}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\cf6 fontPieceBackColorBlack}}}{\f1\cf6 + /fontPieceBackColorBlack }{\i\f1\cf6 color\line }{\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super K}{ }{\f1\cf6 fontPieceForeColorBlack}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\super #}{ }{\f1\cf6 fontPieceForeColorBlack}}}{\f1\cf6 /fontPieceForeColorBlack }{\i\f1\cf6 color}{\cs58\f1\cf6\super }{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Color specifications for white pieces, black pieces that are generated with font-based rendering. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + liteBackTextureFile}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 liteBackTextureFile}{\f1 }}}{\f1\cf6 /liteBackTextureFile }{\i\f1\cf6 filename}{\f1\cf6 + + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 darkBackTextureFile}{\f1 + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 darkBackTextureFile}{\f1 }}}{\f1\cf6 /darkBackTextureFile }{\i\f1\cf6 filename}{\f1\cf6 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -The filename indicates a bitmap file that should be used to display the light or dark squares, allowing you to make boards that look like wood, marble, etc. A filename starting with * is ignored. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 The filename indicates a bitmap file that should be used to displ ++ay the light or dark squares, allowing you to make boards that look like wood, marble, etc. A filename starting with * is ignored. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + liteBackTextureMode}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 liteBackTextureMode}{\f1 }}}{\f1\cf6 /liteBackTextureMode }{\i\f1\cf6 number}{\f1\cf6 + + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 darkBackTextureMode}{\f1 + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 darkBackTextureMode}{\f1 }}}{\f1\cf6 /darkBackTextureMode }{\i\f1\cf6 number}{\f1\cf6 -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 The number indicates the way the files given in the background-texture options should be used to fill in the squares.}{\cf6\lang1043\cgrid0 Valid textu -re modes are 1 (default) and 2. In mode 1 the squares are taken from portions of the texture bitmap and copied without further processing. In mode 2, squares can also be rotated, mirrored and so on in order to provide a little more variety to the texture. - The operations are selected at random so the board will look slightly different every time the program is run.\line }{\cf6 ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 The number indicates the way the files given in the background-texture options should be used to fill in the squares.}{\cf6\lang1043\cgrid0 ++ Valid texture modes are 1 (default) and 2. In mode 1 the squares are taken from portions of the texture bitmap and copied without further processing. In mode 2, squares can also be rotated, mirrored an ++d so on in order to provide a little more variety to the texture. The operations are selected at random so the board will look slightly different every time the program is run.\line }{\cf6 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 overideLineGap}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 overideLineGap}{\f1 }}}{\f1\cf6 /overideLineGap }{\i\f1\cf6 number}{\f1\cf6 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -The number specifies the width, in pixels, of the grid lines used to separate the squares. If it is very small (like a single pixel), it becomes vey hard to see which squares are highlighted (to indicate the last move), as this highlighting is a color cha -nge of these grid lines. Highlighting the moves with an arrow is then recommended. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 The number specifies the width, in pixels, of the gr ++id lines used to separate the squares. If it is very small (like a single pixel), it becomes vey hard to see which squares are highlighted (to indicate the last move), as this highlighting is a color change of these grid lines. Highlighting the moves with ++ an arrow is then recommended. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 highlightMovesWithArrow}{\f1 }} #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 highlightMovesWithArrow}{\f1 }}}{\f1\cf6 /highlightMovesWithArrow }{ + \i\f1\cf6 true|false}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If this option is true, a big, fat arrow is drawn to indicate the last move. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 highlightArrowColor}{\f1 }} #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 highlightArrowColor}{\f1 }}}{\f1\cf6 /highlightArrowColor }{\i\f1\cf6 color}{ + \f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Specifies the color of the arrow that highlights the moves. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + evalHistoColorWhite}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 evalHistoColorWhite}{\f1 }}}{\f1\cf6 /evalHistoColorWhite }{\i\f1\cf6 color}{\f1\cf6 + + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 evalHistoColorBlack}{\f1 + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 evalHistoColorBlack}{\f1 }}}{\f1\cf6 /evalHistoColorBlack }{\i\f1\cf6 color}{\f1\cf6 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf6 Specifies the colors to be used to plot the white and black scores in the evaluation graph}{\cf6\lang1043\cgrid0 .\line }{ + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorShout + }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorShout}}}{\f1 /colorShout}{\i\f1 \ldblquote effects color\rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorSShout}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorSShout}}}{\f1 + /colorSShout }{\i\f1 \ldblquote effects color\rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorChannel1}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorChannel1}}}{\f1 /colorChannel1 }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorChannel}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorChannel}}}{\f1 + /colorChannel }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorKibitz}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorKibitz}}}{\f1 /colorKibitz }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorTell}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorTell}}}{\f1 + /colorTell }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorChallenge}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorChallenge}}}{\f1 /colorChallenge }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorRequest}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorRequest}}}{\f1 + /colorRequest }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorSeek}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorSeek}}}{\f1 /colorSeek }{\i\f1 \ldblquote effects color\rdblquote }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorNormal}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorNormal}}}{\f1 + /colorNormal }{\i\f1 \ldblquote effects color\rdblquote + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Select colors and effects to colorize messages in the ICS Interaction window. The effects may be any combination of }{\b\f1 b}{\f1 old, }{\b\f1 i}{\f1 talic, }{\b\f1 u}{ -\f1 nderline, and }{\b\f1 s}{\f1 trikeout. Colors are specified as for squares and pieces. Available on the }{\f1\uldb ICS Interaction Colors}{\v\f1 ICSInteractionColors}{\f1 section of the }{\f1\uldb ICS Options}{\v\f1 ICSOptions}{\f1 - dialog. Limitation: On 256 color displays, Windows chooses the nearest solid color from the system palette, which will not always be close to the color you selected. ++\f1 nderline, and }{\b\f1 s}{\f1 trikeout. Colors are specified as for squares and pieces. Available on the }{\f1\uldb ICS Interaction Colors}{\v\f1 ICSInteractionColors}{\f1 section of the }{\f1\uldb ICS Options}{\v\f1 ICSOptions}{\f1 dialog. Li ++mitation: On 256 color displays, Windows chooses the nearest solid color from the system palette, which will not always be close to the color you selected. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + colorBackground}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorBackground}}}{\f1 /colorBackground }{\i\f1 color + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the background color for the ICS Interaction window. Available on the }{\f1\uldb ICS Interaction Colors}{\v\f1 ICSInteractionColors}{\f1 section of the }{\f1\uldb + ICS Options}{\v\f1 ICSOptions}{\f1 dialog. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorize}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 colorize}}}{\f1 /colorize}{\cs58\f1\super }{\b0\f1 or }{\f1 /xcolorize}{\b0\f1 , or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 colorizeMessages}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 + colorizeMessages}}}{\f1 /colorizeMessages}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If True, WinBoard colorizes messages in the ICS Interaction window with the colors listed above. Default: True. Available in the }{\f1\uldb ICS Interaction Colors}{\v\f1 + ICSInteractionColors}{\f1 section of the }{\f1\uldb ICS Options}{\v\f1 ICSOptions}{\f1 dialog. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 clockFont} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 clockFont}}}{\f1 /clockFont \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 messageFont}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 messageFont + }}}{\f1 /messageFont \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 coordFont}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 coordFont}}}{\f1 /coordFont \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 tagsFont}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 tagsFont}}}{ + \f1 /tagsFont \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 commentFont}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 commentFont}}}{\f1 /commentFont \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icsFont}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icsFont}}}{\f1 /icsFont + \ldblquote }{\i\f1 fontname:size effects}{\f1 \rdblquote -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The fonts used respectively for the clocks, the message display line, rank and file coordinate labels, the -Edit Tags dialog, the Edit Comment dialog, and the ICS Interaction window. These options may be given more than once. Each occurrence affects the fonts for the current board size; that is, the size given in the last preceding /boardSize option, if any, or - else the default size. The font size may contain a decimal point, and the effects may be any combination of }{\b\f1 b}{\f1 old, }{\b\f1 i}{\f1 talic, }{\b\f1 u}{\f1 nderline, and }{\b\f1 s}{\f1 trikeout. Example: }{\f2\fs16 /clockFont="Arial:20.0 bi".}{ -\f1 Available on the }{\f1\uldb Fonts}{\v\f1 Fonts}{\f1 menu.}{\f2\fs16 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The fonts used respectively for the clocks, the message display line, rank and file coordinate labels, the Edit Tags dialog, the Edit Comment dialog, and the ICS Interact ++ion window. These options may be given more than once. Each occurrence affects the fonts for the current board size; that is, the size given in the last preceding /boardSize option, if any, or else the default size. The font size may contain a decimal poi ++nt, and the effects may be any combination of }{\b\f1 b}{\f1 old, }{\b\f1 i}{\f1 talic, }{\b\f1 u}{\f1 nderline, and }{\b\f1 s}{\f1 trikeout. Example: }{\f2\fs16 /clockFont="Arial:20.0 bi".}{\f1 Available on the }{\f1\uldb Fonts}{\v\f1 Fonts}{\f1 menu.} ++{\f2\fs16 + \par }\pard\plain \s2\li115\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundShout}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundShout}}}{ /soundShout}{\i sound\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundSShout}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundSShout}}}{ /soundSShout }{\i sound\line }{ + \cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundChannel1}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundChannel1}}}{ /soundChannel1 }{\i sound}{\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundChannel}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundChannel}}}{ /soundChannel }{\i sound}{\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundKibitz}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundKibitz}}}{ /soundKibitz }{\i sound}{\line }{ + \cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundTell}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super #}{\f1 soundTell}}}{ /soundTell }{\i sound}{\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundChallenge}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundChallenge}}}{ /soundChallenge }{\i sound}{\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundRequest}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundRequest}}}{ /soundRequest }{\i sound}{\line }{\cs58\f1\super K + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundMove}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{ + \f1 soundMove}}}{ /soundMove }{\i sound}{\cs58\f1\super }{\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundBell}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundBell}}}{ /soundBell }{\i sound}{\cs58\f1\super }{ + \par }\pard \s2\li115\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundIcsWin}}#{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundIcsWin}}}{\f1 /soundIcsWin }{\i\f1 sound}{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundIcsLoss}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundIcsLoss}}}{\f1 /soundIcsLoss }{\i\f1 sound}{\cs58\f1\super }{\f1 + \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundIcsDraw}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundIcsDraw}}}{\f1 /soundIcsDraw }{\i\f1 sound}{\cs58\f1\super }{\f1 \line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{ + \f1 soundIcsUnfinished}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundIcsUnfinished}}}{\f1 /soundIcsUnfinished }{\i\f1 sound}{\cs58\f1\super }{\f1 + \par }\pard \s2\li115\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 soundIcsAlarm}}#{\footnote\ftnalt + \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 soundIcsAlarm}}}{\f1 /soundIcsAlarm }{\i\f1 sound}{\cs58\f1\super }{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Associate sounds with WinBoard events. Most of the events are the same ones that cause text colorization. In addition, }{\b\f1 soundMove}{\f1 + is played if a chess engine or another player makes a move. }{\b\f1 SoundBell}{\f1 is played if the chess server sends an ASCII BEL character (Ctrl+G). Available on the }{\f1\uldb Sounds}{\v\f1 Sounds}{\f1 menu. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\b SoundIcsWin}{, }{\b soundIcsLoss}{, }{\b soundIcsDraw}{ and }{\b soundIcsUnfinished}{ + are played at the conclusion of an ICS game. The result of the game determines which sound is played. + \par }{\b SoundIcsAlarm}{ is played when your game clock counts down to }{\uldb icsAlarmTime}{\v\uldb icsAlarmTime}{. + \par }\pard \li120\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480\adjustright {\f1 The }{\i\f1 sound}{\f1 argument may be one of the following: + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls2\adjustright {\f1 + The name of a }{\f2 .wav}{\f1 file. The filename is interpreted relative to WinBoard's installation directory (the directory containing WinBoard.exe). + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls2\adjustright {\f2 $}{ + \f1 , indicating the default system sound. + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls2\adjustright {\f2 !}{ + \f1 followed by the name of a built-in WinBoard wave resource. + \par {\pntext\pard\plain\f3\fs20\lang1033\cgrid \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnhang{\pntxtb \'b7}}\ls2\adjustright {\f2 !}{ + \f1 alone, or \ldblquote \rdblquote (empty string), indicating silence. + \par }\pard \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright {\f1 The default for soundMove and soundBell is }{\f2 $}{\f1 , while the others default to silence. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icsMenu}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icsMenu}}}{\f1 /icsMenu=\{}{\i\f1 entries}{\f1 \} }{\b0\f1 or }{\f1 /icsMenu=@}{\i\f1 filename + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you customize the right-button }{\f1\uldb context menu}{\v\f1 ICSInteractionContextMenu}{\f1 - that is available in the upper (output) pane of the ICS Interaction window. It consists of a list of menu ent -ries, one per line. If the option value starts with an @ sign, it is the name of a file that contains the entries. Each entry contains either four fields separated by commas or the single character }{\f2 "-"}{\f1 . The fields are: ++ that is available in the upper (output) pane of the ICS Interaction window. It consists of a list of menu entries, one per line. If the option value starts with an @ sign, it is th ++e name of a file that contains the entries. Each entry contains either four fields separated by commas or the single character }{\f2 "-"}{\f1 . The fields are: + \par {\pntext\pard\plain\f5\fs20\lang1033\cgrid \hich\af5\dbch\af0\loch\f5 1.\tab}}\pard\plain \fi-360\li480\sb80\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls14\adjustright + \f5\fs20\cgrid {The menu text. If this field begins with }{\f2 "|"}{, the item begins a new column in the menu and the }{\f2 "|"}{ is not shown. If this field contains an }{\f2 "&"}{ + , the character after the ampersand is underlined in the menu and acts as a keyboard shortcut for the item when the menu is displayed. Do not assign the same shortcut key to two different menu items. + \par {\pntext\pard\plain\s26 \f1\fs20\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 2.\tab}}\pard\plain \s26\fi-360\li480\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls14\adjustright + \f5\fs20\cgrid {\f1 Text to insert into the input pane. The text cannot include a comma. You can use ICS aliases to get around this limitation. + \par {\pntext\pard\plain\s26 \f1\fs20\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 3.\tab}}\pard \s26\fi-360\li480\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls14\adjustright {\f1 + A flag (1 or 0) saying whether to insert a space and }{\i\f1 name }{\f1 (see }{\f1\uldb above}{\v\f1 Tell}{\f1 ) after the text. If you set this flag, you might also want to put "(name)" into the menu text as a memory aid. + \par {\pntext\pard\plain\s26 \f1\fs20\lang1033\cgrid \hich\af1\dbch\af0\loch\f1 4.\tab}}\pard \s26\fi-360\li480\sl-240\slmult0\nowidctlpar\jclisttab\tx480{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec\pnstart1\pnindent360\pnhang{\pntxta .}}\ls14\adjustright {\f1 + A flag (1 or 0) saying whether the result should be sent immediately to ICS or left in the input pane for further editing. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {The entry }{\f2 "-"}{ produces a separator line in the menu. The top three menu entries are always }{\b Copy and Paste}{, }{\b Copy}{, and }{\b Paste}{ + , but you have full control over the rest of the menu. + \par }{\f1 The default menu is: -\par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 \endash \line &Who,who,0,1\line Playe&rs,players,0,1\line &Games,games,0,1\line &Sought,sought,0,1\line |& -Tell (name),tell,1,0\line M&essage (name),message,1,0\line \endash \line &Finger (name),finger,1,1\line &Vars (name),vars,1,1\line &Observe (name),observe,1,1\line &Match (name),match,1,1\line Pl&ay (name),play,1,1 ++\par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 \endash \line &Who,who,0,1\line Playe&rs,players,0,1\line &Games,games,0,1\line &Sought,sought,0,1\line ++|&Tell (name),tell,1,0\line M&essage (name),message,1,0\line \endash \line &Finger (name),finger,1,1\line &Vars (name),vars,1,1\line &Observe (name),observe,1,1\line &Match (name),match,1,1\line Pl&ay (name),play,1,1 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb settings}{\v\f1 settings}{\f1 file with a plain text editor such as Notepad. + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 icsNames}} + #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 icsNames}}}{\f1 /icsNames=\{}{\i\f1 names}{\f1 \} }{\b0\f1 or }{\f1 /icsNames=@}{\i\f1 filename -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you customize the drop-down list of ICS names that appears in the WinBoard startup dialog. It consists of a li -st of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepends the text \rdblquote /ics /icsHost=\rdblquote ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++This option lets you customize the drop-down list of ICS names that appears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains ++the strings. When you select a string from the drop-down list, WinBoard prepends the text \rdblquote /ics /icsHost=\rdblquote + and adds the result to the command-line options. There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb settings}{\v\f1 settings}{\f1 file with a plain text editor such as Notepad. + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + firstChessProgramNames}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 firstChessProgramNames}}}{\f1 /firstChessProgramNames=\{}{\i\f1 names}{\f1 \} }{\b0\f1 or }{\f1 + /firstChessProgramNames="@}{\i\f1 filename}{\f1 " -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you customize the first drop-down list of chess engine na -mes that appears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prep -ends the text \rdblquote /cp /firstChessProgram=\rdblquote and adds the result to the command-line options. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you customize the first drop-down list of chess engine names that appears in the WinBoard startup dialog. It consists of ++ a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepends the text \rdblquote /cp /firstChessProgram=\rdblquote ++ and adds the result to the command-line options. + \par + \par There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb settings}{\v\f1 settings}{\f1 file with a plain text editor such as Notepad. Example: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2 /firstChessProgramNames=\{GNUChess\line WCrafty-15_11 /fd="C:\\Program Files\\Crafty"\line ArasanX /fd="C:\\Program Files\\Arasan + \\Arasan 4.1"\line "EXchess xb" /fd=C:\\EXchess\line Comet-WB /fd=C:\\Comet\line \} + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + secondChessProgramNames}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 secondChessProgramNames}}}{\f1 /secondChessProgramNames=\{}{\i\f1 names}{\f1 \}}{\b0\f1 or }{\f1 + /secondChessProgramNames="@}{\i\f1 filename}{\f1 "}{\i\f1 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -This option lets you customize the second drop-down list of chess engine names that appears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it -is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepends the text \rdblquote /cp /secondChessProgram=\rdblquote and adds the result to the command-line options. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 This option lets you customize the second drop-down list of chess engine name ++s that appears in the WinBoard startup dialog. It consists of a list of strings, one per line. If the option value starts with an @ sign, it is the name of a file that contains the strings. When you select a string from the drop-down list, WinBoard prepen ++ds the text \rdblquote /cp /secondChessProgram=\rdblquote and adds the result to the command-line options. + \par + \par There is no graphical user interface to set this option. To change it, edit your }{\f1\uldb settings}{\v\f1 settings}{\f1 file with a plain text editor such as Notepad. Example: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {/secondChessProgramNames=\{GNUChess\line WCrafty-15_11 /sd="C:\\\\Program Files\\\\Crafty\\"\line ArasanX /sd="C:\\Program Files\\ + Arasan\\Arasan 4.1"\line "EXchess xb" /sd=C:\\EXchess\line Comet-WB /sd=C:\\Comet\line \}}{\f1 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xy coordinates of board}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xy}}}{\f1 /x=}{\i\f1 xcoord }{\f1 /y=}{\i\f1 ycoord + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location of the board window, giving the screen coordinates of the upper left-hand corner. Both arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Analysis window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /analysisX=}{\i\f1 xcoord }{\f1 /analysisY=}{\i\f1 ycoord}{\f1 /analysisW=}{ + \i\f1 width}{\f1 /analysisH=}{\i\f1 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size - of the Analysis window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size of the Analysis window, giving the screen coordinates of the u ++pper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Comment window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /commentX=}{\i\f1 xcoord }{\f1 /commentY=}{\i\f1 ycoord}{\f1 /commentW=}{ + \i\f1 width}{\f1 /commentH=}{\i\f1 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Sets the initial location and size of the Comment window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size of the Comment window, giving the screen coordinates of ++the upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Game List window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /gameListX=}{\i\f1 xcoord }{\f1 /gameListY=}{\i\f1 ycoord}{\f1 /gameListW=}{ + \i\f1 width}{\f1 /gameListH=}{\i\f1 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Sets the initial location and size of the Game List window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size of the Game List window, giving the screen coor ++dinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of ICS Interaction window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /icsX=}{\i\f1 xcoord }{\f1 /icsY=}{\i\f1 ycoord}{\f1 /icsW=}{\i\f1 + width}{\f1 /icsH=}{\i\f1 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location an -d size of the ICS Interaction window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. -\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 - xywh coordinates of Tags window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /tagsX=}{\i\f1 xcoord }{\f1 /tagsY=}{\i\f1 ycoord}{\f1 /tagsW=}{\i\f1 width}{\f1 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size of the ICS Interaction window, giving the screen coordin ++ates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 xy ++wh coordinates of Tags window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1 /tagsX=}{\i\f1 xcoord }{\f1 /tagsY=}{\i\f1 ycoord}{\f1 /tagsW=}{\i\f1 width}{\f1 + /tagsH=}{\i\f1 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Sets the initial location and size of the Tags window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Sets the initial location and size of the Tags window, giving the screen coordinates of th ++e upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Move History window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1\cf6 /moveHistoryX=}{\i\f1\cf6 xcoord }{\f1\cf6 moveHistoryY=}{\i\f1\cf6 + ycoord}{\f1\cf6 /moveHistoryW=}{\i\f1\cf6 width}{\f1\cf6 /moveHistoryH=}{\i\f1\cf6 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -Sets the initial location and size of the move-history window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the initial location and size of the move-history window, giving the ++ screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Evaluation Graph window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1\cf6 /evalGraphX=}{\i\f1\cf6 xcoord }{\f1\cf6 /evalGraphY=}{\i\f1\cf6 + ycoord}{\f1\cf6 /evalGraphW=}{\i\f1\cf6 width}{\f1\cf6 /evalGraphH=}{\i\f1\cf6 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -Sets the initial location and size of the evaluation-graph window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the initial location and size of the evaluation-gr ++aph window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 + xywh coordinates of Engine Output window}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 xywh}}}{\f1\cf6 /engineOutputX=}{\i\f1\cf6 xcoord }{\f1\cf6 /engineOutputY=}{ + \i\f1\cf6 ycoord}{\f1\cf6 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\f1\cf6 /engineOutputW=}{\i\f1\cf6 width}{\f1\cf6 /engineOutputH=}{\i\f1\cf6 height -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -Sets the initial location and size of the engine-output window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Sets the initial l ++ocation and size of the engine-output window, giving the screen coordinates of the upper left-hand corner, the width, and the height. All four arguments must be given together. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + engineOutputUp}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Window Up}}}{\f1\cf6 /engineOutputUp }{\i\f1\cf6 true|false + \par }\pard \s2\li119\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 evalGraphUp}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Window Up}}}{\f1\cf6 /evalGraphUp }{\i\f1\cf6 true|false}{\f1\cf6 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 moveHistoryUp}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 Window Up}}}{\f1\cf6 /moveHistoryUp }{\i\f1\cf6 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If set to True, the corresponding window is displayed, if False, the window is absent. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 stickyWindows}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 stickyWindows}}}{\f1\cf6 /stickyWindows }{\i\f1\cf6 true|false + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Not an album of the Rolling stones. + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + autoDisplayComments}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 autoDisplayComments}}}{\f1\cf6 /autoDisplayComments }{\i\f1\cf6 true|false + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 autoDisplayTags}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 autoDisplayTags}}}{\f1\cf6 /autoDisplayTags }{\i\f1\cf6 true|false -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 -If set to True, these options cause the window with the move comments, and the window with PGN tags, respectively, to pop up automatically when such tags or comments are encountered during the replaying a stored or loaded game. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If set to True, these options cause ++the window with the move comments, and the window with PGN tags, respectively, to pop up automatically when such tags or comments are encountered during the replaying a stored or loaded game. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\cf6\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 Adjudication Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 }{\f1\cf6 Adjudication Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 AdjudicationOptions}}}{ + \b0\f1\fs18\cf6\up6 }{\f1\fs20\cf6 Adjudication Options + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 adjudicateLossThreshold}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 adjudicateLossThreshold}{\f1 }}}{\f1\cf6 /adjudicateLossThreshold }{\i\f1\cf6 + scorethreshold}{\f1\cf6 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If the -given value is non-zero, WinBoard adjudicates the game as a loss if both engines agree for a duration of 6 consecutive ply that the score is below the given score threshold for that engine. Make sure the score is interpreted properly by WinBoard, using /f -irstScoreAbs and /secondScoreAbs if needed.}{\cf6 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 ++If the given value is non-zero, WinBoard adjudicates the game as a loss if both engines agree for a duration of 6 consecutive ply that the score is below the given score threshold for that engine. Make sure the score is interpreted properly by WinBo ++ard, using /firstScoreAbs and /secondScoreAbs if needed.}{\cf6 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 adjudicateDrawMoves}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 adjudicateDrawMoves}{\f1 }}}{\f1\cf6 /adjudicateDrawMoves }{\i\f1\cf6 number}{ + \f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 If the given value is non-zero, WinBoard adjudicates the game as a draw if after the given }{\i\f1\cf6 number}{\f1\cf6 of moves it was not yet decided. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 checkMates}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 checkMates}{\f1 }}}{\f1\cf11 /checkMates}{\i\f1\cf11 true|false}{\f1\cf11 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If this option is True, WinBoard detects all checkmates and stalemates, and ends the game as soon as they occur. Legality-testing must be on for this option to work.} + { + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 testClaims}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 testClaims}{\f1 }}}{\f1\cf11 /testClaims}{\i\f1\cf11 true|false}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -If this option is True, WinBoard verifies all result claims made by engines, and those who send false claims will forfeit the game because of it. Legality-testing must be on for this option to work.}{\cf11 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If this option is True, WinBoard verifies all result claims made by engines ++, and those who send false claims will forfeit the game because of it. Legality-testing must be on for this option to work.}{\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 materialDraws}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 materialDraws}{\f1 }}}{\f1\cf11 /materialDraws}{\i\f1\cf11 true|false}{\f1\cf11 + -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -If this option is True, WinBoard adjudicates games as draws when there is no sufficient material left to create a checkmate. This applies to KBKB with like bishops, and to KBK, KNK and KK. Legality-testing must be on for this option to work.}{\cf11 - ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If this option is True, WinBoard adjudicates games as draws when there is no sufficient material left t ++o create a checkmate. This applies to KBKB with like bishops, and to KBK, KNK and KK. Legality-testing must be on for this option to work.}{\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 trivialDraws}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 trivialDraws}{\f1 }}}{\f1\cf11 /trivialDraws}{\i\f1\cf11 true|false}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -If this option is True, WinBoard adjudicates games as draws that cannot be usualy won without opponent assistance. This applies to KBKB with unlike bishops, and to KBKN, KNKN, KNNK, KRKR an -d KQKQ. The draw is called after 6 ply into these end-games, to allow quick mates that can occur in some positions. KQKQ does not really belong in this category, and might be taken out in the future. (When bitbase-based adjudications are implemented.) Leg -ality-testing must be on for this option to work.}{\cf11 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If this option is True, WinBoard adjudicates games as draws that cannot be usualy won wit ++hout opponent assistance. This applies to KBKB with unlike bishops, and to KBKN, KNKN, KNNK, KRKR and KQKQ. The draw is called after 6 ply into these end-games, to allow quick mates that can occur in some positions. KQKQ does not really belong in this cat ++egory, and might be taken out in the future. (When bitbase-based adjudications are implemented.) Legality-testing must be on for this option to work.}{\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 ruleMoves}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 ruleMoves}{\f1 }}}{\f1\cf11 /ruleMoves }{\i\f1\cf11 number}{\f1\cf11 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If the given value is non-zero, WinBoard adjudicates the game as a draw after the given }{\i\f1\cf11 number}{\f1\cf11 + of consecutive reversible moves. Engines can claim draws after 50 moves, irrespective of the value of }{\i\f1\cf11 number}{\f1\cf11 .}{\cf11 + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 repeatsToDraw}{\f1 }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 repeatsToDraw}{\f1 }}}{\f1\cf11 /repeatsToDraw }{\i\f1\cf11 number}{\f1\cf11 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 If the given value is non-zero, WinBoard adjudicates the game as a draw if a position is repeated the given }{\i\f1\cf11 number}{\f1\cf11 + of times. Engines can claim draws after 3 repeats, (on the 3rd occurrence, actually), irrespective of the value of }{\i\f1\cf11 number}{\f1\cf11 + . Beware that positions that have different castling or en-passant rights do not count as repeats, WinBoard is fully e.p. and castling aware!}{\cf11 + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20\cf11 \page }{\cs58\f1\fs20\super +{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super +}{\f1 main}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Other Options}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Other Options}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 OtherOptions}}}{\b0\f1\fs18\up6 }{\f1\fs20 Other Options + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ncp }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ncp }}}{\f1 /ncp}{\b0\f1 or }{\f1 /xncp}{\b0\f1 ,}{\f1 }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain + \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 noChessProgram}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 noChessProgram}}}{ + \f1 /noChessProgram}{\i\f1 true|false}{\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + If this option is True, WinBoard acts as a passive chessboard; it does not start a chess program or connect to ICS. This option also sets clockMode to False. Default: False. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 mode}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 mode}}}{\f1 /mode}{\b0\f1 or }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 initialMode}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 initialMode}}}{\f1 /initialMode }{\i\f1 modename + + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If this option is given, WinBoard selects the given }{\i\f1 modename}{\f1 from the }{\f1\uldb Mode menu}{\v\f1 ModeMenu }{\f1 -after starting and (if applicable) processing the }{\f1\uldb loadGameFile}{\v\f1 loadGameFile }{\f1 or }{\f1\uldb loadPositionFile}{\v\f1 loadPositionFile }{\f1 option. Default: "". Other supported values are TwoMachin -es, AnalyzeFile, Analysis, MachineWhite, MachineBlack, EditGame, EditPosition, and Training. ++after starting and (if applicable) processing the }{\f1\uldb loadGameFile}{\v\f1 loadGameFile }{\f1 or }{\f1\uldb loadPositionFile}{\v\f1 loadPositionFile }{\f1 option. Default: "". ++Other supported values are TwoMachines, AnalyzeFile, Analysis, MachineWhite, MachineBlack, EditGame, EditPosition, and Training. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 variant}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 variant}}}{\f1 /variant}{\b0\f1 }{\i\f1 varname}{\f1 -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Activates preliminary, partial support for playing chess variants against a local engine or editing variant games. This fl -ag is not needed in ICS mode. Recognized variant names are: ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {Activates preliminary, partial support for playing chess variants against a local engine or editing varian ++t games. This flag is not needed in ICS mode. Recognized variant names are: + \par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {normal\tab \tab Normal chess\line wildcastle\tab Shuffle chess, king can castle from d file\line nocastle\tab Shuffle chess, no castling allowed\line fischerandom\tab + Fischer Random shuffle chess\line bughouse\tab Bughouse, ICC/FICS rules\line crazyhouse\tab Crazyhouse, ICC/FICS rules\line losers \tab Lose all pieces or get mated (ICC wild 17)\line suicide\tab Lose all pieces including king (FICS)\line giveaway\tab + Try to have no legal moves (ICC wild 26)\line twokings\tab Weird ICC wild 9\line kriegspiel\tab Opponent's pieces are invisible\line atomic \tab Capturing piece explodes (ICC wild 27)\line 3check\tab Win by giving check 3 times (ICC wild 25) + \par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {xiangqi\tab Chinese Chess (on a 9x10 board)\line shogi\tab \tab Japanese Chess (on a 9x9 board, with piece drops) \line capablanca\tab + Capablanca Chess (10x8 board, with Archbishop and Chancellor pieces)\line gothic\tab \tab similar, with a better initial position\line caparandom\tab An FRC-like version of Capablanca Chess (10x8 board) \line janus\tab \tab + A game with two Archbishops (10x8 board)\line shatranj\tab Ancient Arabic Chess, with Elephants and General replacing B and Q.\line courier\tab Medieval intermedite between shatranj and modern Chess (on 12x8 board) \line falcon\tab \tab + A patented Chess variant with two Falcon pieces (10x8) board \line berolina\tab Pawns capture straight ahead, and move diagonal (legality testing off!)\line cylinder\tab Pieces wrap around the board, as if it were a cylinder (legality testing off!) \line + fairy\tab \tab A variant in which all pieces known to WinBoard can participate\line knightmate\tab King moves a Knight, and vice versa + \par In the shuffle variants, WinBoard does now shuffle the pieces, although you can still do it by hand using Edit Position. }{\cf0 Some variants are supported only in ICS mode, including bughouse, and kriegspiel.}{ }{\cf0 -The winning/drawing conditions in crazyhouse (offboard interposition on mate), losers, suicide, giveaway, atomic, and 3check are not fully understood. In crazyhouse,}{ WinBoard now does keep track of offboard pieces.I -n shatranj it does implement the baring rule when mate detection is switched on. ++The winning/drawing conditions in crazyhouse (offboard interposition on mate), losers, suicide, giveaway, atomic, and 3check are not fully understood. In crazyhouse,}{ ++ WinBoard now does keep track of offboard pieces.In shatranj it does implement the baring rule when mate detection is switched on. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 boardHeight}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 boardHeight}}}{\f1\cf11 /boardHeight }{\i\f1\cf11 height}{\f1\cf11 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Allows you to set a non-standard number of board ranks in any variant. If the height is given as \lquote -1\rquote , the default height for the variant is used. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 boardWidth}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 boardWidth}}}{\f1\cf11 /boardWidth }{\i\f1\cf11 width}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Allows you to set a non-standard number of board files in any variant. If the width is given as \lquote -1\rquote , the default width for the variant is used. Widt -h a non-standard width, the initial position will always be an empty board, as the usual opening array will not fit. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Allows you to set a non-standard number of board files in any variant. If the width is given as \lquote -1\rquote , the default width for the variant ++is used. Width a non-standard width, the initial position will always be an empty board, as the usual opening array will not fit. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 holdingsSize}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 holdingsSize}}}{\f1\cf11 /holdingsSize }{\i\f1\cf11 size}{\f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Allows you to set a non-standard size for the holdings in any variant. If the size is given as \lquote -1\rquote -, the default holdings size for the variant is used. The first }{\i\f1\cf11 size}{\f1\cf11 piece types will go into the holdings on capture, and you will be able to drop them on the board in stead of making a normal move. If }{\i\f1\cf11 size}{\f1\cf11 ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Allows you to set a non-standard size for the holdings in any variant. If the size is given as \lquote -1\rquote , the ++ default holdings size for the variant is used. The first }{\i\f1\cf11 size}{\f1\cf11 piece types will go into the holdings on capture, and you will be able to drop them on the board in stead of making a normal move. If }{\i\f1\cf11 size}{\f1\cf11 + equals 0, there will be no holdings. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf6 defaultFrcPosition}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 defaultFrcPosition}}}{\f1\cf6 /defaultFrcPosition }{\i\f1\cf6 number}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 Specifies the number of the opening position in shuffle games like FRC. A value of \lquote -1\rquote means the position is randomly generated by WinBoard. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 pieceToSquareTable}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 pieceToSquareTable}}}{\f1\cf11 /pieceToSquareTable }{\i\f1\cf11 characterstring}{ + \f1\cf11 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 -The characters that are used to represent the piece types WinBoard knows in FEN diagrams and SAN moves. The string argument has to have an even length (or it will be ignored), as white and black pieces have to be give -n separately (in that order). The last letter for each color will be the King. The letters before that will be PNBRQ and then a whole host of fairy pieces in an order that has not fully crystallized yet (currently FEACWMOHIJGDVSLU, F=Ferz, Elephant, A=Arc -h -bishop, C=Chancellor, W=Wazir, M=Commoner, O=Cannon, H=Nightrider). You should list at least all pieces that occur in the variant you are playing. If you have less than 44 characters in the string, the pieces not mentioned will get assigned a period, and -you will not be able to distinguish them in FENs. You can also explicitly assign pieces a period, in which case they will not be counted in deciding which captured pieces can go into the holdings. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 A tilde as a piece name does mean this piece is used to repr -esent a promoted Pawn in Crazyhouse-like games, i.e. on capture it turns back onto a Pawn. A + similarly indicate the piece is a Shogi-style promoted piece, that should revert to its non-promoted version on capture (rather than to a Pawn). ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 The characters that are used to represent the piece types WinB ++oard knows in FEN diagrams and SAN moves. The string argument has to have an even length (or it will be ignored), as white and black pieces have to be given separately (in that order). The last letter for each color will be the King. The letters before th ++a ++t will be PNBRQ and then a whole host of fairy pieces in an order that has not fully crystallized yet (currently FEACWMOHIJGDVSLU, F=Ferz, Elephant, A=Archbishop, C=Chancellor, W=Wazir, M=Commoner, O=Cannon, H=Nightrider). You should list at least all pie ++c ++es that occur in the variant you are playing. If you have less than 44 characters in the string, the pieces not mentioned will get assigned a period, and you will not be able to distinguish them in FENs. You can also explicitly assign pieces a period, in ++which case they will not be counted in deciding which captured pieces can go into the holdings. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cf11 A tilde as a piece name does mean this piece is used to represent a promoted Pawn in Crazyhouse-like games, i.e. on capture it turns back onto a Pawn. A + simila ++rly indicate the piece is a Shogi-style promoted piece, that should revert to its non-promoted version on capture (rather than to a Pawn). + \par Note that promoted pieces are represented by pieces 11 further in the list. + \par You should not have to use this option often: each variant has its own default setting for the piece representation in FEN, which should be sufficient in normal use. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 rsh }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 rsh }}}{\f1 /rsh }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 remoteShell }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 remoteShell }}}{\f1 /remoteShell }{\i\f1 shellname} + {\f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Name of the command used to run programs remotely. If this option is not given, WinBoard}{\i\f1 }{\f1 uses its own built-in implementation of the Unix }{\i\f1 rcmd}{\f1 + protocol (the protocol used by }{\i\f1 rsh}{\f1 ). + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ruser }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ruser }}}{\f1 /ruser }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 remoteUser }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 remoteUser }}}{\f1 /remoteUser }{\i\f1 username}{ + \f1 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 User name on the remote system when running programs with the remoteShell. The default is your local user name. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf11\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{ + \f1\cf11 userName}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf11 userName}}}{\f1\cf11 /userName }{\i\f1\cf11 username}{\f1\cf11 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Name under which the Human player will be listed in the PGN file. (Default is the login name on your local computer.) + \par }\pard\plain \s2\li119\sb120\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 + delayBeforeQuit}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 delayBeforeQuit}}}{\f1\cf6 /delayBeforeQuit }{\i\f1\cf6 number}{\f1\cf6 + \par }\pard \s2\li119\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright {\cs58\f1\cf6\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 }{\f1\cf6 delayAfterQuit}}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 }{\f1\cf6 delayAfterQuit}}}{\f1\cf6 /delayAfterQuit }{\i\f1\cf6 number}{\f1\cf6 + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf6 These options specify how long WinBoard has to wait before sending a termination signal to rogue engine processes, that do not want to react to the \lquote quit\rquote + command. The second one determines the pause after killing the engine, to make sure it dies. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ini }}# + {\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ini }}}{\f1 /ini }{\b0\f1 or}{\f1 }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 settingsFile }}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 settingsFile }}}{\f1 /settingsFile }{\i\f1 + filename\line }{\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 at sign}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super #}{\f1 atsign }}}{\f1 @ }{\i\f1 file-name + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 See }{\f1\uldb Settings}{\v\f1 Settings}{\f1 . + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Initialization files}}K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Files}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Files}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Files}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 INITIALIZATION FILES + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 Settings } + }}{\f1\fs18\up6 }{\cs58\f1\super #{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Settings }}}{\f1 Settings + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {When WinBoard starts up, it reads option settings from a file named }{\i WinBoard.ini }{ -in its installation directory (the directory containing WinBoard.exe). Options in this file have the same format as }{\uldb command line options}{\v Options}{, except that they do not all ha -ve to be on a single line. You can put a comment in a settings file by preceding it with a semicolon (}{\f2 ;}{). ++in its installation directory (the directory containing WinBoard.exe). Options in this file have the same format as }{\uldb command line options}{\v Options}{, except t ++hat they do not all have to be on a single line. You can put a comment in a settings file by preceding it with a semicolon (}{\f2 ;}{). + \par The WinBoard.ini file is read before the command line is processed, so any options you give on the command line override options in the file. + \par }{\f1 If WinBoard encounters a /}{\f1\uldb settingsFile}{\v\f1 settingsFile}{\f1 }{\i\f1 filename }{\f1 or }{\f1\uldb @}{\v\f1 atsign}{\i\f1 filename }{\f1 + option while reading settings (whether from the command line or a file), it reads more settings from the given file before reading the next option. + \par The }{\f1\uldb Save Settings Now}{\v\f1 SaveSettings}{\f1 menu command writes the current values of most options to a file. In addition, settings are saved automatically when WinBoard exits if }{\f1\uldb Save Settings on Exit}{\v\f1 SaveSettingsOnExit}{ + \f1 is checked. The settings are written to the last file named in a /settingsFile command, if any; otherwise to WinBoard.ini}{\i\f1 .}{\f1 The @ option does not affect which file settings are saved to. -\par Warning: Because Save Settings overwrites the last settings file (usually WinBoard.ini) and only saves a subset of WinBoard's options, you should not add -settings of more options to such a file with a text editor. If you do this, your additional options will be lost on the next Save Settings. You can change the values of existing settings freely, using Notepad or any plain text editor. Be careful not to do - this while WinBoard is running, however, unless you know that Save Settings on Exit is off. Otherwise all your changes will be overwritten and lost when WinBoard exits. -\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {\f1 Notice that tournament managers, like PSWBTM, usually call WinBoard with the option not - to save settings on exit, so that the entire tournament uses the same settings. So it does make sense to edit \lquote volatile\rquote options, such as /variant, into the settings file. ++\par Warning: Because Save Settings overwrites the last settings file (usually WinBoard.ini) and only saves a subset of WinBoard's option ++s, you should not add settings of more options to such a file with a text editor. If you do this, your additional options will be lost on the next Save Settings. You can change the values of existing settings freely, using Notepad or any plain text editor ++. Be careful not to do this while WinBoard is running, however, unless you know that Save Settings on Exit is off. Otherwise all your changes will be overwritten and lost when WinBoard exits. ++\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {\f1 Notice that tournament managers, like PSWBTM, usually call WinBoa ++rd with the option not to save settings on exit, so that the entire tournament uses the same settings. So it does make sense to edit \lquote volatile\rquote options, such as /variant, into the settings file. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\cs58\f1\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super K}{\f1 ICS Logon} + }#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 ICSLogon}}}{\f1 ICS Logon + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Whenever WinBoard connects to the Internet Chess Server, if it finds a file called }{\i\f1 ICS.ini }{\f1 in its installation directory}{\i\f1 ,}{\f1 + it feeds the file's contents to the ICS as commands. Usually the first two lines of the file should be your ICS user name and password. You can specify a different name instead of }{\i\f1 ICS.ini}{\f1 by using the }{\f1\uldb icslogon}{\v\f1 icslogon}{ + \f1 command line option. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Installing Chess Engines}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Installing Chess Engines}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0 + \nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 InstallingChessEngines}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs20 INSTALLING CHESS ENGINES + + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\f1 Introduction -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard is capable of operating with many differe -nt chess engines. You can play chess against a compatible engine, set up matches between two engines, or (advanced users only) run an automated computer player on an ICS. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Typically, the main difficulty in installing a new chess engine for use by WinBoard c -omes in getting the engine itself running and setting its options appropriately. The connection to WinBoard is relatively straightforward. -\par WinBoard-compatible chess engines are Win32 command line programs that you can run by hand in an MS-DOS Prompt box an -d type human-readable commands to. WinBoard connects to an engine simply by starting the engine up in the background and communicating with it through a pair of pipes. Therefore the basic procedure for installing an engine is: -\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 1. Get a copy of the engine and any supporting files it needs. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard is capable of operating with many different chess engines. You can play chess against a compatible engine, set up matches between two engines, or ++(advanced users only) run an automated computer player on an ICS. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -2. Install and configure the engine as a command-line program by following the instructions that come with it. Try it out by running it from the command line in an MS-DOS Prompt box and make sure it works. ++Typically, the main difficulty in installing a new chess engine for use by WinBoard comes in getting the engine itself running and setting its options appropriately. The connection to WinBoard is relatively straightforward. ++\par WinBoard-compatible chess engines are Win32 command line programs that you can run by hand in an MS-DOS Prompt box and type human-readable commands to. WinBoard connects to an engine simply by starting the engine up in the ++ background and communicating with it through a pair of pipes. Therefore the basic procedure for installing an engine is: ++\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 1. Get a copy of the engine and any supporting files it needs. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 2. Install and configure the engine as a command-line program by follow ++ing the instructions that come with it. Try it out by running it from the command line in an MS-DOS Prompt box and make sure it works. + \par 3. Optional, but recommended: Try out the WinBoard plus engine combination by running WinBoard with the proper command line arguments in an MS-DOS Prompt box. + \par 4. Create a shortcut on your desktop or Start menu to run the engine with WinBoard. + \par 5. Optionally edit your WinBoard.ini file to add the engine to the drop-down lists on WinBoard's startup dialog. + \par This document cannot explain steps 1 and 2 in detail for all engines, but we will take you through all five steps in outline, using Crafty as an example. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\f1 Example: Crafty -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 1. Choose a directory to put Crafty in. We'll use }{\f2 C:\\Program Files\\Crafty}{\f1 - in this example. Download your copy of Crafty into this directory from its author's FTP site, }{\f2 ftp://ftp.cis.uab.edu/pub/hyatt}{\f1 . At this writing, you will need at least the following files: ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 1. Choose a directory to put Crafty in. We'll use }{\f2 C:\\Program Files\\Crafty}{\f1 in this example. Download your co ++py of Crafty into this directory from its author's FTP site, }{\f2 ftp://ftp.cis.uab.edu/pub/hyatt}{\f1 . At this writing, you will need at least the following files: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 read.me\line v15/crafty.doc\line v15/crafty.faq\line v15/wcrafty-15.*.exe}{\f1\fs20 + (where * is replaced by the largest number there)\line }{\f2\fs20 common/start.zip}{\fs20 \line }{\f2\fs20 common/medium.zip}{\fs20 }{\f1\fs20 (or another book). -\par }\pard\plain \s16\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 2. The first three files are documentation that you can read with - a text editor. Read the read.me file first and follow the instructions carefully. This will take some time. Do not write to the author of WinBoard if you have trouble with the instructions in the Crafty read.me. Try running Crafty from an MS-DOS Prompt b -ox and make sure it works before you go on. ++\par }\pard\plain \s16\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++2. The first three files are documentation that you can read with a text editor. Read the read.me file first and follow the instructions carefully. This will take some time. Do not write to the ++author of WinBoard if you have trouble with the instructions in the Crafty read.me. Try running Crafty from an MS-DOS Prompt box and make sure it works before you go on. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 3. Optional, but recommended: In an MS-DOS Prompt box,}{ }{\f2 cd }{\f1 to the directory where WinBoard is installed, typically }{\f2 "C:\\Program Files\\WinBoard"}{\f1 + . Then type the following command line. Use the actual name of the wcrafty file you downloaded, not an }{\f2 *}{\f1 , and if your browser changed the first period to an underscore when you downloaded the file, make that change in the command line too. + + \par }\pard\plain \s63\fi-720\li1440\sb80\sl-240\slmult0\nowidctlpar\adjustright \f2\fs20\cgrid {WinBoard /cp /fcp=WCrafty-15.* /fd="C:\\Program Files\\Crafty" /scp=WCrafty-15.* /sd="C:\\Program Files\\Crafty" + \par }\pard\plain \s16\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard should start up, with Crafty running as its chess engine. Check that you can play chess against Crafty. -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 4. To make a shortcut or Start menu entry for Crafty: Right-click on the desktop and select New/Shortcut. Use the Browse b -utton to find your winboard.exe file and get its name into the Command Line box. (It usually will be "C:\\Program Files\\WinBoard\\ -winboard.exe".) Click in the Command Line box and hit the End key to go to the end. Add the following to the end of the command line, }{\i\f1 after}{\f1 the closing quotation mark. Use the actual name of the wcrafty file you downloaded, not an }{\f2 *}{ ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++4. To make a shortcut or Start menu entry for Crafty: Right-click on the desktop and select New/Shortcut. Use the Browse button to find your winboard.exe file and get its name into the Command Line box. (It usually will be "C:\\Program Files\\WinBoard\\w ++inboard.exe".) Click in the Command Line box and hit the End key to go to the end. Add the following to the end of the command line, }{\i\f1 after}{\f1 the closing quotation mark. Use the actual name of the wcrafty file you downloaded, not an }{\f2 *}{ + \f1 , and if your browser changed the first period to an underscore when you downloaded the file, make that change in the command line too. + \par }\pard\plain \s63\fi-720\li1440\sb80\sl-240\slmult0\nowidctlpar\adjustright \f2\fs20\cgrid {/cp /fcp=WCrafty-15.* /fd="C:\\Program Files\\Crafty" \line /scp=WCrafty-15.* /sd="C:\\Program Files\\Crafty" -\par }\pard\plain \s62\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 -Press Next, choose a name for the shortcut, and press Finish. You can now use this shortcut to run WinBoard with Crafty. Double-click it to check that it works. You can drag or copy the shortcut into your Start menu if you like. ++\par }\pard\plain \s62\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Press Next, choose a name for the shortcut, ++and press Finish. You can now use this shortcut to run WinBoard with Crafty. Double-click it to check that it works. You can drag or copy the shortcut into your Start menu if you like. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 5. To add Crafty as an option in the WinBoard Startup dialog, edit your }{\f1\uldb WinBoard.ini file}{\v\f1 Settings}{\f1 + with Notepad or another plain text editor, carefully following the example shown under }{\f1\uldb /firstChessProgramNames}{\v\f1 firstChessProgramNames}{\f1 above. + \par }\pard\plain \s2\li120\sb120\sa60\sl-240\slmult0\nowidctlpar\outlinelevel1\adjustright \b\f5\fs20\cgrid {\f1 For more information + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 If you would like to run an automated computer player on the ICS, see the separate file }{\f2 zippy.README}{\f1 -. If you would like to write your own engine to interface to WinBoard, see the separate file }{\f2 engine-intf.html}{\f1 -, and join the mailing list mentioned there. Both files are included in the WinBoard distribution. You might also want to get the source code for WinBoard. It is available from the author's Web page, http://www.tim-mann.org/chess.html}{\f2 .}{\f1 ++. If you would like to write your own engine to interface to WinBoard, see the separate file }{\f2 engine-intf.html}{\f1 , and join the mailing list mentioned there. Both files are included in the WinBoard distribution. You might also w ++ant to get the source code for WinBoard. It is available from the author's Web page, http://www.tim-mann.org/chess.html}{\f2 .}{\f1 + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Firewalls}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Firewalls}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Firewalls}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs18\up6 }{\f1\fs20 FIREWALLS -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 By default, "WinBoard /ics"}{\i\f1 }{\f1 communicates with an Internet Chess Server by opening a TCP socket directly from the machine it is runni -ng on to the ICS. If there is a firewall between your machine and the ICS, this won't work. Here are some recipes for getting around common kinds of firewalls using special options to WinBoard}{\i\f1 .}{\f1 Important: See the paragraph in the }{\f1\uldb -LIMITATIONS}{\v\f1 LIMITATIONS}{\f1 section below about extra echoes. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 By default, "WinBoard /ics"}{\i\f1 }{\f1 communicates with an Internet Chess Server by opening a TCP socket directly from the machin ++e it is running on to the ICS. If there is a firewall between your machine and the ICS, this won't work. Here are some recipes for getting around common kinds of firewalls using special options to WinBoard}{\i\f1 .}{\f1 ++ Important: See the paragraph in the }{\f1\uldb LIMITATIONS}{\v\f1 LIMITATIONS}{\f1 section below about extra echoes. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 + Suppose that you can't telnet directly to ICS, but you can telnet to a firewall host, log in, and then telnet from there to ICS. Let's say the firewall is called fire.wall.com. Set command-line options as follows: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 WinBoard -ics -icshost fire.wall.com -icsport 23 + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Then when you run WinBoard}{\i\f1 }{\f1 -in ICS mode, you will be prompted to log in to the firewall host. (This works because port 23 is the standard telnet login service.) Do so, then telnet to ICS, using a command like "telnet c -hessclub.com 5000", or whatever command the firewall provides for telnetting to port 5000. -\par If your firewall lets you telnet (or rlogin) to remote hosts, but doesn't let you telnet to port 5000, you will have to find some other host outside the firewall tha -t does let you do this, and hop through it. For instance, suppose you have an account at foo.edu. Follow the recipe above, but instead of typing "telnet chessclub.com 5000" to the firewall, type "telnet foo.edu" (or "rlogin foo.edu"), log in there, and th -en type "telnet chessclub.com 5000". ++in ICS mode, you will be prompted to log in to the firewall host. (This works because port 23 is the standard telnet login service.) Do so, then telnet to ICS, using a command l ++ike "telnet chessclub.com 5000", or whatever command the firewall provides for telnetting to port 5000. ++\par If your firewall lets you telnet (or rlogin) to remote hosts, but doesn't let you telnet to port 5000, you will have to find some other host outside the ++ firewall that does let you do this, and hop through it. For instance, suppose you have an account at foo.edu. Follow the recipe above, but instead of typing "telnet chessclub.com 5000" to the firewall, type "telnet foo.edu" (or "rlogin foo.edu"), log in ++there, and then type "telnet chessclub.com 5000". + \par Exception: chessclub.com itself lets you connect to the chess server on the default telnet port (23), which is what you get if you don\rquote t specify a port to the telnet program. But the other chess servers don\rquote t allow this. + \par Suppose that you can't telnet directly to ICS, but you can use rsh to run programs on a firewall host, and that host can telnet to ICS. Let's say the firewall is called rsh.wall.com. Set command-line options as follows: + \par }\pard\plain \s19\li520\sb60\sl-240\slmult0\keep\nowidctlpar\tx520\tx920\tx1320\tx1720\tx2120\adjustright \f6\fs16\cgrid {\f2\fs20 WinBoard -ics -gateway rsh.wall.com -icshost chessclub.com + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Then when you run WinBoard}{\i\f1 }{\f1 in ICS mode, it will connect to the ICS by using rsh to run the command "telnet chessclub.com 5000" on host rsh.wall.com. -\par ICC timestamp and FICS timeseal do not work through many}{\b\f1 }{\f1 -firewalls. You can use them only if your firewall gives a clean TCP connection with a full 8-bit wide path. If your firewall allows you to get out only by running a special telnet program, you can't use timestamp or timeseal across it. But if you -have access to a computer just outside your firewall, and you have much lower netlag when talking to that computer than to the ICS, it might be worthwhile running timestamp there. Follow the instructions above for hopping through a host outside the firewa -ll (foo.edu in the example), but run timestamp or timeseal on that host instead of telnet. -\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Suppose that you have a SOCKS firewall that requires you to go through some extra level of authentication, but after that will give you a clean 8-bit wide TCP connect -ion to the chess server. In that case, if you are using timestamp or timeseal, you need to somehow socksify it; if not, you need to socksify WinBoard itself. Socksification is beyond the scope of this document, but see the SOCKS Web site at http://www.soc -ks.nec.com/how2socksify.html. ++\par ICC timestamp and FICS timeseal do not work through many}{\b\f1 }{\f1 firewalls. Y ++ou can use them only if your firewall gives a clean TCP connection with a full 8-bit wide path. If your firewall allows you to get out only by running a special telnet program, you can't use timestamp or timeseal across it. But if you have access to a com ++p ++uter just outside your firewall, and you have much lower netlag when talking to that computer than to the ICS, it might be worthwhile running timestamp there. Follow the instructions above for hopping through a host outside the firewall (foo.edu in the ex ++ample), but run timestamp or timeseal on that host instead of telnet. ++\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 ++Suppose that you have a SOCKS firewall that requires you to go through some extra level of authentication, but after that will give you a clean 8-bit wide TCP connection to the chess serv ++er. In that case, if you are using timestamp or timeseal, you need to somehow socksify it; if not, you need to socksify WinBoard itself. Socksification is beyond the scope of this document, but see the SOCKS Web site at http://www.socks.nec.com/how2socksi ++fy.html. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Limitations}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Limitations}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Limitations}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs18\up6 }{\f1\fs20 LIMITATIONS }{\f1\fs20\cf11 + AND NON-LIMITATIONS}{\f1\fs20 -\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard}{\i\f1 }{\f1 is a Win32 application. It runs only on Windows NT and Windows 95. It does not work on Windows 3.11 or earlier, even with the Win32 -s compatibility package. ++\par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard}{\i\f1 }{\f1 ++is a Win32 application. It runs only on Windows NT and Windows 95. It does not work on Windows 3.11 or earlier, even with the Win32s compatibility package. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\i\f1 CMail, }{\f1 the companion program to xboard for playing electronic mail correspondence chess, has not been ported to Win32. + \par There is no way for two people running copies of WinBoard}{\i\f1 }{\f1 to play each other without going through the Internet Chess Server. + \par Under some circumstances, your ICS password may be echoed when you log on. -\par If you are connecting to the ICS by running telnet, timestamp, or timeseal on an Internet provider host, you may find that each line you type is echoed back an extra t -ime after you hit Enter. You can probably turn this echo off. If your Internet provider is a Unix system, type "}{\f2 stty -echo}{\f1 -" after you log in to the provider but before you run telnet, timestamp, or timeseal. In addition, you may need to type the sequence \ldblquote }{\f2 Ctrl+Q Ctrl+E Enter}{\f1 \ldblquote after you have finished logging in to ICS. On VMS, type \ldblquote } -{\f2 set terminal /noecho /nowrap}{\f1 \rdblquote , and after you telnet to the ICS, type \ldblquote }{\f2 Ctrl+Q Ctrl+] Enter set mode char Enter Enter}{\f1 \rdblquote . It is a good idea to turn off the extra remote echo if you c -an, because otherwise it can get interleaved with output from the ICS and confuse WinBoard's parsing routines. Don\rquote t just turn off }{\f1\uldb Local Line Editing}{\v\f1 localLineEditing}{\f1 - so that you see only the remote echo and not the local one; that will make the interleaving problem worse. ++\par If you are connecting to the ICS by running telnet, timestamp, or timeseal on an Internet provider host, you may find that each line you type is echoed back an extra time after you hit Enter. You can probably turn this echo off. If your ++Internet provider is a Unix system, type "}{\f2 stty -echo}{\f1 " after you log in to the provider but before you run telnet, timestamp, or timeseal. In addition, you may need to type the sequence \ldblquote }{\f2 Ctrl+Q Ctrl+E Enter}{\f1 \ldblquote ++ after you have finished logging in to ICS. On VMS, type \ldblquote }{\f2 set terminal /noecho /nowrap}{\f1 \rdblquote , and after you telnet to the ICS, type \ldblquote }{\f2 Ctrl+Q Ctrl+] Enter set mode char Enter Enter}{\f1 \rdblquote ++. It is a good idea to turn off the extra remote echo if you can, because otherwise it can get interleaved with output from the ICS and confuse WinBoard's parsing routines. Don\rquote t just turn off }{\f1\uldb Local Line Editing}{\v\f1 localLineEditing}{ ++\f1 so that you see only the remote echo and not the local one; that will make the interleaving problem worse. + \par The game parser recognizes only algebraic notation (SAN). + \par The }{\f1\uldb ICS logon}{\v\f1 ICSLogon}{\f1 file does not work properly when you connect to ICS through a Unix gateway host by setting }{\f1\uldb icsPort}{\v\f1 icsPort}{\f1 to 23. The Unix login process apparently discards type-ahead. + \par Some WinBoard functions may not work with versions of GNU Chess earlier than 4.0, patchlevel 77. The current version of WinBoard}{\i\f1 }{\f1 works best with Crafty version 15.11 or later. + \par }{\f1\cf11 Many of the following points used to be limitations in WinBoard 4.2.7 and earlier, but are now fixed: + \par The internal move legality tester in WinBoard 4.3.xx does look at the game history, and is fully aware of castling or en passant-capture rights. }{\f1 It permits castling with the king on the }{\b\f1 d}{\f1 + file because this is possible in some "wild 1" games on ICS. The piece-drop menu does not check piece drops in bughouse to see if you actually hold the piece you are trying to drop.}{\f1\cf11 + But this way of dropping pieces should be considered an obsolete feature, now that pieces can be dropped by dragging them from the holdings to the board. }{\f1 Anyway, if you would attempt an illegal move when using a chess engine or the ICS,}{\f1\cf11 + }{\f1 WinBoard will accept the error message that comes back, undo the move, and let you try another. + \par }{\f1\cf11 FEN positions saved by WinBoard}{\i\f1\cf11 }{\f1\cf11 do include correct information about whether castling or en passant are legal, and also handle the 50-move counter. -\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The mate detector does not understand that non-contact mate is not really mate in bughouse.}{\f1\cf11 }{\f1 The only pro -blem this causes while playing is minor: a "#" (mate indicator) character will show up after a non-contact mating move in the move list. WinBoard will not assume the game is over at that point,}{\f1\cf11 not even when the option Detect Mates is on. - -\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Edit Game mode al -ways uses the rules of the selected variant, which can be a variant that uses piece drops. You can load and edit games that contain piece drops. The (obsolete) piece menus are not active, but you can perform piece drops by dragging pieces from the holdin -gs. -\par Edit Position mode does not allow you to edit the Crazyhouse holdings properly. You cannot drag pieces to the holding, and using the popup menu to put pieces there does not adapt the holding counts and leads to an inconsistent state. Set up Crazyhouse p -ositions by loading / pasting a bFEN, from there you can set the holdings. ++\par }\pard\plain \s20\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The mate detector does not understand that non-contact mate is not really mate in bughouse.}{\f1\cf11 }{\f1 ++The only problem this causes while playing is minor: a "#" (mate indicator) character will show up after a non-contact mating move in the move list. WinBoard will not assume the game is over at that point,}{\f1\cf11 ++ not even when the option Detect Mates is on. ++\par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1\cf11 Edit Game mode always uses the rules of the selected variant, which can be a variant that uses piece drops. You can load and ++ edit games that contain piece drops. The (obsolete) piece menus are not active, but you can perform piece drops by dragging pieces from the holdings. ++\par Edit Position mode does not allow you to edit the Crazyhouse holdings properly. You cannot drag pieces to ++ the holding, and using the popup menu to put pieces there does not adapt the holding counts and leads to an inconsistent state. Set up Crazyhouse positions by loading / pasting a bFEN, from there you can set the holdings. + \par Fischer Random castling is fully understood. You can enter castlings by dragging the King on top of your Rook. You can probably also play Fischer Random successfully on ICS by typing castling moves into the ICS Interaction window. + \par }{\f1 Also see the ToDo file included with the distribution for many other possible bugs, limitations, and ideas for improvement that have been suggested. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Authors}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Authors}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid { + \cs58\f1\super $}{\f1 Authors}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs18\up6 }{\f1\fs20 AUTHORS AND CONTRIBUTORS + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 WinBoard is partly based on }{\i\f1 xboard}{\f1 , a chessboard program for Unix and the X Window System. Tim Mann has been responsible for all versions of WinBoard,}{ + \i\f1 }{\f1 and for xboard versions 1.3 and beyond. }{\f1\cf11 H.G.Muller is responsible for version 4.3.}{\f1 -\par Mark Williams added many features to WinBoard 4.1.0, including copy/paste, premove, icsAlarm, autoFlipView, training mode, auto raise, and blindfold. Hugh Fischer added piece animation to xboard, and Henrik Gram added it to WinBoard. Frank McIngvale con -tributed many xboard}{\i\f1 }{\f1 user interface improvements and improved Crafty support. Jochen Wiedmann ported xboard}{\i\f1 }{\f1 to the Amiga, creating }{\i\f1 AmyBoard}{\f1 -, and converted the documentation to texinfo. Elmar Bartel contributed the new piece bitmaps for version 3.2. Evan Welsh wrote }{\i\f1 CMail. }{\f1 ++\par Mark Williams added many features to WinBoard 4.1.0, including copy/paste, premove, icsAlarm, autoFlipView, training mode, auto raise, and blindfold. Hugh F ++ischer added piece animation to xboard, and Henrik Gram added it to WinBoard. Frank McIngvale contributed many xboard}{\i\f1 }{\f1 user interface improvements and improved Crafty support. Jochen Wiedmann ported xboard}{\i\f1 }{\f1 ++to the Amiga, creating }{\i\f1 AmyBoard}{\f1 , and converted the documentation to texinfo. Elmar Bartel contributed the new piece bitmaps for version 3.2. Evan Welsh wrote }{\i\f1 CMail. }{\f1 + John Chanak contributed the initial implementation of ICS mode. The default color scheme was adapted from Wayne Christopher's }{\i\f1 XChess }{\f1 program. Chris Sears and Dan Sears wrote the original xboard}{\i\f1 . }{\f1 They were responsible for xboard -}{\i\f1 }{\f1 versions 1.0 through 1.2. }{\f1\cf6 -Allessandro Scotti added many elements to the user interface, including the board textures and font-based rendering, the evaluation-graph, move-history and engine-output window. He was also responsible for adding the UCI support.}{\f1 }{\f1\cf11 -H.G. Muller - made WinBoard castling- and e.p.-aware, added variant support with adjustable board sizes, the Crazyhouse holdings, and the fairy pieces. In addition he added most of the adjudication options, made WinBoard ore robust in dealing with buggy and crashing e -ngines, and extended time control with a time-odds and node-count-based modes.}{\f1 ++}{\i\f1 }{\f1 versions 1.0 through 1.2. }{\f1\cf6 Allessandro Scotti added many elements to the user interface, including the board textures and font-based rendering, the evaluation-graph, move- ++history and engine-output window. He was also responsible for adding the UCI support.}{\f1 }{\f1\cf11 ++H.G. Muller made WinBoard castling- and e.p.-aware, added variant support with adjustable board sizes, the Crazyhouse holdings, and the fairy pieces. In addition he added ++ most of the adjudication options, made WinBoard ore robust in dealing with buggy and crashing engines, and extended time control with a time-odds and node-count-based modes.}{\f1 + \par Send bug reports to . Please run WinBoard with the /debug option and include the output from the resulting WinBoard.debug file in your message. -\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {\f1 The WinBoard 4 -.3.xx line is being developed by H.G. Muller independently of the GNU Savannah xboard project. Bug reports on this version, and suggestions for improvements and additions, are best posted in the WinBoard forum, development section (http://www.open-aurec.c -om/wbforum). ++\par }\pard\plain \s66\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cf11\cgrid {\f1 ++The WinBoard 4.3.xx line is being developed by H.G. Muller independently of the GNU Savannah xboard project. Bug reports on this version, and suggestions for improvements an ++d additions, are best posted in the WinBoard forum, development section (http://www.open-aurec.com/wbforum). ++\par }{\f1\cf2 Arun Persaud worked with H.G. Muller to combine all the features of the never-released WinBoard 4.2.8 of the Savannah project (mainly by Daniel Meh ++rmann), and the never-released 4.3.16 into a unified WinBoard 4.4, which is now available both from the Savannah web site and the WinBoard forum. + \par }\pard\plain \s1\li120\sb280\sa120\sl-320\slmult0\nowidctlpar\outlinelevel0\adjustright \b\f5\cgrid {\f1\fs20 \page }{\cs58\f1\fs20\super K{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super + K}{\f1 Copyright}}#{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super #}{\f1 Copyright}}${\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright + \f5\fs20\cgrid {\cs58\f1\super $}{\f1 Copyright}}+{\footnote\ftnalt \pard\plain \s57\li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\cs58\f1\super +}{\f1 main}}}{\f1\fs18\up6 }{\f1\fs20 COPYRIGHT + \par }\pard\plain \s26\li120\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. \line Enhancements Copyright 1992-2003 Free Software Foundation, Inc. + \par }\pard\plain \li120\sb80\sl-240\slmult0\nowidctlpar\adjustright \f5\fs20\cgrid {\f1 The following terms apply to Digital Equipment Corporation's copyright interest in WinBoard: + \par All Rights Reserved -\par Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided - that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the - software without specific, written prior permission. -\par DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENT -IAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++\par Permission to use, copy, modify, and distribute this software and its documentation for any purpose ++ and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or ++ publicity pertaining to distribution of the software without specific, written prior permission. ++\par DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LI ++ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMAN ++CE OF THIS SOFTWARE. + \par The following terms apply to the enhanced version of WinBoard distributed by the Free Software Foundation: + \par 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 of the License, or (at your option) any later version. + \par 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. + \par You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \par }} diff --cc xboard.c index 3698728,54c457e..1f17046 --- a/xboard.c +++ b/xboard.c @@@ -1,8597 -1,9095 +1,9217 @@@ - /* - * xboard.c -- X front end for XBoard - * $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - * - * See the file ChangeLog for a revision history. - */ - - #include "config.h" - - #include - #include - #include - #include - #include - #include - #include - - #if !OMIT_SOCKETS - # if HAVE_SYS_SOCKET_H - # include - # include - # include - # else /* not HAVE_SYS_SOCKET_H */ - # if HAVE_LAN_SOCKET_H - # include - # include - # include - # else /* not HAVE_LAN_SOCKET_H */ - # define OMIT_SOCKETS 1 - # endif /* not HAVE_LAN_SOCKET_H */ - # endif /* not HAVE_SYS_SOCKET_H */ - #endif /* !OMIT_SOCKETS */ - - #if STDC_HEADERS - # include - # include - #else /* not STDC_HEADERS */ - extern char *getenv(); - # if HAVE_STRING_H - # include - # else /* not HAVE_STRING_H */ - # include - # endif /* not HAVE_STRING_H */ - #endif /* not STDC_HEADERS */ - - #if HAVE_SYS_FCNTL_H - # include - #else /* not HAVE_SYS_FCNTL_H */ - # if HAVE_FCNTL_H - # include - # endif /* HAVE_FCNTL_H */ - #endif /* not HAVE_SYS_FCNTL_H */ - - #if HAVE_SYS_SYSTEMINFO_H - # include - #endif /* HAVE_SYS_SYSTEMINFO_H */ - - #if TIME_WITH_SYS_TIME - # include - # include - #else - # if HAVE_SYS_TIME_H - # include - # else - # include - # endif - #endif - - #if HAVE_UNISTD_H - # include - #endif - - #if HAVE_SYS_WAIT_H - # include - #endif - - #if HAVE_DIRENT_H - # include - # define NAMLEN(dirent) strlen((dirent)->d_name) - # define HAVE_DIR_STRUCT - #else - # define dirent direct - # define NAMLEN(dirent) (dirent)->d_namlen - # if HAVE_SYS_NDIR_H - # include - # define HAVE_DIR_STRUCT - # endif - # if HAVE_SYS_DIR_H - # include - # define HAVE_DIR_STRUCT - # endif - # if HAVE_NDIR_H - # include - # define HAVE_DIR_STRUCT - # endif - #endif - - #include - #include - #include - #include - #include - #if USE_XAW3D - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #else - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #endif - - #if HAVE_LIBXPM - #include - #include "pixmaps/pixmaps.h" - #define IMAGE_EXT "xpm" - #else - #define IMAGE_EXT "xim" - #include "bitmaps/bitmaps.h" - #endif - - #include "bitmaps/icon_white.bm" - #include "bitmaps/icon_black.bm" - #include "bitmaps/checkmark.bm" - - #include "common.h" - #include "frontend.h" - #include "backend.h" - #include "moves.h" - #include "xboard.h" - #include "childio.h" - #include "xgamelist.h" - #include "xhistory.h" - #include "xedittags.h" - #include "gettext.h" - - #ifdef __EMX__ - #ifndef HAVE_USLEEP - #define HAVE_USLEEP - #endif - #define usleep(t) _sleep2(((t)+500)/1000) - #endif - - #ifdef ENABLE_NLS - # define _(s) gettext (s) - # define N_(s) gettext_noop (s) - #else - # define _(s) (s) - # define N_(s) s - #endif - - typedef struct { - String string; - XtActionProc proc; - } MenuItem; - - typedef struct { - String name; - MenuItem *mi; - } Menu; - - int main P((int argc, char **argv)); - RETSIGTYPE CmailSigHandler P((int sig)); - RETSIGTYPE IntSigHandler P((int sig)); - void CreateGCs P((void)); - void CreateXIMPieces P((void)); - void CreateXPMPieces P((void)); - void CreatePieces P((void)); - void CreatePieceMenus P((void)); - Widget CreateMenuBar P((Menu *mb)); - Widget CreateButtonBar P ((MenuItem *mi)); - char *FindFont P((char *pattern, int targetPxlSize)); - void PieceMenuPopup P((Widget w, XEvent *event, - String *params, Cardinal *num_params)); - static void PieceMenuSelect P((Widget w, ChessSquare piece, caddr_t junk)); - static void DropMenuSelect P((Widget w, ChessSquare piece, caddr_t junk)); - void ReadBitmap P((Pixmap *pm, String name, unsigned char bits[], - u_int wreq, u_int hreq)); - void CreateGrid P((void)); - int EventToSquare P((int x, int limit)); - void DrawSquare P((int row, int column, ChessSquare piece, int do_flash)); - void EventProc P((Widget widget, caddr_t unused, XEvent *event)); - void HandleUserMove P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AnimateUserMove P((Widget w, XEvent * event, - String * params, Cardinal * nParams)); - void WhiteClock P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void BlackClock P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void DrawPositionProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void XDrawPosition P((Widget w, /*Boolean*/int repaint, - Board board)); - void CommentPopUp P((char *title, char *label)); - void CommentPopDown P((void)); - void CommentCallback P((Widget w, XtPointer client_data, - XtPointer call_data)); - void ICSInputBoxPopUp P((void)); - void ICSInputBoxPopDown P((void)); - void FileNamePopUp P((char *label, char *def, - FileProc proc, char *openMode)); - void FileNamePopDown P((void)); - void FileNameCallback P((Widget w, XtPointer client_data, - XtPointer call_data)); - void FileNameAction P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AskQuestionReplyAction P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AskQuestionProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AskQuestionPopDown P((void)); - void PromotionPopUp P((void)); - void PromotionPopDown P((void)); - void PromotionCallback P((Widget w, XtPointer client_data, - XtPointer call_data)); - void EditCommentPopDown P((void)); - void EditCommentCallback P((Widget w, XtPointer client_data, - XtPointer call_data)); - void SelectCommand P((Widget w, XtPointer client_data, XtPointer call_data)); - void ResetProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void LoadGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void LoadNextGameProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void LoadPrevGameProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void ReloadGameProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void LoadPositionProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void LoadNextPositionProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void LoadPrevPositionProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void ReloadPositionProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void CopyPositionProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PastePositionProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void CopyGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void PasteGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void SaveGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void SavePositionProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void MailMoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ReloadCmailMsgProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void QuitProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void PauseProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void MachineBlackProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void MachineWhiteProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AnalyzeModeProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AnalyzeFileProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void TwoMachinesProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void IcsClientProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void EditGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void EditPositionProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void TrainingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void EditCommentProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void IcsInputBoxProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); - void AcceptProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void DeclineProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void RematchProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void CallFlagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void DrawProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AbortProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AdjournProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ResignProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void EnterKeyProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void StopObservingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void StopExaminingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void BackwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ForwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ToStartProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ToEndProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void RevertProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void TruncateGameProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void RetractMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void MoveNowProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AlwaysQueenProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void AnimateDraggingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void AnimateMovingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void AutocommProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void AutoflagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AutoflipProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AutobsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void AutoraiseProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AutosaveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void BlindfoldProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void FlashMovesProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void FlipViewProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void GetMoveListProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void HighlightDraggingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void HighlightLastMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void MoveSoundProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void IcsAlarmProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void OldSaveStyleProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PeriodicUpdatesProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PonderNextMoveProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PopupMoveErrorsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PopupExitMessageProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void PremoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void QuietPlayProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ShowCoordsProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void ShowThinkingProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void TestLegalityProc P((Widget w, XEvent *event, String *prms, - Cardinal *nprms)); - void InfoProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void ManProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void HintProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void BookProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AboutGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void AboutProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void DebugProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void NothingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void Iconify P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); - void DisplayMove P((int moveNumber)); - void DisplayTitle P((char *title)); - void ICSInitScript P((void)); - int LoadGamePopUp P((FILE *f, int gameNumber, char *title)); - void ErrorPopUp P((char *title, char *text, int modal)); - void ErrorPopDown P((void)); - static char *ExpandPathName P((char *path)); - static void CreateAnimVars P((void)); - static void DragPieceBegin P((int x, int y)); - static void DragPieceMove P((int x, int y)); - static void DragPieceEnd P((int x, int y)); - static void DrawDragPiece P((void)); - char *ModeToWidgetName P((GameMode mode)); - - /* - * XBoard depends on Xt R4 or higher - */ - int xtVersion = XtSpecificationRelease; - - int xScreen; - Display *xDisplay; - Window xBoardWindow; - Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, - jailSquareColor, highlightSquareColor, premoveHighlightColor; - GC lightSquareGC, darkSquareGC, jailSquareGC, lineGC, wdPieceGC, wlPieceGC, - bdPieceGC, blPieceGC, wbPieceGC, bwPieceGC, coordGC, highlineGC, - wjPieceGC, bjPieceGC, prelineGC; - Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; - Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget, - whiteTimerWidget, blackTimerWidget, titleWidget, widgetList[16], - commentShell, promotionShell, whitePieceMenu, blackPieceMenu, dropMenu, - menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell, - ICSInputShell, fileNameShell, askQuestionShell; - XSegment gridSegments[(BOARD_SIZE + 1) * 2]; - XSegment jailGridSegments[(BOARD_SIZE + 3) * 2]; - Font clockFontID, coordFontID; - XFontStruct *clockFontStruct, *coordFontStruct; - XtAppContext appContext; - char *layoutName; - char *oldICSInteractionTitle; - - FileProc fileProc; - char *fileOpenMode; - - Position commentX = -1, commentY = -1; - Dimension commentW, commentH; - - int squareSize, smallLayout = 0, tinyLayout = 0, - fromX = -1, fromY = -1, toX, toY, commentUp = False, analysisUp = False, - ICSInputBoxUp = False, askQuestionUp = False, - filenameUp = False, promotionUp = False, pmFromX = -1, pmFromY = -1, - editUp = False, errorUp = False, errorExitStatus = -1, lineGap; - Pixel timerForegroundPixel, timerBackgroundPixel; - Pixel buttonForegroundPixel, buttonBackgroundPixel; - char *chessDir, *programName, *programVersion, - *gameCopyFilename, *gamePasteFilename; - - #define SOLID 0 - #define OUTLINE 1 - Pixmap pieceBitmap[2][6]; - Pixmap xpmPieceBitmap[4][6]; /* LL, LD, DL, DD */ - Pixmap xpmLightSquare, xpmDarkSquare, xpmJailSquare; - int useImages, useImageSqs; - XImage *ximPieceBitmap[4][6]; /* LL, LD, DL, DD */ - Pixmap ximMaskPm[6]; /* clipmasks, used for XIM pieces */ - XImage *ximLightSquare, *ximDarkSquare; - XImage *xim_Cross; - - #define pieceToSolid(piece) &pieceBitmap[SOLID][((int)(piece)) % 6] - #define pieceToOutline(piece) &pieceBitmap[OUTLINE][((int)(piece)) % 6] - - #define White(piece) ((int)(piece) < (int)BlackPawn) - - /* Variables for doing smooth animation. This whole thing - would be much easier if the board was double-buffered, - but that would require a fairly major rewrite. */ - - typedef struct { - Pixmap saveBuf; - Pixmap newBuf; - GC blitGC, pieceGC, outlineGC; - XPoint startSquare, prevFrame, mouseDelta; - int startColor; - int dragPiece; - Boolean dragActive; - int startBoardX, startBoardY; - } AnimState; - - /* There can be two pieces being animated at once: a player - can begin dragging a piece before the remote opponent has moved. */ - - static AnimState game, player; - - /* Bitmaps for use as masks when drawing XPM pieces. - Need one for each black and white piece. */ - static Pixmap xpmMask[BlackKing + 1]; - - /* This magic number is the number of intermediate frames used - in each half of the animation. For short moves it's reduced - by 1. The total number of frames will be factor * 2 + 1. */ - #define kFactor 4 - - SizeDefaults sizeDefaults[] = SIZE_DEFAULTS; - - MenuItem fileMenu[] = { - {N_("Reset Game"), ResetProc}, - {"----", NothingProc}, - {N_("Load Game"), LoadGameProc}, - {N_("Load Next Game"), LoadNextGameProc}, - {N_("Load Previous Game"), LoadPrevGameProc}, - {N_("Reload Same Game"), ReloadGameProc}, - {N_("Save Game"), SaveGameProc}, - {"----", NothingProc}, - {N_("Copy Game"), CopyGameProc}, - {N_("Paste Game"), PasteGameProc}, - {"----", NothingProc}, - {N_("Load Position"), LoadPositionProc}, - {N_("Load Next Position"), LoadNextPositionProc}, - {N_("Load Previous Position"), LoadPrevPositionProc}, - {N_("Reload Same Position"), ReloadPositionProc}, - {N_("Save Position"), SavePositionProc}, - {"----", NothingProc}, - {N_("Copy Position"), CopyPositionProc}, - {N_("Paste Position"), PastePositionProc}, - {"----", NothingProc}, - {N_("Mail Move"), MailMoveProc}, - {N_("Reload CMail Message"), ReloadCmailMsgProc}, - {"----", NothingProc}, - {N_("Exit"), QuitProc}, - {NULL, NULL} - }; - - MenuItem modeMenu[] = { - {N_("Machine White"), MachineWhiteProc}, - {N_("Machine Black"), MachineBlackProc}, - {N_("Two Machines"), TwoMachinesProc}, - {N_("Analysis Mode"), AnalyzeModeProc}, - {N_("Analyze File"), AnalyzeFileProc }, - {N_("ICS Client"), IcsClientProc}, - {N_("Edit Game"), EditGameProc}, - {N_("Edit Position"), EditPositionProc}, - {N_("Training"), TrainingProc}, - {"----", NothingProc}, - {N_("Show Game List"), ShowGameListProc}, - {N_("Show Move List"), HistoryShowProc}, - {N_("Edit Tags"), EditTagsProc}, - {N_("Edit Comment"), EditCommentProc}, - {N_("ICS Input Box"), IcsInputBoxProc}, - {N_("Pause"), PauseProc}, - {NULL, NULL} - }; - - MenuItem actionMenu[] = { - {N_("Accept"), AcceptProc}, - {N_("Decline"), DeclineProc}, - {N_("Rematch"), RematchProc}, - {"----", NothingProc}, - {N_("Call Flag"), CallFlagProc}, - {N_("Draw"), DrawProc}, - {N_("Adjourn"), AdjournProc}, - {N_("Abort"), AbortProc}, - {N_("Resign"), ResignProc}, - {"----", NothingProc}, - {N_("Stop Observing"), StopObservingProc}, - {N_("Stop Examining"), StopExaminingProc}, - {NULL, NULL} - }; - - MenuItem stepMenu[] = { - {N_("Backward"), BackwardProc}, - {N_("Forward"), ForwardProc}, - {N_("Back to Start"), ToStartProc}, - {N_("Forward to End"), ToEndProc}, - {N_("Revert"), RevertProc}, - {N_("Truncate Game"), TruncateGameProc}, - {"----", NothingProc}, - {N_("Move Now"), MoveNowProc}, - {N_("Retract Move"), RetractMoveProc}, - {NULL, NULL} - }; - - MenuItem optionsMenu[] = { - {N_("Always Queen"), AlwaysQueenProc}, - {N_("Animate Dragging"), AnimateDraggingProc}, - {N_("Animate Moving"), AnimateMovingProc}, - {N_("Auto Comment"), AutocommProc}, - {N_("Auto Flag"), AutoflagProc}, - {N_("Auto Flip View"), AutoflipProc}, - {N_("Auto Observe"), AutobsProc}, - {N_("Auto Raise Board"), AutoraiseProc}, - {N_("Auto Save"), AutosaveProc}, - {N_("Blindfold"), BlindfoldProc}, - {N_("Flash Moves"), FlashMovesProc}, - {N_("Flip View"), FlipViewProc}, - {N_("Get Move List"), GetMoveListProc}, - #if HIGHDRAG - {N_("Highlight Dragging"), HighlightDraggingProc}, - #endif - {N_("Highlight Last Move"), HighlightLastMoveProc}, - {N_("Move Sound"), MoveSoundProc}, - {N_("ICS Alarm"), IcsAlarmProc}, - {N_("Old Save Style"), OldSaveStyleProc}, - {N_("Periodic Updates"), PeriodicUpdatesProc}, - {N_("Ponder Next Move"), PonderNextMoveProc}, - {N_("Popup Exit Message"), PopupExitMessageProc}, - {N_("Popup Move Errors"), PopupMoveErrorsProc}, - {N_("Premove"), PremoveProc}, - {N_("Quiet Play"), QuietPlayProc}, - {N_("Show Coords"), ShowCoordsProc}, - {N_("Show Thinking"), ShowThinkingProc}, - {N_("Test Legality"), TestLegalityProc}, - {NULL, NULL} - }; - - MenuItem helpMenu[] = { - {N_("Info XBoard"), InfoProc}, - {N_("Man XBoard"), ManProc}, - {"----", NothingProc}, - {N_("Hint"), HintProc}, - {N_("Book"), BookProc}, - {"----", NothingProc}, - {N_("About XBoard"), AboutProc}, - {NULL, NULL} - }; - - Menu menuBar[] = { - {N_("File"), fileMenu}, - {N_("Mode"), modeMenu}, - {N_("Action"), actionMenu}, - {N_("Step"), stepMenu}, - {N_("Options"), optionsMenu}, - {N_("Help"), helpMenu}, - {NULL, NULL} - }; - - - /* Label on pause button */ - #define PAUSE_BUTTON N_("P") - MenuItem buttonBar[] = { - {"<<", ToStartProc}, - {"<", BackwardProc}, - {PAUSE_BUTTON, PauseProc}, - {">", ForwardProc}, - {">>", ToEndProc}, - {NULL, NULL} - }; - - #define PIECE_MENU_SIZE 11 - String pieceMenuStrings[2][PIECE_MENU_SIZE] = { - { N_("White"), "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), - N_("Queen"), N_("King"), "----", N_("Empty square"), N_("Clear board") }, - { N_("Black"), "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), - N_("Queen"), N_("King"), "----", N_("Empty square"), N_("Clear board") }, - }; - /* must be in same order as PieceMenuStrings! */ - ChessSquare pieceMenuTranslation[2][PIECE_MENU_SIZE] = { - { WhitePlay, (ChessSquare) 0, WhitePawn, WhiteKnight, WhiteBishop, - WhiteRook, WhiteQueen, WhiteKing, - (ChessSquare) 0, EmptySquare, ClearBoard }, - { BlackPlay, (ChessSquare) 0, BlackPawn, BlackKnight, BlackBishop, - BlackRook, BlackQueen, BlackKing, - (ChessSquare) 0, EmptySquare, ClearBoard }, - }; - - #define DROP_MENU_SIZE 6 - String dropMenuStrings[DROP_MENU_SIZE] = { - "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), N_("Queen") - }; - /* must be in same order as PieceMenuStrings! */ - ChessSquare dropMenuTranslation[DROP_MENU_SIZE] = { - (ChessSquare) 0, WhitePawn, WhiteKnight, WhiteBishop, - WhiteRook, WhiteQueen - }; - - typedef struct { - char piece; - char* widget; - } DropMenuEnables; - - DropMenuEnables dmEnables[] = { - { 'P', "Pawn" }, - { 'N', "Knight" }, - { 'B', "Bishop" }, - { 'R', "Rook" }, - { 'Q', "Queen" } - }; - - Arg shellArgs[] = { - { XtNwidth, 0 }, - { XtNheight, 0 }, - { XtNminWidth, 0 }, - { XtNminHeight, 0 }, - { XtNmaxWidth, 0 }, - { XtNmaxHeight, 0 } - }; - - Arg layoutArgs[] = { - { XtNborderWidth, 0 }, - { XtNdefaultDistance, 0 }, - }; - - Arg formArgs[] = { - { XtNborderWidth, 0 }, - { XtNresizable, (XtArgVal) True }, - }; - - Arg boardArgs[] = { - { XtNborderWidth, 0 }, - { XtNwidth, 0 }, - { XtNheight, 0 } - }; - - Arg titleArgs[] = { - { XtNjustify, (XtArgVal) XtJustifyRight }, - { XtNlabel, (XtArgVal) "..." }, - { XtNresizable, (XtArgVal) True }, - { XtNresize, (XtArgVal) False } - }; - - Arg messageArgs[] = { - { XtNjustify, (XtArgVal) XtJustifyLeft }, - { XtNlabel, (XtArgVal) "..." }, - { XtNresizable, (XtArgVal) True }, - { XtNresize, (XtArgVal) False } - }; - - Arg timerArgs[] = { - { XtNborderWidth, 0 }, - { XtNjustify, (XtArgVal) XtJustifyLeft } - }; - - XtResource clientResources[] = { - { "whitePieceColor", "whitePieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, whitePieceColor), XtRString, - WHITE_PIECE_COLOR }, - { "blackPieceColor", "blackPieceColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, blackPieceColor), XtRString, - BLACK_PIECE_COLOR }, - { "lightSquareColor", "lightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, lightSquareColor), - XtRString, LIGHT_SQUARE_COLOR }, - { "darkSquareColor", "darkSquareColor", XtRString, sizeof(String), - XtOffset(AppDataPtr, darkSquareColor), XtRString, - DARK_SQUARE_COLOR }, - { "highlightSquareColor", "highlightSquareColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, highlightSquareColor), - XtRString, HIGHLIGHT_SQUARE_COLOR }, - { "premoveHighlightColor", "premoveHighlightColor", XtRString, - sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor), - XtRString, PREMOVE_HIGHLIGHT_COLOR }, - { "movesPerSession", "movesPerSession", XtRInt, sizeof(int), - XtOffset(AppDataPtr, movesPerSession), XtRImmediate, - (XtPointer) MOVES_PER_SESSION }, - { "timeIncrement", "timeIncrement", XtRInt, sizeof(int), - XtOffset(AppDataPtr, timeIncrement), XtRImmediate, - (XtPointer) TIME_INCREMENT }, - { "initString", "initString", XtRString, sizeof(String), - XtOffset(AppDataPtr, initString), XtRString, INIT_STRING }, - { "secondInitString", "secondInitString", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondInitString), XtRString, INIT_STRING }, - { "firstComputerString", "firstComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstComputerString), XtRString, - COMPUTER_STRING }, - { "secondComputerString", "secondComputerString", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondComputerString), XtRString, - COMPUTER_STRING }, - { "firstChessProgram", "firstChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, firstChessProgram), - XtRString, FIRST_CHESS_PROGRAM }, - { "secondChessProgram", "secondChessProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, secondChessProgram), - XtRString, SECOND_CHESS_PROGRAM }, - { "firstPlaysBlack", "firstPlaysBlack", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, firstPlaysBlack), - XtRImmediate, (XtPointer) False }, - { "noChessProgram", "noChessProgram", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, noChessProgram), - XtRImmediate, (XtPointer) False }, - { "firstHost", "firstHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstHost), XtRString, FIRST_HOST }, - { "secondHost", "secondHost", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST }, - { "firstDirectory", "firstDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, firstDirectory), XtRString, "" }, - { "secondDirectory", "secondDirectory", XtRString, sizeof(String), - XtOffset(AppDataPtr, secondDirectory), XtRString, "" }, - { "bitmapDirectory", "bitmapDirectory", XtRString, - sizeof(String), XtOffset(AppDataPtr, bitmapDirectory), - XtRString, "" }, - { "remoteShell", "remoteShell", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteShell), XtRString, REMOTE_SHELL }, - { "remoteUser", "remoteUser", XtRString, sizeof(String), - XtOffset(AppDataPtr, remoteUser), XtRString, "" }, - { "timeDelay", "timeDelay", XtRFloat, sizeof(float), - XtOffset(AppDataPtr, timeDelay), XtRString, - (XtPointer) TIME_DELAY_QUOTE }, - { "timeControl", "timeControl", XtRString, sizeof(String), - XtOffset(AppDataPtr, timeControl), XtRString, - (XtPointer) TIME_CONTROL }, - { "internetChessServerMode", "internetChessServerMode", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsActive), XtRImmediate, - (XtPointer) False }, - { "internetChessServerHost", "internetChessServerHost", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHost), - XtRString, (XtPointer) ICS_HOST }, - { "internetChessServerPort", "internetChessServerPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsPort), XtRString, - (XtPointer) ICS_PORT }, - { "internetChessServerCommPort", "internetChessServerCommPort", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsCommPort), XtRString, - ICS_COMM_PORT }, - { "internetChessServerLogonScript", "internetChessServerLogonScript", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsLogon), XtRString, - ICS_LOGON }, - { "internetChessServerHelper", "internetChessServerHelper", - XtRString, sizeof(String), - XtOffset(AppDataPtr, icsHelper), XtRString, "" }, - { "internetChessServerInputBox", "internetChessServerInputBox", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsInputBox), XtRImmediate, - (XtPointer) False }, - { "icsAlarm", "icsAlarm", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, icsAlarm), XtRImmediate, - (XtPointer) True }, - { "icsAlarmTime", "icsAlarmTime", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, icsAlarmTime), XtRImmediate, - (XtPointer) 5000 }, - { "useTelnet", "useTelnet", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, useTelnet), XtRImmediate, - (XtPointer) False }, - { "telnetProgram", "telnetProgram", XtRString, sizeof(String), - XtOffset(AppDataPtr, telnetProgram), XtRString, TELNET_PROGRAM }, - { "gateway", "gateway", XtRString, sizeof(String), - XtOffset(AppDataPtr, gateway), XtRString, "" }, - { "loadGameFile", "loadGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, loadGameFile), XtRString, "" }, - { "loadGameIndex", "loadGameIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadGameIndex), XtRImmediate, - (XtPointer) 0 }, - { "saveGameFile", "saveGameFile", XtRString, sizeof(String), - XtOffset(AppDataPtr, saveGameFile), XtRString, "" }, - { "autoRaiseBoard", "autoRaiseBoard", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoRaiseBoard), - XtRImmediate, (XtPointer) True }, - { "autoSaveGames", "autoSaveGames", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoSaveGames), - XtRImmediate, (XtPointer) False }, - { "blindfold", "blindfold", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, blindfold), - XtRImmediate, (XtPointer) False }, - { "loadPositionFile", "loadPositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, loadPositionFile), - XtRString, "" }, - { "loadPositionIndex", "loadPositionIndex", - XtRInt, sizeof(int), - XtOffset(AppDataPtr, loadPositionIndex), XtRImmediate, - (XtPointer) 1 }, - { "savePositionFile", "savePositionFile", XtRString, - sizeof(String), XtOffset(AppDataPtr, savePositionFile), - XtRString, "" }, - { "matchMode", "matchMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, matchMode), XtRImmediate, (XtPointer) False }, - { "matchGames", "matchGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, matchGames), XtRImmediate, - (XtPointer) 0 }, - { "monoMode", "monoMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, monoMode), XtRImmediate, - (XtPointer) False }, - { "debugMode", "debugMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, debugMode), XtRImmediate, - (XtPointer) False }, - { "clockMode", "clockMode", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, clockMode), XtRImmediate, - (XtPointer) True }, - { "boardSize", "boardSize", XtRString, sizeof(String), - XtOffset(AppDataPtr, boardSize), XtRString, "" }, - { "searchTime", "searchTime", XtRString, sizeof(String), - XtOffset(AppDataPtr, searchTime), XtRString, - (XtPointer) "" }, - { "searchDepth", "searchDepth", XtRInt, sizeof(int), - XtOffset(AppDataPtr, searchDepth), XtRImmediate, - (XtPointer) 0 }, - { "showCoords", "showCoords", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showCoords), XtRImmediate, - (XtPointer) False }, - { "showJail", "showJail", XtRInt, sizeof(int), - XtOffset(AppDataPtr, showJail), XtRImmediate, - (XtPointer) 0 }, - { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, showThinking), XtRImmediate, - (XtPointer) False }, - { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ponderNextMove), XtRImmediate, - (XtPointer) True }, - { "periodicUpdates", "periodicUpdates", XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, periodicUpdates), XtRImmediate, - (XtPointer) True }, - { "clockFont", "clockFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, clockFont), XtRString, CLOCK_FONT }, - { "coordFont", "coordFont", XtRString, sizeof(String), - XtOffset(AppDataPtr, coordFont), XtRString, COORD_FONT }, - { "font", "font", XtRString, sizeof(String), - XtOffset(AppDataPtr, font), XtRString, DEFAULT_FONT }, - { "ringBellAfterMoves", "ringBellAfterMoves", - XtRBoolean, sizeof(Boolean), - XtOffset(AppDataPtr, ringBellAfterMoves), - XtRImmediate, (XtPointer) False }, - { "autoCallFlag", "autoCallFlag", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoCallFlag), - XtRImmediate, (XtPointer) False }, - { "autoFlipView", "autoFlipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoFlipView), - XtRImmediate, (XtPointer) True }, - { "autoObserve", "autoObserve", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoObserve), - XtRImmediate, (XtPointer) False }, - { "autoComment", "autoComment", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, autoComment), - XtRImmediate, (XtPointer) False }, - { "getMoveList", "getMoveList", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, getMoveList), - XtRImmediate, (XtPointer) True }, - #if HIGHDRAG - { "highlightDragging", "highlightDragging", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightDragging), - XtRImmediate, (XtPointer) False }, - #endif - { "highlightLastMove", "highlightLastMove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, highlightLastMove), - XtRImmediate, (XtPointer) False }, - { "premove", "premove", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, premove), - XtRImmediate, (XtPointer) True }, - { "testLegality", "testLegality", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, testLegality), - XtRImmediate, (XtPointer) True }, - { "flipView", "flipView", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, flipView), - XtRImmediate, (XtPointer) False }, - { "cmail", "cmailGameName", XtRString, sizeof(String), - XtOffset(AppDataPtr, cmailGameName), XtRString, "" }, - { "alwaysPromoteToQueen", "alwaysPromoteToQueen", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, alwaysPromoteToQueen), - XtRImmediate, (XtPointer) False }, - { "oldSaveStyle", "oldSaveStyle", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, oldSaveStyle), - XtRImmediate, (XtPointer) False }, - { "quietPlay", "quietPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, quietPlay), - XtRImmediate, (XtPointer) False }, - { "titleInWindow", "titleInWindow", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, titleInWindow), - XtRImmediate, (XtPointer) False }, - { "localLineEditing", "localLineEditing", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing), - XtRImmediate, (XtPointer) True }, /* not implemented, must be True */ - #ifdef ZIPPY - { "zippyTalk", "zippyTalk", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk), - XtRImmediate, (XtPointer) ZIPPY_TALK }, - { "zippyPlay", "zippyPlay", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyPlay), - XtRImmediate, (XtPointer) ZIPPY_PLAY }, - { "zippyLines", "zippyLines", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyLines), XtRString, ZIPPY_LINES }, - { "zippyPinhead", "zippyPinhead", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPinhead), XtRString, ZIPPY_PINHEAD }, - { "zippyPassword", "zippyPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword), XtRString, ZIPPY_PASSWORD }, - { "zippyPassword2", "zippyPassword2", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyPassword2), XtRString, ZIPPY_PASSWORD2 }, - { "zippyWrongPassword", "zippyWrongPassword", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyWrongPassword), XtRString, - ZIPPY_WRONG_PASSWORD }, - { "zippyAcceptOnly", "zippyAcceptOnly", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyAcceptOnly), XtRString, ZIPPY_ACCEPT_ONLY }, - { "zippyUseI", "zippyUseI", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyUseI), - XtRImmediate, (XtPointer) ZIPPY_USE_I }, - { "zippyBughouse", "zippyBughouse", XtRInt, - sizeof(int), XtOffset(AppDataPtr, zippyBughouse), - XtRImmediate, (XtPointer) ZIPPY_BUGHOUSE }, - { "zippyNoplayCrafty", "zippyNoplayCrafty", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyNoplayCrafty), - XtRImmediate, (XtPointer) ZIPPY_NOPLAY_CRAFTY }, - { "zippyGameEnd", "zippyGameEnd", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameEnd), XtRString, ZIPPY_GAME_END }, - { "zippyGameStart", "zippyGameStart", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyGameStart), XtRString, ZIPPY_GAME_START }, - { "zippyAdjourn", "zippyAdjourn", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAdjourn), - XtRImmediate, (XtPointer) ZIPPY_ADJOURN }, - { "zippyAbort", "zippyAbort", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, zippyAbort), - XtRImmediate, (XtPointer) ZIPPY_ABORT }, - { "zippyVariants", "zippyVariants", XtRString, sizeof(String), - XtOffset(AppDataPtr, zippyVariants), XtRString, ZIPPY_VARIANTS }, - { "zippyMaxGames", "zippyMaxGames", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyMaxGames), XtRImmediate, - (XtPointer) ZIPPY_MAX_GAMES }, - { "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int), - XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate, - (XtPointer) ZIPPY_REPLAY_TIMEOUT }, - #endif - { "flashCount", "flashCount", XtRInt, sizeof(int), - XtOffset(AppDataPtr, flashCount), XtRImmediate, - (XtPointer) FLASH_COUNT }, - { "flashRate", "flashRate", XtRInt, sizeof(int), - XtOffset(AppDataPtr, flashRate), XtRImmediate, - (XtPointer) FLASH_RATE }, - { "pixmapDirectory", "pixmapDirectory", XtRString, - sizeof(String), XtOffset(AppDataPtr, pixmapDirectory), - XtRString, "" }, - { "msLoginDelay", "msLoginDelay", XtRInt, sizeof(int), - XtOffset(AppDataPtr, msLoginDelay), XtRImmediate, - (XtPointer) MS_LOGIN_DELAY }, - { "colorizeMessages", "colorizeMessages", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, colorize), - XtRImmediate, (XtPointer) False }, - { "colorShout", "colorShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorShout), - XtRString, COLOR_SHOUT }, - { "colorSShout", "colorSShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorSShout), - XtRString, COLOR_SSHOUT }, - { "colorChannel1", "colorChannel1", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChannel1), - XtRString, COLOR_CHANNEL1 }, - { "colorChannel", "colorChannel", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChannel), - XtRString, COLOR_CHANNEL }, - { "colorKibitz", "colorKibitz", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorKibitz), - XtRString, COLOR_KIBITZ }, - { "colorTell", "colorTell", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorTell), - XtRString, COLOR_TELL }, - { "colorChallenge", "colorChallenge", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorChallenge), - XtRString, COLOR_CHALLENGE }, - { "colorRequest", "colorRequest", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorRequest), - XtRString, COLOR_REQUEST }, - { "colorSeek", "colorSeek", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorSeek), - XtRString, COLOR_SEEK }, - { "colorNormal", "colorNormal", XtRString, - sizeof(String), XtOffset(AppDataPtr, colorNormal), - XtRString, COLOR_NORMAL }, - { "soundProgram", "soundProgram", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundProgram), - XtRString, "play" }, - { "soundShout", "soundShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundShout), - XtRString, "" }, - { "soundSShout", "soundSShout", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundSShout), - XtRString, "" }, - { "soundChannel1", "soundChannel1", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChannel1), - XtRString, "" }, - { "soundChannel", "soundChannel", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChannel), - XtRString, "" }, - { "soundKibitz", "soundKibitz", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundKibitz), - XtRString, "" }, - { "soundTell", "soundTell", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundTell), - XtRString, "" }, - { "soundChallenge", "soundChallenge", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundChallenge), - XtRString, "" }, - { "soundRequest", "soundRequest", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundRequest), - XtRString, "" }, - { "soundSeek", "soundSeek", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundSeek), - XtRString, "" }, - { "soundMove", "soundMove", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundMove), - XtRString, "$" }, - { "soundIcsWin", "soundIcsWin", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsWin), - XtRString, "" }, - { "soundIcsLoss", "soundIcsLoss", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsLoss), - XtRString, "" }, - { "soundIcsDraw", "soundIcsDraw", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsDraw), - XtRString, "" }, - { "soundIcsUnfinished", "soundIcsUnfinished", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsUnfinished), - XtRString, "" }, - { "soundIcsAlarm", "soundIcsAlarm", XtRString, - sizeof(String), XtOffset(AppDataPtr, soundIcsAlarm), - XtRString, "$" }, - { "reuseFirst", "reuseFirst", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, reuseFirst), - XtRImmediate, (XtPointer) True }, - { "reuseSecond", "reuseSecond", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, reuseSecond), - XtRImmediate, (XtPointer) True }, - { "animateDragging", "animateDragging", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, animateDragging), - XtRImmediate, (XtPointer) True }, - { "animateMoving", "animateMoving", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, animate), - XtRImmediate, (XtPointer) True }, - { "animateSpeed", "animateSpeed", XtRInt, - sizeof(int), XtOffset(AppDataPtr, animSpeed), - XtRImmediate, (XtPointer)10 }, - { "popupExitMessage", "popupExitMessage", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, popupExitMessage), - XtRImmediate, (XtPointer) True }, - { "popupMoveErrors", "popupMoveErrors", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, popupMoveErrors), - XtRImmediate, (XtPointer) False }, - { "fontSizeTolerance", "fontSizeTolerance", XtRInt, - sizeof(int), XtOffset(AppDataPtr, fontSizeTolerance), - XtRImmediate, (XtPointer)4 }, - { "initialMode", "initialMode", XtRString, - sizeof(String), XtOffset(AppDataPtr, initialMode), - XtRImmediate, (XtPointer) "" }, - { "variant", "variant", XtRString, - sizeof(String), XtOffset(AppDataPtr, variant), - XtRImmediate, (XtPointer) "normal" }, - { "firstProtocolVersion", "firstProtocolVersion", XtRInt, - sizeof(int), XtOffset(AppDataPtr, firstProtocolVersion), - XtRImmediate, (XtPointer)PROTOVER }, - { "secondProtocolVersion", "secondProtocolVersion", XtRInt, - sizeof(int), XtOffset(AppDataPtr, secondProtocolVersion), - XtRImmediate, (XtPointer)PROTOVER }, - { "showButtonBar", "showButtonBar", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar), - XtRImmediate, (XtPointer) True }, - /* icsEngineAnalyze */ - {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean, - sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze), - XtRImmediate, (XtPointer) False }, - }; - - XrmOptionDescRec shellOptions[] = { - { "-whitePieceColor", "whitePieceColor", XrmoptionSepArg, NULL }, - { "-blackPieceColor", "blackPieceColor", XrmoptionSepArg, NULL }, - { "-lightSquareColor", "lightSquareColor", XrmoptionSepArg, NULL }, - { "-darkSquareColor", "darkSquareColor", XrmoptionSepArg, NULL }, - { "-highlightSquareColor", "highlightSquareColor", XrmoptionSepArg, NULL }, - { "-premoveHighlightColor", "premoveHighlightColor", XrmoptionSepArg,NULL}, - { "-movesPerSession", "movesPerSession", XrmoptionSepArg, NULL }, - { "-mps", "movesPerSession", XrmoptionSepArg, NULL }, - { "-timeIncrement", "timeIncrement", XrmoptionSepArg, NULL }, - { "-inc", "timeIncrement", XrmoptionSepArg, NULL }, - { "-initString", "initString", XrmoptionSepArg, NULL }, - { "-firstInitString", "initString", XrmoptionSepArg, NULL }, - { "-secondInitString", "secondInitString", XrmoptionSepArg, NULL }, - { "-firstComputerString", "firstComputerString", XrmoptionSepArg, NULL }, - { "-secondComputerString", "secondComputerString", XrmoptionSepArg, NULL }, - { "-firstChessProgram", "firstChessProgram", XrmoptionSepArg, NULL }, - { "-fcp", "firstChessProgram", XrmoptionSepArg, NULL }, - { "-secondChessProgram", "secondChessProgram", XrmoptionSepArg, NULL }, - { "-scp", "secondChessProgram", XrmoptionSepArg, NULL }, - { "-firstPlaysBlack", "firstPlaysBlack", XrmoptionSepArg, NULL }, - { "-fb", "firstPlaysBlack", XrmoptionNoArg, "True" }, - { "-xfb", "firstPlaysBlack", XrmoptionNoArg, "False" }, - { "-noChessProgram", "noChessProgram", XrmoptionSepArg, NULL }, - { "-ncp", "noChessProgram", XrmoptionNoArg, "True" }, - { "-xncp", "noChessProgram", XrmoptionNoArg, "False" }, - { "-firstHost", "firstHost", XrmoptionSepArg, NULL }, - { "-fh", "firstHost", XrmoptionSepArg, NULL }, - { "-secondHost", "secondHost", XrmoptionSepArg, NULL }, - { "-sh", "secondHost", XrmoptionSepArg, NULL }, - { "-firstDirectory", "firstDirectory", XrmoptionSepArg, NULL }, - { "-fd", "firstDirectory", XrmoptionSepArg, NULL }, - { "-secondDirectory", "secondDirectory", XrmoptionSepArg, NULL }, - { "-sd", "secondDirectory", XrmoptionSepArg, NULL }, - { "-bitmapDirectory", "bitmapDirectory", XrmoptionSepArg, NULL }, - { "-bm", "bitmapDirectory", XrmoptionSepArg, NULL }, - { "-remoteShell", "remoteShell", XrmoptionSepArg, NULL }, - { "-rsh", "remoteShell", XrmoptionSepArg, NULL }, - { "-remoteUser", "remoteUser", XrmoptionSepArg, NULL }, - { "-ruser", "remoteUser", XrmoptionSepArg, NULL }, - { "-timeDelay", "timeDelay", XrmoptionSepArg, NULL }, - { "-td", "timeDelay", XrmoptionSepArg, NULL }, - { "-timeControl", "timeControl", XrmoptionSepArg, NULL }, - { "-tc", "timeControl", XrmoptionSepArg, NULL }, - { "-internetChessServerMode", "internetChessServerMode", - XrmoptionSepArg, NULL }, - { "-ics", "internetChessServerMode", XrmoptionNoArg, "True" }, - { "-xics", "internetChessServerMode", XrmoptionNoArg, "False" }, - { "-internetChessServerHost", "internetChessServerHost", - XrmoptionSepArg, NULL }, - { "-icshost", "internetChessServerHost", XrmoptionSepArg, NULL }, - { "-internetChessServerPort", "internetChessServerPort", - XrmoptionSepArg, NULL }, - { "-icsport", "internetChessServerPort", XrmoptionSepArg, NULL }, - { "-internetChessServerCommPort", "internetChessServerCommPort", - XrmoptionSepArg, NULL }, - { "-icscomm", "internetChessServerCommPort", XrmoptionSepArg, NULL }, - { "-internetChessServerLogonScript", "internetChessServerLogonScript", - XrmoptionSepArg, NULL }, - { "-icslogon", "internetChessServerLogonScript", XrmoptionSepArg, NULL }, - { "-internetChessServerHelper", "internetChessServerHelper", - XrmoptionSepArg, NULL }, - { "-icshelper", "internetChessServerHelper", XrmoptionSepArg, NULL }, - { "-internetChessServerInputBox", "internetChessServerInputBox", - XrmoptionSepArg, NULL }, - { "-icsinput", "internetChessServerInputBox", XrmoptionNoArg, "True" }, - { "-xicsinput", "internetChessServerInputBox", XrmoptionNoArg, "False" }, - { "-icsAlarm", "icsAlarm", XrmoptionSepArg, NULL }, - { "-alarm", "icsAlarm", XrmoptionNoArg, "True" }, - { "-xalarm", "icsAlarm", XrmoptionNoArg, "False" }, - { "-icsAlarmTime", "icsAlarmTime", XrmoptionSepArg, NULL }, - { "-useTelnet", "useTelnet", XrmoptionSepArg, NULL }, - { "-telnet", "useTelnet", XrmoptionNoArg, "True" }, - { "-xtelnet", "useTelnet", XrmoptionNoArg, "False" }, - { "-telnetProgram", "telnetProgram", XrmoptionSepArg, NULL }, - { "-gateway", "gateway", XrmoptionSepArg, NULL }, - { "-loadGameFile", "loadGameFile", XrmoptionSepArg, NULL }, - { "-lgf", "loadGameFile", XrmoptionSepArg, NULL }, - { "-loadGameIndex", "loadGameIndex", XrmoptionSepArg, NULL }, - { "-lgi", "loadGameIndex", XrmoptionSepArg, NULL }, - { "-saveGameFile", "saveGameFile", XrmoptionSepArg, NULL }, - { "-sgf", "saveGameFile", XrmoptionSepArg, NULL }, - { "-autoSaveGames", "autoSaveGames", XrmoptionSepArg, NULL }, - { "-autosave", "autoSaveGames", XrmoptionNoArg, "True" }, - { "-xautosave", "autoSaveGames", XrmoptionNoArg, "False" }, - { "-autoRaiseBoard", "autoRaiseBoard", XrmoptionSepArg, NULL }, - { "-autoraise", "autoRaiseBoard", XrmoptionNoArg, "True" }, - { "-xautoraise", "autoRaiseBoard", XrmoptionNoArg, "False" }, - { "-blindfold", "blindfold", XrmoptionSepArg, NULL }, - { "-blind", "blindfold", XrmoptionNoArg, "True" }, - { "-xblind", "blindfold", XrmoptionNoArg, "False" }, - { "-loadPositionFile", "loadPositionFile", XrmoptionSepArg, NULL }, - { "-lpf", "loadPositionFile", XrmoptionSepArg, NULL }, - { "-loadPositionIndex", "loadPositionIndex", XrmoptionSepArg, NULL }, - { "-lpi", "loadPositionIndex", XrmoptionSepArg, NULL }, - { "-savePositionFile", "savePositionFile", XrmoptionSepArg, NULL }, - { "-spf", "savePositionFile", XrmoptionSepArg, NULL }, - { "-matchMode", "matchMode", XrmoptionSepArg, NULL }, - { "-mm", "matchMode", XrmoptionNoArg, "True" }, - { "-xmm", "matchMode", XrmoptionNoArg, "False" }, - { "-matchGames", "matchGames", XrmoptionSepArg, NULL }, - { "-mg", "matchGames", XrmoptionSepArg, NULL }, - { "-monoMode", "monoMode", XrmoptionSepArg, NULL }, - { "-mono", "monoMode", XrmoptionNoArg, "True" }, - { "-xmono", "monoMode", XrmoptionNoArg, "False" }, - { "-debugMode", "debugMode", XrmoptionSepArg, NULL }, - { "-debug", "debugMode", XrmoptionNoArg, "True" }, - { "-xdebug", "debugMode", XrmoptionNoArg, "False" }, - { "-clockMode", "clockMode", XrmoptionSepArg, NULL }, - { "-clock", "clockMode", XrmoptionNoArg, "True" }, - { "-xclock", "clockMode", XrmoptionNoArg, "False" }, - { "-boardSize", "boardSize", XrmoptionSepArg, NULL }, - { "-size", "boardSize", XrmoptionSepArg, NULL }, - { "-searchTime", "searchTime", XrmoptionSepArg, NULL }, - { "-st", "searchTime", XrmoptionSepArg, NULL }, - { "-searchDepth", "searchDepth", XrmoptionSepArg, NULL }, - { "-depth", "searchDepth", XrmoptionSepArg, NULL }, - { "-showCoords", "showCoords", XrmoptionSepArg, NULL }, - { "-coords", "showCoords", XrmoptionNoArg, "True" }, - { "-xcoords", "showCoords", XrmoptionNoArg, "False" }, - #if JAIL - { "-showJail", "showJail", XrmoptionSepArg, NULL }, - { "-jail", "showJail", XrmoptionNoArg, "1" }, - { "-sidejail", "showJail", XrmoptionNoArg, "2" }, - { "-xjail", "showJail", XrmoptionNoArg, "0" }, - #endif - { "-showThinking", "showThinking", XrmoptionSepArg, NULL }, - { "-thinking", "showThinking", XrmoptionNoArg, "True" }, - { "-xthinking", "showThinking", XrmoptionNoArg, "False" }, - { "-ponderNextMove", "ponderNextMove", XrmoptionSepArg, NULL }, - { "-ponder", "ponderNextMove", XrmoptionNoArg, "True" }, - { "-xponder", "ponderNextMove", XrmoptionNoArg, "False" }, - { "-periodicUpdates", "periodicUpdates", XrmoptionSepArg, NULL }, - { "-periodic", "periodicUpdates", XrmoptionNoArg, "True" }, - { "-xperiodic", "periodicUpdates", XrmoptionNoArg, "False" }, - { "-clockFont", "clockFont", XrmoptionSepArg, NULL }, - { "-coordFont", "coordFont", XrmoptionSepArg, NULL }, - { "-font", "font", XrmoptionSepArg, NULL }, - { "-ringBellAfterMoves", "ringBellAfterMoves", XrmoptionSepArg, NULL }, - { "-bell", "ringBellAfterMoves", XrmoptionNoArg, "True" }, - { "-xbell", "ringBellAfterMoves", XrmoptionNoArg, "False" }, - { "-movesound", "ringBellAfterMoves", XrmoptionNoArg, "True" }, - { "-xmovesound", "ringBellAfterMoves", XrmoptionNoArg, "False" }, - { "-autoCallFlag", "autoCallFlag", XrmoptionSepArg, NULL }, - { "-autoflag", "autoCallFlag", XrmoptionNoArg, "True" }, - { "-xautoflag", "autoCallFlag", XrmoptionNoArg, "False" }, - { "-autoFlipView", "autoFlipView", XrmoptionSepArg, NULL }, - { "-autoflip", "autoFlipView", XrmoptionNoArg, "True" }, - { "-xautoflip", "autoFlipView", XrmoptionNoArg, "False" }, - { "-autoObserve", "autoObserve", XrmoptionSepArg, NULL }, - { "-autobs", "autoObserve", XrmoptionNoArg, "True" }, - { "-xautobs", "autoObserve", XrmoptionNoArg, "False" }, - { "-autoComment", "autoComment", XrmoptionSepArg, NULL }, - { "-autocomm", "autoComment", XrmoptionNoArg, "True" }, - { "-xautocomm", "autoComment", XrmoptionNoArg, "False" }, - { "-getMoveList", "getMoveList", XrmoptionSepArg, NULL }, - { "-moves", "getMoveList", XrmoptionNoArg, "True" }, - { "-xmoves", "getMoveList", XrmoptionNoArg, "False" }, - #if HIGHDRAG - { "-highlightDragging", "highlightDragging", XrmoptionSepArg, NULL }, - { "-highdrag", "highlightDragging", XrmoptionNoArg, "True" }, - { "-xhighdrag", "highlightDragging", XrmoptionNoArg, "False" }, - #endif - { "-highlightLastMove", "highlightLastMove", XrmoptionSepArg, NULL }, - { "-highlight", "highlightLastMove", XrmoptionNoArg, "True" }, - { "-xhighlight", "highlightLastMove", XrmoptionNoArg, "False" }, - { "-premove", "premove", XrmoptionSepArg, NULL }, - { "-pre", "premove", XrmoptionNoArg, "True" }, - { "-xpre", "premove", XrmoptionNoArg, "False" }, - { "-testLegality", "testLegality", XrmoptionSepArg, NULL }, - { "-legal", "testLegality", XrmoptionNoArg, "True" }, - { "-xlegal", "testLegality", XrmoptionNoArg, "False" }, - { "-flipView", "flipView", XrmoptionSepArg, NULL }, - { "-flip", "flipView", XrmoptionNoArg, "True" }, - { "-xflip", "flipView", XrmoptionNoArg, "False" }, - { "-cmail", "cmailGameName", XrmoptionSepArg, NULL }, - { "-alwaysPromoteToQueen", "alwaysPromoteToQueen", - XrmoptionSepArg, NULL }, - { "-queen", "alwaysPromoteToQueen", XrmoptionNoArg, "True" }, - { "-xqueen", "alwaysPromoteToQueen", XrmoptionNoArg, "False" }, - { "-oldSaveStyle", "oldSaveStyle", XrmoptionSepArg, NULL }, - { "-oldsave", "oldSaveStyle", XrmoptionNoArg, "True" }, - { "-xoldsave", "oldSaveStyle", XrmoptionNoArg, "False" }, - { "-quietPlay", "quietPlay", XrmoptionSepArg, NULL }, - { "-quiet", "quietPlay", XrmoptionNoArg, "True" }, - { "-xquiet", "quietPlay", XrmoptionNoArg, "False" }, - { "-titleInWindow", "titleInWindow", XrmoptionSepArg, NULL }, - { "-title", "titleInWindow", XrmoptionNoArg, "True" }, - { "-xtitle", "titleInWindow", XrmoptionNoArg, "False" }, - #ifdef ZIPPY - { "-zippyTalk", "zippyTalk", XrmoptionSepArg, NULL }, - { "-zt", "zippyTalk", XrmoptionNoArg, "True" }, - { "-xzt", "zippyTalk", XrmoptionNoArg, "False" }, - { "-zippyPlay", "zippyPlay", XrmoptionSepArg, NULL }, - { "-zp", "zippyPlay", XrmoptionNoArg, "True" }, - { "-xzp", "zippyPlay", XrmoptionNoArg, "False" }, - { "-zippyLines", "zippyLines", XrmoptionSepArg, NULL }, - { "-zippyPinhead", "zippyPinhead", XrmoptionSepArg, NULL }, - { "-zippyPassword", "zippyPassword", XrmoptionSepArg, NULL }, - { "-zippyPassword2", "zippyPassword2", XrmoptionSepArg, NULL }, - { "-zippyWrongPassword", "zippyWrongPassword", XrmoptionSepArg, NULL }, - { "-zippyAcceptOnly", "zippyAcceptOnly", XrmoptionSepArg, NULL }, - { "-zippyUseI", "zippyUseI", XrmoptionSepArg, NULL }, - { "-zui", "zippyUseI", XrmoptionNoArg, "True" }, - { "-xzui", "zippyUseI", XrmoptionNoArg, "False" }, - { "-zippyBughouse", "zippyBughouse", XrmoptionSepArg, NULL }, - { "-zippyNoplayCrafty", "zippyNoplayCrafty", XrmoptionSepArg, NULL }, - { "-znc", "zippyNoplayCrafty", XrmoptionNoArg, "True" }, - { "-xznc", "zippyNoplayCrafty", XrmoptionNoArg, "False" }, - { "-zippyGameEnd", "zippyGameEnd", XrmoptionSepArg, NULL }, - { "-zippyGameStart", "zippyGameStart", XrmoptionSepArg, NULL }, - { "-zippyAdjourn", "zippyAdjourn", XrmoptionSepArg, NULL }, - { "-zadj", "zippyAdjourn", XrmoptionNoArg, "True" }, - { "-xzadj", "zippyAdjourn", XrmoptionNoArg, "False" }, - { "-zippyAbort", "zippyAbort", XrmoptionSepArg, NULL }, - { "-zab", "zippyAbort", XrmoptionNoArg, "True" }, - { "-xzab", "zippyAbort", XrmoptionNoArg, "False" }, - { "-zippyVariants", "zippyVariants", XrmoptionSepArg, NULL }, - { "-zippyMaxGames", "zippyMaxGames", XrmoptionSepArg, NULL }, - { "-zippyReplayTimeout", "zippyReplayTimeout", XrmoptionSepArg, NULL }, - #endif - { "-flashCount", "flashCount", XrmoptionSepArg, NULL }, - { "-flash", "flashCount", XrmoptionNoArg, "3" }, - { "-xflash", "flashCount", XrmoptionNoArg, "0" }, - { "-flashRate", "flashRate", XrmoptionSepArg, NULL }, - { "-pixmapDirectory", "pixmapDirectory", XrmoptionSepArg, NULL }, - { "-msLoginDelay", "msLoginDelay", XrmoptionSepArg, NULL }, - { "-pixmap", "pixmapDirectory", XrmoptionSepArg, NULL }, - { "-colorizeMessages", "colorizeMessages", XrmoptionSepArg, NULL }, - { "-colorize", "colorizeMessages", XrmoptionNoArg, "True" }, - { "-xcolorize", "colorizeMessages", XrmoptionNoArg, "False" }, - { "-colorShout", "colorShout", XrmoptionSepArg, NULL }, - { "-colorSShout", "colorSShout", XrmoptionSepArg, NULL }, - { "-colorCShout", "colorSShout", XrmoptionSepArg, NULL }, /*FICS name*/ - { "-colorChannel1", "colorChannel1", XrmoptionSepArg, NULL }, - { "-colorChannel", "colorChannel", XrmoptionSepArg, NULL }, - { "-colorKibitz", "colorKibitz", XrmoptionSepArg, NULL }, - { "-colorTell", "colorTell", XrmoptionSepArg, NULL }, - { "-colorChallenge", "colorChallenge", XrmoptionSepArg, NULL }, - { "-colorRequest", "colorRequest", XrmoptionSepArg, NULL }, - { "-colorSeek", "colorSeek", XrmoptionSepArg, NULL }, - { "-colorNormal", "colorNormal", XrmoptionSepArg, NULL }, - { "-soundProgram", "soundProgram", XrmoptionSepArg, NULL }, - { "-soundShout", "soundShout", XrmoptionSepArg, NULL }, - { "-soundSShout", "soundSShout", XrmoptionSepArg, NULL }, - { "-soundCShout", "soundSShout", XrmoptionSepArg, NULL }, /*FICS name*/ - { "-soundChannel1", "soundChannel1", XrmoptionSepArg, NULL }, - { "-soundChannel", "soundChannel", XrmoptionSepArg, NULL }, - { "-soundKibitz", "soundKibitz", XrmoptionSepArg, NULL }, - { "-soundTell", "soundTell", XrmoptionSepArg, NULL }, - { "-soundChallenge", "soundChallenge", XrmoptionSepArg, NULL }, - { "-soundRequest", "soundRequest", XrmoptionSepArg, NULL }, - { "-soundSeek", "soundSeek", XrmoptionSepArg, NULL }, - { "-soundMove", "soundMove", XrmoptionSepArg, NULL }, - { "-soundIcsWin", "soundIcsWin", XrmoptionSepArg, NULL }, - { "-soundIcsLoss", "soundIcsLoss", XrmoptionSepArg, NULL }, - { "-soundIcsDraw", "soundIcsDraw", XrmoptionSepArg, NULL }, - { "-soundIcsUnfinished", "soundIcsUnfinished", XrmoptionSepArg, NULL }, - { "-soundIcsAlarm", "soundIcsAlarm", XrmoptionSepArg, NULL }, - { "-reuseFirst", "reuseFirst", XrmoptionSepArg, NULL }, - { "-reuseChessPrograms", "reuseFirst", XrmoptionSepArg, NULL }, /*compat*/ - { "-reuse", "reuseFirst", XrmoptionNoArg, "True" }, - { "-xreuse", "reuseFirst", XrmoptionNoArg, "False" }, - { "-reuseSecond", "reuseSecond", XrmoptionSepArg, NULL }, - { "-reuse2", "reuseSecond", XrmoptionNoArg, "True" }, - { "-xreuse2", "reuseSecond", XrmoptionNoArg, "False" }, - { "-animateMoving", "animateMoving", XrmoptionSepArg, NULL }, - { "-animate", "animateMoving", XrmoptionNoArg, "True" }, - { "-xanimate", "animateMoving", XrmoptionNoArg, "False" }, - { "-animateDragging", "animateDragging", XrmoptionSepArg, NULL }, - { "-drag", "animateDragging", XrmoptionNoArg, "True" }, - { "-xdrag", "animateDragging", XrmoptionNoArg, "False" }, - { "-animateSpeed", "animateSpeed", XrmoptionSepArg, NULL }, - { "-popupExitMessage", "popupExitMessage", XrmoptionSepArg, NULL }, - { "-exit", "popupExitMessage", XrmoptionNoArg, "True" }, - { "-xexit", "popupExitMessage", XrmoptionNoArg, "False" }, - { "-popupMoveErrors", "popupMoveErrors", XrmoptionSepArg, NULL }, - { "-popup", "popupMoveErrors", XrmoptionNoArg, "True" }, - { "-xpopup", "popupMoveErrors", XrmoptionNoArg, "False" }, - { "-fontSizeTolerance", "fontSizeTolerance", XrmoptionSepArg, NULL }, - { "-initialMode", "initialMode", XrmoptionSepArg, NULL }, - { "-mode", "initialMode", XrmoptionSepArg, NULL }, - { "-variant", "variant", XrmoptionSepArg, NULL }, - { "-firstProtocolVersion", "firstProtocolVersion", XrmoptionSepArg, NULL }, - { "-secondProtocolVersion","secondProtocolVersion",XrmoptionSepArg, NULL }, - { "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL }, - { "-buttons", "showButtonBar", XrmoptionNoArg, "True" }, - { "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" }, - }; - - - XtActionsRec boardActions[] = { - { "DrawPosition", DrawPositionProc }, - { "HandleUserMove", HandleUserMove }, - { "AnimateUserMove", AnimateUserMove }, - { "FileNameAction", FileNameAction }, - { "AskQuestionProc", AskQuestionProc }, - { "AskQuestionReplyAction", AskQuestionReplyAction }, - { "PieceMenuPopup", PieceMenuPopup }, - { "WhiteClock", WhiteClock }, - { "BlackClock", BlackClock }, - { "Iconify", Iconify }, - { "ResetProc", ResetProc }, - { "LoadGameProc", LoadGameProc }, - { "LoadNextGameProc", LoadNextGameProc }, - { "LoadPrevGameProc", LoadPrevGameProc }, - { "LoadSelectedProc", LoadSelectedProc }, - { "ReloadGameProc", ReloadGameProc }, - { "LoadPositionProc", LoadPositionProc }, - { "LoadNextPositionProc", LoadNextPositionProc }, - { "LoadPrevPositionProc", LoadPrevPositionProc }, - { "ReloadPositionProc", ReloadPositionProc }, - { "CopyPositionProc", CopyPositionProc }, - { "PastePositionProc", PastePositionProc }, - { "CopyGameProc", CopyGameProc }, - { "PasteGameProc", PasteGameProc }, - { "SaveGameProc", SaveGameProc }, - { "SavePositionProc", SavePositionProc }, - { "MailMoveProc", MailMoveProc }, - { "ReloadCmailMsgProc", ReloadCmailMsgProc }, - { "QuitProc", QuitProc }, - { "MachineWhiteProc", MachineWhiteProc }, - { "MachineBlackProc", MachineBlackProc }, - { "AnalysisModeProc", AnalyzeModeProc }, - { "AnalyzeFileProc", AnalyzeFileProc }, - { "TwoMachinesProc", TwoMachinesProc }, - { "IcsClientProc", IcsClientProc }, - { "EditGameProc", EditGameProc }, - { "EditPositionProc", EditPositionProc }, - { "TrainingProc", EditPositionProc }, - { "ShowGameListProc", ShowGameListProc }, - { "ShowMoveListProc", HistoryShowProc}, - { "EditTagsProc", EditCommentProc }, - { "EditCommentProc", EditCommentProc }, - { "IcsAlarmProc", IcsAlarmProc }, - { "IcsInputBoxProc", IcsInputBoxProc }, - { "PauseProc", PauseProc }, - { "AcceptProc", AcceptProc }, - { "DeclineProc", DeclineProc }, - { "RematchProc", RematchProc }, - { "CallFlagProc", CallFlagProc }, - { "DrawProc", DrawProc }, - { "AdjournProc", AdjournProc }, - { "AbortProc", AbortProc }, - { "ResignProc", ResignProc }, - { "EnterKeyProc", EnterKeyProc }, - { "StopObservingProc", StopObservingProc }, - { "StopExaminingProc", StopExaminingProc }, - { "BackwardProc", BackwardProc }, - { "ForwardProc", ForwardProc }, - { "ToStartProc", ToStartProc }, - { "ToEndProc", ToEndProc }, - { "RevertProc", RevertProc }, - { "TruncateGameProc", TruncateGameProc }, - { "MoveNowProc", MoveNowProc }, - { "RetractMoveProc", RetractMoveProc }, - { "AlwaysQueenProc", AlwaysQueenProc }, - { "AnimateDraggingProc", AnimateDraggingProc }, - { "AnimateMovingProc", AnimateMovingProc }, - { "AutoflagProc", AutoflagProc }, - { "AutoflipProc", AutoflipProc }, - { "AutobsProc", AutobsProc }, - { "AutoraiseProc", AutoraiseProc }, - { "AutosaveProc", AutosaveProc }, - { "BlindfoldProc", BlindfoldProc }, - { "FlashMovesProc", FlashMovesProc }, - { "FlipViewProc", FlipViewProc }, - { "GetMoveListProc", GetMoveListProc }, - #if HIGHDRAG - { "HighlightDraggingProc", HighlightDraggingProc }, - #endif - { "HighlightLastMoveProc", HighlightLastMoveProc }, - { "IcsAlarmProc", IcsAlarmProc }, - { "MoveSoundProc", MoveSoundProc }, - { "OldSaveStyleProc", OldSaveStyleProc }, - { "PeriodicUpdatesProc", PeriodicUpdatesProc }, - { "PonderNextMoveProc", PonderNextMoveProc }, - { "PopupExitMessageProc", PopupExitMessageProc }, - { "PopupMoveErrorsProc", PopupMoveErrorsProc }, - { "PremoveProc", PremoveProc }, - { "QuietPlayProc", QuietPlayProc }, - { "ShowCoordsProc", ShowCoordsProc }, - { "ShowThinkingProc", ShowThinkingProc }, - { "TestLegalityProc", TestLegalityProc }, - { "InfoProc", InfoProc }, - { "ManProc", ManProc }, - { "HintProc", HintProc }, - { "BookProc", BookProc }, - { "AboutGameProc", AboutGameProc }, - { "AboutProc", AboutProc }, - { "DebugProc", DebugProc }, - { "NothingProc", NothingProc }, - { "CommentPopDown", (XtActionProc) CommentPopDown }, - { "EditCommentPopDown", (XtActionProc) EditCommentPopDown }, - { "TagsPopDown", (XtActionProc) TagsPopDown }, - { "ErrorPopDown", (XtActionProc) ErrorPopDown }, - { "ICSInputBoxPopDown", (XtActionProc) ICSInputBoxPopDown }, - { "AnalysisPopDown", (XtActionProc) AnalysisPopDown }, - { "FileNamePopDown", (XtActionProc) FileNamePopDown }, - { "AskQuestionPopDown", (XtActionProc) AskQuestionPopDown }, - { "GameListPopDown", (XtActionProc) GameListPopDown }, - { "PromotionPopDown", (XtActionProc) PromotionPopDown }, - { "HistoryPopDown", (XtActionProc) HistoryPopDown }, - }; - - char globalTranslations[] = - ":R: ResignProc() \n \ - :r: ResetProc() \n \ - :g: LoadGameProc() \n \ - :N: LoadNextGameProc() \n \ - :P: LoadPrevGameProc() \n \ - :Q: QuitProc() \n \ - :F: ToEndProc() \n \ - :f: ForwardProc() \n \ - :B: ToStartProc() \n \ - :b: BackwardProc() \n \ - :p: PauseProc() \n \ - :d: DrawProc() \n \ - :t: CallFlagProc() \n \ - :i: Iconify() \n \ - :c: Iconify() \n \ - :v: FlipViewProc() \n \ - Control_L: BackwardProc() \n \ - Control_L: ForwardProc() \n \ - Control_R: BackwardProc() \n \ - Control_R: ForwardProc() \n \ - Shift1: AskQuestionProc(\"Direct command\",\ - \"Send to chess program:\",,1) \n \ - Shift2: AskQuestionProc(\"Direct command\",\ - \"Send to second chess program:\",,2) \n"; - - char boardTranslations[] = - ": HandleUserMove() \n \ - : HandleUserMove() \n \ - : AnimateUserMove() \n \ - Shift: XawPositionSimpleMenu(menuB) XawPositionSimpleMenu(menuD)\ - PieceMenuPopup(menuB) \n \ - Any: XawPositionSimpleMenu(menuW) XawPositionSimpleMenu(menuD) \ - PieceMenuPopup(menuW) \n \ - Shift: XawPositionSimpleMenu(menuW) XawPositionSimpleMenu(menuD)\ - PieceMenuPopup(menuW) \n \ - Any: XawPositionSimpleMenu(menuB) XawPositionSimpleMenu(menuD) \ - PieceMenuPopup(menuB) \n"; - - char whiteTranslations[] = ": WhiteClock()\n"; - char blackTranslations[] = ": BlackClock()\n"; - - char ICSInputTranslations[] = - "Return: EnterKeyProc() \n"; - - String xboardResources[] = { - "*fileName*value.translations: #override\\n Return: FileNameAction()", - "*question*value.translations: #override\\n Return: AskQuestionReplyAction()", - "*errorpopup*translations: #override\\n Return: ErrorPopDown()", - NULL - }; - - - /* Max possible square size */ - #define MAXSQSIZE 256 - - static int xpm_avail[MAXSQSIZE]; - - #ifdef HAVE_DIR_STRUCT - - /* Extract piece size from filename */ - static int - xpm_getsize(name, len, ext) - char *name; - int len; - char *ext; - { - char *p, *d; - char buf[10]; - - if (len < 4) - return 0; - - if ((p=strchr(name, '.')) == NULL || - StrCaseCmp(p+1, ext) != 0) - return 0; - - p = name + 3; - d = buf; - - while (*p && isdigit(*p)) - *(d++) = *(p++); - - *d = 0; - return atoi(buf); - } - - /* Setup xpm_avail */ - static int - xpm_getavail(dirname, ext) - char *dirname; - char *ext; - { - DIR *dir; - struct dirent *ent; - int i; - - for (i=0; id_name, NAMLEN(ent), ext); - if (i > 0 && i < MAXSQSIZE) - xpm_avail[i] = 1; - } - - closedir(dir); - - return 0; - } - - void - xpm_print_avail(fp, ext) - FILE *fp; - char *ext; - { - int i; - - fprintf(fp, _("Available `%s' sizes:\n"), ext); - for (i=1; i 99) /* watch bounds on buf */ - return -1; - - p = str; - d = buf; - for (i=0; iWM_PROTOCOLS: %s() \n", procname); - XtAugmentTranslations(w, XtParseTranslationTable(buf)); - } - - void - BoardToTop() - { - Arg args[16]; - XtSetArg(args[0], XtNiconic, False); - XtSetValues(shellWidget, args, 1); - - XtPopup(shellWidget, XtGrabNone); /* Raise if lowered */ - } - - int - main(argc, argv) - int argc; - char **argv; - { - int i, j, clockFontPxlSize, coordFontPxlSize, fontPxlSize; - XSetWindowAttributes window_attributes; - Arg args[16]; - Dimension timerWidth, boardWidth, w, h, sep, bor, wr, hr; - XrmValue vFrom, vTo; - XtGeometryResult gres; - char *p; - XrmDatabase xdb; - int forceMono = False; - - setbuf(stdout, NULL); - setbuf(stderr, NULL); - debugFP = stderr; - - programName = strrchr(argv[0], '/'); - if (programName == NULL) - programName = argv[0]; - else - programName++; - - #ifdef ENABLE_NLS - XtSetLanguageProc(NULL, NULL, NULL); - bindtextdomain(PRODUCT, LOCALEDIR); - bind_textdomain_codeset(PRODUCT, "UTF-8"); - textdomain(PRODUCT); - #endif - - shellWidget = - XtAppInitialize(&appContext, "XBoard", shellOptions, - XtNumber(shellOptions), - &argc, argv, xboardResources, NULL, 0); - if (argc > 1) { - fprintf(stderr, _("%s: unrecognized argument %s\n"), - programName, argv[1]); - exit(2); - } - - if ((chessDir = (char *) getenv("CHESSDIR")) == NULL) { - chessDir = "."; - } else { - if (chdir(chessDir) != 0) { - fprintf(stderr, _("%s: can't cd to CHESSDIR: "), programName); - perror(chessDir); - exit(1); - } - } - - p = getenv("HOME"); - if (p == NULL) p = "/tmp"; - i = strlen(p) + strlen("/.xboardXXXXXx.pgn") + 1; - gameCopyFilename = (char*) malloc(i); - gamePasteFilename = (char*) malloc(i); - sprintf(gameCopyFilename, "%s/.xboard%05uc.pgn", p, getpid()); - sprintf(gamePasteFilename, "%s/.xboard%05up.pgn", p, getpid()); - - XtGetApplicationResources(shellWidget, (XtPointer) &appData, - clientResources, XtNumber(clientResources), - NULL, 0); - - if (appData.debugMode) { - if ((debugFP = fopen("xboard.debug", "w")) == NULL) { - printf(_("Failed to open file xboard.debug \n")); - exit(errno); - } - setbuf(debugFP, NULL); - } - - #if !HIGHDRAG - /* This feature does not work; animation needs a rewrite */ - appData.highlightDragging = FALSE; - #endif - InitBackEnd1(); - - xDisplay = XtDisplay(shellWidget); - xScreen = DefaultScreen(xDisplay); - wm_delete_window = XInternAtom(xDisplay, "WM_DELETE_WINDOW", True); - - /* - * Determine boardSize - */ - if (isdigit(appData.boardSize[0])) { - i = sscanf(appData.boardSize, "%d,%d,%d,%d,%d,%d,%d", &squareSize, - &lineGap, &clockFontPxlSize, &coordFontPxlSize, - &fontPxlSize, &smallLayout, &tinyLayout); - if (i == 0) { - fprintf(stderr, _("%s: bad boardSize syntax %s\n"), - programName, appData.boardSize); - exit(2); - } - if (i < 7) { - /* Find some defaults; use the nearest known size */ - SizeDefaults *szd, *nearest; - int distance = 99999; - nearest = szd = sizeDefaults; - while (szd->name != NULL) { - if (abs(szd->squareSize - squareSize) < distance) { - nearest = szd; - distance = abs(szd->squareSize - squareSize); - if (distance == 0) break; - } - szd++; - } - if (i < 2) lineGap = nearest->lineGap; - if (i < 3) clockFontPxlSize = nearest->clockFontPxlSize; - if (i < 4) coordFontPxlSize = nearest->coordFontPxlSize; - if (i < 5) fontPxlSize = nearest->fontPxlSize; - if (i < 6) smallLayout = nearest->smallLayout; - if (i < 7) tinyLayout = nearest->tinyLayout; - } - } else { - SizeDefaults *szd = sizeDefaults; - if (*appData.boardSize == NULLCHAR) { - while (DisplayWidth(xDisplay, xScreen) < szd->minScreenSize || - DisplayHeight(xDisplay, xScreen) < szd->minScreenSize) { - szd++; - } - if (szd->name == NULL) szd--; - } else { - while (szd->name != NULL && - StrCaseCmp(szd->name, appData.boardSize) != 0) szd++; - if (szd->name == NULL) { - fprintf(stderr, _("%s: unrecognized boardSize name %s\n"), - programName, appData.boardSize); - exit(2); - } - } - squareSize = szd->squareSize; - lineGap = szd->lineGap; - clockFontPxlSize = szd->clockFontPxlSize; - coordFontPxlSize = szd->coordFontPxlSize; - fontPxlSize = szd->fontPxlSize; - smallLayout = szd->smallLayout; - tinyLayout = szd->tinyLayout; - } - - /* Now, using squareSize as a hint, find a good XPM/XIM set size */ - if (strlen(appData.pixmapDirectory) > 0) { - p = ExpandPathName(appData.pixmapDirectory); - if (!p) { - fprintf(stderr, _("Error expanding path name \"%s\"\n"), - appData.pixmapDirectory); - exit(1); - } - if (appData.debugMode) { - fprintf(stderr, _("\ - XBoard square size (hint): %d\n\ - %s fulldir:%s:\n"), squareSize, IMAGE_EXT, p); - } - squareSize = xpm_closest_to(p, squareSize, IMAGE_EXT); - if (appData.debugMode) { - fprintf(stderr, _("Closest %s size: %d\n"), IMAGE_EXT, squareSize); - } - } - - boardWidth = lineGap + BOARD_SIZE * (squareSize + lineGap); - if (appData.showJail == 1) { - /* Jail on top and bottom */ - XtSetArg(boardArgs[1], XtNwidth, boardWidth); - XtSetArg(boardArgs[2], XtNheight, - boardWidth + 2*(lineGap + squareSize)); - } else if (appData.showJail == 2) { - /* Jail on sides */ - XtSetArg(boardArgs[1], XtNwidth, - boardWidth + 2*(lineGap + squareSize)); - XtSetArg(boardArgs[2], XtNheight, boardWidth); - } else { - /* No jail */ - XtSetArg(boardArgs[1], XtNwidth, boardWidth); - XtSetArg(boardArgs[2], XtNheight, boardWidth); - } - - /* - * Determine what fonts to use. - */ - appData.clockFont = FindFont(appData.clockFont, clockFontPxlSize); - clockFontID = XLoadFont(xDisplay, appData.clockFont); - clockFontStruct = XQueryFont(xDisplay, clockFontID); - appData.coordFont = FindFont(appData.coordFont, coordFontPxlSize); - coordFontID = XLoadFont(xDisplay, appData.coordFont); - coordFontStruct = XQueryFont(xDisplay, coordFontID); - appData.font = FindFont(appData.font, fontPxlSize); - - xdb = XtDatabase(xDisplay); - XrmPutStringResource(&xdb, "*font", appData.font); - - /* - * Detect if there are not enough colors available and adapt. - */ - if (DefaultDepth(xDisplay, xScreen) <= 2) { - appData.monoMode = True; - } - - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.lightSquareColor; - vFrom.size = strlen(appData.lightSquareColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - lightSquareColor = *(Pixel *) vTo.addr; - } - } - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.darkSquareColor; - vFrom.size = strlen(appData.darkSquareColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - darkSquareColor = *(Pixel *) vTo.addr; - } - } - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.whitePieceColor; - vFrom.size = strlen(appData.whitePieceColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - whitePieceColor = *(Pixel *) vTo.addr; - } - } - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.blackPieceColor; - vFrom.size = strlen(appData.blackPieceColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - blackPieceColor = *(Pixel *) vTo.addr; - } - } - - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.highlightSquareColor; - vFrom.size = strlen(appData.highlightSquareColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - highlightSquareColor = *(Pixel *) vTo.addr; - } - } - - if (!appData.monoMode) { - vFrom.addr = (caddr_t) appData.premoveHighlightColor; - vFrom.size = strlen(appData.premoveHighlightColor); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - appData.monoMode = True; - forceMono = True; - } else { - premoveHighlightColor = *(Pixel *) vTo.addr; - } - } - - if (forceMono) { - fprintf(stderr, _("%s: too few colors available; trying monochrome mode\n"), - programName); - } - - if (appData.monoMode && appData.debugMode) { - fprintf(stderr, _("white pixel = 0x%lx, black pixel = 0x%lx\n"), - (unsigned long) XWhitePixel(xDisplay, xScreen), - (unsigned long) XBlackPixel(xDisplay, xScreen)); - } - - if (parse_cpair(ColorShout, appData.colorShout) < 0 || - parse_cpair(ColorSShout, appData.colorSShout) < 0 || - parse_cpair(ColorChannel1, appData.colorChannel1) < 0 || - parse_cpair(ColorChannel, appData.colorChannel) < 0 || - parse_cpair(ColorKibitz, appData.colorKibitz) < 0 || - parse_cpair(ColorTell, appData.colorTell) < 0 || - parse_cpair(ColorChallenge, appData.colorChallenge) < 0 || - parse_cpair(ColorRequest, appData.colorRequest) < 0 || - parse_cpair(ColorSeek, appData.colorSeek) < 0 || - parse_cpair(ColorNormal, appData.colorNormal) < 0) - { - if (appData.colorize) { - fprintf(stderr, - _("%s: can't parse color names; disabling colorization\n"), - programName); - } - appData.colorize = FALSE; - } - textColors[ColorNone].fg = textColors[ColorNone].bg = -1; - textColors[ColorNone].attr = 0; - - XtAppAddActions(appContext, boardActions, XtNumber(boardActions)); - - /* - * widget hierarchy - */ - if (tinyLayout) { - layoutName = "tinyLayout"; - } else if (smallLayout) { - layoutName = "smallLayout"; - } else { - layoutName = "normalLayout"; - } - /* Outer layoutWidget is there only to provide a name for use in - resources that depend on the layout style */ - layoutWidget = - XtCreateManagedWidget(layoutName, formWidgetClass, shellWidget, - layoutArgs, XtNumber(layoutArgs)); - formWidget = - XtCreateManagedWidget("form", formWidgetClass, layoutWidget, - formArgs, XtNumber(formArgs)); - XtSetArg(args[0], XtNdefaultDistance, &sep); - XtGetValues(formWidget, args, 1); - - j = 0; - widgetList[j++] = menuBarWidget = CreateMenuBar(menuBar); - - widgetList[j++] = whiteTimerWidget = - XtCreateWidget("whiteTime", labelWidgetClass, - formWidget, timerArgs, XtNumber(timerArgs)); - XtSetArg(args[0], XtNfont, clockFontStruct); - XtSetValues(whiteTimerWidget, args, 1); - - widgetList[j++] = blackTimerWidget = - XtCreateWidget("blackTime", labelWidgetClass, - formWidget, timerArgs, XtNumber(timerArgs)); - XtSetArg(args[0], XtNfont, clockFontStruct); - XtSetValues(blackTimerWidget, args, 1); - - if (appData.titleInWindow) { - widgetList[j++] = titleWidget = - XtCreateWidget("title", labelWidgetClass, formWidget, - titleArgs, XtNumber(titleArgs)); - } - - if (appData.showButtonBar) { - widgetList[j++] = buttonBarWidget = CreateButtonBar(buttonBar); - } - - widgetList[j++] = messageWidget = - XtCreateWidget("message", labelWidgetClass, formWidget, - messageArgs, XtNumber(messageArgs)); - - widgetList[j++] = boardWidget = - XtCreateWidget("board", widgetClass, formWidget, boardArgs, - XtNumber(boardArgs)); - - XtManageChildren(widgetList, j); - - timerWidth = (boardWidth - sep) / 2; - XtSetArg(args[0], XtNwidth, timerWidth); - XtSetValues(whiteTimerWidget, args, 1); - XtSetValues(blackTimerWidget, args, 1); - - XtSetArg(args[0], XtNbackground, &timerBackgroundPixel); - XtSetArg(args[1], XtNforeground, &timerForegroundPixel); - XtGetValues(whiteTimerWidget, args, 2); - - if (appData.showButtonBar) { - XtSetArg(args[0], XtNbackground, &buttonBackgroundPixel); - XtSetArg(args[1], XtNforeground, &buttonForegroundPixel); - XtGetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), args, 2); - } - - /* - * formWidget uses these constraints but they are stored - * in the children. - */ - i = 0; - XtSetArg(args[i], XtNfromHoriz, 0); i++; - XtSetValues(menuBarWidget, args, i); - if (appData.titleInWindow) { - if (smallLayout) { - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNjustify, XtJustifyLeft); i++; - XtSetValues(titleWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } else { - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, titleWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromHoriz, menuBarWidget); i++; - XtSetValues(titleWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } - } else { - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetValues(whiteTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; - XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; - XtSetValues(blackTimerWidget, args, i); - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; - XtSetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; - XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; - XtSetValues(buttonBarWidget, args, i); - } - } - i = 0; - XtSetArg(args[0], XtNfromVert, messageWidget); - XtSetValues(boardWidget, args, 1); - - XtRealizeWidget(shellWidget); - - /* - * Correct the width of the message and title widgets. - * It is not known why some systems need the extra fudge term. - * The value "2" is probably larger than needed. - */ - XawFormDoLayout(formWidget, False); - #define WIDTH_FUDGE 2 - i = 0; - XtSetArg(args[i], XtNborderWidth, &bor); i++; - XtSetArg(args[i], XtNheight, &h); i++; - XtGetValues(messageWidget, args, i); - if (appData.showButtonBar) { - i = 0; - XtSetArg(args[i], XtNwidth, &w); i++; - XtGetValues(buttonBarWidget, args, i); - w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; - } else { - w = boardWidth - 2*bor + 1; /*!! +1 compensates for kludge below */ - } - - gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } - - /* !! Horrible hack to work around bug in XFree86 4.0.1 (X11R6.4.3) */ - /* The size used for the child widget in layout lags one resize behind - its true size, so we resize a second time, 1 pixel smaller. Yeech! */ - w--; - gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } - /* !! end hack */ - - if (appData.titleInWindow) { - i = 0; - XtSetArg(args[i], XtNborderWidth, &bor); i++; - XtSetArg(args[i], XtNheight, &h); i++; - XtGetValues(titleWidget, args, i); - if (smallLayout) { - w = boardWidth - 2*bor; - } else { - XtSetArg(args[0], XtNwidth, &w); - XtGetValues(menuBarWidget, args, 1); - w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; - } - - gres = XtMakeResizeRequest(titleWidget, w, h, &wr, &hr); - if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, - _("%s: titleWidget geometry error %d %d %d %d %d\n"), - programName, gres, w, h, wr, hr); - } - } - XawFormDoLayout(formWidget, True); - - xBoardWindow = XtWindow(boardWidget); - - /* - * Create X checkmark bitmap and initialize option menu checks. - */ - ReadBitmap(&xMarkPixmap, "checkmark.bm", - checkmark_bits, checkmark_width, checkmark_height); - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - if (appData.alwaysPromoteToQueen) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"), - args, 1); - } - if (appData.animateDragging) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Animate Dragging"), - args, 1); - } - if (appData.animate) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Moving"), - args, 1); - } - if (appData.autoComment) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Comment"), - args, 1); - } - if (appData.autoCallFlag) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flag"), - args, 1); - } - if (appData.autoFlipView) { - XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Auto Flip View"), - args, 1); - } - if (appData.autoObserve) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Observe"), - args, 1); - } - if (appData.autoRaiseBoard) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Auto Raise Board"), args, 1); - } - if (appData.autoSaveGames) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - args, 1); - } - if (appData.saveGameFile[0] != NULLCHAR) { - /* Can't turn this off from menu */ - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - args, 1); - XtSetSensitive(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - False); - - } - if (appData.blindfold) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Blindfold"), args, 1); - } - if (appData.flashCount > 0) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Flash Moves"), - args, 1); - } - if (appData.getMoveList) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Get Move List"), - args, 1); - } - #if HIGHDRAG - if (appData.highlightDragging) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Dragging"), - args, 1); - } - #endif - if (appData.highlightLastMove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Last Move"), - args, 1); - } - if (appData.icsAlarm) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.ICS Alarm"), - args, 1); - } - if (appData.ringBellAfterMoves) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Move Sound"), - args, 1); - } - if (appData.oldSaveStyle) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Old Save Style"), args, 1); - } - if (appData.periodicUpdates) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Periodic Updates"), args, 1); - } - if (appData.ponderNextMove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Ponder Next Move"), args, 1); - } - if (appData.popupExitMessage) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Popup Exit Message"), args, 1); - } - if (appData.popupMoveErrors) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Popup Move Errors"), args, 1); - } - if (appData.premove) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Premove"), args, 1); - } - if (appData.quietPlay) { - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Quiet Play"), args, 1); - } - if (appData.showCoords) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), - args, 1); - } - if (appData.showThinking) { - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Thinking"), - args, 1); - } - if (appData.testLegality) { - XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"), - args, 1); - } - - /* - * Create an icon. - */ - ReadBitmap(&wIconPixmap, "icon_white.bm", - icon_white_bits, icon_white_width, icon_white_height); - ReadBitmap(&bIconPixmap, "icon_black.bm", - icon_black_bits, icon_black_width, icon_black_height); - iconPixmap = wIconPixmap; - i = 0; - XtSetArg(args[i], XtNiconPixmap, iconPixmap); i++; - XtSetValues(shellWidget, args, i); - - /* - * Create a cursor for the board widget. - */ - window_attributes.cursor = XCreateFontCursor(xDisplay, XC_hand2); - XChangeWindowAttributes(xDisplay, xBoardWindow, - CWCursor, &window_attributes); - - /* - * Inhibit shell resizing. - */ - shellArgs[0].value = (XtArgVal) &w; - shellArgs[1].value = (XtArgVal) &h; - XtGetValues(shellWidget, shellArgs, 2); - shellArgs[4].value = shellArgs[2].value = w; - shellArgs[5].value = shellArgs[3].value = h; - XtSetValues(shellWidget, &shellArgs[2], 4); - - CatchDeleteWindow(shellWidget, "QuitProc"); - - CreateGCs(); - CreateGrid(); - #if HAVE_LIBXPM - if (appData.bitmapDirectory[0] != NULLCHAR) { - CreatePieces(); - } else { - CreateXPMPieces(); - } - #else - CreateXIMPieces(); - /* Create regular pieces */ - if (!useImages) CreatePieces(); - #endif - - CreatePieceMenus(); - - if (appData.animate || appData.animateDragging) - CreateAnimVars(); - - XtAugmentTranslations(formWidget, - XtParseTranslationTable(globalTranslations)); - XtAugmentTranslations(boardWidget, - XtParseTranslationTable(boardTranslations)); - XtAugmentTranslations(whiteTimerWidget, - XtParseTranslationTable(whiteTranslations)); - XtAugmentTranslations(blackTimerWidget, - XtParseTranslationTable(blackTranslations)); - - /* Why is the following needed on some versions of X instead - * of a translation? */ - XtAddEventHandler(boardWidget, ExposureMask, False, - (XtEventHandler) EventProc, NULL); - /* end why */ - - InitBackEnd2(); - - if (errorExitStatus == -1) { - if (appData.icsActive) { - /* We now wait until we see "login:" from the ICS before - sending the logon script (problems with timestamp otherwise) */ - /*ICSInitScript();*/ - if (appData.icsInputBox) ICSInputBoxPopUp(); - } - - signal(SIGINT, IntSigHandler); - signal(SIGTERM, IntSigHandler); - if (*appData.cmailGameName != NULLCHAR) { - signal(SIGUSR1, CmailSigHandler); - } - } - - XtAppMainLoop(appContext); - if (appData.debugMode) fclose(debugFP); - - return 0; - } - - void - ShutDownFrontEnd() - { - if (appData.icsActive && oldICSInteractionTitle != NULL) { - DisplayIcsInteractionTitle(oldICSInteractionTitle); - } - unlink(gameCopyFilename); - unlink(gamePasteFilename); - } - - RETSIGTYPE - IntSigHandler(sig) - int sig; - { - ExitEvent(sig); - } - - RETSIGTYPE - CmailSigHandler(sig) - int sig; - { - int dummy = 0; - int error; - - signal(SIGUSR1, SIG_IGN); /* suspend handler */ - - /* Activate call-back function CmailSigHandlerCallBack() */ - OutputToProcess(cmailPR, (char *)(&dummy), sizeof(int), &error); - - signal(SIGUSR1, CmailSigHandler); /* re-activate handler */ - } - - void - CmailSigHandlerCallBack(isr, closure, message, count, error) - InputSourceRef isr; - VOIDSTAR closure; - char *message; - int count; - int error; - { - BoardToTop(); - ReloadCmailMsgEvent(TRUE); /* Reload cmail msg */ - } - /**** end signal code ****/ - - - void - ICSInitScript() - { - FILE *f; - char buf[MSG_SIZ]; - char *p; - - f = fopen(appData.icsLogon, "r"); - if (f == NULL) { - p = getenv("HOME"); - if (p != NULL) { - strcpy(buf, p); - strcat(buf, "/"); - strcat(buf, appData.icsLogon); - f = fopen(buf, "r"); - } - } - if (f != NULL) - ProcessICSInitScript(f); - } - - void - ResetFrontEnd() - { - CommentPopDown(); - EditCommentPopDown(); - TagsPopDown(); - return; - } - - typedef struct { - char *name; - Boolean value; - } Enables; - - void - SetMenuEnables(enab) - Enables *enab; - { - Widget w; - if (!menuBarWidget) return; - while (enab->name != NULL) { - w = XtNameToWidget(menuBarWidget, enab->name); - if (w == NULL) { - DisplayError(enab->name, 0); - } else { - XtSetSensitive(w, enab->value); - } - enab++; - } - } - - Enables icsEnables[] = { - { "menuFile.Mail Move", False }, - { "menuFile.Reload CMail Message", False }, - { "menuMode.Machine Black", False }, - { "menuMode.Machine White", False }, - { "menuMode.Analysis Mode", False }, - { "menuMode.Analyze File", False }, - { "menuMode.Two Machines", False }, - #ifndef ZIPPY - { "menuHelp.Hint", False }, - { "menuHelp.Book", False }, - { "menuStep.Move Now", False }, - { "menuOptions.Periodic Updates", False }, - { "menuOptions.Show Thinking", False }, - { "menuOptions.Ponder Next Move", False }, - #endif - { NULL, False } - }; - - Enables ncpEnables[] = { - { "menuFile.Mail Move", False }, - { "menuFile.Reload CMail Message", False }, - { "menuMode.Machine White", False }, - { "menuMode.Machine Black", False }, - { "menuMode.Analysis Mode", False }, - { "menuMode.Analyze File", False }, - { "menuMode.Two Machines", False }, - { "menuMode.ICS Client", False }, - { "menuMode.ICS Input Box", False }, - { "Action", False }, - { "menuStep.Revert", False }, - { "menuStep.Move Now", False }, - { "menuStep.Retract Move", False }, - { "menuOptions.Auto Comment", False }, - { "menuOptions.Auto Flag", False }, - { "menuOptions.Auto Flip View", False }, - { "menuOptions.Auto Observe", False }, - { "menuOptions.Auto Raise Board", False }, - { "menuOptions.Get Move List", False }, - { "menuOptions.ICS Alarm", False }, - { "menuOptions.Move Sound", False }, - { "menuOptions.Quiet Play", False }, - { "menuOptions.Show Thinking", False }, - { "menuOptions.Periodic Updates", False }, - { "menuOptions.Ponder Next Move", False }, - { "menuHelp.Hint", False }, - { "menuHelp.Book", False }, - { NULL, False } - }; - - Enables gnuEnables[] = { - { "menuMode.ICS Client", False }, - { "menuMode.ICS Input Box", False }, - { "menuAction.Accept", False }, - { "menuAction.Decline", False }, - { "menuAction.Rematch", False }, - { "menuAction.Adjourn", False }, - { "menuAction.Stop Examining", False }, - { "menuAction.Stop Observing", False }, - { "menuStep.Revert", False }, - { "menuOptions.Auto Comment", False }, - { "menuOptions.Auto Observe", False }, - { "menuOptions.Auto Raise Board", False }, - { "menuOptions.Get Move List", False }, - { "menuOptions.Premove", False }, - { "menuOptions.Quiet Play", False }, - - /* The next two options rely on SetCmailMode being called *after* */ - /* SetGNUMode so that when GNU is being used to give hints these */ - /* menu options are still available */ - - { "menuFile.Mail Move", False }, - { "menuFile.Reload CMail Message", False }, - { NULL, False } - }; - - Enables cmailEnables[] = { - { "Action", True }, - { "menuAction.Call Flag", False }, - { "menuAction.Draw", True }, - { "menuAction.Adjourn", False }, - { "menuAction.Abort", False }, - { "menuAction.Stop Observing", False }, - { "menuAction.Stop Examining", False }, - { "menuFile.Mail Move", True }, - { "menuFile.Reload CMail Message", True }, - { NULL, False } - }; - - Enables trainingOnEnables[] = { - { "menuMode.Edit Comment", False }, - { "menuMode.Pause", False }, - { "menuStep.Forward", False }, - { "menuStep.Backward", False }, - { "menuStep.Forward to End", False }, - { "menuStep.Back to Start", False }, - { "menuStep.Move Now", False }, - { "menuStep.Truncate Game", False }, - { NULL, False } - }; - - Enables trainingOffEnables[] = { - { "menuMode.Edit Comment", True }, - { "menuMode.Pause", True }, - { "menuStep.Forward", True }, - { "menuStep.Backward", True }, - { "menuStep.Forward to End", True }, - { "menuStep.Back to Start", True }, - { "menuStep.Move Now", True }, - { "menuStep.Truncate Game", True }, - { NULL, False } - }; - - Enables machineThinkingEnables[] = { - { "menuFile.Load Game", False }, - { "menuFile.Load Next Game", False }, - { "menuFile.Load Previous Game", False }, - { "menuFile.Reload Same Game", False }, - { "menuFile.Paste Game", False }, - { "menuFile.Load Position", False }, - { "menuFile.Load Next Position", False }, - { "menuFile.Load Previous Position", False }, - { "menuFile.Reload Same Position", False }, - { "menuFile.Paste Position", False }, - { "menuMode.Machine White", False }, - { "menuMode.Machine Black", False }, - { "menuMode.Two Machines", False }, - { "menuStep.Retract Move", False }, - { NULL, False } - }; - - Enables userThinkingEnables[] = { - { "menuFile.Load Game", True }, - { "menuFile.Load Next Game", True }, - { "menuFile.Load Previous Game", True }, - { "menuFile.Reload Same Game", True }, - { "menuFile.Paste Game", True }, - { "menuFile.Load Position", True }, - { "menuFile.Load Next Position", True }, - { "menuFile.Load Previous Position", True }, - { "menuFile.Reload Same Position", True }, - { "menuFile.Paste Position", True }, - { "menuMode.Machine White", True }, - { "menuMode.Machine Black", True }, - { "menuMode.Two Machines", True }, - { "menuStep.Retract Move", True }, - { NULL, False } - }; - - void SetICSMode() - { - SetMenuEnables(icsEnables); - - #ifdef ZIPPY - /* icsEngineAnalyze */ - if (appData.zippyPlay && !appData.noChessProgram) - XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Analysis Mode"), True); - #endif - } - - void - SetNCPMode() - { - SetMenuEnables(ncpEnables); - } - - void - SetGNUMode() - { - SetMenuEnables(gnuEnables); - } - - void - SetCmailMode() - { - SetMenuEnables(cmailEnables); - } - - void - SetTrainingModeOn() - { - SetMenuEnables(trainingOnEnables); - if (appData.showButtonBar) { - XtSetSensitive(buttonBarWidget, False); - } - CommentPopDown(); - } - - void - SetTrainingModeOff() - { - SetMenuEnables(trainingOffEnables); - if (appData.showButtonBar) { - XtSetSensitive(buttonBarWidget, True); - } - } - - void - SetUserThinkingEnables() - { - if (appData.noChessProgram) return; - SetMenuEnables(userThinkingEnables); - } - - void - SetMachineThinkingEnables() - { - if (appData.noChessProgram) return; - SetMenuEnables(machineThinkingEnables); - switch (gameMode) { - case MachinePlaysBlack: - case MachinePlaysWhite: - case TwoMachinesPlay: - XtSetSensitive(XtNameToWidget(menuBarWidget, - ModeToWidgetName(gameMode)), True); - break; - default: - break; - } - } - - #define Abs(n) ((n)<0 ? -(n) : (n)) - - /* - * Find a font that matches "pattern" that is as close as - * possible to the targetPxlSize. Prefer fonts that are k - * pixels smaller to fonts that are k pixels larger. The - * pattern must be in the X Consortium standard format, - * e.g. "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*". - * The return value should be freed with XtFree when no - * longer needed. - */ - char *FindFont(pattern, targetPxlSize) - char *pattern; - int targetPxlSize; - { - char **fonts, *p, *best, *scalable, *scalableTail; - int i, j, nfonts, minerr, err, pxlSize; - - #ifdef ENABLE_NLS - char **missing_list; - int missing_count; - char *def_string, *base_fnt_lst, strInt[3]; - XFontSet fntSet; - XFontStruct **fnt_list; - - base_fnt_lst = calloc(1, strlen(pattern) + 3); - sprintf(strInt, "%d", targetPxlSize); - p = strstr(pattern, "--"); - strncpy(base_fnt_lst, pattern, p - pattern + 2); - strcat(base_fnt_lst, strInt); - strcat(base_fnt_lst, strchr(p + 2, '-')); - - if ((fntSet = XCreateFontSet(xDisplay, - base_fnt_lst, - &missing_list, - &missing_count, - &def_string)) == NULL) { - - fprintf(stderr, _("Unable to create font set.\n")); - exit (2); - } - - nfonts = XFontsOfFontSet(fntSet, &fnt_list, &fonts); - #else - fonts = XListFonts(xDisplay, pattern, 999999, &nfonts); - if (nfonts < 1) { - fprintf(stderr, _("%s: no fonts match pattern %s\n"), - programName, pattern); - exit(2); - } - #endif - - best = fonts[0]; - scalable = NULL; - minerr = 999999; - for (i=0; i 0 && err < 0 && -err == minerr)) { - best = fonts[i]; - minerr = err; - } - } - } - if (scalable && Abs(minerr) > appData.fontSizeTolerance) { - /* If the error is too big and there is a scalable font, - use the scalable font. */ - int headlen = scalableTail - scalable; - p = (char *) XtMalloc(strlen(scalable) + 10); - while (isdigit(*scalableTail)) scalableTail++; - sprintf(p, "%.*s%d%s", headlen, scalable, targetPxlSize, scalableTail); - } else { - p = (char *) XtMalloc(strlen(best) + 1); - strcpy(p, best); - } - if (appData.debugMode) { - fprintf(debugFP, _("resolved %s at pixel size %d\n to %s\n"), - pattern, targetPxlSize, p); - } - #ifdef ENABLE_NLS - if (missing_count > 0) - XFreeStringList(missing_list); - XFreeFontSet(xDisplay, fntSet); - #else - XFreeFontNames(fonts); - #endif - return p; - } - - void CreateGCs() - { - XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground - | GCBackground | GCFunction | GCPlaneMask; - XGCValues gc_values; - GC copyInvertedGC; - - gc_values.plane_mask = AllPlanes; - gc_values.line_width = lineGap; - gc_values.line_style = LineSolid; - gc_values.function = GXcopy; - - gc_values.foreground = XBlackPixel(xDisplay, xScreen); - gc_values.background = XBlackPixel(xDisplay, xScreen); - lineGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = XBlackPixel(xDisplay, xScreen); - gc_values.background = XWhitePixel(xDisplay, xScreen); - coordGC = XtGetGC(shellWidget, value_mask, &gc_values); - XSetFont(xDisplay, coordGC, coordFontID); - - if (appData.monoMode) { - gc_values.foreground = XWhitePixel(xDisplay, xScreen); - gc_values.background = XWhitePixel(xDisplay, xScreen); - highlineGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = XWhitePixel(xDisplay, xScreen); - gc_values.background = XBlackPixel(xDisplay, xScreen); - lightSquareGC = wbPieceGC - = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = XBlackPixel(xDisplay, xScreen); - gc_values.background = XWhitePixel(xDisplay, xScreen); - darkSquareGC = bwPieceGC - = XtGetGC(shellWidget, value_mask, &gc_values); - - if (DefaultDepth(xDisplay, xScreen) == 1) { - /* Avoid XCopyPlane on 1-bit screens to work around Sun bug */ - gc_values.function = GXcopyInverted; - copyInvertedGC = XtGetGC(shellWidget, value_mask, &gc_values); - gc_values.function = GXcopy; - if (XBlackPixel(xDisplay, xScreen) == 1) { - bwPieceGC = darkSquareGC; - wbPieceGC = copyInvertedGC; - } else { - bwPieceGC = copyInvertedGC; - wbPieceGC = lightSquareGC; - } - } - } else { - gc_values.foreground = highlightSquareColor; - gc_values.background = highlightSquareColor; - highlineGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = premoveHighlightColor; - gc_values.background = premoveHighlightColor; - prelineGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = lightSquareColor; - gc_values.background = darkSquareColor; - lightSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = darkSquareColor; - gc_values.background = lightSquareColor; - darkSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = jailSquareColor; - gc_values.background = jailSquareColor; - jailSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = whitePieceColor; - gc_values.background = darkSquareColor; - wdPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = whitePieceColor; - gc_values.background = lightSquareColor; - wlPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = whitePieceColor; - gc_values.background = jailSquareColor; - wjPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = blackPieceColor; - gc_values.background = darkSquareColor; - bdPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = blackPieceColor; - gc_values.background = lightSquareColor; - blPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - - gc_values.foreground = blackPieceColor; - gc_values.background = jailSquareColor; - bjPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); - } - } - - void loadXIM(xim, xmask, filename, dest, mask) - XImage *xim; - XImage *xmask; - char *filename; - Pixmap *dest; - Pixmap *mask; - { - int x, y, w, h, p; - FILE *fp; - Pixmap temp; - XGCValues values; - GC maskGC; - - fp = fopen(filename, "rb"); - if (!fp) { - fprintf(stderr, _("%s: error loading XIM!\n"), programName); - exit(1); - } - - w = fgetc(fp); - h = fgetc(fp); - - for (y=0; ydepth); - XPutImage(xDisplay, *dest, lightSquareGC, xim, - 0, 0, 0, 0, w, h); - - /* create Pixmap of clipmask - Note: We assume the white/black pieces have the same - outline, so we make only 6 masks. This is okay - since the XPM clipmask routines do the same. */ - if (xmask) { - temp = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay), - w, h, xim->depth); - XPutImage(xDisplay, temp, lightSquareGC, xmask, - 0, 0, 0, 0, w, h); - - /* now create the 1-bit version */ - *mask = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay), - w, h, 1); - - values.foreground = 1; - values.background = 0; - - /* Don't use XtGetGC, not read only */ - maskGC = XCreateGC(xDisplay, *mask, - GCForeground | GCBackground, &values); - XCopyPlane(xDisplay, temp, *mask, maskGC, - 0, 0, squareSize, squareSize, 0, 0, 1); - XFreePixmap(xDisplay, temp); - } - } - - void CreateXIMPieces() - { - int piece, kind; - char buf[MSG_SIZ]; - u_int ss; - static char *ximkind[] = { "ll", "ld", "dl", "dd" }; - XImage *ximtemp; - - ss = squareSize; - - /* The XSynchronize calls were copied from CreatePieces. - Not sure if needed, but can't hurt */ - XSynchronize(xDisplay, True); /* Work-around for xlib/xt - buffering bug */ - - /* temp needed by loadXIM() */ - ximtemp = XGetImage(xDisplay, DefaultRootWindow(xDisplay), - 0, 0, ss, ss, AllPlanes, XYPixmap); - - if (strlen(appData.pixmapDirectory) == 0) { - useImages = 0; - } else { - useImages = 1; - if (appData.monoMode) { - DisplayFatalError(_("XIM pieces cannot be used in monochrome mode"), - 0, 2); - ExitEvent(2); - } - fprintf(stderr, _("\nLoading XIMs...\n")); - /* Load pieces */ - for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { - fprintf(stderr, "%d", piece+1); - for (kind=0; kind<4; kind++) { - fprintf(stderr, "."); - sprintf(buf, "%s/%c%s%u.xim", - ExpandPathName(appData.pixmapDirectory), - ToLower(PieceToChar((ChessSquare)piece)), - ximkind[kind], ss); - ximPieceBitmap[kind][piece] = - XGetImage(xDisplay, DefaultRootWindow(xDisplay), - 0, 0, ss, ss, AllPlanes, XYPixmap); - if (appData.debugMode) - fprintf(stderr, _("(File:%s:) "), buf); - loadXIM(ximPieceBitmap[kind][piece], - ximtemp, buf, - &(xpmPieceBitmap[kind][piece]), - &(ximMaskPm[piece%6])); - } - fprintf(stderr," "); - } - /* Load light and dark squares */ - /* If the LSQ and DSQ pieces don't exist, we will - draw them with solid squares. */ - sprintf(buf, "%s/lsq%u.xim", ExpandPathName(appData.pixmapDirectory), ss); - if (access(buf, 0) != 0) { - useImageSqs = 0; - } else { - useImageSqs = 1; - fprintf(stderr, _("light square ")); - ximLightSquare= - XGetImage(xDisplay, DefaultRootWindow(xDisplay), - 0, 0, ss, ss, AllPlanes, XYPixmap); - if (appData.debugMode) - fprintf(stderr, _("(File:%s:) "), buf); - - loadXIM(ximLightSquare, NULL, buf, &xpmLightSquare, NULL); - fprintf(stderr, _("dark square ")); - sprintf(buf, "%s/dsq%u.xim", - ExpandPathName(appData.pixmapDirectory), ss); - if (appData.debugMode) - fprintf(stderr, _("(File:%s:) "), buf); - ximDarkSquare= - XGetImage(xDisplay, DefaultRootWindow(xDisplay), - 0, 0, ss, ss, AllPlanes, XYPixmap); - loadXIM(ximDarkSquare, NULL, buf, &xpmDarkSquare, NULL); - xpmJailSquare = xpmLightSquare; - } - fprintf(stderr, _("Done.\n")); - } - XSynchronize(xDisplay, False); /* Work-around for xlib/xt buffering bug */ - } - - #if HAVE_LIBXPM - void CreateXPMPieces() - { - int piece, kind, r; - char buf[MSG_SIZ]; - u_int ss = squareSize; - XpmAttributes attr; - static char *xpmkind[] = { "ll", "ld", "dl", "dd" }; - XpmColorSymbol symbols[4]; - - #if 0 - /* Apparently some versions of Xpm don't define XpmFormat at all --tpm */ - if (appData.debugMode) { - fprintf(stderr, "XPM Library Version: %d.%d%c\n", - XpmFormat, XpmVersion, (char)('a' + XpmRevision - 1)); - } - #endif - - /* The XSynchronize calls were copied from CreatePieces. - Not sure if needed, but can't hurt */ - XSynchronize(xDisplay, True); /* Work-around for xlib/xt buffering bug */ - - /* Setup translations so piece colors match square colors */ - symbols[0].name = "light_piece"; - symbols[0].value = appData.whitePieceColor; - symbols[1].name = "dark_piece"; - symbols[1].value = appData.blackPieceColor; - symbols[2].name = "light_square"; - symbols[2].value = appData.lightSquareColor; - symbols[3].name = "dark_square"; - symbols[3].value = appData.darkSquareColor; - - attr.valuemask = XpmColorSymbols; - attr.colorsymbols = symbols; - attr.numsymbols = 4; - - if (appData.monoMode) { - DisplayFatalError(_("XPM pieces cannot be used in monochrome mode"), - 0, 2); - ExitEvent(2); - } - if (strlen(appData.pixmapDirectory) == 0) { - XpmPieces* pieces = builtInXpms; - useImages = 1; - /* Load pieces */ - while (pieces->size != squareSize && pieces->size) pieces++; - if (!pieces->size) { - fprintf(stderr, _("No builtin XPM pieces of size %d\n"), squareSize); - exit(1); - } - for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { - for (kind=0; kind<4; kind++) { - - if ((r=XpmCreatePixmapFromData(xDisplay, xBoardWindow, - pieces->xpm[piece][kind], - &(xpmPieceBitmap[kind][piece]), - NULL, &attr)) != 0) { - fprintf(stderr, _("Error %d loading XPM image \"%s\"\n"), - r, buf); - exit(1); - } - } - } - useImageSqs = 0; - xpmJailSquare = xpmLightSquare; - } else { - useImages = 1; - - fprintf(stderr, _("\nLoading XPMs...\n")); - - /* Load pieces */ - for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { - fprintf(stderr, "%d ", piece+1); - for (kind=0; kind<4; kind++) { - sprintf(buf, "%s/%c%s%u.xpm", - ExpandPathName(appData.pixmapDirectory), - ToLower(PieceToChar((ChessSquare)piece)), - xpmkind[kind], ss); - if (appData.debugMode) { - fprintf(stderr, _("(File:%s:) "), buf); - } - if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, - &(xpmPieceBitmap[kind][piece]), - NULL, &attr)) != 0) { - fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), - r, buf); - exit(1); - } - } - } - /* Load light and dark squares */ - /* If the LSQ and DSQ pieces don't exist, we will - draw them with solid squares. */ - fprintf(stderr, _("light square ")); - sprintf(buf, "%s/lsq%u.xpm", ExpandPathName(appData.pixmapDirectory), ss); - if (access(buf, 0) != 0) { - useImageSqs = 0; - } else { - useImageSqs = 1; - if (appData.debugMode) - fprintf(stderr, _("(File:%s:) "), buf); - - if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, - &xpmLightSquare, NULL, &attr)) != 0) { - fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), r, buf); - exit(1); - } - fprintf(stderr, _("dark square ")); - sprintf(buf, "%s/dsq%u.xpm", - ExpandPathName(appData.pixmapDirectory), ss); - if (appData.debugMode) { - fprintf(stderr, _("(File:%s:) "), buf); - } - if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, - &xpmDarkSquare, NULL, &attr)) != 0) { - fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), r, buf); - exit(1); - } - } - xpmJailSquare = xpmLightSquare; - fprintf(stderr, _("Done.\n")); - } - XSynchronize(xDisplay, False); /* Work-around for xlib/xt - buffering bug */ - } - #endif /* HAVE_LIBXPM */ - - #if HAVE_LIBXPM - /* No built-in bitmaps */ - void CreatePieces() - { - int piece, kind; - char buf[MSG_SIZ]; - u_int ss = squareSize; - - XSynchronize(xDisplay, True); /* Work-around for xlib/xt - buffering bug */ - - for (kind = SOLID; kind <= (appData.monoMode ? OUTLINE : SOLID); kind++) { - for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { - sprintf(buf, "%c%u%c.bm", ToLower(PieceToChar((ChessSquare)piece)), - ss, kind == SOLID ? 's' : 'o'); - ReadBitmap(&pieceBitmap[kind][piece], buf, NULL, ss, ss); - } - } - - XSynchronize(xDisplay, False); /* Work-around for xlib/xt - buffering bug */ - } - #else - /* With built-in bitmaps */ - void CreatePieces() - { - BuiltInBits* bib = builtInBits; - int piece, kind; - char buf[MSG_SIZ]; - u_int ss = squareSize; - - XSynchronize(xDisplay, True); /* Work-around for xlib/xt - buffering bug */ - - while (bib->squareSize != ss && bib->squareSize != 0) bib++; - - for (kind = SOLID; kind <= (appData.monoMode ? OUTLINE : SOLID); kind++) { - for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { - sprintf(buf, "%c%u%c.bm", ToLower(PieceToChar((ChessSquare)piece)), - ss, kind == SOLID ? 's' : 'o'); - ReadBitmap(&pieceBitmap[kind][piece], buf, - bib->bits[kind][piece], ss, ss); - } - } - - XSynchronize(xDisplay, False); /* Work-around for xlib/xt - buffering bug */ - } - #endif - - void ReadBitmap(pm, name, bits, wreq, hreq) - Pixmap *pm; - String name; - unsigned char bits[]; - u_int wreq, hreq; - { - int x_hot, y_hot; - u_int w, h; - int errcode; - char msg[MSG_SIZ], fullname[MSG_SIZ]; - - if (*appData.bitmapDirectory != NULLCHAR) { - strcpy(fullname, appData.bitmapDirectory); - strcat(fullname, "/"); - strcat(fullname, name); - errcode = XReadBitmapFile(xDisplay, xBoardWindow, fullname, - &w, &h, pm, &x_hot, &y_hot); - if (errcode != BitmapSuccess) { - switch (errcode) { - case BitmapOpenFailed: - sprintf(msg, _("Can't open bitmap file %s"), fullname); - break; - case BitmapFileInvalid: - sprintf(msg, _("Invalid bitmap in file %s"), fullname); - break; - case BitmapNoMemory: - sprintf(msg, _("Ran out of memory reading bitmap file %s"), - fullname); - break; - default: - sprintf(msg, _("Unknown XReadBitmapFile error %d on file %s"), - errcode, fullname); - break; - } - fprintf(stderr, _("%s: %s...using built-in\n"), - programName, msg); - } else if (w != wreq || h != hreq) { - fprintf(stderr, - _("%s: Bitmap %s is %dx%d, not %dx%d...using built-in\n"), - programName, fullname, w, h, wreq, hreq); - } else { - return; - } - } - if (bits == NULL) { - fprintf(stderr, _("%s: No built-in bitmap for %s; giving up\n"), - programName, name); - exit(1); - } else { - *pm = XCreateBitmapFromData(xDisplay, xBoardWindow, (char *) bits, - wreq, hreq); - } - } - - void CreateGrid() - { - int i; - - if (lineGap == 0) return; - for (i = 0; i < BOARD_SIZE + 1; i++) { - gridSegments[i].x1 = 0; - gridSegments[i].x2 = - lineGap + BOARD_SIZE * (squareSize + lineGap); - gridSegments[i].y1 = gridSegments[i].y2 - = lineGap / 2 + (i * (squareSize + lineGap)); - - gridSegments[i + BOARD_SIZE + 1].y1 = 0; - gridSegments[i + BOARD_SIZE + 1].y2 = - BOARD_SIZE * (squareSize + lineGap); - gridSegments[i + BOARD_SIZE + 1].x1 = - gridSegments[i + BOARD_SIZE + 1].x2 - = lineGap / 2 + (i * (squareSize + lineGap)); - } - } - - static void MenuBarSelect(w, addr, index) - Widget w; - caddr_t addr; - caddr_t index; - { - XtActionProc proc = (XtActionProc) addr; - - (proc)(NULL, NULL, NULL, NULL); - } - - void CreateMenuBarPopup(parent, name, mb) - Widget parent; - String name; - Menu *mb; - { - int j; - Widget menu, entry; - MenuItem *mi; - Arg args[16]; - - menu = XtCreatePopupShell(name, simpleMenuWidgetClass, - parent, NULL, 0); - j = 0; - XtSetArg(args[j], XtNleftMargin, 20); j++; - XtSetArg(args[j], XtNrightMargin, 20); j++; - mi = mb->mi; - while (mi->string != NULL) { - if (strcmp(mi->string, "----") == 0) { - entry = XtCreateManagedWidget(mi->string, smeLineObjectClass, - menu, args, j); - } else { - XtSetArg(args[j], XtNlabel, XtNewString(_(mi->string))); - entry = XtCreateManagedWidget(mi->string, smeBSBObjectClass, - menu, args, j+1); - XtAddCallback(entry, XtNcallback, - (XtCallbackProc) MenuBarSelect, - (caddr_t) mi->proc); - } - mi++; - } - } - - Widget CreateMenuBar(mb) - Menu *mb; - { - int j; - Widget anchor, menuBar; - Arg args[16]; - char menuName[MSG_SIZ]; - - j = 0; - XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++; - XtSetArg(args[j], XtNvSpace, 0); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - menuBar = XtCreateWidget("menuBar", boxWidgetClass, - formWidget, args, j); - - while (mb->name != NULL) { - strcpy(menuName, "menu"); - strcat(menuName, mb->name); - j = 0; - XtSetArg(args[j], XtNmenuName, XtNewString(menuName)); j++; - if (tinyLayout) { - char shortName[2]; - shortName[0] = _(mb->name)[0]; - shortName[1] = NULLCHAR; - XtSetArg(args[j], XtNlabel, XtNewString(shortName)); j++; - } - else { - XtSetArg(args[j], XtNlabel, XtNewString(_(mb->name))); j++; - } - - XtSetArg(args[j], XtNborderWidth, 0); j++; - anchor = XtCreateManagedWidget(mb->name, menuButtonWidgetClass, - menuBar, args, j); - CreateMenuBarPopup(menuBar, menuName, mb); - mb++; - } - return menuBar; - } - - Widget CreateButtonBar(mi) - MenuItem *mi; - { - int j; - Widget button, buttonBar; - Arg args[16]; - - j = 0; - XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++; - if (tinyLayout) { - XtSetArg(args[j], XtNhSpace, 0); j++; - } - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNvSpace, 0); j++; - buttonBar = XtCreateWidget("buttonBar", boxWidgetClass, - formWidget, args, j); - - while (mi->string != NULL) { - j = 0; - if (tinyLayout) { - XtSetArg(args[j], XtNinternalWidth, 2); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - } - XtSetArg(args[j], XtNlabel, XtNewString(_(mi->string))); j++; - button = XtCreateManagedWidget(mi->string, commandWidgetClass, - buttonBar, args, j); - XtAddCallback(button, XtNcallback, - (XtCallbackProc) MenuBarSelect, - (caddr_t) mi->proc); - mi++; - } - return buttonBar; - } - - Widget - CreatePieceMenu(name, color) - char *name; - int color; - { - int i; - Widget entry, menu; - Arg args[16]; - ChessSquare selection; - - menu = XtCreatePopupShell(name, simpleMenuWidgetClass, - boardWidget, args, 0); - - for (i = 0; i < PIECE_MENU_SIZE; i++) { - String item = pieceMenuStrings[color][i]; - - if (strcmp(item, "----") == 0) { - entry = XtCreateManagedWidget(item, smeLineObjectClass, - menu, NULL, 0); - } else { - XtSetArg(args[0], XtNlabel, XtNewString(_(item))); - entry = XtCreateManagedWidget(item, smeBSBObjectClass, - menu, args, 1); - selection = pieceMenuTranslation[color][i]; - XtAddCallback(entry, XtNcallback, - (XtCallbackProc) PieceMenuSelect, - (caddr_t) selection); - if (selection == WhitePawn || selection == BlackPawn) { - XtSetArg(args[0], XtNpopupOnEntry, entry); - XtSetValues(menu, args, 1); - } - } - } - return menu; - } - - void - CreatePieceMenus() - { - int i; - Widget entry; - Arg args[16]; - ChessSquare selection; - - whitePieceMenu = CreatePieceMenu("menuW", 0); - blackPieceMenu = CreatePieceMenu("menuB", 1); - - XtRegisterGrabAction(PieceMenuPopup, True, - (unsigned)(ButtonPressMask|ButtonReleaseMask), - GrabModeAsync, GrabModeAsync); - - XtSetArg(args[0], XtNlabel, _("Drop")); - dropMenu = XtCreatePopupShell("menuD", simpleMenuWidgetClass, - boardWidget, args, 1); - for (i = 0; i < DROP_MENU_SIZE; i++) { - String item = dropMenuStrings[i]; - - if (strcmp(item, "----") == 0) { - entry = XtCreateManagedWidget(item, smeLineObjectClass, - dropMenu, NULL, 0); - } else { - XtSetArg(args[0], XtNlabel, XtNewString(_(item))); - entry = XtCreateManagedWidget(item, smeBSBObjectClass, - dropMenu, args, 1); - selection = dropMenuTranslation[i]; - XtAddCallback(entry, XtNcallback, - (XtCallbackProc) DropMenuSelect, - (caddr_t) selection); - } - } - } - - void SetupDropMenu() - { - int i, j, count; - char label[32]; - Arg args[16]; - Widget entry; - char* p; - - for (i=0; itype != ButtonPress) return; - if (errorUp) ErrorPopDown(); - switch (gameMode) { - case EditPosition: - case IcsExamining: - whichMenu = params[0]; - break; - case IcsPlayingWhite: - case IcsPlayingBlack: - case EditGame: - case MachinePlaysWhite: - case MachinePlaysBlack: - if (appData.testLegality && - gameInfo.variant != VariantBughouse && - gameInfo.variant != VariantCrazyhouse) return; - SetupDropMenu(); - whichMenu = "menuD"; - break; - default: - return; - } - - if (((pmFromX = EventToSquare(event->xbutton.x, BOARD_SIZE)) < 0) || - ((pmFromY = EventToSquare(event->xbutton.y, BOARD_SIZE)) < 0)) { - pmFromX = pmFromY = -1; - return; - } - if (flipView) - pmFromX = BOARD_SIZE - 1 - pmFromX; - else - pmFromY = BOARD_SIZE - 1 - pmFromY; - - XtPopupSpringLoaded(XtNameToWidget(boardWidget, whichMenu)); - } - - static void PieceMenuSelect(w, piece, junk) - Widget w; - ChessSquare piece; - caddr_t junk; - { - if (pmFromX < 0 || pmFromY < 0) return; - EditPositionMenuEvent(piece, pmFromX, pmFromY); - } - - static void DropMenuSelect(w, piece, junk) - Widget w; - ChessSquare piece; - caddr_t junk; - { - if (pmFromX < 0 || pmFromY < 0) return; - DropMenuEvent(piece, pmFromX, pmFromY); - } - - void WhiteClock(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (gameMode == EditPosition || gameMode == IcsExamining) { - SetWhiteToPlayEvent(); - } else if (gameMode == IcsPlayingBlack || gameMode == MachinePlaysWhite) { - CallFlagEvent(); - } - } - - void BlackClock(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (gameMode == EditPosition || gameMode == IcsExamining) { - SetBlackToPlayEvent(); - } else if (gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) { - CallFlagEvent(); - } - } - - - /* - * If the user selects on a border boundary, return -1; if off the board, - * return -2. Otherwise map the event coordinate to the square. - */ - int EventToSquare(x, limit) - int x; - { - if (x <= 0) - return -2; - if (x < lineGap) - return -1; - x -= lineGap; - if ((x % (squareSize + lineGap)) >= squareSize) - return -1; - x /= (squareSize + lineGap); - if (x >= limit) - return -2; - return x; - } - - static void do_flash_delay(msec) - unsigned long msec; - { - TimeDelay(msec); - } - - static void drawHighlight(file, rank, gc) - int file, rank; - GC gc; - { - int x, y; - - if (lineGap == 0 || appData.blindfold) return; - - if (flipView) { - x = lineGap/2 + ((BOARD_SIZE-1)-file) * - (squareSize + lineGap); - y = lineGap/2 + rank * (squareSize + lineGap); - } else { - x = lineGap/2 + file * (squareSize + lineGap); - y = lineGap/2 + ((BOARD_SIZE-1)-rank) * - (squareSize + lineGap); - } - - XDrawRectangle(xDisplay, xBoardWindow, gc, x, y, - squareSize+lineGap, squareSize+lineGap); - } - - int hi1X = -1, hi1Y = -1, hi2X = -1, hi2Y = -1; - int pm1X = -1, pm1Y = -1, pm2X = -1, pm2Y = -1; - - void - SetHighlights(fromX, fromY, toX, toY) - int fromX, fromY, toX, toY; - { - if (hi1X != fromX || hi1Y != fromY) { - if (hi1X >= 0 && hi1Y >= 0) { - drawHighlight(hi1X, hi1Y, lineGC); - } - if (fromX >= 0 && fromY >= 0) { - drawHighlight(fromX, fromY, highlineGC); - } - } - if (hi2X != toX || hi2Y != toY) { - if (hi2X >= 0 && hi2Y >= 0) { - drawHighlight(hi2X, hi2Y, lineGC); - } - if (toX >= 0 && toY >= 0) { - drawHighlight(toX, toY, highlineGC); - } - } - hi1X = fromX; - hi1Y = fromY; - hi2X = toX; - hi2Y = toY; - } - - void - ClearHighlights() - { - SetHighlights(-1, -1, -1, -1); - } - - - void - SetPremoveHighlights(fromX, fromY, toX, toY) - int fromX, fromY, toX, toY; - { - if (pm1X != fromX || pm1Y != fromY) { - if (pm1X >= 0 && pm1Y >= 0) { - drawHighlight(pm1X, pm1Y, lineGC); - } - if (fromX >= 0 && fromY >= 0) { - drawHighlight(fromX, fromY, prelineGC); - } - } - if (pm2X != toX || pm2Y != toY) { - if (pm2X >= 0 && pm2Y >= 0) { - drawHighlight(pm2X, pm2Y, lineGC); - } - if (toX >= 0 && toY >= 0) { - drawHighlight(toX, toY, prelineGC); - } - } - pm1X = fromX; - pm1Y = fromY; - pm2X = toX; - pm2Y = toY; - } - - void - ClearPremoveHighlights() - { - SetPremoveHighlights(-1, -1, -1, -1); - } - - static void BlankSquare(x, y, color, piece, dest) - int x, y, color; - ChessSquare piece; - Drawable dest; - { - if (useImages && useImageSqs) { - Pixmap pm; - switch (color) { - case 1: /* light */ - pm = xpmLightSquare; - break; - case 0: /* dark */ - pm = xpmDarkSquare; - break; - case 2: /* neutral */ - default: - pm = xpmJailSquare; - break; - } - XCopyArea(xDisplay, pm, dest, wlPieceGC, 0, 0, - squareSize, squareSize, x, y); - } else { - GC gc; - switch (color) { - case 1: /* light */ - gc = lightSquareGC; - break; - case 0: /* dark */ - gc = darkSquareGC; - break; - case 2: /* neutral */ - default: - gc = jailSquareGC; - break; - } - XFillRectangle(xDisplay, dest, gc, x, y, squareSize, squareSize); - } - } - - /* - I split out the routines to draw a piece so that I could - make a generic flash routine. - */ - static void monoDrawPiece_1bit(piece, square_color, x, y, dest) - ChessSquare piece; - int square_color, x, y; - Drawable dest; - { - /* Avoid XCopyPlane on 1-bit screens to work around Sun bug */ - switch (square_color) { - case 1: /* light */ - case 2: /* neutral */ - default: - XCopyArea(xDisplay, (int) piece < (int) BlackPawn - ? *pieceToOutline(piece) - : *pieceToSolid(piece), - dest, bwPieceGC, 0, 0, - squareSize, squareSize, x, y); - break; - case 0: /* dark */ - XCopyArea(xDisplay, (int) piece < (int) BlackPawn - ? *pieceToSolid(piece) - : *pieceToOutline(piece), - dest, wbPieceGC, 0, 0, - squareSize, squareSize, x, y); - break; - } - } - - static void monoDrawPiece(piece, square_color, x, y, dest) - ChessSquare piece; - int square_color, x, y; - Drawable dest; - { - switch (square_color) { - case 1: /* light */ - case 2: /* neutral */ - default: - XCopyPlane(xDisplay, (int) piece < (int) BlackPawn - ? *pieceToOutline(piece) - : *pieceToSolid(piece), - dest, bwPieceGC, 0, 0, - squareSize, squareSize, x, y, 1); - break; - case 0: /* dark */ - XCopyPlane(xDisplay, (int) piece < (int) BlackPawn - ? *pieceToSolid(piece) - : *pieceToOutline(piece), - dest, wbPieceGC, 0, 0, - squareSize, squareSize, x, y, 1); - break; - } - } - - static void colorDrawPiece(piece, square_color, x, y, dest) - ChessSquare piece; - int square_color, x, y; - Drawable dest; - { - switch (square_color) { - case 1: /* light */ - XCopyPlane(xDisplay, *pieceToSolid(piece), - dest, (int) piece < (int) BlackPawn - ? wlPieceGC : blPieceGC, 0, 0, - squareSize, squareSize, x, y, 1); - break; - case 0: /* dark */ - XCopyPlane(xDisplay, *pieceToSolid(piece), - dest, (int) piece < (int) BlackPawn - ? wdPieceGC : bdPieceGC, 0, 0, - squareSize, squareSize, x, y, 1); - break; - case 2: /* neutral */ - default: - XCopyPlane(xDisplay, *pieceToSolid(piece), - dest, (int) piece < (int) BlackPawn - ? wjPieceGC : bjPieceGC, 0, 0, - squareSize, squareSize, x, y, 1); - break; - } - } - - static void colorDrawPieceImage(piece, square_color, x, y, dest) - ChessSquare piece; - int square_color, x, y; - Drawable dest; - { - int kind; - - switch (square_color) { - case 1: /* light */ - case 2: /* neutral */ - default: - if ((int)piece < (int) BlackPawn) { - kind = 0; - } else { - kind = 2; - piece -= BlackPawn; - } - break; - case 0: /* dark */ - if ((int)piece < (int) BlackPawn) { - kind = 1; - } else { - kind = 3; - piece -= BlackPawn; - } - break; - } - XCopyArea(xDisplay, xpmPieceBitmap[kind][piece], - dest, wlPieceGC, 0, 0, - squareSize, squareSize, x, y); - } - - typedef void (*DrawFunc)(); - - DrawFunc ChooseDrawFunc() - { - if (appData.monoMode) { - if (DefaultDepth(xDisplay, xScreen) == 1) { - return monoDrawPiece_1bit; - } else { - return monoDrawPiece; - } - } else { - if (useImages) - return colorDrawPieceImage; - else - return colorDrawPiece; - } - } - - void DrawSquare(row, column, piece, do_flash) - int row, column, do_flash; - ChessSquare piece; - { - int square_color, x, y, direction, font_ascent, font_descent; - int i; - char string[2]; - XCharStruct overall; - DrawFunc drawfunc; - int flash_delay; - - /* Calculate delay in milliseconds (2-delays per complete flash) */ - flash_delay = 500 / appData.flashRate; - - if (flipView) { - x = lineGap + ((BOARD_SIZE-1)-column) * - (squareSize + lineGap); - y = lineGap + row * (squareSize + lineGap); - } else { - x = lineGap + column * (squareSize + lineGap); - y = lineGap + ((BOARD_SIZE-1)-row) * - (squareSize + lineGap); - } - - square_color = ((column + row) % 2) == 1; - - if (piece == EmptySquare || appData.blindfold) { - BlankSquare(x, y, square_color, piece, xBoardWindow); - } else { - drawfunc = ChooseDrawFunc(); - if (do_flash && appData.flashCount > 0) { - for (i=0; itype) { - case Expose: - if (event->xexpose.count > 0) return; /* no clipping is done */ - XDrawPosition(widget, True, NULL); - break; - default: - return; - } - } - /* end why */ - - void DrawPosition(fullRedraw, board) - /*Boolean*/int fullRedraw; - Board board; - { - XDrawPosition(boardWidget, fullRedraw, board); - } - - /* Returns 1 if there are "too many" differences between b1 and b2 - (i.e. more than 1 move was made) */ - static int too_many_diffs(b1, b2) - Board b1, b2; - { - int i, j; - int c = 0; - - for (i=0; i 4) /* Castling causes 4 diffs */ - return 1; - } - } - } - - return 0; - } - - /* Matrix describing castling maneuvers */ - /* Row, ColRookFrom, ColKingFrom, ColRookTo, ColKingTo */ - static int castling_matrix[4][5] = { - { 0, 0, 4, 3, 2 }, /* 0-0-0, white */ - { 0, 7, 4, 5, 6 }, /* 0-0, white */ - { 7, 0, 4, 3, 2 }, /* 0-0-0, black */ - { 7, 7, 4, 5, 6 } /* 0-0, black */ - }; - - /* Checks whether castling occurred. If it did, *rrow and *rcol - are set to the destination (row,col) of the rook that moved. - - Returns 1 if castling occurred, 0 if not. - - Note: Only handles a max of 1 castling move, so be sure - to call too_many_diffs() first. - */ - static int check_castle_draw(newb, oldb, rrow, rcol) - Board newb, oldb; - int *rrow, *rcol; - { - int i, *r, j; - int match; - - /* For each type of castling... */ - for (i=0; i<4; ++i) { - r = castling_matrix[i]; - - /* Check the 4 squares involved in the castling move */ - match = 0; - for (j=1; j<=4; ++j) { - if (newb[r[0]][r[j]] == oldb[r[0]][r[j]]) { - match = 1; - break; - } - } - - if (!match) { - /* All 4 changed, so it must be a castling move */ - *rrow = r[0]; - *rcol = r[3]; - return 1; - } - } - return 0; - } - - static int damage[BOARD_SIZE][BOARD_SIZE]; - - /* - * event handler for redrawing the board - */ - void XDrawPosition(w, repaint, board) - Widget w; - /*Boolean*/int repaint; - Board board; - { - int i, j, do_flash; - static int lastFlipView = 0; - static int lastBoardValid = 0; - static Board lastBoard; - Arg args[16]; - int rrow, rcol; - - if (board == NULL) { - if (!lastBoardValid) return; - board = lastBoard; - } - if (!lastBoardValid || lastFlipView != flipView) { - XtSetArg(args[0], XtNleftBitmap, (flipView ? xMarkPixmap : None)); - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Flip View"), - args, 1); - } - - /* - * It would be simpler to clear the window with XClearWindow() - * but this causes a very distracting flicker. - */ - - if (!repaint && lastBoardValid && lastFlipView == flipView) { - - /* If too much changes (begin observing new game, etc.), don't - do flashing */ - do_flash = too_many_diffs(board, lastBoard) ? 0 : 1; - - /* Special check for castling so we don't flash both the king - and the rook (just flash the king). */ - if (do_flash) { - if (check_castle_draw(board, lastBoard, &rrow, &rcol)) { - /* Draw rook with NO flashing. King will be drawn flashing later */ - DrawSquare(rrow, rcol, board[rrow][rcol], 0); - lastBoard[rrow][rcol] = board[rrow][rcol]; - } - } - - /* First pass -- Draw (newly) empty squares and repair damage. - This prevents you from having a piece show up twice while it - is flashing on its new square */ - for (i = 0; i < BOARD_SIZE; i++) - for (j = 0; j < BOARD_SIZE; j++) - if ((board[i][j] != lastBoard[i][j] && board[i][j] == EmptySquare) - || damage[i][j]) { - DrawSquare(i, j, board[i][j], 0); - damage[i][j] = False; - } - - /* Second pass -- Draw piece(s) in new position and flash them */ - for (i = 0; i < BOARD_SIZE; i++) - for (j = 0; j < BOARD_SIZE; j++) - if (board[i][j] != lastBoard[i][j]) { - DrawSquare(i, j, board[i][j], do_flash); - } - } else { - if (lineGap > 0) - XDrawSegments(xDisplay, xBoardWindow, lineGC, - gridSegments, (BOARD_SIZE + 1) * 2); - - for (i = 0; i < BOARD_SIZE; i++) - for (j = 0; j < BOARD_SIZE; j++) { - DrawSquare(i, j, board[i][j], 0); - damage[i][j] = False; - } - } - - CopyBoard(lastBoard, board); - lastBoardValid = 1; - lastFlipView = flipView; - - /* Draw highlights */ - if (pm1X >= 0 && pm1Y >= 0) { - drawHighlight(pm1X, pm1Y, prelineGC); - } - if (pm2X >= 0 && pm2Y >= 0) { - drawHighlight(pm2X, pm2Y, prelineGC); - } - if (hi1X >= 0 && hi1Y >= 0) { - drawHighlight(hi1X, hi1Y, highlineGC); - } - if (hi2X >= 0 && hi2Y >= 0) { - drawHighlight(hi2X, hi2Y, highlineGC); - } - - /* If piece being dragged around board, must redraw that too */ - DrawDragPiece(); - - XSync(xDisplay, False); - } - - - /* - * event handler for redrawing the board - */ - void DrawPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - XDrawPosition(w, True, NULL); - } - - - /* - * event handler for parsing user moves - */ - void HandleUserMove(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - int x, y; - Boolean saveAnimate; - static int second = 0; - - if (w != boardWidget || errorExitStatus != -1) return; - - if (event->type == ButtonPress) ErrorPopDown(); - - if (promotionUp) { - if (event->type == ButtonPress) { - XtPopdown(promotionShell); - XtDestroyWidget(promotionShell); - promotionUp = False; - ClearHighlights(); - fromX = fromY = -1; - } else { - return; - } - } - - x = EventToSquare(event->xbutton.x, BOARD_SIZE); - y = EventToSquare(event->xbutton.y, BOARD_SIZE); - if (!flipView && y >= 0) { - y = BOARD_SIZE - 1 - y; - } - if (flipView && x >= 0) { - x = BOARD_SIZE - 1 - x; - } - - if (fromX == -1) { - if (event->type == ButtonPress) { - /* First square */ - if (OKToStartUserMove(x, y)) { - fromX = x; - fromY = y; - second = 0; - DragPieceBegin(event->xbutton.x, event->xbutton.y); - if (appData.highlightDragging) { - SetHighlights(x, y, -1, -1); - } - } - } - return; - } - - /* fromX != -1 */ - if (event->type == ButtonPress && gameMode != EditPosition && - x >= 0 && y >= 0) { - ChessSquare fromP; - ChessSquare toP; - /* Check if clicking again on the same color piece */ - fromP = boards[currentMove][fromY][fromX]; - toP = boards[currentMove][y][x]; - if ((WhitePawn <= fromP && fromP <= WhiteKing && - WhitePawn <= toP && toP <= WhiteKing) || - (BlackPawn <= fromP && fromP <= BlackKing && - BlackPawn <= toP && toP <= BlackKing)) { - /* Clicked again on same color piece -- changed his mind */ - second = (x == fromX && y == fromY); - if (appData.highlightDragging) { - SetHighlights(x, y, -1, -1); - } else { - ClearHighlights(); - } - if (OKToStartUserMove(x, y)) { - fromX = x; - fromY = y; - DragPieceBegin(event->xbutton.x, event->xbutton.y); - } - return; - } - } - - if (event->type == ButtonRelease && x == fromX && y == fromY) { - DragPieceEnd(event->xbutton.x, event->xbutton.y); - if (appData.animateDragging) { - /* Undo animation damage if any */ - DrawPosition(FALSE, NULL); - } - if (second) { - /* Second up/down in same square; just abort move */ - second = 0; - fromX = fromY = -1; - ClearHighlights(); - gotPremove = 0; - ClearPremoveHighlights(); - } else { - /* First upclick in same square; start click-click mode */ - SetHighlights(x, y, -1, -1); - } - return; - } - - /* Completed move */ - toX = x; - toY = y; - saveAnimate = appData.animate; - if (event->type == ButtonPress) { - /* Finish clickclick move */ - if (appData.animate || appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } - } else { - /* Finish drag move */ - if (appData.highlightLastMove) { - SetHighlights(fromX, fromY, toX, toY); - } else { - ClearHighlights(); - } - DragPieceEnd(event->xbutton.x, event->xbutton.y); - /* Don't animate move and drag both */ - appData.animate = FALSE; - } - if (IsPromotion(fromX, fromY, toX, toY)) { - if (appData.alwaysPromoteToQueen) { - UserMoveEvent(fromX, fromY, toX, toY, 'q'); - if (!appData.highlightLastMove || gotPremove) ClearHighlights(); - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - } else { - SetHighlights(fromX, fromY, toX, toY); - PromotionPopUp(); - } - } else { - UserMoveEvent(fromX, fromY, toX, toY, NULLCHAR); - if (!appData.highlightLastMove || gotPremove) ClearHighlights(); - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - } - appData.animate = saveAnimate; - if (appData.animate || appData.animateDragging) { - /* Undo animation damage if needed */ - DrawPosition(FALSE, NULL); - } - } - - void AnimateUserMove (Widget w, XEvent * event, - String * params, Cardinal * nParams) - { - DragPieceMove(event->xmotion.x, event->xmotion.y); - } - - Widget CommentCreate(name, text, mutable, callback, lines) - char *name, *text; - int /*Boolean*/ mutable; - XtCallbackProc callback; - int lines; - { - Arg args[16]; - Widget shell, layout, form, edit, b_ok, b_cancel, b_clear, b_close, b_edit; - Dimension bw_width; - int j; - - j = 0; - XtSetArg(args[j], XtNwidth, &bw_width); j++; - XtGetValues(boardWidget, args, j); - - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - #if TOPLEVEL - shell = - XtCreatePopupShell(name, topLevelShellWidgetClass, - shellWidget, args, j); - #else - shell = - XtCreatePopupShell(name, transientShellWidgetClass, - shellWidget, args, j); - #endif - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, shell, - layoutArgs, XtNumber(layoutArgs)); - form = - XtCreateManagedWidget("form", formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - j = 0; - if (mutable) { - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - } - XtSetArg(args[j], XtNstring, text); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, bw_width); j++; /*force wider than buttons*/ - #if 0 - XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; - #else - /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ - XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; - #endif - XtSetArg(args[j], XtNautoFill, True); j++; - XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; - edit = - XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); - - if (mutable) { - j = 0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_ok = - XtCreateManagedWidget(_("ok"), commandWidgetClass, form, args, j); - XtAddCallback(b_ok, XtNcallback, callback, (XtPointer) 0); - - j = 0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, b_ok); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_cancel = - XtCreateManagedWidget(_("cancel"), commandWidgetClass, form, args, j); - XtAddCallback(b_cancel, XtNcallback, callback, (XtPointer) 0); - - j = 0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, b_cancel); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_clear = - XtCreateManagedWidget(_("clear"), commandWidgetClass, form, args, j); - XtAddCallback(b_clear, XtNcallback, callback, (XtPointer) 0); - } else { - j = 0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_close = - XtCreateManagedWidget(_("close"), commandWidgetClass, form, args, j); - XtAddCallback(b_close, XtNcallback, callback, (XtPointer) 0); - - j = 0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, b_close); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_edit = - XtCreateManagedWidget(_("edit"), commandWidgetClass, form, args, j); - XtAddCallback(b_edit, XtNcallback, callback, (XtPointer) 0); - } - - XtRealizeWidget(shell); - - if (commentX == -1) { - int xx, yy; - Window junk; - Dimension pw_height; - Dimension ew_height; - - j = 0; - XtSetArg(args[j], XtNheight, &ew_height); j++; - XtGetValues(edit, args, j); - - j = 0; - XtSetArg(args[j], XtNheight, &pw_height); j++; - XtGetValues(shell, args, j); - commentH = pw_height + (lines - 1) * ew_height; - commentW = bw_width - 16; - - XSync(xDisplay, False); - #ifdef NOTDEF - /* This code seems to tickle an X bug if it is executed too soon - after xboard starts up. The coordinates get transformed as if - the main window was positioned at (0, 0). - */ - XtTranslateCoords(shellWidget, - (bw_width - commentW) / 2, 0 - commentH / 2, - &commentX, &commentY); - #else /*!NOTDEF*/ - XTranslateCoordinates(xDisplay, XtWindow(shellWidget), - RootWindowOfScreen(XtScreen(shellWidget)), - (bw_width - commentW) / 2, 0 - commentH / 2, - &xx, &yy, &junk); - commentX = xx; - commentY = yy; - #endif /*!NOTDEF*/ - if (commentY < 0) commentY = 0; /*avoid positioning top offscreen*/ - } - j = 0; - XtSetArg(args[j], XtNheight, commentH); j++; - XtSetArg(args[j], XtNwidth, commentW); j++; - XtSetArg(args[j], XtNx, commentX); j++; - XtSetArg(args[j], XtNy, commentY); j++; - XtSetValues(shell, args, j); - XtSetKeyboardFocus(shell, edit); - - return shell; - } - - /* Used for analysis window and ICS input window */ - Widget MiscCreate(name, text, mutable, callback, lines) - char *name, *text; - int /*Boolean*/ mutable; - XtCallbackProc callback; - int lines; - { - Arg args[16]; - Widget shell, layout, form, edit; - Position x, y; - Dimension bw_width, pw_height, ew_height, w, h; - int j; - int xx, yy; - Window junk; - - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - #if TOPLEVEL - shell = - XtCreatePopupShell(name, topLevelShellWidgetClass, - shellWidget, args, j); - #else - shell = - XtCreatePopupShell(name, transientShellWidgetClass, - shellWidget, args, j); - #endif - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, shell, - layoutArgs, XtNumber(layoutArgs)); - form = - XtCreateManagedWidget("form", formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - j = 0; - if (mutable) { - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - } - XtSetArg(args[j], XtNstring, text); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - #if 0 - XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; - #else - /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ - XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; - #endif - XtSetArg(args[j], XtNautoFill, True); j++; - XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; - edit = - XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); - - XtRealizeWidget(shell); - - j = 0; - XtSetArg(args[j], XtNwidth, &bw_width); j++; - XtGetValues(boardWidget, args, j); - - j = 0; - XtSetArg(args[j], XtNheight, &ew_height); j++; - XtGetValues(edit, args, j); - - j = 0; - XtSetArg(args[j], XtNheight, &pw_height); j++; - XtGetValues(shell, args, j); - h = pw_height + (lines - 1) * ew_height; - w = bw_width - 16; - - XSync(xDisplay, False); - #ifdef NOTDEF - /* This code seems to tickle an X bug if it is executed too soon - after xboard starts up. The coordinates get transformed as if - the main window was positioned at (0, 0). - */ - XtTranslateCoords(shellWidget, (bw_width - w) / 2, 0 - h / 2, &x, &y); - #else /*!NOTDEF*/ - XTranslateCoordinates(xDisplay, XtWindow(shellWidget), - RootWindowOfScreen(XtScreen(shellWidget)), - (bw_width - w) / 2, 0 - h / 2, &xx, &yy, &junk); - #endif /*!NOTDEF*/ - x = xx; - y = yy; - if (y < 0) y = 0; /*avoid positioning top offscreen*/ - - j = 0; - XtSetArg(args[j], XtNheight, h); j++; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetArg(args[j], XtNx, x); j++; - XtSetArg(args[j], XtNy, y); j++; - XtSetValues(shell, args, j); - - return shell; - } - - - static int savedIndex; /* gross that this is global */ - - void EditCommentPopUp(index, title, text) - int index; - char *title, *text; - { - Widget edit; - Arg args[16]; - int j; - - savedIndex = index; - if (text == NULL) text = ""; - - if (editShell == NULL) { - editShell = - CommentCreate(title, text, True, EditCommentCallback, 4); - XtRealizeWidget(editShell); - CatchDeleteWindow(editShell, "EditCommentPopDown"); - } else { - edit = XtNameToWidget(editShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, text); j++; - XtSetValues(edit, args, j); - j = 0; - XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; - XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; - XtSetValues(editShell, args, j); - } - - XtPopup(editShell, XtGrabNone); - - editUp = True; - j = 0; - XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Edit Comment"), - args, j); - } - - void EditCommentCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - String name, val; - Arg args[16]; - int j; - Widget edit; - - j = 0; - XtSetArg(args[j], XtNlabel, &name); j++; - XtGetValues(w, args, j); - - if (strcmp(name, _("ok")) == 0) { - edit = XtNameToWidget(editShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, &val); j++; - XtGetValues(edit, args, j); - ReplaceComment(savedIndex, val); - EditCommentPopDown(); - } else if (strcmp(name, _("cancel")) == 0) { - EditCommentPopDown(); - } else if (strcmp(name, _("clear")) == 0) { - edit = XtNameToWidget(editShell, "*form.text"); - XtCallActionProc(edit, "select-all", NULL, NULL, 0); - XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); - } - } - - void EditCommentPopDown() - { - Arg args[16]; - int j; - - if (!editUp) return; - j = 0; - XtSetArg(args[j], XtNx, &commentX); j++; - XtSetArg(args[j], XtNy, &commentY); j++; - XtSetArg(args[j], XtNheight, &commentH); j++; - XtSetArg(args[j], XtNwidth, &commentW); j++; - XtGetValues(editShell, args, j); - XtPopdown(editShell); - editUp = False; - j = 0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Edit Comment"), - args, j); - } - - void ICSInputBoxPopUp() - { - Widget edit; - Arg args[16]; - int j; - char *title = _("ICS Input"); - XtTranslations tr; - - if (ICSInputShell == NULL) { - ICSInputShell = MiscCreate(title, "", True, NULL, 1); - tr = XtParseTranslationTable(ICSInputTranslations); - edit = XtNameToWidget(ICSInputShell, "*form.text"); - XtOverrideTranslations(edit, tr); - XtRealizeWidget(ICSInputShell); - CatchDeleteWindow(ICSInputShell, "ICSInputBoxPopDown"); - - } else { - edit = XtNameToWidget(ICSInputShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, ""); j++; - XtSetValues(edit, args, j); - j = 0; - XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; - XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; - XtSetValues(ICSInputShell, args, j); - } - - XtPopup(ICSInputShell, XtGrabNone); - XtSetKeyboardFocus(ICSInputShell, edit); - - ICSInputBoxUp = True; - j = 0; - XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.ICS Input Box"), - args, j); - } - - void ICSInputSendText() - { - Widget edit; - int j; - Arg args[16]; - String val; - - edit = XtNameToWidget(ICSInputShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, &val); j++; - XtGetValues(edit, args, j); - SendMultiLineToICS(val); - XtCallActionProc(edit, "select-all", NULL, NULL, 0); - XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); - } - - void ICSInputBoxPopDown() - { - Arg args[16]; - int j; - - if (!ICSInputBoxUp) return; - j = 0; - XtPopdown(ICSInputShell); - ICSInputBoxUp = False; - j = 0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.ICS Input Box"), - args, j); - } - - void CommentPopUp(title, text) - char *title, *text; - { - Arg args[16]; - int j; - Widget edit; - - if (commentShell == NULL) { - commentShell = - CommentCreate(title, text, False, CommentCallback, 4); - XtRealizeWidget(commentShell); - CatchDeleteWindow(commentShell, "CommentPopDown"); - } else { - edit = XtNameToWidget(commentShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, text); j++; - XtSetValues(edit, args, j); - j = 0; - XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; - XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; - XtSetValues(commentShell, args, j); - } - - XtPopup(commentShell, XtGrabNone); - XSync(xDisplay, False); - - commentUp = True; - } - - void AnalysisPopUp(title, text) - char *title, *text; - { - Arg args[16]; - int j; - Widget edit; - - if (analysisShell == NULL) { - analysisShell = MiscCreate(title, text, False, NULL, 4); - XtRealizeWidget(analysisShell); - CatchDeleteWindow(analysisShell, "AnalysisPopDown"); - - } else { - edit = XtNameToWidget(analysisShell, "*form.text"); - j = 0; - XtSetArg(args[j], XtNstring, text); j++; - XtSetValues(edit, args, j); - j = 0; - XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; - XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; - XtSetValues(analysisShell, args, j); - } - - if (!analysisUp) { - XtPopup(analysisShell, XtGrabNone); - } - XSync(xDisplay, False); - - analysisUp = True; - } - - void CommentCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - String name; - Arg args[16]; - int j; - - j = 0; - XtSetArg(args[j], XtNlabel, &name); j++; - XtGetValues(w, args, j); - - if (strcmp(name, _("close")) == 0) { - CommentPopDown(); - } else if (strcmp(name, _("edit")) == 0) { - CommentPopDown(); - EditCommentEvent(); - } - } - - - void CommentPopDown() - { - Arg args[16]; - int j; - - if (!commentUp) return; - j = 0; - XtSetArg(args[j], XtNx, &commentX); j++; - XtSetArg(args[j], XtNy, &commentY); j++; - XtSetArg(args[j], XtNwidth, &commentW); j++; - XtSetArg(args[j], XtNheight, &commentH); j++; - XtGetValues(commentShell, args, j); - XtPopdown(commentShell); - XSync(xDisplay, False); - commentUp = False; - } - - void AnalysisPopDown() - { - if (!analysisUp) return; - XtPopdown(analysisShell); - XSync(xDisplay, False); - analysisUp = False; - /* icsEngineAnalyze */ - if (appData.icsEngineAnalyze) ExitAnalyzeMode(); - } - - - void FileNamePopUp(label, def, proc, openMode) - char *label; - char *def; - FileProc proc; - char *openMode; - { - Arg args[16]; - Widget popup, layout, dialog, edit; - Window root, child; - int x, y, i; - int win_x, win_y; - unsigned int mask; - - fileProc = proc; /* I can't see a way not */ - fileOpenMode = openMode; /* to use globals here */ - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - XtSetArg(args[i], XtNtitle, XtNewString(_("File name prompt"))); i++; - fileNameShell = popup = - XtCreatePopupShell("File name prompt", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - i = 0; - XtSetArg(args[i], XtNlabel, label); i++; - XtSetArg(args[i], XtNvalue, def); i++; - XtSetArg(args[i], XtNborderWidth, 0); i++; - dialog = XtCreateManagedWidget("fileName", dialogWidgetClass, - layout, args, i); - - XawDialogAddButton(dialog, _("ok"), FileNameCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, _("cancel"), FileNameCallback, - (XtPointer) dialog); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "FileNamePopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - filenameUp = True; - - edit = XtNameToWidget(dialog, "*value"); - XtSetKeyboardFocus(popup, edit); - } - - void FileNamePopDown() - { - if (!filenameUp) return; - XtPopdown(fileNameShell); - XtDestroyWidget(fileNameShell); - filenameUp = False; - ModeHighlight(); - } - - void FileNameCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - String name; - Arg args[16]; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, _("cancel")) == 0) { - FileNamePopDown(); - return; - } - - FileNameAction(w, NULL, NULL, NULL); - } - - void FileNameAction(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - String name; - FILE *f; - char *p, *fullname; - int index; - - name = XawDialogGetValueString(w = XtParent(w)); - - if ((name != NULL) && (*name != NULLCHAR)) { - strcpy(buf, name); - XtPopdown(w = XtParent(XtParent(w))); - XtDestroyWidget(w); - filenameUp = False; - - p = strrchr(buf, ' '); - if (p == NULL) { - index = 0; - } else { - *p++ = NULLCHAR; - index = atoi(p); - } - fullname = ExpandPathName(buf); - if (!fullname) { - ErrorPopUp(_("Error"), _("Can't open file"), FALSE); - } - else { - f = fopen(fullname, fileOpenMode); - if (f == NULL) { - DisplayError(_("Failed to open file"), errno); - } else { - (void) (*fileProc)(f, index, buf); - } - } - ModeHighlight(); - return; - } - - XtPopdown(w = XtParent(XtParent(w))); - XtDestroyWidget(w); - filenameUp = False; - ModeHighlight(); - } - - void PromotionPopUp() - { - Arg args[16]; - Widget dialog, layout; - Position x, y; - Dimension bw_width, pw_width; - int j; - - j = 0; - XtSetArg(args[j], XtNwidth, &bw_width); j++; - XtGetValues(boardWidget, args, j); - - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNtitle, XtNewString(_("Promotion"))); j++; - promotionShell = - XtCreatePopupShell("Promotion", transientShellWidgetClass, - shellWidget, args, j); - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, promotionShell, - layoutArgs, XtNumber(layoutArgs)); - - j = 0; - XtSetArg(args[j], XtNlabel, _("Promote pawn to what?")); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - dialog = XtCreateManagedWidget("promotion", dialogWidgetClass, - layout, args, j); - - XawDialogAddButton(dialog, _("Queen"), PromotionCallback, - (XtPointer) dialog); - XawDialogAddButton(dialog, _("Rook"), PromotionCallback, - (XtPointer) dialog); - XawDialogAddButton(dialog, _("Bishop"), PromotionCallback, - (XtPointer) dialog); - XawDialogAddButton(dialog, _("Knight"), PromotionCallback, - (XtPointer) dialog); - if (!appData.testLegality || gameInfo.variant == VariantSuicide || - gameInfo.variant == VariantGiveaway) { - XawDialogAddButton(dialog, _("King"), PromotionCallback, - (XtPointer) dialog); - } - XawDialogAddButton(dialog, _("cancel"), PromotionCallback, - (XtPointer) dialog); - - XtRealizeWidget(promotionShell); - CatchDeleteWindow(promotionShell, "PromotionPopDown"); - - j = 0; - XtSetArg(args[j], XtNwidth, &pw_width); j++; - XtGetValues(promotionShell, args, j); - - XtTranslateCoords(boardWidget, (bw_width - pw_width) / 2, - lineGap + squareSize/3 + - ((toY == 7) ^ (flipView) ? - 0 : 6*(squareSize + lineGap)), &x, &y); - - j = 0; - XtSetArg(args[j], XtNx, x); j++; - XtSetArg(args[j], XtNy, y); j++; - XtSetValues(promotionShell, args, j); - - XtPopup(promotionShell, XtGrabNone); - - promotionUp = True; - } - - void PromotionPopDown() - { - if (!promotionUp) return; - XtPopdown(promotionShell); - XtDestroyWidget(promotionShell); - promotionUp = False; - } - - void PromotionCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - String name; - Arg args[16]; - int promoChar; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - PromotionPopDown(); - - if (fromX == -1) return; - - if (strcmp(name, _("cancel")) == 0) { - fromX = fromY = -1; - ClearHighlights(); - return; - } else if (strcmp(name, _("Knight")) == 0) { - promoChar = 'n'; - } else { - promoChar = ToLower(name[0]); - } - - UserMoveEvent(fromX, fromY, toX, toY, promoChar); - - if (!appData.highlightLastMove || gotPremove) ClearHighlights(); - if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); - fromX = fromY = -1; - } - - - void ErrorCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - errorUp = False; - XtPopdown(w = XtParent(XtParent(XtParent(w)))); - XtDestroyWidget(w); - if (errorExitStatus != -1) ExitEvent(errorExitStatus); - } - - - void ErrorPopDown() - { - if (!errorUp) return; - errorUp = False; - XtPopdown(errorShell); - XtDestroyWidget(errorShell); - if (errorExitStatus != -1) ExitEvent(errorExitStatus); - } - - void ErrorPopUp(title, label, modal) - char *title, *label; - int modal; - { - Arg args[16]; - Widget dialog, layout; - Position x, y; - int xx, yy; - Window junk; - Dimension bw_width, pw_width; - Dimension pw_height; - int i; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - XtSetArg(args[i], XtNtitle, title); i++; - errorShell = - XtCreatePopupShell("errorpopup", transientShellWidgetClass, - shellWidget, args, i); - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, errorShell, - layoutArgs, XtNumber(layoutArgs)); - - i = 0; - XtSetArg(args[i], XtNlabel, label); i++; - XtSetArg(args[i], XtNborderWidth, 0); i++; - dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, - layout, args, i); - - XawDialogAddButton(dialog, _("ok"), ErrorCallback, (XtPointer) dialog); - - XtRealizeWidget(errorShell); - CatchDeleteWindow(errorShell, "ErrorPopDown"); - - i = 0; - XtSetArg(args[i], XtNwidth, &bw_width); i++; - XtGetValues(boardWidget, args, i); - i = 0; - XtSetArg(args[i], XtNwidth, &pw_width); i++; - XtSetArg(args[i], XtNheight, &pw_height); i++; - XtGetValues(errorShell, args, i); - - #ifdef NOTDEF - /* This code seems to tickle an X bug if it is executed too soon - after xboard starts up. The coordinates get transformed as if - the main window was positioned at (0, 0). - */ - XtTranslateCoords(boardWidget, (bw_width - pw_width) / 2, - 0 - pw_height + squareSize / 3, &x, &y); - #else - XTranslateCoordinates(xDisplay, XtWindow(boardWidget), - RootWindowOfScreen(XtScreen(boardWidget)), - (bw_width - pw_width) / 2, - 0 - pw_height + squareSize / 3, &xx, &yy, &junk); - x = xx; - y = yy; - #endif - if (y < 0) y = 0; /*avoid positioning top offscreen*/ - - i = 0; - XtSetArg(args[i], XtNx, x); i++; - XtSetArg(args[i], XtNy, y); i++; - XtSetValues(errorShell, args, i); - - errorUp = True; - XtPopup(errorShell, modal ? XtGrabExclusive : XtGrabNone); - } - - /* Disable all user input other than deleting the window */ - static int frozen = 0; - void FreezeUI() - { - if (frozen) return; - /* Grab by a widget that doesn't accept input */ - XtAddGrab(messageWidget, TRUE, FALSE); - frozen = 1; - } - - /* Undo a FreezeUI */ - void ThawUI() - { - if (!frozen) return; - XtRemoveGrab(messageWidget); - frozen = 0; - } - - char *ModeToWidgetName(mode) - GameMode mode; - { - switch (mode) { - case BeginningOfGame: - if (appData.icsActive) - return "menuMode.ICS Client"; - else if (appData.noChessProgram || - *appData.cmailGameName != NULLCHAR) - return "menuMode.Edit Game"; - else - return "menuMode.Machine Black"; - case MachinePlaysBlack: - return "menuMode.Machine Black"; - case MachinePlaysWhite: - return "menuMode.Machine White"; - case AnalyzeMode: - return "menuMode.Analysis Mode"; - case AnalyzeFile: - return "menuMode.Analyze File"; - case TwoMachinesPlay: - return "menuMode.Two Machines"; - case EditGame: - return "menuMode.Edit Game"; - case PlayFromGameFile: - return "menuFile.Load Game"; - case EditPosition: - return "menuMode.Edit Position"; - case Training: - return "menuMode.Training"; - case IcsPlayingWhite: - case IcsPlayingBlack: - case IcsObserving: - case IcsIdle: - case IcsExamining: - return "menuMode.ICS Client"; - default: - case EndOfGame: - return NULL; - } - } - - void ModeHighlight() - { - Arg args[16]; - static int oldPausing = FALSE; - static GameMode oldmode = (GameMode) -1; - char *wname; - - if (!boardWidget || !XtIsRealized(boardWidget)) return; - - if (pausing != oldPausing) { - oldPausing = pausing; - if (pausing) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Pause"), - args, 1); - - if (appData.showButtonBar) { - #if 0 - if (pausing) { - XtSetArg(args[0], XtNbackground, buttonForegroundPixel); - XtSetArg(args[1], XtNforeground, buttonBackgroundPixel); - } else { - XtSetArg(args[0], XtNbackground, buttonBackgroundPixel); - XtSetArg(args[1], XtNforeground, buttonForegroundPixel); - } - #else - /* Always toggle, don't set. Previous code messes up when - invoked while the button is pressed, as releasing it - toggles the state again. */ - { - Pixel oldbg, oldfg; - XtSetArg(args[0], XtNbackground, &oldbg); - XtSetArg(args[1], XtNforeground, &oldfg); - XtGetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), - args, 2); - XtSetArg(args[0], XtNbackground, oldfg); - XtSetArg(args[1], XtNforeground, oldbg); - } - #endif - XtSetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), args, 2); - } - } - - wname = ModeToWidgetName(oldmode); - if (wname != NULL) { - XtSetArg(args[0], XtNleftBitmap, None); - XtSetValues(XtNameToWidget(menuBarWidget, wname), args, 1); - } - wname = ModeToWidgetName(gameMode); - if (wname != NULL) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - XtSetValues(XtNameToWidget(menuBarWidget, wname), args, 1); - } - oldmode = gameMode; - - /* Maybe all the enables should be handled here, not just this one */ - XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Training"), - gameMode == Training || gameMode == PlayFromGameFile); - } - - /* - * Button/menu procedures - */ - void ResetProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ResetGameEvent(); - AnalysisPopDown(); - } - - int LoadGamePopUp(f, gameNumber, title) - FILE *f; - int gameNumber; - char *title; - { - cmailMsgLoaded = FALSE; - if (gameNumber == 0) { - int error = GameListBuild(f); - if (error) { - DisplayError(_("Cannot build game list"), error); - } else if (!ListEmpty(&gameList) && - ((ListGame *) gameList.tailPred)->number > 1) { - GameListPopUp(f, title); - return TRUE; - } - GameListDestroy(); - gameNumber = 1; - } - return LoadGame(f, gameNumber, title, FALSE); - } - - void LoadGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - Reset(FALSE, TRUE); - } - FileNamePopUp(_("Load game file name?"), "", LoadGamePopUp, "rb"); - } - - void LoadNextGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadGame(1); - } - - void LoadPrevGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadGame(-1); - } - - void ReloadGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadGame(0); - } - - void LoadNextPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadPosition(1); - } - - void LoadPrevPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadPosition(-1); - } - - void ReloadPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadPosition(0); - } - - void LoadPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { - Reset(FALSE, TRUE); - } - FileNamePopUp(_("Load position file name?"), "", LoadPosition, "rb"); - } - - void SaveGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - FileNamePopUp(_("Save game file name?"), - DefaultFileName(appData.oldSaveStyle ? "game" : "pgn"), - SaveGame, "a"); - } - - void SavePositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - FileNamePopUp(_("Save position file name?"), - DefaultFileName(appData.oldSaveStyle ? "pos" : "fen"), - SavePosition, "a"); - } - - void ReloadCmailMsgProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ReloadCmailMsgEvent(FALSE); - } - - void MailMoveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - MailMoveEvent(); - } - - /* this variable is shared between CopyPositionProc and SendPositionSelection */ - static char *selected_fen_position=NULL; - - static Boolean - SendPositionSelection(Widget w, Atom *selection, Atom *target, - Atom *type_return, XtPointer *value_return, - unsigned long *length_return, int *format_return) - { - char *selection_tmp; - - if (!selected_fen_position) return False; /* should never happen */ - if (*target == XA_STRING){ - /* note: since no XtSelectionDoneProc was registered, Xt will - * automatically call XtFree on the value returned. So have to - * make a copy of it allocated with XtMalloc */ - selection_tmp= XtMalloc(strlen(selected_fen_position)+16); - strcpy(selection_tmp, selected_fen_position); - - *value_return=selection_tmp; - *length_return=strlen(selection_tmp); - *type_return=XA_STRING; - *format_return = 8; /* bits per byte */ - return True; - } else { - return False; - } - } - - /* note: when called from menu all parameters are NULL, so no clue what the - * Widget which was clicked on was, or what the click event was - */ - void CopyPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - int ret; - - if (selected_fen_position) free(selected_fen_position); - selected_fen_position = (char *)PositionToFEN(currentMove); - if (!selected_fen_position) return; - ret = XtOwnSelection(menuBarWidget, XA_PRIMARY, - CurrentTime, - SendPositionSelection, - NULL/* lose_ownership_proc */ , - NULL/* transfer_done_proc */); - if (!ret) { - free(selected_fen_position); - selected_fen_position=NULL; - } - } - - /* function called when the data to Paste is ready */ - static void - PastePositionCB(Widget w, XtPointer client_data, Atom *selection, - Atom *type, XtPointer value, unsigned long *len, int *format) - { - char *fenstr=value; - if (value==NULL || *len==0) return; /* nothing had been selected to copy */ - fenstr[*len]='\0'; /* normally this string is terminated, but be safe */ - EditPositionPasteFEN(fenstr); - XtFree(value); - } - - /* called when Paste Position button is pressed, - * all parameters will be NULL */ - void PastePositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - XtGetSelectionValue(menuBarWidget, XA_PRIMARY, XA_STRING, - /* (XtSelectionCallbackProc) */ PastePositionCB, - NULL, /* client_data passed to PastePositionCB */ - - /* better to use the time field from the event that triggered the - * call to this function, but that isn't trivial to get - */ - CurrentTime - ); - return; - } - - static Boolean - SendGameSelection(Widget w, Atom *selection, Atom *target, - Atom *type_return, XtPointer *value_return, - unsigned long *length_return, int *format_return) - { - char *selection_tmp; - - if (*target == XA_STRING){ - FILE* f = fopen(gameCopyFilename, "r"); - long len; - size_t count; - if (f == NULL) return False; - fseek(f, 0, 2); - len = ftell(f); - rewind(f); - selection_tmp = XtMalloc(len + 1); - count = fread(selection_tmp, 1, len, f); - if (len != count) { - XtFree(selection_tmp); - return False; - } - selection_tmp[len] = NULLCHAR; - *value_return = selection_tmp; - *length_return = len; - *type_return = XA_STRING; - *format_return = 8; /* bits per byte */ - return True; - } else { - return False; - } - } - - /* note: when called from menu all parameters are NULL, so no clue what the - * Widget which was clicked on was, or what the click event was - */ - void CopyGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - int ret; - - ret = SaveGameToFile(gameCopyFilename, FALSE); - if (!ret) return; - - ret = XtOwnSelection(menuBarWidget, XA_PRIMARY, - CurrentTime, - SendGameSelection, - NULL/* lose_ownership_proc */ , - NULL/* transfer_done_proc */); - } - - /* function called when the data to Paste is ready */ - static void - PasteGameCB(Widget w, XtPointer client_data, Atom *selection, - Atom *type, XtPointer value, unsigned long *len, int *format) - { - FILE* f; - if (value == NULL || *len == 0) { - return; /* nothing had been selected to copy */ - } - f = fopen(gamePasteFilename, "w"); - if (f == NULL) { - DisplayError(_("Can't open temp file"), errno); - return; - } - fwrite(value, 1, *len, f); - fclose(f); - XtFree(value); - LoadGameFromFile(gamePasteFilename, 0, gamePasteFilename, TRUE); - } - - /* called when Paste Game button is pressed, - * all parameters will be NULL */ - void PasteGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - XtGetSelectionValue(menuBarWidget, XA_PRIMARY, XA_STRING, - /* (XtSelectionCallbackProc) */ PasteGameCB, - NULL, /* client_data passed to PasteGameCB */ - - /* better to use the time field from the event that triggered the - * call to this function, but that isn't trivial to get - */ - CurrentTime - ); - return; - } - - - void AutoSaveGame() - { - SaveGameProc(NULL, NULL, NULL, NULL); - } - - - void QuitProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ExitEvent(0); - } - - void PauseProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - PauseEvent(); - } - - - void MachineBlackProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - MachineBlackEvent(); - } - - void MachineWhiteProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - MachineWhiteEvent(); - } - - void AnalyzeModeProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - - if (!first.analysisSupport) { - sprintf(buf, _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; - } - /* icsEngineAnalyze */ - if (appData.icsActive) { - if (gameMode != IcsObserving) { - sprintf(buf,_("You are not observing a game")); - DisplayError(buf, 0); - /* secure check */ - if (appData.icsEngineAnalyze) { - if (appData.debugMode) - fprintf(debugFP, _("Found unexpected active ICS engine analyze \n")); - ExitAnalyzeMode(); - ModeHighlight(); - return; - } - return; - } else { - /* if enable, use want disable icsEngineAnalyze */ - if (appData.icsEngineAnalyze) { - ExitAnalyzeMode(); - ModeHighlight(); - return; - } - appData.icsEngineAnalyze = TRUE; - if (appData.debugMode) - fprintf(debugFP, "ICS engine analyze starting... \n"); - } - } - if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); - AnalyzeModeEvent(); - } - - void AnalyzeFileProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (!first.analysisSupport) { - char buf[MSG_SIZ]; - sprintf(buf, _("%s does not support analysis"), first.tidy); - DisplayError(buf, 0); - return; - } - Reset(FALSE, TRUE); - - if (!appData.showThinking) - ShowThinkingProc(w,event,prms,nprms); - - AnalyzeFileEvent(); - FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); - AnalysisPeriodicEvent(1); - } - - void TwoMachinesProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - TwoMachinesEvent(); - } - - void IcsClientProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - IcsClientEvent(); - } - - void EditGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - EditGameEvent(); - } - - void EditPositionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - EditPositionEvent(); - } - - void TrainingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - TrainingEvent(); - } - - void EditCommentProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (editUp) { - EditCommentPopDown(); - } else { - EditCommentEvent(); - } - } - - void IcsInputBoxProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (ICSInputBoxUp) { - ICSInputBoxPopDown(); - } else { - ICSInputBoxPopUp(); - } - } - - void AcceptProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - AcceptEvent(); - } - - void DeclineProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - DeclineEvent(); - } - - void RematchProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - RematchEvent(); - } - - void CallFlagProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - CallFlagEvent(); - } - - void DrawProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - DrawEvent(); - } - - void AbortProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - AbortEvent(); - } - - void AdjournProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - AdjournEvent(); - } - - void ResignProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ResignEvent(); - } - - void EnterKeyProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (ICSInputBoxUp == True) - ICSInputSendText(); - } - - void StopObservingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - StopObservingEvent(); - } - - void StopExaminingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - StopExaminingEvent(); - } - - - void ForwardProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ForwardEvent(); - } - - - void BackwardProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - BackwardEvent(); - } - - void ToStartProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ToStartEvent(); - } - - void ToEndProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - ToEndEvent(); - } - - void RevertProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - RevertEvent(); - } - - void TruncateGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - TruncateGameEvent(); - } - void RetractMoveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - RetractMoveEvent(); - } - - void MoveNowProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - MoveNowEvent(); - } - - - void AlwaysQueenProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.alwaysPromoteToQueen = !appData.alwaysPromoteToQueen; - - if (appData.alwaysPromoteToQueen) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"), - args, 1); - } - - void AnimateDraggingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.animateDragging = !appData.animateDragging; - - if (appData.animateDragging) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - CreateAnimVars(); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Dragging"), - args, 1); - } - - void AnimateMovingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.animate = !appData.animate; - - if (appData.animate) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - CreateAnimVars(); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Moving"), - args, 1); - } - - void AutocommProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoComment = !appData.autoComment; - - if (appData.autoComment) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Comment"), - args, 1); - } - - - void AutoflagProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoCallFlag = !appData.autoCallFlag; - - if (appData.autoCallFlag) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flag"), - args, 1); - } - - void AutoflipProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoFlipView = !appData.autoFlipView; - - if (appData.autoFlipView) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flip View"), - args, 1); - } - - void AutobsProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoObserve = !appData.autoObserve; - - if (appData.autoObserve) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Observe"), - args, 1); - } - - void AutoraiseProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoRaiseBoard = !appData.autoRaiseBoard; - - if (appData.autoRaiseBoard) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Raise Board"), - args, 1); - } - - void AutosaveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.autoSaveGames = !appData.autoSaveGames; - - if (appData.autoSaveGames) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), - args, 1); - } - - void BlindfoldProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.blindfold = !appData.blindfold; - - if (appData.blindfold) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Blindfold"), - args, 1); - - DrawPosition(True, NULL); - } - - void TestLegalityProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.testLegality = !appData.testLegality; - - if (appData.testLegality) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Test Legality"), - args, 1); - } - - - void FlashMovesProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - if (appData.flashCount == 0) { - appData.flashCount = 3; - } else { - appData.flashCount = -appData.flashCount; - } - - if (appData.flashCount > 0) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Flash Moves"), - args, 1); - } - - void FlipViewProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - flipView = !flipView; - DrawPosition(True, NULL); - } - - void GetMoveListProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.getMoveList = !appData.getMoveList; - - if (appData.getMoveList) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - GetMoveListEvent(); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Get Move List"), - args, 1); - } - - #if HIGHDRAG - void HighlightDraggingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.highlightDragging = !appData.highlightDragging; - - if (appData.highlightDragging) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Dragging"), args, 1); - } - #endif - - void HighlightLastMoveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.highlightLastMove = !appData.highlightLastMove; - - if (appData.highlightLastMove) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Highlight Last Move"), args, 1); - } - - void IcsAlarmProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.icsAlarm = !appData.icsAlarm; - - if (appData.icsAlarm) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.ICS Alarm"), args, 1); - } - - void MoveSoundProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.ringBellAfterMoves = !appData.ringBellAfterMoves; - - if (appData.ringBellAfterMoves) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Move Sound"), - args, 1); - } - - - void OldSaveStyleProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.oldSaveStyle = !appData.oldSaveStyle; - - if (appData.oldSaveStyle) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Old Save Style"), - args, 1); - } - - void PeriodicUpdatesProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - PeriodicUpdatesEvent(!appData.periodicUpdates); - - if (appData.periodicUpdates) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Periodic Updates"), - args, 1); - } - - void PonderNextMoveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - PonderNextMoveEvent(!appData.ponderNextMove); - - if (appData.ponderNextMove) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Ponder Next Move"), - args, 1); - } - - void PopupExitMessageProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.popupExitMessage = !appData.popupExitMessage; - - if (appData.popupExitMessage) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Popup Exit Message"), args, 1); - } - - void PopupMoveErrorsProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.popupMoveErrors = !appData.popupMoveErrors; - - if (appData.popupMoveErrors) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Popup Move Errors"), - args, 1); - } - - void PremoveProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.premove = !appData.premove; - - if (appData.premove) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Premove"), args, 1); - } - - void QuietPlayProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.quietPlay = !appData.quietPlay; - - if (appData.quietPlay) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Quiet Play"), - args, 1); - } - - void ShowCoordsProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - appData.showCoords = !appData.showCoords; - - if (appData.showCoords) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), - args, 1); - - DrawPosition(True, NULL); - } - - void ShowThinkingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - ShowThinkingEvent(!appData.showThinking); - - if (appData.showThinking) { - XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); - } else { - XtSetArg(args[0], XtNleftBitmap, None); - } - XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Thinking"), - args, 1); - } - - void InfoProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - sprintf(buf, "xterm -e info --directory %s --directory . -f %s &", - INFODIR, INFOFILE); - system(buf); - } - - void ManProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - String name; - if (nprms && *nprms > 0) - name = prms[0]; - else - name = "xboard"; - sprintf(buf, "xterm -e man %s &", name); - system(buf); - } - - void HintProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - HintEvent(); - } - - void BookProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - BookEvent(); - } - - void AboutProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - #if ZIPPY - char *zippy = " (with Zippy code)"; - #else - char *zippy = ""; - #endif - sprintf(buf, "%s%s\n\n%s\n%s\n\n%s%s\n%s", - programVersion, zippy, - "Copyright 1991 Digital Equipment Corporation", - "Enhancements Copyright 1992-2001 Free Software Foundation", - PRODUCT, " is free software and carries NO WARRANTY;", - "see the file COPYING for more information."); - ErrorPopUp(_("About XBoard"), buf, FALSE); - } - - void DebugProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - appData.debugMode = !appData.debugMode; - } - - void AboutGameProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - AboutGameEvent(); - } - - void NothingProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - return; - } - - void Iconify(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - Arg args[16]; - - fromX = fromY = -1; - XtSetArg(args[0], XtNiconic, True); - XtSetValues(shellWidget, args, 1); - } - - void DisplayMessage(message, extMessage) - char *message, *extMessage; - { - char buf[MSG_SIZ]; - Arg arg; - - if (extMessage) { - if (*message) { - sprintf(buf, "%s %s", message, extMessage); - message = buf; - } else { - message = extMessage; - } - } - XtSetArg(arg, XtNlabel, message); - XtSetValues(messageWidget, &arg, 1); - } - - void DisplayTitle(text) - char *text; - { - Arg args[16]; - int i; - char title[MSG_SIZ]; - char icon[MSG_SIZ]; - - if (text == NULL) text = ""; - - if (appData.titleInWindow) { - i = 0; - XtSetArg(args[i], XtNlabel, text); i++; - XtSetValues(titleWidget, args, i); - } - - if (*text != NULLCHAR) { - strcpy(icon, text); - strcpy(title, text); - } else if (appData.icsActive) { - sprintf(icon, "%s", appData.icsHost); - sprintf(title, "%s: %s", programName, appData.icsHost); - } else if (appData.cmailGameName[0] != NULLCHAR) { - sprintf(icon, "%s", "CMail"); - sprintf(title, "%s: %s", programName, "CMail"); - } else if (appData.noChessProgram) { - strcpy(icon, programName); - strcpy(title, programName); - } else { - strcpy(icon, first.tidy); - sprintf(title, "%s: %s", programName, first.tidy); - } - i = 0; - XtSetArg(args[i], XtNiconName, (XtArgVal) icon); i++; - XtSetArg(args[i], XtNtitle, (XtArgVal) title); i++; - XtSetValues(shellWidget, args, i); - } - - - void DisplayError(message, error) - String message; - int error; - { - char buf[MSG_SIZ]; - - if (error == 0) { - if (appData.debugMode || appData.matchMode) { - fprintf(stderr, "%s: %s\n", programName, message); - } - } else { - if (appData.debugMode || appData.matchMode) { - fprintf(stderr, "%s: %s: %s\n", - programName, message, strerror(error)); - } - sprintf(buf, "%s: %s", message, strerror(error)); - message = buf; - } - ErrorPopUp(_("Error"), message, FALSE); - } - - - void DisplayMoveError(message) - String message; - { - fromX = fromY = -1; - ClearHighlights(); - DrawPosition(FALSE, NULL); - if (appData.debugMode || appData.matchMode) { - fprintf(stderr, "%s: %s\n", programName, message); - } - if (appData.popupMoveErrors) { - ErrorPopUp(_("Error"), message, FALSE); - } else { - DisplayMessage(message, ""); - } - } - - - void DisplayFatalError(message, error, status) - String message; - int error, status; - { - char buf[MSG_SIZ]; - - errorExitStatus = status; - if (error == 0) { - fprintf(stderr, "%s: %s\n", programName, message); - } else { - fprintf(stderr, "%s: %s: %s\n", - programName, message, strerror(error)); - sprintf(buf, "%s: %s", message, strerror(error)); - message = buf; - } - if (appData.popupExitMessage && boardWidget && XtIsRealized(boardWidget)) { - ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE); - } else { - ExitEvent(status); - } - } - - void DisplayInformation(message) - String message; - { - ErrorPopDown(); - ErrorPopUp(_("Information"), message, TRUE); - } - - void DisplayNote(message) - String message; - { - ErrorPopDown(); - ErrorPopUp(_("Note"), message, FALSE); - } - - static int - NullXErrorCheck(dpy, error_event) - Display *dpy; - XErrorEvent *error_event; - { - return 0; - } - - void DisplayIcsInteractionTitle(message) - String message; - { - if (oldICSInteractionTitle == NULL) { - /* Magic to find the old window title, adapted from vim */ - char *wina = getenv("WINDOWID"); - if (wina != NULL) { - Window win = (Window) atoi(wina); - Window root, parent, *children; - unsigned int nchildren; - int (*oldHandler)() = XSetErrorHandler(NullXErrorCheck); - for (;;) { - if (XFetchName(xDisplay, win, &oldICSInteractionTitle)) break; - if (!XQueryTree(xDisplay, win, &root, &parent, - &children, &nchildren)) break; - if (children) XFree((void *)children); - if (parent == root || parent == 0) break; - win = parent; - } - XSetErrorHandler(oldHandler); - } - if (oldICSInteractionTitle == NULL) { - oldICSInteractionTitle = "xterm"; - } - } - printf("\033]0;%s\007", message); - fflush(stdout); - } - - char pendingReplyPrefix[MSG_SIZ]; - ProcRef pendingReplyPR; - - void AskQuestionProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (*nprms != 4) { - fprintf(stderr, _("AskQuestionProc needed 4 parameters, got %d\n"), - *nprms); - return; - } - AskQuestionEvent(prms[0], prms[1], prms[2], prms[3]); - } - - void AskQuestionPopDown() - { - if (!askQuestionUp) return; - XtPopdown(askQuestionShell); - XtDestroyWidget(askQuestionShell); - askQuestionUp = False; - } - - void AskQuestionReplyAction(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - char buf[MSG_SIZ]; - int err; - String reply; - - reply = XawDialogGetValueString(w = XtParent(w)); - strcpy(buf, pendingReplyPrefix); - if (*buf) strcat(buf, " "); - strcat(buf, reply); - strcat(buf, "\n"); - OutputToProcess(pendingReplyPR, buf, strlen(buf), &err); - AskQuestionPopDown(); - - if (err) DisplayFatalError(_("Error writing to chess program"), err, 0); - } - - void AskQuestionCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - String name; - Arg args[16]; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, _("cancel")) == 0) { - AskQuestionPopDown(); - } else { - AskQuestionReplyAction(w, NULL, NULL, NULL); - } - } - - void AskQuestion(title, question, replyPrefix, pr) - char *title, *question, *replyPrefix; - ProcRef pr; - { - Arg args[16]; - Widget popup, layout, dialog, edit; - Window root, child; - int x, y, i; - int win_x, win_y; - unsigned int mask; - - strcpy(pendingReplyPrefix, replyPrefix); - pendingReplyPR = pr; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - askQuestionShell = popup = - XtCreatePopupShell(title, transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - i = 0; - XtSetArg(args[i], XtNlabel, question); i++; - XtSetArg(args[i], XtNvalue, ""); i++; - XtSetArg(args[i], XtNborderWidth, 0); i++; - dialog = XtCreateManagedWidget("question", dialogWidgetClass, - layout, args, i); - - XawDialogAddButton(dialog, _("enter"), AskQuestionCallback, - (XtPointer) dialog); - XawDialogAddButton(dialog, _("cancel"), AskQuestionCallback, - (XtPointer) dialog); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "AskQuestionPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - askQuestionUp = True; - - edit = XtNameToWidget(dialog, "*value"); - XtSetKeyboardFocus(popup, edit); - } - - - void - PlaySound(name) - char *name; - { - if (*name == NULLCHAR) { - return; - } else if (strcmp(name, "$") == 0) { - putc(BELLCHAR, stderr); - } else { - char buf[2048]; - sprintf(buf, "%s '%s' &", appData.soundProgram, name); - system(buf); - } - } - - void - RingBell() - { - PlaySound(appData.soundMove); - } - - void - PlayIcsWinSound() - { - PlaySound(appData.soundIcsWin); - } - - void - PlayIcsLossSound() - { - PlaySound(appData.soundIcsLoss); - } - - void - PlayIcsDrawSound() - { - PlaySound(appData.soundIcsDraw); - } - - void - PlayIcsUnfinishedSound() - { - PlaySound(appData.soundIcsUnfinished); - } - - void - PlayAlarmSound() - { - PlaySound(appData.soundIcsAlarm); - } - - void - EchoOn() - { - system("stty echo"); - } - - void - EchoOff() - { - system("stty -echo"); - } - - void - Colorize(cc, continuation) - ColorClass cc; - int continuation; - { - char buf[MSG_SIZ]; - int count, outCount, error; - - if (textColors[(int)cc].bg > 0) { - if (textColors[(int)cc].fg > 0) { - sprintf(buf, "\033[0;%d;%d;%dm", textColors[(int)cc].attr, - textColors[(int)cc].fg, textColors[(int)cc].bg); - } else { - sprintf(buf, "\033[0;%d;%dm", textColors[(int)cc].attr, - textColors[(int)cc].bg); - } - } else { - if (textColors[(int)cc].fg > 0) { - sprintf(buf, "\033[0;%d;%dm", textColors[(int)cc].attr, - textColors[(int)cc].fg); - } else { - sprintf(buf, "\033[0;%dm", textColors[(int)cc].attr); - } - } - count = strlen(buf); - outCount = OutputToProcess(NoProc, buf, count, &error); - if (outCount < count) { - DisplayFatalError(_("Error writing to display"), error, 1); - } - - if (continuation) return; - switch (cc) { - case ColorShout: - PlaySound(appData.soundShout); - break; - case ColorSShout: - PlaySound(appData.soundSShout); - break; - case ColorChannel1: - PlaySound(appData.soundChannel1); - break; - case ColorChannel: - PlaySound(appData.soundChannel); - break; - case ColorKibitz: - PlaySound(appData.soundKibitz); - break; - case ColorTell: - PlaySound(appData.soundTell); - break; - case ColorChallenge: - PlaySound(appData.soundChallenge); - break; - case ColorRequest: - PlaySound(appData.soundRequest); - break; - case ColorSeek: - PlaySound(appData.soundSeek); - break; - case ColorNormal: - case ColorNone: - default: - break; - } - } - - char *UserName() - { - return getpwuid(getuid())->pw_name; - } - - static char *ExpandPathName(path) - char *path; - { - static char static_buf[2000]; - char *d, *s, buf[2000]; - struct passwd *pwd; - - s = path; - d = static_buf; - - while (*s && isspace(*s)) - ++s; - - if (!*s) { - *d = 0; - return static_buf; - } - - if (*s == '~') { - if (*(s+1) == '/') { - strcpy(d, getpwuid(getuid())->pw_dir); - strcat(d, s+1); - } - else { - strcpy(buf, s+1); - *strchr(buf, '/') = 0; - pwd = getpwnam(buf); - if (!pwd) - { - fprintf(stderr, _("ERROR: Unknown user %s (in path %s)\n"), - buf, path); - return NULL; - } - strcpy(d, pwd->pw_dir); - strcat(d, strchr(s+1, '/')); - } - } - else - strcpy(d, s); - - return static_buf; - } - - char *HostName() - { - static char host_name[MSG_SIZ]; - - #if HAVE_GETHOSTNAME - gethostname(host_name, MSG_SIZ); - return host_name; - #else /* not HAVE_GETHOSTNAME */ - # if HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H - sysinfo(SI_HOSTNAME, host_name, MSG_SIZ); - return host_name; - # else /* not (HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H) */ - return "localhost"; - # endif/* not (HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H) */ - #endif /* not HAVE_GETHOSTNAME */ - } - - XtIntervalId delayedEventTimerXID = 0; - DelayedEventCallback delayedEventCallback = 0; - - void - FireDelayedEvent() - { - delayedEventTimerXID = 0; - delayedEventCallback(); - } - - void - ScheduleDelayedEvent(cb, millisec) - DelayedEventCallback cb; long millisec; - { - delayedEventCallback = cb; - delayedEventTimerXID = - XtAppAddTimeOut(appContext, millisec, - (XtTimerCallbackProc) FireDelayedEvent, (XtPointer) 0); - } - - DelayedEventCallback - GetDelayedEvent() - { - if (delayedEventTimerXID) { - return delayedEventCallback; - } else { - return NULL; - } - } - - void - CancelDelayedEvent() - { - if (delayedEventTimerXID) { - XtRemoveTimeOut(delayedEventTimerXID); - delayedEventTimerXID = 0; - } - } - - XtIntervalId loadGameTimerXID = 0; - - int LoadGameTimerRunning() - { - return loadGameTimerXID != 0; - } - - int StopLoadGameTimer() - { - if (loadGameTimerXID != 0) { - XtRemoveTimeOut(loadGameTimerXID); - loadGameTimerXID = 0; - return TRUE; - } else { - return FALSE; - } - } - - void - LoadGameTimerCallback(arg, id) - XtPointer arg; - XtIntervalId *id; - { - loadGameTimerXID = 0; - AutoPlayGameLoop(); - } - - void - StartLoadGameTimer(millisec) - long millisec; - { - loadGameTimerXID = - XtAppAddTimeOut(appContext, millisec, - (XtTimerCallbackProc) LoadGameTimerCallback, - (XtPointer) 0); - } - - XtIntervalId analysisClockXID = 0; - - void - AnalysisClockCallback(arg, id) - XtPointer arg; - XtIntervalId *id; - { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile - || appData.icsEngineAnalyze) { - AnalysisPeriodicEvent(0); - StartAnalysisClock(); - } - } - - void - StartAnalysisClock() - { - analysisClockXID = - XtAppAddTimeOut(appContext, 2000, - (XtTimerCallbackProc) AnalysisClockCallback, - (XtPointer) 0); - } - - XtIntervalId clockTimerXID = 0; - - int ClockTimerRunning() - { - return clockTimerXID != 0; - } - - int StopClockTimer() - { - if (clockTimerXID != 0) { - XtRemoveTimeOut(clockTimerXID); - clockTimerXID = 0; - return TRUE; - } else { - return FALSE; - } - } - - void - ClockTimerCallback(arg, id) - XtPointer arg; - XtIntervalId *id; - { - clockTimerXID = 0; - DecrementClocks(); - } - - void - StartClockTimer(millisec) - long millisec; - { - clockTimerXID = - XtAppAddTimeOut(appContext, millisec, - (XtTimerCallbackProc) ClockTimerCallback, - (XtPointer) 0); - } - - void - DisplayTimerLabel(w, color, timer, highlight) - Widget w; - char *color; - long timer; - int highlight; - { - char buf[MSG_SIZ]; - Arg args[16]; - - if (appData.clockMode) { - sprintf(buf, "%s: %s", color, TimeString(timer)); - XtSetArg(args[0], XtNlabel, buf); - } else { - sprintf(buf, "%s ", color); - XtSetArg(args[0], XtNlabel, buf); - } - - if (highlight) { - XtSetArg(args[1], XtNbackground, timerForegroundPixel); - XtSetArg(args[2], XtNforeground, timerBackgroundPixel); - } else { - XtSetArg(args[1], XtNbackground, timerBackgroundPixel); - XtSetArg(args[2], XtNforeground, timerForegroundPixel); - } - - XtSetValues(w, args, 3); - } - - void - DisplayWhiteClock(timeRemaining, highlight) - long timeRemaining; - int highlight; - { - Arg args[16]; - DisplayTimerLabel(whiteTimerWidget, _("White"), timeRemaining, highlight); - if (highlight && iconPixmap == bIconPixmap) { - iconPixmap = wIconPixmap; - XtSetArg(args[0], XtNiconPixmap, iconPixmap); - XtSetValues(shellWidget, args, 1); - } - } - - void - DisplayBlackClock(timeRemaining, highlight) - long timeRemaining; - int highlight; - { - Arg args[16]; - DisplayTimerLabel(blackTimerWidget, _("Black"), timeRemaining, highlight); - if (highlight && iconPixmap == wIconPixmap) { - iconPixmap = bIconPixmap; - XtSetArg(args[0], XtNiconPixmap, iconPixmap); - XtSetValues(shellWidget, args, 1); - } - } - - #define CPNone 0 - #define CPReal 1 - #define CPComm 2 - #define CPSock 3 - #define CPLoop 4 - typedef int CPKind; - - typedef struct { - CPKind kind; - int pid; - int fdTo, fdFrom; - } ChildProc; - - - int StartChildProcess(cmdLine, dir, pr) - char *cmdLine; - char *dir; - ProcRef *pr; - { - char *argv[64], *p; - int i, pid; - int to_prog[2], from_prog[2]; - ChildProc *cp; - char buf[MSG_SIZ]; - - if (appData.debugMode) { - fprintf(stderr, "StartChildProcess (dir=\"%s\") %s\n",dir, cmdLine); - } - - /* We do NOT feed the cmdLine to the shell; we just - parse it into blank-separated arguments in the - most simple-minded way possible. - */ - i = 0; - strcpy(buf, cmdLine); - p = buf; - for (;;) { - argv[i++] = p; - p = strchr(p, ' '); - if (p == NULL) break; - *p++ = NULLCHAR; - } - argv[i] = NULL; - - SetUpChildIO(to_prog, from_prog); - - if ((pid = fork()) == 0) { - /* Child process */ - dup2(to_prog[0], 0); - dup2(from_prog[1], 1); - close(to_prog[0]); - close(to_prog[1]); - close(from_prog[0]); - close(from_prog[1]); - dup2(1, fileno(stderr)); /* force stderr to the pipe */ - - if (dir[0] != NULLCHAR && chdir(dir) != 0) { - perror(dir); - exit(1); - } - - execvp(argv[0], argv); - - /* If we get here, exec failed */ - perror(argv[0]); - exit(1); - } - - /* Parent process */ - close(to_prog[0]); - close(from_prog[1]); - - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPReal; - cp->pid = pid; - cp->fdFrom = from_prog[0]; - cp->fdTo = to_prog[1]; - *pr = (ProcRef) cp; - return 0; - } - - void - DestroyChildProcess(pr, signal) - ProcRef pr; - int signal; - { - ChildProc *cp = (ChildProc *) pr; - - if (cp->kind != CPReal) return; - cp->kind = CPNone; - if (signal) { - kill(cp->pid, SIGTERM); - } - /* Process is exiting either because of the kill or because of - a quit command sent by the backend; either way, wait for it to die. - */ - wait((int *) 0); - close(cp->fdFrom); - close(cp->fdTo); - } - - void - InterruptChildProcess(pr) - ProcRef pr; - { - ChildProc *cp = (ChildProc *) pr; - - if (cp->kind != CPReal) return; - (void) kill(cp->pid, SIGINT); /* stop it thinking */ - } - - int OpenTelnet(host, port, pr) - char *host; - char *port; - ProcRef *pr; - { - char cmdLine[MSG_SIZ]; - - if (port[0] == NULLCHAR) { - sprintf(cmdLine, "%s %s", appData.telnetProgram, host); - } else { - sprintf(cmdLine, "%s %s %s", appData.telnetProgram, host, port); - } - return StartChildProcess(cmdLine, "", pr); - } - - int OpenTCP(host, port, pr) - char *host; - char *port; - ProcRef *pr; - { - #if OMIT_SOCKETS - DisplayFatalError(_("Socket support is not configured in"), 0, 2); - #else /* !OMIT_SOCKETS */ - int s; - struct sockaddr_in sa; - struct hostent *hp; - unsigned short uport; - ChildProc *cp; - - if ((s = socket(AF_INET, SOCK_STREAM, 6)) < 0) { - return errno; - } - - memset((char *) &sa, (int)0, sizeof(struct sockaddr_in)); - sa.sin_family = AF_INET; - sa.sin_addr.s_addr = INADDR_ANY; - uport = (unsigned short) 0; - sa.sin_port = htons(uport); - if (bind(s, (struct sockaddr *) &sa, sizeof(struct sockaddr_in)) < 0) { - return errno; - } - - memset((char *) &sa, (int)0, sizeof(struct sockaddr_in)); - if (!(hp = gethostbyname(host))) { - int b0, b1, b2, b3; - if (sscanf(host, "%d.%d.%d.%d", &b0, &b1, &b2, &b3) == 4) { - hp = (struct hostent *) calloc(1, sizeof(struct hostent)); - hp->h_addrtype = AF_INET; - hp->h_length = 4; - hp->h_addr_list = (char **) calloc(2, sizeof(char *)); - hp->h_addr_list[0] = (char *) malloc(4); - hp->h_addr_list[0][0] = b0; - hp->h_addr_list[0][1] = b1; - hp->h_addr_list[0][2] = b2; - hp->h_addr_list[0][3] = b3; - } else { - return ENOENT; - } - } - sa.sin_family = hp->h_addrtype; - uport = (unsigned short) atoi(port); - sa.sin_port = htons(uport); - memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); - - if (connect(s, (struct sockaddr *) &sa, - sizeof(struct sockaddr_in)) < 0) { - return errno; - } - - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPSock; - cp->pid = 0; - cp->fdFrom = s; - cp->fdTo = s; - *pr = (ProcRef) cp; - - #endif /* !OMIT_SOCKETS */ - - return 0; - } - - int OpenCommPort(name, pr) - char *name; - ProcRef *pr; - { - int fd; - ChildProc *cp; - - fd = open(name, 2, 0); - if (fd < 0) return errno; - - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPComm; - cp->pid = 0; - cp->fdFrom = fd; - cp->fdTo = fd; - *pr = (ProcRef) cp; - - return 0; - } - - int OpenLoopback(pr) - ProcRef *pr; - { - ChildProc *cp; - int to[2], from[2]; - - SetUpChildIO(to, from); - - cp = (ChildProc *) calloc(1, sizeof(ChildProc)); - cp->kind = CPLoop; - cp->pid = 0; - cp->fdFrom = to[0]; /* note not from[0]; we are doing a loopback */ - cp->fdTo = to[1]; - *pr = (ProcRef) cp; - - return 0; - } - - int OpenRcmd(host, user, cmd, pr) - char *host, *user, *cmd; - ProcRef *pr; - { - DisplayFatalError(_("internal rcmd not implemented for Unix"), 0, 1); - return -1; - } - - #define INPUT_SOURCE_BUF_SIZE 8192 - - typedef struct { - CPKind kind; - int fd; - int lineByLine; - char *unused; - InputCallback func; - XtInputId xid; - char buf[INPUT_SOURCE_BUF_SIZE]; - VOIDSTAR closure; - } InputSource; - - void - DoInputCallback(closure, source, xid) - caddr_t closure; - int *source; - XtInputId *xid; - { - InputSource *is = (InputSource *) closure; - int count; - int error; - char *p, *q; - - if (is->lineByLine) { - count = read(is->fd, is->unused, - INPUT_SOURCE_BUF_SIZE - (is->unused - is->buf)); - if (count <= 0) { - (is->func)(is, is->closure, is->buf, count, count ? errno : 0); - return; - } - is->unused += count; - p = is->buf; - while (p < is->unused) { - q = memchr(p, '\n', is->unused - p); - if (q == NULL) break; - q++; - (is->func)(is, is->closure, p, q - p, 0); - p = q; - } - q = is->buf; - while (p < is->unused) { - *q++ = *p++; - } - is->unused = q; - } else { - count = read(is->fd, is->buf, INPUT_SOURCE_BUF_SIZE); - if (count == -1) - error = errno; - else - error = 0; - (is->func)(is, is->closure, is->buf, count, error); - } - } - - InputSourceRef AddInputSource(pr, lineByLine, func, closure) - ProcRef pr; - int lineByLine; - InputCallback func; - VOIDSTAR closure; - { - InputSource *is; - ChildProc *cp = (ChildProc *) pr; - - is = (InputSource *) calloc(1, sizeof(InputSource)); - is->lineByLine = lineByLine; - is->func = func; - if (pr == NoProc) { - is->kind = CPReal; - is->fd = fileno(stdin); - } else { - is->kind = cp->kind; - is->fd = cp->fdFrom; - } - if (lineByLine) { - is->unused = is->buf; - } - - is->xid = XtAppAddInput(appContext, is->fd, - (XtPointer) (XtInputReadMask), - (XtInputCallbackProc) DoInputCallback, - (XtPointer) is); - is->closure = closure; - return (InputSourceRef) is; - } - - void - RemoveInputSource(isr) - InputSourceRef isr; - { - InputSource *is = (InputSource *) isr; - - if (is->xid == 0) return; - XtRemoveInput(is->xid); - is->xid = 0; - } - - int OutputToProcess(pr, message, count, outError) - ProcRef pr; - char *message; - int count; - int *outError; - { - ChildProc *cp = (ChildProc *) pr; - int outCount; - - if (pr == NoProc) - outCount = fwrite(message, 1, count, stdout); - else - outCount = write(cp->fdTo, message, count); - - if (outCount == -1) - *outError = errno; - else - *outError = 0; - - return outCount; - } - - /* Output message to process, with "ms" milliseconds of delay - between each character. This is needed when sending the logon - script to ICC, which for some reason doesn't like the - instantaneous send. */ - int OutputToProcessDelayed(pr, message, count, outError, msdelay) - ProcRef pr; - char *message; - int count; - int *outError; - long msdelay; - { - ChildProc *cp = (ChildProc *) pr; - int outCount = 0; - int r; - - while (count--) { - r = write(cp->fdTo, message++, 1); - if (r == -1) { - *outError = errno; - return outCount; - } - ++outCount; - if (msdelay >= 0) - TimeDelay(msdelay); - } - - return outCount; - } - - /**** Animation code by Hugh Fisher, DCS, ANU. - - Known problem: if a window overlapping the board is - moved away while a piece is being animated underneath, - the newly exposed area won't be updated properly. - I can live with this. - - Known problem: if you look carefully at the animation - of pieces in mono mode, they are being drawn as solid - shapes without interior detail while moving. Fixing - this would be a major complication for minimal return. - ****/ - - /* Masks for XPM pieces. Black and white pieces can have - different shapes, but in the interest of retaining my - sanity pieces must have the same outline on both light - and dark squares, and all pieces must use the same - background square colors/images. */ - - static void - CreateAnimMasks (pieceDepth) - int pieceDepth; - { - ChessSquare piece; - Pixmap buf; - GC bufGC, maskGC; - int kind, n; - unsigned long plane; - XGCValues values; - - /* Need a bitmap just to get a GC with right depth */ - buf = XCreatePixmap(xDisplay, xBoardWindow, - 8, 8, 1); - values.foreground = 1; - values.background = 0; - /* Don't use XtGetGC, not read only */ - maskGC = XCreateGC(xDisplay, buf, - GCForeground | GCBackground, &values); - XFreePixmap(xDisplay, buf); - - buf = XCreatePixmap(xDisplay, xBoardWindow, - squareSize, squareSize, pieceDepth); - values.foreground = XBlackPixel(xDisplay, xScreen); - values.background = XWhitePixel(xDisplay, xScreen); - bufGC = XCreateGC(xDisplay, buf, - GCForeground | GCBackground, &values); - - for (piece = WhitePawn; piece <= BlackKing; piece++) { - /* Begin with empty mask */ - xpmMask[piece] = XCreatePixmap(xDisplay, xBoardWindow, - squareSize, squareSize, 1); - XSetFunction(xDisplay, maskGC, GXclear); - XFillRectangle(xDisplay, xpmMask[piece], maskGC, - 0, 0, squareSize, squareSize); - - /* Take a copy of the piece */ - if (White(piece)) - kind = 0; - else - kind = 2; - XSetFunction(xDisplay, bufGC, GXcopy); - XCopyArea(xDisplay, xpmPieceBitmap[kind][((int)piece) % 6], - buf, bufGC, - 0, 0, squareSize, squareSize, 0, 0); - - /* XOR the background (light) over the piece */ - XSetFunction(xDisplay, bufGC, GXxor); - if (useImageSqs) - XCopyArea(xDisplay, xpmLightSquare, buf, bufGC, - 0, 0, squareSize, squareSize, 0, 0); - else { - XSetForeground(xDisplay, bufGC, lightSquareColor); - XFillRectangle(xDisplay, buf, bufGC, 0, 0, squareSize, squareSize); - } - - /* We now have an inverted piece image with the background - erased. Construct mask by just selecting all the non-zero - pixels - no need to reconstruct the original image. */ - XSetFunction(xDisplay, maskGC, GXor); - plane = 1; - /* Might be quicker to download an XImage and create bitmap - data from it rather than this N copies per piece, but it - only takes a fraction of a second and there is a much - longer delay for loading the pieces. */ - for (n = 0; n < pieceDepth; n ++) { - XCopyPlane(xDisplay, buf, xpmMask[piece], maskGC, - 0, 0, squareSize, squareSize, - 0, 0, plane); - plane = plane << 1; - } - } - /* Clean up */ - XFreePixmap(xDisplay, buf); - XFreeGC(xDisplay, bufGC); - XFreeGC(xDisplay, maskGC); - } - - static void - InitAnimState (anim, info) - AnimState * anim; - XWindowAttributes * info; - { - XtGCMask mask; - XGCValues values; - - /* Each buffer is square size, same depth as window */ - anim->saveBuf = XCreatePixmap(xDisplay, xBoardWindow, - squareSize, squareSize, info->depth); - anim->newBuf = XCreatePixmap(xDisplay, xBoardWindow, - squareSize, squareSize, info->depth); - - /* Create a plain GC for blitting */ - mask = GCForeground | GCBackground | GCFunction | - GCPlaneMask | GCGraphicsExposures; - values.foreground = XBlackPixel(xDisplay, xScreen); - values.background = XWhitePixel(xDisplay, xScreen); - values.function = GXcopy; - values.plane_mask = AllPlanes; - values.graphics_exposures = False; - anim->blitGC = XCreateGC(xDisplay, xBoardWindow, mask, &values); - - /* Piece will be copied from an existing context at - the start of each new animation/drag. */ - anim->pieceGC = XCreateGC(xDisplay, xBoardWindow, 0, &values); - - /* Outline will be a read-only copy of an existing */ - anim->outlineGC = None; - } - - static void - CreateAnimVars () - { - static int done = 0; - XWindowAttributes info; - - if (done) return; - done = 1; - XGetWindowAttributes(xDisplay, xBoardWindow, &info); - - InitAnimState(&game, &info); - InitAnimState(&player, &info); - - /* For XPM pieces, we need bitmaps to use as masks. */ - if (useImages) - CreateAnimMasks(info.depth); - } - - #ifndef HAVE_USLEEP - - static Boolean frameWaiting; - - static RETSIGTYPE FrameAlarm (sig) - int sig; - { - frameWaiting = False; - /* In case System-V style signals. Needed?? */ - signal(SIGALRM, FrameAlarm); - } - - static void - FrameDelay (time) - int time; - { - struct itimerval delay; - - XSync(xDisplay, False); - - if (time > 0) { - frameWaiting = True; - signal(SIGALRM, FrameAlarm); - delay.it_interval.tv_sec = - delay.it_value.tv_sec = time / 1000; - delay.it_interval.tv_usec = - delay.it_value.tv_usec = (time % 1000) * 1000; - setitimer(ITIMER_REAL, &delay, NULL); - #if 0 - /* Ugh -- busy-wait! --tpm */ - while (frameWaiting); - #else - while (frameWaiting) pause(); - #endif - delay.it_interval.tv_sec = delay.it_value.tv_sec = 0; - delay.it_interval.tv_usec = delay.it_value.tv_usec = 0; - setitimer(ITIMER_REAL, &delay, NULL); - } - } - - #else - - static void - FrameDelay (time) - int time; - { - XSync(xDisplay, False); - if (time > 0) - usleep(time * 1000); - } - - #endif - - /* Convert board position to corner of screen rect and color */ - - static void - ScreenSquare(column, row, pt, color) - int column; int row; XPoint * pt; int * color; - { - if (flipView) { - pt->x = lineGap + ((BOARD_SIZE-1)-column) * (squareSize + lineGap); - pt->y = lineGap + row * (squareSize + lineGap); - } else { - pt->x = lineGap + column * (squareSize + lineGap); - pt->y = lineGap + ((BOARD_SIZE-1)-row) * (squareSize + lineGap); - } - *color = ((column + row) % 2) == 1; - } - - /* Convert window coords to square */ - - static void - BoardSquare(x, y, column, row) - int x; int y; int * column; int * row; - { - *column = EventToSquare(x, BOARD_SIZE); - if (flipView && *column >= 0) - *column = BOARD_SIZE - 1 - *column; - *row = EventToSquare(y, BOARD_SIZE); - if (!flipView && *row >= 0) - *row = BOARD_SIZE - 1 - *row; - } - - /* Utilities */ - - #undef Max /* just in case */ - #undef Min - #define Max(a, b) ((a) > (b) ? (a) : (b)) - #define Min(a, b) ((a) < (b) ? (a) : (b)) - - static void - SetRect(rect, x, y, width, height) - XRectangle * rect; int x; int y; int width; int height; - { - rect->x = x; - rect->y = y; - rect->width = width; - rect->height = height; - } - - /* Test if two frames overlap. If they do, return - intersection rect within old and location of - that rect within new. */ - - static Boolean - Intersect(old, new, size, area, pt) - XPoint * old; XPoint * new; - int size; XRectangle * area; XPoint * pt; - { - if (old->x > new->x + size || new->x > old->x + size || - old->y > new->y + size || new->y > old->y + size) { - return False; - } else { - SetRect(area, Max(new->x - old->x, 0), Max(new->y - old->y, 0), - size - abs(old->x - new->x), size - abs(old->y - new->y)); - pt->x = Max(old->x - new->x, 0); - pt->y = Max(old->y - new->y, 0); - return True; - } - } - - /* For two overlapping frames, return the rect(s) - in the old that do not intersect with the new. */ - - static void - CalcUpdateRects(old, new, size, update, nUpdates) - XPoint * old; XPoint * new; int size; - XRectangle update[]; int * nUpdates; - { - int count; - - /* If old = new (shouldn't happen) then nothing to draw */ - if (old->x == new->x && old->y == new->y) { - *nUpdates = 0; - return; - } - /* Work out what bits overlap. Since we know the rects - are the same size we don't need a full intersect calc. */ - count = 0; - /* Top or bottom edge? */ - if (new->y > old->y) { - SetRect(&(update[count]), old->x, old->y, size, new->y - old->y); - count ++; - } else if (old->y > new->y) { - SetRect(&(update[count]), old->x, old->y + size - (old->y - new->y), - size, old->y - new->y); - count ++; - } - /* Left or right edge - don't overlap any update calculated above. */ - if (new->x > old->x) { - SetRect(&(update[count]), old->x, Max(new->y, old->y), - new->x - old->x, size - abs(new->y - old->y)); - count ++; - } else if (old->x > new->x) { - SetRect(&(update[count]), new->x + size, Max(new->y, old->y), - old->x - new->x, size - abs(new->y - old->y)); - count ++; - } - /* Done */ - *nUpdates = count; - } - - /* Generate a series of frame coords from start->mid->finish. - The movement rate doubles until the half way point is - reached, then halves back down to the final destination, - which gives a nice slow in/out effect. The algorithmn - may seem to generate too many intermediates for short - moves, but remember that the purpose is to attract the - viewers attention to the piece about to be moved and - then to where it ends up. Too few frames would be less - noticeable. */ - - static void - Tween(start, mid, finish, factor, frames, nFrames) - XPoint * start; XPoint * mid; - XPoint * finish; int factor; - XPoint frames[]; int * nFrames; - { - int fraction, n, count; - - count = 0; - - /* Slow in, stepping 1/16th, then 1/8th, ... */ - fraction = 1; - for (n = 0; n < factor; n++) - fraction *= 2; - for (n = 0; n < factor; n++) { - frames[count].x = start->x + (mid->x - start->x) / fraction; - frames[count].y = start->y + (mid->y - start->y) / fraction; - count ++; - fraction = fraction / 2; - } - - /* Midpoint */ - frames[count] = *mid; - count ++; - - /* Slow out, stepping 1/2, then 1/4, ... */ - fraction = 2; - for (n = 0; n < factor; n++) { - frames[count].x = finish->x - (finish->x - mid->x) / fraction; - frames[count].y = finish->y - (finish->y - mid->y) / fraction; - count ++; - fraction = fraction * 2; - } - *nFrames = count; - } - - /* Draw a piece on the screen without disturbing what's there */ - - static void - SelectGCMask(piece, clip, outline, mask) - ChessSquare piece; GC * clip; GC * outline; Pixmap * mask; - { - GC source; - - /* Bitmap for piece being moved. */ - if (appData.monoMode) { - *mask = *pieceToSolid(piece); - } else if (useImages) { - #if HAVE_LIBXPM - *mask = xpmMask[piece]; - #else - *mask = ximMaskPm[piece%6]; - #endif - } else { - *mask = *pieceToSolid(piece); - } - - /* GC for piece being moved. Square color doesn't matter, but - since it gets modified we make a copy of the original. */ - if (White(piece)) { - if (appData.monoMode) - source = bwPieceGC; - else - source = wlPieceGC; - } else { - if (appData.monoMode) - source = wbPieceGC; - else - source = blPieceGC; - } - XCopyGC(xDisplay, source, 0xFFFFFFFF, *clip); - - /* Outline only used in mono mode and is not modified */ - if (White(piece)) - *outline = bwPieceGC; - else - *outline = wbPieceGC; - } - - static void - OverlayPiece(piece, clip, outline, dest) - ChessSquare piece; GC clip; GC outline; Drawable dest; - { - int kind; - - if (!useImages) { - /* Draw solid rectangle which will be clipped to shape of piece */ - XFillRectangle(xDisplay, dest, clip, - 0, 0, squareSize, squareSize); - if (appData.monoMode) - /* Also draw outline in contrasting color for black - on black / white on white cases */ - XCopyPlane(xDisplay, *pieceToOutline(piece), dest, outline, - 0, 0, squareSize, squareSize, 0, 0, 1); - } else { - /* Copy the piece */ - if (White(piece)) - kind = 0; - else - kind = 2; - XCopyArea(xDisplay, xpmPieceBitmap[kind][((int)piece) % 6], - dest, clip, - 0, 0, squareSize, squareSize, - 0, 0); - } - } - - /* Animate the movement of a single piece */ - - static void - BeginAnimation(anim, piece, startColor, start) - AnimState *anim; - ChessSquare piece; - int startColor; - XPoint * start; - { - Pixmap mask; - - /* The old buffer is initialised with the start square (empty) */ - BlankSquare(0, 0, startColor, EmptySquare, anim->saveBuf); - anim->prevFrame = *start; - - /* The piece will be drawn using its own bitmap as a matte */ - SelectGCMask(piece, &anim->pieceGC, &anim->outlineGC, &mask); - XSetClipMask(xDisplay, anim->pieceGC, mask); - } - - static void - AnimationFrame(anim, frame, piece) - AnimState *anim; - XPoint *frame; - ChessSquare piece; - { - XRectangle updates[4]; - XRectangle overlap; - XPoint pt; - int count, i; - - /* Save what we are about to draw into the new buffer */ - XCopyArea(xDisplay, xBoardWindow, anim->newBuf, anim->blitGC, - frame->x, frame->y, squareSize, squareSize, - 0, 0); - - /* Erase bits of the previous frame */ - if (Intersect(&anim->prevFrame, frame, squareSize, &overlap, &pt)) { - /* Where the new frame overlapped the previous, - the contents in newBuf are wrong. */ - XCopyArea(xDisplay, anim->saveBuf, anim->newBuf, anim->blitGC, - overlap.x, overlap.y, - overlap.width, overlap.height, - pt.x, pt.y); - /* Repaint the areas in the old that don't overlap new */ - CalcUpdateRects(&anim->prevFrame, frame, squareSize, updates, &count); - for (i = 0; i < count; i++) - XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, - updates[i].x - anim->prevFrame.x, - updates[i].y - anim->prevFrame.y, - updates[i].width, updates[i].height, - updates[i].x, updates[i].y); - } else { - /* Easy when no overlap */ - XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, - 0, 0, squareSize, squareSize, - anim->prevFrame.x, anim->prevFrame.y); - } - - /* Save this frame for next time round */ - XCopyArea(xDisplay, anim->newBuf, anim->saveBuf, anim->blitGC, - 0, 0, squareSize, squareSize, - 0, 0); - anim->prevFrame = *frame; - - /* Draw piece over original screen contents, not current, - and copy entire rect. Wipes out overlapping piece images. */ - OverlayPiece(piece, anim->pieceGC, anim->outlineGC, anim->newBuf); - XCopyArea(xDisplay, anim->newBuf, xBoardWindow, anim->blitGC, - 0, 0, squareSize, squareSize, - frame->x, frame->y); - } - - static void - EndAnimation (anim, finish) - AnimState *anim; - XPoint *finish; - { - XRectangle updates[4]; - XRectangle overlap; - XPoint pt; - int count, i; - - /* The main code will redraw the final square, so we - only need to erase the bits that don't overlap. */ - if (Intersect(&anim->prevFrame, finish, squareSize, &overlap, &pt)) { - CalcUpdateRects(&anim->prevFrame, finish, squareSize, updates, &count); - for (i = 0; i < count; i++) - XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, - updates[i].x - anim->prevFrame.x, - updates[i].y - anim->prevFrame.y, - updates[i].width, updates[i].height, - updates[i].x, updates[i].y); - } else { - XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, - 0, 0, squareSize, squareSize, - anim->prevFrame.x, anim->prevFrame.y); - } - } - - static void - FrameSequence(anim, piece, startColor, start, finish, frames, nFrames) - AnimState *anim; - ChessSquare piece; int startColor; - XPoint * start; XPoint * finish; - XPoint frames[]; int nFrames; - { - int n; - - BeginAnimation(anim, piece, startColor, start); - for (n = 0; n < nFrames; n++) { - AnimationFrame(anim, &(frames[n]), piece); - FrameDelay(appData.animSpeed); - } - EndAnimation(anim, finish); - } - - /* Main control logic for deciding what to animate and how */ - - void - AnimateMove(board, fromX, fromY, toX, toY) - Board board; - int fromX; - int fromY; - int toX; - int toY; - { - ChessSquare piece; - int hop; - XPoint start, finish, mid; - XPoint frames[kFactor * 2 + 1]; - int nFrames, startColor, endColor; - - /* Are we animating? */ - if (!appData.animate || appData.blindfold) - return; - - if (fromY < 0 || fromX < 0 || toX < 0 || toY < 0) return; - piece = board[fromY][fromX]; - if (piece >= EmptySquare) return; - - #if DONT_HOP - hop = FALSE; - #else - hop = (piece == WhiteKnight || piece == BlackKnight); - #endif - - if (appData.debugMode) { - printf(hop ? _("AnimateMove: piece %d hops from %d,%d to %d,%d \n") : - _("AnimateMove: piece %d slides from %d,%d to %d,%d \n"), - piece, fromX, fromY, toX, toY); - } - - ScreenSquare(fromX, fromY, &start, &startColor); - ScreenSquare(toX, toY, &finish, &endColor); - - if (hop) { - /* Knight: make diagonal movement then straight */ - if (abs(toY - fromY) < abs(toX - fromX)) { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = finish.y; - } else { - mid.x = finish.x; - mid.y = start.y + (finish.y - start.y) / 2; - } - } else { - mid.x = start.x + (finish.x - start.x) / 2; - mid.y = start.y + (finish.y - start.y) / 2; - } - - /* Don't use as many frames for very short moves */ - if (abs(toY - fromY) + abs(toX - fromX) <= 2) - Tween(&start, &mid, &finish, kFactor - 1, frames, &nFrames); - else - Tween(&start, &mid, &finish, kFactor, frames, &nFrames); - FrameSequence(&game, piece, startColor, &start, &finish, frames, nFrames); - - /* Be sure end square is redrawn */ - damage[toY][toX] = True; - } - - static void - DragPieceBegin(x, y) - int x; int y; - { - int boardX, boardY, color; - XPoint corner; - - /* Are we animating? */ - if (!appData.animateDragging || appData.blindfold) - return; - - /* Figure out which square we start in and the - mouse position relative to top left corner. */ - BoardSquare(x, y, &boardX, &boardY); - player.startBoardX = boardX; - player.startBoardY = boardY; - ScreenSquare(boardX, boardY, &corner, &color); - player.startSquare = corner; - player.startColor = color; - #if 0 - /* Start from exactly where the piece is. This can be confusing - if you start dragging far from the center of the square; most - or all of the piece can be over a different square from the one - the mouse pointer is in. */ - player.mouseDelta.x = x - corner.x; - player.mouseDelta.y = y - corner.y; - #else - /* As soon as we start dragging, the piece will jump slightly to - be centered over the mouse pointer. */ - player.mouseDelta.x = squareSize/2; - player.mouseDelta.y = squareSize/2; - #endif - /* Initialise animation */ - player.dragPiece = PieceForSquare(boardX, boardY); - /* Sanity check */ - if (player.dragPiece >= 0 && player.dragPiece < EmptySquare) { - player.dragActive = True; - BeginAnimation(&player, player.dragPiece, color, &corner); - /* Mark this square as needing to be redrawn. Note that - we don't remove the piece though, since logically (ie - as seen by opponent) the move hasn't been made yet. */ - damage[boardY][boardX] = True; - } else { - player.dragActive = False; - } - } - - static void - DragPieceMove(x, y) - int x; int y; - { - XPoint corner; - - /* Are we animating? */ - if (!appData.animateDragging || appData.blindfold) - return; - - /* Sanity check */ - if (! player.dragActive) - return; - /* Move piece, maintaining same relative position - of mouse within square */ - corner.x = x - player.mouseDelta.x; - corner.y = y - player.mouseDelta.y; - AnimationFrame(&player, &corner, player.dragPiece); - #if HIGHDRAG - if (appData.highlightDragging) { - int boardX, boardY; - BoardSquare(x, y, &boardX, &boardY); - SetHighlights(fromX, fromY, boardX, boardY); - } - #endif - } - - static void - DragPieceEnd(x, y) - int x; int y; - { - int boardX, boardY, color; - XPoint corner; - - /* Are we animating? */ - if (!appData.animateDragging || appData.blindfold) - return; - - /* Sanity check */ - if (! player.dragActive) - return; - /* Last frame in sequence is square piece is - placed on, which may not match mouse exactly. */ - BoardSquare(x, y, &boardX, &boardY); - ScreenSquare(boardX, boardY, &corner, &color); - EndAnimation(&player, &corner); - - /* Be sure end square is redrawn */ - damage[boardY][boardX] = True; - - /* This prevents weird things happening with fast successive - clicks which on my Sun at least can cause motion events - without corresponding press/release. */ - player.dragActive = False; - } - - /* Handle expose event while piece being dragged */ - - static void - DrawDragPiece () - { - if (!player.dragActive || appData.blindfold) - return; - - /* What we're doing: logically, the move hasn't been made yet, - so the piece is still in it's original square. But visually - it's being dragged around the board. So we erase the square - that the piece is on and draw it at the last known drag point. */ - BlankSquare(player.startSquare.x, player.startSquare.y, - player.startColor, EmptySquare, xBoardWindow); - AnimationFrame(&player, &player.prevFrame, player.dragPiece); - damage[player.startBoardY][player.startBoardX] = TRUE; - } - + /* + * xboard.c -- X front end for XBoard + * $Id: xboard.c,v 2.2 2003/11/06 07:22:14 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + * + * See the file ChangeLog for a revision history. + */ + + #include "config.h" + + #include + #include + #include + #include + #include + #include + #include + + #if !OMIT_SOCKETS + # if HAVE_SYS_SOCKET_H + # include + # include + # include + # else /* not HAVE_SYS_SOCKET_H */ + # if HAVE_LAN_SOCKET_H + # include + # include + # include + # else /* not HAVE_LAN_SOCKET_H */ + # define OMIT_SOCKETS 1 + # endif /* not HAVE_LAN_SOCKET_H */ + # endif /* not HAVE_SYS_SOCKET_H */ + #endif /* !OMIT_SOCKETS */ + + #if STDC_HEADERS + # include + # include + #else /* not STDC_HEADERS */ + extern char *getenv(); + # if HAVE_STRING_H + # include + # else /* not HAVE_STRING_H */ + # include + # endif /* not HAVE_STRING_H */ + #endif /* not STDC_HEADERS */ + + #if HAVE_SYS_FCNTL_H + # include + #else /* not HAVE_SYS_FCNTL_H */ + # if HAVE_FCNTL_H + # include + # endif /* HAVE_FCNTL_H */ + #endif /* not HAVE_SYS_FCNTL_H */ + + #if HAVE_SYS_SYSTEMINFO_H + # include + #endif /* HAVE_SYS_SYSTEMINFO_H */ + + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + #if HAVE_UNISTD_H + # include + #endif + + #if HAVE_SYS_WAIT_H + # include + #endif + + #if HAVE_DIRENT_H + # include + # define NAMLEN(dirent) strlen((dirent)->d_name) + # define HAVE_DIR_STRUCT + #else + # define dirent direct + # define NAMLEN(dirent) (dirent)->d_namlen + # if HAVE_SYS_NDIR_H + # include + # define HAVE_DIR_STRUCT + # endif + # if HAVE_SYS_DIR_H + # include + # define HAVE_DIR_STRUCT + # endif + # if HAVE_NDIR_H + # include + # define HAVE_DIR_STRUCT + # endif + #endif + + #include + #include + #include + #include + #include + #if USE_XAW3D + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #else + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #endif + + // [HGM] bitmaps: put before incuding the bitmaps / pixmaps, to know how many piece types there are. + #include "common.h" + + #if HAVE_LIBXPM + #include + #include "pixmaps/pixmaps.h" + #define IMAGE_EXT "xpm" + #else + #define IMAGE_EXT "xim" + #include "bitmaps/bitmaps.h" + #endif + + #include "bitmaps/icon_white.bm" + #include "bitmaps/icon_black.bm" + #include "bitmaps/checkmark.bm" + + #include "frontend.h" + #include "backend.h" + #include "moves.h" + #include "xboard.h" + #include "childio.h" + #include "xgamelist.h" + #include "xhistory.h" -#include "xedittags.h" - -// must be moved to xengineoutput.h -void EngineOutputProc P((Widget w, XEvent *event, - String *prms, Cardinal *nprms)); ++#include "xedittags.h" ++#include "gettext.h" ++ ++// must be moved to xengineoutput.h ++ ++void EngineOutputProc P((Widget w, XEvent *event, ++ String *prms, Cardinal *nprms)); ++ + void EngineOutputPopDown(); + + + #ifdef __EMX__ + #ifndef HAVE_USLEEP + #define HAVE_USLEEP + #endif + #define usleep(t) _sleep2(((t)+500)/1000) + #endif + ++#ifdef ENABLE_NLS ++# define _(s) gettext (s) ++# define N_(s) gettext_noop (s) ++#else ++# define _(s) (s) ++# define N_(s) s ++#endif ++ + typedef struct { + String string; + XtActionProc proc; + } MenuItem; + + typedef struct { + String name; + MenuItem *mi; + } Menu; + + int main P((int argc, char **argv)); + RETSIGTYPE CmailSigHandler P((int sig)); + RETSIGTYPE IntSigHandler P((int sig)); + void CreateGCs P((void)); + void CreateXIMPieces P((void)); + void CreateXPMPieces P((void)); + void CreatePieces P((void)); + void CreatePieceMenus P((void)); + Widget CreateMenuBar P((Menu *mb)); + Widget CreateButtonBar P ((MenuItem *mi)); + char *FindFont P((char *pattern, int targetPxlSize)); + void PieceMenuPopup P((Widget w, XEvent *event, + String *params, Cardinal *num_params)); + static void PieceMenuSelect P((Widget w, ChessSquare piece, caddr_t junk)); + static void DropMenuSelect P((Widget w, ChessSquare piece, caddr_t junk)); + void ReadBitmap P((Pixmap *pm, String name, unsigned char bits[], + u_int wreq, u_int hreq)); + void CreateGrid P((void)); + int EventToSquare P((int x, int limit)); + void DrawSquare P((int row, int column, ChessSquare piece, int do_flash)); + void EventProc P((Widget widget, caddr_t unused, XEvent *event)); + void HandleUserMove P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AnimateUserMove P((Widget w, XEvent * event, + String * params, Cardinal * nParams)); + void WhiteClock P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void BlackClock P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void DrawPositionProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void XDrawPosition P((Widget w, /*Boolean*/int repaint, + Board board)); + void CommentPopUp P((char *title, char *label)); + void CommentPopDown P((void)); + void CommentCallback P((Widget w, XtPointer client_data, + XtPointer call_data)); + void ICSInputBoxPopUp P((void)); + void ICSInputBoxPopDown P((void)); + void FileNamePopUp P((char *label, char *def, + FileProc proc, char *openMode)); + void FileNamePopDown P((void)); + void FileNameCallback P((Widget w, XtPointer client_data, + XtPointer call_data)); + void FileNameAction P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AskQuestionReplyAction P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AskQuestionProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AskQuestionPopDown P((void)); + void PromotionPopUp P((void)); + void PromotionPopDown P((void)); + void PromotionCallback P((Widget w, XtPointer client_data, + XtPointer call_data)); + void EditCommentPopDown P((void)); + void EditCommentCallback P((Widget w, XtPointer client_data, + XtPointer call_data)); + void SelectCommand P((Widget w, XtPointer client_data, XtPointer call_data)); + void ResetProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void LoadGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void LoadNextGameProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void LoadPrevGameProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void ReloadGameProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void LoadPositionProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void LoadNextPositionProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void LoadPrevPositionProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void ReloadPositionProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void CopyPositionProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PastePositionProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void CopyGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void PasteGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void SaveGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void SavePositionProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void MailMoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ReloadCmailMsgProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void QuitProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void PauseProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void MachineBlackProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void MachineWhiteProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AnalyzeModeProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AnalyzeFileProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void TwoMachinesProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void IcsClientProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void EditGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void EditPositionProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void TrainingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void EditCommentProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void IcsInputBoxProc P((Widget w, XEvent *event, + String *prms, Cardinal *nprms)); + void AcceptProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void DeclineProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void RematchProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void CallFlagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void DrawProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AbortProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AdjournProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ResignProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void EnterKeyProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void StopObservingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void StopExaminingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void BackwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ForwardProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ToStartProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ToEndProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void RevertProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void TruncateGameProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void RetractMoveProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void MoveNowProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AlwaysQueenProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void AnimateDraggingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void AnimateMovingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void AutocommProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void AutoflagProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AutoflipProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AutobsProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void AutoraiseProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AutosaveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void BlindfoldProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void FlashMovesProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void FlipViewProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void GetMoveListProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void HighlightDraggingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void HighlightLastMoveProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void MoveSoundProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void IcsAlarmProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void OldSaveStyleProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PeriodicUpdatesProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PonderNextMoveProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PopupMoveErrorsProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PopupExitMessageProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void PremoveProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void QuietPlayProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ShowCoordsProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void ShowThinkingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void HideThinkingProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void TestLegalityProc P((Widget w, XEvent *event, String *prms, + Cardinal *nprms)); + void InfoProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ManProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void HintProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void BookProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AboutGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void AboutProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void DebugProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void NothingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void Iconify P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void DisplayMove P((int moveNumber)); + void DisplayTitle P((char *title)); + void ICSInitScript P((void)); + int LoadGamePopUp P((FILE *f, int gameNumber, char *title)); + void ErrorPopUp P((char *title, char *text, int modal)); + void ErrorPopDown P((void)); + static char *ExpandPathName P((char *path)); + static void CreateAnimVars P((void)); + static void DragPieceBegin P((int x, int y)); + static void DragPieceMove P((int x, int y)); + static void DragPieceEnd P((int x, int y)); + static void DrawDragPiece P((void)); + char *ModeToWidgetName P((GameMode mode)); + void EngineOutputUpdate( FrontEndProgramStats * stats ); + void ShuffleMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void EngineMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void UciMenuProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void TimeControlProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void NewVariantProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void FirstSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void SecondSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms)); + void ShufflePopDown P(()); + void EnginePopDown P(()); + void UciPopDown P(()); + void TimeControlPopDown P(()); + void NewVariantPopDown P(()); + void SettingsPopDown P(()); + /* + * XBoard depends on Xt R4 or higher + */ + int xtVersion = XtSpecificationRelease; + + int xScreen; + Display *xDisplay; + Window xBoardWindow; + Pixel lightSquareColor, darkSquareColor, whitePieceColor, blackPieceColor, + jailSquareColor, highlightSquareColor, premoveHighlightColor; + GC lightSquareGC, darkSquareGC, jailSquareGC, lineGC, wdPieceGC, wlPieceGC, + bdPieceGC, blPieceGC, wbPieceGC, bwPieceGC, coordGC, highlineGC, + wjPieceGC, bjPieceGC, prelineGC, countGC; + Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; + Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget, + whiteTimerWidget, blackTimerWidget, titleWidget, widgetList[16], + commentShell, promotionShell, whitePieceMenu, blackPieceMenu, dropMenu, + menuBarWidget, buttonBarWidget, editShell, errorShell, analysisShell, + ICSInputShell, fileNameShell, askQuestionShell; + XSegment gridSegments[(BOARD_SIZE + 1) * 2]; + XSegment jailGridSegments[(BOARD_SIZE + 3) * 2]; + Font clockFontID, coordFontID, countFontID; + XFontStruct *clockFontStruct, *coordFontStruct, *countFontStruct; + XtAppContext appContext; + char *layoutName; + char *oldICSInteractionTitle; + + FileProc fileProc; -char *fileOpenMode; ++char *fileOpenMode; + char installDir[] = "."; // [HGM] UCI: needed for UCI; probably needs run-time initializtion + + Position commentX = -1, commentY = -1; + Dimension commentW, commentH; + -int squareSize, smallLayout = 0, tinyLayout = 0, ++int squareSize, smallLayout = 0, tinyLayout = 0, + marginW, marginH, // [HGM] for run-time resizing + fromX = -1, fromY = -1, toX, toY, commentUp = False, analysisUp = False, + ICSInputBoxUp = False, askQuestionUp = False, + filenameUp = False, promotionUp = False, pmFromX = -1, pmFromY = -1, + editUp = False, errorUp = False, errorExitStatus = -1, lineGap; + Pixel timerForegroundPixel, timerBackgroundPixel; + Pixel buttonForegroundPixel, buttonBackgroundPixel; + char *chessDir, *programName, *programVersion, + *gameCopyFilename, *gamePasteFilename; + + #define SOLID 0 + #define OUTLINE 1 + Pixmap pieceBitmap[2][(int)BlackPawn]; + Pixmap xpmPieceBitmap[4][(int)BlackPawn]; /* LL, LD, DL, DD */ + Pixmap xpmLightSquare, xpmDarkSquare, xpmJailSquare; + int useImages, useImageSqs; + XImage *ximPieceBitmap[4][(int)BlackPawn]; /* LL, LD, DL, DD */ + Pixmap ximMaskPm[(int)BlackPawn]; /* clipmasks, used for XIM pieces */ + XImage *ximLightSquare, *ximDarkSquare; + XImage *xim_Cross; + + #define pieceToSolid(piece) &pieceBitmap[SOLID][((int)(piece)) % (int)BlackPawn] + #define pieceToOutline(piece) &pieceBitmap[OUTLINE][((int)(piece)) % (int)BlackPawn] + + #define White(piece) ((int)(piece) < (int)BlackPawn) + + /* Variables for doing smooth animation. This whole thing + would be much easier if the board was double-buffered, + but that would require a fairly major rewrite. */ + + typedef struct { + Pixmap saveBuf; + Pixmap newBuf; + GC blitGC, pieceGC, outlineGC; + XPoint startSquare, prevFrame, mouseDelta; + int startColor; + int dragPiece; + Boolean dragActive; + int startBoardX, startBoardY; + } AnimState; + + /* There can be two pieces being animated at once: a player + can begin dragging a piece before the remote opponent has moved. */ + + static AnimState game, player; + + /* Bitmaps for use as masks when drawing XPM pieces. + Need one for each black and white piece. */ + static Pixmap xpmMask[BlackKing + 1]; + + /* This magic number is the number of intermediate frames used + in each half of the animation. For short moves it's reduced + by 1. The total number of frames will be factor * 2 + 1. */ + #define kFactor 4 + + SizeDefaults sizeDefaults[] = SIZE_DEFAULTS; + + MenuItem fileMenu[] = { - {"New Game", ResetProc}, - {"New Shuffle Game ...", ShuffleMenuProc}, - {"New Variant ...", NewVariantProc}, // [HGM] variant: not functional yet ++ {N_("New Game"), ResetProc}, ++ {N_("New Shuffle Game ..."), ShuffleMenuProc}, ++ {N_("New Variant ..."), NewVariantProc}, // [HGM] variant: not functional yet + {"----", NothingProc}, - {"Load Game", LoadGameProc}, - {"Load Next Game", LoadNextGameProc}, - {"Load Previous Game", LoadPrevGameProc}, - {"Reload Same Game", ReloadGameProc}, - {"Save Game", SaveGameProc}, ++ {N_("Load Game"), LoadGameProc}, ++ {N_("Load Next Game"), LoadNextGameProc}, ++ {N_("Load Previous Game"), LoadPrevGameProc}, ++ {N_("Reload Same Game"), ReloadGameProc}, ++ {N_("Save Game"), SaveGameProc}, + {"----", NothingProc}, - {"Copy Game", CopyGameProc}, - {"Paste Game", PasteGameProc}, ++ {N_("Copy Game"), CopyGameProc}, ++ {N_("Paste Game"), PasteGameProc}, + {"----", NothingProc}, - {"Load Position", LoadPositionProc}, - {"Load Next Position", LoadNextPositionProc}, - {"Load Previous Position", LoadPrevPositionProc}, - {"Reload Same Position", ReloadPositionProc}, - {"Save Position", SavePositionProc}, ++ {N_("Load Position"), LoadPositionProc}, ++ {N_("Load Next Position"), LoadNextPositionProc}, ++ {N_("Load Previous Position"), LoadPrevPositionProc}, ++ {N_("Reload Same Position"), ReloadPositionProc}, ++ {N_("Save Position"), SavePositionProc}, + {"----", NothingProc}, - {"Copy Position", CopyPositionProc}, - {"Paste Position", PastePositionProc}, ++ {N_("Copy Position"), CopyPositionProc}, ++ {N_("Paste Position"), PastePositionProc}, + {"----", NothingProc}, - {"Mail Move", MailMoveProc}, - {"Reload CMail Message", ReloadCmailMsgProc}, ++ {N_("Mail Move"), MailMoveProc}, ++ {N_("Reload CMail Message"), ReloadCmailMsgProc}, + {"----", NothingProc}, - {"Exit", QuitProc}, ++ {N_("Exit"), QuitProc}, + {NULL, NULL} + }; + + MenuItem modeMenu[] = { - {"Machine White", MachineWhiteProc}, - {"Machine Black", MachineBlackProc}, - {"Two Machines", TwoMachinesProc}, - {"Analysis Mode", AnalyzeModeProc}, - {"Analyze File", AnalyzeFileProc }, - {"ICS Client", IcsClientProc}, - {"Edit Game", EditGameProc}, - {"Edit Position", EditPositionProc}, - {"Training", TrainingProc}, ++ {N_("Machine White"), MachineWhiteProc}, ++ {N_("Machine Black"), MachineBlackProc}, ++ {N_("Two Machines"), TwoMachinesProc}, ++ {N_("Analysis Mode"), AnalyzeModeProc}, ++ {N_("Analyze File"), AnalyzeFileProc }, ++ {N_("ICS Client"), IcsClientProc}, ++ {N_("Edit Game"), EditGameProc}, ++ {N_("Edit Position"), EditPositionProc}, ++ {N_("Training"), TrainingProc}, + {"----", NothingProc}, - {"Show Engine Output", EngineOutputProc}, - {"Show Evaluation Graph", NothingProc}, // [HGM] evalgr: not functional yet - {"Show Game List", ShowGameListProc}, ++ {N_("Show Engine Output"), EngineOutputProc}, ++ {N_("Show Evaluation Graph"), NothingProc}, // [HGM] evalgr: not functional yet ++ {N_("Show Game List"), ShowGameListProc}, + {"Show Move History", HistoryShowProc}, // [HGM] hist: activate 4.2.7 code + {"----", NothingProc}, - {"Edit Tags", EditTagsProc}, - {"Edit Comment", EditCommentProc}, - {"ICS Input Box", IcsInputBoxProc}, - {"Pause", PauseProc}, ++ {N_("Edit Tags"), EditTagsProc}, ++ {N_("Edit Comment"), EditCommentProc}, ++ {N_("ICS Input Box"), IcsInputBoxProc}, ++ {N_("Pause"), PauseProc}, + {NULL, NULL} + }; + + MenuItem actionMenu[] = { - {"Accept", AcceptProc}, - {"Decline", DeclineProc}, - {"Rematch", RematchProc}, ++ {N_("Accept"), AcceptProc}, ++ {N_("Decline"), DeclineProc}, ++ {N_("Rematch"), RematchProc}, + {"----", NothingProc}, - {"Call Flag", CallFlagProc}, - {"Draw", DrawProc}, - {"Adjourn", AdjournProc}, - {"Abort", AbortProc}, - {"Resign", ResignProc}, ++ {N_("Call Flag"), CallFlagProc}, ++ {N_("Draw"), DrawProc}, ++ {N_("Adjourn"), AdjournProc}, ++ {N_("Abort"), AbortProc}, ++ {N_("Resign"), ResignProc}, + {"----", NothingProc}, - {"Stop Observing", StopObservingProc}, - {"Stop Examining", StopExaminingProc}, ++ {N_("Stop Observing"), StopObservingProc}, ++ {N_("Stop Examining"), StopExaminingProc}, + {NULL, NULL} + }; + + MenuItem stepMenu[] = { - {"Backward", BackwardProc}, - {"Forward", ForwardProc}, - {"Back to Start", ToStartProc}, - {"Forward to End", ToEndProc}, - {"Revert", RevertProc}, - {"Truncate Game", TruncateGameProc}, ++ {N_("Backward"), BackwardProc}, ++ {N_("Forward"), ForwardProc}, ++ {N_("Back to Start"), ToStartProc}, ++ {N_("Forward to End"), ToEndProc}, ++ {N_("Revert"), RevertProc}, ++ {N_("Truncate Game"), TruncateGameProc}, + {"----", NothingProc}, - {"Move Now", MoveNowProc}, - {"Retract Move", RetractMoveProc}, ++ {N_("Move Now"), MoveNowProc}, ++ {N_("Retract Move"), RetractMoveProc}, + {NULL, NULL} + }; + -MenuItem optionsMenu[] = { - {"Flip View", FlipViewProc}, ++MenuItem optionsMenu[] = { ++ {N_("Flip View"), FlipViewProc}, + {"----", NothingProc}, - {"Adjudications ...", EngineMenuProc}, - {"General Settings ...", UciMenuProc}, - {"Engine #1 Settings ...", FirstSettingsProc}, - {"Engine #2 Settings ...", SecondSettingsProc}, - {"Time Control ...", TimeControlProc}, ++ {N_("Adjudications ..."), EngineMenuProc}, ++ {N_("General Settings ..."), UciMenuProc}, ++ {N_("Engine #1 Settings ..."), FirstSettingsProc}, ++ {N_("Engine #2 Settings ..."), SecondSettingsProc}, ++ {N_("Time Control ..."), TimeControlProc}, + {"----", NothingProc}, - {"Always Queen", AlwaysQueenProc}, - {"Animate Dragging", AnimateDraggingProc}, - {"Animate Moving", AnimateMovingProc}, - {"Auto Comment", AutocommProc}, - {"Auto Flag", AutoflagProc}, - {"Auto Flip View", AutoflipProc}, - {"Auto Observe", AutobsProc}, - {"Auto Raise Board", AutoraiseProc}, - {"Auto Save", AutosaveProc}, - {"Blindfold", BlindfoldProc}, - {"Flash Moves", FlashMovesProc}, - {"Get Move List", GetMoveListProc}, ++ {N_("Always Queen"), AlwaysQueenProc}, ++ {N_("Animate Dragging"), AnimateDraggingProc}, ++ {N_("Animate Moving"), AnimateMovingProc}, ++ {N_("Auto Comment"), AutocommProc}, ++ {N_("Auto Flag"), AutoflagProc}, ++ {N_("Auto Flip View"), AutoflipProc}, ++ {N_("Auto Observe"), AutobsProc}, ++ {N_("Auto Raise Board"), AutoraiseProc}, ++ {N_("Auto Save"), AutosaveProc}, ++ {N_("Blindfold"), BlindfoldProc}, ++ {N_("Flash Moves"), FlashMovesProc}, ++ {N_("Get Move List"), GetMoveListProc}, + #if HIGHDRAG - {"Highlight Dragging", HighlightDraggingProc}, ++ {N_("Highlight Dragging"), HighlightDraggingProc}, + #endif - {"Highlight Last Move", HighlightLastMoveProc}, - {"Move Sound", MoveSoundProc}, - {"ICS Alarm", IcsAlarmProc}, - {"Old Save Style", OldSaveStyleProc}, - {"Periodic Updates", PeriodicUpdatesProc}, - {"Ponder Next Move", PonderNextMoveProc}, - {"Popup Exit Message", PopupExitMessageProc}, - {"Popup Move Errors", PopupMoveErrorsProc}, - {"Premove", PremoveProc}, - {"Quiet Play", QuietPlayProc}, - {"Show Coords", ShowCoordsProc}, - {"Hide Thinking", HideThinkingProc}, - {"Test Legality", TestLegalityProc}, ++ {N_("Highlight Last Move"), HighlightLastMoveProc}, ++ {N_("Move Sound"), MoveSoundProc}, ++ {N_("ICS Alarm"), IcsAlarmProc}, ++ {N_("Old Save Style"), OldSaveStyleProc}, ++ {N_("Periodic Updates"), PeriodicUpdatesProc}, ++ {N_("Ponder Next Move"), PonderNextMoveProc}, ++ {N_("Popup Exit Message"), PopupExitMessageProc}, ++ {N_("Popup Move Errors"), PopupMoveErrorsProc}, ++ {N_("Premove"), PremoveProc}, ++ {N_("Quiet Play"), QuietPlayProc}, ++ {N_("Show Coords"), ShowCoordsProc}, ++ {N_("Hide Thinking"), HideThinkingProc}, ++ {N_("Test Legality"), TestLegalityProc}, + {NULL, NULL} + }; + + MenuItem helpMenu[] = { - {"Info XBoard", InfoProc}, - {"Man XBoard", ManProc}, ++ {N_("Info XBoard"), InfoProc}, ++ {N_("Man XBoard"), ManProc}, + {"----", NothingProc}, - {"Hint", HintProc}, - {"Book", BookProc}, ++ {N_("Hint"), HintProc}, ++ {N_("Book"), BookProc}, + {"----", NothingProc}, - {"About XBoard", AboutProc}, ++ {N_("About XBoard"), AboutProc}, + {NULL, NULL} + }; + + Menu menuBar[] = { - {"File", fileMenu}, - {"Mode", modeMenu}, - {"Action", actionMenu}, - {"Step", stepMenu}, - {"Options", optionsMenu}, - {"Help", helpMenu}, ++ {N_("File"), fileMenu}, ++ {N_("Mode"), modeMenu}, ++ {N_("Action"), actionMenu}, ++ {N_("Step"), stepMenu}, ++ {N_("Options"), optionsMenu}, ++ {N_("Help"), helpMenu}, + {NULL, NULL} + }; + -#define PAUSE_BUTTON "P" ++#define PAUSE_BUTTON N_("P") + MenuItem buttonBar[] = { + {"<<", ToStartProc}, + {"<", BackwardProc}, + {PAUSE_BUTTON, PauseProc}, + {">", ForwardProc}, + {">>", ToEndProc}, + {NULL, NULL} + }; + + #define PIECE_MENU_SIZE 11 + String pieceMenuStrings[2][PIECE_MENU_SIZE] = { - { "White", "----", "Pawn", "Knight", "Bishop", "Rook", "Queen", "King", - "----", "Empty square", "Clear board" }, - { "Black", "----", "Pawn", "Knight", "Bishop", "Rook", "Queen", "King", - "----", "Empty square", "Clear board" }, - }; ++ { N_("White"), "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), ++ N_("Queen"), N_("King"), "----", N_("Empty square"), N_("Clear board") }, ++ { N_("Black"), "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), ++ N_("Queen"), N_("King"), "----", N_("Empty square"), N_("Clear board") }, ++}; + /* must be in same order as PieceMenuStrings! */ + ChessSquare pieceMenuTranslation[2][PIECE_MENU_SIZE] = { + { WhitePlay, (ChessSquare) 0, WhitePawn, WhiteKnight, WhiteBishop, + WhiteRook, WhiteQueen, WhiteKing, + (ChessSquare) 0, EmptySquare, ClearBoard }, + { BlackPlay, (ChessSquare) 0, BlackPawn, BlackKnight, BlackBishop, + BlackRook, BlackQueen, BlackKing, + (ChessSquare) 0, EmptySquare, ClearBoard }, + }; + + #define DROP_MENU_SIZE 6 + String dropMenuStrings[DROP_MENU_SIZE] = { - "----", "Pawn", "Knight", "Bishop", "Rook", "Queen" ++ "----", N_("Pawn"), N_("Knight"), N_("Bishop"), N_("Rook"), N_("Queen") + }; + /* must be in same order as PieceMenuStrings! */ + ChessSquare dropMenuTranslation[DROP_MENU_SIZE] = { + (ChessSquare) 0, WhitePawn, WhiteKnight, WhiteBishop, + WhiteRook, WhiteQueen + }; + + typedef struct { + char piece; + char* widget; + } DropMenuEnables; + + DropMenuEnables dmEnables[] = { + { 'P', "Pawn" }, + { 'N', "Knight" }, + { 'B', "Bishop" }, + { 'R', "Rook" }, + { 'Q', "Queen" } + }; + + Arg shellArgs[] = { + { XtNwidth, 0 }, + { XtNheight, 0 }, + { XtNminWidth, 0 }, + { XtNminHeight, 0 }, + { XtNmaxWidth, 0 }, + { XtNmaxHeight, 0 } + }; + + Arg layoutArgs[] = { + { XtNborderWidth, 0 }, + { XtNdefaultDistance, 0 }, + }; + + Arg formArgs[] = { + { XtNborderWidth, 0 }, + { XtNresizable, (XtArgVal) True }, + }; + + Arg boardArgs[] = { + { XtNborderWidth, 0 }, + { XtNwidth, 0 }, + { XtNheight, 0 } + }; + + Arg titleArgs[] = { + { XtNjustify, (XtArgVal) XtJustifyRight }, + { XtNlabel, (XtArgVal) "..." }, + { XtNresizable, (XtArgVal) True }, + { XtNresize, (XtArgVal) False } + }; + + Arg messageArgs[] = { + { XtNjustify, (XtArgVal) XtJustifyLeft }, + { XtNlabel, (XtArgVal) "..." }, + { XtNresizable, (XtArgVal) True }, + { XtNresize, (XtArgVal) False } + }; + + Arg timerArgs[] = { + { XtNborderWidth, 0 }, + { XtNjustify, (XtArgVal) XtJustifyLeft } + }; + + XtResource clientResources[] = { + { "whitePieceColor", "whitePieceColor", XtRString, sizeof(String), + XtOffset(AppDataPtr, whitePieceColor), XtRString, + WHITE_PIECE_COLOR }, + { "blackPieceColor", "blackPieceColor", XtRString, sizeof(String), + XtOffset(AppDataPtr, blackPieceColor), XtRString, + BLACK_PIECE_COLOR }, + { "lightSquareColor", "lightSquareColor", XtRString, + sizeof(String), XtOffset(AppDataPtr, lightSquareColor), + XtRString, LIGHT_SQUARE_COLOR }, + { "darkSquareColor", "darkSquareColor", XtRString, sizeof(String), + XtOffset(AppDataPtr, darkSquareColor), XtRString, + DARK_SQUARE_COLOR }, + { "highlightSquareColor", "highlightSquareColor", XtRString, + sizeof(String), XtOffset(AppDataPtr, highlightSquareColor), + XtRString, HIGHLIGHT_SQUARE_COLOR }, + { "premoveHighlightColor", "premoveHighlightColor", XtRString, + sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor), + XtRString, PREMOVE_HIGHLIGHT_COLOR }, + { "movesPerSession", "movesPerSession", XtRInt, sizeof(int), + XtOffset(AppDataPtr, movesPerSession), XtRImmediate, + (XtPointer) MOVES_PER_SESSION }, + { "timeIncrement", "timeIncrement", XtRInt, sizeof(int), + XtOffset(AppDataPtr, timeIncrement), XtRImmediate, + (XtPointer) TIME_INCREMENT }, + { "initString", "initString", XtRString, sizeof(String), + XtOffset(AppDataPtr, initString), XtRString, INIT_STRING }, + { "secondInitString", "secondInitString", XtRString, sizeof(String), + XtOffset(AppDataPtr, secondInitString), XtRString, INIT_STRING }, + { "firstComputerString", "firstComputerString", XtRString, + sizeof(String), XtOffset(AppDataPtr, firstComputerString), XtRString, + COMPUTER_STRING }, + { "secondComputerString", "secondComputerString", XtRString, + sizeof(String), XtOffset(AppDataPtr, secondComputerString), XtRString, + COMPUTER_STRING }, + { "firstChessProgram", "firstChessProgram", XtRString, + sizeof(String), XtOffset(AppDataPtr, firstChessProgram), + XtRString, FIRST_CHESS_PROGRAM }, + { "secondChessProgram", "secondChessProgram", XtRString, + sizeof(String), XtOffset(AppDataPtr, secondChessProgram), + XtRString, SECOND_CHESS_PROGRAM }, + { "firstPlaysBlack", "firstPlaysBlack", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstPlaysBlack), + XtRImmediate, (XtPointer) False }, + { "noChessProgram", "noChessProgram", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, noChessProgram), + XtRImmediate, (XtPointer) False }, + { "firstHost", "firstHost", XtRString, sizeof(String), + XtOffset(AppDataPtr, firstHost), XtRString, FIRST_HOST }, + { "secondHost", "secondHost", XtRString, sizeof(String), + XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST }, + { "firstDirectory", "firstDirectory", XtRString, sizeof(String), + XtOffset(AppDataPtr, firstDirectory), XtRString, "." }, + { "secondDirectory", "secondDirectory", XtRString, sizeof(String), + XtOffset(AppDataPtr, secondDirectory), XtRString, "." }, + { "bitmapDirectory", "bitmapDirectory", XtRString, + sizeof(String), XtOffset(AppDataPtr, bitmapDirectory), + XtRString, "" }, + { "remoteShell", "remoteShell", XtRString, sizeof(String), + XtOffset(AppDataPtr, remoteShell), XtRString, REMOTE_SHELL }, + { "remoteUser", "remoteUser", XtRString, sizeof(String), + XtOffset(AppDataPtr, remoteUser), XtRString, "" }, + { "timeDelay", "timeDelay", XtRFloat, sizeof(float), + XtOffset(AppDataPtr, timeDelay), XtRString, + (XtPointer) TIME_DELAY_QUOTE }, + { "timeControl", "timeControl", XtRString, sizeof(String), + XtOffset(AppDataPtr, timeControl), XtRString, + (XtPointer) TIME_CONTROL }, + { "internetChessServerMode", "internetChessServerMode", + XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, icsActive), XtRImmediate, + (XtPointer) False }, + { "internetChessServerHost", "internetChessServerHost", + XtRString, sizeof(String), + XtOffset(AppDataPtr, icsHost), + XtRString, (XtPointer) ICS_HOST }, + { "internetChessServerPort", "internetChessServerPort", + XtRString, sizeof(String), + XtOffset(AppDataPtr, icsPort), XtRString, + (XtPointer) ICS_PORT }, + { "internetChessServerCommPort", "internetChessServerCommPort", + XtRString, sizeof(String), + XtOffset(AppDataPtr, icsCommPort), XtRString, + ICS_COMM_PORT }, + { "internetChessServerLogonScript", "internetChessServerLogonScript", + XtRString, sizeof(String), + XtOffset(AppDataPtr, icsLogon), XtRString, + ICS_LOGON }, + { "internetChessServerHelper", "internetChessServerHelper", + XtRString, sizeof(String), + XtOffset(AppDataPtr, icsHelper), XtRString, "" }, + { "internetChessServerInputBox", "internetChessServerInputBox", + XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, icsInputBox), XtRImmediate, + (XtPointer) False }, + { "icsAlarm", "icsAlarm", + XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, icsAlarm), XtRImmediate, + (XtPointer) True }, + { "icsAlarmTime", "icsAlarmTime", + XtRInt, sizeof(int), + XtOffset(AppDataPtr, icsAlarmTime), XtRImmediate, + (XtPointer) 5000 }, + { "useTelnet", "useTelnet", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, useTelnet), XtRImmediate, + (XtPointer) False }, + { "telnetProgram", "telnetProgram", XtRString, sizeof(String), + XtOffset(AppDataPtr, telnetProgram), XtRString, TELNET_PROGRAM }, + { "gateway", "gateway", XtRString, sizeof(String), + XtOffset(AppDataPtr, gateway), XtRString, "" }, + { "loadGameFile", "loadGameFile", XtRString, sizeof(String), + XtOffset(AppDataPtr, loadGameFile), XtRString, "" }, + { "loadGameIndex", "loadGameIndex", + XtRInt, sizeof(int), + XtOffset(AppDataPtr, loadGameIndex), XtRImmediate, + (XtPointer) 0 }, + { "saveGameFile", "saveGameFile", XtRString, sizeof(String), + XtOffset(AppDataPtr, saveGameFile), XtRString, "" }, + { "autoRaiseBoard", "autoRaiseBoard", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoRaiseBoard), + XtRImmediate, (XtPointer) True }, + { "autoSaveGames", "autoSaveGames", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoSaveGames), + XtRImmediate, (XtPointer) False }, + { "blindfold", "blindfold", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, blindfold), + XtRImmediate, (XtPointer) False }, + { "loadPositionFile", "loadPositionFile", XtRString, + sizeof(String), XtOffset(AppDataPtr, loadPositionFile), + XtRString, "" }, + { "loadPositionIndex", "loadPositionIndex", + XtRInt, sizeof(int), + XtOffset(AppDataPtr, loadPositionIndex), XtRImmediate, + (XtPointer) 1 }, + { "savePositionFile", "savePositionFile", XtRString, + sizeof(String), XtOffset(AppDataPtr, savePositionFile), + XtRString, "" }, + { "matchMode", "matchMode", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, matchMode), XtRImmediate, (XtPointer) False }, + { "matchGames", "matchGames", XtRInt, sizeof(int), + XtOffset(AppDataPtr, matchGames), XtRImmediate, + (XtPointer) 0 }, + { "monoMode", "monoMode", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, monoMode), XtRImmediate, + (XtPointer) False }, + { "debugMode", "debugMode", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, debugMode), XtRImmediate, + (XtPointer) False }, + { "clockMode", "clockMode", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, clockMode), XtRImmediate, + (XtPointer) True }, + { "boardSize", "boardSize", XtRString, sizeof(String), + XtOffset(AppDataPtr, boardSize), XtRString, "" }, + { "searchTime", "searchTime", XtRString, sizeof(String), + XtOffset(AppDataPtr, searchTime), XtRString, + (XtPointer) "" }, + { "searchDepth", "searchDepth", XtRInt, sizeof(int), + XtOffset(AppDataPtr, searchDepth), XtRImmediate, + (XtPointer) 0 }, + { "showCoords", "showCoords", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, showCoords), XtRImmediate, + (XtPointer) False }, + { "showJail", "showJail", XtRInt, sizeof(int), + XtOffset(AppDataPtr, showJail), XtRImmediate, + (XtPointer) 0 }, + { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, showThinking), XtRImmediate, + (XtPointer) True }, + { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, ponderNextMove), XtRImmediate, + (XtPointer) True }, + { "periodicUpdates", "periodicUpdates", XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, periodicUpdates), XtRImmediate, + (XtPointer) True }, + { "clockFont", "clockFont", XtRString, sizeof(String), + XtOffset(AppDataPtr, clockFont), XtRString, CLOCK_FONT }, + { "coordFont", "coordFont", XtRString, sizeof(String), + XtOffset(AppDataPtr, coordFont), XtRString, COORD_FONT }, + { "font", "font", XtRString, sizeof(String), + XtOffset(AppDataPtr, font), XtRString, DEFAULT_FONT }, + { "ringBellAfterMoves", "ringBellAfterMoves", + XtRBoolean, sizeof(Boolean), + XtOffset(AppDataPtr, ringBellAfterMoves), + XtRImmediate, (XtPointer) False }, + { "autoCallFlag", "autoCallFlag", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoCallFlag), + XtRImmediate, (XtPointer) False }, + { "autoFlipView", "autoFlipView", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoFlipView), + XtRImmediate, (XtPointer) True }, + { "autoObserve", "autoObserve", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoObserve), + XtRImmediate, (XtPointer) False }, + { "autoComment", "autoComment", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoComment), + XtRImmediate, (XtPointer) False }, + { "getMoveList", "getMoveList", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, getMoveList), + XtRImmediate, (XtPointer) True }, + #if HIGHDRAG + { "highlightDragging", "highlightDragging", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, highlightDragging), + XtRImmediate, (XtPointer) False }, + #endif + { "highlightLastMove", "highlightLastMove", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, highlightLastMove), + XtRImmediate, (XtPointer) False }, + { "premove", "premove", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, premove), + XtRImmediate, (XtPointer) True }, + { "testLegality", "testLegality", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, testLegality), + XtRImmediate, (XtPointer) True }, + { "flipView", "flipView", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, flipView), + XtRImmediate, (XtPointer) False }, + { "cmail", "cmailGameName", XtRString, sizeof(String), + XtOffset(AppDataPtr, cmailGameName), XtRString, "" }, + { "alwaysPromoteToQueen", "alwaysPromoteToQueen", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, alwaysPromoteToQueen), + XtRImmediate, (XtPointer) False }, + { "oldSaveStyle", "oldSaveStyle", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, oldSaveStyle), + XtRImmediate, (XtPointer) False }, + { "quietPlay", "quietPlay", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, quietPlay), + XtRImmediate, (XtPointer) False }, + { "titleInWindow", "titleInWindow", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, titleInWindow), + XtRImmediate, (XtPointer) False }, + { "localLineEditing", "localLineEditing", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing), + XtRImmediate, (XtPointer) True }, /* not implemented, must be True */ + #ifdef ZIPPY + { "zippyTalk", "zippyTalk", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk), + XtRImmediate, (XtPointer) ZIPPY_TALK }, + { "zippyPlay", "zippyPlay", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyPlay), + XtRImmediate, (XtPointer) ZIPPY_PLAY }, + { "zippyLines", "zippyLines", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyLines), XtRString, ZIPPY_LINES }, + { "zippyPinhead", "zippyPinhead", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyPinhead), XtRString, ZIPPY_PINHEAD }, + { "zippyPassword", "zippyPassword", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyPassword), XtRString, ZIPPY_PASSWORD }, + { "zippyPassword2", "zippyPassword2", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyPassword2), XtRString, ZIPPY_PASSWORD2 }, + { "zippyWrongPassword", "zippyWrongPassword", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyWrongPassword), XtRString, + ZIPPY_WRONG_PASSWORD }, + { "zippyAcceptOnly", "zippyAcceptOnly", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyAcceptOnly), XtRString, ZIPPY_ACCEPT_ONLY }, + { "zippyUseI", "zippyUseI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyUseI), + XtRImmediate, (XtPointer) ZIPPY_USE_I }, + { "zippyBughouse", "zippyBughouse", XtRInt, + sizeof(int), XtOffset(AppDataPtr, zippyBughouse), + XtRImmediate, (XtPointer) ZIPPY_BUGHOUSE }, + { "zippyNoplayCrafty", "zippyNoplayCrafty", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyNoplayCrafty), + XtRImmediate, (XtPointer) ZIPPY_NOPLAY_CRAFTY }, + { "zippyGameEnd", "zippyGameEnd", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyGameEnd), XtRString, ZIPPY_GAME_END }, + { "zippyGameStart", "zippyGameStart", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyGameStart), XtRString, ZIPPY_GAME_START }, + { "zippyAdjourn", "zippyAdjourn", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyAdjourn), + XtRImmediate, (XtPointer) ZIPPY_ADJOURN }, + { "zippyAbort", "zippyAbort", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, zippyAbort), + XtRImmediate, (XtPointer) ZIPPY_ABORT }, + { "zippyVariants", "zippyVariants", XtRString, sizeof(String), + XtOffset(AppDataPtr, zippyVariants), XtRString, ZIPPY_VARIANTS }, + { "zippyMaxGames", "zippyMaxGames", XtRInt, sizeof(int), + XtOffset(AppDataPtr, zippyMaxGames), XtRImmediate, + (XtPointer) ZIPPY_MAX_GAMES }, + { "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int), + XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate, + (XtPointer) ZIPPY_REPLAY_TIMEOUT }, + #endif + { "flashCount", "flashCount", XtRInt, sizeof(int), + XtOffset(AppDataPtr, flashCount), XtRImmediate, + (XtPointer) FLASH_COUNT }, + { "flashRate", "flashRate", XtRInt, sizeof(int), + XtOffset(AppDataPtr, flashRate), XtRImmediate, + (XtPointer) FLASH_RATE }, + { "pixmapDirectory", "pixmapDirectory", XtRString, + sizeof(String), XtOffset(AppDataPtr, pixmapDirectory), + XtRString, "" }, + { "msLoginDelay", "msLoginDelay", XtRInt, sizeof(int), + XtOffset(AppDataPtr, msLoginDelay), XtRImmediate, + (XtPointer) MS_LOGIN_DELAY }, + { "colorizeMessages", "colorizeMessages", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, colorize), + XtRImmediate, (XtPointer) False }, + { "colorShout", "colorShout", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorShout), + XtRString, COLOR_SHOUT }, + { "colorSShout", "colorSShout", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorSShout), + XtRString, COLOR_SSHOUT }, + { "colorChannel1", "colorChannel1", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorChannel1), + XtRString, COLOR_CHANNEL1 }, + { "colorChannel", "colorChannel", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorChannel), + XtRString, COLOR_CHANNEL }, + { "colorKibitz", "colorKibitz", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorKibitz), + XtRString, COLOR_KIBITZ }, + { "colorTell", "colorTell", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorTell), + XtRString, COLOR_TELL }, + { "colorChallenge", "colorChallenge", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorChallenge), + XtRString, COLOR_CHALLENGE }, + { "colorRequest", "colorRequest", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorRequest), + XtRString, COLOR_REQUEST }, + { "colorSeek", "colorSeek", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorSeek), + XtRString, COLOR_SEEK }, + { "colorNormal", "colorNormal", XtRString, + sizeof(String), XtOffset(AppDataPtr, colorNormal), + XtRString, COLOR_NORMAL }, + { "soundProgram", "soundProgram", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundProgram), + XtRString, "play" }, + { "soundShout", "soundShout", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundShout), + XtRString, "" }, + { "soundSShout", "soundSShout", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundSShout), + XtRString, "" }, + { "soundChannel1", "soundChannel1", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundChannel1), + XtRString, "" }, + { "soundChannel", "soundChannel", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundChannel), + XtRString, "" }, + { "soundKibitz", "soundKibitz", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundKibitz), + XtRString, "" }, + { "soundTell", "soundTell", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundTell), + XtRString, "" }, + { "soundChallenge", "soundChallenge", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundChallenge), + XtRString, "" }, + { "soundRequest", "soundRequest", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundRequest), + XtRString, "" }, + { "soundSeek", "soundSeek", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundSeek), + XtRString, "" }, + { "soundMove", "soundMove", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundMove), + XtRString, "$" }, + { "soundIcsWin", "soundIcsWin", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundIcsWin), + XtRString, "" }, + { "soundIcsLoss", "soundIcsLoss", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundIcsLoss), + XtRString, "" }, + { "soundIcsDraw", "soundIcsDraw", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundIcsDraw), + XtRString, "" }, + { "soundIcsUnfinished", "soundIcsUnfinished", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundIcsUnfinished), + XtRString, "" }, + { "soundIcsAlarm", "soundIcsAlarm", XtRString, + sizeof(String), XtOffset(AppDataPtr, soundIcsAlarm), + XtRString, "$" }, + { "reuseFirst", "reuseFirst", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, reuseFirst), + XtRImmediate, (XtPointer) True }, + { "reuseSecond", "reuseSecond", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, reuseSecond), + XtRImmediate, (XtPointer) True }, + { "animateDragging", "animateDragging", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, animateDragging), + XtRImmediate, (XtPointer) True }, + { "animateMoving", "animateMoving", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, animate), + XtRImmediate, (XtPointer) True }, + { "animateSpeed", "animateSpeed", XtRInt, + sizeof(int), XtOffset(AppDataPtr, animSpeed), + XtRImmediate, (XtPointer)10 }, + { "popupExitMessage", "popupExitMessage", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, popupExitMessage), + XtRImmediate, (XtPointer) True }, + { "popupMoveErrors", "popupMoveErrors", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, popupMoveErrors), + XtRImmediate, (XtPointer) False }, + { "fontSizeTolerance", "fontSizeTolerance", XtRInt, + sizeof(int), XtOffset(AppDataPtr, fontSizeTolerance), + XtRImmediate, (XtPointer)4 }, + { "initialMode", "initialMode", XtRString, + sizeof(String), XtOffset(AppDataPtr, initialMode), + XtRImmediate, (XtPointer) "" }, + { "variant", "variant", XtRString, + sizeof(String), XtOffset(AppDataPtr, variant), + XtRImmediate, (XtPointer) "normal" }, + { "firstProtocolVersion", "firstProtocolVersion", XtRInt, + sizeof(int), XtOffset(AppDataPtr, firstProtocolVersion), + XtRImmediate, (XtPointer)PROTOVER }, + { "secondProtocolVersion", "secondProtocolVersion", XtRInt, + sizeof(int), XtOffset(AppDataPtr, secondProtocolVersion), + XtRImmediate, (XtPointer)PROTOVER }, + { "showButtonBar", "showButtonBar", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar), + XtRImmediate, (XtPointer) True }, ++ {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean, /* [DM] icsEngineAnalyze */ ++ sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze), ++ XtRImmediate, (XtPointer) False }, + { "firstScoreAbs", "firstScoreAbs", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstScoreIsAbsolute), + XtRImmediate, (XtPointer) False }, + { "secondScoreAbs", "secondScoreAbs", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, secondScoreIsAbsolute), + XtRImmediate, (XtPointer) False }, + { "pgnExtendedInfo", "pgnExtendedInfo", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, saveExtendedInfoInPGN), + XtRImmediate, (XtPointer) False }, + { "hideThinkingFromHuman", "hideThinkingFromHuman", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, hideThinkingFromHuman), + XtRImmediate, (XtPointer) True }, + { "adjudicateLossThreshold", "adjudicateLossThreshold", XtRInt, + sizeof(int), XtOffset(AppDataPtr, adjudicateLossThreshold), + XtRImmediate, (XtPointer) 0}, + { "pgnEventHeader", "pgnEventHeader", XtRString, + sizeof(String), XtOffset(AppDataPtr, pgnEventHeader), + XtRImmediate, (XtPointer) "Computer Chess Game" }, + { "defaultFrcPosition", "defaultFrcPositon", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultFrcPosition), + XtRImmediate, (XtPointer) -1}, + + // [HGM] 4.3.xx options + { "boardWidth", "boardWidth", XtRInt, + sizeof(int), XtOffset(AppDataPtr, NrFiles), + XtRImmediate, (XtPointer) -1}, + { "boardHeight", "boardHeight", XtRInt, + sizeof(int), XtOffset(AppDataPtr, NrRanks), + XtRImmediate, (XtPointer) -1}, + { "matchPause", "matchPause", XtRInt, + sizeof(int), XtOffset(AppDataPtr, matchPause), + XtRImmediate, (XtPointer) 10000}, + { "holdingsSize", "holdingsSize", XtRInt, + sizeof(int), XtOffset(AppDataPtr, holdingsSize), + XtRImmediate, (XtPointer) -1}, + { "flipBlack", "flipBlack", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, upsideDown), + XtRImmediate, (XtPointer) False}, + { "allWhite", "allWhite", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, allWhite), + XtRImmediate, (XtPointer) False}, + { "pieceToCharTable", "pieceToCharTable", XtRString, + sizeof(String), XtOffset(AppDataPtr, pieceToCharTable), + XtRImmediate, (XtPointer) 0}, + { "alphaRank", "alphaRank", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, alphaRank), + XtRImmediate, (XtPointer) False}, + { "testClaims", "testClaims", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, testClaims), + XtRImmediate, (XtPointer) True}, + { "checkMates", "checkMates", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, checkMates), + XtRImmediate, (XtPointer) True}, + { "materialDraws", "materialDraws", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, materialDraws), + XtRImmediate, (XtPointer) True}, + { "trivialDraws", "trivialDraws", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, trivialDraws), + XtRImmediate, (XtPointer) False}, + { "ruleMoves", "ruleMoves", XtRInt, + sizeof(int), XtOffset(AppDataPtr, ruleMoves), + XtRImmediate, (XtPointer) 51}, + { "repeatsToDraw", "repeatsToDraw", XtRInt, + sizeof(int), XtOffset(AppDataPtr, drawRepeats), + XtRImmediate, (XtPointer) 6}, + { "engineDebugOutput", "engineDebugOutput", XtRInt, + sizeof(int), XtOffset(AppDataPtr, engineComments), + XtRImmediate, (XtPointer) 1}, + { "userName", "userName", XtRString, + sizeof(int), XtOffset(AppDataPtr, userName), + XtRImmediate, (XtPointer) 0}, + { "autoKibitz", "autoKibitz", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, autoKibitz), + XtRImmediate, (XtPointer) False}, + { "firstTimeOdds", "firstTimeOdds", XtRInt, + sizeof(int), XtOffset(AppDataPtr, firstTimeOdds), + XtRImmediate, (XtPointer) 1}, + { "secondTimeOdds", "secondTimeOdds", XtRInt, + sizeof(int), XtOffset(AppDataPtr, secondTimeOdds), + XtRImmediate, (XtPointer) 1}, + { "timeOddsMode", "timeOddsMode", XtRInt, + sizeof(int), XtOffset(AppDataPtr, timeOddsMode), + XtRImmediate, (XtPointer) 0}, + { "firstAccumulateTC", "firstAccumulateTC", XtRInt, + sizeof(int), XtOffset(AppDataPtr, firstAccumulateTC), + XtRImmediate, (XtPointer) 1}, + { "secondAccumulateTC", "secondAccumulateTC", XtRInt, + sizeof(int), XtOffset(AppDataPtr, secondAccumulateTC), + XtRImmediate, (XtPointer) 1}, + { "firstNPS", "firstNPS", XtRInt, + sizeof(int), XtOffset(AppDataPtr, firstNPS), + XtRImmediate, (XtPointer) -1}, + { "secondNPS", "secondNPS", XtRInt, + sizeof(int), XtOffset(AppDataPtr, secondNPS), + XtRImmediate, (XtPointer) -1}, + { "serverMoves", "serverMoves", XtRString, + sizeof(String), XtOffset(AppDataPtr, serverMovesName), + XtRImmediate, (XtPointer) 0}, + { "serverPause", "serverPause", XtRInt, + sizeof(int), XtOffset(AppDataPtr, serverPause), + XtRImmediate, (XtPointer) 0}, + { "suppressLoadMoves", "suppressLoadMoves", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, suppressLoadMoves), - XtRImmediate, (XtPointer) False}, ++ XtRImmediate, (XtPointer) False}, + { "userName", "userName", XtRString, + sizeof(String), XtOffset(AppDataPtr, userName), + XtRImmediate, (XtPointer) 0}, + { "egtFormats", "egtFormats", XtRString, + sizeof(String), XtOffset(AppDataPtr, egtFormats), + XtRImmediate, (XtPointer) 0}, + { "rewindIndex", "rewindIndex", XtRInt, + sizeof(int), XtOffset(AppDataPtr, rewindIndex), + XtRImmediate, (XtPointer) 0}, + { "sameColorGames", "sameColorGames", XtRInt, + sizeof(int), XtOffset(AppDataPtr, sameColorGames), + XtRImmediate, (XtPointer) 0}, + { "smpCores", "smpCores", XtRInt, + sizeof(int), XtOffset(AppDataPtr, smpCores), + XtRImmediate, (XtPointer) 1}, + { "niceEngines", "niceEngines", XtRInt, + sizeof(int), XtOffset(AppDataPtr, niceEngines), + XtRImmediate, (XtPointer) 0}, - ++ + // [HGM] Winboard_x UCI options + { "firstIsUCI", "firstIsUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstIsUCI), + XtRImmediate, (XtPointer) False}, + { "secondIsUCI", "secondIsUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, secondIsUCI), + XtRImmediate, (XtPointer) False}, + { "firstHasOwnBookUCI", "firstHasOwnBookUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, firstHasOwnBookUCI), + XtRImmediate, (XtPointer) True}, + { "secondHasOwnBookUCI", "secondHasOwnBookUCI", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, secondHasOwnBookUCI), + XtRImmediate, (XtPointer) True}, + { "usePolyglotBook", "usePolyglotBook", XtRBoolean, + sizeof(Boolean), XtOffset(AppDataPtr, usePolyglotBook), + XtRImmediate, (XtPointer) False}, + { "defaultHashSize", "defaultHashSize", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultHashSize), + XtRImmediate, (XtPointer) 64}, + { "defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XtRInt, + sizeof(int), XtOffset(AppDataPtr, defaultCacheSizeEGTB), + XtRImmediate, (XtPointer) 4}, + { "polyglotDir", "polyglotDir", XtRString, + sizeof(String), XtOffset(AppDataPtr, polyglotDir), + XtRImmediate, (XtPointer) "." }, + { "polyglotBook", "polyglotBook", XtRString, + sizeof(String), XtOffset(AppDataPtr, polyglotBook), + XtRImmediate, (XtPointer) "" }, + { "defaultPathEGTB", "defaultPathEGTB", XtRString, + sizeof(String), XtOffset(AppDataPtr, defaultPathEGTB), + XtRImmediate, (XtPointer) "/usr/local/share/egtb"}, + { "delayBeforeQuit", "delayBeforeQuit", XtRInt, + sizeof(int), XtOffset(AppDataPtr, delayBeforeQuit), + XtRImmediate, (XtPointer) 0}, + { "delayAfterQuit", "delayAfterQuit", XtRInt, + sizeof(int), XtOffset(AppDataPtr, delayAfterQuit), + XtRImmediate, (XtPointer) 0}, ++ { "nameOfDebugFile", "nameOfDebugFile", XtRString, ++ sizeof(String), XtOffset(AppDataPtr, nameOfDebugFile), ++ XtRImmediate, (XtPointer) "xboard.debug"}, ++ { "noGUI", "noGUI", XtRBoolean, ++ sizeof(Boolean), XtOffset(AppDataPtr, noGUI), ++ XtRImmediate, (XtPointer) 0}, + }; + + XrmOptionDescRec shellOptions[] = { + { "-whitePieceColor", "whitePieceColor", XrmoptionSepArg, NULL }, + { "-blackPieceColor", "blackPieceColor", XrmoptionSepArg, NULL }, + { "-lightSquareColor", "lightSquareColor", XrmoptionSepArg, NULL }, + { "-darkSquareColor", "darkSquareColor", XrmoptionSepArg, NULL }, + { "-highlightSquareColor", "highlightSquareColor", XrmoptionSepArg, NULL }, + { "-premoveHighlightColor", "premoveHighlightColor", XrmoptionSepArg,NULL}, + { "-movesPerSession", "movesPerSession", XrmoptionSepArg, NULL }, + { "-mps", "movesPerSession", XrmoptionSepArg, NULL }, + { "-timeIncrement", "timeIncrement", XrmoptionSepArg, NULL }, + { "-inc", "timeIncrement", XrmoptionSepArg, NULL }, + { "-initString", "initString", XrmoptionSepArg, NULL }, + { "-firstInitString", "initString", XrmoptionSepArg, NULL }, + { "-secondInitString", "secondInitString", XrmoptionSepArg, NULL }, + { "-firstComputerString", "firstComputerString", XrmoptionSepArg, NULL }, + { "-secondComputerString", "secondComputerString", XrmoptionSepArg, NULL }, + { "-firstChessProgram", "firstChessProgram", XrmoptionSepArg, NULL }, + { "-fcp", "firstChessProgram", XrmoptionSepArg, NULL }, + { "-secondChessProgram", "secondChessProgram", XrmoptionSepArg, NULL }, + { "-scp", "secondChessProgram", XrmoptionSepArg, NULL }, + { "-firstPlaysBlack", "firstPlaysBlack", XrmoptionSepArg, NULL }, + { "-fb", "firstPlaysBlack", XrmoptionNoArg, "True" }, + { "-xfb", "firstPlaysBlack", XrmoptionNoArg, "False" }, + { "-noChessProgram", "noChessProgram", XrmoptionSepArg, NULL }, + { "-ncp", "noChessProgram", XrmoptionNoArg, "True" }, + { "-xncp", "noChessProgram", XrmoptionNoArg, "False" }, + { "-firstHost", "firstHost", XrmoptionSepArg, NULL }, + { "-fh", "firstHost", XrmoptionSepArg, NULL }, + { "-secondHost", "secondHost", XrmoptionSepArg, NULL }, + { "-sh", "secondHost", XrmoptionSepArg, NULL }, + { "-firstDirectory", "firstDirectory", XrmoptionSepArg, NULL }, + { "-fd", "firstDirectory", XrmoptionSepArg, NULL }, + { "-secondDirectory", "secondDirectory", XrmoptionSepArg, NULL }, + { "-sd", "secondDirectory", XrmoptionSepArg, NULL }, + { "-bitmapDirectory", "bitmapDirectory", XrmoptionSepArg, NULL }, + { "-bm", "bitmapDirectory", XrmoptionSepArg, NULL }, + { "-remoteShell", "remoteShell", XrmoptionSepArg, NULL }, + { "-rsh", "remoteShell", XrmoptionSepArg, NULL }, + { "-remoteUser", "remoteUser", XrmoptionSepArg, NULL }, + { "-ruser", "remoteUser", XrmoptionSepArg, NULL }, + { "-timeDelay", "timeDelay", XrmoptionSepArg, NULL }, + { "-td", "timeDelay", XrmoptionSepArg, NULL }, + { "-timeControl", "timeControl", XrmoptionSepArg, NULL }, + { "-tc", "timeControl", XrmoptionSepArg, NULL }, + { "-internetChessServerMode", "internetChessServerMode", + XrmoptionSepArg, NULL }, + { "-ics", "internetChessServerMode", XrmoptionNoArg, "True" }, + { "-xics", "internetChessServerMode", XrmoptionNoArg, "False" }, + { "-internetChessServerHost", "internetChessServerHost", + XrmoptionSepArg, NULL }, + { "-icshost", "internetChessServerHost", XrmoptionSepArg, NULL }, + { "-internetChessServerPort", "internetChessServerPort", + XrmoptionSepArg, NULL }, + { "-icsport", "internetChessServerPort", XrmoptionSepArg, NULL }, + { "-internetChessServerCommPort", "internetChessServerCommPort", + XrmoptionSepArg, NULL }, + { "-icscomm", "internetChessServerCommPort", XrmoptionSepArg, NULL }, + { "-internetChessServerLogonScript", "internetChessServerLogonScript", + XrmoptionSepArg, NULL }, + { "-icslogon", "internetChessServerLogonScript", XrmoptionSepArg, NULL }, + { "-internetChessServerHelper", "internetChessServerHelper", + XrmoptionSepArg, NULL }, + { "-icshelper", "internetChessServerHelper", XrmoptionSepArg, NULL }, + { "-internetChessServerInputBox", "internetChessServerInputBox", + XrmoptionSepArg, NULL }, + { "-icsinput", "internetChessServerInputBox", XrmoptionNoArg, "True" }, + { "-xicsinput", "internetChessServerInputBox", XrmoptionNoArg, "False" }, + { "-icsAlarm", "icsAlarm", XrmoptionSepArg, NULL }, + { "-alarm", "icsAlarm", XrmoptionNoArg, "True" }, + { "-xalarm", "icsAlarm", XrmoptionNoArg, "False" }, + { "-icsAlarmTime", "icsAlarmTime", XrmoptionSepArg, NULL }, + { "-useTelnet", "useTelnet", XrmoptionSepArg, NULL }, + { "-telnet", "useTelnet", XrmoptionNoArg, "True" }, + { "-xtelnet", "useTelnet", XrmoptionNoArg, "False" }, + { "-telnetProgram", "telnetProgram", XrmoptionSepArg, NULL }, + { "-gateway", "gateway", XrmoptionSepArg, NULL }, + { "-loadGameFile", "loadGameFile", XrmoptionSepArg, NULL }, + { "-lgf", "loadGameFile", XrmoptionSepArg, NULL }, + { "-loadGameIndex", "loadGameIndex", XrmoptionSepArg, NULL }, + { "-lgi", "loadGameIndex", XrmoptionSepArg, NULL }, + { "-saveGameFile", "saveGameFile", XrmoptionSepArg, NULL }, + { "-sgf", "saveGameFile", XrmoptionSepArg, NULL }, + { "-autoSaveGames", "autoSaveGames", XrmoptionSepArg, NULL }, + { "-autosave", "autoSaveGames", XrmoptionNoArg, "True" }, + { "-xautosave", "autoSaveGames", XrmoptionNoArg, "False" }, + { "-autoRaiseBoard", "autoRaiseBoard", XrmoptionSepArg, NULL }, + { "-autoraise", "autoRaiseBoard", XrmoptionNoArg, "True" }, + { "-xautoraise", "autoRaiseBoard", XrmoptionNoArg, "False" }, + { "-blindfold", "blindfold", XrmoptionSepArg, NULL }, + { "-blind", "blindfold", XrmoptionNoArg, "True" }, + { "-xblind", "blindfold", XrmoptionNoArg, "False" }, + { "-loadPositionFile", "loadPositionFile", XrmoptionSepArg, NULL }, + { "-lpf", "loadPositionFile", XrmoptionSepArg, NULL }, + { "-loadPositionIndex", "loadPositionIndex", XrmoptionSepArg, NULL }, + { "-lpi", "loadPositionIndex", XrmoptionSepArg, NULL }, + { "-savePositionFile", "savePositionFile", XrmoptionSepArg, NULL }, + { "-spf", "savePositionFile", XrmoptionSepArg, NULL }, + { "-matchMode", "matchMode", XrmoptionSepArg, NULL }, + { "-mm", "matchMode", XrmoptionNoArg, "True" }, + { "-xmm", "matchMode", XrmoptionNoArg, "False" }, + { "-matchGames", "matchGames", XrmoptionSepArg, NULL }, + { "-mg", "matchGames", XrmoptionSepArg, NULL }, + { "-monoMode", "monoMode", XrmoptionSepArg, NULL }, + { "-mono", "monoMode", XrmoptionNoArg, "True" }, + { "-xmono", "monoMode", XrmoptionNoArg, "False" }, + { "-debugMode", "debugMode", XrmoptionSepArg, NULL }, + { "-debug", "debugMode", XrmoptionNoArg, "True" }, + { "-xdebug", "debugMode", XrmoptionNoArg, "False" }, + { "-clockMode", "clockMode", XrmoptionSepArg, NULL }, + { "-clock", "clockMode", XrmoptionNoArg, "True" }, + { "-xclock", "clockMode", XrmoptionNoArg, "False" }, + { "-boardSize", "boardSize", XrmoptionSepArg, NULL }, + { "-size", "boardSize", XrmoptionSepArg, NULL }, + { "-searchTime", "searchTime", XrmoptionSepArg, NULL }, + { "-st", "searchTime", XrmoptionSepArg, NULL }, + { "-searchDepth", "searchDepth", XrmoptionSepArg, NULL }, + { "-depth", "searchDepth", XrmoptionSepArg, NULL }, + { "-showCoords", "showCoords", XrmoptionSepArg, NULL }, + { "-coords", "showCoords", XrmoptionNoArg, "True" }, + { "-xcoords", "showCoords", XrmoptionNoArg, "False" }, + #if JAIL + { "-showJail", "showJail", XrmoptionSepArg, NULL }, + { "-jail", "showJail", XrmoptionNoArg, "1" }, + { "-sidejail", "showJail", XrmoptionNoArg, "2" }, + { "-xjail", "showJail", XrmoptionNoArg, "0" }, + #endif + { "-showThinking", "showThinking", XrmoptionSepArg, NULL }, + { "-thinking", "showThinking", XrmoptionNoArg, "True" }, + { "-xthinking", "showThinking", XrmoptionNoArg, "False" }, + { "-ponderNextMove", "ponderNextMove", XrmoptionSepArg, NULL }, + { "-ponder", "ponderNextMove", XrmoptionNoArg, "True" }, + { "-xponder", "ponderNextMove", XrmoptionNoArg, "False" }, + { "-periodicUpdates", "periodicUpdates", XrmoptionSepArg, NULL }, + { "-periodic", "periodicUpdates", XrmoptionNoArg, "True" }, + { "-xperiodic", "periodicUpdates", XrmoptionNoArg, "False" }, + { "-clockFont", "clockFont", XrmoptionSepArg, NULL }, + { "-coordFont", "coordFont", XrmoptionSepArg, NULL }, + { "-font", "font", XrmoptionSepArg, NULL }, + { "-ringBellAfterMoves", "ringBellAfterMoves", XrmoptionSepArg, NULL }, + { "-bell", "ringBellAfterMoves", XrmoptionNoArg, "True" }, + { "-xbell", "ringBellAfterMoves", XrmoptionNoArg, "False" }, + { "-movesound", "ringBellAfterMoves", XrmoptionNoArg, "True" }, + { "-xmovesound", "ringBellAfterMoves", XrmoptionNoArg, "False" }, + { "-autoCallFlag", "autoCallFlag", XrmoptionSepArg, NULL }, + { "-autoflag", "autoCallFlag", XrmoptionNoArg, "True" }, + { "-xautoflag", "autoCallFlag", XrmoptionNoArg, "False" }, + { "-autoFlipView", "autoFlipView", XrmoptionSepArg, NULL }, + { "-autoflip", "autoFlipView", XrmoptionNoArg, "True" }, + { "-xautoflip", "autoFlipView", XrmoptionNoArg, "False" }, + { "-autoObserve", "autoObserve", XrmoptionSepArg, NULL }, + { "-autobs", "autoObserve", XrmoptionNoArg, "True" }, + { "-xautobs", "autoObserve", XrmoptionNoArg, "False" }, + { "-autoComment", "autoComment", XrmoptionSepArg, NULL }, + { "-autocomm", "autoComment", XrmoptionNoArg, "True" }, + { "-xautocomm", "autoComment", XrmoptionNoArg, "False" }, + { "-getMoveList", "getMoveList", XrmoptionSepArg, NULL }, + { "-moves", "getMoveList", XrmoptionNoArg, "True" }, + { "-xmoves", "getMoveList", XrmoptionNoArg, "False" }, + #if HIGHDRAG + { "-highlightDragging", "highlightDragging", XrmoptionSepArg, NULL }, + { "-highdrag", "highlightDragging", XrmoptionNoArg, "True" }, + { "-xhighdrag", "highlightDragging", XrmoptionNoArg, "False" }, + #endif + { "-highlightLastMove", "highlightLastMove", XrmoptionSepArg, NULL }, + { "-highlight", "highlightLastMove", XrmoptionNoArg, "True" }, + { "-xhighlight", "highlightLastMove", XrmoptionNoArg, "False" }, + { "-premove", "premove", XrmoptionSepArg, NULL }, + { "-pre", "premove", XrmoptionNoArg, "True" }, + { "-xpre", "premove", XrmoptionNoArg, "False" }, + { "-testLegality", "testLegality", XrmoptionSepArg, NULL }, + { "-legal", "testLegality", XrmoptionNoArg, "True" }, + { "-xlegal", "testLegality", XrmoptionNoArg, "False" }, + { "-flipView", "flipView", XrmoptionSepArg, NULL }, + { "-flip", "flipView", XrmoptionNoArg, "True" }, + { "-xflip", "flipView", XrmoptionNoArg, "False" }, + { "-cmail", "cmailGameName", XrmoptionSepArg, NULL }, + { "-alwaysPromoteToQueen", "alwaysPromoteToQueen", + XrmoptionSepArg, NULL }, + { "-queen", "alwaysPromoteToQueen", XrmoptionNoArg, "True" }, + { "-xqueen", "alwaysPromoteToQueen", XrmoptionNoArg, "False" }, + { "-oldSaveStyle", "oldSaveStyle", XrmoptionSepArg, NULL }, + { "-oldsave", "oldSaveStyle", XrmoptionNoArg, "True" }, + { "-xoldsave", "oldSaveStyle", XrmoptionNoArg, "False" }, + { "-quietPlay", "quietPlay", XrmoptionSepArg, NULL }, + { "-quiet", "quietPlay", XrmoptionNoArg, "True" }, + { "-xquiet", "quietPlay", XrmoptionNoArg, "False" }, + { "-titleInWindow", "titleInWindow", XrmoptionSepArg, NULL }, + { "-title", "titleInWindow", XrmoptionNoArg, "True" }, + { "-xtitle", "titleInWindow", XrmoptionNoArg, "False" }, + #ifdef ZIPPY + { "-zippyTalk", "zippyTalk", XrmoptionSepArg, NULL }, + { "-zt", "zippyTalk", XrmoptionNoArg, "True" }, + { "-xzt", "zippyTalk", XrmoptionNoArg, "False" }, + { "-zippyPlay", "zippyPlay", XrmoptionSepArg, NULL }, + { "-zp", "zippyPlay", XrmoptionNoArg, "True" }, + { "-xzp", "zippyPlay", XrmoptionNoArg, "False" }, + { "-zippyLines", "zippyLines", XrmoptionSepArg, NULL }, + { "-zippyPinhead", "zippyPinhead", XrmoptionSepArg, NULL }, + { "-zippyPassword", "zippyPassword", XrmoptionSepArg, NULL }, + { "-zippyPassword2", "zippyPassword2", XrmoptionSepArg, NULL }, + { "-zippyWrongPassword", "zippyWrongPassword", XrmoptionSepArg, NULL }, + { "-zippyAcceptOnly", "zippyAcceptOnly", XrmoptionSepArg, NULL }, + { "-zippyUseI", "zippyUseI", XrmoptionSepArg, NULL }, + { "-zui", "zippyUseI", XrmoptionNoArg, "True" }, + { "-xzui", "zippyUseI", XrmoptionNoArg, "False" }, + { "-zippyBughouse", "zippyBughouse", XrmoptionSepArg, NULL }, + { "-zippyNoplayCrafty", "zippyNoplayCrafty", XrmoptionSepArg, NULL }, + { "-znc", "zippyNoplayCrafty", XrmoptionNoArg, "True" }, + { "-xznc", "zippyNoplayCrafty", XrmoptionNoArg, "False" }, + { "-zippyGameEnd", "zippyGameEnd", XrmoptionSepArg, NULL }, + { "-zippyGameStart", "zippyGameStart", XrmoptionSepArg, NULL }, + { "-zippyAdjourn", "zippyAdjourn", XrmoptionSepArg, NULL }, + { "-zadj", "zippyAdjourn", XrmoptionNoArg, "True" }, + { "-xzadj", "zippyAdjourn", XrmoptionNoArg, "False" }, + { "-zippyAbort", "zippyAbort", XrmoptionSepArg, NULL }, + { "-zab", "zippyAbort", XrmoptionNoArg, "True" }, + { "-xzab", "zippyAbort", XrmoptionNoArg, "False" }, + { "-zippyVariants", "zippyVariants", XrmoptionSepArg, NULL }, + { "-zippyMaxGames", "zippyMaxGames", XrmoptionSepArg, NULL }, + { "-zippyReplayTimeout", "zippyReplayTimeout", XrmoptionSepArg, NULL }, + #endif + { "-flashCount", "flashCount", XrmoptionSepArg, NULL }, + { "-flash", "flashCount", XrmoptionNoArg, "3" }, + { "-xflash", "flashCount", XrmoptionNoArg, "0" }, + { "-flashRate", "flashRate", XrmoptionSepArg, NULL }, + { "-pixmapDirectory", "pixmapDirectory", XrmoptionSepArg, NULL }, + { "-msLoginDelay", "msLoginDelay", XrmoptionSepArg, NULL }, + { "-pixmap", "pixmapDirectory", XrmoptionSepArg, NULL }, + { "-colorizeMessages", "colorizeMessages", XrmoptionSepArg, NULL }, + { "-colorize", "colorizeMessages", XrmoptionNoArg, "True" }, + { "-xcolorize", "colorizeMessages", XrmoptionNoArg, "False" }, + { "-colorShout", "colorShout", XrmoptionSepArg, NULL }, + { "-colorSShout", "colorSShout", XrmoptionSepArg, NULL }, + { "-colorCShout", "colorSShout", XrmoptionSepArg, NULL }, /*FICS name*/ + { "-colorChannel1", "colorChannel1", XrmoptionSepArg, NULL }, + { "-colorChannel", "colorChannel", XrmoptionSepArg, NULL }, + { "-colorKibitz", "colorKibitz", XrmoptionSepArg, NULL }, + { "-colorTell", "colorTell", XrmoptionSepArg, NULL }, + { "-colorChallenge", "colorChallenge", XrmoptionSepArg, NULL }, + { "-colorRequest", "colorRequest", XrmoptionSepArg, NULL }, + { "-colorSeek", "colorSeek", XrmoptionSepArg, NULL }, + { "-colorNormal", "colorNormal", XrmoptionSepArg, NULL }, + { "-soundProgram", "soundProgram", XrmoptionSepArg, NULL }, + { "-soundShout", "soundShout", XrmoptionSepArg, NULL }, + { "-soundSShout", "soundSShout", XrmoptionSepArg, NULL }, + { "-soundCShout", "soundSShout", XrmoptionSepArg, NULL }, /*FICS name*/ + { "-soundChannel1", "soundChannel1", XrmoptionSepArg, NULL }, + { "-soundChannel", "soundChannel", XrmoptionSepArg, NULL }, + { "-soundKibitz", "soundKibitz", XrmoptionSepArg, NULL }, + { "-soundTell", "soundTell", XrmoptionSepArg, NULL }, + { "-soundChallenge", "soundChallenge", XrmoptionSepArg, NULL }, + { "-soundRequest", "soundRequest", XrmoptionSepArg, NULL }, + { "-soundSeek", "soundSeek", XrmoptionSepArg, NULL }, + { "-soundMove", "soundMove", XrmoptionSepArg, NULL }, + { "-soundIcsWin", "soundIcsWin", XrmoptionSepArg, NULL }, + { "-soundIcsLoss", "soundIcsLoss", XrmoptionSepArg, NULL }, + { "-soundIcsDraw", "soundIcsDraw", XrmoptionSepArg, NULL }, + { "-soundIcsUnfinished", "soundIcsUnfinished", XrmoptionSepArg, NULL }, + { "-soundIcsAlarm", "soundIcsAlarm", XrmoptionSepArg, NULL }, + { "-reuseFirst", "reuseFirst", XrmoptionSepArg, NULL }, + { "-reuseChessPrograms", "reuseFirst", XrmoptionSepArg, NULL }, /*compat*/ + { "-reuse", "reuseFirst", XrmoptionNoArg, "True" }, + { "-xreuse", "reuseFirst", XrmoptionNoArg, "False" }, + { "-reuseSecond", "reuseSecond", XrmoptionSepArg, NULL }, + { "-reuse2", "reuseSecond", XrmoptionNoArg, "True" }, + { "-xreuse2", "reuseSecond", XrmoptionNoArg, "False" }, + { "-animateMoving", "animateMoving", XrmoptionSepArg, NULL }, + { "-animate", "animateMoving", XrmoptionNoArg, "True" }, + { "-xanimate", "animateMoving", XrmoptionNoArg, "False" }, + { "-animateDragging", "animateDragging", XrmoptionSepArg, NULL }, + { "-drag", "animateDragging", XrmoptionNoArg, "True" }, + { "-xdrag", "animateDragging", XrmoptionNoArg, "False" }, + { "-animateSpeed", "animateSpeed", XrmoptionSepArg, NULL }, + { "-popupExitMessage", "popupExitMessage", XrmoptionSepArg, NULL }, + { "-exit", "popupExitMessage", XrmoptionNoArg, "True" }, + { "-xexit", "popupExitMessage", XrmoptionNoArg, "False" }, + { "-popupMoveErrors", "popupMoveErrors", XrmoptionSepArg, NULL }, + { "-popup", "popupMoveErrors", XrmoptionNoArg, "True" }, + { "-xpopup", "popupMoveErrors", XrmoptionNoArg, "False" }, + { "-fontSizeTolerance", "fontSizeTolerance", XrmoptionSepArg, NULL }, + { "-initialMode", "initialMode", XrmoptionSepArg, NULL }, + { "-mode", "initialMode", XrmoptionSepArg, NULL }, + { "-variant", "variant", XrmoptionSepArg, NULL }, + { "-firstProtocolVersion", "firstProtocolVersion", XrmoptionSepArg, NULL }, + { "-secondProtocolVersion","secondProtocolVersion",XrmoptionSepArg, NULL }, + { "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL }, + { "-buttons", "showButtonBar", XrmoptionNoArg, "True" }, + { "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" }, + /* [AS,HR] New features */ + { "-firstScoreAbs", "firstScoreAbs", XrmoptionSepArg, NULL }, + { "-secondScoreAbs", "secondScoreAbs", XrmoptionSepArg, NULL }, + { "-pgnExtendedInfo", "pgnExtendedInfo", XrmoptionSepArg, NULL }, + { "-hideThinkingFromHuman", "hideThinkingFromHuman", XrmoptionSepArg, NULL }, + { "-adjudicateLossThreshold", "adjudicateLossThreshold", XrmoptionSepArg, NULL }, + { "-pgnEventHeader", "pgnEventHeader", XrmoptionSepArg, NULL }, + { "-firstIsUCI", "firstIsUCI", XrmoptionSepArg, NULL }, + { "-secondIsUCI", "secondIsUCI", XrmoptionSepArg, NULL }, + { "-fUCI", "firstIsUCI", XrmoptionNoArg, "True" }, + { "-sUCI", "secondIsUCI", XrmoptionNoArg, "True" }, + { "-firstHasOwnBookUCI", "firstHasOwnBookUCI", XrmoptionSepArg, NULL }, + { "-secondHasOwnBookUCI", "secondHasOwnBookUCI", XrmoptionSepArg, NULL }, + { "-fNoOwnBookUCI", "firstHasOwnBookUCI", XrmoptionNoArg, "False" }, + { "-sNoOwnBookUCI", "secondHasOwnBookUCI", XrmoptionNoArg, "False" }, + { "-polyglotDir", "polyglotDir", XrmoptionSepArg, NULL }, + { "-usePolyglotBook", "usePolyglotBook", XrmoptionSepArg, NULL }, + { "-polyglotBook", "polyglotBook", XrmoptionSepArg, NULL }, + { "-defaultHashSize", "defaultHashSize", XrmoptionSepArg, NULL }, + { "-defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XrmoptionSepArg, NULL }, + { "-defaultPathEGTB", "defaultPathEGTB", XrmoptionSepArg, NULL }, + { "-defaultFrcPosition", "defaultFrcPosition", XrmoptionSepArg, NULL }, + // [HGM] I am sure AS added many more options, but we have to fish them out, from the list in winboard.c + + /* [HGM,HR] User-selectable board size */ + { "-boardWidth", "boardWidth", XrmoptionSepArg, NULL }, + { "-boardHeight", "boardHeight", XrmoptionSepArg, NULL }, + { "-matchPause", "matchPause", XrmoptionSepArg, NULL }, + + /* [HGM] new arguments of 4.3.xx. All except first three are back-end options, which should work immediately */ + { "-holdingsSize", "holdingsSize", XrmoptionSepArg, NULL }, // requires extensive front-end changes to work + { "-flipBlack", "flipBlack", XrmoptionSepArg, NULL }, // requires front-end changes to work + { "-allWhite", "allWhite", XrmoptionSepArg, NULL }, // requires front-end changes to work + { "-pieceToCharTable", "pieceToCharTable", XrmoptionSepArg, NULL }, + { "-alphaRank", "alphaRank", XrmoptionSepArg, NULL }, + { "-testClaims", "testClaims", XrmoptionSepArg, NULL }, + { "-checkMates", "checkMates", XrmoptionSepArg, NULL }, + { "-materialDraws", "materialDraws", XrmoptionSepArg, NULL }, + { "-trivialDraws", "trivialDraws", XrmoptionSepArg, NULL }, + { "-ruleMoves", "ruleMoves", XrmoptionSepArg, NULL }, + { "-repeatsToDraw", "repeatsToDraw", XrmoptionSepArg, NULL }, + { "-engineDebugOutput", "engineDebugOutput", XrmoptionSepArg, NULL }, + { "-userName", "userName", XrmoptionSepArg, NULL }, + { "-autoKibitz", "autoKibitz", XrmoptionNoArg, "True" }, + { "-firstTimeOdds", "firstTimeOdds", XrmoptionSepArg, NULL }, + { "-secondTimeOdds", "secondTimeOdds", XrmoptionSepArg, NULL }, + { "-timeOddsMode", "timeOddsMode", XrmoptionSepArg, NULL }, + { "-firstAccumulateTC", "firstAccumulateTC", XrmoptionSepArg, NULL }, + { "-secondAccumulateTC", "secondAccumulateTC", XrmoptionSepArg, NULL }, + { "-firstNPS", "firstNPS", XrmoptionSepArg, NULL }, + { "-secondNPS", "secondNPS", XrmoptionSepArg, NULL }, + { "-serverMoves", "serverMoves", XrmoptionSepArg, NULL }, + { "-serverPause", "serverPause", XrmoptionSepArg, NULL }, + { "-suppressLoadMoves", "suppressLoadMoves", XrmoptionSepArg, NULL }, + { "-egtFormats", "egtFormats", XrmoptionSepArg, NULL }, + { "-userName", "userName", XrmoptionSepArg, NULL }, + { "-smpCores", "smpCores", XrmoptionSepArg, NULL }, + { "-sameColorGames", "sameColorGames", XrmoptionSepArg, NULL }, + { "-rewindIndex", "rewindIndex", XrmoptionSepArg, NULL }, + { "-niceEngines", "niceEngines", XrmoptionSepArg, NULL }, + { "-delayBeforeQuit", "delayBeforeQuit", XrmoptionSepArg, NULL }, + { "-delayAfterQuit", "delayAfterQuit", XrmoptionSepArg, NULL }, ++ { "-nameOfDebugFile", "nameOfDebugFile", XrmoptionSepArg, NULL }, ++ { "-noGUI", "noGUI", XrmoptionNoArg, "True" }, + }; + + + XtActionsRec boardActions[] = { + { "DrawPosition", DrawPositionProc }, + { "HandleUserMove", HandleUserMove }, + { "AnimateUserMove", AnimateUserMove }, + { "FileNameAction", FileNameAction }, + { "AskQuestionProc", AskQuestionProc }, + { "AskQuestionReplyAction", AskQuestionReplyAction }, + { "PieceMenuPopup", PieceMenuPopup }, + { "WhiteClock", WhiteClock }, + { "BlackClock", BlackClock }, + { "Iconify", Iconify }, + { "ResetProc", ResetProc }, + { "LoadGameProc", LoadGameProc }, + { "LoadNextGameProc", LoadNextGameProc }, + { "LoadPrevGameProc", LoadPrevGameProc }, + { "LoadSelectedProc", LoadSelectedProc }, + { "ReloadGameProc", ReloadGameProc }, + { "LoadPositionProc", LoadPositionProc }, + { "LoadNextPositionProc", LoadNextPositionProc }, + { "LoadPrevPositionProc", LoadPrevPositionProc }, + { "ReloadPositionProc", ReloadPositionProc }, + { "CopyPositionProc", CopyPositionProc }, + { "PastePositionProc", PastePositionProc }, + { "CopyGameProc", CopyGameProc }, + { "PasteGameProc", PasteGameProc }, + { "SaveGameProc", SaveGameProc }, + { "SavePositionProc", SavePositionProc }, + { "MailMoveProc", MailMoveProc }, + { "ReloadCmailMsgProc", ReloadCmailMsgProc }, + { "QuitProc", QuitProc }, + { "MachineWhiteProc", MachineWhiteProc }, + { "MachineBlackProc", MachineBlackProc }, + { "AnalysisModeProc", AnalyzeModeProc }, + { "AnalyzeFileProc", AnalyzeFileProc }, + { "TwoMachinesProc", TwoMachinesProc }, + { "IcsClientProc", IcsClientProc }, + { "EditGameProc", EditGameProc }, + { "EditPositionProc", EditPositionProc }, + { "TrainingProc", EditPositionProc }, + { "EngineOutputProc", EngineOutputProc}, // [HGM] Winboard_x engine-output window + { "ShowGameListProc", ShowGameListProc }, + { "ShowMoveListProc", HistoryShowProc}, + { "EditTagsProc", EditCommentProc }, + { "EditCommentProc", EditCommentProc }, + { "IcsAlarmProc", IcsAlarmProc }, + { "IcsInputBoxProc", IcsInputBoxProc }, + { "PauseProc", PauseProc }, + { "AcceptProc", AcceptProc }, + { "DeclineProc", DeclineProc }, + { "RematchProc", RematchProc }, + { "CallFlagProc", CallFlagProc }, + { "DrawProc", DrawProc }, + { "AdjournProc", AdjournProc }, + { "AbortProc", AbortProc }, + { "ResignProc", ResignProc }, + { "EnterKeyProc", EnterKeyProc }, + { "StopObservingProc", StopObservingProc }, + { "StopExaminingProc", StopExaminingProc }, + { "BackwardProc", BackwardProc }, + { "ForwardProc", ForwardProc }, + { "ToStartProc", ToStartProc }, + { "ToEndProc", ToEndProc }, + { "RevertProc", RevertProc }, + { "TruncateGameProc", TruncateGameProc }, + { "MoveNowProc", MoveNowProc }, + { "RetractMoveProc", RetractMoveProc }, + { "AlwaysQueenProc", AlwaysQueenProc }, + { "AnimateDraggingProc", AnimateDraggingProc }, + { "AnimateMovingProc", AnimateMovingProc }, + { "AutoflagProc", AutoflagProc }, + { "AutoflipProc", AutoflipProc }, + { "AutobsProc", AutobsProc }, + { "AutoraiseProc", AutoraiseProc }, + { "AutosaveProc", AutosaveProc }, + { "BlindfoldProc", BlindfoldProc }, + { "FlashMovesProc", FlashMovesProc }, + { "FlipViewProc", FlipViewProc }, + { "GetMoveListProc", GetMoveListProc }, + #if HIGHDRAG + { "HighlightDraggingProc", HighlightDraggingProc }, + #endif + { "HighlightLastMoveProc", HighlightLastMoveProc }, + { "IcsAlarmProc", IcsAlarmProc }, + { "MoveSoundProc", MoveSoundProc }, + { "OldSaveStyleProc", OldSaveStyleProc }, + { "PeriodicUpdatesProc", PeriodicUpdatesProc }, + { "PonderNextMoveProc", PonderNextMoveProc }, + { "PopupExitMessageProc", PopupExitMessageProc }, + { "PopupMoveErrorsProc", PopupMoveErrorsProc }, + { "PremoveProc", PremoveProc }, + { "QuietPlayProc", QuietPlayProc }, + { "ShowCoordsProc", ShowCoordsProc }, + { "ShowThinkingProc", ShowThinkingProc }, + { "HideThinkingProc", HideThinkingProc }, + { "TestLegalityProc", TestLegalityProc }, + { "InfoProc", InfoProc }, + { "ManProc", ManProc }, + { "HintProc", HintProc }, + { "BookProc", BookProc }, + { "AboutGameProc", AboutGameProc }, + { "AboutProc", AboutProc }, + { "DebugProc", DebugProc }, + { "NothingProc", NothingProc }, + { "CommentPopDown", (XtActionProc) CommentPopDown }, + { "EditCommentPopDown", (XtActionProc) EditCommentPopDown }, + { "TagsPopDown", (XtActionProc) TagsPopDown }, + { "ErrorPopDown", (XtActionProc) ErrorPopDown }, + { "ICSInputBoxPopDown", (XtActionProc) ICSInputBoxPopDown }, + { "AnalysisPopDown", (XtActionProc) AnalysisPopDown }, + { "FileNamePopDown", (XtActionProc) FileNamePopDown }, + { "AskQuestionPopDown", (XtActionProc) AskQuestionPopDown }, + { "GameListPopDown", (XtActionProc) GameListPopDown }, + { "PromotionPopDown", (XtActionProc) PromotionPopDown }, + { "HistoryPopDown", (XtActionProc) HistoryPopDown }, + { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown }, + { "ShufflePopDown", (XtActionProc) ShufflePopDown }, + { "EnginePopDown", (XtActionProc) EnginePopDown }, + { "UciPopDown", (XtActionProc) UciPopDown }, + { "TimeControlPopDown", (XtActionProc) TimeControlPopDown }, + { "NewVariantPopDown", (XtActionProc) NewVariantPopDown }, + { "SettingsPopDown", (XtActionProc) SettingsPopDown }, + }; + + char globalTranslations[] = + ":R: ResignProc() \n \ + :r: ResetProc() \n \ + :g: LoadGameProc() \n \ + :N: LoadNextGameProc() \n \ + :P: LoadPrevGameProc() \n \ + :Q: QuitProc() \n \ + :F: ToEndProc() \n \ + :f: ForwardProc() \n \ + :B: ToStartProc() \n \ + :b: BackwardProc() \n \ + :p: PauseProc() \n \ + :d: DrawProc() \n \ + :t: CallFlagProc() \n \ + :i: Iconify() \n \ + :c: Iconify() \n \ + :v: FlipViewProc() \n \ + Control_L: BackwardProc() \n \ + Control_L: ForwardProc() \n \ + Control_R: BackwardProc() \n \ + Control_R: ForwardProc() \n \ + Shift1: AskQuestionProc(\"Direct command\",\ + \"Send to chess program:\",,1) \n \ + Shift2: AskQuestionProc(\"Direct command\",\ + \"Send to second chess program:\",,2) \n"; + + char boardTranslations[] = + ": HandleUserMove() \n \ + : HandleUserMove() \n \ + : AnimateUserMove() \n \ + Shift: XawPositionSimpleMenu(menuB) XawPositionSimpleMenu(menuD)\ + PieceMenuPopup(menuB) \n \ + Any: XawPositionSimpleMenu(menuW) XawPositionSimpleMenu(menuD) \ + PieceMenuPopup(menuW) \n \ + Shift: XawPositionSimpleMenu(menuW) XawPositionSimpleMenu(menuD)\ + PieceMenuPopup(menuW) \n \ + Any: XawPositionSimpleMenu(menuB) XawPositionSimpleMenu(menuD) \ + PieceMenuPopup(menuB) \n"; + + char whiteTranslations[] = ": WhiteClock()\n"; + char blackTranslations[] = ": BlackClock()\n"; + + char ICSInputTranslations[] = + "Return: EnterKeyProc() \n"; + + String xboardResources[] = { + "*fileName*value.translations: #override\\n Return: FileNameAction()", + "*question*value.translations: #override\\n Return: AskQuestionReplyAction()", + "*errorpopup*translations: #override\\n Return: ErrorPopDown()", + NULL + }; + + + /* Max possible square size */ + #define MAXSQSIZE 256 + + static int xpm_avail[MAXSQSIZE]; + + #ifdef HAVE_DIR_STRUCT + + /* Extract piece size from filename */ + static int + xpm_getsize(name, len, ext) + char *name; + int len; + char *ext; + { + char *p, *d; + char buf[10]; + + if (len < 4) + return 0; + + if ((p=strchr(name, '.')) == NULL || + StrCaseCmp(p+1, ext) != 0) + return 0; + + p = name + 3; + d = buf; + + while (*p && isdigit(*p)) + *(d++) = *(p++); + + *d = 0; + return atoi(buf); + } + + /* Setup xpm_avail */ + static int + xpm_getavail(dirname, ext) + char *dirname; + char *ext; + { + DIR *dir; + struct dirent *ent; + int i; + + for (i=0; id_name, NAMLEN(ent), ext); + if (i > 0 && i < MAXSQSIZE) + xpm_avail[i] = 1; + } + + closedir(dir); + + return 0; + } + + void + xpm_print_avail(fp, ext) + FILE *fp; + char *ext; + { + int i; + - fprintf(fp, "Available `%s' sizes:\n", ext); ++ fprintf(fp, _("Available `%s' sizes:\n"), ext); + for (i=1; i 99) /* watch bounds on buf */ + return -1; + + p = str; + d = buf; + for (i=0; iWM_PROTOCOLS: %s() \n", procname); + XtAugmentTranslations(w, XtParseTranslationTable(buf)); + } + + void + BoardToTop() + { + Arg args[16]; + XtSetArg(args[0], XtNiconic, False); + XtSetValues(shellWidget, args, 1); + + XtPopup(shellWidget, XtGrabNone); /* Raise if lowered */ + } + + #ifdef IDSIZES + // eventually, all layout determining code should go into a subroutine, but until then IDSIZE remains undefined -#else ++#else + #define BoardSize int + void InitDrawingSizes(BoardSize boardSize, int flags) + { // [HGM] resize is functional now, but for board format changes only (nr of ranks, files) - Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; - Arg args[16]; ++ Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; ++ Arg args[16]; + XtGeometryResult gres; - int i; - ++ int i; ++ + if(!formWidget) return; - ++ + /* + * Enable shell resizing. + */ + shellArgs[0].value = (XtArgVal) &w; + shellArgs[1].value = (XtArgVal) &h; + XtGetValues(shellWidget, shellArgs, 2); - ++ + shellArgs[4].value = 2*w; shellArgs[2].value = 10; + shellArgs[5].value = 2*h; shellArgs[3].value = 10; - XtSetValues(shellWidget, &shellArgs[2], 4); ++ XtSetValues(shellWidget, &shellArgs[2], 4); + - XtSetArg(args[0], XtNdefaultDistance, &sep); XtGetValues(formWidget, args, 1); ++ XtSetArg(args[0], XtNdefaultDistance, &sep); ++ XtGetValues(formWidget, args, 1); + + boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); - boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); ++ boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); + CreateGrid(); - ++ + XtSetArg(args[0], XtNwidth, boardWidth); + XtSetArg(args[1], XtNheight, boardHeight); + XtSetValues(boardWidget, args, 2); + + timerWidth = (boardWidth - sep) / 2; + XtSetArg(args[0], XtNwidth, timerWidth); + XtSetValues(whiteTimerWidget, args, 1); + XtSetValues(blackTimerWidget, args, 1); + + XawFormDoLayout(formWidget, False); - ++ + if (appData.titleInWindow) { + i = 0; + XtSetArg(args[i], XtNborderWidth, &bor); i++; + XtSetArg(args[i], XtNheight, &h); i++; + XtGetValues(titleWidget, args, i); + if (smallLayout) { + w = boardWidth - 2*bor; + } else { + XtSetArg(args[0], XtNwidth, &w); + XtGetValues(menuBarWidget, args, 1); + w = boardWidth - w - sep - 2*bor - 2; // WIDTH_FUDGE + } + + gres = XtMakeResizeRequest(titleWidget, w, h, &wr, &hr); + if (gres != XtGeometryYes && appData.debugMode) { + fprintf(stderr, - "%s: titleWidget geometry error %d %d %d %d %d\n", ++ _("%s: titleWidget geometry error %d %d %d %d %d\n"), + programName, gres, w, h, wr, hr); + } + } + + XawFormDoLayout(formWidget, True); - ++ + /* + * Inhibit shell resizing. - */ ++ */ + shellArgs[0].value = w = (XtArgVal) boardWidth + marginW; + shellArgs[1].value = h = (XtArgVal) boardHeight + marginH; + shellArgs[4].value = shellArgs[2].value = w; + shellArgs[5].value = shellArgs[3].value = h; + XtSetValues(shellWidget, &shellArgs[0], 6); + } + #endif + + int + main(argc, argv) + int argc; + char **argv; + { + int i, j, clockFontPxlSize, coordFontPxlSize, fontPxlSize; + XSetWindowAttributes window_attributes; + Arg args[16]; + Dimension timerWidth, boardWidth, boardHeight, w, h, sep, bor, wr, hr; + XrmValue vFrom, vTo; + XtGeometryResult gres; + char *p; + XrmDatabase xdb; - int forceMono = False; ++ int forceMono = False; + #define INDIRECTION -#ifdef INDIRECTION - // [HGM] before anything else, expand any indirection files amongst options - char *argvCopy[1000]; // 1000 seems enough - char newArgs[10000]; // holds actual characters - int k = 0; - - srandom(time(0)); // [HGM] book: make random truly random - - j = 0; - for(i=0; i= 1000-2) { printf("too many arguments\n"); exit(-1); } -//fprintf(stderr, "arg %s\n", argv[i]); - if(argv[i][0] != '@') argvCopy[j++] = argv[i]; else { - char c; - FILE *f = fopen(argv[i]+1, "rb"); - if(f == NULL) { fprintf(stderr, "ignore %s\n", argv[i]); continue; } // do not expand non-existing - argvCopy[j++] = newArgs + k; // get ready for first argument from file - while((c = fgetc(f)) != EOF) { // each line of file inserts 1 argument in the list - if(c == '\n') { - if(j >= 1000-2) { printf("too many arguments\n"); exit(-1); } - newArgs[k++] = 0; // terminate current arg - if(k >= 10000-1) { printf("too long arguments\n"); exit(-1); } - argvCopy[j++] = newArgs + k; // get ready for next - } else { - if(k >= 10000-1) { printf("too long arguments\n"); exit(-1); } - newArgs[k++] = c; - } - } - newArgs[k] = 0; - j--; - fclose(f); - } - } - argvCopy[j] = NULL; - argv = argvCopy; - argc = j; -#if 0 - if(appData.debugMode,1) { // OK, appData is not initialized here yet... - for(i=0; i= 1000-2) { printf(_("too many arguments\n")); exit(-1); } ++//fprintf(stderr, "arg %s\n", argv[i]); ++ if(argv[i][0] != '@') argvCopy[j++] = argv[i]; else { ++ char c; ++ FILE *f = fopen(argv[i]+1, "rb"); ++ if(f == NULL) { fprintf(stderr, _("ignore %s\n"), argv[i]); continue; } // do not expand non-existing ++ argvCopy[j++] = newArgs + k; // get ready for first argument from file ++ while((c = fgetc(f)) != EOF) { // each line of file inserts 1 argument in the list ++ if(c == '\n') { ++ if(j >= 1000-2) { printf(_("too many arguments\n")); exit(-1); } ++ newArgs[k++] = 0; // terminate current arg ++ if(k >= 10000-1) { printf(_("too long arguments\n")); exit(-1); } ++ argvCopy[j++] = newArgs + k; // get ready for next ++ } else { ++ if(k >= 10000-1) { printf(_("too long arguments\n")); exit(-1); } ++ newArgs[k++] = c; ++ } ++ } ++ newArgs[k] = 0; ++ j--; ++ fclose(f); ++ } ++ } ++ argvCopy[j] = NULL; ++ argv = argvCopy; ++ argc = j; ++#if 0 ++ if(appData.debugMode,1) { // OK, appData is not initialized here yet... ++ for(i=0; i 1) { - fprintf(stderr, "%s: unrecognized argument %s\n", ++ fprintf(stderr, _("%s: unrecognized argument %s\n"), + programName, argv[1]); + exit(2); + } + + if ((chessDir = (char *) getenv("CHESSDIR")) == NULL) { + chessDir = "."; + } else { + if (chdir(chessDir) != 0) { - fprintf(stderr, "%s: can't cd to CHESSDIR: ", programName); ++ fprintf(stderr, _("%s: can't cd to CHESSDIR: "), programName); + perror(chessDir); + exit(1); + } + } + + p = getenv("HOME"); + if (p == NULL) p = "/tmp"; + i = strlen(p) + strlen("/.xboardXXXXXx.pgn") + 1; + gameCopyFilename = (char*) malloc(i); + gamePasteFilename = (char*) malloc(i); + sprintf(gameCopyFilename, "%s/.xboard%05uc.pgn", p, getpid()); + sprintf(gamePasteFilename, "%s/.xboard%05up.pgn", p, getpid()); + + XtGetApplicationResources(shellWidget, (XtPointer) &appData, + clientResources, XtNumber(clientResources), + NULL, 0); + ++ if (appData.debugMode && appData.nameOfDebugFile && strcmp(appData.nameOfDebugFile, "stderr")) { ++ /* [DM] debug info to file [HGM] make the filename a command-line option, and allow it to remain stderr */ ++ if ((debugFP = fopen(appData.nameOfDebugFile, "w")) == NULL) { ++ printf(_("Failed to open file '%s'\n"), appData.nameOfDebugFile); ++ exit(errno); ++ } ++ setbuf(debugFP, NULL); ++ } ++ + /* [HGM,HR] make sure board size is acceptable */ + if(appData.NrFiles > BOARD_SIZE || + appData.NrRanks > BOARD_SIZE ) - DisplayFatalError("Recompile with BOARD_SIZE > 12, to support this size", 0, 2); ++ DisplayFatalError(_("Recompile with BOARD_SIZE > 12, to support this size"), 0, 2); + + #if !HIGHDRAG + /* This feature does not work; animation needs a rewrite */ + appData.highlightDragging = FALSE; + #endif + InitBackEnd1(); + + xDisplay = XtDisplay(shellWidget); + xScreen = DefaultScreen(xDisplay); + wm_delete_window = XInternAtom(xDisplay, "WM_DELETE_WINDOW", True); + + gameInfo.variant = StringToVariant(appData.variant); + InitPosition(FALSE); + #if 0 + /* + * Determine boardSize + */ + gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] boardsize: make sure we start as 8x8 + + //#ifndef IDSIZE + // [HGM] as long as we have not created the possibility to change size while running, start with requested size + gameInfo.boardWidth = appData.NrFiles > 0 ? appData.NrFiles : 8; + gameInfo.boardHeight = appData.NrRanks > 0 ? appData.NrRanks : 8; + gameInfo.holdingsWidth = appData.holdingsSize > 0 ? 2 : 0; + #endif + + + #ifdef IDSIZE + InitDrawingSizes(-1, 0); // [HGM] initsize: make this into a subroutine + #else + if (isdigit(appData.boardSize[0])) { + i = sscanf(appData.boardSize, "%d,%d,%d,%d,%d,%d,%d", &squareSize, + &lineGap, &clockFontPxlSize, &coordFontPxlSize, + &fontPxlSize, &smallLayout, &tinyLayout); + if (i == 0) { - fprintf(stderr, "%s: bad boardSize syntax %s\n", ++ fprintf(stderr, _("%s: bad boardSize syntax %s\n"), + programName, appData.boardSize); + exit(2); + } + if (i < 7) { + /* Find some defaults; use the nearest known size */ + SizeDefaults *szd, *nearest; + int distance = 99999; + nearest = szd = sizeDefaults; + while (szd->name != NULL) { + if (abs(szd->squareSize - squareSize) < distance) { + nearest = szd; + distance = abs(szd->squareSize - squareSize); + if (distance == 0) break; + } + szd++; + } + if (i < 2) lineGap = nearest->lineGap; + if (i < 3) clockFontPxlSize = nearest->clockFontPxlSize; + if (i < 4) coordFontPxlSize = nearest->coordFontPxlSize; + if (i < 5) fontPxlSize = nearest->fontPxlSize; + if (i < 6) smallLayout = nearest->smallLayout; + if (i < 7) tinyLayout = nearest->tinyLayout; + } + } else { + SizeDefaults *szd = sizeDefaults; + if (*appData.boardSize == NULLCHAR) { + while (DisplayWidth(xDisplay, xScreen) < szd->minScreenSize || + DisplayHeight(xDisplay, xScreen) < szd->minScreenSize) { + szd++; + } + if (szd->name == NULL) szd--; + } else { + while (szd->name != NULL && + StrCaseCmp(szd->name, appData.boardSize) != 0) szd++; + if (szd->name == NULL) { - fprintf(stderr, "%s: unrecognized boardSize name %s\n", ++ fprintf(stderr, _("%s: unrecognized boardSize name %s\n"), + programName, appData.boardSize); + exit(2); + } + } + squareSize = szd->squareSize; + lineGap = szd->lineGap; + clockFontPxlSize = szd->clockFontPxlSize; + coordFontPxlSize = szd->coordFontPxlSize; + fontPxlSize = szd->fontPxlSize; + smallLayout = szd->smallLayout; + tinyLayout = szd->tinyLayout; + } + + /* Now, using squareSize as a hint, find a good XPM/XIM set size */ + if (strlen(appData.pixmapDirectory) > 0) { + p = ExpandPathName(appData.pixmapDirectory); + if (!p) { - fprintf(stderr, "Error expanding path name \"%s\"\n", ++ fprintf(stderr, _("Error expanding path name \"%s\"\n"), + appData.pixmapDirectory); + exit(1); + } + if (appData.debugMode) { - fprintf(stderr, "XBoard square size (hint): %d\n", squareSize); - fprintf(stderr, "%s fulldir:%s:\n", IMAGE_EXT, p); ++ fprintf(stderr, _("\ ++XBoard square size (hint): %d\n\ ++%s fulldir:%s:\n"), squareSize, IMAGE_EXT, p); + } + squareSize = xpm_closest_to(p, squareSize, IMAGE_EXT); + if (appData.debugMode) { - fprintf(stderr, "Closest %s size: %d\n", IMAGE_EXT, squareSize); ++ fprintf(stderr, _("Closest %s size: %d\n"), IMAGE_EXT, squareSize); + } + } + + /* [HR] height treated separately (hacked) */ + boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); + boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); + if (appData.showJail == 1) { + /* Jail on top and bottom */ + XtSetArg(boardArgs[1], XtNwidth, boardWidth); + XtSetArg(boardArgs[2], XtNheight, + boardHeight + 2*(lineGap + squareSize)); + } else if (appData.showJail == 2) { + /* Jail on sides */ + XtSetArg(boardArgs[1], XtNwidth, + boardWidth + 2*(lineGap + squareSize)); + XtSetArg(boardArgs[2], XtNheight, boardHeight); + } else { + /* No jail */ + XtSetArg(boardArgs[1], XtNwidth, boardWidth); + XtSetArg(boardArgs[2], XtNheight, boardHeight); + } + + /* + * Determine what fonts to use. + */ + appData.clockFont = FindFont(appData.clockFont, clockFontPxlSize); + clockFontID = XLoadFont(xDisplay, appData.clockFont); + clockFontStruct = XQueryFont(xDisplay, clockFontID); + appData.coordFont = FindFont(appData.coordFont, coordFontPxlSize); + coordFontID = XLoadFont(xDisplay, appData.coordFont); + coordFontStruct = XQueryFont(xDisplay, coordFontID); + appData.font = FindFont(appData.font, fontPxlSize); + countFontID = XLoadFont(xDisplay, appData.coordFont); // [HGM] holdings + countFontStruct = XQueryFont(xDisplay, countFontID); + // appData.font = FindFont(appData.font, fontPxlSize); + + xdb = XtDatabase(xDisplay); + XrmPutStringResource(&xdb, "*font", appData.font); + + /* + * Detect if there are not enough colors available and adapt. + */ + if (DefaultDepth(xDisplay, xScreen) <= 2) { + appData.monoMode = True; + } + + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.lightSquareColor; + vFrom.size = strlen(appData.lightSquareColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + lightSquareColor = *(Pixel *) vTo.addr; + } + } + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.darkSquareColor; + vFrom.size = strlen(appData.darkSquareColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + darkSquareColor = *(Pixel *) vTo.addr; + } + } + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.whitePieceColor; + vFrom.size = strlen(appData.whitePieceColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + whitePieceColor = *(Pixel *) vTo.addr; + } + } + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.blackPieceColor; + vFrom.size = strlen(appData.blackPieceColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + blackPieceColor = *(Pixel *) vTo.addr; + } + } + + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.highlightSquareColor; + vFrom.size = strlen(appData.highlightSquareColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + highlightSquareColor = *(Pixel *) vTo.addr; + } + } + + if (!appData.monoMode) { + vFrom.addr = (caddr_t) appData.premoveHighlightColor; + vFrom.size = strlen(appData.premoveHighlightColor); + XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); + if (vTo.addr == NULL) { + appData.monoMode = True; + forceMono = True; + } else { + premoveHighlightColor = *(Pixel *) vTo.addr; + } + } + + if (forceMono) { - fprintf(stderr, "%s: too few colors available; trying monochrome mode\n", ++ fprintf(stderr, _("%s: too few colors available; trying monochrome mode\n"), + programName); + } + + if (appData.monoMode && appData.debugMode) { - fprintf(stderr, "white pixel = 0x%lx, black pixel = 0x%lx\n", ++ fprintf(stderr, _("white pixel = 0x%lx, black pixel = 0x%lx\n"), + (unsigned long) XWhitePixel(xDisplay, xScreen), + (unsigned long) XBlackPixel(xDisplay, xScreen)); + } + + if (parse_cpair(ColorShout, appData.colorShout) < 0 || + parse_cpair(ColorSShout, appData.colorSShout) < 0 || + parse_cpair(ColorChannel1, appData.colorChannel1) < 0 || + parse_cpair(ColorChannel, appData.colorChannel) < 0 || + parse_cpair(ColorKibitz, appData.colorKibitz) < 0 || + parse_cpair(ColorTell, appData.colorTell) < 0 || + parse_cpair(ColorChallenge, appData.colorChallenge) < 0 || + parse_cpair(ColorRequest, appData.colorRequest) < 0 || + parse_cpair(ColorSeek, appData.colorSeek) < 0 || + parse_cpair(ColorNormal, appData.colorNormal) < 0) + { + if (appData.colorize) { + fprintf(stderr, - "%s: can't parse color names; disabling colorization\n", ++ _("%s: can't parse color names; disabling colorization\n"), + programName); + } + appData.colorize = FALSE; + } + textColors[ColorNone].fg = textColors[ColorNone].bg = -1; + textColors[ColorNone].attr = 0; + + XtAppAddActions(appContext, boardActions, XtNumber(boardActions)); + + /* + * widget hierarchy + */ + if (tinyLayout) { + layoutName = "tinyLayout"; + } else if (smallLayout) { + layoutName = "smallLayout"; + } else { + layoutName = "normalLayout"; + } + /* Outer layoutWidget is there only to provide a name for use in + resources that depend on the layout style */ + layoutWidget = + XtCreateManagedWidget(layoutName, formWidgetClass, shellWidget, + layoutArgs, XtNumber(layoutArgs)); + formWidget = + XtCreateManagedWidget("form", formWidgetClass, layoutWidget, + formArgs, XtNumber(formArgs)); + XtSetArg(args[0], XtNdefaultDistance, &sep); + XtGetValues(formWidget, args, 1); + + j = 0; + widgetList[j++] = menuBarWidget = CreateMenuBar(menuBar); + XtSetArg(args[0], XtNtop, XtChainTop); - XtSetArg(args[1], XtNbottom, XtChainTop); ++ XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(menuBarWidget, args, 2); + + widgetList[j++] = whiteTimerWidget = + XtCreateWidget("whiteTime", labelWidgetClass, + formWidget, timerArgs, XtNumber(timerArgs)); + XtSetArg(args[0], XtNfont, clockFontStruct); + XtSetArg(args[1], XtNtop, XtChainTop); - XtSetArg(args[2], XtNbottom, XtChainTop); ++ XtSetArg(args[2], XtNbottom, XtChainTop); + XtSetValues(whiteTimerWidget, args, 3); + + widgetList[j++] = blackTimerWidget = + XtCreateWidget("blackTime", labelWidgetClass, + formWidget, timerArgs, XtNumber(timerArgs)); + XtSetArg(args[0], XtNfont, clockFontStruct); + XtSetArg(args[1], XtNtop, XtChainTop); - XtSetArg(args[2], XtNbottom, XtChainTop); ++ XtSetArg(args[2], XtNbottom, XtChainTop); + XtSetValues(blackTimerWidget, args, 3); + + if (appData.titleInWindow) { + widgetList[j++] = titleWidget = + XtCreateWidget("title", labelWidgetClass, formWidget, + titleArgs, XtNumber(titleArgs)); + XtSetArg(args[0], XtNtop, XtChainTop); - XtSetArg(args[1], XtNbottom, XtChainTop); ++ XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(titleWidget, args, 2); + } + + if (appData.showButtonBar) { + widgetList[j++] = buttonBarWidget = CreateButtonBar(buttonBar); + XtSetArg(args[0], XtNleft, XtChainRight); // [HGM] glue to right window edge - XtSetArg(args[1], XtNright, XtChainRight); // for good run-time sizing ++ XtSetArg(args[1], XtNright, XtChainRight); // for good run-time sizing + XtSetArg(args[2], XtNtop, XtChainTop); - XtSetArg(args[3], XtNbottom, XtChainTop); ++ XtSetArg(args[3], XtNbottom, XtChainTop); + XtSetValues(buttonBarWidget, args, 4); + } + + widgetList[j++] = messageWidget = + XtCreateWidget("message", labelWidgetClass, formWidget, - messageArgs, XtNumber(messageArgs)); ++ messageArgs, XtNumber(messageArgs)); + XtSetArg(args[0], XtNtop, XtChainTop); - XtSetArg(args[1], XtNbottom, XtChainTop); ++ XtSetArg(args[1], XtNbottom, XtChainTop); + XtSetValues(messageWidget, args, 2); + + widgetList[j++] = boardWidget = + XtCreateWidget("board", widgetClass, formWidget, boardArgs, + XtNumber(boardArgs)); + + XtManageChildren(widgetList, j); + + timerWidth = (boardWidth - sep) / 2; + XtSetArg(args[0], XtNwidth, timerWidth); + XtSetValues(whiteTimerWidget, args, 1); + XtSetValues(blackTimerWidget, args, 1); + + XtSetArg(args[0], XtNbackground, &timerBackgroundPixel); + XtSetArg(args[1], XtNforeground, &timerForegroundPixel); + XtGetValues(whiteTimerWidget, args, 2); + + if (appData.showButtonBar) { + XtSetArg(args[0], XtNbackground, &buttonBackgroundPixel); + XtSetArg(args[1], XtNforeground, &buttonForegroundPixel); + XtGetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), args, 2); + } + + /* + * formWidget uses these constraints but they are stored + * in the children. + */ + i = 0; + XtSetArg(args[i], XtNfromHoriz, 0); i++; + XtSetValues(menuBarWidget, args, i); + if (appData.titleInWindow) { + if (smallLayout) { + i = 0; + XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; + XtSetValues(whiteTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; + XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; + XtSetValues(blackTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; + XtSetArg(args[i], XtNjustify, XtJustifyLeft); i++; + XtSetValues(titleWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, titleWidget); i++; + XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; + XtSetValues(messageWidget, args, i); + if (appData.showButtonBar) { + i = 0; + XtSetArg(args[i], XtNfromVert, titleWidget); i++; + XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; + XtSetValues(buttonBarWidget, args, i); + } + } else { + i = 0; + XtSetArg(args[i], XtNfromVert, titleWidget); i++; + XtSetValues(whiteTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, titleWidget); i++; + XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; + XtSetValues(blackTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromHoriz, menuBarWidget); i++; + XtSetValues(titleWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; + XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; + XtSetValues(messageWidget, args, i); + if (appData.showButtonBar) { + i = 0; + XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; + XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; + XtSetValues(buttonBarWidget, args, i); + } + } + } else { + i = 0; + XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; + XtSetValues(whiteTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, menuBarWidget); i++; + XtSetArg(args[i], XtNfromHoriz, whiteTimerWidget); i++; + XtSetValues(blackTimerWidget, args, i); + i = 0; + XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; + XtSetArg(args[i], XtNresizable, (XtArgVal) True); i++; + XtSetValues(messageWidget, args, i); + if (appData.showButtonBar) { + i = 0; + XtSetArg(args[i], XtNfromVert, whiteTimerWidget); i++; + XtSetArg(args[i], XtNfromHoriz, messageWidget); i++; + XtSetValues(buttonBarWidget, args, i); + } + } + i = 0; + XtSetArg(args[0], XtNfromVert, messageWidget); + XtSetArg(args[1], XtNtop, XtChainTop); - XtSetArg(args[2], XtNbottom, XtChainBottom); ++ XtSetArg(args[2], XtNbottom, XtChainBottom); + XtSetArg(args[3], XtNleft, XtChainLeft); - XtSetArg(args[4], XtNright, XtChainRight); ++ XtSetArg(args[4], XtNright, XtChainRight); + XtSetValues(boardWidget, args, 5); + + XtRealizeWidget(shellWidget); + + /* + * Correct the width of the message and title widgets. + * It is not known why some systems need the extra fudge term. + * The value "2" is probably larger than needed. + */ + XawFormDoLayout(formWidget, False); - ++ + #define WIDTH_FUDGE 2 + i = 0; + XtSetArg(args[i], XtNborderWidth, &bor); i++; + XtSetArg(args[i], XtNheight, &h); i++; + XtGetValues(messageWidget, args, i); + if (appData.showButtonBar) { + i = 0; + XtSetArg(args[i], XtNwidth, &w); i++; + XtGetValues(buttonBarWidget, args, i); + w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; + } else { + w = boardWidth - 2*bor + 1; /*!! +1 compensates for kludge below */ + } + + gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); + if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, "%s: messageWidget geometry error %d %d %d %d %d\n", ++ fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), + programName, gres, w, h, wr, hr); + } + + /* !! Horrible hack to work around bug in XFree86 4.0.1 (X11R6.4.3) */ + /* The size used for the child widget in layout lags one resize behind + its true size, so we resize a second time, 1 pixel smaller. Yeech! */ + w--; + gres = XtMakeResizeRequest(messageWidget, w, h, &wr, &hr); + if (gres != XtGeometryYes && appData.debugMode) { - fprintf(stderr, "%s: messageWidget geometry error %d %d %d %d %d\n", ++ fprintf(stderr, _("%s: messageWidget geometry error %d %d %d %d %d\n"), + programName, gres, w, h, wr, hr); + } + /* !! end hack */ + XtSetArg(args[0], XtNleft, XtChainLeft); // [HGM] glue ends for good run-time sizing - XtSetArg(args[1], XtNright, XtChainRight); ++ XtSetArg(args[1], XtNright, XtChainRight); + XtSetValues(messageWidget, args, 2); + + if (appData.titleInWindow) { + i = 0; + XtSetArg(args[i], XtNborderWidth, &bor); i++; + XtSetArg(args[i], XtNheight, &h); i++; + XtGetValues(titleWidget, args, i); + if (smallLayout) { + w = boardWidth - 2*bor; + } else { + XtSetArg(args[0], XtNwidth, &w); + XtGetValues(menuBarWidget, args, 1); + w = boardWidth - w - sep - 2*bor - WIDTH_FUDGE; + } + + gres = XtMakeResizeRequest(titleWidget, w, h, &wr, &hr); + if (gres != XtGeometryYes && appData.debugMode) { + fprintf(stderr, - "%s: titleWidget geometry error %d %d %d %d %d\n", ++ _("%s: titleWidget geometry error %d %d %d %d %d\n"), + programName, gres, w, h, wr, hr); + } + } + XawFormDoLayout(formWidget, True); + + xBoardWindow = XtWindow(boardWidget); + + // [HGM] it seems the layout code ends here, but perhaps the color stuff is size independent and would + // not need to go into InitDrawingSizes(). + #endif + + /* + * Create X checkmark bitmap and initialize option menu checks. + */ + ReadBitmap(&xMarkPixmap, "checkmark.bm", + checkmark_bits, checkmark_width, checkmark_height); + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + if (appData.alwaysPromoteToQueen) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"), + args, 1); + } + if (appData.animateDragging) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Animate Dragging"), + args, 1); + } + if (appData.animate) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Moving"), + args, 1); + } + if (appData.autoComment) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Comment"), + args, 1); + } + if (appData.autoCallFlag) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flag"), + args, 1); + } + if (appData.autoFlipView) { + XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Auto Flip View"), + args, 1); + } + if (appData.autoObserve) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Observe"), + args, 1); + } + if (appData.autoRaiseBoard) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Auto Raise Board"), args, 1); + } + if (appData.autoSaveGames) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), + args, 1); + } + if (appData.saveGameFile[0] != NULLCHAR) { + /* Can't turn this off from menu */ + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), + args, 1); + XtSetSensitive(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), + False); + + } + if (appData.blindfold) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Blindfold"), args, 1); + } + if (appData.flashCount > 0) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Flash Moves"), + args, 1); + } + if (appData.getMoveList) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Get Move List"), + args, 1); + } + #if HIGHDRAG + if (appData.highlightDragging) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Highlight Dragging"), + args, 1); + } + #endif + if (appData.highlightLastMove) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Highlight Last Move"), + args, 1); + } + if (appData.icsAlarm) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.ICS Alarm"), + args, 1); + } + if (appData.ringBellAfterMoves) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Move Sound"), + args, 1); + } + if (appData.oldSaveStyle) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Old Save Style"), args, 1); + } + if (appData.periodicUpdates) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Periodic Updates"), args, 1); + } + if (appData.ponderNextMove) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Ponder Next Move"), args, 1); + } + if (appData.popupExitMessage) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Popup Exit Message"), args, 1); + } + if (appData.popupMoveErrors) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Popup Move Errors"), args, 1); + } + if (appData.premove) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Premove"), args, 1); + } + if (appData.quietPlay) { + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Quiet Play"), args, 1); + } + if (appData.showCoords) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), + args, 1); + } + if (appData.hideThinkingFromHuman) { + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), + args, 1); + } + if (appData.testLegality) { + XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Test Legality"), + args, 1); + } + + /* + * Create an icon. + */ + ReadBitmap(&wIconPixmap, "icon_white.bm", + icon_white_bits, icon_white_width, icon_white_height); + ReadBitmap(&bIconPixmap, "icon_black.bm", + icon_black_bits, icon_black_width, icon_black_height); + iconPixmap = wIconPixmap; + i = 0; + XtSetArg(args[i], XtNiconPixmap, iconPixmap); i++; + XtSetValues(shellWidget, args, i); + + /* + * Create a cursor for the board widget. + */ + window_attributes.cursor = XCreateFontCursor(xDisplay, XC_hand2); + XChangeWindowAttributes(xDisplay, xBoardWindow, + CWCursor, &window_attributes); + + /* + * Inhibit shell resizing. + */ + shellArgs[0].value = (XtArgVal) &w; + shellArgs[1].value = (XtArgVal) &h; + XtGetValues(shellWidget, shellArgs, 2); + shellArgs[4].value = shellArgs[2].value = w; + shellArgs[5].value = shellArgs[3].value = h; - XtSetValues(shellWidget, &shellArgs[2], 4); ++ XtSetValues(shellWidget, &shellArgs[2], 4); + marginW = w - boardWidth; // [HGM] needed to set new shellWidget size when we resize board + marginH = h - boardHeight; + + CatchDeleteWindow(shellWidget, "QuitProc"); + + CreateGCs(); + CreateGrid(); + #if HAVE_LIBXPM + if (appData.bitmapDirectory[0] != NULLCHAR) { + CreatePieces(); + } else { + CreateXPMPieces(); + } + #else + CreateXIMPieces(); + /* Create regular pieces */ + if (!useImages) CreatePieces(); + #endif + + CreatePieceMenus(); + + if (appData.animate || appData.animateDragging) + CreateAnimVars(); + + XtAugmentTranslations(formWidget, + XtParseTranslationTable(globalTranslations)); + XtAugmentTranslations(boardWidget, + XtParseTranslationTable(boardTranslations)); + XtAugmentTranslations(whiteTimerWidget, + XtParseTranslationTable(whiteTranslations)); + XtAugmentTranslations(blackTimerWidget, + XtParseTranslationTable(blackTranslations)); + + /* Why is the following needed on some versions of X instead + * of a translation? */ + XtAddEventHandler(boardWidget, ExposureMask, False, + (XtEventHandler) EventProc, NULL); + /* end why */ + + InitBackEnd2(); + + if (errorExitStatus == -1) { + if (appData.icsActive) { + /* We now wait until we see "login:" from the ICS before + sending the logon script (problems with timestamp otherwise) */ + /*ICSInitScript();*/ + if (appData.icsInputBox) ICSInputBoxPopUp(); + } + + signal(SIGINT, IntSigHandler); + signal(SIGTERM, IntSigHandler); + if (*appData.cmailGameName != NULLCHAR) { + signal(SIGUSR1, CmailSigHandler); + } + } + InitPosition(TRUE); + + XtAppMainLoop(appContext); ++ if (appData.debugMode) fclose(debugFP); // [DM] debug + return 0; + } + + void + ShutDownFrontEnd() + { + if (appData.icsActive && oldICSInteractionTitle != NULL) { + DisplayIcsInteractionTitle(oldICSInteractionTitle); + } + unlink(gameCopyFilename); + unlink(gamePasteFilename); + } + + RETSIGTYPE + IntSigHandler(sig) + int sig; + { + ExitEvent(sig); + } + + RETSIGTYPE + CmailSigHandler(sig) + int sig; + { + int dummy = 0; + int error; + + signal(SIGUSR1, SIG_IGN); /* suspend handler */ + + /* Activate call-back function CmailSigHandlerCallBack() */ + OutputToProcess(cmailPR, (char *)(&dummy), sizeof(int), &error); + + signal(SIGUSR1, CmailSigHandler); /* re-activate handler */ + } + + void + CmailSigHandlerCallBack(isr, closure, message, count, error) + InputSourceRef isr; + VOIDSTAR closure; + char *message; + int count; + int error; + { + BoardToTop(); + ReloadCmailMsgEvent(TRUE); /* Reload cmail msg */ + } + /**** end signal code ****/ + + + void + ICSInitScript() + { + FILE *f; + char buf[MSG_SIZ]; + char *p; + + f = fopen(appData.icsLogon, "r"); + if (f == NULL) { + p = getenv("HOME"); + if (p != NULL) { + strcpy(buf, p); + strcat(buf, "/"); + strcat(buf, appData.icsLogon); + f = fopen(buf, "r"); + } + } + if (f != NULL) + ProcessICSInitScript(f); + } + + void + ResetFrontEnd() + { + CommentPopDown(); + EditCommentPopDown(); + TagsPopDown(); + return; + } + + typedef struct { + char *name; + Boolean value; + } Enables; + + void + SetMenuEnables(enab) + Enables *enab; + { + Widget w; + if (!menuBarWidget) return; + while (enab->name != NULL) { + w = XtNameToWidget(menuBarWidget, enab->name); + if (w == NULL) { + DisplayError(enab->name, 0); + } else { + XtSetSensitive(w, enab->value); + } + enab++; + } + } + + Enables icsEnables[] = { + { "menuFile.Mail Move", False }, + { "menuFile.Reload CMail Message", False }, + { "menuMode.Machine Black", False }, + { "menuMode.Machine White", False }, + { "menuMode.Analysis Mode", False }, + { "menuMode.Analyze File", False }, + { "menuMode.Two Machines", False }, + #ifndef ZIPPY + { "menuHelp.Hint", False }, + { "menuHelp.Book", False }, + { "menuStep.Move Now", False }, + { "menuOptions.Periodic Updates", False }, + { "menuOptions.Hide Thinking", False }, + { "menuOptions.Ponder Next Move", False }, + #endif + { NULL, False } + }; + + Enables ncpEnables[] = { + { "menuFile.Mail Move", False }, + { "menuFile.Reload CMail Message", False }, + { "menuMode.Machine White", False }, + { "menuMode.Machine Black", False }, + { "menuMode.Analysis Mode", False }, + { "menuMode.Analyze File", False }, + { "menuMode.Two Machines", False }, + { "menuMode.ICS Client", False }, + { "menuMode.ICS Input Box", False }, + { "Action", False }, + { "menuStep.Revert", False }, + { "menuStep.Move Now", False }, + { "menuStep.Retract Move", False }, + { "menuOptions.Auto Comment", False }, + { "menuOptions.Auto Flag", False }, + { "menuOptions.Auto Flip View", False }, + { "menuOptions.Auto Observe", False }, + { "menuOptions.Auto Raise Board", False }, + { "menuOptions.Get Move List", False }, + { "menuOptions.ICS Alarm", False }, + { "menuOptions.Move Sound", False }, + { "menuOptions.Quiet Play", False }, + { "menuOptions.Hide Thinking", False }, + { "menuOptions.Periodic Updates", False }, + { "menuOptions.Ponder Next Move", False }, + { "menuHelp.Hint", False }, + { "menuHelp.Book", False }, + { NULL, False } + }; + + Enables gnuEnables[] = { + { "menuMode.ICS Client", False }, + { "menuMode.ICS Input Box", False }, + { "menuAction.Accept", False }, + { "menuAction.Decline", False }, + { "menuAction.Rematch", False }, + { "menuAction.Adjourn", False }, + { "menuAction.Stop Examining", False }, + { "menuAction.Stop Observing", False }, + { "menuStep.Revert", False }, + { "menuOptions.Auto Comment", False }, + { "menuOptions.Auto Observe", False }, + { "menuOptions.Auto Raise Board", False }, + { "menuOptions.Get Move List", False }, + { "menuOptions.Premove", False }, + { "menuOptions.Quiet Play", False }, + + /* The next two options rely on SetCmailMode being called *after* */ + /* SetGNUMode so that when GNU is being used to give hints these */ + /* menu options are still available */ + + { "menuFile.Mail Move", False }, + { "menuFile.Reload CMail Message", False }, + { NULL, False } + }; + + Enables cmailEnables[] = { + { "Action", True }, + { "menuAction.Call Flag", False }, + { "menuAction.Draw", True }, + { "menuAction.Adjourn", False }, + { "menuAction.Abort", False }, + { "menuAction.Stop Observing", False }, + { "menuAction.Stop Examining", False }, + { "menuFile.Mail Move", True }, + { "menuFile.Reload CMail Message", True }, + { NULL, False } + }; + + Enables trainingOnEnables[] = { + { "menuMode.Edit Comment", False }, + { "menuMode.Pause", False }, + { "menuStep.Forward", False }, + { "menuStep.Backward", False }, + { "menuStep.Forward to End", False }, + { "menuStep.Back to Start", False }, + { "menuStep.Move Now", False }, + { "menuStep.Truncate Game", False }, + { NULL, False } + }; + + Enables trainingOffEnables[] = { + { "menuMode.Edit Comment", True }, + { "menuMode.Pause", True }, + { "menuStep.Forward", True }, + { "menuStep.Backward", True }, + { "menuStep.Forward to End", True }, + { "menuStep.Back to Start", True }, + { "menuStep.Move Now", True }, + { "menuStep.Truncate Game", True }, + { NULL, False } + }; + + Enables machineThinkingEnables[] = { + { "menuFile.Load Game", False }, + { "menuFile.Load Next Game", False }, + { "menuFile.Load Previous Game", False }, + { "menuFile.Reload Same Game", False }, + { "menuFile.Paste Game", False }, + { "menuFile.Load Position", False }, + { "menuFile.Load Next Position", False }, + { "menuFile.Load Previous Position", False }, + { "menuFile.Reload Same Position", False }, + { "menuFile.Paste Position", False }, + { "menuMode.Machine White", False }, + { "menuMode.Machine Black", False }, + { "menuMode.Two Machines", False }, + { "menuStep.Retract Move", False }, + { NULL, False } + }; + + Enables userThinkingEnables[] = { + { "menuFile.Load Game", True }, + { "menuFile.Load Next Game", True }, + { "menuFile.Load Previous Game", True }, + { "menuFile.Reload Same Game", True }, + { "menuFile.Paste Game", True }, + { "menuFile.Load Position", True }, + { "menuFile.Load Next Position", True }, + { "menuFile.Load Previous Position", True }, + { "menuFile.Reload Same Position", True }, + { "menuFile.Paste Position", True }, + { "menuMode.Machine White", True }, + { "menuMode.Machine Black", True }, + { "menuMode.Two Machines", True }, + { "menuStep.Retract Move", True }, + { NULL, False } + }; + + void SetICSMode() + { + SetMenuEnables(icsEnables); ++ ++#ifdef ZIPPY ++ if (appData.zippyPlay && !appData.noChessProgram) /* [DM] icsEngineAnalyze */ ++ XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Analysis Mode"), True); ++#endif + } + + void + SetNCPMode() + { + SetMenuEnables(ncpEnables); + } + + void + SetGNUMode() + { + SetMenuEnables(gnuEnables); + } + + void + SetCmailMode() + { + SetMenuEnables(cmailEnables); + } + + void + SetTrainingModeOn() + { + SetMenuEnables(trainingOnEnables); + if (appData.showButtonBar) { + XtSetSensitive(buttonBarWidget, False); + } + CommentPopDown(); + } + + void + SetTrainingModeOff() + { + SetMenuEnables(trainingOffEnables); + if (appData.showButtonBar) { + XtSetSensitive(buttonBarWidget, True); + } + } + + void + SetUserThinkingEnables() + { + if (appData.noChessProgram) return; + SetMenuEnables(userThinkingEnables); + } + + void + SetMachineThinkingEnables() + { + if (appData.noChessProgram) return; + SetMenuEnables(machineThinkingEnables); + switch (gameMode) { + case MachinePlaysBlack: + case MachinePlaysWhite: + case TwoMachinesPlay: + XtSetSensitive(XtNameToWidget(menuBarWidget, + ModeToWidgetName(gameMode)), True); + break; + default: + break; + } + } + + #define Abs(n) ((n)<0 ? -(n) : (n)) + + /* + * Find a font that matches "pattern" that is as close as + * possible to the targetPxlSize. Prefer fonts that are k + * pixels smaller to fonts that are k pixels larger. The + * pattern must be in the X Consortium standard format, + * e.g. "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*". + * The return value should be freed with XtFree when no + * longer needed. + */ + char *FindFont(pattern, targetPxlSize) + char *pattern; + int targetPxlSize; + { + char **fonts, *p, *best, *scalable, *scalableTail; + int i, j, nfonts, minerr, err, pxlSize; + ++#ifdef ENABLE_NLS ++ char **missing_list; ++ int missing_count; ++ char *def_string, *base_fnt_lst, strInt[3]; ++ XFontSet fntSet; ++ XFontStruct **fnt_list; ++ ++ base_fnt_lst = calloc(1, strlen(pattern) + 3); ++ sprintf(strInt, "%d", targetPxlSize); ++ p = strstr(pattern, "--"); ++ strncpy(base_fnt_lst, pattern, p - pattern + 2); ++ strcat(base_fnt_lst, strInt); ++ strcat(base_fnt_lst, strchr(p + 2, '-')); ++ ++ if ((fntSet = XCreateFontSet(xDisplay, ++ base_fnt_lst, ++ &missing_list, ++ &missing_count, ++ &def_string)) == NULL) { ++ ++ fprintf(stderr, _("Unable to create font set.\n")); ++ exit (2); ++ } ++ ++ nfonts = XFontsOfFontSet(fntSet, &fnt_list, &fonts); ++#else + fonts = XListFonts(xDisplay, pattern, 999999, &nfonts); + if (nfonts < 1) { - fprintf(stderr, "%s: no fonts match pattern %s\n", ++ fprintf(stderr, _("%s: no fonts match pattern %s\n"), + programName, pattern); + exit(2); + } ++#endif ++ + best = fonts[0]; + scalable = NULL; + minerr = 999999; + for (i=0; i 0 && err < 0 && -err == minerr)) { + best = fonts[i]; + minerr = err; + } + } + } + if (scalable && Abs(minerr) > appData.fontSizeTolerance) { + /* If the error is too big and there is a scalable font, + use the scalable font. */ + int headlen = scalableTail - scalable; + p = (char *) XtMalloc(strlen(scalable) + 10); + while (isdigit(*scalableTail)) scalableTail++; + sprintf(p, "%.*s%d%s", headlen, scalable, targetPxlSize, scalableTail); + } else { + p = (char *) XtMalloc(strlen(best) + 1); + strcpy(p, best); + } + if (appData.debugMode) { - fprintf(debugFP, "resolved %s at pixel size %d\n to %s\n", ++ fprintf(debugFP, _("resolved %s at pixel size %d\n to %s\n"), + pattern, targetPxlSize, p); + } - XFreeFontNames(fonts); ++#ifdef ENABLE_NLS ++ if (missing_count > 0) ++ XFreeStringList(missing_list); ++ XFreeFontSet(xDisplay, fntSet); ++#else ++ XFreeFontNames(fonts); ++#endif + return p; + } + + void CreateGCs() + { + XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground + | GCBackground | GCFunction | GCPlaneMask; + XGCValues gc_values; + GC copyInvertedGC; + + gc_values.plane_mask = AllPlanes; + gc_values.line_width = lineGap; + gc_values.line_style = LineSolid; + gc_values.function = GXcopy; + + gc_values.foreground = XBlackPixel(xDisplay, xScreen); + gc_values.background = XBlackPixel(xDisplay, xScreen); + lineGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = XBlackPixel(xDisplay, xScreen); + gc_values.background = XWhitePixel(xDisplay, xScreen); + coordGC = XtGetGC(shellWidget, value_mask, &gc_values); + XSetFont(xDisplay, coordGC, coordFontID); + - // [HGM] make font for holdings counts (white on black0 ++ // [HGM] make font for holdings counts (white on black0 + gc_values.foreground = XWhitePixel(xDisplay, xScreen); + gc_values.background = XBlackPixel(xDisplay, xScreen); + countGC = XtGetGC(shellWidget, value_mask, &gc_values); + XSetFont(xDisplay, countGC, countFontID); + + if (appData.monoMode) { + gc_values.foreground = XWhitePixel(xDisplay, xScreen); + gc_values.background = XWhitePixel(xDisplay, xScreen); + highlineGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = XWhitePixel(xDisplay, xScreen); + gc_values.background = XBlackPixel(xDisplay, xScreen); + lightSquareGC = wbPieceGC + = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = XBlackPixel(xDisplay, xScreen); + gc_values.background = XWhitePixel(xDisplay, xScreen); + darkSquareGC = bwPieceGC + = XtGetGC(shellWidget, value_mask, &gc_values); + + if (DefaultDepth(xDisplay, xScreen) == 1) { + /* Avoid XCopyPlane on 1-bit screens to work around Sun bug */ + gc_values.function = GXcopyInverted; + copyInvertedGC = XtGetGC(shellWidget, value_mask, &gc_values); + gc_values.function = GXcopy; + if (XBlackPixel(xDisplay, xScreen) == 1) { + bwPieceGC = darkSquareGC; + wbPieceGC = copyInvertedGC; + } else { + bwPieceGC = copyInvertedGC; + wbPieceGC = lightSquareGC; + } + } + } else { + gc_values.foreground = highlightSquareColor; + gc_values.background = highlightSquareColor; + highlineGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = premoveHighlightColor; + gc_values.background = premoveHighlightColor; + prelineGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = lightSquareColor; + gc_values.background = darkSquareColor; + lightSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = darkSquareColor; + gc_values.background = lightSquareColor; + darkSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = jailSquareColor; + gc_values.background = jailSquareColor; + jailSquareGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = whitePieceColor; + gc_values.background = darkSquareColor; + wdPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = whitePieceColor; + gc_values.background = lightSquareColor; + wlPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = whitePieceColor; + gc_values.background = jailSquareColor; + wjPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = blackPieceColor; + gc_values.background = darkSquareColor; + bdPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = blackPieceColor; + gc_values.background = lightSquareColor; + blPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + + gc_values.foreground = blackPieceColor; + gc_values.background = jailSquareColor; + bjPieceGC = XtGetGC(shellWidget, value_mask, &gc_values); + } + } + + void loadXIM(xim, xmask, filename, dest, mask) + XImage *xim; + XImage *xmask; + char *filename; + Pixmap *dest; + Pixmap *mask; + { + int x, y, w, h, p; + FILE *fp; + Pixmap temp; + XGCValues values; + GC maskGC; + + fp = fopen(filename, "rb"); + if (!fp) { - fprintf(stderr, "%s: error loading XIM!\n", programName); ++ fprintf(stderr, _("%s: error loading XIM!\n"), programName); + exit(1); + } + + w = fgetc(fp); + h = fgetc(fp); + + for (y=0; ydepth); + XPutImage(xDisplay, *dest, lightSquareGC, xim, + 0, 0, 0, 0, w, h); + + /* create Pixmap of clipmask + Note: We assume the white/black pieces have the same + outline, so we make only 6 masks. This is okay + since the XPM clipmask routines do the same. */ + if (xmask) { + temp = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay), + w, h, xim->depth); + XPutImage(xDisplay, temp, lightSquareGC, xmask, + 0, 0, 0, 0, w, h); + + /* now create the 1-bit version */ + *mask = XCreatePixmap(xDisplay, DefaultRootWindow(xDisplay), + w, h, 1); + + values.foreground = 1; + values.background = 0; + + /* Don't use XtGetGC, not read only */ + maskGC = XCreateGC(xDisplay, *mask, + GCForeground | GCBackground, &values); + XCopyPlane(xDisplay, temp, *mask, maskGC, + 0, 0, squareSize, squareSize, 0, 0, 1); + XFreePixmap(xDisplay, temp); + } + } + + void CreateXIMPieces() + { + int piece, kind; + char buf[MSG_SIZ]; + u_int ss; + static char *ximkind[] = { "ll", "ld", "dl", "dd" }; + XImage *ximtemp; + + ss = squareSize; + + /* The XSynchronize calls were copied from CreatePieces. + Not sure if needed, but can't hurt */ + XSynchronize(xDisplay, True); /* Work-around for xlib/xt + buffering bug */ + + /* temp needed by loadXIM() */ + ximtemp = XGetImage(xDisplay, DefaultRootWindow(xDisplay), + 0, 0, ss, ss, AllPlanes, XYPixmap); + + if (strlen(appData.pixmapDirectory) == 0) { + useImages = 0; + } else { + useImages = 1; + if (appData.monoMode) { - DisplayFatalError("XIM pieces cannot be used in monochrome mode", ++ DisplayFatalError(_("XIM pieces cannot be used in monochrome mode"), + 0, 2); + ExitEvent(2); + } - fprintf(stderr, "\nLoading XIMs...\n"); ++ fprintf(stderr, _("\nLoading XIMs...\n")); + /* Load pieces */ + for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { + fprintf(stderr, "%d", piece+1); + for (kind=0; kind<4; kind++) { + fprintf(stderr, "."); + sprintf(buf, "%s/%c%s%u.xim", + ExpandPathName(appData.pixmapDirectory), + ToLower(PieceToChar((ChessSquare)piece)), + ximkind[kind], ss); + ximPieceBitmap[kind][piece] = + XGetImage(xDisplay, DefaultRootWindow(xDisplay), + 0, 0, ss, ss, AllPlanes, XYPixmap); + if (appData.debugMode) - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + loadXIM(ximPieceBitmap[kind][piece], + ximtemp, buf, + &(xpmPieceBitmap[kind][piece]), + &(ximMaskPm[piece%(int)BlackPawn])); + } + fprintf(stderr," "); + } + /* Load light and dark squares */ + /* If the LSQ and DSQ pieces don't exist, we will + draw them with solid squares. */ + sprintf(buf, "%s/lsq%u.xim", ExpandPathName(appData.pixmapDirectory), ss); + if (access(buf, 0) != 0) { + useImageSqs = 0; + } else { + useImageSqs = 1; - fprintf(stderr, "light square "); ++ fprintf(stderr, _("light square ")); + ximLightSquare= + XGetImage(xDisplay, DefaultRootWindow(xDisplay), + 0, 0, ss, ss, AllPlanes, XYPixmap); + if (appData.debugMode) - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + + loadXIM(ximLightSquare, NULL, buf, &xpmLightSquare, NULL); - fprintf(stderr, "dark square "); ++ fprintf(stderr, _("dark square ")); + sprintf(buf, "%s/dsq%u.xim", + ExpandPathName(appData.pixmapDirectory), ss); + if (appData.debugMode) - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + ximDarkSquare= + XGetImage(xDisplay, DefaultRootWindow(xDisplay), + 0, 0, ss, ss, AllPlanes, XYPixmap); + loadXIM(ximDarkSquare, NULL, buf, &xpmDarkSquare, NULL); + xpmJailSquare = xpmLightSquare; + } - fprintf(stderr, "Done.\n"); ++ fprintf(stderr, _("Done.\n")); + } + XSynchronize(xDisplay, False); /* Work-around for xlib/xt buffering bug */ + } + + #if HAVE_LIBXPM + void CreateXPMPieces() + { + int piece, kind, r; + char buf[MSG_SIZ]; + u_int ss = squareSize; + XpmAttributes attr; + static char *xpmkind[] = { "ll", "ld", "dl", "dd" }; + XpmColorSymbol symbols[4]; + + #if 0 + /* Apparently some versions of Xpm don't define XpmFormat at all --tpm */ + if (appData.debugMode) { + fprintf(stderr, "XPM Library Version: %d.%d%c\n", + XpmFormat, XpmVersion, (char)('a' + XpmRevision - 1)); + } + #endif + + /* The XSynchronize calls were copied from CreatePieces. + Not sure if needed, but can't hurt */ + XSynchronize(xDisplay, True); /* Work-around for xlib/xt buffering bug */ + + /* Setup translations so piece colors match square colors */ + symbols[0].name = "light_piece"; + symbols[0].value = appData.whitePieceColor; + symbols[1].name = "dark_piece"; + symbols[1].value = appData.blackPieceColor; + symbols[2].name = "light_square"; + symbols[2].value = appData.lightSquareColor; + symbols[3].name = "dark_square"; + symbols[3].value = appData.darkSquareColor; + + attr.valuemask = XpmColorSymbols; + attr.colorsymbols = symbols; + attr.numsymbols = 4; + + if (appData.monoMode) { - DisplayFatalError("XPM pieces cannot be used in monochrome mode", ++ DisplayFatalError(_("XPM pieces cannot be used in monochrome mode"), + 0, 2); + ExitEvent(2); + } + if (strlen(appData.pixmapDirectory) == 0) { + XpmPieces* pieces = builtInXpms; + useImages = 1; + /* Load pieces */ + while (pieces->size != squareSize && pieces->size) pieces++; + if (!pieces->size) { - fprintf(stderr, "No builtin XPM pieces of size %d\n", squareSize); ++ fprintf(stderr, _("No builtin XPM pieces of size %d\n"), squareSize); + exit(1); + } + for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { + for (kind=0; kind<4; kind++) { + + if ((r=XpmCreatePixmapFromData(xDisplay, xBoardWindow, + pieces->xpm[piece][kind], + &(xpmPieceBitmap[kind][piece]), + NULL, &attr)) != 0) { - fprintf(stderr, "Error %d loading XPM image \"%s\"\n", ++ fprintf(stderr, _("Error %d loading XPM image \"%s\"\n"), + r, buf); + exit(1); + } + } + } + useImageSqs = 0; + xpmJailSquare = xpmLightSquare; + } else { + useImages = 1; + - fprintf(stderr, "\nLoading XPMs...\n"); ++ fprintf(stderr, _("\nLoading XPMs...\n")); + + /* Load pieces */ + for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { + fprintf(stderr, "%d ", piece+1); + for (kind=0; kind<4; kind++) { + sprintf(buf, "%s/%c%s%u.xpm", + ExpandPathName(appData.pixmapDirectory), + ToLower(PieceToChar((ChessSquare)piece)), + xpmkind[kind], ss); + if (appData.debugMode) { - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + } + if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, + &(xpmPieceBitmap[kind][piece]), + NULL, &attr)) != 0) { - fprintf(stderr, "Error %d loading XPM file \"%s\"\n", ++ fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), + r, buf); + exit(1); + } + } + } + /* Load light and dark squares */ + /* If the LSQ and DSQ pieces don't exist, we will + draw them with solid squares. */ - fprintf(stderr, "light square "); ++ fprintf(stderr, _("light square ")); + sprintf(buf, "%s/lsq%u.xpm", ExpandPathName(appData.pixmapDirectory), ss); + if (access(buf, 0) != 0) { + useImageSqs = 0; + } else { + useImageSqs = 1; + if (appData.debugMode) - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + + if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, + &xpmLightSquare, NULL, &attr)) != 0) { - fprintf(stderr, "Error %d loading XPM file \"%s\"\n", r, buf); ++ fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), r, buf); + exit(1); + } - fprintf(stderr, "dark square "); ++ fprintf(stderr, _("dark square ")); + sprintf(buf, "%s/dsq%u.xpm", + ExpandPathName(appData.pixmapDirectory), ss); + if (appData.debugMode) { - fprintf(stderr, "(File:%s:) ", buf); ++ fprintf(stderr, _("(File:%s:) "), buf); + } + if ((r=XpmReadFileToPixmap(xDisplay, xBoardWindow, buf, + &xpmDarkSquare, NULL, &attr)) != 0) { - fprintf(stderr, "Error %d loading XPM file \"%s\"\n", r, buf); ++ fprintf(stderr, _("Error %d loading XPM file \"%s\"\n"), r, buf); + exit(1); + } + } + xpmJailSquare = xpmLightSquare; - fprintf(stderr, "Done.\n"); ++ fprintf(stderr, _("Done.\n")); + } + XSynchronize(xDisplay, False); /* Work-around for xlib/xt + buffering bug */ + } + #endif /* HAVE_LIBXPM */ + + #if HAVE_LIBXPM + /* No built-in bitmaps */ + void CreatePieces() + { + int piece, kind; + char buf[MSG_SIZ]; + u_int ss = squareSize; + + XSynchronize(xDisplay, True); /* Work-around for xlib/xt + buffering bug */ + + for (kind = SOLID; kind <= (appData.monoMode ? OUTLINE : SOLID); kind++) { + for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { + sprintf(buf, "%c%u%c.bm", ToLower(PieceToChar((ChessSquare)piece)), + ss, kind == SOLID ? 's' : 'o'); + ReadBitmap(&pieceBitmap[kind][piece], buf, NULL, ss, ss); + } + } + + XSynchronize(xDisplay, False); /* Work-around for xlib/xt + buffering bug */ + } + #else + /* With built-in bitmaps */ + void CreatePieces() + { + BuiltInBits* bib = builtInBits; + int piece, kind; + char buf[MSG_SIZ]; + u_int ss = squareSize; + + XSynchronize(xDisplay, True); /* Work-around for xlib/xt + buffering bug */ + + while (bib->squareSize != ss && bib->squareSize != 0) bib++; + + for (kind = SOLID; kind <= (appData.monoMode ? OUTLINE : SOLID); kind++) { + for (piece = (int) WhitePawn; piece <= (int) WhiteKing; piece++) { + sprintf(buf, "%c%u%c.bm", ToLower(PieceToChar((ChessSquare)piece)), + ss, kind == SOLID ? 's' : 'o'); + ReadBitmap(&pieceBitmap[kind][piece], buf, + bib->bits[kind][piece], ss, ss); + } + } + + XSynchronize(xDisplay, False); /* Work-around for xlib/xt + buffering bug */ + } + #endif + + void ReadBitmap(pm, name, bits, wreq, hreq) + Pixmap *pm; + String name; + unsigned char bits[]; + u_int wreq, hreq; + { + int x_hot, y_hot; + u_int w, h; + int errcode; + char msg[MSG_SIZ], fullname[MSG_SIZ]; + + if (*appData.bitmapDirectory != NULLCHAR) { + strcpy(fullname, appData.bitmapDirectory); + strcat(fullname, "/"); + strcat(fullname, name); + errcode = XReadBitmapFile(xDisplay, xBoardWindow, fullname, + &w, &h, pm, &x_hot, &y_hot); + if (errcode != BitmapSuccess) { + switch (errcode) { + case BitmapOpenFailed: - sprintf(msg, "Can't open bitmap file %s", fullname); ++ sprintf(msg, _("Can't open bitmap file %s"), fullname); + break; + case BitmapFileInvalid: - sprintf(msg, "Invalid bitmap in file %s", fullname); ++ sprintf(msg, _("Invalid bitmap in file %s"), fullname); + break; + case BitmapNoMemory: - sprintf(msg, "Ran out of memory reading bitmap file %s", ++ sprintf(msg, _("Ran out of memory reading bitmap file %s"), + fullname); + break; + default: - sprintf(msg, "Unknown XReadBitmapFile error %d on file %s", ++ sprintf(msg, _("Unknown XReadBitmapFile error %d on file %s"), + errcode, fullname); + break; + } - fprintf(stderr, "%s: %s...using built-in\n", ++ fprintf(stderr, _("%s: %s...using built-in\n"), + programName, msg); + } else if (w != wreq || h != hreq) { + fprintf(stderr, - "%s: Bitmap %s is %dx%d, not %dx%d...using built-in\n", ++ _("%s: Bitmap %s is %dx%d, not %dx%d...using built-in\n"), + programName, fullname, w, h, wreq, hreq); + } else { + return; + } + } + if (bits == NULL) { + #if 0 - fprintf(stderr, "%s: No built-in bitmap for %s; giving up\n", ++ fprintf(stderr, _("%s: No built-in bitmap for %s; giving up\n"), + programName, name); + exit(1); + #endif + ; // [HGM] bitmaps: make it non-fatal if we have no bitmap; + } else { + *pm = XCreateBitmapFromData(xDisplay, xBoardWindow, (char *) bits, + wreq, hreq); + } + } + + void CreateGrid() + { + int i, j; + + if (lineGap == 0) return; + + /* [HR] Split this into 2 loops for non-square boards. */ + + for (i = 0; i < BOARD_HEIGHT + 1; i++) { + gridSegments[i].x1 = 0; + gridSegments[i].x2 = + lineGap + BOARD_WIDTH * (squareSize + lineGap); + gridSegments[i].y1 = gridSegments[i].y2 + = lineGap / 2 + (i * (squareSize + lineGap)); + } + + for (j = 0; j < BOARD_WIDTH + 1; j++) { + gridSegments[j + i].y1 = 0; + gridSegments[j + i].y2 = + lineGap + BOARD_HEIGHT * (squareSize + lineGap); + gridSegments[j + i].x1 = gridSegments[j + i].x2 + = lineGap / 2 + (j * (squareSize + lineGap)); + } + } + + static void MenuBarSelect(w, addr, index) + Widget w; + caddr_t addr; + caddr_t index; + { + XtActionProc proc = (XtActionProc) addr; + + (proc)(NULL, NULL, NULL, NULL); + } + + void CreateMenuBarPopup(parent, name, mb) + Widget parent; + String name; + Menu *mb; + { + int j; + Widget menu, entry; + MenuItem *mi; + Arg args[16]; + + menu = XtCreatePopupShell(name, simpleMenuWidgetClass, + parent, NULL, 0); + j = 0; + XtSetArg(args[j], XtNleftMargin, 20); j++; + XtSetArg(args[j], XtNrightMargin, 20); j++; + mi = mb->mi; + while (mi->string != NULL) { + if (strcmp(mi->string, "----") == 0) { + entry = XtCreateManagedWidget(mi->string, smeLineObjectClass, + menu, args, j); + } else { ++ XtSetArg(args[j], XtNlabel, XtNewString(_(mi->string))); + entry = XtCreateManagedWidget(mi->string, smeBSBObjectClass, - menu, args, j); ++ menu, args, j+1); + XtAddCallback(entry, XtNcallback, + (XtCallbackProc) MenuBarSelect, + (caddr_t) mi->proc); + } + mi++; + } + } + + Widget CreateMenuBar(mb) + Menu *mb; + { + int j; + Widget anchor, menuBar; + Arg args[16]; + char menuName[MSG_SIZ]; + + j = 0; + XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++; + XtSetArg(args[j], XtNvSpace, 0); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + menuBar = XtCreateWidget("menuBar", boxWidgetClass, + formWidget, args, j); + + while (mb->name != NULL) { + strcpy(menuName, "menu"); + strcat(menuName, mb->name); + j = 0; + XtSetArg(args[j], XtNmenuName, XtNewString(menuName)); j++; + if (tinyLayout) { + char shortName[2]; - shortName[0] = mb->name[0]; ++ shortName[0] = _(mb->name)[0]; + shortName[1] = NULLCHAR; + XtSetArg(args[j], XtNlabel, XtNewString(shortName)); j++; + } ++ else { ++ XtSetArg(args[j], XtNlabel, XtNewString(_(mb->name))); j++; ++ } ++ + XtSetArg(args[j], XtNborderWidth, 0); j++; + anchor = XtCreateManagedWidget(mb->name, menuButtonWidgetClass, + menuBar, args, j); + CreateMenuBarPopup(menuBar, menuName, mb); + mb++; + } + return menuBar; + } + + Widget CreateButtonBar(mi) + MenuItem *mi; + { + int j; + Widget button, buttonBar; + Arg args[16]; + + j = 0; + XtSetArg(args[j], XtNorientation, XtorientHorizontal); j++; + if (tinyLayout) { + XtSetArg(args[j], XtNhSpace, 0); j++; + } + XtSetArg(args[j], XtNborderWidth, 0); j++; + XtSetArg(args[j], XtNvSpace, 0); j++; + buttonBar = XtCreateWidget("buttonBar", boxWidgetClass, + formWidget, args, j); + + while (mi->string != NULL) { + j = 0; + if (tinyLayout) { + XtSetArg(args[j], XtNinternalWidth, 2); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + } ++ XtSetArg(args[j], XtNlabel, XtNewString(_(mi->string))); j++; + button = XtCreateManagedWidget(mi->string, commandWidgetClass, + buttonBar, args, j); + XtAddCallback(button, XtNcallback, + (XtCallbackProc) MenuBarSelect, + (caddr_t) mi->proc); + mi++; + } + return buttonBar; + } + + Widget + CreatePieceMenu(name, color) + char *name; + int color; + { + int i; + Widget entry, menu; + Arg args[16]; + ChessSquare selection; + + menu = XtCreatePopupShell(name, simpleMenuWidgetClass, + boardWidget, args, 0); + + for (i = 0; i < PIECE_MENU_SIZE; i++) { + String item = pieceMenuStrings[color][i]; + + if (strcmp(item, "----") == 0) { + entry = XtCreateManagedWidget(item, smeLineObjectClass, + menu, NULL, 0); + } else { ++ XtSetArg(args[0], XtNlabel, XtNewString(_(item))); + entry = XtCreateManagedWidget(item, smeBSBObjectClass, - menu, NULL, 0); ++ menu, args, 1); + selection = pieceMenuTranslation[color][i]; + XtAddCallback(entry, XtNcallback, + (XtCallbackProc) PieceMenuSelect, + (caddr_t) selection); + if (selection == WhitePawn || selection == BlackPawn) { + XtSetArg(args[0], XtNpopupOnEntry, entry); + XtSetValues(menu, args, 1); + } + } + } + return menu; + } + + void + CreatePieceMenus() + { + int i; + Widget entry; + Arg args[16]; + ChessSquare selection; + + whitePieceMenu = CreatePieceMenu("menuW", 0); + blackPieceMenu = CreatePieceMenu("menuB", 1); + + XtRegisterGrabAction(PieceMenuPopup, True, + (unsigned)(ButtonPressMask|ButtonReleaseMask), + GrabModeAsync, GrabModeAsync); + - XtSetArg(args[0], XtNlabel, "Drop"); ++ XtSetArg(args[0], XtNlabel, _("Drop")); + dropMenu = XtCreatePopupShell("menuD", simpleMenuWidgetClass, + boardWidget, args, 1); + for (i = 0; i < DROP_MENU_SIZE; i++) { + String item = dropMenuStrings[i]; + + if (strcmp(item, "----") == 0) { + entry = XtCreateManagedWidget(item, smeLineObjectClass, + dropMenu, NULL, 0); + } else { ++ XtSetArg(args[0], XtNlabel, XtNewString(_(item))); + entry = XtCreateManagedWidget(item, smeBSBObjectClass, - dropMenu, NULL, 0); ++ dropMenu, args, 1); + selection = dropMenuTranslation[i]; + XtAddCallback(entry, XtNcallback, + (XtCallbackProc) DropMenuSelect, + (caddr_t) selection); + } + } + } + + void SetupDropMenu() + { + int i, j, count; + char label[32]; + Arg args[16]; + Widget entry; + char* p; + + for (i=0; itype != ButtonPress) return; + if (errorUp) ErrorPopDown(); + switch (gameMode) { + case EditPosition: + case IcsExamining: + whichMenu = params[0]; + break; + case IcsPlayingWhite: + case IcsPlayingBlack: + case EditGame: + case MachinePlaysWhite: + case MachinePlaysBlack: + if (appData.testLegality && + gameInfo.variant != VariantBughouse && + gameInfo.variant != VariantCrazyhouse) return; + SetupDropMenu(); + whichMenu = "menuD"; + break; + default: + return; + } + + if (((pmFromX = EventToSquare(event->xbutton.x, BOARD_WIDTH)) < 0) || + ((pmFromY = EventToSquare(event->xbutton.y, BOARD_HEIGHT)) < 0)) { + pmFromX = pmFromY = -1; + return; + } + if (flipView) + pmFromX = BOARD_WIDTH - 1 - pmFromX; + else + pmFromY = BOARD_HEIGHT - 1 - pmFromY; + + XtPopupSpringLoaded(XtNameToWidget(boardWidget, whichMenu)); + } + + static void PieceMenuSelect(w, piece, junk) + Widget w; + ChessSquare piece; + caddr_t junk; + { + if (pmFromX < 0 || pmFromY < 0) return; + EditPositionMenuEvent(piece, pmFromX, pmFromY); + } + + static void DropMenuSelect(w, piece, junk) + Widget w; + ChessSquare piece; + caddr_t junk; + { + if (pmFromX < 0 || pmFromY < 0) return; + DropMenuEvent(piece, pmFromX, pmFromY); + } + + void WhiteClock(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (gameMode == EditPosition || gameMode == IcsExamining) { + SetWhiteToPlayEvent(); + } else if (gameMode == IcsPlayingBlack || gameMode == MachinePlaysWhite) { + CallFlagEvent(); + } + } + + void BlackClock(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (gameMode == EditPosition || gameMode == IcsExamining) { + SetBlackToPlayEvent(); + } else if (gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) { + CallFlagEvent(); + } + } + + + /* + * If the user selects on a border boundary, return -1; if off the board, + * return -2. Otherwise map the event coordinate to the square. + */ + int EventToSquare(x, limit) + int x; + { + if (x <= 0) + return -2; + if (x < lineGap) + return -1; + x -= lineGap; + if ((x % (squareSize + lineGap)) >= squareSize) + return -1; + x /= (squareSize + lineGap); + if (x >= limit) + return -2; + return x; + } + + static void do_flash_delay(msec) + unsigned long msec; + { + TimeDelay(msec); + } + + static void drawHighlight(file, rank, gc) + int file, rank; + GC gc; + { + int x, y; + + if (lineGap == 0 || appData.blindfold) return; + + if (flipView) { + x = lineGap/2 + ((BOARD_WIDTH-1)-file) * + (squareSize + lineGap); + y = lineGap/2 + rank * (squareSize + lineGap); + } else { + x = lineGap/2 + file * (squareSize + lineGap); + y = lineGap/2 + ((BOARD_HEIGHT-1)-rank) * + (squareSize + lineGap); + } + + XDrawRectangle(xDisplay, xBoardWindow, gc, x, y, + squareSize+lineGap, squareSize+lineGap); + } + + int hi1X = -1, hi1Y = -1, hi2X = -1, hi2Y = -1; + int pm1X = -1, pm1Y = -1, pm2X = -1, pm2Y = -1; + + void + SetHighlights(fromX, fromY, toX, toY) + int fromX, fromY, toX, toY; + { + if (hi1X != fromX || hi1Y != fromY) { + if (hi1X >= 0 && hi1Y >= 0) { + drawHighlight(hi1X, hi1Y, lineGC); + } + if (fromX >= 0 && fromY >= 0) { + drawHighlight(fromX, fromY, highlineGC); + } + } + if (hi2X != toX || hi2Y != toY) { + if (hi2X >= 0 && hi2Y >= 0) { + drawHighlight(hi2X, hi2Y, lineGC); + } + if (toX >= 0 && toY >= 0) { + drawHighlight(toX, toY, highlineGC); + } + } + hi1X = fromX; + hi1Y = fromY; + hi2X = toX; + hi2Y = toY; + } + + void + ClearHighlights() + { + SetHighlights(-1, -1, -1, -1); + } + + + void + SetPremoveHighlights(fromX, fromY, toX, toY) + int fromX, fromY, toX, toY; + { + if (pm1X != fromX || pm1Y != fromY) { + if (pm1X >= 0 && pm1Y >= 0) { + drawHighlight(pm1X, pm1Y, lineGC); + } + if (fromX >= 0 && fromY >= 0) { + drawHighlight(fromX, fromY, prelineGC); + } + } + if (pm2X != toX || pm2Y != toY) { + if (pm2X >= 0 && pm2Y >= 0) { + drawHighlight(pm2X, pm2Y, lineGC); + } + if (toX >= 0 && toY >= 0) { + drawHighlight(toX, toY, prelineGC); + } + } + pm1X = fromX; + pm1Y = fromY; + pm2X = toX; + pm2Y = toY; + } + + void + ClearPremoveHighlights() + { + SetPremoveHighlights(-1, -1, -1, -1); + } + + static void BlankSquare(x, y, color, piece, dest) + int x, y, color; + ChessSquare piece; + Drawable dest; + { + if (useImages && useImageSqs) { + Pixmap pm; + switch (color) { + case 1: /* light */ + pm = xpmLightSquare; + break; + case 0: /* dark */ + pm = xpmDarkSquare; + break; + case 2: /* neutral */ + default: + pm = xpmJailSquare; + break; + } + XCopyArea(xDisplay, pm, dest, wlPieceGC, 0, 0, + squareSize, squareSize, x, y); + } else { + GC gc; + switch (color) { + case 1: /* light */ + gc = lightSquareGC; + break; + case 0: /* dark */ + gc = darkSquareGC; + break; + case 2: /* neutral */ + default: + gc = jailSquareGC; + break; + } + XFillRectangle(xDisplay, dest, gc, x, y, squareSize, squareSize); + } + } + + /* + I split out the routines to draw a piece so that I could + make a generic flash routine. + */ + static void monoDrawPiece_1bit(piece, square_color, x, y, dest) + ChessSquare piece; + int square_color, x, y; + Drawable dest; + { + /* Avoid XCopyPlane on 1-bit screens to work around Sun bug */ + switch (square_color) { + case 1: /* light */ + case 2: /* neutral */ + default: + XCopyArea(xDisplay, (int) piece < (int) BlackPawn + ? *pieceToOutline(piece) + : *pieceToSolid(piece), + dest, bwPieceGC, 0, 0, + squareSize, squareSize, x, y); + break; + case 0: /* dark */ + XCopyArea(xDisplay, (int) piece < (int) BlackPawn + ? *pieceToSolid(piece) + : *pieceToOutline(piece), + dest, wbPieceGC, 0, 0, + squareSize, squareSize, x, y); + break; + } + } + + static void monoDrawPiece(piece, square_color, x, y, dest) + ChessSquare piece; + int square_color, x, y; + Drawable dest; + { + switch (square_color) { + case 1: /* light */ + case 2: /* neutral */ + default: + XCopyPlane(xDisplay, (int) piece < (int) BlackPawn + ? *pieceToOutline(piece) + : *pieceToSolid(piece), + dest, bwPieceGC, 0, 0, + squareSize, squareSize, x, y, 1); + break; + case 0: /* dark */ + XCopyPlane(xDisplay, (int) piece < (int) BlackPawn + ? *pieceToSolid(piece) + : *pieceToOutline(piece), + dest, wbPieceGC, 0, 0, + squareSize, squareSize, x, y, 1); + break; + } + } + + static void colorDrawPiece(piece, square_color, x, y, dest) + ChessSquare piece; + int square_color, x, y; + Drawable dest; + { + if(pieceToSolid(piece) == NULL) return; // [HGM] bitmaps: make it non-fatal if we have no bitmap; + switch (square_color) { + case 1: /* light */ + XCopyPlane(xDisplay, *pieceToSolid(piece), + dest, (int) piece < (int) BlackPawn + ? wlPieceGC : blPieceGC, 0, 0, + squareSize, squareSize, x, y, 1); + break; + case 0: /* dark */ + XCopyPlane(xDisplay, *pieceToSolid(piece), + dest, (int) piece < (int) BlackPawn + ? wdPieceGC : bdPieceGC, 0, 0, + squareSize, squareSize, x, y, 1); + break; + case 2: /* neutral */ + default: + XCopyPlane(xDisplay, *pieceToSolid(piece), + dest, (int) piece < (int) BlackPawn + ? wjPieceGC : bjPieceGC, 0, 0, + squareSize, squareSize, x, y, 1); + break; + } + } + + static void colorDrawPieceImage(piece, square_color, x, y, dest) + ChessSquare piece; + int square_color, x, y; + Drawable dest; + { + int kind; + + switch (square_color) { + case 1: /* light */ + case 2: /* neutral */ + default: + if ((int)piece < (int) BlackPawn) { + kind = 0; + } else { + kind = 2; + piece -= BlackPawn; + } + break; + case 0: /* dark */ + if ((int)piece < (int) BlackPawn) { + kind = 1; + } else { + kind = 3; + piece -= BlackPawn; + } + break; + } + XCopyArea(xDisplay, xpmPieceBitmap[kind][piece], + dest, wlPieceGC, 0, 0, + squareSize, squareSize, x, y); + } + + typedef void (*DrawFunc)(); + + DrawFunc ChooseDrawFunc() + { + if (appData.monoMode) { + if (DefaultDepth(xDisplay, xScreen) == 1) { + return monoDrawPiece_1bit; + } else { + return monoDrawPiece; + } + } else { + if (useImages) + return colorDrawPieceImage; + else + return colorDrawPiece; + } + } + + /* [HR] determine square color depending on chess variant. */ + static int SquareColor(row, column) + int row, column; + { + int square_color; + + if (gameInfo.variant == VariantXiangqi) { + if (column >= 3 && column <= 5 && row >= 0 && row <= 2) { + square_color = 1; + } else if (column >= 3 && column <= 5 && row >= 7 && row <= 9) { + square_color = 0; + } else if (row <= 4) { + square_color = 0; + } else { + square_color = 1; + } + } else { + square_color = ((column + row) % 2) == 1; + } + + /* [hgm] holdings: next line makes all holdings squares light */ + if(column < BOARD_LEFT || column >= BOARD_RGHT) square_color = 1; + + return square_color; + } + + void DrawSquare(row, column, piece, do_flash) + int row, column, do_flash; + ChessSquare piece; + { + int square_color, x, y, direction, font_ascent, font_descent; + int i; + char string[2]; + XCharStruct overall; + DrawFunc drawfunc; + int flash_delay; + - if(gameInfo.variant == VariantShogi) { // [HGM] shogi: in shogi Q is used for Lance - if(piece == WhiteQueen) piece = WhiteLance; else - if(piece == BlackQueen) piece = BlackLance; - } -#ifdef GOTHIC - else if(gameInfo.variant == VariantGothic) { // [HGM] shogi: in Gothic Chancelor has alternative look - if(piece == WhiteMarshall) piece = WhiteSilver; else - if(piece == BlackMarshall) piece = BlackSilver; - } -#endif - ++ if(gameInfo.variant == VariantShogi) { // [HGM] shogi: in shogi Q is used for Lance ++ if(piece == WhiteQueen) piece = WhiteLance; else ++ if(piece == BlackQueen) piece = BlackLance; ++ } ++#ifdef GOTHIC ++ else if(gameInfo.variant == VariantGothic) { // [HGM] shogi: in Gothic Chancelor has alternative look ++ if(piece == WhiteMarshall) piece = WhiteSilver; else ++ if(piece == BlackMarshall) piece = BlackSilver; ++ } ++#endif ++ + /* Calculate delay in milliseconds (2-delays per complete flash) */ + flash_delay = 500 / appData.flashRate; + + if (flipView) { + x = lineGap + ((BOARD_WIDTH-1)-column) * + (squareSize + lineGap); + y = lineGap + row * (squareSize + lineGap); + } else { + x = lineGap + column * (squareSize + lineGap); + y = lineGap + ((BOARD_HEIGHT-1)-row) * + (squareSize + lineGap); + } + + square_color = SquareColor(row, column); + + if ( // [HGM] holdings: blank out area between board and holdings + column == BOARD_LEFT-1 || column == BOARD_RGHT + || (column == BOARD_LEFT-2 && row < BOARD_HEIGHT-gameInfo.holdingsSize) + || (column == BOARD_RGHT+1 && row >= gameInfo.holdingsSize) ) { - BlankSquare(x, y, 2, EmptySquare, xBoardWindow); ++ BlankSquare(x, y, 2, EmptySquare, xBoardWindow); + - // [HGM] print piece counts next to holdings ++ // [HGM] print piece counts next to holdings + string[1] = NULLCHAR; + if (column == (flipView ? BOARD_LEFT-1 : BOARD_RGHT) && piece > 1 ) { + string[0] = '0' + piece; + XTextExtents(countFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, countGC, + x + squareSize - overall.width - 2, + y + font_ascent + 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, countGC, + x + squareSize - overall.width - 2, + y + font_ascent + 1, string, 1); + } + } + if (column == (flipView ? BOARD_RGHT : BOARD_LEFT-1) && piece > 1) { + string[0] = '0' + piece; + XTextExtents(countFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, countGC, + x + 2, y + font_ascent + 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, countGC, + x + 2, y + font_ascent + 1, string, 1); + } + } + } else { + if (piece == EmptySquare || appData.blindfold) { + BlankSquare(x, y, square_color, piece, xBoardWindow); + } else { + drawfunc = ChooseDrawFunc(); + if (do_flash && appData.flashCount > 0) { + for (i=0; i= BOARD_LEFT && column < BOARD_RGHT) { + string[0] = 'a' + column - BOARD_LEFT; + XTextExtents(coordFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, coordGC, + x + squareSize - overall.width - 2, + y + squareSize - font_descent - 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, coordGC, + x + squareSize - overall.width - 2, + y + squareSize - font_descent - 1, string, 1); + } + } + if (appData.showCoords && column == (flipView ? BOARD_RGHT-1 : BOARD_LEFT)) { + string[0] = ONE + row; + XTextExtents(coordFontStruct, string, 1, &direction, + &font_ascent, &font_descent, &overall); + if (appData.monoMode) { + XDrawImageString(xDisplay, xBoardWindow, coordGC, + x + 2, y + font_ascent + 1, string, 1); + } else { + XDrawString(xDisplay, xBoardWindow, coordGC, + x + 2, y + font_ascent + 1, string, 1); + } + } + } + + + /* Why is this needed on some versions of X? */ + void EventProc(widget, unused, event) + Widget widget; + caddr_t unused; + XEvent *event; + { + if (!XtIsRealized(widget)) + return; + + switch (event->type) { + case Expose: + if (event->xexpose.count > 0) return; /* no clipping is done */ + XDrawPosition(widget, True, NULL); + break; + default: + return; + } + } + /* end why */ + + void DrawPosition(fullRedraw, board) + /*Boolean*/int fullRedraw; + Board board; + { + XDrawPosition(boardWidget, fullRedraw, board); + } + + /* Returns 1 if there are "too many" differences between b1 and b2 + (i.e. more than 1 move was made) */ + static int too_many_diffs(b1, b2) + Board b1, b2; + { + int i, j; + int c = 0; + + for (i=0; i 4) /* Castling causes 4 diffs */ + return 1; + } + } + } + + return 0; + } + + /* Matrix describing castling maneuvers */ + /* Row, ColRookFrom, ColKingFrom, ColRookTo, ColKingTo */ + static int castling_matrix[4][5] = { + { 0, 0, 4, 3, 2 }, /* 0-0-0, white */ + { 0, 7, 4, 5, 6 }, /* 0-0, white */ + { 7, 0, 4, 3, 2 }, /* 0-0-0, black */ + { 7, 7, 4, 5, 6 } /* 0-0, black */ + }; + + /* Checks whether castling occurred. If it did, *rrow and *rcol + are set to the destination (row,col) of the rook that moved. + + Returns 1 if castling occurred, 0 if not. + + Note: Only handles a max of 1 castling move, so be sure + to call too_many_diffs() first. + */ + static int check_castle_draw(newb, oldb, rrow, rcol) + Board newb, oldb; + int *rrow, *rcol; + { + int i, *r, j; + int match; + + /* For each type of castling... */ + for (i=0; i<4; ++i) { + r = castling_matrix[i]; + + /* Check the 4 squares involved in the castling move */ + match = 0; + for (j=1; j<=4; ++j) { + if (newb[r[0]][r[j]] == oldb[r[0]][r[j]]) { + match = 1; + break; + } + } + + if (!match) { + /* All 4 changed, so it must be a castling move */ + *rrow = r[0]; + *rcol = r[3]; + return 1; + } + } + return 0; + } + + static int damage[BOARD_SIZE][BOARD_SIZE]; + + /* + * event handler for redrawing the board + */ + void XDrawPosition(w, repaint, board) + Widget w; + /*Boolean*/int repaint; + Board board; + { + int i, j, do_flash; + static int lastFlipView = 0; + static int lastBoardValid = 0; + static Board lastBoard; + Arg args[16]; + int rrow, rcol; + + if (board == NULL) { + if (!lastBoardValid) return; + board = lastBoard; + } + if (!lastBoardValid || lastFlipView != flipView) { + XtSetArg(args[0], XtNleftBitmap, (flipView ? xMarkPixmap : None)); + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Flip View"), + args, 1); + } + + /* + * It would be simpler to clear the window with XClearWindow() + * but this causes a very distracting flicker. + */ + + if (!repaint && lastBoardValid && lastFlipView == flipView) { + + /* If too much changes (begin observing new game, etc.), don't + do flashing */ + do_flash = too_many_diffs(board, lastBoard) ? 0 : 1; + + /* Special check for castling so we don't flash both the king + and the rook (just flash the king). */ + if (do_flash) { + if (check_castle_draw(board, lastBoard, &rrow, &rcol)) { + /* Draw rook with NO flashing. King will be drawn flashing later */ + DrawSquare(rrow, rcol, board[rrow][rcol], 0); + lastBoard[rrow][rcol] = board[rrow][rcol]; + } + } + + /* First pass -- Draw (newly) empty squares and repair damage. + This prevents you from having a piece show up twice while it + is flashing on its new square */ + for (i = 0; i < BOARD_HEIGHT; i++) + for (j = 0; j < BOARD_WIDTH; j++) + if ((board[i][j] != lastBoard[i][j] && board[i][j] == EmptySquare) + || damage[i][j]) { + DrawSquare(i, j, board[i][j], 0); + damage[i][j] = False; + } + + /* Second pass -- Draw piece(s) in new position and flash them */ + for (i = 0; i < BOARD_HEIGHT; i++) + for (j = 0; j < BOARD_WIDTH; j++) + if (board[i][j] != lastBoard[i][j]) { + DrawSquare(i, j, board[i][j], do_flash); + } + } else { + if (lineGap > 0) + XDrawSegments(xDisplay, xBoardWindow, lineGC, + gridSegments, BOARD_HEIGHT + BOARD_WIDTH + 2); + + for (i = 0; i < BOARD_HEIGHT; i++) + for (j = 0; j < BOARD_WIDTH; j++) { + DrawSquare(i, j, board[i][j], 0); + damage[i][j] = False; + } + } + + CopyBoard(lastBoard, board); + lastBoardValid = 1; + lastFlipView = flipView; + + /* Draw highlights */ + if (pm1X >= 0 && pm1Y >= 0) { + drawHighlight(pm1X, pm1Y, prelineGC); + } + if (pm2X >= 0 && pm2Y >= 0) { + drawHighlight(pm2X, pm2Y, prelineGC); + } + if (hi1X >= 0 && hi1Y >= 0) { + drawHighlight(hi1X, hi1Y, highlineGC); + } + if (hi2X >= 0 && hi2Y >= 0) { + drawHighlight(hi2X, hi2Y, highlineGC); + } + + /* If piece being dragged around board, must redraw that too */ + DrawDragPiece(); + + XSync(xDisplay, False); + } + + + /* + * event handler for redrawing the board + */ + void DrawPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + XDrawPosition(w, True, NULL); + } + + + /* + * event handler for parsing user moves + */ + // [HGM] This routine will need quite some reworking. Although the backend still supports the old + // way of doing things, by calling UserMoveEvent() to test the legality of the move and then perform + // it at the end, and doing all kind of preliminary tests here (e.g. to weed out self-captures), it + // should be made to use the new way, of calling UserMoveTest early to determine the legality of the + // move, (which will weed out the illegal selfcaptures and moves into the holdings, and flag promotions), + // and at the end FinishMove() to perform the move after optional promotion popups. + // For now I patched it to allow self-capture with King, and suppress clicks between board and holdings. + void HandleUserMove(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + int x, y; + Boolean saveAnimate; + static int second = 0; + + if (w != boardWidget || errorExitStatus != -1) return; + + if (event->type == ButtonPress) ErrorPopDown(); + + if (promotionUp) { + if (event->type == ButtonPress) { + XtPopdown(promotionShell); + XtDestroyWidget(promotionShell); + promotionUp = False; + ClearHighlights(); + fromX = fromY = -1; + } else { + return; + } + } + + x = EventToSquare(event->xbutton.x, BOARD_WIDTH); + y = EventToSquare(event->xbutton.y, BOARD_HEIGHT); + if (!flipView && y >= 0) { + y = BOARD_HEIGHT - 1 - y; + } + if (flipView && x >= 0) { + x = BOARD_WIDTH - 1 - x; + } + + /* [HGM] holdings: next 5 lines: ignore all clicks between board and holdings */ + if(event->type == ButtonPress + && ( x == BOARD_LEFT-1 || x == BOARD_RGHT + || x == BOARD_LEFT-2 && y < BOARD_HEIGHT-gameInfo.holdingsSize + || x == BOARD_RGHT+1 && y >= gameInfo.holdingsSize) ) + return; + + if (fromX == -1) { + if (event->type == ButtonPress) { + /* First square */ + if (OKToStartUserMove(x, y)) { + fromX = x; + fromY = y; + second = 0; + DragPieceBegin(event->xbutton.x, event->xbutton.y); + if (appData.highlightDragging) { + SetHighlights(x, y, -1, -1); + } + } + } + return; + } + + /* fromX != -1 */ + if (event->type == ButtonPress && gameMode != EditPosition && + x >= 0 && y >= 0) { + ChessSquare fromP; + ChessSquare toP; + + /* Check if clicking again on the same color piece */ + fromP = boards[currentMove][fromY][fromX]; + toP = boards[currentMove][y][x]; + if ((WhitePawn <= fromP && fromP < WhiteKing && // [HGM] this test should go, as UserMoveTest now does it. + WhitePawn <= toP && toP <= WhiteKing) || // For now I made it less critical by exempting King + (BlackPawn <= fromP && fromP < BlackKing && // moves, to not interfere with FRC castlings. + BlackPawn <= toP && toP <= BlackKing)) { + /* Clicked again on same color piece -- changed his mind */ + second = (x == fromX && y == fromY); + if (appData.highlightDragging) { + SetHighlights(x, y, -1, -1); + } else { + ClearHighlights(); + } + if (OKToStartUserMove(x, y)) { + fromX = x; + fromY = y; + DragPieceBegin(event->xbutton.x, event->xbutton.y); + } + return; + } + } + + if (event->type == ButtonRelease && x == fromX && y == fromY) { + DragPieceEnd(event->xbutton.x, event->xbutton.y); + if (appData.animateDragging) { + /* Undo animation damage if any */ + DrawPosition(FALSE, NULL); + } + if (second) { + /* Second up/down in same square; just abort move */ + second = 0; + fromX = fromY = -1; + ClearHighlights(); + gotPremove = 0; + ClearPremoveHighlights(); + } else { + /* First upclick in same square; start click-click mode */ + SetHighlights(x, y, -1, -1); + } + return; + } + + /* Completed move */ + toX = x; + toY = y; + saveAnimate = appData.animate; + if (event->type == ButtonPress) { + /* Finish clickclick move */ + if (appData.animate || appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } else { + ClearHighlights(); + } + } else { + /* Finish drag move */ + if (appData.highlightLastMove) { + SetHighlights(fromX, fromY, toX, toY); + } else { + ClearHighlights(); + } + DragPieceEnd(event->xbutton.x, event->xbutton.y); + /* Don't animate move and drag both */ + appData.animate = FALSE; + } + if (IsPromotion(fromX, fromY, toX, toY)) { + if (appData.alwaysPromoteToQueen) { + UserMoveEvent(fromX, fromY, toX, toY, 'q'); + if (!appData.highlightLastMove || gotPremove) ClearHighlights(); + if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); + fromX = fromY = -1; + } else { + SetHighlights(fromX, fromY, toX, toY); + PromotionPopUp(); + } + } else { + UserMoveEvent(fromX, fromY, toX, toY, NULLCHAR); + if (!appData.highlightLastMove || gotPremove) ClearHighlights(); + if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); + fromX = fromY = -1; + } + appData.animate = saveAnimate; + if (appData.animate || appData.animateDragging) { + /* Undo animation damage if needed */ + DrawPosition(FALSE, NULL); + } + } + + void AnimateUserMove (Widget w, XEvent * event, + String * params, Cardinal * nParams) + { + DragPieceMove(event->xmotion.x, event->xmotion.y); + } + + Widget CommentCreate(name, text, mutable, callback, lines) + char *name, *text; + int /*Boolean*/ mutable; + XtCallbackProc callback; + int lines; + { + Arg args[16]; + Widget shell, layout, form, edit, b_ok, b_cancel, b_clear, b_close, b_edit; + Dimension bw_width; + int j; + + j = 0; + XtSetArg(args[j], XtNwidth, &bw_width); j++; + XtGetValues(boardWidget, args, j); + + j = 0; + XtSetArg(args[j], XtNresizable, True); j++; + #if TOPLEVEL + shell = + XtCreatePopupShell(name, topLevelShellWidgetClass, + shellWidget, args, j); + #else + shell = + XtCreatePopupShell(name, transientShellWidgetClass, + shellWidget, args, j); + #endif + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, shell, + layoutArgs, XtNumber(layoutArgs)); + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + j = 0; + if (mutable) { + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + } + XtSetArg(args[j], XtNstring, text); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, bw_width); j++; /*force wider than buttons*/ + #if 0 + XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; + #else + /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ + XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; + #endif + XtSetArg(args[j], XtNautoFill, True); j++; + XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; + edit = + XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); + + if (mutable) { + j = 0; + XtSetArg(args[j], XtNfromVert, edit); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_ok = - XtCreateManagedWidget("ok", commandWidgetClass, form, args, j); ++ XtCreateManagedWidget(_("ok"), commandWidgetClass, form, args, j); + XtAddCallback(b_ok, XtNcallback, callback, (XtPointer) 0); + + j = 0; + XtSetArg(args[j], XtNfromVert, edit); j++; + XtSetArg(args[j], XtNfromHoriz, b_ok); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_cancel = - XtCreateManagedWidget("cancel", commandWidgetClass, form, args, j); ++ XtCreateManagedWidget(_("cancel"), commandWidgetClass, form, args, j); + XtAddCallback(b_cancel, XtNcallback, callback, (XtPointer) 0); + + j = 0; + XtSetArg(args[j], XtNfromVert, edit); j++; + XtSetArg(args[j], XtNfromHoriz, b_cancel); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_clear = - XtCreateManagedWidget("clear", commandWidgetClass, form, args, j); ++ XtCreateManagedWidget(_("clear"), commandWidgetClass, form, args, j); + XtAddCallback(b_clear, XtNcallback, callback, (XtPointer) 0); + } else { + j = 0; + XtSetArg(args[j], XtNfromVert, edit); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_close = - XtCreateManagedWidget("close", commandWidgetClass, form, args, j); ++ XtCreateManagedWidget(_("close"), commandWidgetClass, form, args, j); + XtAddCallback(b_close, XtNcallback, callback, (XtPointer) 0); + + j = 0; + XtSetArg(args[j], XtNfromVert, edit); j++; + XtSetArg(args[j], XtNfromHoriz, b_close); j++; + XtSetArg(args[j], XtNtop, XtChainBottom); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainLeft); j++; + b_edit = - XtCreateManagedWidget("edit", commandWidgetClass, form, args, j); ++ XtCreateManagedWidget(_("edit"), commandWidgetClass, form, args, j); + XtAddCallback(b_edit, XtNcallback, callback, (XtPointer) 0); + } + + XtRealizeWidget(shell); + + if (commentX == -1) { + int xx, yy; + Window junk; + Dimension pw_height; + Dimension ew_height; + + j = 0; + XtSetArg(args[j], XtNheight, &ew_height); j++; + XtGetValues(edit, args, j); + + j = 0; + XtSetArg(args[j], XtNheight, &pw_height); j++; + XtGetValues(shell, args, j); + commentH = pw_height + (lines - 1) * ew_height; + commentW = bw_width - 16; + + XSync(xDisplay, False); + #ifdef NOTDEF + /* This code seems to tickle an X bug if it is executed too soon + after xboard starts up. The coordinates get transformed as if + the main window was positioned at (0, 0). + */ + XtTranslateCoords(shellWidget, + (bw_width - commentW) / 2, 0 - commentH / 2, + &commentX, &commentY); + #else /*!NOTDEF*/ + XTranslateCoordinates(xDisplay, XtWindow(shellWidget), + RootWindowOfScreen(XtScreen(shellWidget)), + (bw_width - commentW) / 2, 0 - commentH / 2, + &xx, &yy, &junk); + commentX = xx; + commentY = yy; + #endif /*!NOTDEF*/ + if (commentY < 0) commentY = 0; /*avoid positioning top offscreen*/ + } + j = 0; + XtSetArg(args[j], XtNheight, commentH); j++; + XtSetArg(args[j], XtNwidth, commentW); j++; + XtSetArg(args[j], XtNx, commentX); j++; + XtSetArg(args[j], XtNy, commentY); j++; + XtSetValues(shell, args, j); + XtSetKeyboardFocus(shell, edit); + + return shell; + } + + /* Used for analysis window and ICS input window */ + Widget MiscCreate(name, text, mutable, callback, lines) + char *name, *text; + int /*Boolean*/ mutable; + XtCallbackProc callback; + int lines; + { + Arg args[16]; + Widget shell, layout, form, edit; + Position x, y; + Dimension bw_width, pw_height, ew_height, w, h; + int j; + int xx, yy; + Window junk; + + j = 0; + XtSetArg(args[j], XtNresizable, True); j++; + #if TOPLEVEL + shell = + XtCreatePopupShell(name, topLevelShellWidgetClass, + shellWidget, args, j); + #else + shell = + XtCreatePopupShell(name, transientShellWidgetClass, + shellWidget, args, j); + #endif + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, shell, + layoutArgs, XtNumber(layoutArgs)); + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + + j = 0; + if (mutable) { + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + } + XtSetArg(args[j], XtNstring, text); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + #if 0 + XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; + #else + /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ + XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; + #endif + XtSetArg(args[j], XtNautoFill, True); j++; + XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; + edit = + XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); + + XtRealizeWidget(shell); + + j = 0; + XtSetArg(args[j], XtNwidth, &bw_width); j++; + XtGetValues(boardWidget, args, j); + + j = 0; + XtSetArg(args[j], XtNheight, &ew_height); j++; + XtGetValues(edit, args, j); + + j = 0; + XtSetArg(args[j], XtNheight, &pw_height); j++; + XtGetValues(shell, args, j); + h = pw_height + (lines - 1) * ew_height; + w = bw_width - 16; + + XSync(xDisplay, False); + #ifdef NOTDEF + /* This code seems to tickle an X bug if it is executed too soon + after xboard starts up. The coordinates get transformed as if + the main window was positioned at (0, 0). + */ + XtTranslateCoords(shellWidget, (bw_width - w) / 2, 0 - h / 2, &x, &y); + #else /*!NOTDEF*/ + XTranslateCoordinates(xDisplay, XtWindow(shellWidget), + RootWindowOfScreen(XtScreen(shellWidget)), + (bw_width - w) / 2, 0 - h / 2, &xx, &yy, &junk); + #endif /*!NOTDEF*/ + x = xx; + y = yy; + if (y < 0) y = 0; /*avoid positioning top offscreen*/ + + j = 0; + XtSetArg(args[j], XtNheight, h); j++; + XtSetArg(args[j], XtNwidth, w); j++; + XtSetArg(args[j], XtNx, x); j++; + XtSetArg(args[j], XtNy, y); j++; + XtSetValues(shell, args, j); + + return shell; + } + + + static int savedIndex; /* gross that this is global */ + + void EditCommentPopUp(index, title, text) + int index; + char *title, *text; + { + Widget edit; + Arg args[16]; + int j; + + savedIndex = index; + if (text == NULL) text = ""; + + if (editShell == NULL) { + editShell = + CommentCreate(title, text, True, EditCommentCallback, 4); + XtRealizeWidget(editShell); + CatchDeleteWindow(editShell, "EditCommentPopDown"); + } else { + edit = XtNameToWidget(editShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, text); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(editShell, args, j); + } + + XtPopup(editShell, XtGrabNone); + + editUp = True; + j = 0; + XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Edit Comment"), + args, j); + } + + void EditCommentCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + String name, val; + Arg args[16]; + int j; + Widget edit; + + j = 0; + XtSetArg(args[j], XtNlabel, &name); j++; + XtGetValues(w, args, j); + - if (strcmp(name, "ok") == 0) { ++ if (strcmp(name, _("ok")) == 0) { + edit = XtNameToWidget(editShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, &val); j++; + XtGetValues(edit, args, j); + ReplaceComment(savedIndex, val); + EditCommentPopDown(); - } else if (strcmp(name, "cancel") == 0) { ++ } else if (strcmp(name, _("cancel")) == 0) { + EditCommentPopDown(); - } else if (strcmp(name, "clear") == 0) { ++ } else if (strcmp(name, _("clear")) == 0) { + edit = XtNameToWidget(editShell, "*form.text"); + XtCallActionProc(edit, "select-all", NULL, NULL, 0); + XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); + } + } + + void EditCommentPopDown() + { + Arg args[16]; + int j; + + if (!editUp) return; + j = 0; + XtSetArg(args[j], XtNx, &commentX); j++; + XtSetArg(args[j], XtNy, &commentY); j++; + XtSetArg(args[j], XtNheight, &commentH); j++; + XtSetArg(args[j], XtNwidth, &commentW); j++; + XtGetValues(editShell, args, j); + XtPopdown(editShell); + editUp = False; + j = 0; + XtSetArg(args[j], XtNleftBitmap, None); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Edit Comment"), + args, j); + } + + void ICSInputBoxPopUp() + { + Widget edit; + Arg args[16]; + int j; - char *title = "ICS Input"; ++ char *title = _("ICS Input"); + XtTranslations tr; + + if (ICSInputShell == NULL) { + ICSInputShell = MiscCreate(title, "", True, NULL, 1); + tr = XtParseTranslationTable(ICSInputTranslations); + edit = XtNameToWidget(ICSInputShell, "*form.text"); + XtOverrideTranslations(edit, tr); + XtRealizeWidget(ICSInputShell); + CatchDeleteWindow(ICSInputShell, "ICSInputBoxPopDown"); + + } else { + edit = XtNameToWidget(ICSInputShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, ""); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(ICSInputShell, args, j); + } + + XtPopup(ICSInputShell, XtGrabNone); + XtSetKeyboardFocus(ICSInputShell, edit); + + ICSInputBoxUp = True; + j = 0; + XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.ICS Input Box"), + args, j); + } + + void ICSInputSendText() + { + Widget edit; + int j; + Arg args[16]; + String val; + + edit = XtNameToWidget(ICSInputShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, &val); j++; + XtGetValues(edit, args, j); + SendMultiLineToICS(val); + XtCallActionProc(edit, "select-all", NULL, NULL, 0); + XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); + } + + void ICSInputBoxPopDown() + { + Arg args[16]; + int j; + + if (!ICSInputBoxUp) return; + j = 0; + XtPopdown(ICSInputShell); + ICSInputBoxUp = False; + j = 0; + XtSetArg(args[j], XtNleftBitmap, None); j++; + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.ICS Input Box"), + args, j); + } + + void CommentPopUp(title, text) + char *title, *text; + { + Arg args[16]; + int j; + Widget edit; + + if (commentShell == NULL) { + commentShell = + CommentCreate(title, text, False, CommentCallback, 4); + XtRealizeWidget(commentShell); + CatchDeleteWindow(commentShell, "CommentPopDown"); + } else { + edit = XtNameToWidget(commentShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, text); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(commentShell, args, j); + } + + XtPopup(commentShell, XtGrabNone); + XSync(xDisplay, False); + + commentUp = True; + } + + void AnalysisPopUp(title, text) + char *title, *text; + { + Arg args[16]; + int j; + Widget edit; + + if (analysisShell == NULL) { + analysisShell = MiscCreate(title, text, False, NULL, 4); + XtRealizeWidget(analysisShell); + CatchDeleteWindow(analysisShell, "AnalysisPopDown"); + + } else { + edit = XtNameToWidget(analysisShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, text); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(analysisShell, args, j); + } + + if (!analysisUp) { + XtPopup(analysisShell, XtGrabNone); + } + XSync(xDisplay, False); + + analysisUp = True; + } + + void CommentCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + String name; + Arg args[16]; + int j; + + j = 0; + XtSetArg(args[j], XtNlabel, &name); j++; + XtGetValues(w, args, j); + - if (strcmp(name, "close") == 0) { ++ if (strcmp(name, _("close")) == 0) { + CommentPopDown(); - } else if (strcmp(name, "edit") == 0) { ++ } else if (strcmp(name, _("edit")) == 0) { + CommentPopDown(); + EditCommentEvent(); + } + } + + + void CommentPopDown() + { + Arg args[16]; + int j; + + if (!commentUp) return; + j = 0; + XtSetArg(args[j], XtNx, &commentX); j++; + XtSetArg(args[j], XtNy, &commentY); j++; + XtSetArg(args[j], XtNwidth, &commentW); j++; + XtSetArg(args[j], XtNheight, &commentH); j++; + XtGetValues(commentShell, args, j); + XtPopdown(commentShell); + XSync(xDisplay, False); + commentUp = False; + } + + void AnalysisPopDown() + { + if (!analysisUp) return; + XtPopdown(analysisShell); + XSync(xDisplay, False); + analysisUp = False; ++ if (appData.icsEngineAnalyze) ExitAnalyzeMode(); /* [DM] icsEngineAnalyze */ + } + + + void FileNamePopUp(label, def, proc, openMode) + char *label; + char *def; + FileProc proc; + char *openMode; + { + Arg args[16]; + Widget popup, layout, dialog, edit; + Window root, child; + int x, y, i; + int win_x, win_y; + unsigned int mask; + + fileProc = proc; /* I can't see a way not */ + fileOpenMode = openMode; /* to use globals here */ + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; + XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; ++ XtSetArg(args[i], XtNtitle, XtNewString(_("File name prompt"))); i++; + fileNameShell = popup = + XtCreatePopupShell("File name prompt", transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + i = 0; + XtSetArg(args[i], XtNlabel, label); i++; + XtSetArg(args[i], XtNvalue, def); i++; + XtSetArg(args[i], XtNborderWidth, 0); i++; + dialog = XtCreateManagedWidget("fileName", dialogWidgetClass, + layout, args, i); + - XawDialogAddButton(dialog, "ok", FileNameCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, "cancel", FileNameCallback, ++ XawDialogAddButton(dialog, _("ok"), FileNameCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("cancel"), FileNameCallback, + (XtPointer) dialog); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "FileNamePopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + filenameUp = True; + + edit = XtNameToWidget(dialog, "*value"); + XtSetKeyboardFocus(popup, edit); + } + + void FileNamePopDown() + { + if (!filenameUp) return; + XtPopdown(fileNameShell); + XtDestroyWidget(fileNameShell); + filenameUp = False; + ModeHighlight(); + } + + void FileNameCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + String name; + Arg args[16]; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + - if (strcmp(name, "cancel") == 0) { ++ if (strcmp(name, _("cancel")) == 0) { + FileNamePopDown(); + return; + } + + FileNameAction(w, NULL, NULL, NULL); + } + + void FileNameAction(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + char buf[MSG_SIZ]; + String name; + FILE *f; + char *p, *fullname; + int index; + + name = XawDialogGetValueString(w = XtParent(w)); + + if ((name != NULL) && (*name != NULLCHAR)) { + strcpy(buf, name); + XtPopdown(w = XtParent(XtParent(w))); + XtDestroyWidget(w); + filenameUp = False; + + p = strrchr(buf, ' '); + if (p == NULL) { + index = 0; + } else { + *p++ = NULLCHAR; + index = atoi(p); + } + fullname = ExpandPathName(buf); + if (!fullname) { - ErrorPopUp("Error", "Can't open file", FALSE); ++ ErrorPopUp(_("Error"), _("Can't open file"), FALSE); + } + else { + f = fopen(fullname, fileOpenMode); + if (f == NULL) { - DisplayError("Failed to open file", errno); ++ DisplayError(_("Failed to open file"), errno); + } else { + (void) (*fileProc)(f, index, buf); + } + } + ModeHighlight(); + return; + } + + XtPopdown(w = XtParent(XtParent(w))); + XtDestroyWidget(w); + filenameUp = False; + ModeHighlight(); + } + + void PromotionPopUp() + { + Arg args[16]; + Widget dialog, layout; + Position x, y; + Dimension bw_width, pw_width; + int j; + + j = 0; + XtSetArg(args[j], XtNwidth, &bw_width); j++; + XtGetValues(boardWidget, args, j); + + j = 0; + XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNtitle, XtNewString(_("Promotion"))); j++; + promotionShell = + XtCreatePopupShell("Promotion", transientShellWidgetClass, + shellWidget, args, j); + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, promotionShell, + layoutArgs, XtNumber(layoutArgs)); + + j = 0; - XtSetArg(args[j], XtNlabel, "Promote pawn to what?"); j++; ++ XtSetArg(args[j], XtNlabel, _("Promote pawn to what?")); j++; + XtSetArg(args[j], XtNborderWidth, 0); j++; + dialog = XtCreateManagedWidget("promotion", dialogWidgetClass, + layout, args, j); + - XawDialogAddButton(dialog, "Queen", PromotionCallback, ++ XawDialogAddButton(dialog, _("Queen"), PromotionCallback, + (XtPointer) dialog); - XawDialogAddButton(dialog, "Rook", PromotionCallback, ++ XawDialogAddButton(dialog, _("Rook"), PromotionCallback, + (XtPointer) dialog); - XawDialogAddButton(dialog, "Bishop", PromotionCallback, ++ XawDialogAddButton(dialog, _("Bishop"), PromotionCallback, + (XtPointer) dialog); - XawDialogAddButton(dialog, "Knight", PromotionCallback, ++ XawDialogAddButton(dialog, _("Knight"), PromotionCallback, + (XtPointer) dialog); + if (!appData.testLegality || gameInfo.variant == VariantSuicide || + gameInfo.variant == VariantGiveaway) { - XawDialogAddButton(dialog, "King", PromotionCallback, ++ XawDialogAddButton(dialog, _("King"), PromotionCallback, + (XtPointer) dialog); + } - XawDialogAddButton(dialog, "cancel", PromotionCallback, ++ XawDialogAddButton(dialog, _("cancel"), PromotionCallback, + (XtPointer) dialog); + + XtRealizeWidget(promotionShell); + CatchDeleteWindow(promotionShell, "PromotionPopDown"); + + j = 0; + XtSetArg(args[j], XtNwidth, &pw_width); j++; + XtGetValues(promotionShell, args, j); + + XtTranslateCoords(boardWidget, (bw_width - pw_width) / 2, + lineGap + squareSize/3 + + ((toY == BOARD_HEIGHT-1) ^ (flipView) ? + 0 : 6*(squareSize + lineGap)), &x, &y); + + j = 0; + XtSetArg(args[j], XtNx, x); j++; + XtSetArg(args[j], XtNy, y); j++; + XtSetValues(promotionShell, args, j); + + XtPopup(promotionShell, XtGrabNone); + + promotionUp = True; + } + + void PromotionPopDown() + { + if (!promotionUp) return; + XtPopdown(promotionShell); + XtDestroyWidget(promotionShell); + promotionUp = False; + } + + void PromotionCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + String name; + Arg args[16]; + int promoChar; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + + PromotionPopDown(); + + if (fromX == -1) return; + - if (strcmp(name, "cancel") == 0) { ++ if (strcmp(name, _("cancel")) == 0) { + fromX = fromY = -1; + ClearHighlights(); + return; - } else if (strcmp(name, "Knight") == 0) { ++ } else if (strcmp(name, _("Knight")) == 0) { + promoChar = 'n'; + } else { + promoChar = ToLower(name[0]); + } + + UserMoveEvent(fromX, fromY, toX, toY, promoChar); + + if (!appData.highlightLastMove || gotPremove) ClearHighlights(); + if (gotPremove) SetPremoveHighlights(fromX, fromY, toX, toY); + fromX = fromY = -1; + } + + + void ErrorCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + errorUp = False; + XtPopdown(w = XtParent(XtParent(XtParent(w)))); + XtDestroyWidget(w); + if (errorExitStatus != -1) ExitEvent(errorExitStatus); + } + + + void ErrorPopDown() + { + if (!errorUp) return; + errorUp = False; + XtPopdown(errorShell); + XtDestroyWidget(errorShell); + if (errorExitStatus != -1) ExitEvent(errorExitStatus); + } + + void ErrorPopUp(title, label, modal) + char *title, *label; + int modal; + { + Arg args[16]; + Widget dialog, layout; + Position x, y; + int xx, yy; + Window junk; + Dimension bw_width, pw_width; + Dimension pw_height; + int i; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; + XtSetArg(args[i], XtNtitle, title); i++; + errorShell = + XtCreatePopupShell("errorpopup", transientShellWidgetClass, + shellWidget, args, i); + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, errorShell, + layoutArgs, XtNumber(layoutArgs)); + + i = 0; + XtSetArg(args[i], XtNlabel, label); i++; + XtSetArg(args[i], XtNborderWidth, 0); i++; + dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, + layout, args, i); + - XawDialogAddButton(dialog, "ok", ErrorCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("ok"), ErrorCallback, (XtPointer) dialog); + + XtRealizeWidget(errorShell); + CatchDeleteWindow(errorShell, "ErrorPopDown"); + + i = 0; + XtSetArg(args[i], XtNwidth, &bw_width); i++; + XtGetValues(boardWidget, args, i); + i = 0; + XtSetArg(args[i], XtNwidth, &pw_width); i++; + XtSetArg(args[i], XtNheight, &pw_height); i++; + XtGetValues(errorShell, args, i); + + #ifdef NOTDEF + /* This code seems to tickle an X bug if it is executed too soon + after xboard starts up. The coordinates get transformed as if + the main window was positioned at (0, 0). + */ + XtTranslateCoords(boardWidget, (bw_width - pw_width) / 2, + 0 - pw_height + squareSize / 3, &x, &y); + #else + XTranslateCoordinates(xDisplay, XtWindow(boardWidget), + RootWindowOfScreen(XtScreen(boardWidget)), + (bw_width - pw_width) / 2, + 0 - pw_height + squareSize / 3, &xx, &yy, &junk); + x = xx; + y = yy; + #endif + if (y < 0) y = 0; /*avoid positioning top offscreen*/ + + i = 0; + XtSetArg(args[i], XtNx, x); i++; + XtSetArg(args[i], XtNy, y); i++; + XtSetValues(errorShell, args, i); + + errorUp = True; + XtPopup(errorShell, modal ? XtGrabExclusive : XtGrabNone); + } + + /* Disable all user input other than deleting the window */ + static int frozen = 0; + void FreezeUI() + { + if (frozen) return; + /* Grab by a widget that doesn't accept input */ + XtAddGrab(messageWidget, TRUE, FALSE); + frozen = 1; + } + + /* Undo a FreezeUI */ + void ThawUI() + { + if (!frozen) return; + XtRemoveGrab(messageWidget); + frozen = 0; + } + + char *ModeToWidgetName(mode) + GameMode mode; + { + switch (mode) { + case BeginningOfGame: + if (appData.icsActive) + return "menuMode.ICS Client"; + else if (appData.noChessProgram || + *appData.cmailGameName != NULLCHAR) + return "menuMode.Edit Game"; + else + return "menuMode.Machine Black"; + case MachinePlaysBlack: + return "menuMode.Machine Black"; + case MachinePlaysWhite: + return "menuMode.Machine White"; + case AnalyzeMode: + return "menuMode.Analysis Mode"; + case AnalyzeFile: + return "menuMode.Analyze File"; + case TwoMachinesPlay: + return "menuMode.Two Machines"; + case EditGame: + return "menuMode.Edit Game"; + case PlayFromGameFile: + return "menuFile.Load Game"; + case EditPosition: + return "menuMode.Edit Position"; + case Training: + return "menuMode.Training"; + case IcsPlayingWhite: + case IcsPlayingBlack: + case IcsObserving: + case IcsIdle: + case IcsExamining: + return "menuMode.ICS Client"; + default: + case EndOfGame: + return NULL; + } + } + + void ModeHighlight() + { + Arg args[16]; + static int oldPausing = FALSE; + static GameMode oldmode = (GameMode) -1; + char *wname; + + if (!boardWidget || !XtIsRealized(boardWidget)) return; + + if (pausing != oldPausing) { + oldPausing = pausing; + if (pausing) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Pause"), + args, 1); + + if (appData.showButtonBar) { + #if 0 + if (pausing) { + XtSetArg(args[0], XtNbackground, buttonForegroundPixel); + XtSetArg(args[1], XtNforeground, buttonBackgroundPixel); + } else { + XtSetArg(args[0], XtNbackground, buttonBackgroundPixel); + XtSetArg(args[1], XtNforeground, buttonForegroundPixel); + } + #else + /* Always toggle, don't set. Previous code messes up when + invoked while the button is pressed, as releasing it + toggles the state again. */ + { + Pixel oldbg, oldfg; + XtSetArg(args[0], XtNbackground, &oldbg); + XtSetArg(args[1], XtNforeground, &oldfg); + XtGetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), + args, 2); + XtSetArg(args[0], XtNbackground, oldfg); + XtSetArg(args[1], XtNforeground, oldbg); + } + #endif + XtSetValues(XtNameToWidget(buttonBarWidget, PAUSE_BUTTON), args, 2); + } + } + + wname = ModeToWidgetName(oldmode); + if (wname != NULL) { + XtSetArg(args[0], XtNleftBitmap, None); + XtSetValues(XtNameToWidget(menuBarWidget, wname), args, 1); + } + wname = ModeToWidgetName(gameMode); + if (wname != NULL) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + XtSetValues(XtNameToWidget(menuBarWidget, wname), args, 1); + } + oldmode = gameMode; + + /* Maybe all the enables should be handled here, not just this one */ + XtSetSensitive(XtNameToWidget(menuBarWidget, "menuMode.Training"), + gameMode == Training || gameMode == PlayFromGameFile); + } + + + /* + * Button/menu procedures + */ + void ResetProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ResetGameEvent(); + AnalysisPopDown(); + } + + int LoadGamePopUp(f, gameNumber, title) + FILE *f; + int gameNumber; + char *title; + { + cmailMsgLoaded = FALSE; + if (gameNumber == 0) { + int error = GameListBuild(f); + if (error) { - DisplayError("Cannot build game list", error); ++ DisplayError(_("Cannot build game list"), error); + } else if (!ListEmpty(&gameList) && + ((ListGame *) gameList.tailPred)->number > 1) { + GameListPopUp(f, title); + return TRUE; + } + GameListDestroy(); + gameNumber = 1; + } + return LoadGame(f, gameNumber, title, FALSE); + } + + void LoadGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + Reset(FALSE, TRUE); + } - FileNamePopUp("Load game file name?", "", LoadGamePopUp, "rb"); ++ FileNamePopUp(_("Load game file name?"), "", LoadGamePopUp, "rb"); + } + + void LoadNextGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadGame(1); + } + + void LoadPrevGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadGame(-1); + } + + void ReloadGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadGame(0); + } + + void LoadNextPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadPosition(1); + } + + void LoadPrevPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadPosition(-1); + } + + void ReloadPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadPosition(0); + } + + void LoadPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { + Reset(FALSE, TRUE); + } - FileNamePopUp("Load position file name?", "", LoadPosition, "rb"); ++ FileNamePopUp(_("Load position file name?"), "", LoadPosition, "rb"); + } + + void SaveGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { - FileNamePopUp("Save game file name?", ++ FileNamePopUp(_("Save game file name?"), + DefaultFileName(appData.oldSaveStyle ? "game" : "pgn"), + SaveGame, "a"); + } + + void SavePositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { - FileNamePopUp("Save position file name?", ++ FileNamePopUp(_("Save position file name?"), + DefaultFileName(appData.oldSaveStyle ? "pos" : "fen"), + SavePosition, "a"); + } + + void ReloadCmailMsgProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ReloadCmailMsgEvent(FALSE); + } + + void MailMoveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + MailMoveEvent(); + } + + /* this variable is shared between CopyPositionProc and SendPositionSelection */ + static char *selected_fen_position=NULL; + + static Boolean + SendPositionSelection(Widget w, Atom *selection, Atom *target, + Atom *type_return, XtPointer *value_return, + unsigned long *length_return, int *format_return) + { + char *selection_tmp; + + if (!selected_fen_position) return False; /* should never happen */ + if (*target == XA_STRING){ + /* note: since no XtSelectionDoneProc was registered, Xt will + * automatically call XtFree on the value returned. So have to + * make a copy of it allocated with XtMalloc */ + selection_tmp= XtMalloc(strlen(selected_fen_position)+16); + strcpy(selection_tmp, selected_fen_position); + + *value_return=selection_tmp; + *length_return=strlen(selection_tmp); + *type_return=XA_STRING; + *format_return = 8; /* bits per byte */ + return True; + } else { + return False; + } + } + + /* note: when called from menu all parameters are NULL, so no clue what the + * Widget which was clicked on was, or what the click event was + */ + void CopyPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + int ret; + + if (selected_fen_position) free(selected_fen_position); + selected_fen_position = (char *)PositionToFEN(currentMove,1); + if (!selected_fen_position) return; + ret = XtOwnSelection(menuBarWidget, XA_PRIMARY, + CurrentTime, + SendPositionSelection, + NULL/* lose_ownership_proc */ , + NULL/* transfer_done_proc */); + if (!ret) { + free(selected_fen_position); + selected_fen_position=NULL; + } + } + + /* function called when the data to Paste is ready */ + static void + PastePositionCB(Widget w, XtPointer client_data, Atom *selection, + Atom *type, XtPointer value, unsigned long *len, int *format) + { + char *fenstr=value; + if (value==NULL || *len==0) return; /* nothing had been selected to copy */ + fenstr[*len]='\0'; /* normally this string is terminated, but be safe */ + EditPositionPasteFEN(fenstr); + XtFree(value); + } + + /* called when Paste Position button is pressed, + * all parameters will be NULL */ + void PastePositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + XtGetSelectionValue(menuBarWidget, XA_PRIMARY, XA_STRING, + /* (XtSelectionCallbackProc) */ PastePositionCB, + NULL, /* client_data passed to PastePositionCB */ + + /* better to use the time field from the event that triggered the + * call to this function, but that isn't trivial to get + */ + CurrentTime + ); + return; + } + + static Boolean + SendGameSelection(Widget w, Atom *selection, Atom *target, + Atom *type_return, XtPointer *value_return, + unsigned long *length_return, int *format_return) + { + char *selection_tmp; + + if (*target == XA_STRING){ + FILE* f = fopen(gameCopyFilename, "r"); + long len; + size_t count; + if (f == NULL) return False; + fseek(f, 0, 2); + len = ftell(f); + rewind(f); + selection_tmp = XtMalloc(len + 1); + count = fread(selection_tmp, 1, len, f); + if (len != count) { + XtFree(selection_tmp); + return False; + } + selection_tmp[len] = NULLCHAR; + *value_return = selection_tmp; + *length_return = len; + *type_return = XA_STRING; + *format_return = 8; /* bits per byte */ + return True; + } else { + return False; + } + } + + /* note: when called from menu all parameters are NULL, so no clue what the + * Widget which was clicked on was, or what the click event was + */ + void CopyGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + int ret; + + ret = SaveGameToFile(gameCopyFilename, FALSE); + if (!ret) return; + + ret = XtOwnSelection(menuBarWidget, XA_PRIMARY, + CurrentTime, + SendGameSelection, + NULL/* lose_ownership_proc */ , + NULL/* transfer_done_proc */); + } + + /* function called when the data to Paste is ready */ + static void + PasteGameCB(Widget w, XtPointer client_data, Atom *selection, + Atom *type, XtPointer value, unsigned long *len, int *format) + { + FILE* f; + if (value == NULL || *len == 0) { + return; /* nothing had been selected to copy */ + } + f = fopen(gamePasteFilename, "w"); + if (f == NULL) { - DisplayError("Can't open temp file", errno); ++ DisplayError(_("Can't open temp file"), errno); + return; + } + fwrite(value, 1, *len, f); + fclose(f); + XtFree(value); + LoadGameFromFile(gamePasteFilename, 0, gamePasteFilename, TRUE); + } + + /* called when Paste Game button is pressed, + * all parameters will be NULL */ + void PasteGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + XtGetSelectionValue(menuBarWidget, XA_PRIMARY, XA_STRING, + /* (XtSelectionCallbackProc) */ PasteGameCB, + NULL, /* client_data passed to PasteGameCB */ + + /* better to use the time field from the event that triggered the + * call to this function, but that isn't trivial to get + */ + CurrentTime + ); + return; + } + + + void AutoSaveGame() + { + SaveGameProc(NULL, NULL, NULL, NULL); + } + + + void QuitProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ExitEvent(0); + } + + void PauseProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + PauseEvent(); + } + + + void MachineBlackProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + MachineBlackEvent(); + } + + void MachineWhiteProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + MachineWhiteEvent(); + } + + void AnalyzeModeProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { ++ char buf[MSG_SIZ]; ++ + if (!first.analysisSupport) { - char buf[MSG_SIZ]; - sprintf(buf, "%s does not support analysis", first.tidy); ++ sprintf(buf, _("%s does not support analysis"), first.tidy); + DisplayError(buf, 0); + return; + } ++ /* [DM] icsEngineAnalyze [HGM] This is horrible code; reverse the gameMode and isEngineAnalyze tests! */ ++ if (appData.icsActive) { ++ if (gameMode != IcsObserving) { ++ sprintf(buf,_("You are not observing a game")); ++ DisplayError(buf, 0); ++ /* secure check */ ++ if (appData.icsEngineAnalyze) { ++ if (appData.debugMode) ++ fprintf(debugFP, _("Found unexpected active ICS engine analyze \n")); ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ } ++ return; ++ } ++ /* if enable, use want disable icsEngineAnalyze */ ++ if (appData.icsEngineAnalyze) { ++ ExitAnalyzeMode(); ++ ModeHighlight(); ++ return; ++ } ++ appData.icsEngineAnalyze = TRUE; ++ if (appData.debugMode) ++ fprintf(debugFP, _("ICS engine analyze starting... \n")); ++ } + if (!appData.showThinking) + ShowThinkingProc(w,event,prms,nprms); + + AnalyzeModeEvent(); + } + + void AnalyzeFileProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (!first.analysisSupport) { + char buf[MSG_SIZ]; - sprintf(buf, "%s does not support analysis", first.tidy); ++ sprintf(buf, _("%s does not support analysis"), first.tidy); + DisplayError(buf, 0); + return; + } + Reset(FALSE, TRUE); + + if (!appData.showThinking) + ShowThinkingProc(w,event,prms,nprms); + + AnalyzeFileEvent(); - FileNamePopUp("File to analyze", "", LoadGamePopUp, "rb"); ++ FileNamePopUp(_("File to analyze"), "", LoadGamePopUp, "rb"); + AnalysisPeriodicEvent(1); + } + + void TwoMachinesProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + TwoMachinesEvent(); + } + + void IcsClientProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + IcsClientEvent(); + } + + void EditGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + EditGameEvent(); + } + + void EditPositionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + EditPositionEvent(); + } + + void TrainingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + TrainingEvent(); + } + + void EditCommentProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (editUp) { + EditCommentPopDown(); + } else { + EditCommentEvent(); + } + } + + void IcsInputBoxProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (ICSInputBoxUp) { + ICSInputBoxPopDown(); + } else { + ICSInputBoxPopUp(); + } + } + + void AcceptProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + AcceptEvent(); + } + + void DeclineProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + DeclineEvent(); + } + + void RematchProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + RematchEvent(); + } + + void CallFlagProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + CallFlagEvent(); + } + + void DrawProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + DrawEvent(); + } + + void AbortProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + AbortEvent(); + } + + void AdjournProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + AdjournEvent(); + } + + void ResignProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ResignEvent(); + } + + void EnterKeyProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (ICSInputBoxUp == True) + ICSInputSendText(); + } + + void StopObservingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + StopObservingEvent(); + } + + void StopExaminingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + StopExaminingEvent(); + } + + + void ForwardProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ForwardEvent(); + } + + + void BackwardProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + BackwardEvent(); + } + + void ToStartProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ToStartEvent(); + } + + void ToEndProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + ToEndEvent(); + } + + void RevertProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + RevertEvent(); + } + + void TruncateGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + TruncateGameEvent(); + } + void RetractMoveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + RetractMoveEvent(); + } + + void MoveNowProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + MoveNowEvent(); + } + + + void AlwaysQueenProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.alwaysPromoteToQueen = !appData.alwaysPromoteToQueen; + + if (appData.alwaysPromoteToQueen) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Always Queen"), + args, 1); + } + + void AnimateDraggingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.animateDragging = !appData.animateDragging; + + if (appData.animateDragging) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + CreateAnimVars(); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Dragging"), + args, 1); + } + + void AnimateMovingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.animate = !appData.animate; + + if (appData.animate) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + CreateAnimVars(); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Animate Moving"), + args, 1); + } + + void AutocommProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoComment = !appData.autoComment; + + if (appData.autoComment) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Comment"), + args, 1); + } + + + void AutoflagProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoCallFlag = !appData.autoCallFlag; + + if (appData.autoCallFlag) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flag"), + args, 1); + } + + void AutoflipProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoFlipView = !appData.autoFlipView; + + if (appData.autoFlipView) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Flip View"), + args, 1); + } + + void AutobsProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoObserve = !appData.autoObserve; + + if (appData.autoObserve) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Observe"), + args, 1); + } + + void AutoraiseProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoRaiseBoard = !appData.autoRaiseBoard; + + if (appData.autoRaiseBoard) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Raise Board"), + args, 1); + } + + void AutosaveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.autoSaveGames = !appData.autoSaveGames; + + if (appData.autoSaveGames) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Auto Save"), + args, 1); + } + + void BlindfoldProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.blindfold = !appData.blindfold; + + if (appData.blindfold) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Blindfold"), + args, 1); + + DrawPosition(True, NULL); + } + + void TestLegalityProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.testLegality = !appData.testLegality; + + if (appData.testLegality) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Test Legality"), + args, 1); + } + + + void FlashMovesProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + if (appData.flashCount == 0) { + appData.flashCount = 3; + } else { + appData.flashCount = -appData.flashCount; + } + + if (appData.flashCount > 0) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Flash Moves"), + args, 1); + } + + void FlipViewProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + flipView = !flipView; + DrawPosition(True, NULL); + } + + void GetMoveListProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.getMoveList = !appData.getMoveList; + + if (appData.getMoveList) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + GetMoveListEvent(); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Get Move List"), + args, 1); + } + + #if HIGHDRAG + void HighlightDraggingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.highlightDragging = !appData.highlightDragging; + + if (appData.highlightDragging) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Highlight Dragging"), args, 1); + } + #endif + + void HighlightLastMoveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.highlightLastMove = !appData.highlightLastMove; + + if (appData.highlightLastMove) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Highlight Last Move"), args, 1); + } + + void IcsAlarmProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.icsAlarm = !appData.icsAlarm; + + if (appData.icsAlarm) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.ICS Alarm"), args, 1); + } + + void MoveSoundProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.ringBellAfterMoves = !appData.ringBellAfterMoves; + + if (appData.ringBellAfterMoves) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Move Sound"), + args, 1); + } + + + void OldSaveStyleProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.oldSaveStyle = !appData.oldSaveStyle; + + if (appData.oldSaveStyle) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Old Save Style"), + args, 1); + } + + void PeriodicUpdatesProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + PeriodicUpdatesEvent(!appData.periodicUpdates); + + if (appData.periodicUpdates) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Periodic Updates"), + args, 1); + } + + void PonderNextMoveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + PonderNextMoveEvent(!appData.ponderNextMove); + + if (appData.ponderNextMove) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Ponder Next Move"), + args, 1); + } + + void PopupExitMessageProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.popupExitMessage = !appData.popupExitMessage; + + if (appData.popupExitMessage) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Popup Exit Message"), args, 1); + } + + void PopupMoveErrorsProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.popupMoveErrors = !appData.popupMoveErrors; + + if (appData.popupMoveErrors) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Popup Move Errors"), + args, 1); + } + + void PremoveProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.premove = !appData.premove; + + if (appData.premove) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, + "menuOptions.Premove"), args, 1); + } + + void QuietPlayProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.quietPlay = !appData.quietPlay; + + if (appData.quietPlay) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Quiet Play"), + args, 1); + } + + void ShowCoordsProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + appData.showCoords = !appData.showCoords; + + if (appData.showCoords) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Coords"), + args, 1); + + DrawPosition(True, NULL); + } + + void ShowThinkingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + - appData.showThinking = !appData.showThinking; // [HGM] thinking: tken out of ShowThinkingEvent ++ appData.showThinking = !appData.showThinking; // [HGM] thinking: tken out of ShowThinkingEvent + ShowThinkingEvent(); -#if 0 ++#if 0 + // [HGM] thinking: currently no suc menu item; replaced by Hide Thinking (From Human) + if (appData.showThinking) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Show Thinking"), - args, 1); ++ args, 1); + #endif + } + + void HideThinkingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + - appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; // [HGM] thinking: tken out of ShowThinkingEvent ++ appData.hideThinkingFromHuman = !appData.hideThinkingFromHuman; // [HGM] thinking: tken out of ShowThinkingEvent + ShowThinkingEvent(); + + if (appData.hideThinkingFromHuman) { + XtSetArg(args[0], XtNleftBitmap, xMarkPixmap); + } else { + XtSetArg(args[0], XtNleftBitmap, None); + } + XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Hide Thinking"), + args, 1); + } + + void InfoProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + char buf[MSG_SIZ]; + sprintf(buf, "xterm -e info --directory %s --directory . -f %s &", + INFODIR, INFOFILE); + system(buf); + } + + void ManProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + char buf[MSG_SIZ]; + String name; + if (nprms && *nprms > 0) + name = prms[0]; + else + name = "xboard"; + sprintf(buf, "xterm -e man %s &", name); + system(buf); + } + + void HintProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + HintEvent(); + } + + void BookProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + BookEvent(); + } + + void AboutProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + char buf[MSG_SIZ]; + #if ZIPPY + char *zippy = " (with Zippy code)"; + #else + char *zippy = ""; + #endif + sprintf(buf, "%s%s\n\n%s\n%s\n%s\n%s\n\n%s%s\n%s", + programVersion, zippy, + "Copyright 1991 Digital Equipment Corporation", - "Enhancements Copyright 1992-2001 Free Software Foundation", ++ "Enhancements Copyright 1992-2001 Free Software Foundation", + "Enhancements Copyright 2005 Alessandro Scotti", + "Enhancements Copyright 2007-2008 H.G.Muller", + PRODUCT, " is free software and carries NO WARRANTY;", + "see the file COPYING for more information."); - ErrorPopUp("About XBoard", buf, FALSE); ++ ErrorPopUp(_("About XBoard"), buf, FALSE); + } + + void DebugProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + appData.debugMode = !appData.debugMode; + } + + void AboutGameProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + AboutGameEvent(); + } + + void NothingProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + return; + } + + void Iconify(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + Arg args[16]; + + fromX = fromY = -1; + XtSetArg(args[0], XtNiconic, True); + XtSetValues(shellWidget, args, 1); + } + + void DisplayMessage(message, extMessage) + char *message, *extMessage; + { + char buf[MSG_SIZ]; + Arg arg; + + if (extMessage) { + if (*message) { + sprintf(buf, "%s %s", message, extMessage); + message = buf; + } else { + message = extMessage; + } + } + XtSetArg(arg, XtNlabel, message); + XtSetValues(messageWidget, &arg, 1); + } + + void DisplayTitle(text) + char *text; + { + Arg args[16]; + int i; + char title[MSG_SIZ]; + char icon[MSG_SIZ]; + + if (text == NULL) text = ""; + + if (appData.titleInWindow) { + i = 0; + XtSetArg(args[i], XtNlabel, text); i++; + XtSetValues(titleWidget, args, i); + } + + if (*text != NULLCHAR) { + strcpy(icon, text); + strcpy(title, text); + } else if (appData.icsActive) { + sprintf(icon, "%s", appData.icsHost); + sprintf(title, "%s: %s", programName, appData.icsHost); + } else if (appData.cmailGameName[0] != NULLCHAR) { + sprintf(icon, "%s", "CMail"); + sprintf(title, "%s: %s", programName, "CMail"); -#ifdef GOTHIC - // [HGM] license: This stuff should really be done in back-end, but WinBoard already had a pop-up for it ++#ifdef GOTHIC ++ // [HGM] license: This stuff should really be done in back-end, but WinBoard already had a pop-up for it + } else if (gameInfo.variant == VariantGothic) { + strcpy(icon, programName); + strcpy(title, GOTHIC); -#endif -#ifdef FALCON ++#endif ++#ifdef FALCON + } else if (gameInfo.variant == VariantFalcon) { + strcpy(icon, programName); + strcpy(title, FALCON); -#endif ++#endif + } else if (appData.noChessProgram) { + strcpy(icon, programName); + strcpy(title, programName); + } else { + strcpy(icon, first.tidy); + sprintf(title, "%s: %s", programName, first.tidy); + } + i = 0; + XtSetArg(args[i], XtNiconName, (XtArgVal) icon); i++; + XtSetArg(args[i], XtNtitle, (XtArgVal) title); i++; + XtSetValues(shellWidget, args, i); + } + + + void DisplayError(message, error) + String message; + int error; + { + char buf[MSG_SIZ]; + + if (error == 0) { + if (appData.debugMode || appData.matchMode) { + fprintf(stderr, "%s: %s\n", programName, message); + } + } else { + if (appData.debugMode || appData.matchMode) { + fprintf(stderr, "%s: %s: %s\n", + programName, message, strerror(error)); + } + sprintf(buf, "%s: %s", message, strerror(error)); + message = buf; + } - ErrorPopUp("Error", message, FALSE); ++ ErrorPopUp(_("Error"), message, FALSE); + } + + + void DisplayMoveError(message) + String message; + { + fromX = fromY = -1; + ClearHighlights(); + DrawPosition(FALSE, NULL); + if (appData.debugMode || appData.matchMode) { + fprintf(stderr, "%s: %s\n", programName, message); + } + if (appData.popupMoveErrors) { - ErrorPopUp("Error", message, FALSE); ++ ErrorPopUp(_("Error"), message, FALSE); + } else { + DisplayMessage(message, ""); + } + } + + + void DisplayFatalError(message, error, status) + String message; + int error, status; + { + char buf[MSG_SIZ]; + + errorExitStatus = status; + if (error == 0) { + fprintf(stderr, "%s: %s\n", programName, message); + } else { + fprintf(stderr, "%s: %s: %s\n", + programName, message, strerror(error)); + sprintf(buf, "%s: %s", message, strerror(error)); + message = buf; + } + if (appData.popupExitMessage && boardWidget && XtIsRealized(boardWidget)) { - ErrorPopUp(status ? "Fatal Error" : "Exiting", message, TRUE); ++ ErrorPopUp(status ? _("Fatal Error") : _("Exiting"), message, TRUE); + } else { + ExitEvent(status); + } + } + + void DisplayInformation(message) + String message; + { + ErrorPopDown(); - ErrorPopUp("Information", message, TRUE); ++ ErrorPopUp(_("Information"), message, TRUE); + } + + void DisplayNote(message) + String message; + { + ErrorPopDown(); - ErrorPopUp("Note", message, FALSE); ++ ErrorPopUp(_("Note"), message, FALSE); + } + + static int + NullXErrorCheck(dpy, error_event) + Display *dpy; + XErrorEvent *error_event; + { + return 0; + } + + void DisplayIcsInteractionTitle(message) + String message; + { + if (oldICSInteractionTitle == NULL) { + /* Magic to find the old window title, adapted from vim */ + char *wina = getenv("WINDOWID"); + if (wina != NULL) { + Window win = (Window) atoi(wina); + Window root, parent, *children; + unsigned int nchildren; + int (*oldHandler)() = XSetErrorHandler(NullXErrorCheck); + for (;;) { + if (XFetchName(xDisplay, win, &oldICSInteractionTitle)) break; + if (!XQueryTree(xDisplay, win, &root, &parent, + &children, &nchildren)) break; + if (children) XFree((void *)children); + if (parent == root || parent == 0) break; + win = parent; + } + XSetErrorHandler(oldHandler); + } + if (oldICSInteractionTitle == NULL) { + oldICSInteractionTitle = "xterm"; + } + } + printf("\033]0;%s\007", message); + fflush(stdout); + } + + char pendingReplyPrefix[MSG_SIZ]; + ProcRef pendingReplyPR; + + void AskQuestionProc(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + if (*nprms != 4) { - fprintf(stderr, "AskQuestionProc needed 4 parameters, got %d\n", ++ fprintf(stderr, _("AskQuestionProc needed 4 parameters, got %d\n"), + *nprms); + return; + } + AskQuestionEvent(prms[0], prms[1], prms[2], prms[3]); + } + + void AskQuestionPopDown() + { + if (!askQuestionUp) return; + XtPopdown(askQuestionShell); + XtDestroyWidget(askQuestionShell); + askQuestionUp = False; + } + + void AskQuestionReplyAction(w, event, prms, nprms) + Widget w; + XEvent *event; + String *prms; + Cardinal *nprms; + { + char buf[MSG_SIZ]; + int err; + String reply; + + reply = XawDialogGetValueString(w = XtParent(w)); + strcpy(buf, pendingReplyPrefix); + if (*buf) strcat(buf, " "); + strcat(buf, reply); + strcat(buf, "\n"); + OutputToProcess(pendingReplyPR, buf, strlen(buf), &err); + AskQuestionPopDown(); + - if (err) DisplayFatalError("Error writing to chess program", err, 0); ++ if (err) DisplayFatalError(_("Error writing to chess program"), err, 0); + } + + void AskQuestionCallback(w, client_data, call_data) + Widget w; + XtPointer client_data, call_data; + { + String name; + Arg args[16]; + + XtSetArg(args[0], XtNlabel, &name); + XtGetValues(w, args, 1); + - if (strcmp(name, "cancel") == 0) { ++ if (strcmp(name, _("cancel")) == 0) { + AskQuestionPopDown(); + } else { + AskQuestionReplyAction(w, NULL, NULL, NULL); + } + } + + void AskQuestion(title, question, replyPrefix, pr) + char *title, *question, *replyPrefix; + ProcRef pr; + { + Arg args[16]; + Widget popup, layout, dialog, edit; + Window root, child; + int x, y, i; + int win_x, win_y; + unsigned int mask; + + strcpy(pendingReplyPrefix, replyPrefix); + pendingReplyPR = pr; + + i = 0; + XtSetArg(args[i], XtNresizable, True); i++; + XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; + askQuestionShell = popup = + XtCreatePopupShell(title, transientShellWidgetClass, + shellWidget, args, i); + + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, popup, + layoutArgs, XtNumber(layoutArgs)); + + i = 0; + XtSetArg(args[i], XtNlabel, question); i++; + XtSetArg(args[i], XtNvalue, ""); i++; + XtSetArg(args[i], XtNborderWidth, 0); i++; + dialog = XtCreateManagedWidget("question", dialogWidgetClass, + layout, args, i); + - XawDialogAddButton(dialog, "enter", AskQuestionCallback, ++ XawDialogAddButton(dialog, _("enter"), AskQuestionCallback, + (XtPointer) dialog); - XawDialogAddButton(dialog, "cancel", AskQuestionCallback, ++ XawDialogAddButton(dialog, _("cancel"), AskQuestionCallback, + (XtPointer) dialog); + + XtRealizeWidget(popup); + CatchDeleteWindow(popup, "AskQuestionPopDown"); + + XQueryPointer(xDisplay, xBoardWindow, &root, &child, + &x, &y, &win_x, &win_y, &mask); + + XtSetArg(args[0], XtNx, x - 10); + XtSetArg(args[1], XtNy, y - 30); + XtSetValues(popup, args, 2); + + XtPopup(popup, XtGrabExclusive); + askQuestionUp = True; + + edit = XtNameToWidget(dialog, "*value"); + XtSetKeyboardFocus(popup, edit); + } + + + void + PlaySound(name) + char *name; + { + if (*name == NULLCHAR) { + return; + } else if (strcmp(name, "$") == 0) { + putc(BELLCHAR, stderr); + } else { + char buf[2048]; + sprintf(buf, "%s '%s' &", appData.soundProgram, name); + system(buf); + } + } + + void + RingBell() + { + PlaySound(appData.soundMove); + } + + void + PlayIcsWinSound() + { + PlaySound(appData.soundIcsWin); + } + + void + PlayIcsLossSound() + { + PlaySound(appData.soundIcsLoss); + } + + void + PlayIcsDrawSound() + { + PlaySound(appData.soundIcsDraw); + } + + void + PlayIcsUnfinishedSound() + { + PlaySound(appData.soundIcsUnfinished); + } + + void + PlayAlarmSound() + { + PlaySound(appData.soundIcsAlarm); + } + + void + EchoOn() + { + system("stty echo"); + } + + void + EchoOff() + { + system("stty -echo"); + } + + void + Colorize(cc, continuation) + ColorClass cc; + int continuation; + { + char buf[MSG_SIZ]; + int count, outCount, error; + + if (textColors[(int)cc].bg > 0) { + if (textColors[(int)cc].fg > 0) { + sprintf(buf, "\033[0;%d;%d;%dm", textColors[(int)cc].attr, + textColors[(int)cc].fg, textColors[(int)cc].bg); + } else { + sprintf(buf, "\033[0;%d;%dm", textColors[(int)cc].attr, + textColors[(int)cc].bg); + } + } else { + if (textColors[(int)cc].fg > 0) { + sprintf(buf, "\033[0;%d;%dm", textColors[(int)cc].attr, + textColors[(int)cc].fg); + } else { + sprintf(buf, "\033[0;%dm", textColors[(int)cc].attr); + } + } + count = strlen(buf); + outCount = OutputToProcess(NoProc, buf, count, &error); + if (outCount < count) { - DisplayFatalError("Error writing to display", error, 1); ++ DisplayFatalError(_("Error writing to display"), error, 1); + } + + if (continuation) return; + switch (cc) { + case ColorShout: + PlaySound(appData.soundShout); + break; + case ColorSShout: + PlaySound(appData.soundSShout); + break; + case ColorChannel1: + PlaySound(appData.soundChannel1); + break; + case ColorChannel: + PlaySound(appData.soundChannel); + break; + case ColorKibitz: + PlaySound(appData.soundKibitz); + break; + case ColorTell: + PlaySound(appData.soundTell); + break; + case ColorChallenge: + PlaySound(appData.soundChallenge); + break; + case ColorRequest: + PlaySound(appData.soundRequest); + break; + case ColorSeek: + PlaySound(appData.soundSeek); + break; + case ColorNormal: + case ColorNone: + default: + break; + } + } + + char *UserName() + { + return getpwuid(getuid())->pw_name; + } + + static char *ExpandPathName(path) + char *path; + { + static char static_buf[2000]; + char *d, *s, buf[2000]; + struct passwd *pwd; + + s = path; + d = static_buf; + + while (*s && isspace(*s)) + ++s; + + if (!*s) { + *d = 0; + return static_buf; + } + + if (*s == '~') { + if (*(s+1) == '/') { + strcpy(d, getpwuid(getuid())->pw_dir); + strcat(d, s+1); + } + else { + strcpy(buf, s+1); + *strchr(buf, '/') = 0; + pwd = getpwnam(buf); + if (!pwd) + { - fprintf(stderr, "ERROR: Unknown user %s (in path %s)\n", ++ fprintf(stderr, _("ERROR: Unknown user %s (in path %s)\n"), + buf, path); + return NULL; + } + strcpy(d, pwd->pw_dir); + strcat(d, strchr(s+1, '/')); + } + } + else + strcpy(d, s); + + return static_buf; + } + + char *HostName() + { + static char host_name[MSG_SIZ]; + + #if HAVE_GETHOSTNAME + gethostname(host_name, MSG_SIZ); + return host_name; + #else /* not HAVE_GETHOSTNAME */ + # if HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H + sysinfo(SI_HOSTNAME, host_name, MSG_SIZ); + return host_name; + # else /* not (HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H) */ + return "localhost"; + # endif/* not (HAVE_SYSINFO && HAVE_SYS_SYSTEMINFO_H) */ + #endif /* not HAVE_GETHOSTNAME */ + } + + XtIntervalId delayedEventTimerXID = 0; + DelayedEventCallback delayedEventCallback = 0; + + void + FireDelayedEvent() + { + delayedEventTimerXID = 0; + delayedEventCallback(); + } + + void + ScheduleDelayedEvent(cb, millisec) + DelayedEventCallback cb; long millisec; + { + delayedEventCallback = cb; + delayedEventTimerXID = + XtAppAddTimeOut(appContext, millisec, + (XtTimerCallbackProc) FireDelayedEvent, (XtPointer) 0); + } + + DelayedEventCallback + GetDelayedEvent() + { + if (delayedEventTimerXID) { + return delayedEventCallback; + } else { + return NULL; + } + } + + void + CancelDelayedEvent() + { + if (delayedEventTimerXID) { + XtRemoveTimeOut(delayedEventTimerXID); + delayedEventTimerXID = 0; + } + } + + XtIntervalId loadGameTimerXID = 0; + + int LoadGameTimerRunning() + { + return loadGameTimerXID != 0; + } + + int StopLoadGameTimer() + { + if (loadGameTimerXID != 0) { + XtRemoveTimeOut(loadGameTimerXID); + loadGameTimerXID = 0; + return TRUE; + } else { + return FALSE; + } + } + + void + LoadGameTimerCallback(arg, id) + XtPointer arg; + XtIntervalId *id; + { + loadGameTimerXID = 0; + AutoPlayGameLoop(); + } + + void + StartLoadGameTimer(millisec) + long millisec; + { + loadGameTimerXID = + XtAppAddTimeOut(appContext, millisec, + (XtTimerCallbackProc) LoadGameTimerCallback, + (XtPointer) 0); + } + + XtIntervalId analysisClockXID = 0; + + void + AnalysisClockCallback(arg, id) + XtPointer arg; + XtIntervalId *id; + { - if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { ++ if (gameMode == AnalyzeMode || gameMode == AnalyzeFile ++ || appData.icsEngineAnalyze) { // [DM] + AnalysisPeriodicEvent(0); + StartAnalysisClock(); + } + } + + void + StartAnalysisClock() + { + analysisClockXID = + XtAppAddTimeOut(appContext, 2000, + (XtTimerCallbackProc) AnalysisClockCallback, + (XtPointer) 0); + } + + XtIntervalId clockTimerXID = 0; + + int ClockTimerRunning() + { + return clockTimerXID != 0; + } + + int StopClockTimer() + { + if (clockTimerXID != 0) { + XtRemoveTimeOut(clockTimerXID); + clockTimerXID = 0; + return TRUE; + } else { + return FALSE; + } + } + + void + ClockTimerCallback(arg, id) + XtPointer arg; + XtIntervalId *id; + { + clockTimerXID = 0; + DecrementClocks(); + } + + void + StartClockTimer(millisec) + long millisec; + { + clockTimerXID = + XtAppAddTimeOut(appContext, millisec, + (XtTimerCallbackProc) ClockTimerCallback, + (XtPointer) 0); + } + + void + DisplayTimerLabel(w, color, timer, highlight) + Widget w; + char *color; + long timer; + int highlight; + { + char buf[MSG_SIZ]; + Arg args[16]; + + if (appData.clockMode) { + sprintf(buf, "%s: %s", color, TimeString(timer)); + XtSetArg(args[0], XtNlabel, buf); + } else { + sprintf(buf, "%s ", color); + XtSetArg(args[0], XtNlabel, buf); + } + + if (highlight) { + XtSetArg(args[1], XtNbackground, timerForegroundPixel); + XtSetArg(args[2], XtNforeground, timerBackgroundPixel); + } else { + XtSetArg(args[1], XtNbackground, timerBackgroundPixel); + XtSetArg(args[2], XtNforeground, timerForegroundPixel); + } + + XtSetValues(w, args, 3); + } + + void + DisplayWhiteClock(timeRemaining, highlight) + long timeRemaining; + int highlight; + { + Arg args[16]; - DisplayTimerLabel(whiteTimerWidget, "White", timeRemaining, highlight); ++ ++ if(appData.noGUI) return; ++ DisplayTimerLabel(whiteTimerWidget, _("White"), timeRemaining, highlight); + if (highlight && iconPixmap == bIconPixmap) { + iconPixmap = wIconPixmap; + XtSetArg(args[0], XtNiconPixmap, iconPixmap); + XtSetValues(shellWidget, args, 1); + } + } + + void + DisplayBlackClock(timeRemaining, highlight) + long timeRemaining; + int highlight; + { + Arg args[16]; - DisplayTimerLabel(blackTimerWidget, "Black", timeRemaining, highlight); ++ ++ if(appData.noGUI) return; ++ DisplayTimerLabel(blackTimerWidget, _("Black"), timeRemaining, highlight); + if (highlight && iconPixmap == wIconPixmap) { + iconPixmap = bIconPixmap; + XtSetArg(args[0], XtNiconPixmap, iconPixmap); + XtSetValues(shellWidget, args, 1); + } + } + + #define CPNone 0 + #define CPReal 1 + #define CPComm 2 + #define CPSock 3 + #define CPLoop 4 + typedef int CPKind; + + typedef struct { + CPKind kind; + int pid; + int fdTo, fdFrom; + } ChildProc; + + + int StartChildProcess(cmdLine, dir, pr) + char *cmdLine; + char *dir; + ProcRef *pr; + { + char *argv[64], *p; + int i, pid; + int to_prog[2], from_prog[2]; + ChildProc *cp; + char buf[MSG_SIZ]; + + if (appData.debugMode) { + fprintf(stderr, "StartChildProcess (dir=\"%s\") %s\n",dir, cmdLine); + } + + /* We do NOT feed the cmdLine to the shell; we just + parse it into blank-separated arguments in the + most simple-minded way possible. + */ + i = 0; + strcpy(buf, cmdLine); + p = buf; + for (;;) { + argv[i++] = p; + p = strchr(p, ' '); + if (p == NULL) break; + *p++ = NULLCHAR; + } + argv[i] = NULL; + + SetUpChildIO(to_prog, from_prog); + + if ((pid = fork()) == 0) { - /* Child process */ ++ /* Child process */ + // [HGM] PSWBTM: made order resistant against case where fd of created pipe was 0 or 1 + close(to_prog[1]); // first close the unused pipe ends + close(from_prog[0]); + dup2(to_prog[0], 0); // to_prog was created first, nd is the only one to use 0 or 1 + dup2(from_prog[1], 1); + if(to_prog[0] >= 2) close(to_prog[0]); // if 0 or 1, the dup2 already cosed the original + close(from_prog[1]); // and closing again loses one of the pipes! - if(fileno(stderr) >= 2) // better safe than sorry... ++ if(fileno(stderr) >= 2) // better safe than sorry... + dup2(1, fileno(stderr)); /* force stderr to the pipe */ + + if (dir[0] != NULLCHAR && chdir(dir) != 0) { + perror(dir); + exit(1); - } - ++ } ++ + nice(appData.niceEngines); // [HGM] nice: adjust priority of engine proc + + execvp(argv[0], argv); + + /* If we get here, exec failed */ + perror(argv[0]); + exit(1); + } + + /* Parent process */ + close(to_prog[0]); + close(from_prog[1]); + + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPReal; + cp->pid = pid; + cp->fdFrom = from_prog[0]; + cp->fdTo = to_prog[1]; + *pr = (ProcRef) cp; + return 0; + } + + // [HGM] kill: implement the 'hard killing' of AS's Winboard_x + static RETSIGTYPE AlarmCallBack(int n) + { + return; + } + + void + DestroyChildProcess(pr, signalType) + ProcRef pr; + int signalType; + { + ChildProc *cp = (ChildProc *) pr; + + if (cp->kind != CPReal) return; + cp->kind = CPNone; + if (signalType == 10) { // [HGM] kill: if it does not terminate in 3 sec, kill + signal(SIGALRM, AlarmCallBack); + alarm(3); + if(wait((int *) 0) == -1) { // process does not terminate on its own accord + kill(cp->pid, SIGKILL); // kill it forcefully + wait((int *) 0); // and wait again + } + } else { + if (signalType) { + kill(cp->pid, signalType == 9 ? SIGKILL : SIGTERM); // [HGM] kill: use hard kill if so requested + } + /* Process is exiting either because of the kill or because of + a quit command sent by the backend; either way, wait for it to die. + */ + wait((int *) 0); + } + close(cp->fdFrom); + close(cp->fdTo); + } + + void + InterruptChildProcess(pr) + ProcRef pr; + { + ChildProc *cp = (ChildProc *) pr; + + if (cp->kind != CPReal) return; + (void) kill(cp->pid, SIGINT); /* stop it thinking */ + } + + int OpenTelnet(host, port, pr) + char *host; + char *port; + ProcRef *pr; + { + char cmdLine[MSG_SIZ]; + + if (port[0] == NULLCHAR) { + sprintf(cmdLine, "%s %s", appData.telnetProgram, host); + } else { + sprintf(cmdLine, "%s %s %s", appData.telnetProgram, host, port); + } + return StartChildProcess(cmdLine, "", pr); + } + + int OpenTCP(host, port, pr) + char *host; + char *port; + ProcRef *pr; + { + #if OMIT_SOCKETS - DisplayFatalError("Socket support is not configured in", 0, 2); ++ DisplayFatalError(_("Socket support is not configured in"), 0, 2); + #else /* !OMIT_SOCKETS */ + int s; + struct sockaddr_in sa; + struct hostent *hp; + unsigned short uport; + ChildProc *cp; + + if ((s = socket(AF_INET, SOCK_STREAM, 6)) < 0) { + return errno; + } + + memset((char *) &sa, (int)0, sizeof(struct sockaddr_in)); + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = INADDR_ANY; + uport = (unsigned short) 0; + sa.sin_port = htons(uport); + if (bind(s, (struct sockaddr *) &sa, sizeof(struct sockaddr_in)) < 0) { + return errno; + } + + memset((char *) &sa, (int)0, sizeof(struct sockaddr_in)); + if (!(hp = gethostbyname(host))) { + int b0, b1, b2, b3; + if (sscanf(host, "%d.%d.%d.%d", &b0, &b1, &b2, &b3) == 4) { + hp = (struct hostent *) calloc(1, sizeof(struct hostent)); + hp->h_addrtype = AF_INET; + hp->h_length = 4; + hp->h_addr_list = (char **) calloc(2, sizeof(char *)); + hp->h_addr_list[0] = (char *) malloc(4); + hp->h_addr_list[0][0] = b0; + hp->h_addr_list[0][1] = b1; + hp->h_addr_list[0][2] = b2; + hp->h_addr_list[0][3] = b3; + } else { + return ENOENT; + } + } + sa.sin_family = hp->h_addrtype; + uport = (unsigned short) atoi(port); + sa.sin_port = htons(uport); + memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length); + + if (connect(s, (struct sockaddr *) &sa, + sizeof(struct sockaddr_in)) < 0) { + return errno; + } + + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPSock; + cp->pid = 0; + cp->fdFrom = s; + cp->fdTo = s; + *pr = (ProcRef) cp; + + #endif /* !OMIT_SOCKETS */ + + return 0; + } + + int OpenCommPort(name, pr) + char *name; + ProcRef *pr; + { + int fd; + ChildProc *cp; + + fd = open(name, 2, 0); + if (fd < 0) return errno; + + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPComm; + cp->pid = 0; + cp->fdFrom = fd; + cp->fdTo = fd; + *pr = (ProcRef) cp; + + return 0; + } + + int OpenLoopback(pr) + ProcRef *pr; + { + ChildProc *cp; + int to[2], from[2]; + + SetUpChildIO(to, from); + + cp = (ChildProc *) calloc(1, sizeof(ChildProc)); + cp->kind = CPLoop; + cp->pid = 0; + cp->fdFrom = to[0]; /* note not from[0]; we are doing a loopback */ + cp->fdTo = to[1]; + *pr = (ProcRef) cp; + + return 0; + } + + int OpenRcmd(host, user, cmd, pr) + char *host, *user, *cmd; + ProcRef *pr; + { - DisplayFatalError("internal rcmd not implemented for Unix", 0, 1); ++ DisplayFatalError(_("internal rcmd not implemented for Unix"), 0, 1); + return -1; + } + + #define INPUT_SOURCE_BUF_SIZE 8192 + + typedef struct { + CPKind kind; + int fd; + int lineByLine; + char *unused; + InputCallback func; + XtInputId xid; + char buf[INPUT_SOURCE_BUF_SIZE]; + VOIDSTAR closure; + } InputSource; + + void + DoInputCallback(closure, source, xid) + caddr_t closure; + int *source; + XtInputId *xid; + { + InputSource *is = (InputSource *) closure; + int count; + int error; + char *p, *q; + + if (is->lineByLine) { + count = read(is->fd, is->unused, + INPUT_SOURCE_BUF_SIZE - (is->unused - is->buf)); + if (count <= 0) { + (is->func)(is, is->closure, is->buf, count, count ? errno : 0); + return; + } + is->unused += count; + p = is->buf; + while (p < is->unused) { + q = memchr(p, '\n', is->unused - p); + if (q == NULL) break; + q++; + (is->func)(is, is->closure, p, q - p, 0); + p = q; + } + q = is->buf; + while (p < is->unused) { + *q++ = *p++; + } + is->unused = q; + } else { + count = read(is->fd, is->buf, INPUT_SOURCE_BUF_SIZE); + if (count == -1) + error = errno; + else + error = 0; + (is->func)(is, is->closure, is->buf, count, error); + } + } + + InputSourceRef AddInputSource(pr, lineByLine, func, closure) + ProcRef pr; + int lineByLine; + InputCallback func; + VOIDSTAR closure; + { + InputSource *is; + ChildProc *cp = (ChildProc *) pr; + + is = (InputSource *) calloc(1, sizeof(InputSource)); + is->lineByLine = lineByLine; + is->func = func; + if (pr == NoProc) { + is->kind = CPReal; + is->fd = fileno(stdin); + } else { + is->kind = cp->kind; + is->fd = cp->fdFrom; + } + if (lineByLine) { + is->unused = is->buf; + } + + is->xid = XtAppAddInput(appContext, is->fd, + (XtPointer) (XtInputReadMask), + (XtInputCallbackProc) DoInputCallback, + (XtPointer) is); + is->closure = closure; + return (InputSourceRef) is; + } + + void + RemoveInputSource(isr) + InputSourceRef isr; + { + InputSource *is = (InputSource *) isr; + + if (is->xid == 0) return; + XtRemoveInput(is->xid); + is->xid = 0; + } + + int OutputToProcess(pr, message, count, outError) + ProcRef pr; + char *message; + int count; + int *outError; + { + ChildProc *cp = (ChildProc *) pr; + int outCount; + + if (pr == NoProc) + outCount = fwrite(message, 1, count, stdout); + else + outCount = write(cp->fdTo, message, count); + + if (outCount == -1) + *outError = errno; + else + *outError = 0; + + return outCount; + } + + /* Output message to process, with "ms" milliseconds of delay + between each character. This is needed when sending the logon + script to ICC, which for some reason doesn't like the + instantaneous send. */ + int OutputToProcessDelayed(pr, message, count, outError, msdelay) + ProcRef pr; + char *message; + int count; + int *outError; + long msdelay; + { + ChildProc *cp = (ChildProc *) pr; + int outCount = 0; + int r; + + while (count--) { + r = write(cp->fdTo, message++, 1); + if (r == -1) { + *outError = errno; + return outCount; + } + ++outCount; + if (msdelay >= 0) + TimeDelay(msdelay); + } + + return outCount; + } + + /**** Animation code by Hugh Fisher, DCS, ANU. + + Known problem: if a window overlapping the board is + moved away while a piece is being animated underneath, + the newly exposed area won't be updated properly. + I can live with this. + + Known problem: if you look carefully at the animation + of pieces in mono mode, they are being drawn as solid + shapes without interior detail while moving. Fixing + this would be a major complication for minimal return. + ****/ + + /* Masks for XPM pieces. Black and white pieces can have + different shapes, but in the interest of retaining my + sanity pieces must have the same outline on both light + and dark squares, and all pieces must use the same + background square colors/images. */ + + static void + CreateAnimMasks (pieceDepth) + int pieceDepth; + { + ChessSquare piece; + Pixmap buf; + GC bufGC, maskGC; + int kind, n; + unsigned long plane; + XGCValues values; + + /* Need a bitmap just to get a GC with right depth */ + buf = XCreatePixmap(xDisplay, xBoardWindow, + 8, 8, 1); + values.foreground = 1; + values.background = 0; + /* Don't use XtGetGC, not read only */ + maskGC = XCreateGC(xDisplay, buf, + GCForeground | GCBackground, &values); + XFreePixmap(xDisplay, buf); + + buf = XCreatePixmap(xDisplay, xBoardWindow, + squareSize, squareSize, pieceDepth); + values.foreground = XBlackPixel(xDisplay, xScreen); + values.background = XWhitePixel(xDisplay, xScreen); + bufGC = XCreateGC(xDisplay, buf, + GCForeground | GCBackground, &values); + + for (piece = WhitePawn; piece <= BlackKing; piece++) { + /* Begin with empty mask */ + xpmMask[piece] = XCreatePixmap(xDisplay, xBoardWindow, + squareSize, squareSize, 1); + XSetFunction(xDisplay, maskGC, GXclear); + XFillRectangle(xDisplay, xpmMask[piece], maskGC, + 0, 0, squareSize, squareSize); + + /* Take a copy of the piece */ + if (White(piece)) + kind = 0; + else + kind = 2; + XSetFunction(xDisplay, bufGC, GXcopy); + XCopyArea(xDisplay, xpmPieceBitmap[kind][((int)piece) % (int)BlackPawn], + buf, bufGC, + 0, 0, squareSize, squareSize, 0, 0); + + /* XOR the background (light) over the piece */ + XSetFunction(xDisplay, bufGC, GXxor); + if (useImageSqs) + XCopyArea(xDisplay, xpmLightSquare, buf, bufGC, + 0, 0, squareSize, squareSize, 0, 0); + else { + XSetForeground(xDisplay, bufGC, lightSquareColor); + XFillRectangle(xDisplay, buf, bufGC, 0, 0, squareSize, squareSize); + } + + /* We now have an inverted piece image with the background + erased. Construct mask by just selecting all the non-zero + pixels - no need to reconstruct the original image. */ + XSetFunction(xDisplay, maskGC, GXor); + plane = 1; + /* Might be quicker to download an XImage and create bitmap + data from it rather than this N copies per piece, but it + only takes a fraction of a second and there is a much + longer delay for loading the pieces. */ + for (n = 0; n < pieceDepth; n ++) { + XCopyPlane(xDisplay, buf, xpmMask[piece], maskGC, + 0, 0, squareSize, squareSize, + 0, 0, plane); + plane = plane << 1; + } + } + /* Clean up */ + XFreePixmap(xDisplay, buf); + XFreeGC(xDisplay, bufGC); + XFreeGC(xDisplay, maskGC); + } + + static void + InitAnimState (anim, info) + AnimState * anim; + XWindowAttributes * info; + { + XtGCMask mask; + XGCValues values; + + /* Each buffer is square size, same depth as window */ + anim->saveBuf = XCreatePixmap(xDisplay, xBoardWindow, + squareSize, squareSize, info->depth); + anim->newBuf = XCreatePixmap(xDisplay, xBoardWindow, + squareSize, squareSize, info->depth); + + /* Create a plain GC for blitting */ + mask = GCForeground | GCBackground | GCFunction | + GCPlaneMask | GCGraphicsExposures; + values.foreground = XBlackPixel(xDisplay, xScreen); + values.background = XWhitePixel(xDisplay, xScreen); + values.function = GXcopy; + values.plane_mask = AllPlanes; + values.graphics_exposures = False; + anim->blitGC = XCreateGC(xDisplay, xBoardWindow, mask, &values); + + /* Piece will be copied from an existing context at + the start of each new animation/drag. */ + anim->pieceGC = XCreateGC(xDisplay, xBoardWindow, 0, &values); + + /* Outline will be a read-only copy of an existing */ + anim->outlineGC = None; + } + + static void + CreateAnimVars () + { + static int done = 0; + XWindowAttributes info; + + if (done) return; + done = 1; + XGetWindowAttributes(xDisplay, xBoardWindow, &info); + + InitAnimState(&game, &info); + InitAnimState(&player, &info); + + /* For XPM pieces, we need bitmaps to use as masks. */ + if (useImages) + CreateAnimMasks(info.depth); + } + + #ifndef HAVE_USLEEP + + static Boolean frameWaiting; + + static RETSIGTYPE FrameAlarm (sig) + int sig; + { + frameWaiting = False; + /* In case System-V style signals. Needed?? */ + signal(SIGALRM, FrameAlarm); + } + + static void + FrameDelay (time) + int time; + { + struct itimerval delay; + + XSync(xDisplay, False); + + if (time > 0) { + frameWaiting = True; + signal(SIGALRM, FrameAlarm); + delay.it_interval.tv_sec = + delay.it_value.tv_sec = time / 1000; + delay.it_interval.tv_usec = + delay.it_value.tv_usec = (time % 1000) * 1000; + setitimer(ITIMER_REAL, &delay, NULL); + #if 0 + /* Ugh -- busy-wait! --tpm */ + while (frameWaiting); + #else + while (frameWaiting) pause(); + #endif + delay.it_interval.tv_sec = delay.it_value.tv_sec = 0; + delay.it_interval.tv_usec = delay.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &delay, NULL); + } + } + + #else + + static void + FrameDelay (time) + int time; + { + XSync(xDisplay, False); + if (time > 0) + usleep(time * 1000); + } + + #endif + + /* Convert board position to corner of screen rect and color */ + + static void + ScreenSquare(column, row, pt, color) + int column; int row; XPoint * pt; int * color; + { + if (flipView) { + pt->x = lineGap + ((BOARD_WIDTH-1)-column) * (squareSize + lineGap); + pt->y = lineGap + row * (squareSize + lineGap); + } else { + pt->x = lineGap + column * (squareSize + lineGap); + pt->y = lineGap + ((BOARD_HEIGHT-1)-row) * (squareSize + lineGap); + } + *color = SquareColor(row, column); + } + + /* Convert window coords to square */ + + static void + BoardSquare(x, y, column, row) + int x; int y; int * column; int * row; + { + *column = EventToSquare(x, BOARD_WIDTH); + if (flipView && *column >= 0) + *column = BOARD_WIDTH - 1 - *column; + *row = EventToSquare(y, BOARD_HEIGHT); + if (!flipView && *row >= 0) + *row = BOARD_HEIGHT - 1 - *row; + } + + /* Utilities */ + + #undef Max /* just in case */ + #undef Min + #define Max(a, b) ((a) > (b) ? (a) : (b)) + #define Min(a, b) ((a) < (b) ? (a) : (b)) + + static void + SetRect(rect, x, y, width, height) + XRectangle * rect; int x; int y; int width; int height; + { + rect->x = x; + rect->y = y; + rect->width = width; + rect->height = height; + } + + /* Test if two frames overlap. If they do, return + intersection rect within old and location of + that rect within new. */ + + static Boolean + Intersect(old, new, size, area, pt) + XPoint * old; XPoint * new; + int size; XRectangle * area; XPoint * pt; + { + if (old->x > new->x + size || new->x > old->x + size || + old->y > new->y + size || new->y > old->y + size) { + return False; + } else { + SetRect(area, Max(new->x - old->x, 0), Max(new->y - old->y, 0), + size - abs(old->x - new->x), size - abs(old->y - new->y)); + pt->x = Max(old->x - new->x, 0); + pt->y = Max(old->y - new->y, 0); + return True; + } + } + + /* For two overlapping frames, return the rect(s) + in the old that do not intersect with the new. */ + + static void + CalcUpdateRects(old, new, size, update, nUpdates) + XPoint * old; XPoint * new; int size; + XRectangle update[]; int * nUpdates; + { + int count; + + /* If old = new (shouldn't happen) then nothing to draw */ + if (old->x == new->x && old->y == new->y) { + *nUpdates = 0; + return; + } + /* Work out what bits overlap. Since we know the rects + are the same size we don't need a full intersect calc. */ + count = 0; + /* Top or bottom edge? */ + if (new->y > old->y) { + SetRect(&(update[count]), old->x, old->y, size, new->y - old->y); + count ++; + } else if (old->y > new->y) { + SetRect(&(update[count]), old->x, old->y + size - (old->y - new->y), + size, old->y - new->y); + count ++; + } + /* Left or right edge - don't overlap any update calculated above. */ + if (new->x > old->x) { + SetRect(&(update[count]), old->x, Max(new->y, old->y), + new->x - old->x, size - abs(new->y - old->y)); + count ++; + } else if (old->x > new->x) { + SetRect(&(update[count]), new->x + size, Max(new->y, old->y), + old->x - new->x, size - abs(new->y - old->y)); + count ++; + } + /* Done */ + *nUpdates = count; + } + + /* Generate a series of frame coords from start->mid->finish. + The movement rate doubles until the half way point is + reached, then halves back down to the final destination, + which gives a nice slow in/out effect. The algorithmn + may seem to generate too many intermediates for short + moves, but remember that the purpose is to attract the + viewers attention to the piece about to be moved and + then to where it ends up. Too few frames would be less + noticeable. */ + + static void + Tween(start, mid, finish, factor, frames, nFrames) + XPoint * start; XPoint * mid; + XPoint * finish; int factor; + XPoint frames[]; int * nFrames; + { + int fraction, n, count; + + count = 0; + + /* Slow in, stepping 1/16th, then 1/8th, ... */ + fraction = 1; + for (n = 0; n < factor; n++) + fraction *= 2; + for (n = 0; n < factor; n++) { + frames[count].x = start->x + (mid->x - start->x) / fraction; + frames[count].y = start->y + (mid->y - start->y) / fraction; + count ++; + fraction = fraction / 2; + } + + /* Midpoint */ + frames[count] = *mid; + count ++; + + /* Slow out, stepping 1/2, then 1/4, ... */ + fraction = 2; + for (n = 0; n < factor; n++) { + frames[count].x = finish->x - (finish->x - mid->x) / fraction; + frames[count].y = finish->y - (finish->y - mid->y) / fraction; + count ++; + fraction = fraction * 2; + } + *nFrames = count; + } + + /* Draw a piece on the screen without disturbing what's there */ + + static void + SelectGCMask(piece, clip, outline, mask) + ChessSquare piece; GC * clip; GC * outline; Pixmap * mask; + { + GC source; + + /* Bitmap for piece being moved. */ + if (appData.monoMode) { + *mask = *pieceToSolid(piece); + } else if (useImages) { + #if HAVE_LIBXPM + *mask = xpmMask[piece]; + #else + *mask = ximMaskPm[piece%(int)BlackPawn]; + #endif + } else { + *mask = *pieceToSolid(piece); + } + + /* GC for piece being moved. Square color doesn't matter, but + since it gets modified we make a copy of the original. */ + if (White(piece)) { + if (appData.monoMode) + source = bwPieceGC; + else + source = wlPieceGC; + } else { + if (appData.monoMode) + source = wbPieceGC; + else + source = blPieceGC; + } + XCopyGC(xDisplay, source, 0xFFFFFFFF, *clip); + + /* Outline only used in mono mode and is not modified */ + if (White(piece)) + *outline = bwPieceGC; + else + *outline = wbPieceGC; + } + + static void + OverlayPiece(piece, clip, outline, dest) + ChessSquare piece; GC clip; GC outline; Drawable dest; + { + int kind; + + if (!useImages) { + /* Draw solid rectangle which will be clipped to shape of piece */ + XFillRectangle(xDisplay, dest, clip, + 0, 0, squareSize, squareSize); + if (appData.monoMode) + /* Also draw outline in contrasting color for black + on black / white on white cases */ + XCopyPlane(xDisplay, *pieceToOutline(piece), dest, outline, + 0, 0, squareSize, squareSize, 0, 0, 1); + } else { + /* Copy the piece */ + if (White(piece)) + kind = 0; + else + kind = 2; + XCopyArea(xDisplay, xpmPieceBitmap[kind][((int)piece) % (int)BlackPawn], + dest, clip, + 0, 0, squareSize, squareSize, + 0, 0); + } + } + + /* Animate the movement of a single piece */ + + static void + BeginAnimation(anim, piece, startColor, start) + AnimState *anim; + ChessSquare piece; + int startColor; + XPoint * start; + { + Pixmap mask; + + /* The old buffer is initialised with the start square (empty) */ + BlankSquare(0, 0, startColor, EmptySquare, anim->saveBuf); + anim->prevFrame = *start; + + /* The piece will be drawn using its own bitmap as a matte */ + SelectGCMask(piece, &anim->pieceGC, &anim->outlineGC, &mask); + XSetClipMask(xDisplay, anim->pieceGC, mask); + } + + static void + AnimationFrame(anim, frame, piece) + AnimState *anim; + XPoint *frame; + ChessSquare piece; + { + XRectangle updates[4]; + XRectangle overlap; + XPoint pt; + int count, i; + + /* Save what we are about to draw into the new buffer */ + XCopyArea(xDisplay, xBoardWindow, anim->newBuf, anim->blitGC, + frame->x, frame->y, squareSize, squareSize, + 0, 0); + + /* Erase bits of the previous frame */ + if (Intersect(&anim->prevFrame, frame, squareSize, &overlap, &pt)) { + /* Where the new frame overlapped the previous, + the contents in newBuf are wrong. */ + XCopyArea(xDisplay, anim->saveBuf, anim->newBuf, anim->blitGC, + overlap.x, overlap.y, + overlap.width, overlap.height, + pt.x, pt.y); + /* Repaint the areas in the old that don't overlap new */ + CalcUpdateRects(&anim->prevFrame, frame, squareSize, updates, &count); + for (i = 0; i < count; i++) + XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, + updates[i].x - anim->prevFrame.x, + updates[i].y - anim->prevFrame.y, + updates[i].width, updates[i].height, + updates[i].x, updates[i].y); + } else { + /* Easy when no overlap */ + XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, + 0, 0, squareSize, squareSize, + anim->prevFrame.x, anim->prevFrame.y); + } + + /* Save this frame for next time round */ + XCopyArea(xDisplay, anim->newBuf, anim->saveBuf, anim->blitGC, + 0, 0, squareSize, squareSize, + 0, 0); + anim->prevFrame = *frame; + + /* Draw piece over original screen contents, not current, + and copy entire rect. Wipes out overlapping piece images. */ + OverlayPiece(piece, anim->pieceGC, anim->outlineGC, anim->newBuf); + XCopyArea(xDisplay, anim->newBuf, xBoardWindow, anim->blitGC, + 0, 0, squareSize, squareSize, + frame->x, frame->y); + } + + static void + EndAnimation (anim, finish) + AnimState *anim; + XPoint *finish; + { + XRectangle updates[4]; + XRectangle overlap; + XPoint pt; + int count, i; + + /* The main code will redraw the final square, so we + only need to erase the bits that don't overlap. */ + if (Intersect(&anim->prevFrame, finish, squareSize, &overlap, &pt)) { + CalcUpdateRects(&anim->prevFrame, finish, squareSize, updates, &count); + for (i = 0; i < count; i++) + XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, + updates[i].x - anim->prevFrame.x, + updates[i].y - anim->prevFrame.y, + updates[i].width, updates[i].height, + updates[i].x, updates[i].y); + } else { + XCopyArea(xDisplay, anim->saveBuf, xBoardWindow, anim->blitGC, + 0, 0, squareSize, squareSize, + anim->prevFrame.x, anim->prevFrame.y); + } + } + + static void + FrameSequence(anim, piece, startColor, start, finish, frames, nFrames) + AnimState *anim; + ChessSquare piece; int startColor; + XPoint * start; XPoint * finish; + XPoint frames[]; int nFrames; + { + int n; + + BeginAnimation(anim, piece, startColor, start); + for (n = 0; n < nFrames; n++) { + AnimationFrame(anim, &(frames[n]), piece); + FrameDelay(appData.animSpeed); + } + EndAnimation(anim, finish); + } + + /* Main control logic for deciding what to animate and how */ + + void + AnimateMove(board, fromX, fromY, toX, toY) + Board board; + int fromX; + int fromY; + int toX; + int toY; + { + ChessSquare piece; + int hop; + XPoint start, finish, mid; + XPoint frames[kFactor * 2 + 1]; + int nFrames, startColor, endColor; + + /* Are we animating? */ + if (!appData.animate || appData.blindfold) + return; + + if (fromY < 0 || fromX < 0 || toX < 0 || toY < 0) return; + piece = board[fromY][fromX]; + if (piece >= EmptySquare) return; + + #if DONT_HOP + hop = FALSE; + #else + hop = (piece == WhiteKnight || piece == BlackKnight); + #endif + + if (appData.debugMode) { - printf("AnimateMove: piece %d %s from %d,%d to %d,%d \n", - piece, hop ? "hops" : "slides", fromX, fromY, toX, toY); - } ++ fprintf(debugFP, hop ? _("AnimateMove: piece %d hops from %d,%d to %d,%d \n") : ++ _("AnimateMove: piece %d slides from %d,%d to %d,%d \n"), ++ piece, fromX, fromY, toX, toY); } + + ScreenSquare(fromX, fromY, &start, &startColor); + ScreenSquare(toX, toY, &finish, &endColor); + + if (hop) { + /* Knight: make diagonal movement then straight */ + if (abs(toY - fromY) < abs(toX - fromX)) { + mid.x = start.x + (finish.x - start.x) / 2; + mid.y = finish.y; + } else { + mid.x = finish.x; + mid.y = start.y + (finish.y - start.y) / 2; + } + } else { + mid.x = start.x + (finish.x - start.x) / 2; + mid.y = start.y + (finish.y - start.y) / 2; + } + + /* Don't use as many frames for very short moves */ + if (abs(toY - fromY) + abs(toX - fromX) <= 2) + Tween(&start, &mid, &finish, kFactor - 1, frames, &nFrames); + else + Tween(&start, &mid, &finish, kFactor, frames, &nFrames); + FrameSequence(&game, piece, startColor, &start, &finish, frames, nFrames); + + /* Be sure end square is redrawn */ + damage[toY][toX] = True; + } + + static void + DragPieceBegin(x, y) + int x; int y; + { + int boardX, boardY, color; + XPoint corner; + + /* Are we animating? */ + if (!appData.animateDragging || appData.blindfold) + return; + + /* Figure out which square we start in and the + mouse position relative to top left corner. */ + BoardSquare(x, y, &boardX, &boardY); + player.startBoardX = boardX; + player.startBoardY = boardY; + ScreenSquare(boardX, boardY, &corner, &color); + player.startSquare = corner; + player.startColor = color; + #if 0 + /* Start from exactly where the piece is. This can be confusing + if you start dragging far from the center of the square; most + or all of the piece can be over a different square from the one + the mouse pointer is in. */ + player.mouseDelta.x = x - corner.x; + player.mouseDelta.y = y - corner.y; + #else + /* As soon as we start dragging, the piece will jump slightly to + be centered over the mouse pointer. */ + player.mouseDelta.x = squareSize/2; + player.mouseDelta.y = squareSize/2; + #endif + /* Initialise animation */ + player.dragPiece = PieceForSquare(boardX, boardY); + /* Sanity check */ + if (player.dragPiece >= 0 && player.dragPiece < EmptySquare) { + player.dragActive = True; + BeginAnimation(&player, player.dragPiece, color, &corner); + /* Mark this square as needing to be redrawn. Note that + we don't remove the piece though, since logically (ie + as seen by opponent) the move hasn't been made yet. */ + damage[boardY][boardX] = True; + } else { + player.dragActive = False; + } + } + + static void + DragPieceMove(x, y) + int x; int y; + { + XPoint corner; + + /* Are we animating? */ + if (!appData.animateDragging || appData.blindfold) + return; + + /* Sanity check */ + if (! player.dragActive) + return; + /* Move piece, maintaining same relative position + of mouse within square */ + corner.x = x - player.mouseDelta.x; + corner.y = y - player.mouseDelta.y; + AnimationFrame(&player, &corner, player.dragPiece); + #if HIGHDRAG + if (appData.highlightDragging) { + int boardX, boardY; + BoardSquare(x, y, &boardX, &boardY); + SetHighlights(fromX, fromY, boardX, boardY); + } + #endif + } + + static void + DragPieceEnd(x, y) + int x; int y; + { + int boardX, boardY, color; + XPoint corner; + + /* Are we animating? */ + if (!appData.animateDragging || appData.blindfold) + return; + + /* Sanity check */ + if (! player.dragActive) + return; + /* Last frame in sequence is square piece is + placed on, which may not match mouse exactly. */ + BoardSquare(x, y, &boardX, &boardY); + ScreenSquare(boardX, boardY, &corner, &color); + EndAnimation(&player, &corner); + + /* Be sure end square is redrawn */ + damage[boardY][boardX] = True; + + /* This prevents weird things happening with fast successive + clicks which on my Sun at least can cause motion events + without corresponding press/release. */ + player.dragActive = False; + } + + /* Handle expose event while piece being dragged */ + + static void + DrawDragPiece () + { + if (!player.dragActive || appData.blindfold) + return; + + /* What we're doing: logically, the move hasn't been made yet, + so the piece is still in it's original square. But visually + it's being dragged around the board. So we erase the square + that the piece is on and draw it at the last known drag point. */ + BlankSquare(player.startSquare.x, player.startSquare.y, + player.startColor, EmptySquare, xBoardWindow); + AnimationFrame(&player, &player.prevFrame, player.dragPiece); + damage[player.startBoardY][player.startBoardX] = TRUE; + } + + void + SetProgramStats( FrontEndProgramStats * stats ) + { - // [HR] TODO ++ // [HR] TODO + // [HGM] done, but perhaps backend should call this directly? + EngineOutputUpdate( stats ); + } diff --cc xengineoutput.c index 0000000,a7d595d..6fe9931 mode 000000,100644..100644 --- a/xengineoutput.c +++ b/xengineoutput.c @@@ -1,0 -1,1293 +1,964 @@@ + /* + * Engine output (PV) + * + * Author: Alessandro Scotti (Dec 2005) + * + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * ------------------------------------------------------------------------ + */ -#include "config.h" - -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -#else /* not STDC_HEADERS */ -extern char *getenv(); -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if HAVE_UNISTD_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "xboard.h" -// Add xengineo.h later - ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++ ++#if STDC_HEADERS ++# include ++# include ++#else /* not STDC_HEADERS */ ++extern char *getenv(); ++# if HAVE_STRING_H ++# include ++# else /* not HAVE_STRING_H */ ++# include ++# endif /* not HAVE_STRING_H */ ++#endif /* not STDC_HEADERS */ ++ ++#if HAVE_UNISTD_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "common.h" ++#include "frontend.h" ++#include "backend.h" ++#include "xboard.h" ++// Add xengineo.h later ++#include "gettext.h" ++ ++#ifdef ENABLE_NLS ++# define _(s) gettext (s) ++# define N_(s) gettext_noop (s) ++#else ++# define _(s) (s) ++# define N_(s) s ++#endif ++ + #include - -// [HGM] pixmaps of some ICONS used in the engine-outut window -#include "pixmaps/WHITE_14.xpm" -#include "pixmaps/BLACK_14.xpm" -#include "pixmaps/CLEAR_14.xpm" -#include "pixmaps/UNKNOWN_14.xpm" -#include "pixmaps/THINKING_14.xpm" -#include "pixmaps/PONDER_14.xpm" -#include "pixmaps/ANALYZING_14.xpm" - ++ ++// [HGM] pixmaps of some ICONS used in the engine-outut window ++#include "pixmaps/WHITE_14.xpm" ++#include "pixmaps/BLACK_14.xpm" ++#include "pixmaps/CLEAR_14.xpm" ++#include "pixmaps/UNKNOWN_14.xpm" ++#include "pixmaps/THINKING_14.xpm" ++#include "pixmaps/PONDER_14.xpm" ++#include "pixmaps/ANALYZING_14.xpm" ++ + #ifdef SNAP + #include "wsnap.h" -#endif - -#define _LL_ 100 - -// imports from xboard.c -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; -extern Display *xDisplay; -extern Window xBoardWindow; -extern int squareSize; -extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap; -extern char *layoutName; - -// temporary kludge to avoid compile errors untill all Windows code has been replaced -#define HICON int * -#define HWND int * ++#endif ++ ++#define _LL_ 100 ++ ++// imports from xboard.c ++extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; ++extern Display *xDisplay; ++extern Window xBoardWindow; ++extern int squareSize; ++extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap; ++extern char *layoutName; ++ ++// temporary kludge to avoid compile errors untill all Windows code has been replaced ++#define HICON int * ++#define HWND int * + + // [HGM] define numbers to indicate icons, for referring to them in platform-independent way + #define nColorBlack 1 + #define nColorWhite 2 + #define nColorUnknown 3 + #define nClear 4 + #define nPondering 5 + #define nThinking 6 + #define nAnalyzing 7 + + Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle + + // [HGM] same for output fields (note that there are two of each type, one per color) + #define nColorIcon 1 + #define nStateIcon 2 + #define nLabel 3 + #define nStateData 4 + #define nLabelNPS 5 + #define nMemo 6 + + Widget outputField[2][7]; // [HGM] front-end array to translate output field to window handle + + void EngineOutputPopDown(); + void engineOutputPopUp(char *title, char *text); + int EngineOutputIsUp(); + static void SetEngineColorIcon( int which ); + + #define SHOW_PONDERING + + /* Imports from backend.c */ -char * SavePart(char *str); ++char * SavePart(char *str); + extern int opponentKibitzes; + + /* Imports from winboard.c */ + //extern HWND engineOutputDialog; + extern Arg layoutArgs[2], formArgs[2], messageArgs[4]; + + //extern WindowPlacement wpEngineOutput; - -Position engineOutputX = -1, engineOutputY = -1; -Dimension engineOutputW, engineOutputH; -Widget engineOutputShell; -int engineOutputDialogUp; - ++ ++Position engineOutputX = -1, engineOutputY = -1; ++Dimension engineOutputW, engineOutputH; ++Widget engineOutputShell; ++int engineOutputDialogUp; ++ + /* Module variables */ + #define H_MARGIN 2 + #define V_MARGIN 2 + #define LABEL_V_DISTANCE 1 /* Distance between label and memo */ + #define SPLITTER_SIZE 4 /* Distance between first memo and second label */ + + #define ICON_SIZE 14 + + #define STATE_UNKNOWN -1 + #define STATE_THINKING 0 + #define STATE_IDLE 1 + #define STATE_PONDERING 2 + #define STATE_ANALYZING 3 + + static int windowMode = 1; + + static int needInit = TRUE; + + static int lastDepth[2] = { -1, -1 }; + static int lastForwardMostMove[2] = { -1, -1 }; + static int engineState[2] = { -1, -1 }; + + typedef struct { + char * name; + int which; + int depth; - unsigned long nodes; ++ u64 nodes; + int score; + int time; + char * pv; + char * hint; + int an_move_index; + int an_move_count; + } EngineOutputData; + + static int VerifyDisplayMode(); + static void UpdateControls( EngineOutputData * ed ); + static SetEngineState( int which, int state, char * state_data ); - -void ReadIcon(char *pixData[], int iconNr) -{ - int r; - ++ ++void ReadIcon(char *pixData[], int iconNr) ++{ ++ int r; ++ + if ((r=XpmCreatePixmapFromData(xDisplay, XtWindow(outputField[0][nColorIcon]), + pixData, + &(icons[iconNr]), + NULL, NULL /*&attr*/)) != 0) { - fprintf(stderr, "Error %d loading icon image\n", r); ++ fprintf(stderr, _("Error %d loading icon image\n"), r); + exit(1); + } -} - ++} ++ + static void InitializeEngineOutput() -{ int i; - ++{ int i; ++ + ReadIcon(WHITE_14, nColorWhite); + ReadIcon(BLACK_14, nColorBlack); + ReadIcon(UNKNOWN_14, nColorUnknown); - ++ + ReadIcon(CLEAR_14, nClear); + ReadIcon(PONDER_14, nPondering); + ReadIcon(THINK_14, nThinking); + ReadIcon(ANALYZE_14, nAnalyzing); -// icons[nClear] = wIconPixmap; -// icons[nPondering] = bIconPixmap; // icons[nThinking] = wIconPixmap; -// icons[nAnalyzing] = bIconPixmap; } - -#if 0 -// Windows routines commented out - -// front end -static HICON LoadIconEx( int id ) -{ - return LoadImage( hInst, MAKEINTRESOURCE(id), IMAGE_ICON, ICON_SIZE, ICON_SIZE, 0 ); -} - -// [HGM] the platform-dependent way of indicating where output should go is now all -// concentrated here, where a table of platform-dependent handles are initialized. -// This cleanses most other routines of front-end stuff, so they can go into the back end. -static void InitializeEngineOutput() -{ - // if( needInit ) { // needInit was already tested before call - // [HGM] made this into a table, rather than separate global variables - icons[nColorBlack] = LoadIconEx( IDI_BLACK_14 ); - icons[nColorWhite] = LoadIconEx( IDI_WHITE_14 ); - icons[nColorUnknown] = LoadIconEx( IDI_UNKNOWN_14 ); - icons[nClear] = LoadIconEx( IDI_TRANS_14 ); - icons[nPondering] = LoadIconEx( IDI_PONDER_14 ); - icons[nThinking] = LoadIconEx( IDI_CLOCK_14 ); - icons[nAnalyzing] = LoadIconEx( IDI_ANALYZE2_14 ); - - // [HGM] also make a table of handles to output controls - // Note that engineOutputDialog must be defined first! - outputField[0][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color1 ); - outputField[0][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel1 ); - outputField[0][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon1 ); - outputField[0][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData1 ); - outputField[0][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine1_NPS ); - outputField[0][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo1 ); - - outputField[1][nColorIcon] = GetDlgItem( engineOutputDialog, IDC_Color2 ); - outputField[1][nLabel] = GetDlgItem( engineOutputDialog, IDC_EngineLabel2 ); - outputField[1][nStateIcon] = GetDlgItem( engineOutputDialog, IDC_StateIcon2 ); - outputField[1][nStateData] = GetDlgItem( engineOutputDialog, IDC_StateData2 ); - outputField[1][nLabelNPS] = GetDlgItem( engineOutputDialog, IDC_Engine2_NPS ); - outputField[1][nMemo] = GetDlgItem( engineOutputDialog, IDC_EngineMemo2 ); -// needInit = FALSE; -// } + } + -// front end -static void SetControlPos( HWND hDlg, int id, int x, int y, int width, int height ) -{ - HWND hControl = GetDlgItem( hDlg, id ); - - SetWindowPos( hControl, HWND_TOP, x, y, width, height, SWP_NOZORDER ); -} - -#define HIDDEN_X 20000 -#define HIDDEN_Y 20000 - -// front end -static void HideControl( HWND hDlg, int id ) -{ - HWND hControl = GetDlgItem( hDlg, id ); - RECT rc; - - GetWindowRect( hControl, &rc ); - - /* - Avoid hiding an already hidden control, because that causes many - unnecessary WM_ERASEBKGND messages! - */ - if( rc.left != HIDDEN_X || rc.top != HIDDEN_Y ) { - SetControlPos( hDlg, id, 20000, 20000, 100, 100 ); - } -} - -// front end, although we might make GetWindowRect front end instead -static int GetControlWidth( HWND hDlg, int id ) -{ - RECT rc; - - GetWindowRect( GetDlgItem( hDlg, id ), &rc ); - - return rc.right - rc.left; -} - -// front end? -static int GetControlHeight( HWND hDlg, int id ) -{ - RECT rc; - - GetWindowRect( GetDlgItem( hDlg, id ), &rc ); - - return rc.bottom - rc.top; -} - -static int GetHeaderHeight() -{ - int result = GetControlHeight( engineOutputDialog, IDC_EngineLabel1 ); - - if( result < ICON_SIZE ) result = ICON_SIZE; - - return result; -} - -// The size calculations should be backend? If setControlPos is a platform-dependent way of doing things, -// a platform-independent wrapper for it should be supplied. -static void PositionControlSet( HWND hDlg, int x, int y, int clientWidth, int memoHeight, int idColor, int idEngineLabel, int idNPS, int idMemo, int idStateIcon, int idStateData ) -{ - int label_x = x + ICON_SIZE + H_MARGIN; - int label_h = GetControlHeight( hDlg, IDC_EngineLabel1 ); - int label_y = y + ICON_SIZE - label_h; - int nps_w = GetControlWidth( hDlg, IDC_Engine1_NPS ); - int nps_x = clientWidth - H_MARGIN - nps_w; - int state_data_w = GetControlWidth( hDlg, IDC_StateData1 ); - int state_data_x = nps_x - H_MARGIN - state_data_w; - int state_icon_x = state_data_x - ICON_SIZE - 2; - int max_w = clientWidth - 2*H_MARGIN; - int memo_y = y + ICON_SIZE + LABEL_V_DISTANCE; - - SetControlPos( hDlg, idColor, x, y, ICON_SIZE, ICON_SIZE ); - SetControlPos( hDlg, idEngineLabel, label_x, label_y, state_icon_x - label_x, label_h ); - SetControlPos( hDlg, idStateIcon, state_icon_x, y, ICON_SIZE, ICON_SIZE ); - SetControlPos( hDlg, idStateData, state_data_x, label_y, state_data_w, label_h ); - SetControlPos( hDlg, idNPS, nps_x, label_y, nps_w, label_h ); - SetControlPos( hDlg, idMemo, x, memo_y, max_w, memoHeight ); -} - -// Also here some of the size calculations should go to the back end, and their actual application to a front-end routine -static void ResizeWindowControls( HWND hDlg, int mode ) -{ - RECT rc; - int headerHeight = GetHeaderHeight(); - int labelHeight = GetControlHeight( hDlg, IDC_EngineLabel1 ); - int labelOffset = H_MARGIN + ICON_SIZE + H_MARGIN; - int labelDeltaY = ICON_SIZE - labelHeight; - int clientWidth; - int clientHeight; - int maxControlWidth; - int npsWidth; - - /* Initialize variables */ - GetClientRect( hDlg, &rc ); - - clientWidth = rc.right - rc.left; - clientHeight = rc.bottom - rc.top; - - maxControlWidth = clientWidth - 2*H_MARGIN; - - npsWidth = GetControlWidth( hDlg, IDC_Engine1_NPS ); - - /* Resize controls */ - if( mode == 0 ) { - /* One engine */ - PositionControlSet( hDlg, H_MARGIN, V_MARGIN, - clientWidth, - clientHeight - V_MARGIN - LABEL_V_DISTANCE - headerHeight- V_MARGIN, - IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); - - /* Hide controls for the second engine */ - HideControl( hDlg, IDC_Color2 ); - HideControl( hDlg, IDC_EngineLabel2 ); - HideControl( hDlg, IDC_StateIcon2 ); - HideControl( hDlg, IDC_StateData2 ); - HideControl( hDlg, IDC_Engine2_NPS ); - HideControl( hDlg, IDC_EngineMemo2 ); - SendDlgItemMessage( hDlg, IDC_EngineMemo2, WM_SETTEXT, 0, (LPARAM) "" ); - /* TODO: we should also hide/disable them!!! what about tab stops?!?! */ - } - else { - /* Two engines */ - int memo_h = (clientHeight - headerHeight*2 - V_MARGIN*2 - LABEL_V_DISTANCE*2 - SPLITTER_SIZE) / 2; - int header1_y = V_MARGIN; - int header2_y = V_MARGIN + headerHeight + LABEL_V_DISTANCE + memo_h + SPLITTER_SIZE; - - PositionControlSet( hDlg, H_MARGIN, header1_y, clientWidth, memo_h, - IDC_Color1, IDC_EngineLabel1, IDC_Engine1_NPS, IDC_EngineMemo1, IDC_StateIcon1, IDC_StateData1 ); - - PositionControlSet( hDlg, H_MARGIN, header2_y, clientWidth, memo_h, - IDC_Color2, IDC_EngineLabel2, IDC_Engine2_NPS, IDC_EngineMemo2, IDC_StateIcon2, IDC_StateData2 ); - } - - InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo1), NULL, FALSE ); - InvalidateRect( GetDlgItem(hDlg,IDC_EngineMemo2), NULL, FALSE ); -} - -// front end. Actual printing of PV lines into the output field -static void InsertIntoMemo( int which, char * text ) -{ - SendMessage( outputField[which][nMemo], EM_SETSEL, 0, 0 ); - - SendMessage( outputField[which][nMemo], EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) text ); -} - -// front end. Associates an icon with an output field ("control" in Windows jargon). -// [HGM] let it find out the output field from the 'which' number by itself -static void SetIcon( int which, int field, int nIcon ) -{ - - if( nIcon != 0 ) { - SendMessage( outputField[which][field], STM_SETICON, (WPARAM) icons[nIcon], 0 ); - } -} - -// front end wrapper for SetWindowText, taking control number in stead of handle -void DoSetWindowText(int which, int field, char *s_label) -{ - SetWindowText( outputField[which][field], s_label ); -} -#endif - + void DoSetWindowText(int which, int field, char *s_label) + { + Arg arg; + + XtSetArg(arg, XtNlabel, (XtArgVal) s_label); + XtSetValues(outputField[which][field], &arg, 1); + } - ++ + static void InsertIntoMemo( int which, char * text ) -{ - Arg arg; XawTextBlock t; Widget edit; - ++{ ++ Arg arg; XawTextBlock t; Widget edit; ++ + t.ptr = text; t.firstPos = 0; t.length = strlen(text); t.format = XawFmt8Bit; + edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); - XawTextReplace(edit, 0, 0, &t); ++ XawTextReplace(edit, 0, 0, &t); + // XtSetArg(arg, XtNstring, (XtArgVal) text); + // XtSetValues(outputField[which][nMemo], &arg, 1); + } - -static void SetIcon( int which, int field, int nIcon ) -{ - Arg arg; ++ ++static void SetIcon( int which, int field, int nIcon ) ++{ ++ Arg arg; + + if( nIcon != 0 ) { + XtSetArg(arg, XtNleftBitmap, (XtArgVal) icons[nIcon]); + XtSetValues(outputField[which][field], &arg, 1); + } -} - -void DoClearMemo(int which) { Arg args[16]; ++} ++ ++void DoClearMemo(int which) ++{ ++ Arg args[16]; + int j; + Widget edit; - ++ + edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text"); + XtCallActionProc(edit, "select-all", NULL, NULL, 0); + XtCallActionProc(edit, "kill-selection", NULL, NULL, 0); -} ++} + + // The following routines are mutated clones of the commentPopUp routines + + void PositionControlSet(which, form, bw_width) + int which; + Widget form; - Dimension bw_width; { ++ Dimension bw_width; ++{ + Arg args[16]; + Widget edit, NameWidget, ColorWidget, ModeWidget, MoveWidget, NodesWidget; + int j, mutable=1; + j = 0; - XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; ++ XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNright, XtChainLeft); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 17); j++; - outputField[which][nColorIcon] = ColorWidget = ++ outputField[which][nColorIcon] = ColorWidget = + XtCreateManagedWidget("Color", labelWidgetClass, + form, args, j); - ++ + j = 0; - XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; - XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; ++ XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) ColorWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width/2 - 57); j++; - outputField[which][nLabel] = NameWidget = ++ outputField[which][nLabel] = NameWidget = + XtCreateManagedWidget("Engine", labelWidgetClass, + form, args, j); - ++ + j = 0; - XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; ++ XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) NameWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 20); j++; - outputField[which][nStateIcon] = ModeWidget = ++ outputField[which][nStateIcon] = ModeWidget = + XtCreateManagedWidget("Mode", labelWidgetClass, + form, args, j); - ++ + j = 0; - XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; - XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; ++ XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; + XtSetArg(args[j], XtNlabel, (XtArgVal) ""); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) ModeWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width/2 - 102); j++; - outputField[which][nStateData] = MoveWidget = ++ outputField[which][nStateData] = MoveWidget = + XtCreateManagedWidget("Move", labelWidgetClass, + form, args, j); - ++ + j = 0; - XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; ++ XtSetArg(args[j], XtNborderWidth, (XtArgVal) 0); j++; + XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyRight); j++; - XtSetArg(args[j], XtNlabel, (XtArgVal) "NPS"); j++; ++ XtSetArg(args[j], XtNlabel, (XtArgVal) _("NPS")); j++; + XtSetArg(args[j], XtNfromHoriz, (XtArgVal) MoveWidget); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; XtSetArg(args[j], XtNright, XtChainRight); j++; XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNheight, (XtArgVal) 16); j++; + XtSetArg(args[j], XtNwidth, (XtArgVal) 100); j++; - outputField[which][nLabelNPS] = NodesWidget = ++ outputField[which][nLabelNPS] = NodesWidget = + XtCreateManagedWidget("Nodes", labelWidgetClass, + form, args, j); - - // create "text" within "form" ++ ++ // create "text" within "form" + j = 0; + if (mutable) { + XtSetArg(args[j], XtNeditType, XawtextEdit); j++; + XtSetArg(args[j], XtNuseStringInPlace, False); j++; + } + XtSetArg(args[j], XtNstring, ""); j++; + XtSetArg(args[j], XtNdisplayCaret, False); j++; + XtSetArg(args[j], XtNtop, XtChainTop); j++; + XtSetArg(args[j], XtNbottom, XtChainBottom); j++; + XtSetArg(args[j], XtNleft, XtChainLeft); j++; + XtSetArg(args[j], XtNright, XtChainRight); j++; + XtSetArg(args[j], XtNresizable, True); j++; + XtSetArg(args[j], XtNwidth, bw_width); j++; /*force wider than buttons*/ + #if 0 + XtSetArg(args[j], XtNscrollVertical, XawtextScrollWhenNeeded); j++; + #else + /* !!Work around an apparent bug in XFree86 4.0.1 (X11R6.4.3) */ + XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; - XtSetArg(args[j], XtNscrollHorizontal, XawtextScrollWhenNeeded); j++; #endif ++ XtSetArg(args[j], XtNscrollHorizontal, XawtextScrollWhenNeeded); j++; ++#endif + // XtSetArg(args[j], XtNautoFill, True); j++; + // XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; + outputField[which][nMemo] = edit = + XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); + + j = 0; + XtSetArg(args[j], XtNfromVert, ColorWidget); j++; + // XtSetArg(args[j], XtNresizable, (XtArgVal) True); j++; + XtSetValues(edit, args, j); + } + + Widget EngineOutputCreate(name, text) + char *name, *text; + { + Arg args[16]; - Widget shell, layout, form, form2, edit; ++ Widget shell, layout, form, form2, edit; + Dimension bw_width, bw_height; + int j; + - // get board width ++ // get board width + j = 0; - XtSetArg(args[j], XtNwidth, &bw_width); j++; XtSetArg(args[j], XtNheight, &bw_height); j++; XtGetValues(boardWidget, args, j); ++ XtSetArg(args[j], XtNwidth, &bw_width); j++; ++ XtSetArg(args[j], XtNheight, &bw_height); j++; ++ XtGetValues(boardWidget, args, j); + - // define form within layout within shell. ++ // define form within layout within shell. + j = 0; + XtSetArg(args[j], XtNresizable, True); j++; + shell = + XtCreatePopupShell(name, transientShellWidgetClass, + shellWidget, args, j); + layout = + XtCreateManagedWidget(layoutName, formWidgetClass, shell, + layoutArgs, XtNumber(layoutArgs)); - // divide window vertically into two equal parts, by creating two forms ++ // divide window vertically into two equal parts, by creating two forms + form = + XtCreateManagedWidget("form", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); + form2 = + XtCreateManagedWidget("form2", formWidgetClass, layout, + formArgs, XtNumber(formArgs)); - j = 0; XtSetArg(args[j], XtNfromVert, (XtArgVal) form); j++; XtSetValues(form2, args, j); - // make sure width is known in advance, for better placement of child widgets - j = 0; XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width-16); j++; XtSetArg(args[j], XtNheight, (XtArgVal) bw_height/2); j++; XtSetValues(shell, args, j); - - // fill up both forms with control elements - PositionControlSet(0, form, bw_width); - PositionControlSet(1, form2, bw_width); ++ j = 0; ++ XtSetArg(args[j], XtNfromVert, (XtArgVal) form); j++; ++ XtSetValues(form2, args, j); ++ // make sure width is known in advance, for better placement of child widgets ++ j = 0; ++ XtSetArg(args[j], XtNwidth, (XtArgVal) bw_width-16); j++; ++ XtSetArg(args[j], XtNheight, (XtArgVal) bw_height/2); j++; ++ XtSetValues(shell, args, j); ++ ++ // fill up both forms with control elements ++ PositionControlSet(0, form, bw_width); ++ PositionControlSet(1, form2, bw_width); + + XtRealizeWidget(shell); - ++ + if (engineOutputX == -1) { + int xx, yy; + Window junk; + Dimension pw_height; + Dimension ew_height; + #if 0 + j = 0; + XtSetArg(args[j], XtNheight, &ew_height); j++; + XtGetValues(edit, args, j); + + j = 0; + XtSetArg(args[j], XtNheight, &pw_height); j++; + XtGetValues(shell, args, j); + engineOutputH = pw_height + (lines - 1) * ew_height; - engineOutputW = bw_width - 16; -#else - engineOutputH = bw_height/2; engineOutputW = bw_width-16; #endif ++ engineOutputW = bw_width - 16; ++#else ++ engineOutputH = bw_height/2; ++ engineOutputW = bw_width-16; ++#endif + + XSync(xDisplay, False); + #ifdef NOTDEF + /* This code seems to tickle an X bug if it is executed too soon + after xboard starts up. The coordinates get transformed as if + the main window was positioned at (0, 0). + */ + XtTranslateCoords(shellWidget, + (bw_width - engineOutputW) / 2, 0 - engineOutputH / 2, + &engineOutputX, &engineOutputY); + #else /*!NOTDEF*/ + XTranslateCoordinates(xDisplay, XtWindow(shellWidget), + RootWindowOfScreen(XtScreen(shellWidget)), + (bw_width - engineOutputW) / 2, 0 - engineOutputH / 2, + &xx, &yy, &junk); + engineOutputX = xx; + engineOutputY = yy; + #endif /*!NOTDEF*/ + if (engineOutputY < 0) engineOutputY = 0; /*avoid positioning top offscreen*/ + } + j = 0; - XtSetArg(args[j], XtNheight, engineOutputH); j++; XtSetArg(args[j], XtNwidth, engineOutputW); j++; ++ XtSetArg(args[j], XtNheight, engineOutputH); j++; ++ XtSetArg(args[j], XtNwidth, engineOutputW); j++; + XtSetArg(args[j], XtNx, engineOutputX); j++; + XtSetArg(args[j], XtNy, engineOutputY); j++; + XtSetValues(shell, args, j); + // XtSetKeyboardFocus(shell, edit); + + return shell; + } + -void ResizeWindowControls(shell, mode) - Widget shell; - int mode; -{ - Widget form1, form2; - Arg args[16]; - int j; - Dimension ew_height, tmp; - ++void ResizeWindowControls(shell, mode) ++ Widget shell; ++ int mode; ++{ ++ Widget form1, form2; ++ Arg args[16]; ++ int j; ++ Dimension ew_height, tmp; ++ + form1 = XtNameToWidget(shell, "*form"); - form2 = XtNameToWidget(shell, "*form2"); - - j = 0; - XtSetArg(args[j], XtNheight, (XtArgVal) &ew_height); j++; XtGetValues(form1, args, j); - j = 0; - XtSetArg(args[j], XtNheight, (XtArgVal) &tmp); j++; XtGetValues(form2, args, j); - ew_height += tmp; // total height ++ form2 = XtNameToWidget(shell, "*form2"); ++ ++ j = 0; ++ XtSetArg(args[j], XtNheight, (XtArgVal) &ew_height); j++; ++ XtGetValues(form1, args, j); ++ j = 0; ++ XtSetArg(args[j], XtNheight, (XtArgVal) &tmp); j++; ++ XtGetValues(form2, args, j); ++ ew_height += tmp; // total height + + if(mode==0) { - j = 0; ++ j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) 5); j++; - XtSetValues(form2, args, j); - j = 0; ++ XtSetValues(form2, args, j); ++ j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height-5)); j++; - XtSetValues(form1, args, j); - } else { - j = 0; ++ XtSetValues(form1, args, j); ++ } else { ++ j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++; - XtSetValues(form1, args, j); - j = 0; ++ XtSetValues(form1, args, j); ++ j = 0; + XtSetArg(args[j], XtNheight, (XtArgVal) (ew_height/2)); j++; - XtSetValues(form2, args, j); - } -} - -#if 0 -void EngineOutputCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Arg args[16]; - int j; - - j = 0; - XtSetArg(args[j], XtNlabel, &name); j++; - XtGetValues(w, args, j); - - if (strcmp(name, "close") == 0) { - EngineOutputPopDown(); - } else if (strcmp(name, "edit") == 0) { - EngineOutputPopDown(); - EditCommentEvent(); - } -} -#endif - -#if 0 -// This seems pure front end -LRESULT CALLBACK EngineOutputProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) -{ - static SnapData sd; - - switch (message) { - case WM_INITDIALOG: - if( engineOutputDialog == NULL ) { - engineOutputDialog = hDlg; - - RestoreWindowPlacement( hDlg, &wpEngineOutput ); /* Restore window placement */ - - ResizeWindowControls( hDlg, windowMode ); - - SetEngineState( 0, STATE_IDLE, "" ); - SetEngineState( 1, STATE_IDLE, "" ); - } - - return FALSE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - EndDialog(hDlg, TRUE); - return TRUE; - - case IDCANCEL: - EndDialog(hDlg, FALSE); - return TRUE; - - default: - break; - } - - break; - - case WM_GETMINMAXINFO: - { - MINMAXINFO * mmi = (MINMAXINFO *) lParam; - - mmi->ptMinTrackSize.x = 100; - mmi->ptMinTrackSize.y = 160; - } - break; - - case WM_CLOSE: - EngineOutputPopDown(); - break; - - case WM_SIZE: - ResizeWindowControls( hDlg, windowMode ); - break; - - case WM_ENTERSIZEMOVE: - return OnEnterSizeMove( &sd, hDlg, wParam, lParam ); - - case WM_SIZING: - return OnSizing( &sd, hDlg, wParam, lParam ); - - case WM_MOVING: - return OnMoving( &sd, hDlg, wParam, lParam ); - - case WM_EXITSIZEMOVE: - return OnExitSizeMove( &sd, hDlg, wParam, lParam ); ++ XtSetValues(form2, args, j); + } - - return FALSE; + } -#endif + + void EngineOutputPopUp(title, text) + char *title, *text; + { + Arg args[16]; + int j; + Widget edit; + + if (engineOutputShell == NULL) { + engineOutputShell = + EngineOutputCreate(title, text); + XtRealizeWidget(engineOutputShell); + CatchDeleteWindow(engineOutputShell, "EngineOutputPopDown"); + if( needInit ) { + InitializeEngineOutput(); - needInit = FALSE; } ++ needInit = FALSE; ++ } + SetEngineColorIcon( 0 ); + SetEngineColorIcon( 1 ); + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); - } else { ++ } else { + edit = XtNameToWidget(engineOutputShell, "*form.text"); + j = 0; + XtSetArg(args[j], XtNstring, text); j++; + XtSetValues(edit, args, j); + j = 0; + XtSetArg(args[j], XtNiconName, (XtArgVal) title); j++; + XtSetArg(args[j], XtNtitle, (XtArgVal) title); j++; + XtSetValues(engineOutputShell, args, j); + } + + XtPopup(engineOutputShell, XtGrabNone); + XSync(xDisplay, False); + - j=0; - XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), - args, j); - - engineOutputDialogUp = True; - ShowThinkingEvent(); // [HGM] thinking: might need to prompt engine for thinking output -} - -#if 0 -// front end -void EngineOutputPopUp() -{ - FARPROC lpProc; - - CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_CHECKED); - - if( engineOutputDialog ) { - SendMessage( engineOutputDialog, WM_INITDIALOG, 0, 0 ); - - if( ! engineOutputDialogUp ) { - ShowWindow(engineOutputDialog, SW_SHOW); - } - } - else { - lpProc = MakeProcInstance( (FARPROC) EngineOutputProc, hInst ); - - /* Note to self: dialog must have the WS_VISIBLE style set, otherwise it's not shown! */ - CreateDialog( hInst, MAKEINTRESOURCE(DLG_EngineOutput), hwndMain, (DLGPROC)lpProc ); - - FreeProcInstance(lpProc); - } - - // [HGM] displaced to after creation of dialog, to allow initialization of output fields - if( needInit ) { - InitializeEngineOutput(); - needInit = FALSE; - } ++ j=0; ++ XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; ++ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), ++ args, j); + - engineOutputDialogUp = TRUE; ++ engineOutputDialogUp = True; ++ ShowThinkingEvent(); // [HGM] thinking: might need to prompt engine for thinking output + } -#endif + + void EngineOutputPopDown() + { + Arg args[16]; + int j; + + if (!engineOutputDialogUp) return; - DoClearMemo(1); ++ DoClearMemo(1); + j = 0; + XtSetArg(args[j], XtNx, &engineOutputX); j++; + XtSetArg(args[j], XtNy, &engineOutputY); j++; + XtSetArg(args[j], XtNwidth, &engineOutputW); j++; + XtSetArg(args[j], XtNheight, &engineOutputH); j++; + XtGetValues(engineOutputShell, args, j); + XtPopdown(engineOutputShell); - XSync(xDisplay, False); - j=0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), - args, j); ++ XSync(xDisplay, False); ++ j=0; ++ XtSetArg(args[j], XtNleftBitmap, None); j++; ++ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Engine Output"), ++ args, j); + + engineOutputDialogUp = False; - ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output -} - -#if 0 -// front end -void EngineOutputPopDown() -{ - CheckMenuItem(GetMenu(hwndMain), IDM_ShowEngineOutput, MF_UNCHECKED); - - if( engineOutputDialog ) { - ShowWindow(engineOutputDialog, SW_HIDE); - } - - engineOutputDialogUp = FALSE; ++ ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output + } + -// front end. [HGM] Takes handle of output control from table, so only number is passed -void DoClearMemo(int which) -{ - SendMessage( outputField[which][nMemo], WM_SETTEXT, 0, (LPARAM) "" ); -} -#endif - + //------------------------ pure back-end routines ------------------------------- + + + // back end, due to front-end wrapper for SetWindowText, and new SetIcon arguments + static SetEngineState( int which, int state, char * state_data ) + { + int x_which = 1 - which; + + if( engineState[ which ] != state ) { + engineState[ which ] = state; + + switch( state ) { + case STATE_THINKING: + SetIcon( which, nStateIcon, nThinking ); + if( engineState[ x_which ] == STATE_THINKING ) { + SetEngineState( x_which, STATE_IDLE, "" ); + } + break; + case STATE_PONDERING: + SetIcon( which, nStateIcon, nPondering ); + break; + case STATE_ANALYZING: + SetIcon( which, nStateIcon, nAnalyzing ); + break; + default: + SetIcon( which, nStateIcon, nClear ); + break; + } + } + + if( state_data != 0 ) { + DoSetWindowText( which, nStateData, state_data ); + } + } + + // back end, now the front-end wrapper ClearMemo is used, and ed no longer contains handles. + void EngineOutputUpdate( FrontEndProgramStats * stats ) + { + EngineOutputData ed; + int clearMemo = FALSE; + int which; + int depth; + + if( stats == 0 ) { + SetEngineState( 0, STATE_IDLE, "" ); + SetEngineState( 1, STATE_IDLE, "" ); + return; + } + - if(gameMode == IcsObserving) return; // [HGM] kibitz: shut up engine if we are observing an ICS game - ++ if(gameMode == IcsObserving && !appData.icsEngineAnalyze) ++ return; // [HGM] kibitz: shut up engine if we are observing an ICS game ++ + which = stats->which; + depth = stats->depth; + + if( which < 0 || which > 1 || depth < 0 || stats->time < 0 || stats->pv == 0 ) { + return; + } + + if( engineOutputShell == NULL ) { + return; + } + + VerifyDisplayMode(); + + ed.which = which; + ed.depth = depth; + ed.nodes = stats->nodes; + ed.score = stats->score; + ed.time = stats->time; + ed.pv = stats->pv; + ed.hint = stats->hint; + ed.an_move_index = stats->an_move_index; + ed.an_move_count = stats->an_move_count; + + /* Get target control. [HGM] this is moved to front end, which get them from a table */ + if( which == 0 ) { + ed.name = first.tidy; + } + else { + ed.name = second.tidy; + } + + /* Clear memo if needed */ + if( lastDepth[which] > depth || (lastDepth[which] == depth && depth <= 1) ) { + clearMemo = TRUE; + } + + if( lastForwardMostMove[which] != forwardMostMove ) { + clearMemo = TRUE; + } + + if( clearMemo ) DoClearMemo(which); + + /* Update */ + lastDepth[which] = depth; + lastForwardMostMove[which] = forwardMostMove; + + if( ed.pv != 0 && ed.pv[0] == ' ' ) { + if( strncmp( ed.pv, " no PV", 6 ) == 0 ) { /* Hack on hack! :-O */ + ed.pv = ""; + } + } + + UpdateControls( &ed ); + } + + #define ENGINE_COLOR_WHITE 'w' + #define ENGINE_COLOR_BLACK 'b' + #define ENGINE_COLOR_UNKNOWN ' ' + + // pure back end + char GetEngineColor( int which ) + { + char result = ENGINE_COLOR_UNKNOWN; + + if( which == 0 || which == 1 ) { + ChessProgramState * cps; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + result = ENGINE_COLOR_BLACK; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + result = ENGINE_COLOR_WHITE; + break; + case AnalyzeMode: + case AnalyzeFile: + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + case TwoMachinesPlay: + cps = (which == 0) ? &first : &second; + result = cps->twoMachinesColor[0]; + result = result == 'w' ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + break; + } + } + + return result; + } + + // pure back end + char GetActiveEngineColor() + { + char result = ENGINE_COLOR_UNKNOWN; + + if( gameMode == TwoMachinesPlay ) { + result = WhiteOnMove(forwardMostMove) ? ENGINE_COLOR_WHITE : ENGINE_COLOR_BLACK; + } + + return result; + } + + // pure back end + static int IsEnginePondering( int which ) + { + int result = FALSE; + + switch (gameMode) { + case MachinePlaysBlack: + case IcsPlayingBlack: + if( WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case MachinePlaysWhite: + case IcsPlayingWhite: + if( ! WhiteOnMove(forwardMostMove) ) result = TRUE; + break; + case TwoMachinesPlay: + if( GetActiveEngineColor() != ENGINE_COLOR_UNKNOWN ) { + if( GetEngineColor( which ) != GetActiveEngineColor() ) result = TRUE; + } + break; + } + + return result; + } + + // back end + static void SetDisplayMode( int mode ) + { + if( windowMode != mode ) { + windowMode = mode; + + ResizeWindowControls( engineOutputShell, mode ); + } + } + + // pure back end + int VerifyDisplayMode() + { + int mode; + + /* Get proper mode for current game */ + switch( gameMode ) { ++ case IcsObserving: // [HGM] ICS analyze ++ if(!appData.icsEngineAnalyze) return; + case AnalyzeMode: + case AnalyzeFile: + case MachinePlaysWhite: + case MachinePlaysBlack: + mode = 0; + break; + case IcsPlayingWhite: + case IcsPlayingBlack: + mode = appData.zippyPlay && opponentKibitzes; // [HGM] kibitz + break; + case TwoMachinesPlay: + mode = 1; + break; + default: + /* Do not change */ + return; + } + + SetDisplayMode( mode ); + } + + // back end. Determine what icon to se in the color-icon field, and print it + static void SetEngineColorIcon( int which ) + { + char color = GetEngineColor(which); + int nicon = 0; + + if( color == ENGINE_COLOR_BLACK ) + nicon = nColorBlack; + else if( color == ENGINE_COLOR_WHITE ) + nicon = nColorWhite; + else + nicon = nColorUnknown; + + SetIcon( which, nColorIcon, nicon ); + } + + #define MAX_NAME_LENGTH 32 + + // pure back end, now SetWindowText is called via wrapper DoSetWindowText + static void UpdateControls( EngineOutputData * ed ) + { + int isPondering = FALSE; + + char s_label[MAX_NAME_LENGTH + 32]; + + char * name = ed->name; + + /* Label */ + if( name == 0 || *name == '\0' ) { + name = "?"; + } + + strncpy( s_label, name, MAX_NAME_LENGTH ); + s_label[ MAX_NAME_LENGTH-1 ] = '\0'; + + #ifdef SHOW_PONDERING + if( IsEnginePondering( ed->which ) ) { + char buf[8]; + + buf[0] = '\0'; + + if( ed->hint != 0 && *ed->hint != '\0' ) { + strncpy( buf, ed->hint, sizeof(buf) ); + buf[sizeof(buf)-1] = '\0'; + } + else if( ed->pv != 0 && *ed->pv != '\0' ) { + char * sep = strchr( ed->pv, ' ' ); + int buflen = sizeof(buf); + + if( sep != NULL ) { + buflen = sep - ed->pv + 1; + if( buflen > sizeof(buf) ) buflen = sizeof(buf); + } + + strncpy( buf, ed->pv, buflen ); + buf[ buflen-1 ] = '\0'; + } + + SetEngineState( ed->which, STATE_PONDERING, buf ); + } + else if( gameMode == TwoMachinesPlay ) { + SetEngineState( ed->which, STATE_THINKING, "" ); + } - else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ) { ++ else if( gameMode == AnalyzeMode || gameMode == AnalyzeFile ++ || gameMode == IcsObserving && appData.icsEngineAnalyze) { // [HGM] ICS-analyze + char buf[64]; + int time_secs = ed->time / 100; + int time_mins = time_secs / 60; + + buf[0] = '\0'; + + if( ed->an_move_index != 0 && ed->an_move_count != 0 && *ed->hint != '\0' ) { + char mov[16]; + + strncpy( mov, ed->hint, sizeof(mov) ); + mov[ sizeof(mov)-1 ] = '\0'; + + sprintf( buf, "%d/%d: %s [%02d:%02d:%02d]", ed->an_move_index, ed->an_move_count, mov, time_mins / 60, time_mins % 60, time_secs % 60 ); + } + + SetEngineState( ed->which, STATE_ANALYZING, buf ); + } + else { + SetEngineState( ed->which, STATE_IDLE, "" ); + } + #endif + + DoSetWindowText( ed->which, nLabel, s_label ); + + s_label[0] = '\0'; + + if( ed->time > 0 && ed->nodes > 0 ) { + unsigned long nps_100 = ed->nodes / ed->time; + + if( nps_100 < 100000 ) { - sprintf( s_label, "NPS: %lu", nps_100 * 100 ); ++ sprintf( s_label, _("NPS: %lu"), nps_100 * 100 ); + } + else { - sprintf( s_label, "NPS: %.1fk", nps_100 / 10.0 ); ++ sprintf( s_label, _("NPS: %.1fk"), nps_100 / 10.0 ); + } + } + + DoSetWindowText( ed->which, nLabelNPS, s_label ); + + /* Memo */ + if( ed->pv != 0 && *ed->pv != '\0' ) { + char s_nodes[24]; + char s_score[16]; + char s_time[24]; + char buf[256]; + int buflen; + int time_secs = ed->time / 100; + int time_cent = ed->time % 100; + + /* Nodes */ + if( ed->nodes < 1000000 ) { - sprintf( s_nodes, "%lu", ed->nodes ); ++ sprintf( s_nodes, u64Display, ed->nodes ); + } + else { - sprintf( s_nodes, "%.1fM", ed->nodes / 1000000.0 ); ++ sprintf( s_nodes, "%.1fM", u64ToDouble(ed->nodes) / 1000000.0 ); + } + + /* Score */ + if( ed->score > 0 ) { + sprintf( s_score, "+%.2f", ed->score / 100.0 ); + } else + sprintf( s_score, "%.2f", ed->score / 100.0 ); + + /* Time */ + sprintf( s_time, "%d:%02d.%02d", time_secs / 60, time_secs % 60, time_cent ); + + /* Put all together... */ + sprintf( buf, "%3d %s %s\t%s\t", ed->depth, s_score, s_nodes, s_time ); + + /* Add PV */ + buflen = strlen(buf); + + strncpy( buf + buflen, ed->pv, sizeof(buf) - buflen ); + + buf[ sizeof(buf) - 3 ] = '\0'; + + strcat( buf + buflen, "\n" ); + + /* Update memo */ + InsertIntoMemo( ed->which, buf ); + } + + /* Colors */ + SetEngineColorIcon( ed->which ); + } + + // back end + int EngineOutputIsUp() + { + return engineOutputDialogUp; + } - -void -EngineOutputProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - if (engineOutputDialogUp) { - EngineOutputPopDown(); - } else { - EngineOutputPopUp("engine output","This feature is experimental"); - } -// ToNrEvent(currentMove); -} - -// [HGM] kibitz: write kibitz line; split window for it if necessary -void OutputKibitz(int window, char *text) -{ - if(!EngineOutputIsUp()) return; - if(!opponentKibitzes) { // on first kibitz of game, clear memos - DoClearMemo(1); - if(gameMode == IcsObserving) DoClearMemo(0); - } - opponentKibitzes = TRUE; // this causes split window DisplayMode in ICS modes. - VerifyDisplayMode(); - if(gameMode == IcsObserving) { - DoSetWindowText(0, nLabel, gameInfo.white); - SetIcon( 0, nColorIcon, nColorWhite); - SetIcon( 0, nStateIcon, nClear); - } - DoSetWindowText(1, nLabel, gameMode == IcsPlayingBlack ? gameInfo.white : gameInfo.black); // opponent name - SetIcon( 1, nColorIcon, gameMode == IcsPlayingBlack ? nColorWhite : nColorBlack); - SetIcon( 1, nStateIcon, nClear); - InsertIntoMemo(window-1, text); -} - ++ ++void ++EngineOutputProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ if (engineOutputDialogUp) { ++ EngineOutputPopDown(); ++ } else { ++ EngineOutputPopUp(_("engine output"),_("This feature is experimental")); ++ } ++// ToNrEvent(currentMove); ++} ++ ++// [HGM] kibitz: write kibitz line; split window for it if necessary ++void OutputKibitz(char *text) ++{ ++ if(!EngineOutputIsUp()) return; ++ if(!opponentKibitzes) DoClearMemo(1); ++ opponentKibitzes = TRUE; // thas causes split window DisplayMode in ICS modes. ++ VerifyDisplayMode(); ++ DoSetWindowText(1, nLabel, gameMode == IcsPlayingWhite ? gameInfo.black : gameInfo.white); // opponent name ++ SetIcon( 1, nColorIcon, gameMode == IcsPlayingWhite ? nColorBlack : nColorWhite); ++ InsertIntoMemo(1, text); ++} diff --cc xhistory.c index bbdc0bf,5640fee..6fe5b92 --- a/xhistory.c +++ b/xhistory.c @@@ -1,492 -1,503 +1,505 @@@ --/* -- * xhistory.c -- Move list window, part of X front end for XBoard - * $Id$ - * - * Copyright 2000 Free Software Foundation, Inc. - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - * - * See the file ChangeLog for a revision history. - */ - - #include "config.h" - - #include - #include - #include - #include - - #if STDC_HEADERS - # include - # include - #else /* not STDC_HEADERS */ - extern char *getenv(); - # if HAVE_STRING_H - # include - # else /* not HAVE_STRING_H */ - # include - # endif /* not HAVE_STRING_H */ - #endif /* not STDC_HEADERS */ - - #if HAVE_UNISTD_H - # include - #endif - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #include "common.h" - #include "frontend.h" - #include "backend.h" - #include "xboard.h" - #include "xhistory.h" - #include "gettext.h" - - #ifdef ENABLE_NLS - # define _(s) gettext (s) - # define N_(s) gettext_noop (s) - #else - # define _(s) (s) - # define N_(s) s - #endif - - #define _LL_ 100 - - extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; - extern Display *xDisplay; - extern int squareSize; - extern Pixmap xMarkPixmap; - extern char *layoutName; - - struct History{ - String *Nr,*white,*black; - int aNr; /* space actually alocated */ - Widget mvn,mvw,mvb,vbox,viewport,sh; - char Up; - }; - - struct History *hist=0; - String dots=" ... "; - - void - HistoryPopDown(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; - { - Arg args[16]; - int j; - if(hist) - - XtPopdown(hist->sh); - hist->Up=False; - - j=0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), - args, j); - } - - void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) - { - int to; - XawListReturnStruct *R = (XawListReturnStruct *) call_data; - if (w == hist->mvn || w == hist->mvw) { - to=2*R->list_index-1; - ToNrEvent(to); - } - else if (w == hist->mvb) { - to=2*R->list_index; - ToNrEvent(to); - } - } - - void HistoryAlloc(int len){ - int i; - if(hist){ - free(hist->Nr[0]);free(hist->white[0]);free(hist->black[0]); - free(hist->Nr);free(hist->white);free(hist->black); - } - else{ - hist=(struct History*)malloc(sizeof(struct History)); - } - hist->aNr=len; - hist->Nr=(String*)malloc(hist->aNr*sizeof(String*)); - hist->white=(String*)malloc(hist->aNr*sizeof(String*)); - hist->black=(String*)malloc(hist->aNr*sizeof(String*)); - - hist->Nr[0]=(String)malloc(hist->aNr*6); - hist->white[0]=(String)malloc(hist->aNr*MOVE_LEN); - hist->black[0]=(String)malloc(hist->aNr*MOVE_LEN); - - sprintf(hist->Nr[0]," "); - sprintf(hist->white[0],_("White ")); - sprintf(hist->black[0],_("Black ")); - for(i=1;iaNr;i++){ - hist->Nr[i]= hist->Nr[i-1]+6; - hist->white[i]= hist->white[i-1]+MOVE_LEN; - hist->black[i]= hist->black[i-1]+MOVE_LEN; - sprintf(hist->Nr[i],"%i.",i); - sprintf(hist->white[i],"-----"); - sprintf(hist->black[i],"-----"); - } - } - - - #if 1 - /* Find empty space inside vbox form widget and redistribute it amongst - the list widgets inside it. */ - /* This version sort of works */ - void - HistoryFill() - { - Dimension w, bw; - long extra; - Position x, x1, x2; - int j, dd; - Arg args[16]; - - j = 0; - XtSetArg(args[j], XtNx, &x); j++; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNborderWidth, &bw); j++; - XtGetValues(hist->mvb, args, j); - x1 = x + w + 2*bw; - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNdefaultDistance, &dd); j++; - XtGetValues(hist->vbox, args, j); - x2 = w - dd; - - extra = x2 - x1; - if (extra < 0) { - extra = -((-extra)/2); - } else { - extra = extra/2; - } - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvw, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvb, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvb, args, j); - } - #else - /* Find empty space inside vbox form widget and redistribute it amongst - the list widgets inside it. */ - /* This version doesn't work */ - void - HistoryFill() - { - Arg args[16]; - Dimension fw, niw, wiw, biw, nbw, wbw, bbw; - int j, nl, wl, bl, fdd; - long extra; - - j = 0; - XtSetArg(args[j], XtNwidth, &fw); j++; - XtSetArg(args[j], XtNdefaultDistance, &fdd); j++; - XtGetValues(hist->vbox, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &nl); j++; - XtSetArg(args[j], XtNinternalWidth, &niw); j++; - XtSetArg(args[j], XtNborderWidth, &nbw); j++; - XtGetValues(hist->mvn, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &wl); j++; - XtSetArg(args[j], XtNinternalWidth, &wiw); j++; - XtSetArg(args[j], XtNborderWidth, &wbw); j++; - XtGetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &bl); j++; - XtSetArg(args[j], XtNinternalWidth, &biw); j++; - XtSetArg(args[j], XtNborderWidth, &bbw); j++; - XtGetValues(hist->mvb, args, j); - - extra = fw - 4*fdd - - nl - 1 - 2*niw - 2*nbw - wl - 2*wiw - 2*wbw - bl - 2*biw - 2*bbw; - if (extra < 0) extra = 0; - - j = 0; - XtSetArg(args[j], XtNwidth, nl + 1 + 2*niw); j++; - XtSetValues(hist->mvn, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, wl + 2*wiw + extra/2); j++; - XtSetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, bl + 2*biw + extra/2); j++; - XtSetValues(hist->mvb, args, j); - } - #endif - - void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current){ - int i,b,m; - if(hist){ - if(last >= hist->aNr) HistoryAlloc(last+_LL_); - for(i=0;iwhite[i/2+1], movelist[i], p-movelist[i]); - hist->white[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->white[i/2+1],movelist[i]); - } - } else { - strcpy(hist->white[i/2+1],dots); - } - } else { - if(movelist[i][0]) { - char* p = strchr(movelist[i], ' '); - if (p) { - strncpy(hist->black[i/2+1], movelist[i], p-movelist[i]); - hist->black[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->black[i/2+1],movelist[i]); - } - } else { - strcpy(hist->black[i/2+1],""); - } - } - } - strcpy(hist->black[last/2+1],""); - b=first/2; - m=(last+3)/2-b; - XawFormDoLayout(hist->vbox, False); - XawListChange(hist->mvn,hist->Nr+b,m,0,True); - XawListChange(hist->mvw,hist->white+b,m,0,True); - XawListChange(hist->mvb,hist->black+b,m,0,True); - HistoryFill(); - XawFormDoLayout(hist->vbox, True); - if(current<0){ - XawListUnhighlight(hist->mvw); - XawListUnhighlight(hist->mvb); - } - else if((current%2)==0){ - XawListHighlight(hist->mvw, current/2+1); - XawListUnhighlight(hist->mvb); - } - else{ - XawListUnhighlight(hist->mvw); - if(current) XawListHighlight(hist->mvb, current/2+1); - else XawListUnhighlight(hist->mvb); - } - } - } - - Widget HistoryCreate() - { - Arg args[16]; - int i,j; - - Widget layout,form,b_close; - String trstr= - "Up: BackwardProc() \n \ - Left: BackwardProc() \n \ - Down: ForwardProc() \n \ - Right: ForwardProc() \n"; - /*--- allocate memory for move-strings ---*/ - HistoryAlloc(_LL_); - - /*-------- create the widgets ---------------*/ - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNallowShellResize, True); j++; - #if TOPLEVEL - hist->sh = - XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass, - shellWidget, args, j); - #else - hist->sh = - XtCreatePopupShell(_("Move list"), transientShellWidgetClass, - shellWidget, args, j); - #endif - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNdefaultDistance, 0); j++; - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, - args, j); - - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable, True); j++; - - form = - XtCreateManagedWidget("form", formWidgetClass, layout, args, j); - j=0; - - j = 0; - - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNresizable, False); j++; - XtSetArg(args[j], XtNallowVert, True); j++; - XtSetArg(args[j], XtNallowHoriz, True); j++; - XtSetArg(args[j], XtNforceBars, False); j++; - XtSetArg(args[j], XtNheight, 280); j++; - hist->viewport = - XtCreateManagedWidget("viewport", viewportWidgetClass, - form, args, j); - j=0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; - hist->vbox = - XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; - hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtRubber); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; - hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNfromVert, hist->viewport); j++; - b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass, - form, args, j); - XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); - - XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); - - XtRealizeWidget(hist->sh); - CatchDeleteWindow(hist->sh, "HistoryPopDown"); - - for(i=1;iaNr;i++){ - strcpy(hist->white[i],dots); - strcpy(hist->black[i],""); - } - - return hist->sh; - } - - void - HistoryPopUp() - { - Arg args[16]; - int j; - - if(!hist) HistoryCreate(); - XtPopup(hist->sh, XtGrabNone); - j=0; - XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), - args, j); - hist->Up=True; - } - - - void - HistoryShowProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; - { - if (!hist) { - HistoryCreate(); - HistoryPopUp(); - } else if (hist->Up) { - HistoryPopDown(0,0,0); - } else { - HistoryPopUp(); - } - ToNrEvent(currentMove); - } - - * $Id: xhistory.c,v 2.1 2003/10/27 19:21:00 mann Exp $ - * - * Copyright 2000 Free Software Foundation, Inc. - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - * - * See the file ChangeLog for a revision history. - */ - -#include "config.h" - -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -#else /* not STDC_HEADERS */ -extern char *getenv(); -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if HAVE_UNISTD_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "frontend.h" -#include "backend.h" -#include "xboard.h" -#include "xhistory.h" - - -#define _LL_ 100 - -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; -extern Display *xDisplay; -extern int squareSize; -extern Pixmap xMarkPixmap; -extern char *layoutName; - -struct History{ - String *Nr,*white,*black; - int aNr; /* space actually alocated */ - Widget mvn,mvw,mvb,vbox,viewport,sh; - char Up; -}; - -struct History *hist=0; -String dots=" ... "; -Position gameHistoryX, gameHistoryY; -void -HistoryPopDown(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - Arg args[16]; - int j; - if(hist) { - // [HGM] remember old position - j = 0; ++/* ++ * xhistory.c -- Move list window, part of X front end for XBoard ++ * $Id$ ++ * ++ * Copyright 2000 Free Software Foundation, Inc. ++ * ++ * The following terms apply to the enhanced version of XBoard distributed ++ * by the Free Software Foundation: ++ * ------------------------------------------------------------------------ ++ * 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 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, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ------------------------------------------------------------------------ ++ * ++ * See the file ChangeLog for a revision history. ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++ ++#if STDC_HEADERS ++# include ++# include ++#else /* not STDC_HEADERS */ ++extern char *getenv(); ++# if HAVE_STRING_H ++# include ++# else /* not HAVE_STRING_H */ ++# include ++# endif /* not HAVE_STRING_H */ ++#endif /* not STDC_HEADERS */ ++ ++#if HAVE_UNISTD_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "common.h" ++#include "frontend.h" ++#include "backend.h" ++#include "xboard.h" ++#include "xhistory.h" ++#include "gettext.h" ++ ++#ifdef ENABLE_NLS ++# define _(s) gettext (s) ++# define N_(s) gettext_noop (s) ++#else ++# define _(s) (s) ++# define N_(s) s ++#endif ++ ++#define _LL_ 100 ++ ++extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; ++extern Display *xDisplay; ++extern int squareSize; ++extern Pixmap xMarkPixmap; ++extern char *layoutName; ++ ++struct History{ ++ String *Nr,*white,*black; ++ int aNr; /* space actually alocated */ ++ Widget mvn,mvw,mvb,vbox,viewport,sh; ++ char Up; ++}; ++ ++struct History *hist=0; ++String dots=" ... "; ++Position gameHistoryX, gameHistoryY; ++ ++void ++HistoryPopDown(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ Arg args[16]; ++ int j; ++ if(hist) { ++ // [HGM] remember old position ++ j = 0; + XtSetArg(args[j], XtNx, &gameHistoryX); j++; + XtSetArg(args[j], XtNy, &gameHistoryY); j++; + XtGetValues(hist->sh, args, j); - - XtPopdown(hist->sh); - hist->Up=False; - } - j=0; - XtSetArg(args[j], XtNleftBitmap, None); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), - args, j); -} - -void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) -{ - int to; - - XawListReturnStruct *R = (XawListReturnStruct *) call_data; - if (w == hist->mvn || w == hist->mvw) { - to=2*R->list_index-1; - ToNrEvent(to); - } - else if (w == hist->mvb) { - to=2*R->list_index; - ToNrEvent(to); - } -} - -void HistoryAlloc(int len){ - int i; - if(hist){ - free(hist->Nr[0]);free(hist->white[0]);free(hist->black[0]); - free(hist->Nr);free(hist->white);free(hist->black); - } - else{ - hist=(struct History*)malloc(sizeof(struct History)); - } - hist->aNr=len; - hist->Nr=(String*)malloc(hist->aNr*sizeof(String*)); - hist->white=(String*)malloc(hist->aNr*sizeof(String*)); - hist->black=(String*)malloc(hist->aNr*sizeof(String*)); - - hist->Nr[0]=(String)malloc(hist->aNr*6); - hist->white[0]=(String)malloc(hist->aNr*MOVE_LEN); - hist->black[0]=(String)malloc(hist->aNr*MOVE_LEN); - - sprintf(hist->Nr[0]," "); - sprintf(hist->white[0],"White "); - sprintf(hist->black[0],"Black "); - for(i=1;iaNr;i++){ - hist->Nr[i]= hist->Nr[i-1]+6; - hist->white[i]= hist->white[i-1]+MOVE_LEN; - hist->black[i]= hist->black[i-1]+MOVE_LEN; - sprintf(hist->Nr[i],"%i.",i); - sprintf(hist->white[i],"-----"); - sprintf(hist->black[i],"-----"); - } -} - - -#if 1 -/* Find empty space inside vbox form widget and redistribute it amongst - the list widgets inside it. */ -/* This version sort of works */ -void -HistoryFill() -{ - Dimension w, bw; - long extra; - Position x, x1, x2; - int j, dd; - Arg args[16]; - - j = 0; - XtSetArg(args[j], XtNx, &x); j++; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNborderWidth, &bw); j++; - XtGetValues(hist->mvb, args, j); - x1 = x + w + 2*bw; - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtSetArg(args[j], XtNdefaultDistance, &dd); j++; - XtGetValues(hist->vbox, args, j); - x2 = w - dd; - - extra = x2 - x1; - if (extra < 0) { - extra = -((-extra)/2); - } else { - extra = extra/2; - } - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvw, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, &w); j++; - XtGetValues(hist->mvb, args, j); - w += extra; - j = 0; - XtSetArg(args[j], XtNwidth, w); j++; - XtSetValues(hist->mvb, args, j); -} -#else -/* Find empty space inside vbox form widget and redistribute it amongst - the list widgets inside it. */ -/* This version doesn't work */ -void -HistoryFill() -{ - Arg args[16]; - Dimension fw, niw, wiw, biw, nbw, wbw, bbw; - int j, nl, wl, bl, fdd; - long extra; - - j = 0; - XtSetArg(args[j], XtNwidth, &fw); j++; - XtSetArg(args[j], XtNdefaultDistance, &fdd); j++; - XtGetValues(hist->vbox, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &nl); j++; - XtSetArg(args[j], XtNinternalWidth, &niw); j++; - XtSetArg(args[j], XtNborderWidth, &nbw); j++; - XtGetValues(hist->mvn, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &wl); j++; - XtSetArg(args[j], XtNinternalWidth, &wiw); j++; - XtSetArg(args[j], XtNborderWidth, &wbw); j++; - XtGetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNlongest, &bl); j++; - XtSetArg(args[j], XtNinternalWidth, &biw); j++; - XtSetArg(args[j], XtNborderWidth, &bbw); j++; - XtGetValues(hist->mvb, args, j); - - extra = fw - 4*fdd - - nl - 1 - 2*niw - 2*nbw - wl - 2*wiw - 2*wbw - bl - 2*biw - 2*bbw; - if (extra < 0) extra = 0; - - j = 0; - XtSetArg(args[j], XtNwidth, nl + 1 + 2*niw); j++; - XtSetValues(hist->mvn, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, wl + 2*wiw + extra/2); j++; - XtSetValues(hist->mvw, args, j); - - j = 0; - XtSetArg(args[j], XtNwidth, bl + 2*biw + extra/2); j++; - XtSetValues(hist->mvb, args, j); -} -#endif - -void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current){ - int i,b,m; - if(hist){ - if(last >= hist->aNr) HistoryAlloc(last+_LL_); - for(i=0;iwhite[i/2+1], movelist[i], p-movelist[i]); - hist->white[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->white[i/2+1],movelist[i]); - } - } else { - strcpy(hist->white[i/2+1],dots); - } - } else { - if(movelist[i][0]) { - char* p = strchr(movelist[i], ' '); - if (p) { - strncpy(hist->black[i/2+1], movelist[i], p-movelist[i]); - hist->black[i/2+1][p-movelist[i]] = NULLCHAR; - } else { - strcpy(hist->black[i/2+1],movelist[i]); - } - } else { - strcpy(hist->black[i/2+1],""); - } - } - } - strcpy(hist->black[last/2+1],""); - b=first/2; - m=(last+3)/2-b; - XawFormDoLayout(hist->vbox, False); - XawListChange(hist->mvn,hist->Nr+b,m,0,True); - XawListChange(hist->mvw,hist->white+b,m,0,True); - XawListChange(hist->mvb,hist->black+b,m,0,True); - HistoryFill(); - XawFormDoLayout(hist->vbox, True); - if(current<0){ - XawListUnhighlight(hist->mvw); - XawListUnhighlight(hist->mvb); - } - else if((current%2)==0){ - XawListHighlight(hist->mvw, current/2+1); - XawListUnhighlight(hist->mvb); - } - else{ - XawListUnhighlight(hist->mvw); - if(current) XawListHighlight(hist->mvb, current/2+1); - else XawListUnhighlight(hist->mvb); - } - } -} - -Widget HistoryCreate() -{ - Arg args[16]; - int i,j; - - Widget layout,form,b_close; - String trstr= - "Up: BackwardProc() \n \ - Left: BackwardProc() \n \ - Down: ForwardProc() \n \ - Right: ForwardProc() \n"; - /*--- allocate memory for move-strings ---*/ - HistoryAlloc(_LL_); - - /*-------- create the widgets ---------------*/ - j = 0; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNallowShellResize, True); j++; -#if TOPLEVEL - hist->sh = - XtCreatePopupShell("Move list", topLevelShellWidgetClass, - shellWidget, args, j); -#else - hist->sh = - XtCreatePopupShell("Move list", transientShellWidgetClass, - shellWidget, args, j); -#endif - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNdefaultDistance, 0); j++; - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, - args, j); - - j = 0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable, True); j++; - - form = - XtCreateManagedWidget("form", formWidgetClass, layout, args, j); - j=0; - - j = 0; - - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNresizable, False); j++; - XtSetArg(args[j], XtNallowVert, True); j++; - XtSetArg(args[j], XtNallowHoriz, True); j++; - XtSetArg(args[j], XtNforceBars, False); j++; - XtSetArg(args[j], XtNheight, 280); j++; - hist->viewport = - XtCreateManagedWidget("viewport", viewportWidgetClass, - form, args, j); - j=0; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; - hist->vbox = - XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; - hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtRubber); j++; - XtSetArg(args[j], XtNright, XtRubber); j++; - - XtSetArg(args[j], XtNdefaultColumns, 1); j++; - XtSetArg(args[j], XtNforceColumns, True); j++; - XtSetArg(args[j], XtNverticalList, True); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNresizable,True);j++; - XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; - hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, - hist->vbox, args, j); - XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); - - j=0; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNfromVert, hist->viewport); j++; - b_close= XtCreateManagedWidget("Close", commandWidgetClass, - form, args, j); - XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); - - XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); - - XtRealizeWidget(hist->sh); - CatchDeleteWindow(hist->sh, "HistoryPopDown"); - - for(i=1;iaNr;i++){ - strcpy(hist->white[i],dots); - strcpy(hist->black[i],""); - } - - // [HGM] remember old position - j = 0; - XtSetArg(args[j], XtNx, &gameHistoryX); j++; - XtSetArg(args[j], XtNy, &gameHistoryY); j++; - XtGetValues(hist->sh, args, j); - - return hist->sh; -} - -void -HistoryPopUp() -{ - Arg args[16]; - int j; - - if(!hist) HistoryCreate(); - XtPopup(hist->sh, XtGrabNone); - - // [HGM] restore old position - j = 0; ++ ++ XtPopdown(hist->sh); ++ hist->Up=False; ++ } ++ j=0; ++ XtSetArg(args[j], XtNleftBitmap, None); j++; ++ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), ++ args, j); ++} ++ ++void HistoryMoveProc(Widget w, XtPointer closure, XtPointer call_data) ++{ ++ int to; ++ XawListReturnStruct *R = (XawListReturnStruct *) call_data; ++ if (w == hist->mvn || w == hist->mvw) { ++ to=2*R->list_index-1; ++ ToNrEvent(to); ++ } ++ else if (w == hist->mvb) { ++ to=2*R->list_index; ++ ToNrEvent(to); ++ } ++} ++ ++void HistoryAlloc(int len){ ++ int i; ++ if(hist){ ++ free(hist->Nr[0]);free(hist->white[0]);free(hist->black[0]); ++ free(hist->Nr);free(hist->white);free(hist->black); ++ } ++ else{ ++ hist=(struct History*)malloc(sizeof(struct History)); ++ } ++ hist->aNr=len; ++ hist->Nr=(String*)malloc(hist->aNr*sizeof(String*)); ++ hist->white=(String*)malloc(hist->aNr*sizeof(String*)); ++ hist->black=(String*)malloc(hist->aNr*sizeof(String*)); ++ ++ hist->Nr[0]=(String)malloc(hist->aNr*6); ++ hist->white[0]=(String)malloc(hist->aNr*MOVE_LEN); ++ hist->black[0]=(String)malloc(hist->aNr*MOVE_LEN); ++ ++ sprintf(hist->Nr[0]," "); ++ sprintf(hist->white[0],_("White ")); ++ sprintf(hist->black[0],_("Black ")); ++ for(i=1;iaNr;i++){ ++ hist->Nr[i]= hist->Nr[i-1]+6; ++ hist->white[i]= hist->white[i-1]+MOVE_LEN; ++ hist->black[i]= hist->black[i-1]+MOVE_LEN; ++ sprintf(hist->Nr[i],"%i.",i); ++ sprintf(hist->white[i],"-----"); ++ sprintf(hist->black[i],"-----"); ++ } ++} ++ ++ ++#if 1 ++/* Find empty space inside vbox form widget and redistribute it amongst ++ the list widgets inside it. */ ++/* This version sort of works */ ++void ++HistoryFill() ++{ ++ Dimension w, bw; ++ long extra; ++ Position x, x1, x2; ++ int j, dd; ++ Arg args[16]; ++ ++ j = 0; ++ XtSetArg(args[j], XtNx, &x); j++; ++ XtSetArg(args[j], XtNwidth, &w); j++; ++ XtSetArg(args[j], XtNborderWidth, &bw); j++; ++ XtGetValues(hist->mvb, args, j); ++ x1 = x + w + 2*bw; ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, &w); j++; ++ XtSetArg(args[j], XtNdefaultDistance, &dd); j++; ++ XtGetValues(hist->vbox, args, j); ++ x2 = w - dd; ++ ++ extra = x2 - x1; ++ if (extra < 0) { ++ extra = -((-extra)/2); ++ } else { ++ extra = extra/2; ++ } ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, &w); j++; ++ XtGetValues(hist->mvw, args, j); ++ w += extra; ++ j = 0; ++ XtSetArg(args[j], XtNwidth, w); j++; ++ XtSetValues(hist->mvw, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, &w); j++; ++ XtGetValues(hist->mvb, args, j); ++ w += extra; ++ j = 0; ++ XtSetArg(args[j], XtNwidth, w); j++; ++ XtSetValues(hist->mvb, args, j); ++} ++#else ++/* Find empty space inside vbox form widget and redistribute it amongst ++ the list widgets inside it. */ ++/* This version doesn't work */ ++void ++HistoryFill() ++{ ++ Arg args[16]; ++ Dimension fw, niw, wiw, biw, nbw, wbw, bbw; ++ int j, nl, wl, bl, fdd; ++ long extra; ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, &fw); j++; ++ XtSetArg(args[j], XtNdefaultDistance, &fdd); j++; ++ XtGetValues(hist->vbox, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNlongest, &nl); j++; ++ XtSetArg(args[j], XtNinternalWidth, &niw); j++; ++ XtSetArg(args[j], XtNborderWidth, &nbw); j++; ++ XtGetValues(hist->mvn, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNlongest, &wl); j++; ++ XtSetArg(args[j], XtNinternalWidth, &wiw); j++; ++ XtSetArg(args[j], XtNborderWidth, &wbw); j++; ++ XtGetValues(hist->mvw, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNlongest, &bl); j++; ++ XtSetArg(args[j], XtNinternalWidth, &biw); j++; ++ XtSetArg(args[j], XtNborderWidth, &bbw); j++; ++ XtGetValues(hist->mvb, args, j); ++ ++ extra = fw - 4*fdd - ++ nl - 1 - 2*niw - 2*nbw - wl - 2*wiw - 2*wbw - bl - 2*biw - 2*bbw; ++ if (extra < 0) extra = 0; ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, nl + 1 + 2*niw); j++; ++ XtSetValues(hist->mvn, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, wl + 2*wiw + extra/2); j++; ++ XtSetValues(hist->mvw, args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNwidth, bl + 2*biw + extra/2); j++; ++ XtSetValues(hist->mvb, args, j); ++} ++#endif ++ ++void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current){ ++ int i,b,m; ++ if(hist){ ++ if(last >= hist->aNr) HistoryAlloc(last+_LL_); ++ for(i=0;iwhite[i/2+1], movelist[i], p-movelist[i]); ++ hist->white[i/2+1][p-movelist[i]] = NULLCHAR; ++ } else { ++ strcpy(hist->white[i/2+1],movelist[i]); ++ } ++ } else { ++ strcpy(hist->white[i/2+1],dots); ++ } ++ } else { ++ if(movelist[i][0]) { ++ char* p = strchr(movelist[i], ' '); ++ if (p) { ++ strncpy(hist->black[i/2+1], movelist[i], p-movelist[i]); ++ hist->black[i/2+1][p-movelist[i]] = NULLCHAR; ++ } else { ++ strcpy(hist->black[i/2+1],movelist[i]); ++ } ++ } else { ++ strcpy(hist->black[i/2+1],""); ++ } ++ } ++ } ++ strcpy(hist->black[last/2+1],""); ++ b=first/2; ++ m=(last+3)/2-b; ++ XawFormDoLayout(hist->vbox, False); ++ XawListChange(hist->mvn,hist->Nr+b,m,0,True); ++ XawListChange(hist->mvw,hist->white+b,m,0,True); ++ XawListChange(hist->mvb,hist->black+b,m,0,True); ++ HistoryFill(); ++ XawFormDoLayout(hist->vbox, True); ++ if(current<0){ ++ XawListUnhighlight(hist->mvw); ++ XawListUnhighlight(hist->mvb); ++ } ++ else if((current%2)==0){ ++ XawListHighlight(hist->mvw, current/2+1); ++ XawListUnhighlight(hist->mvb); ++ } ++ else{ ++ XawListUnhighlight(hist->mvw); ++ if(current) XawListHighlight(hist->mvb, current/2+1); ++ else XawListUnhighlight(hist->mvb); ++ } ++ } ++} ++ ++Widget HistoryCreate() ++{ ++ Arg args[16]; ++ int i,j; ++ ++ Widget layout,form,b_close; ++ String trstr= ++ "Up: BackwardProc() \n \ ++ Left: BackwardProc() \n \ ++ Down: ForwardProc() \n \ ++ Right: ForwardProc() \n"; ++ /*--- allocate memory for move-strings ---*/ ++ HistoryAlloc(_LL_); ++ ++ /*-------- create the widgets ---------------*/ ++ j = 0; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNallowShellResize, True); j++; ++#if TOPLEVEL ++ hist->sh = ++ XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass, ++ shellWidget, args, j); ++#else ++ hist->sh = ++ XtCreatePopupShell(_("Move list"), transientShellWidgetClass, ++ shellWidget, args, j); ++#endif ++ j = 0; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNdefaultDistance, 0); j++; ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, hist->sh, ++ args, j); ++ ++ j = 0; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ ++ form = ++ XtCreateManagedWidget("form", formWidgetClass, layout, args, j); ++ j=0; ++ ++ j = 0; ++ ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNresizable, False); j++; ++ XtSetArg(args[j], XtNallowVert, True); j++; ++ XtSetArg(args[j], XtNallowHoriz, True); j++; ++ XtSetArg(args[j], XtNforceBars, False); j++; ++ XtSetArg(args[j], XtNheight, 280); j++; ++ hist->viewport = ++ XtCreateManagedWidget("viewport", viewportWidgetClass, ++ form, args, j); ++ j=0; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNorientation,XtorientHorizontal);j++; ++ hist->vbox = ++ XtCreateManagedWidget("vbox", formWidgetClass, hist->viewport, args, j); ++ ++ j=0; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ ++ XtSetArg(args[j], XtNdefaultColumns, 1); j++; ++ XtSetArg(args[j], XtNforceColumns, True); j++; ++ XtSetArg(args[j], XtNverticalList, True); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNresizable,True);j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ hist->mvn = XtCreateManagedWidget("movesn", listWidgetClass, ++ hist->vbox, args, j); ++ XtAddCallback(hist->mvn, XtNcallback, HistoryMoveProc, (XtPointer) hist); ++ ++ j=0; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtRubber); j++; ++ ++ XtSetArg(args[j], XtNdefaultColumns, 1); j++; ++ XtSetArg(args[j], XtNforceColumns, True); j++; ++ XtSetArg(args[j], XtNverticalList, True); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNresizable,True);j++; ++ XtSetArg(args[j], XtNfromHoriz, hist->mvn); j++; ++ hist->mvw = XtCreateManagedWidget("movesw", listWidgetClass, ++ hist->vbox, args, j); ++ XtAddCallback(hist->mvw, XtNcallback, HistoryMoveProc, (XtPointer) hist); ++ ++ j=0; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtRubber); j++; ++ XtSetArg(args[j], XtNright, XtRubber); j++; ++ ++ XtSetArg(args[j], XtNdefaultColumns, 1); j++; ++ XtSetArg(args[j], XtNforceColumns, True); j++; ++ XtSetArg(args[j], XtNverticalList, True); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNresizable,True);j++; ++ XtSetArg(args[j], XtNfromHoriz, hist->mvw); j++; ++ hist->mvb = XtCreateManagedWidget("movesb", listWidgetClass, ++ hist->vbox, args, j); ++ XtAddCallback(hist->mvb, XtNcallback, HistoryMoveProc, (XtPointer) hist); ++ ++ j=0; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNfromVert, hist->viewport); j++; ++ b_close= XtCreateManagedWidget(_("Close"), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_close, XtNcallback, HistoryPopDown, (XtPointer) 0); ++ ++ XtAugmentTranslations(hist->sh,XtParseTranslationTable (trstr)); ++ ++ XtRealizeWidget(hist->sh); ++ CatchDeleteWindow(hist->sh, "HistoryPopDown"); ++ ++ for(i=1;iaNr;i++){ ++ strcpy(hist->white[i],dots); ++ strcpy(hist->black[i],""); ++ } ++ ++ return hist->sh; ++} ++ ++void ++HistoryPopUp() ++{ ++ Arg args[16]; ++ int j; ++ ++ if(!hist) HistoryCreate(); ++ XtPopup(hist->sh, XtGrabNone); ++ ++ // [HGM] restore old position ++ j = 0; + XtSetArg(args[j], XtNx, gameHistoryX); j++; + XtSetArg(args[j], XtNy, gameHistoryY); j++; + XtSetValues(hist->sh, args, j); - - j=0; - XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; - XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move History"), - args, j); - hist->Up=True; -} - - -void -HistoryShowProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - if (!hist) { - HistoryCreate(); - HistoryPopUp(); - } else if (hist->Up) { - HistoryPopDown(0,0,0); - } else { - HistoryPopUp(); - } - ToNrEvent(currentMove); -} - ++ ++ j=0; ++ XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; ++ XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Move List"), ++ args, j); ++ hist->Up=True; ++} ++ ++ ++void ++HistoryShowProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ if (!hist) { ++ HistoryCreate(); ++ HistoryPopUp(); ++ } else if (hist->Up) { ++ HistoryPopDown(0,0,0); ++ } else { ++ HistoryPopUp(); ++ } ++ ToNrEvent(currentMove); ++} ++ diff --cc xoptions.c index 0000000,5e4fac8..6dc6e6d mode 000000,100644..100644 --- a/xoptions.c +++ b/xoptions.c @@@ -1,0 -1,1723 +1,1732 @@@ -/* - * xoptions.c -- Move list window, part of X front end for XBoard - * - * Copyright 2000 Free Software Foundation, Inc. - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - * - * See the file ChangeLog for a revision history. - */ - -// [HGM] this file is the counterpart of woptions.c, containing xboard popup menus -// similar to those of WinBoard, to set the most common options interactively. - -#include "config.h" - -#include -#include -#include -#include - -#if STDC_HEADERS -# include -# include -#else /* not STDC_HEADERS */ -extern char *getenv(); -# if HAVE_STRING_H -# include -# else /* not HAVE_STRING_H */ -# include -# endif /* not HAVE_STRING_H */ -#endif /* not STDC_HEADERS */ - -#if HAVE_UNISTD_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "backend.h" -#include "xboard.h" - -extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; -extern Display *xDisplay; -extern int squareSize; -extern Pixmap xMarkPixmap; -extern char *layoutName; -extern Window xBoardWindow; -extern Arg layoutArgs[2], formArgs[2]; -Pixel timerForegroundPixel, timerBackgroundPixel; - -// [HGM] the following code for makng menu popups was cloned from the FileNamePopUp routines - -static Widget previous = NULL; - -void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b) -{ - Arg args; - - if(previous) { - XtSetArg(args, XtNdisplayCaret, False); - XtSetValues(previous, &args, 1); - } - XtSetArg(args, XtNdisplayCaret, True); - XtSetValues(w, &args, 1); - XtSetKeyboardFocus((Widget) data, w); - previous = w; -} - -//--------------------------- New Shuffle Game -------------------------------------------- -extern int shuffleOpenings; -extern int startedFromPositionFile; -int shuffleUp; -Widget shuffleShell; - -void ShufflePopDown() -{ - if (!shuffleUp) return; - XtPopdown(shuffleShell); - XtDestroyWidget(shuffleShell); - shuffleUp = False; - ModeHighlight(); -} - -void ShuffleCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Widget w2; - Arg args[16]; - char buf[80]; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "cancel") == 0) { - ShufflePopDown(); - return; - } - if (strcmp(name, "off") == 0) { - ShufflePopDown(); - shuffleOpenings = False; // [HGM] should be moved to New Variant menu, once we have it! - ResetGameEvent(); - AnalysisPopDown(); - return; - } - if (strcmp(name, "random") == 0) { - sprintf(buf, "%d", rand()); - XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value - XtSetValues(XtParent(w), args, 1); - return; - } - if (strcmp(name, "ok") == 0) { - int nr; String name; - name = XawDialogGetValueString(w2 = XtParent(w)); - if(sscanf(name ,"%d",&nr) != 1) { - sprintf(buf, "%d", appData.defaultFrcPosition); - XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value - XtSetValues(w2, args, 1); - return; - } - appData.defaultFrcPosition = nr; - shuffleOpenings = True; - ShufflePopDown(); - ResetGameEvent(); - AnalysisPopDown(); - return; - } -} - -void ShufflePopUp() -{ - Arg args[16]; - Widget popup, layout, dialog, edit; - Window root, child; - int x, y, i; - int win_x, win_y; - unsigned int mask; - char def[80]; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - shuffleShell = popup = - XtCreatePopupShell("New Shuffle Game", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - sprintf(def, "%d\n", appData.defaultFrcPosition); - i = 0; - XtSetArg(args[i], XtNlabel, "Start-position number:"); i++; - XtSetArg(args[i], XtNvalue, def); i++; - XtSetArg(args[i], XtNborderWidth, 0); i++; - dialog = XtCreateManagedWidget("Shuffle", dialogWidgetClass, - layout, args, i); - -// XtSetArg(args[0], XtNeditType, XawtextEdit); // [HGM] can't get edit to work decently -// XtSetArg(args[1], XtNuseStringInPlace, False); -// XtSetValues(dialog, args, 2); - - XawDialogAddButton(dialog, "ok", ShuffleCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, "cancel", ShuffleCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, "random", ShuffleCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, "off", ShuffleCallback, (XtPointer) dialog); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "ShufflePopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - shuffleUp = True; - - edit = XtNameToWidget(dialog, "*value"); - - XtSetKeyboardFocus(popup, edit); -} - -void ShuffleMenuProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ -// if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { -// Reset(FALSE, TRUE); -// } - ShufflePopUp(); -} - -//--------------------------- Time-Control Menu Popup ---------------------------------- -int TimeControlUp; -Widget TimeControlShell; -int tcInc; -Widget tcMess1, tcMess2, tcData, tcTime, tcOdds1, tcOdds2; -int tcIncrement, tcMoves; - -void TimeControlPopDown() -{ - if (!TimeControlUp) return; - XtPopdown(TimeControlShell); - XtDestroyWidget(TimeControlShell); - TimeControlUp = False; - ModeHighlight(); -} - -void TimeControlCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name, txt; - Widget w2; - Arg args[16]; - char buf[80]; - int j; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "classical") == 0) { - if(!tcInc) return; - j=0; - XtSetArg(args[j], XtNlabel, "minutes for each"); j++; - XtSetValues(tcMess1, args, j); - j=0; - XtSetArg(args[j], XtNlabel, "moves"); j++; - XtSetValues(tcMess2, args, j); - j=0; - XtSetArg(args[j], XtNstring, &name); j++; - XtGetValues(tcData, args, j); - tcIncrement = 0; sscanf(name, "%d", &tcIncrement); - sprintf(buf, "%d", tcMoves); - j=0; - XtSetArg(args[j], XtNstring, buf); j++; - XtSetValues(tcData, args, j); - tcInc = False; - return; - } - if (strcmp(name, "incremental") == 0) { - if(tcInc) return; - j=0; - XtSetArg(args[j], XtNlabel, "minutes, plus"); j++; - XtSetValues(tcMess1, args, j); - j=0; - XtSetArg(args[j], XtNlabel, "sec/move"); j++; - XtSetValues(tcMess2, args, j); - j=0; - XtSetArg(args[j], XtNstring, &name); j++; - XtGetValues(tcData, args, j); - tcMoves = appData.movesPerSession; sscanf(name, "%d", &tcMoves); - sprintf(buf, "%d", tcIncrement); - j=0; - XtSetArg(args[j], XtNstring, buf); j++; - XtSetValues(tcData, args, j); - tcInc = True; - return; - } - if (strcmp(name, " OK ") == 0) { - int inc, mps, tc, ok; - XtSetArg(args[0], XtNstring, &txt); - XtGetValues(tcData, args, 1); - if(tcInc) { - ok = sscanf(txt, "%d", &inc); mps = 0; - if(!ok && txt[0] == 0) { inc = 0; ok = 1; } // accept empty string as zero - ok &= (inc >= 0); - } else { - ok = sscanf(txt, "%d", &mps); inc = -1; - ok &= (mps > 0); - } - if(ok != 1) { - XtSetArg(args[0], XtNstring, ""); // erase any offending input - XtSetValues(tcData, args, 1); - return; - } - XtSetArg(args[0], XtNstring, &txt); - XtGetValues(tcTime, args, 1); - if(!ParseTimeControl(txt, inc, mps)) { - XtSetArg(args[0], XtNstring, ""); // erase any offending input - XtSetValues(tcTime, args, 1); - DisplayError("Bad Time-Control String", 0); - return; - } - appData.movesPerSession = mps; - appData.timeIncrement = inc; - appData.timeControl = strdup(txt); - XtSetArg(args[0], XtNstring, &txt); - XtGetValues(tcOdds1, args, 1); - appData.firstTimeOdds = first.timeOdds - = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; - XtGetValues(tcOdds2, args, 1); - appData.secondTimeOdds = second.timeOdds - = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; - - Reset(True, True); - TimeControlPopDown(); - return; - } -} - -void TimeControlPopUp() -{ - Arg args[16]; - Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, mess; - Window root, child; - int x, y, i, j; - int win_x, win_y; - unsigned int mask; - char def[80]; - - tcInc = (appData.timeIncrement >= 0); - tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; - if(!tcInc) tcIncrement = 0; - sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; -// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - TimeControlShell = popup = - XtCreatePopupShell("TimeControl Menu", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - form = - XtCreateManagedWidget(layoutName, formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - j = 0; -// XtSetArg(args[j], XtNwidth, (XtArgVal) 300); j++; -// XtSetArg(args[j], XtNheight, (XtArgVal) 85); j++; - XtSetValues(popup, args, j); - - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, appData.timeControl); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 85); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcTime = XtCreateManagedWidget("TC", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(tcTime, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, tcInc ? " minutes, plus " : "minutes for each"); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromHoriz, tcTime); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - // XtSetArg(args[j], XtNwidth, 100); j++; - // XtSetArg(args[j], XtNheight, 20); j++; - tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); - - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromHoriz, tcMess1); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, def); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 40); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcData = XtCreateManagedWidget("MPS", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(tcData, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, tcInc ? "sec/move" : "moves "); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromHoriz, tcData); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; -// XtSetArg(args[j], XtNwidth, 80); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, - form, args, j); - - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, tcTime); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, "1"); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 40); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcOdds1 = XtCreateManagedWidget("Odds1", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(tcOdds1, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, tcTime); j++; - XtSetArg(args[j], XtNfromHoriz, tcOdds1); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, "1"); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 40); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcOdds2 = XtCreateManagedWidget("Odds2", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(tcOdds2, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, "Engine #1 and #2 Time-Odds Factors"); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromVert, tcTime); j++; - XtSetArg(args[j], XtNfromHoriz, tcOdds2); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; -// XtSetArg(args[j], XtNwidth, 200); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - mess = XtCreateManagedWidget("Oddstext", labelWidgetClass, - form, args, j); - j=0; - XtSetArg(args[j], XtNfromVert, tcOdds1); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_clas= XtCreateManagedWidget("classical", commandWidgetClass, - form, args, j); - XtAddCallback(b_clas, XtNcallback, TimeControlCallback, (XtPointer) 0); - - j=0; - XtSetArg(args[j], XtNfromVert, tcOdds1); j++; - XtSetArg(args[j], XtNfromHoriz, b_clas); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_inc = XtCreateManagedWidget("incremental", commandWidgetClass, - form, args, j); - XtAddCallback(b_inc, XtNcallback, TimeControlCallback, (XtPointer) 0); - - j=0; - XtSetArg(args[j], XtNfromVert, tcOdds1); j++; - XtSetArg(args[j], XtNfromHoriz, tcData); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_ok= XtCreateManagedWidget(" OK ", commandWidgetClass, - form, args, j); - XtAddCallback(b_ok, XtNcallback, TimeControlCallback, (XtPointer) 0); - - j=0; - XtSetArg(args[j], XtNfromVert, tcOdds1); j++; - XtSetArg(args[j], XtNfromHoriz, b_ok); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_cancel= XtCreateManagedWidget("cancel", commandWidgetClass, - form, args, j); - XtAddCallback(b_cancel, XtNcallback, TimeControlPopDown, (XtPointer) 0); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "TimeControlPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - TimeControlUp = True; - - previous = NULL; - SetFocus(tcTime, popup, (XEvent*) NULL, False); -// XtSetKeyboardFocus(popup, tcTime); -} - -void TimeControlProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - TimeControlPopUp(); -} - -//--------------------------- Engine-Options Menu Popup ---------------------------------- -int EngineUp; -Widget EngineShell; -extern int adjudicateLossThreshold; - -Widget engDrawMoves, engThreshold, engRule, engRepeat; - -void EnginePopDown() -{ - if (!EngineUp) return; - XtPopdown(EngineShell); - XtDestroyWidget(EngineShell); - EngineUp = False; - ModeHighlight(); -} - -int ReadToggle(Widget w) -{ - Arg args; Boolean res; - - XtSetArg(args, XtNstate, &res); - XtGetValues(w, &args, 1); - - return res; -} - -Widget w1, w2, w3, w4, w5, w6, w7, w8; - -void EngineCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Widget s2; - Arg args[16]; - char buf[80]; - int j; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "OK") == 0) { - // read all switches - appData.periodicUpdates = ReadToggle(w1); -// appData.hideThinkingFromHuman = ReadToggle(w2); - appData.firstScoreIsAbsolute = ReadToggle(w3); - appData.secondScoreIsAbsolute = ReadToggle(w4); - appData.testClaims = ReadToggle(w5); - appData.checkMates = ReadToggle(w6); - appData.materialDraws = ReadToggle(w7); - appData.trivialDraws = ReadToggle(w8); - - // adjust setting in other menu for duplicates - // (perhaps duplicates should be removed from general Option Menu?) -// XtSetArg(args[0], XtNleftBitmap, appData.showThinking ? xMarkPixmap : None); -// XtSetValues(XtNameToWidget(menuBarWidget, -// "menuOptions.Show Thinking"), args, 1); - - // read out numeric controls, simply ignore bad formats for now - XtSetArg(args[0], XtNstring, &name); - XtGetValues(engDrawMoves, args, 1); - if(sscanf(name, "%d", &j) == 1) appData.adjudicateDrawMoves = j; - XtGetValues(engThreshold, args, 1); - if(sscanf(name, "%d", &j) == 1) - adjudicateLossThreshold = appData.adjudicateLossThreshold = -j; // inverted! - XtGetValues(engRule, args, 1); - if(sscanf(name, "%d", &j) == 1) appData.ruleMoves = j; - XtGetValues(engRepeat, args, 1); - if(sscanf(name, "%d", &j) == 1) appData.drawRepeats = j; - - EnginePopDown(); - ShowThinkingEvent(); // [HGM] thinking: score adjudication might need thinking output - return; - } -} - -void EnginePopUp() -{ - Arg args[16]; - Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, s1; - Window root, child; - int x, y, i, j, width; - int win_x, win_y; - unsigned int mask; - char def[80]; - - tcInc = (appData.timeIncrement >= 0); - tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; - if(!tcInc) tcIncrement = 0; - sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; -// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - EngineShell = popup = - XtCreatePopupShell("Adjudications", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - form = - XtCreateManagedWidget(layoutName, formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - j = 0; -// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; -// XtSetArg(args[j], XtNheight, (XtArgVal) 400); j++; -// XtSetValues(popup, args, j); - - j = 0; -// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; -// XtSetArg(args[j], XtNheight, (XtArgVal) 20); j++; - XtSetArg(args[j], XtNleft, (XtArgVal) XtChainLeft); j++; - XtSetArg(args[j], XtNright, (XtArgVal) XtChainRight); j++; - XtSetArg(args[j], XtNstate, appData.periodicUpdates); j++; -// XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; - w1 = XtCreateManagedWidget("Periodic Updates (Analysis Mode)", toggleWidgetClass, form, args, j); - - XtSetArg(args[j], XtNwidth, (XtArgVal) &width); - XtGetValues(w1, &args[j], 1); - -// XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w1); -// XtSetArg(args[j-3], XtNstate, appData.hideThinkingFromHuman); -// w2 = XtCreateManagedWidget("Hide Thinking from Human", toggleWidgetClass, form, args, j); - - XtSetArg(args[j], XtNwidth, (XtArgVal) width); j++; - XtSetArg(args[j-2], XtNstate, appData.firstScoreIsAbsolute); - XtSetArg(args[j], XtNfromVert, (XtArgVal) w1); j++; - w3 = XtCreateManagedWidget("Engine #1 Score is Absolute", toggleWidgetClass, form, args, j); - - XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w3); - XtSetArg(args[j-3], XtNstate, appData.secondScoreIsAbsolute); - w4 = XtCreateManagedWidget("Engine #2 Score is Absolute", toggleWidgetClass, form, args, j); - - s1 = XtCreateManagedWidget("\nEngine-Engine Adjudications:", labelWidgetClass, form, args, 3); - - XtSetArg(args[j-1], XtNfromVert, (XtArgVal) s1); - XtSetArg(args[j-3], XtNstate, appData.testClaims); - w5 = XtCreateManagedWidget("Verify Engine Result Claims", toggleWidgetClass, form, args, j); - - XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w5); - XtSetArg(args[j-3], XtNstate, appData.checkMates); - w6 = XtCreateManagedWidget("Detect All Mates", toggleWidgetClass, form, args, j); - - XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w6); - XtSetArg(args[j-3], XtNstate, appData.materialDraws); - w7 = XtCreateManagedWidget("Draw when Insuff. Mating Material", toggleWidgetClass, form, args, j); - - XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w7); - XtSetArg(args[j-3], XtNstate, appData.trivialDraws); - w8 = XtCreateManagedWidget("Adjudicate Trivial Draws", toggleWidgetClass, form, args, j); - - XtSetArg(args[0], XtNfromVert, (XtArgVal) w4); - XtSetArg(args[1], XtNborderWidth, (XtArgVal) 0); - XtSetValues(s1, args, 2); - - sprintf(def, "%d", appData.adjudicateDrawMoves); - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, w8); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, def); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 60); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - engDrawMoves = XtCreateManagedWidget("Length", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(engDrawMoves, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, " moves maximum, then draw"); j++; - XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromVert, w8); j++; - XtSetArg(args[j], XtNfromHoriz, engDrawMoves); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; -// XtSetArg(args[j], XtNwidth, 170); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); - - sprintf(def, "%d", -appData.adjudicateLossThreshold); // inverted! - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, def); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 60); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - engThreshold = XtCreateManagedWidget("Threshold", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(engThreshold, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, "-centiPawn lead is win"); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; - XtSetArg(args[j], XtNfromHoriz, engThreshold); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; -// XtSetArg(args[j], XtNwidth, 150); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); - - sprintf(def, "%d", appData.ruleMoves); - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, engThreshold); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, def); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 30); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - engRule = XtCreateManagedWidget("Rule", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(engRule, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, "-move rule applied"); j++; - XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromVert, engThreshold); j++; - XtSetArg(args[j], XtNfromHoriz, engRule); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; -// XtSetArg(args[j], XtNwidth, 130); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); - - sprintf(def, "%d", appData.drawRepeats); - j= 0; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNfromVert, engRule); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNstring, def); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, 30); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - engRepeat = XtCreateManagedWidget("Repeats", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(engRepeat, ButtonPressMask, False, SetFocus, (XtPointer) popup); - - j= 0; - XtSetArg(args[j], XtNlabel, "-fold repeat is draw"); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNfromVert, engRule); j++; - XtSetArg(args[j], XtNfromHoriz, engRepeat); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; -// XtSetArg(args[j], XtNwidth, 130); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); - - j=0; - XtSetArg(args[j], XtNfromVert, engRepeat); j++; - XtSetArg(args[j], XtNfromHoriz, tcMess2); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_ok= XtCreateManagedWidget("OK", commandWidgetClass, form, args, j); - XtAddCallback(b_ok, XtNcallback, EngineCallback, (XtPointer) 0); - - j=0; - XtSetArg(args[j], XtNfromVert, engRepeat); j++; - XtSetArg(args[j], XtNfromHoriz, b_ok); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_cancel= XtCreateManagedWidget("cancel", commandWidgetClass, - form, args, j); - XtAddCallback(b_cancel, XtNcallback, EnginePopDown, (XtPointer) 0); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "EnginePopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - EngineUp = True; - - previous = NULL; - SetFocus(engThreshold, popup, (XEvent*) NULL, False); -} - -void EngineMenuProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - EnginePopUp(); -} - -//--------------------------- New-Variant Menu PopUp ----------------------------------- -struct NewVarButton { - char *name; - char *color; - Widget handle; - VariantClass variant; -}; - -struct NewVarButton buttonDesc[] = { - {"normal", "#FFFFFF", 0, VariantNormal}, - {"FRC", "#FFFFFF", 0, VariantFischeRandom}, - {"wild castle", "#FFFFFF", 0, VariantWildCastle}, - {"no castle", "#FFFFFF", 0, VariantNoCastle}, - {"knightmate", "#FFFFFF", 0, VariantKnightmate}, - {"berolina", "#FFFFFF", 0, VariantBerolina}, - {"cylinder", "#FFFFFF", 0, VariantCylinder}, - {"shatranj", "#FFFFFF", 0, VariantShatranj}, - {"atomic", "#FFFFFF", 0, VariantAtomic}, - {"two kings", "#FFFFFF", 0, VariantTwoKings}, - {"3-checks", "#FFFFFF", 0, Variant3Check}, - {"suicide", "#FFFFBF", 0, VariantSuicide}, - {"give-away", "#FFFFBF", 0, VariantGiveaway}, - {"losers", "#FFFFBF", 0, VariantLosers}, - {"fairy", "#BFBFBF", 0, VariantFairy}, - {"Superchess", "#FFBFBF", 0, VariantSuper}, - {"crazyhouse", "#FFBFBF", 0, VariantCrazyhouse}, - {"bughouse", "#FFBFBF", 0, VariantBughouse}, - {"shogi (9x9)", "#BFFFFF", 0, VariantShogi}, - {"xiangqi (9x10)", "#BFFFFF", 0, VariantXiangqi}, - {"courier (12x8)", "#BFFFBF", 0, VariantCourier}, - {"janus (10x8)", "#BFBFFF", 0, VariantJanus}, - {"Capablanca (10x8)", "#BFBFFF", 0, VariantCapablanca}, - {"CRC (10x8)", "#BFBFFF", 0, VariantCapaRandom}, -#ifdef GOTHIC - {"Gothic (10x8)", "#BFBFFF", 0, VariantGothic}, -#endif -#ifdef FALCON - {"Falcon (10x8)", "#BFBFFF", 0, VariantFalcon}, -#endif - {NULL, 0, 0, (VariantClass) 0} -}; - -int NewVariantUp; -Widget NewVariantShell; - -void NewVariantPopDown() -{ - if (!NewVariantUp) return; - XtPopdown(NewVariantShell); - XtDestroyWidget(NewVariantShell); - NewVariantUp = False; - ModeHighlight(); -} - -void NewVariantCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Widget w2; - Arg args[16]; - char buf[80]; - VariantClass v; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, " OK ") == 0) { - int nr = (int) XawToggleGetCurrent(buttonDesc[0].handle) - 1; - if(nr < 0) return; - v = buttonDesc[nr].variant; - if(!appData.noChessProgram) { - char *name = VariantName(v), buf[MSG_SIZ]; - if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) { - /* [HGM] in protocol 2 we check if variant is suported by engine */ - sprintf(buf, "Variant %s not supported by %s", name, first.tidy); - DisplayError(buf, 0); -// NewVariantPopDown(); - return; /* ignore OK if first engine does not support it */ - } else - if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) { - sprintf(buf, "Warning: second engine (%s) does not support this!", second.tidy); - DisplayError(buf, 0); /* use of second engine is optional; only warn user */ - } - } - - gameInfo.variant = v; - appData.variant = VariantName(v); - - shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */ - startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */ - appData.pieceToCharTable = NULL; - Reset(True, True); - NewVariantPopDown(); - return; - } -} - -void NewVariantPopUp() -{ - Arg args[16]; - Widget popup, layout, dialog, edit, form, last = NULL, b_ok, b_cancel; - Window root, child; - int x, y, i, j; - int win_x, win_y; - unsigned int mask; - char def[80]; - XrmValue vFrom, vTo; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; -// XtSetArg(args[i], XtNwidth, 250); i++; -// XtSetArg(args[i], XtNheight, 300); i++; - NewVariantShell = popup = - XtCreatePopupShell("NewVariant Menu", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - form = - XtCreateManagedWidget("form", formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - for(i = 0; buttonDesc[i].name != NULL; i++) { - Pixel buttonColor; - if (!appData.monoMode) { - vFrom.addr = (caddr_t) buttonDesc[i].color; - vFrom.size = strlen(buttonDesc[i].color); - XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); - if (vTo.addr == NULL) { - buttonColor = (Pixel) -1; - } else { - buttonColor = *(Pixel *) vTo.addr; - } - } - - j = 0; - XtSetArg(args[j], XtNradioGroup, last); j++; - XtSetArg(args[j], XtNwidth, 125); j++; -// XtSetArg(args[j], XtNheight, 16); j++; - XtSetArg(args[j], XtNfromVert, i == 15 ? NULL : last); j++; - XtSetArg(args[j], XtNfromHoriz, i < 15 ? NULL : buttonDesc[i-15].handle); j++; - XtSetArg(args[j], XtNradioData, i+1); j++; - XtSetArg(args[j], XtNbackground, buttonColor); j++; - XtSetArg(args[j], XtNstate, gameInfo.variant == buttonDesc[i].variant); j++; - buttonDesc[i].handle = last = - XtCreateManagedWidget(buttonDesc[i].name, toggleWidgetClass, form, args, j); - } - - j=0; - XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; - XtSetArg(args[j], XtNfromHoriz, buttonDesc[12].handle); j++; - XtSetArg(args[j], XtNheight, 35); j++; -// XtSetArg(args[j], XtNwidth, 60); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_cancel= XtCreateManagedWidget("CANCEL", commandWidgetClass, form, args, j); - XtAddCallback(b_cancel, XtNcallback, NewVariantPopDown, (XtPointer) 0); - - j=0; - XtSetArg(args[j], XtNfromHoriz, b_cancel); j++; - XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; - XtSetArg(args[j], XtNheight, 35); j++; -// XtSetArg(args[j], XtNwidth, 60); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - b_ok= XtCreateManagedWidget(" OK ", commandWidgetClass, form, args, j); - XtAddCallback(b_ok, XtNcallback, NewVariantCallback, (XtPointer) 0); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "NewVariantPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - NewVariantUp = True; -} - -void NewVariantProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - NewVariantPopUp(); -} - -//--------------------------- UCI Menu Popup ------------------------------------------ -int UciUp; -Widget UciShell; - -struct UciControl { - char *name; - Widget handle; - void *ptr; -}; - -struct UciControl controlDesc[] = { - {"maximum nr of CPUs:", 0, &appData.smpCores}, - {"Polyglot Directory:", 0, &appData.polyglotDir}, - {"Hash Size (MB):", 0, &appData.defaultHashSize}, - {"EGTB Path:", 0, &appData.defaultPathEGTB}, - {"EGTB Cache (MB):", 0, &appData.defaultCacheSizeEGTB}, - {"Polyglot Book:", 0, &appData.polyglotBook}, - {NULL, 0, NULL}, -}; - -void UciPopDown() -{ - if (!UciUp) return; - XtPopdown(UciShell); - XtDestroyWidget(UciShell); - UciUp = False; - ModeHighlight(); -} - -void UciCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Arg args[16]; - char buf[80]; - int oldCores = appData.smpCores, ponder = 0; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "OK") == 0) { - int nr, i, j; String name; - for(i=0; i<6; i++) { - XtSetArg(args[0], XtNstring, &name); - XtGetValues(controlDesc[i].handle, args, 1); - if(i&1) { - if(name) - *(char**) controlDesc[i].ptr = strdup(name); - } else { - if(sscanf(name, "%d", &j) == 1) - *(int*) controlDesc[i].ptr = j; - } - } - XtSetArg(args[0], XtNstate, &appData.usePolyglotBook); - XtGetValues(w1, args, 1); - XtSetArg(args[0], XtNstate, &appData.firstHasOwnBookUCI); - XtGetValues(w2, args, 1); - XtSetArg(args[0], XtNstate, &appData.secondHasOwnBookUCI); - XtGetValues(w3, args, 1); - XtSetArg(args[0], XtNstate, &ponder); - XtGetValues(w4, args, 1); - - // adjust setting in other menu for duplicates - // (perhaps duplicates should be removed from general Option Menu?) - XtSetArg(args[0], XtNleftBitmap, ponder ? xMarkPixmap : None); - XtSetValues(XtNameToWidget(menuBarWidget, - "menuOptions.Ponder Next Move"), args, 1); - - // make sure changes are sent to first engine by re-initializing it - // if it was already started pre-emptively at end of previous game - if(gameMode == BeginningOfGame) Reset(True, True); else { - // Some changed setting need immediate sending always. - PonderNextMoveEvent(ponder); - if(oldCores != appData.smpCores) - NewSettingEvent(False, "cores", appData.smpCores); - } - UciPopDown(); - return; - } -} - -void UciPopUp() -{ - Arg args[16]; - Widget popup, layout, dialog, edit, form, b_ok, b_cancel, last = NULL, new, upperLeft; - Window root, child; - int x, y, i, j; - int win_x, win_y; - unsigned int mask; - char def[80]; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; -// XtSetArg(args[i], XtNwidth, 300); i++; - UciShell = popup = - XtCreatePopupShell("Engine Settings", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - - form = - XtCreateManagedWidget("form", formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - j = 0; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; -// XtSetArg(args[j], XtNheight, 20); j++; - for(i = 0; controlDesc[i].name != NULL; i++) { - j = 3; - XtSetArg(args[j], XtNfromVert, last); j++; -// XtSetArg(args[j], XtNwidth, 130); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - new = XtCreateManagedWidget(controlDesc[i].name, labelWidgetClass, form, args, j); - if(i==0) upperLeft = new; - - j = 4; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNwidth, i&1 ? 245 : 50); j++; - if(i&1) { - XtSetArg(args[j], XtNstring, * (char**) controlDesc[i].ptr ? - * (char**) controlDesc[i].ptr : ""); j++; - } else { - sprintf(def, "%d", * (int*) controlDesc[i].ptr); - XtSetArg(args[j], XtNstring, def); j++; - } - XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; - controlDesc[i].handle = last = - XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); - XtAddEventHandler(last, ButtonPressMask, False, SetFocus, (XtPointer) popup); - } - - j=0; - XtSetArg(args[j], XtNfromHoriz, controlDesc[0].handle); j++; - XtSetArg(args[j], XtNbottom, XtChainTop); j++; - XtSetArg(args[j], XtNtop, XtChainTop); j++; - XtSetArg(args[j], XtNleft, XtChainRight); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNstate, appData.ponderNextMove); j++; - w4 = XtCreateManagedWidget("Ponder", toggleWidgetClass, form, args, j); - - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_ok = XtCreateManagedWidget("OK", commandWidgetClass, form, args, j); - XtAddCallback(b_ok, XtNcallback, UciCallback, (XtPointer) 0); - - XtSetArg(args[j], XtNfromHoriz, b_ok); j++; - b_cancel = XtCreateManagedWidget("cancel", commandWidgetClass, form, args, j); - XtAddCallback(b_cancel, XtNcallback, UciPopDown, (XtPointer) 0); - - j = 5; - XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; - XtSetArg(args[j], XtNstate, appData.usePolyglotBook); j++; - w1 = XtCreateManagedWidget(" use book ", toggleWidgetClass, form, args, j); -// XtAddCallback(w1, XtNcallback, UciCallback, (XtPointer) 0); - - j = 5; - XtSetArg(args[j], XtNfromHoriz, w1); j++; - XtSetArg(args[j], XtNstate, appData.firstHasOwnBookUCI); j++; - w2 = XtCreateManagedWidget("own book 1", toggleWidgetClass, form, args, j); -// XtAddCallback(w2, XtNcallback, UciCallback, (XtPointer) 0); - - j = 5; - XtSetArg(args[j], XtNfromHoriz, w2); j++; - XtSetArg(args[j], XtNstate, appData.secondHasOwnBookUCI); j++; - w3 = XtCreateManagedWidget("own book 2", toggleWidgetClass, form, args, j); -// XtAddCallback(w3, XtNcallback, UciCallback, (XtPointer) 0); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "UciPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - UciUp = True; - - previous = NULL; - SetFocus(controlDesc[2].handle, popup, (XEvent*) NULL, False); -// XtSetKeyboardFocus(popup, controlDesc[1].handle); -} - -void UciMenuProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - UciPopUp(); -} - -//--------------------------- Engine-specific options menu ---------------------------------- - -int SettingsUp; -Widget SettingsShell; -int values[MAX_OPTIONS]; -ChessProgramState *currentCps; - -void SettingsPopDown() -{ - if (!SettingsUp) return; - XtPopdown(SettingsShell); - XtDestroyWidget(SettingsShell); - SettingsUp = False; - ModeHighlight(); -} - -void SpinCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name, val; - Widget w2; - Arg args[16]; - char buf[MSG_SIZ]; - int i, j; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - j = 0; - XtSetArg(args[0], XtNstring, &val); - XtGetValues(currentCps->option[(int)client_data].handle, args, 1); - sscanf(val, "%d", &j); - if (strcmp(name, "+") == 0) { - if(++j > currentCps->option[(int)client_data].max) return; - } else - if (strcmp(name, "-") == 0) { - if(--j < currentCps->option[(int)client_data].min) return; - } else return; - sprintf(buf, "%d", j); - XtSetArg(args[0], XtNstring, buf); - XtSetValues(currentCps->option[(int)client_data].handle, args, 1); -} - -void SettingsCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name, val; - Widget w2; - Arg args[16]; - char buf[MSG_SIZ]; - int i, j; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "cancel") == 0) { - SettingsPopDown(); - return; - } - if (strcmp(name, "OK") == 0 || (int)client_data) { // save buttons imply OK - int nr; - - for(i=0; inrOptions; i++) { // send all options that had to be OK-ed to engine - switch(currentCps->option[i].type) { - case TextBox: - XtSetArg(args[0], XtNstring, &val); - XtGetValues(currentCps->option[i].handle, args, 1); - if(strcmp(currentCps->option[i].textValue, val)) { - strcpy(currentCps->option[i].textValue, val); - sprintf(buf, "option %s %s\n", currentCps->option[i].name, val); - SendToProgram(buf, currentCps); - } - break; - case Spin: - XtSetArg(args[0], XtNstring, &val); - XtGetValues(currentCps->option[i].handle, args, 1); - sscanf(val, "%d", &j); - if(j > currentCps->option[i].max) j = currentCps->option[i].max; - if(j < currentCps->option[i].min) j = currentCps->option[i].min; - if(currentCps->option[i].value != j) { - currentCps->option[i].value = j; - sprintf(buf, "option %s %d\n", currentCps->option[i].name, j); - SendToProgram(buf, currentCps); - } - break; - case CheckBox: - j = 0; - XtSetArg(args[0], XtNstate, &j); - XtGetValues(currentCps->option[i].handle, args, 1); - if(currentCps->option[i].value != j) { - currentCps->option[i].value = j; - sprintf(buf, "option %s %d\n", currentCps->option[i].name, j); - SendToProgram(buf, currentCps); - } - break; - case ComboBox: - if(currentCps->option[i].value != values[i]) { - currentCps->option[i].value = values[i]; - sprintf(buf, "option %s %s\n", currentCps->option[i].name, - ((char**)currentCps->option[i].textValue)[values[i]]); - SendToProgram(buf, currentCps); - } - break; - } - } - if((int)client_data) { // send save-button command to engine - sprintf(buf, "option %s\n", name); - SendToProgram(buf, currentCps); - } - SettingsPopDown(); - return; - } - sprintf(buf, "option %s\n", name); - SendToProgram(buf, currentCps); -} - -void ComboSelect(w, addr, index) // callback for all combo items ++/* ++ * xoptions.c -- Move list window, part of X front end for XBoard ++ * ++ * Copyright 2000 Free Software Foundation, Inc. ++ * ++ * The following terms apply to the enhanced version of XBoard distributed ++ * by the Free Software Foundation: ++ * ------------------------------------------------------------------------ ++ * 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 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, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ------------------------------------------------------------------------ ++ * ++ * See the file ChangeLog for a revision history. ++ */ ++ ++// [HGM] this file is the counterpart of woptions.c, containing xboard popup menus ++// similar to those of WinBoard, to set the most common options interactively. ++ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++ ++#if STDC_HEADERS ++# include ++# include ++#else /* not STDC_HEADERS */ ++extern char *getenv(); ++# if HAVE_STRING_H ++# include ++# else /* not HAVE_STRING_H */ ++# include ++# endif /* not HAVE_STRING_H */ ++#endif /* not STDC_HEADERS */ ++ ++#if HAVE_UNISTD_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "common.h" ++#include "backend.h" ++#include "xboard.h" ++#include "gettext.h" ++ ++#ifdef ENABLE_NLS ++# define _(s) gettext (s) ++# define N_(s) gettext_noop (s) ++#else ++# define _(s) (s) ++# define N_(s) s ++#endif ++ ++extern Widget formWidget, shellWidget, boardWidget, menuBarWidget; ++extern Display *xDisplay; ++extern int squareSize; ++extern Pixmap xMarkPixmap; ++extern char *layoutName; ++extern Window xBoardWindow; ++extern Arg layoutArgs[2], formArgs[2]; ++Pixel timerForegroundPixel, timerBackgroundPixel; ++ ++// [HGM] the following code for makng menu popups was cloned from the FileNamePopUp routines ++ ++static Widget previous = NULL; ++ ++void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b) ++{ ++ Arg args; ++ ++ if(previous) { ++ XtSetArg(args, XtNdisplayCaret, False); ++ XtSetValues(previous, &args, 1); ++ } ++ XtSetArg(args, XtNdisplayCaret, True); ++ XtSetValues(w, &args, 1); ++ XtSetKeyboardFocus((Widget) data, w); ++ previous = w; ++} ++ ++//--------------------------- New Shuffle Game -------------------------------------------- ++extern int shuffleOpenings; ++extern int startedFromPositionFile; ++int shuffleUp; ++Widget shuffleShell; ++ ++void ShufflePopDown() ++{ ++ if (!shuffleUp) return; ++ XtPopdown(shuffleShell); ++ XtDestroyWidget(shuffleShell); ++ shuffleUp = False; ++ ModeHighlight(); ++} ++ ++void ShuffleCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name; ++ Widget w2; ++ Arg args[16]; ++ char buf[80]; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("cancel")) == 0) { ++ ShufflePopDown(); ++ return; ++ } ++ if (strcmp(name, _("off")) == 0) { ++ ShufflePopDown(); ++ shuffleOpenings = False; // [HGM] should be moved to New Variant menu, once we have it! ++ ResetGameEvent(); ++ AnalysisPopDown(); ++ return; ++ } ++ if (strcmp(name, _("random")) == 0) { ++ sprintf(buf, "%d", rand()); ++ XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value ++ XtSetValues(XtParent(w), args, 1); ++ return; ++ } ++ if (strcmp(name, _("ok")) == 0) { ++ int nr; String name; ++ name = XawDialogGetValueString(w2 = XtParent(w)); ++ if(sscanf(name ,"%d",&nr) != 1) { ++ sprintf(buf, "%d", appData.defaultFrcPosition); ++ XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value ++ XtSetValues(w2, args, 1); ++ return; ++ } ++ appData.defaultFrcPosition = nr; ++ shuffleOpenings = True; ++ ShufflePopDown(); ++ ResetGameEvent(); ++ AnalysisPopDown(); ++ return; ++ } ++} ++ ++void ShufflePopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, dialog, edit; ++ Window root, child; ++ int x, y, i; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++ XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; ++ shuffleShell = popup = ++ XtCreatePopupShell(_("New Shuffle Game"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ sprintf(def, "%d\n", appData.defaultFrcPosition); ++ i = 0; ++ XtSetArg(args[i], XtNlabel, _("Start-position number:")); i++; ++ XtSetArg(args[i], XtNvalue, def); i++; ++ XtSetArg(args[i], XtNborderWidth, 0); i++; ++ dialog = XtCreateManagedWidget(_("Shuffle"), dialogWidgetClass, ++ layout, args, i); ++ ++// XtSetArg(args[0], XtNeditType, XawtextEdit); // [HGM] can't get edit to work decently ++// XtSetArg(args[1], XtNuseStringInPlace, False); ++// XtSetValues(dialog, args, 2); ++ ++ XawDialogAddButton(dialog, _("ok"), ShuffleCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("cancel"), ShuffleCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("random"), ShuffleCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("off"), ShuffleCallback, (XtPointer) dialog); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "ShufflePopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ shuffleUp = True; ++ ++ edit = XtNameToWidget(dialog, "*value"); ++ ++ XtSetKeyboardFocus(popup, edit); ++} ++ ++void ShuffleMenuProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++// if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { ++// Reset(FALSE, TRUE); ++// } ++ ShufflePopUp(); ++} ++ ++//--------------------------- Time-Control Menu Popup ---------------------------------- ++int TimeControlUp; ++Widget TimeControlShell; ++int tcInc; ++Widget tcMess1, tcMess2, tcData, tcTime, tcOdds1, tcOdds2; ++int tcIncrement, tcMoves; ++ ++void TimeControlPopDown() ++{ ++ if (!TimeControlUp) return; ++ XtPopdown(TimeControlShell); ++ XtDestroyWidget(TimeControlShell); ++ TimeControlUp = False; ++ ModeHighlight(); ++} ++ ++void TimeControlCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name, txt; ++ Widget w2; ++ Arg args[16]; ++ char buf[80]; ++ int j; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("classical")) == 0) { ++ if(!tcInc) return; ++ j=0; ++ XtSetArg(args[j], XtNlabel, _("minutes for each")); j++; ++ XtSetValues(tcMess1, args, j); ++ j=0; ++ XtSetArg(args[j], XtNlabel, _("moves")); j++; ++ XtSetValues(tcMess2, args, j); ++ j=0; ++ XtSetArg(args[j], XtNstring, &name); j++; ++ XtGetValues(tcData, args, j); ++ tcIncrement = 0; sscanf(name, "%d", &tcIncrement); ++ sprintf(buf, "%d", tcMoves); ++ j=0; ++ XtSetArg(args[j], XtNstring, buf); j++; ++ XtSetValues(tcData, args, j); ++ tcInc = False; ++ return; ++ } ++ if (strcmp(name, _("incremental")) == 0) { ++ if(tcInc) return; ++ j=0; ++ XtSetArg(args[j], XtNlabel, _("minutes, plus")); j++; ++ XtSetValues(tcMess1, args, j); ++ j=0; ++ XtSetArg(args[j], XtNlabel, _("sec/move")); j++; ++ XtSetValues(tcMess2, args, j); ++ j=0; ++ XtSetArg(args[j], XtNstring, &name); j++; ++ XtGetValues(tcData, args, j); ++ tcMoves = appData.movesPerSession; sscanf(name, "%d", &tcMoves); ++ sprintf(buf, "%d", tcIncrement); ++ j=0; ++ XtSetArg(args[j], XtNstring, buf); j++; ++ XtSetValues(tcData, args, j); ++ tcInc = True; ++ return; ++ } ++ if (strcmp(name, _(" OK ")) == 0) { ++ int inc, mps, tc, ok; ++ XtSetArg(args[0], XtNstring, &txt); ++ XtGetValues(tcData, args, 1); ++ if(tcInc) { ++ ok = sscanf(txt, "%d", &inc); mps = 0; ++ if(!ok && txt[0] == 0) { inc = 0; ok = 1; } // accept empty string as zero ++ ok &= (inc >= 0); ++ } else { ++ ok = sscanf(txt, "%d", &mps); inc = -1; ++ ok &= (mps > 0); ++ } ++ if(ok != 1) { ++ XtSetArg(args[0], XtNstring, ""); // erase any offending input ++ XtSetValues(tcData, args, 1); ++ return; ++ } ++ XtSetArg(args[0], XtNstring, &txt); ++ XtGetValues(tcTime, args, 1); ++ if(!ParseTimeControl(txt, inc, mps)) { ++ XtSetArg(args[0], XtNstring, ""); // erase any offending input ++ XtSetValues(tcTime, args, 1); ++ DisplayError(_("Bad Time-Control String"), 0); ++ return; ++ } ++ appData.movesPerSession = mps; ++ appData.timeIncrement = inc; ++ appData.timeControl = strdup(txt); ++ XtSetArg(args[0], XtNstring, &txt); ++ XtGetValues(tcOdds1, args, 1); ++ appData.firstTimeOdds = first.timeOdds ++ = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; ++ XtGetValues(tcOdds2, args, 1); ++ appData.secondTimeOdds = second.timeOdds ++ = (sscanf(txt, "%d", &j) == 1 && j > 0) ? j : 1; ++ ++ Reset(True, True); ++ TimeControlPopDown(); ++ return; ++ } ++} ++ ++void TimeControlPopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, mess; ++ Window root, child; ++ int x, y, i, j; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ ++ tcInc = (appData.timeIncrement >= 0); ++ tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; ++ if(!tcInc) tcIncrement = 0; ++ sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; ++ TimeControlShell = popup = ++ XtCreatePopupShell(_("TimeControl Menu"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ form = ++ XtCreateManagedWidget(layoutName, formWidgetClass, layout, ++ formArgs, XtNumber(formArgs)); ++ ++ j = 0; ++// XtSetArg(args[j], XtNwidth, (XtArgVal) 300); j++; ++// XtSetArg(args[j], XtNheight, (XtArgVal) 85); j++; ++ XtSetValues(popup, args, j); ++ ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, appData.timeControl); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 85); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcTime = XtCreateManagedWidget("TC", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(tcTime, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, tcInc ? _(" minutes, plus ") : _("minutes for each")); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcTime); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ // XtSetArg(args[j], XtNwidth, 100); j++; ++ // XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); ++ ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcMess1); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, def); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 40); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcData = XtCreateManagedWidget("MPS", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(tcData, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, tcInc ? _("sec/move") : _("moves ")); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcData); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++// XtSetArg(args[j], XtNwidth, 80); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, ++ form, args, j); ++ ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, tcTime); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, "1"); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 40); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcOdds1 = XtCreateManagedWidget("Odds1", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(tcOdds1, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, tcTime); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcOdds1); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, "1"); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 40); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcOdds2 = XtCreateManagedWidget("Odds2", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(tcOdds2, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, _("Engine #1 and #2 Time-Odds Factors")); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromVert, tcTime); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcOdds2); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++// XtSetArg(args[j], XtNwidth, 200); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ mess = XtCreateManagedWidget("Oddstext", labelWidgetClass, ++ form, args, j); ++ j=0; ++ XtSetArg(args[j], XtNfromVert, tcOdds1); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ b_clas= XtCreateManagedWidget(_("classical"), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_clas, XtNcallback, TimeControlCallback, (XtPointer) 0); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, tcOdds1); j++; ++ XtSetArg(args[j], XtNfromHoriz, b_clas); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ b_inc = XtCreateManagedWidget(_("incremental"), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_inc, XtNcallback, TimeControlCallback, (XtPointer) 0); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, tcOdds1); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcData); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_ok= XtCreateManagedWidget(_(" OK "), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_ok, XtNcallback, TimeControlCallback, (XtPointer) 0); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, tcOdds1); j++; ++ XtSetArg(args[j], XtNfromHoriz, b_ok); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_cancel= XtCreateManagedWidget(_("cancel"), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_cancel, XtNcallback, TimeControlPopDown, (XtPointer) 0); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "TimeControlPopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ TimeControlUp = True; ++ ++ previous = NULL; ++ SetFocus(tcTime, popup, (XEvent*) NULL, False); ++// XtSetKeyboardFocus(popup, tcTime); ++} ++ ++void TimeControlProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ TimeControlPopUp(); ++} ++ ++//--------------------------- Engine-Options Menu Popup ---------------------------------- ++int EngineUp; ++Widget EngineShell; ++extern int adjudicateLossThreshold; ++ ++Widget engDrawMoves, engThreshold, engRule, engRepeat; ++ ++void EnginePopDown() ++{ ++ if (!EngineUp) return; ++ XtPopdown(EngineShell); ++ XtDestroyWidget(EngineShell); ++ EngineUp = False; ++ ModeHighlight(); ++} ++ ++int ReadToggle(Widget w) ++{ ++ Arg args; Boolean res; ++ ++ XtSetArg(args, XtNstate, &res); ++ XtGetValues(w, &args, 1); ++ ++ return res; ++} ++ ++Widget w1, w2, w3, w4, w5, w6, w7, w8; ++ ++void EngineCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name; ++ Widget s2; ++ Arg args[16]; ++ char buf[80]; ++ int j; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("OK")) == 0) { ++ // read all switches ++ appData.periodicUpdates = ReadToggle(w1); ++// appData.hideThinkingFromHuman = ReadToggle(w2); ++ appData.firstScoreIsAbsolute = ReadToggle(w3); ++ appData.secondScoreIsAbsolute = ReadToggle(w4); ++ appData.testClaims = ReadToggle(w5); ++ appData.checkMates = ReadToggle(w6); ++ appData.materialDraws = ReadToggle(w7); ++ appData.trivialDraws = ReadToggle(w8); ++ ++ // adjust setting in other menu for duplicates ++ // (perhaps duplicates should be removed from general Option Menu?) ++// XtSetArg(args[0], XtNleftBitmap, appData.showThinking ? xMarkPixmap : None); ++// XtSetValues(XtNameToWidget(menuBarWidget, ++// "menuOptions.Show Thinking"), args, 1); ++ ++ // read out numeric controls, simply ignore bad formats for now ++ XtSetArg(args[0], XtNstring, &name); ++ XtGetValues(engDrawMoves, args, 1); ++ if(sscanf(name, "%d", &j) == 1) appData.adjudicateDrawMoves = j; ++ XtGetValues(engThreshold, args, 1); ++ if(sscanf(name, "%d", &j) == 1) ++ adjudicateLossThreshold = appData.adjudicateLossThreshold = -j; // inverted! ++ XtGetValues(engRule, args, 1); ++ if(sscanf(name, "%d", &j) == 1) appData.ruleMoves = j; ++ XtGetValues(engRepeat, args, 1); ++ if(sscanf(name, "%d", &j) == 1) appData.drawRepeats = j; ++ ++ EnginePopDown(); ++ ShowThinkingEvent(); // [HGM] thinking: score adjudication might need thinking output ++ return; ++ } ++} ++ ++void EnginePopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, form, edit, b_ok, b_cancel, b_clas, b_inc, s1; ++ Window root, child; ++ int x, y, i, j, width; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ ++ tcInc = (appData.timeIncrement >= 0); ++ tcMoves = appData.movesPerSession; tcIncrement = appData.timeIncrement; ++ if(!tcInc) tcIncrement = 0; ++ sprintf(def, "%d", tcInc ? tcIncrement : tcMoves); ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++// XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; ++ EngineShell = popup = ++ XtCreatePopupShell(_("Adjudications"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ form = ++ XtCreateManagedWidget(layoutName, formWidgetClass, layout, ++ formArgs, XtNumber(formArgs)); ++ ++ j = 0; ++// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; ++// XtSetArg(args[j], XtNheight, (XtArgVal) 400); j++; ++// XtSetValues(popup, args, j); ++ ++ j = 0; ++// XtSetArg(args[j], XtNwidth, (XtArgVal) 250); j++; ++// XtSetArg(args[j], XtNheight, (XtArgVal) 20); j++; ++ XtSetArg(args[j], XtNleft, (XtArgVal) XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, (XtArgVal) XtChainRight); j++; ++ XtSetArg(args[j], XtNstate, appData.periodicUpdates); j++; ++// XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; ++ w1 = XtCreateManagedWidget(_("Periodic Updates (Analysis Mode)"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j], XtNwidth, (XtArgVal) &width); ++ XtGetValues(w1, &args[j], 1); ++ ++// XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w1); ++// XtSetArg(args[j-3], XtNstate, appData.hideThinkingFromHuman); ++// w2 = XtCreateManagedWidget(_("Hide Thinking from Human"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j], XtNwidth, (XtArgVal) width); j++; ++ XtSetArg(args[j-2], XtNstate, appData.firstScoreIsAbsolute); ++ XtSetArg(args[j], XtNfromVert, (XtArgVal) w1); j++; ++ w3 = XtCreateManagedWidget(_("Engine #1 Score is Absolute"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w3); ++ XtSetArg(args[j-3], XtNstate, appData.secondScoreIsAbsolute); ++ w4 = XtCreateManagedWidget(_("Engine #2 Score is Absolute"), toggleWidgetClass, form, args, j); ++ ++ s1 = XtCreateManagedWidget(_("\nEngine-Engine Adjudications:"), labelWidgetClass, form, args, 3); ++ ++ XtSetArg(args[j-1], XtNfromVert, (XtArgVal) s1); ++ XtSetArg(args[j-3], XtNstate, appData.testClaims); ++ w5 = XtCreateManagedWidget(_("Verify Engine Result Claims"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w5); ++ XtSetArg(args[j-3], XtNstate, appData.checkMates); ++ w6 = XtCreateManagedWidget(_("Detect All Mates"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w6); ++ XtSetArg(args[j-3], XtNstate, appData.materialDraws); ++ w7 = XtCreateManagedWidget(_("Draw when Insuff. Mating Material"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[j-1], XtNfromVert, (XtArgVal) w7); ++ XtSetArg(args[j-3], XtNstate, appData.trivialDraws); ++ w8 = XtCreateManagedWidget(_("Adjudicate Trivial Draws"), toggleWidgetClass, form, args, j); ++ ++ XtSetArg(args[0], XtNfromVert, (XtArgVal) w4); ++ XtSetArg(args[1], XtNborderWidth, (XtArgVal) 0); ++ XtSetValues(s1, args, 2); ++ ++ sprintf(def, "%d", appData.adjudicateDrawMoves); ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, w8); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, def); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 60); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ engDrawMoves = XtCreateManagedWidget("Length", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(engDrawMoves, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, _(" moves maximum, then draw")); j++; ++ XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromVert, w8); j++; ++ XtSetArg(args[j], XtNfromHoriz, engDrawMoves); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++// XtSetArg(args[j], XtNwidth, 170); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); ++ ++ sprintf(def, "%d", -appData.adjudicateLossThreshold); // inverted! ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, def); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 60); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ engThreshold = XtCreateManagedWidget("Threshold", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(engThreshold, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, _("-centiPawn lead is win")); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromVert, engDrawMoves); j++; ++ XtSetArg(args[j], XtNfromHoriz, engThreshold); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++// XtSetArg(args[j], XtNwidth, 150); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); ++ ++ sprintf(def, "%d", appData.ruleMoves); ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, engThreshold); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, def); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 30); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ engRule = XtCreateManagedWidget("Rule", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(engRule, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, _("-move rule applied")); j++; ++ XtSetArg(args[j], XtNjustify, (XtArgVal) XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromVert, engThreshold); j++; ++ XtSetArg(args[j], XtNfromHoriz, engRule); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++// XtSetArg(args[j], XtNwidth, 130); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess1 = XtCreateManagedWidget("TCtext", labelWidgetClass, form, args, j); ++ ++ sprintf(def, "%d", appData.drawRepeats); ++ j= 0; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNfromVert, engRule); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNstring, def); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, 30); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ engRepeat = XtCreateManagedWidget("Repeats", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(engRepeat, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ ++ j= 0; ++ XtSetArg(args[j], XtNlabel, _("-fold repeat is draw")); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNfromVert, engRule); j++; ++ XtSetArg(args[j], XtNfromHoriz, engRepeat); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++// XtSetArg(args[j], XtNwidth, 130); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ tcMess2 = XtCreateManagedWidget("MPStext", labelWidgetClass, form, args, j); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, engRepeat); j++; ++ XtSetArg(args[j], XtNfromHoriz, tcMess2); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_ok= XtCreateManagedWidget(_("OK"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_ok, XtNcallback, EngineCallback, (XtPointer) 0); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, engRepeat); j++; ++ XtSetArg(args[j], XtNfromHoriz, b_ok); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_cancel= XtCreateManagedWidget(_("cancel"), commandWidgetClass, ++ form, args, j); ++ XtAddCallback(b_cancel, XtNcallback, EnginePopDown, (XtPointer) 0); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "EnginePopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ EngineUp = True; ++ ++ previous = NULL; ++ SetFocus(engThreshold, popup, (XEvent*) NULL, False); ++} ++ ++void EngineMenuProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ EnginePopUp(); ++} ++ ++//--------------------------- New-Variant Menu PopUp ----------------------------------- ++struct NewVarButton { ++ char *name; ++ char *color; ++ Widget handle; ++ VariantClass variant; ++}; ++ ++struct NewVarButton buttonDesc[] = { ++ {N_("normal"), "#FFFFFF", 0, VariantNormal}, ++ {N_("FRC"), "#FFFFFF", 0, VariantFischeRandom}, ++ {N_("wild castle"), "#FFFFFF", 0, VariantWildCastle}, ++ {N_("no castle"), "#FFFFFF", 0, VariantNoCastle}, ++ {N_("knightmate"), "#FFFFFF", 0, VariantKnightmate}, ++ {N_("berolina"), "#FFFFFF", 0, VariantBerolina}, ++ {N_("cylinder"), "#FFFFFF", 0, VariantCylinder}, ++ {N_("shatranj"), "#FFFFFF", 0, VariantShatranj}, ++ {N_("atomic"), "#FFFFFF", 0, VariantAtomic}, ++ {N_("two kings"), "#FFFFFF", 0, VariantTwoKings}, ++ {N_("3-checks"), "#FFFFFF", 0, Variant3Check}, ++ {N_("suicide"), "#FFFFBF", 0, VariantSuicide}, ++ {N_("give-away"), "#FFFFBF", 0, VariantGiveaway}, ++ {N_("losers"), "#FFFFBF", 0, VariantLosers}, ++ {N_("fairy"), "#BFBFBF", 0, VariantFairy}, ++ {N_("Superchess"), "#FFBFBF", 0, VariantSuper}, ++ {N_("crazyhouse"), "#FFBFBF", 0, VariantCrazyhouse}, ++ {N_("bughouse"), "#FFBFBF", 0, VariantBughouse}, ++ {N_("shogi (9x9)"), "#BFFFFF", 0, VariantShogi}, ++ {N_("xiangqi (9x10)"), "#BFFFFF", 0, VariantXiangqi}, ++ {N_("courier (12x8)"), "#BFFFBF", 0, VariantCourier}, ++ {N_("janus (10x8)"), "#BFBFFF", 0, VariantJanus}, ++ {N_("Capablanca (10x8)"), "#BFBFFF", 0, VariantCapablanca}, ++ {N_("CRC (10x8)"), "#BFBFFF", 0, VariantCapaRandom}, ++#ifdef GOTHIC ++ {N_("Gothic (10x8)"), "#BFBFFF", 0, VariantGothic}, ++#endif ++#ifdef FALCON ++ {N_("Falcon (10x8)"), "#BFBFFF", 0, VariantFalcon}, ++#endif ++ {NULL, 0, 0, (VariantClass) 0} ++}; ++ ++int NewVariantUp; ++Widget NewVariantShell; ++ ++void NewVariantPopDown() ++{ ++ if (!NewVariantUp) return; ++ XtPopdown(NewVariantShell); ++ XtDestroyWidget(NewVariantShell); ++ NewVariantUp = False; ++ ModeHighlight(); ++} ++ ++void NewVariantCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name; ++ Widget w2; ++ Arg args[16]; ++ char buf[80]; ++ VariantClass v; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _(" OK ")) == 0) { ++ int nr = (int) XawToggleGetCurrent(buttonDesc[0].handle) - 1; ++ if(nr < 0) return; ++ v = buttonDesc[nr].variant; ++ if(!appData.noChessProgram) { ++ char *name = VariantName(v), buf[MSG_SIZ]; ++ if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) { ++ /* [HGM] in protocol 2 we check if variant is suported by engine */ ++ sprintf(buf, _("Variant %s not supported by %s"), name, first.tidy); ++ DisplayError(buf, 0); ++// NewVariantPopDown(); ++ return; /* ignore OK if first engine does not support it */ ++ } else ++ if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) { ++ sprintf(buf, _("Warning: second engine (%s) does not support this!"), second.tidy); ++ DisplayError(buf, 0); /* use of second engine is optional; only warn user */ ++ } ++ } ++ ++ gameInfo.variant = v; ++ appData.variant = VariantName(v); ++ ++ shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */ ++ startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */ ++ appData.pieceToCharTable = NULL; ++ Reset(True, True); ++ NewVariantPopDown(); ++ return; ++ } ++} ++ ++void NewVariantPopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, dialog, edit, form, last = NULL, b_ok, b_cancel; ++ Window root, child; ++ int x, y, i, j; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ XrmValue vFrom, vTo; ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++// XtSetArg(args[i], XtNwidth, 250); i++; ++// XtSetArg(args[i], XtNheight, 300); i++; ++ NewVariantShell = popup = ++ XtCreatePopupShell(_("NewVariant Menu"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ form = ++ XtCreateManagedWidget("form", formWidgetClass, layout, ++ formArgs, XtNumber(formArgs)); ++ ++ for(i = 0; buttonDesc[i].name != NULL; i++) { ++ Pixel buttonColor; ++ if (!appData.monoMode) { ++ vFrom.addr = (caddr_t) buttonDesc[i].color; ++ vFrom.size = strlen(buttonDesc[i].color); ++ XtConvert(shellWidget, XtRString, &vFrom, XtRPixel, &vTo); ++ if (vTo.addr == NULL) { ++ buttonColor = (Pixel) -1; ++ } else { ++ buttonColor = *(Pixel *) vTo.addr; ++ } ++ } ++ ++ j = 0; ++ XtSetArg(args[j], XtNradioGroup, last); j++; ++ XtSetArg(args[j], XtNwidth, 125); j++; ++// XtSetArg(args[j], XtNheight, 16); j++; ++ XtSetArg(args[j], XtNfromVert, i == 15 ? NULL : last); j++; ++ XtSetArg(args[j], XtNfromHoriz, i < 15 ? NULL : buttonDesc[i-15].handle); j++; ++ XtSetArg(args[j], XtNradioData, i+1); j++; ++ XtSetArg(args[j], XtNbackground, buttonColor); j++; ++ XtSetArg(args[j], XtNstate, gameInfo.variant == buttonDesc[i].variant); j++; ++ buttonDesc[i].handle = last = ++ XtCreateManagedWidget(buttonDesc[i].name, toggleWidgetClass, form, args, j); ++ } ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; ++ XtSetArg(args[j], XtNfromHoriz, buttonDesc[12].handle); j++; ++ XtSetArg(args[j], XtNheight, 35); j++; ++// XtSetArg(args[j], XtNwidth, 60); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_cancel= XtCreateManagedWidget(_("CANCEL"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_cancel, XtNcallback, NewVariantPopDown, (XtPointer) 0); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromHoriz, b_cancel); j++; ++ XtSetArg(args[j], XtNfromVert, buttonDesc[12].handle); j++; ++ XtSetArg(args[j], XtNheight, 35); j++; ++// XtSetArg(args[j], XtNwidth, 60); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ b_ok= XtCreateManagedWidget(_(" OK "), commandWidgetClass, form, args, j); ++ XtAddCallback(b_ok, XtNcallback, NewVariantCallback, (XtPointer) 0); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "NewVariantPopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ NewVariantUp = True; ++} ++ ++void NewVariantProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ NewVariantPopUp(); ++} ++ ++//--------------------------- UCI Menu Popup ------------------------------------------ ++int UciUp; ++Widget UciShell; ++ ++struct UciControl { ++ char *name; ++ Widget handle; ++ void *ptr; ++}; ++ ++struct UciControl controlDesc[] = { ++ {N_("maximum nr of CPUs:"), 0, &appData.smpCores}, ++ {N_("Polyglot Directory:"), 0, &appData.polyglotDir}, ++ {N_("Hash Size (MB):"), 0, &appData.defaultHashSize}, ++ {N_("EGTB Path:"), 0, &appData.defaultPathEGTB}, ++ {N_("EGTB Cache (MB):"), 0, &appData.defaultCacheSizeEGTB}, ++ {N_("Polyglot Book:"), 0, &appData.polyglotBook}, ++ {NULL, 0, NULL}, ++}; ++ ++void UciPopDown() ++{ ++ if (!UciUp) return; ++ XtPopdown(UciShell); ++ XtDestroyWidget(UciShell); ++ UciUp = False; ++ ModeHighlight(); ++} ++ ++void UciCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name; ++ Arg args[16]; ++ char buf[80]; ++ int oldCores = appData.smpCores, ponder = 0; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("OK")) == 0) { ++ int nr, i, j; String name; ++ for(i=0; i<6; i++) { ++ XtSetArg(args[0], XtNstring, &name); ++ XtGetValues(controlDesc[i].handle, args, 1); ++ if(i&1) { ++ if(name) ++ *(char**) controlDesc[i].ptr = strdup(name); ++ } else { ++ if(sscanf(name, "%d", &j) == 1) ++ *(int*) controlDesc[i].ptr = j; ++ } ++ } ++ XtSetArg(args[0], XtNstate, &appData.usePolyglotBook); ++ XtGetValues(w1, args, 1); ++ XtSetArg(args[0], XtNstate, &appData.firstHasOwnBookUCI); ++ XtGetValues(w2, args, 1); ++ XtSetArg(args[0], XtNstate, &appData.secondHasOwnBookUCI); ++ XtGetValues(w3, args, 1); ++ XtSetArg(args[0], XtNstate, &ponder); ++ XtGetValues(w4, args, 1); ++ ++ // adjust setting in other menu for duplicates ++ // (perhaps duplicates should be removed from general Option Menu?) ++ XtSetArg(args[0], XtNleftBitmap, ponder ? xMarkPixmap : None); ++ XtSetValues(XtNameToWidget(menuBarWidget, ++ "menuOptions.Ponder Next Move"), args, 1); ++ ++ // make sure changes are sent to first engine by re-initializing it ++ // if it was already started pre-emptively at end of previous game ++ if(gameMode == BeginningOfGame) Reset(True, True); else { ++ // Some changed setting need immediate sending always. ++ PonderNextMoveEvent(ponder); ++ if(oldCores != appData.smpCores) ++ NewSettingEvent(False, "cores", appData.smpCores); ++ } ++ UciPopDown(); ++ return; ++ } ++} ++ ++void UciPopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, dialog, edit, form, b_ok, b_cancel, last = NULL, new, upperLeft; ++ Window root, child; ++ int x, y, i, j; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++// XtSetArg(args[i], XtNwidth, 300); i++; ++ UciShell = popup = ++ XtCreatePopupShell(_("Engine Settings"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ ++ form = ++ XtCreateManagedWidget("form", formWidgetClass, layout, ++ formArgs, XtNumber(formArgs)); ++ ++ j = 0; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++// XtSetArg(args[j], XtNheight, 20); j++; ++ for(i = 0; controlDesc[i].name != NULL; i++) { ++ j = 3; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++// XtSetArg(args[j], XtNwidth, 130); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ new = XtCreateManagedWidget(controlDesc[i].name, labelWidgetClass, form, args, j); ++ if(i==0) upperLeft = new; ++ ++ j = 4; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNwidth, i&1 ? 245 : 50); j++; ++ if(i&1) { ++ XtSetArg(args[j], XtNstring, * (char**) controlDesc[i].ptr ? ++ * (char**) controlDesc[i].ptr : ""); j++; ++ } else { ++ sprintf(def, "%d", * (int*) controlDesc[i].ptr); ++ XtSetArg(args[j], XtNstring, def); j++; ++ } ++ XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; ++ controlDesc[i].handle = last = ++ XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j); ++ XtAddEventHandler(last, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ } ++ ++ j=0; ++ XtSetArg(args[j], XtNfromHoriz, controlDesc[0].handle); j++; ++ XtSetArg(args[j], XtNbottom, XtChainTop); j++; ++ XtSetArg(args[j], XtNtop, XtChainTop); j++; ++ XtSetArg(args[j], XtNleft, XtChainRight); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNstate, appData.ponderNextMove); j++; ++ w4 = XtCreateManagedWidget(_("Ponder"), toggleWidgetClass, form, args, j); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ b_ok = XtCreateManagedWidget(_("OK"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_ok, XtNcallback, UciCallback, (XtPointer) 0); ++ ++ XtSetArg(args[j], XtNfromHoriz, b_ok); j++; ++ b_cancel = XtCreateManagedWidget(_("cancel"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_cancel, XtNcallback, UciPopDown, (XtPointer) 0); ++ ++ j = 5; ++ XtSetArg(args[j], XtNfromHoriz, upperLeft); j++; ++ XtSetArg(args[j], XtNstate, appData.usePolyglotBook); j++; ++ w1 = XtCreateManagedWidget(_(" use book "), toggleWidgetClass, form, args, j); ++// XtAddCallback(w1, XtNcallback, UciCallback, (XtPointer) 0); ++ ++ j = 5; ++ XtSetArg(args[j], XtNfromHoriz, w1); j++; ++ XtSetArg(args[j], XtNstate, appData.firstHasOwnBookUCI); j++; ++ w2 = XtCreateManagedWidget(_("own book 1"), toggleWidgetClass, form, args, j); ++// XtAddCallback(w2, XtNcallback, UciCallback, (XtPointer) 0); ++ ++ j = 5; ++ XtSetArg(args[j], XtNfromHoriz, w2); j++; ++ XtSetArg(args[j], XtNstate, appData.secondHasOwnBookUCI); j++; ++ w3 = XtCreateManagedWidget(_("own book 2"), toggleWidgetClass, form, args, j); ++// XtAddCallback(w3, XtNcallback, UciCallback, (XtPointer) 0); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "UciPopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ UciUp = True; ++ ++ previous = NULL; ++ SetFocus(controlDesc[2].handle, popup, (XEvent*) NULL, False); ++// XtSetKeyboardFocus(popup, controlDesc[1].handle); ++} ++ ++void UciMenuProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ UciPopUp(); ++} ++ ++//--------------------------- Engine-specific options menu ---------------------------------- ++ ++int SettingsUp; ++Widget SettingsShell; ++int values[MAX_OPTIONS]; ++ChessProgramState *currentCps; ++ ++void SettingsPopDown() ++{ ++ if (!SettingsUp) return; ++ XtPopdown(SettingsShell); ++ XtDestroyWidget(SettingsShell); ++ SettingsUp = False; ++ ModeHighlight(); ++} ++ ++void SpinCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name, val; ++ Widget w2; ++ Arg args[16]; ++ char buf[MSG_SIZ]; ++ int i, j; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ j = 0; ++ XtSetArg(args[0], XtNstring, &val); ++ XtGetValues(currentCps->option[(int)client_data].handle, args, 1); ++ sscanf(val, "%d", &j); ++ if (strcmp(name, "+") == 0) { ++ if(++j > currentCps->option[(int)client_data].max) return; ++ } else ++ if (strcmp(name, "-") == 0) { ++ if(--j < currentCps->option[(int)client_data].min) return; ++ } else return; ++ sprintf(buf, "%d", j); ++ XtSetArg(args[0], XtNstring, buf); ++ XtSetValues(currentCps->option[(int)client_data].handle, args, 1); ++} ++ ++void SettingsCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name, val; ++ Widget w2; ++ Arg args[16]; ++ char buf[MSG_SIZ]; ++ int i, j; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("cancel")) == 0) { ++ SettingsPopDown(); ++ return; ++ } ++ if (strcmp(name, _("OK")) == 0 || (int)client_data) { // save buttons imply OK ++ int nr; ++ ++ for(i=0; inrOptions; i++) { // send all options that had to be OK-ed to engine ++ switch(currentCps->option[i].type) { ++ case TextBox: ++ XtSetArg(args[0], XtNstring, &val); ++ XtGetValues(currentCps->option[i].handle, args, 1); ++ if(strcmp(currentCps->option[i].textValue, val)) { ++ strcpy(currentCps->option[i].textValue, val); ++ sprintf(buf, _("option %s %s\n"), currentCps->option[i].name, val); ++ SendToProgram(buf, currentCps); ++ } ++ break; ++ case Spin: ++ XtSetArg(args[0], XtNstring, &val); ++ XtGetValues(currentCps->option[i].handle, args, 1); ++ sscanf(val, "%d", &j); ++ if(j > currentCps->option[i].max) j = currentCps->option[i].max; ++ if(j < currentCps->option[i].min) j = currentCps->option[i].min; ++ if(currentCps->option[i].value != j) { ++ currentCps->option[i].value = j; ++ sprintf(buf, _("option %s %d\n"), currentCps->option[i].name, j); ++ SendToProgram(buf, currentCps); ++ } ++ break; ++ case CheckBox: ++ j = 0; ++ XtSetArg(args[0], XtNstate, &j); ++ XtGetValues(currentCps->option[i].handle, args, 1); ++ if(currentCps->option[i].value != j) { ++ currentCps->option[i].value = j; ++ sprintf(buf, _("option %s %d\n"), currentCps->option[i].name, j); ++ SendToProgram(buf, currentCps); ++ } ++ break; ++ case ComboBox: ++ if(currentCps->option[i].value != values[i]) { ++ currentCps->option[i].value = values[i]; ++ sprintf(buf, _("option %s %s\n"), currentCps->option[i].name, ++ ((char**)currentCps->option[i].textValue)[values[i]]); ++ SendToProgram(buf, currentCps); ++ } ++ break; ++ } ++ } ++ if((int)client_data) { // send save-button command to engine ++ sprintf(buf, _("option %s\n"), name); ++ SendToProgram(buf, currentCps); ++ } ++ SettingsPopDown(); ++ return; ++ } ++ sprintf(buf, _("option %s\n"), name); ++ SendToProgram(buf, currentCps); ++} ++ ++void ComboSelect(w, addr, index) // callback for all combo items + Widget w; + caddr_t addr; + caddr_t index; -{ - Arg args[16]; - int i = ((int)addr)>>8; - int j = 255 & (int) addr; - - values[i] = j; // store in temporary, for transfer at OK - XtSetArg(args[0], XtNlabel, ((char**)currentCps->option[i].textValue)[j]); ++{ ++ Arg args[16]; ++ int i = ((int)addr)>>8; ++ int j = 255 & (int) addr; ++ ++ values[i] = j; // store in temporary, for transfer at OK ++ XtSetArg(args[0], XtNlabel, ((char**)currentCps->option[i].textValue)[j]); + XtSetValues(currentCps->option[i].handle, args, 1); -} - ++} ++ + void CreateComboPopup(parent, name, n, mb) - Widget parent; - String name; ++ Widget parent; ++ String name; + int n; + char *mb[]; + { + int i=0, j; + Widget menu, entry; + Arg args[16]; + + menu = XtCreatePopupShell(name, simpleMenuWidgetClass, + parent, NULL, 0); + j = 0; - XtSetArg(args[j], XtNwidth, 100); j++; -// XtSetArg(args[j], XtNright, XtChainRight); j++; - while (mb[i] != NULL) { ++ XtSetArg(args[j], XtNwidth, 100); j++; ++// XtSetArg(args[j], XtNright, XtChainRight); j++; ++ while (mb[i] != NULL) { + entry = XtCreateManagedWidget(mb[i], smeBSBObjectClass, + menu, args, j); + XtAddCallback(entry, XtNcallback, + (XtCallbackProc) ComboSelect, + (caddr_t) (256*n+i)); + i++; + } + } + -void SettingsPopUp(ChessProgramState *cps) -{ - Arg args[16]; - Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel; - Window root, child; - int x, y, i, j; - int win_x, win_y; - unsigned int mask; - char def[80], *p, *q; - - // to do: start up second engine if needed - if(!cps->initDone || !cps->nrOptions) return; // nothing to be done - currentCps = cps; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - SettingsShell = popup = - XtCreatePopupShell("Settings Menu", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - form = - XtCreateManagedWidget(layoutName, formWidgetClass, layout, - formArgs, XtNumber(formArgs)); - - last = NULL; - for(i=0; inrOptions; i++) { - Widget box; - switch(cps->option[i].type) { - case Spin: - sprintf(def, "%d", cps->option[i].value); - case TextBox: - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - dialog = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNfromHoriz, dialog); j++; - XtSetArg(args[j], XtNborderWidth, 1); j++; - XtSetArg(args[j], XtNwidth, cps->option[i].type == Spin ? 40 : 100); j++; - XtSetArg(args[j], XtNeditType, XawtextEdit); j++; - XtSetArg(args[j], XtNuseStringInPlace, False); j++; - XtSetArg(args[j], XtNdisplayCaret, False); j++; - XtSetArg(args[j], XtNright, XtChainRight); j++; - XtSetArg(args[j], XtNresizable, True); j++; - XtSetArg(args[j], XtNstring, cps->option[i].type==Spin ? def : cps->option[i].textValue); j++; - edit = last; - cps->option[i].handle = (void*) - (last = XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j)); - XtAddEventHandler(box, ButtonPressMask, False, SetFocus, (XtPointer) popup); - if(cps->option[i].type == TextBox) break; - // add increment and decrement controls for spin - j=0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, box); j++; - XtSetArg(args[j], XtNheight, 10); j++; - XtSetArg(args[j], XtNwidth, 20); j++; - edit = XtCreateManagedWidget("+", commandWidgetClass, form, args, j); - XtAddCallback(edit, XtNcallback, SpinCallback, (XtPointer) i); - j=0; - XtSetArg(args[j], XtNfromVert, edit); j++; - XtSetArg(args[j], XtNfromHoriz, last); j++; - XtSetArg(args[j], XtNheight, 10); j++; - XtSetArg(args[j], XtNwidth, 20); j++; - last = XtCreateManagedWidget("-", commandWidgetClass, form, args, j); - XtAddCallback(last, XtNcallback, SpinCallback, (XtPointer) i); - break; - case CheckBox: - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNwidth, 10); j++; - XtSetArg(args[j], XtNheight, 10); j++; - XtSetArg(args[j], XtNstate, cps->option[i].value); j++; - cps->option[i].handle = (void*) - (dialog = XtCreateManagedWidget(" ", toggleWidgetClass, form, args, j)); - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNfromHoriz, dialog); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - last = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); - break; - case SaveButton: - case Button: - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNstate, cps->option[i].value); j++; - cps->option[i].handle = (void*) - (last = XtCreateManagedWidget(cps->option[i].name, commandWidgetClass, form, args, j)); - XtAddCallback(last, XtNcallback, SettingsCallback, (XtPointer) (cps->option[i].type == SaveButton)); - break; - case ComboBox: - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNborderWidth, 0); j++; - XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; - dialog = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); - - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNfromHoriz, dialog); j++; - XtSetArg(args[j], XtNwidth, 100); j++; - XtSetArg(args[j], XtNmenuName, XtNewString(cps->option[i].name)); j++; - XtSetArg(args[j], XtNlabel, ((char**)cps->option[i].textValue)[cps->option[i].value]); j++; - cps->option[i].handle = (void*) - (last = XtCreateManagedWidget(" ", menuButtonWidgetClass, form, args, j)); - CreateComboPopup(last, cps->option[i].name, i, (char **) cps->option[i].textValue); - values[i] = cps->option[i].value; - break; - } - } - - j=0; - XtSetArg(args[j], XtNfromVert, last); j++; - XtSetArg(args[j], XtNbottom, XtChainBottom); j++; - XtSetArg(args[j], XtNtop, XtChainBottom); j++; - XtSetArg(args[j], XtNleft, XtChainLeft); j++; - XtSetArg(args[j], XtNright, XtChainLeft); j++; - b_ok = XtCreateManagedWidget("OK", commandWidgetClass, form, args, j); - XtAddCallback(b_ok, XtNcallback, SettingsCallback, (XtPointer) 0); - - XtSetArg(args[j], XtNfromHoriz, b_ok); j++; - b_cancel = XtCreateManagedWidget("cancel", commandWidgetClass, form, args, j); - XtAddCallback(b_cancel, XtNcallback, SettingsPopDown, (XtPointer) 0); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "SettingsPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - SettingsUp = True; - - previous = NULL; - SetFocus(edit, popup, (XEvent*) NULL, False); -} - -void FirstSettingsProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - SettingsPopUp(&first); -} - -void SecondSettingsProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - SettingsPopUp(&second); -} - -//--------------------------- General Popup for Cloning ---------------------------------- -#if 0 -int XXXUp; -Widget XXXShell; - -void XXXPopDown() -{ - if (!XXXUp) return; - XtPopdown(XXXShell); - XtDestroyWidget(XXXShell); - XXXUp = False; - ModeHighlight(); -} - -void XXXCallback(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; -{ - String name; - Widget w2; - Arg args[16]; - char buf[80]; - - XtSetArg(args[0], XtNlabel, &name); - XtGetValues(w, args, 1); - - if (strcmp(name, "cancel") == 0) { - XXXPopDown(); - return; - } - if (strcmp(name, "ok") == 0) { - int nr; String name; - name = XawDialogGetValueString(w2 = XtParent(w)); - if(sscanf(name ,"%d",&nr) != 1) { - sprintf(buf, "%d", appData.defaultFrcPosition); - XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value - XtSetValues(w2, args, 1); - return; - } - XXXPopDown(); - return; - } -} - -void XXXPopUp() -{ - Arg args[16]; - Widget popup, layout, dialog, edit; - Window root, child; - int x, y, i; - int win_x, win_y; - unsigned int mask; - char def[80]; - - i = 0; - XtSetArg(args[i], XtNresizable, True); i++; - XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; - XXXShell = popup = - XtCreatePopupShell("XXX Menu", transientShellWidgetClass, - shellWidget, args, i); - - layout = - XtCreateManagedWidget(layoutName, formWidgetClass, popup, - layoutArgs, XtNumber(layoutArgs)); - - sprintf(def, "%d\n", appData.defaultFrcPosition); - i = 0; - XtSetArg(args[i], XtNlabel, ""); i++; - XtSetArg(args[i], XtNvalue, def); i++; - XtSetArg(args[i], XtNborderWidth, 0); i++; - dialog = XtCreateManagedWidget("XXX", dialogWidgetClass, - layout, args, i); - - XawDialogAddButton(dialog, "ok", XXXCallback, (XtPointer) dialog); - XawDialogAddButton(dialog, "cancel", XXXCallback, (XtPointer) dialog); - - XtRealizeWidget(popup); - CatchDeleteWindow(popup, "XXXPopDown"); - - XQueryPointer(xDisplay, xBoardWindow, &root, &child, - &x, &y, &win_x, &win_y, &mask); - - XtSetArg(args[0], XtNx, x - 10); - XtSetArg(args[1], XtNy, y - 30); - XtSetValues(popup, args, 2); - - XtPopup(popup, XtGrabExclusive); - XXXUp = True; - - edit = XtNameToWidget(dialog, "*value"); - - previous = NULL; - SetFocus(engThreshold, popup, (XEvent*) NULL, False); -} - -void XXXMenuProc(w, event, prms, nprms) - Widget w; - XEvent *event; - String *prms; - Cardinal *nprms; -{ - XXXPopUp(); -} -#endif - ++void SettingsPopUp(ChessProgramState *cps) ++{ ++ Arg args[16]; ++ Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel; ++ Window root, child; ++ int x, y, i, j; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80], *p, *q; ++ ++ // to do: start up second engine if needed ++ if(!cps->initDone || !cps->nrOptions) return; // nothing to be done ++ currentCps = cps; ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++ SettingsShell = popup = ++ XtCreatePopupShell(_("Settings Menu"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ form = ++ XtCreateManagedWidget(layoutName, formWidgetClass, layout, ++ formArgs, XtNumber(formArgs)); ++ ++ last = NULL; ++ for(i=0; inrOptions; i++) { ++ Widget box; ++ switch(cps->option[i].type) { ++ case Spin: ++ sprintf(def, "%d", cps->option[i].value); ++ case TextBox: ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ dialog = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNfromHoriz, dialog); j++; ++ XtSetArg(args[j], XtNborderWidth, 1); j++; ++ XtSetArg(args[j], XtNwidth, cps->option[i].type == Spin ? 40 : 100); j++; ++ XtSetArg(args[j], XtNeditType, XawtextEdit); j++; ++ XtSetArg(args[j], XtNuseStringInPlace, False); j++; ++ XtSetArg(args[j], XtNdisplayCaret, False); j++; ++ XtSetArg(args[j], XtNright, XtChainRight); j++; ++ XtSetArg(args[j], XtNresizable, True); j++; ++ XtSetArg(args[j], XtNstring, cps->option[i].type==Spin ? def : cps->option[i].textValue); j++; ++ edit = last; ++ cps->option[i].handle = (void*) ++ (last = XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, j)); ++ XtAddEventHandler(box, ButtonPressMask, False, SetFocus, (XtPointer) popup); ++ if(cps->option[i].type == TextBox) break; ++ // add increment and decrement controls for spin ++ j=0; ++ XtSetArg(args[j], XtNfromVert, edit); j++; ++ XtSetArg(args[j], XtNfromHoriz, box); j++; ++ XtSetArg(args[j], XtNheight, 10); j++; ++ XtSetArg(args[j], XtNwidth, 20); j++; ++ edit = XtCreateManagedWidget("+", commandWidgetClass, form, args, j); ++ XtAddCallback(edit, XtNcallback, SpinCallback, (XtPointer) i); ++ j=0; ++ XtSetArg(args[j], XtNfromVert, edit); j++; ++ XtSetArg(args[j], XtNfromHoriz, last); j++; ++ XtSetArg(args[j], XtNheight, 10); j++; ++ XtSetArg(args[j], XtNwidth, 20); j++; ++ last = XtCreateManagedWidget("-", commandWidgetClass, form, args, j); ++ XtAddCallback(last, XtNcallback, SpinCallback, (XtPointer) i); ++ break; ++ case CheckBox: ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNwidth, 10); j++; ++ XtSetArg(args[j], XtNheight, 10); j++; ++ XtSetArg(args[j], XtNstate, cps->option[i].value); j++; ++ cps->option[i].handle = (void*) ++ (dialog = XtCreateManagedWidget(" ", toggleWidgetClass, form, args, j)); ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNfromHoriz, dialog); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ last = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); ++ break; ++ case SaveButton: ++ case Button: ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNstate, cps->option[i].value); j++; ++ cps->option[i].handle = (void*) ++ (last = XtCreateManagedWidget(cps->option[i].name, commandWidgetClass, form, args, j)); ++ XtAddCallback(last, XtNcallback, SettingsCallback, (XtPointer) (cps->option[i].type == SaveButton)); ++ break; ++ case ComboBox: ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNborderWidth, 0); j++; ++ XtSetArg(args[j], XtNjustify, XtJustifyLeft); j++; ++ dialog = XtCreateManagedWidget(cps->option[i].name, labelWidgetClass, form, args, j); ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNfromHoriz, dialog); j++; ++ XtSetArg(args[j], XtNwidth, 100); j++; ++ XtSetArg(args[j], XtNmenuName, XtNewString(cps->option[i].name)); j++; ++ XtSetArg(args[j], XtNlabel, ((char**)cps->option[i].textValue)[cps->option[i].value]); j++; ++ cps->option[i].handle = (void*) ++ (last = XtCreateManagedWidget(" ", menuButtonWidgetClass, form, args, j)); ++ CreateComboPopup(last, cps->option[i].name, i, (char **) cps->option[i].textValue); ++ values[i] = cps->option[i].value; ++ break; ++ } ++ } ++ ++ j=0; ++ XtSetArg(args[j], XtNfromVert, last); j++; ++ XtSetArg(args[j], XtNbottom, XtChainBottom); j++; ++ XtSetArg(args[j], XtNtop, XtChainBottom); j++; ++ XtSetArg(args[j], XtNleft, XtChainLeft); j++; ++ XtSetArg(args[j], XtNright, XtChainLeft); j++; ++ b_ok = XtCreateManagedWidget(_("OK"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_ok, XtNcallback, SettingsCallback, (XtPointer) 0); ++ ++ XtSetArg(args[j], XtNfromHoriz, b_ok); j++; ++ b_cancel = XtCreateManagedWidget(_("cancel"), commandWidgetClass, form, args, j); ++ XtAddCallback(b_cancel, XtNcallback, SettingsPopDown, (XtPointer) 0); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "SettingsPopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ SettingsUp = True; ++ ++ previous = NULL; ++ SetFocus(edit, popup, (XEvent*) NULL, False); ++} ++ ++void FirstSettingsProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ SettingsPopUp(&first); ++} ++ ++void SecondSettingsProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ SettingsPopUp(&second); ++} ++ ++//--------------------------- General Popup for Cloning ---------------------------------- ++#if 0 ++int XXXUp; ++Widget XXXShell; ++ ++void XXXPopDown() ++{ ++ if (!XXXUp) return; ++ XtPopdown(XXXShell); ++ XtDestroyWidget(XXXShell); ++ XXXUp = False; ++ ModeHighlight(); ++} ++ ++void XXXCallback(w, client_data, call_data) ++ Widget w; ++ XtPointer client_data, call_data; ++{ ++ String name; ++ Widget w2; ++ Arg args[16]; ++ char buf[80]; ++ ++ XtSetArg(args[0], XtNlabel, &name); ++ XtGetValues(w, args, 1); ++ ++ if (strcmp(name, _("cancel")) == 0) { ++ XXXPopDown(); ++ return; ++ } ++ if (strcmp(name, _("ok")) == 0) { ++ int nr; String name; ++ name = XawDialogGetValueString(w2 = XtParent(w)); ++ if(sscanf(name ,"%d",&nr) != 1) { ++ sprintf(buf, "%d", appData.defaultFrcPosition); ++ XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value ++ XtSetValues(w2, args, 1); ++ return; ++ } ++ XXXPopDown(); ++ return; ++ } ++} ++ ++void XXXPopUp() ++{ ++ Arg args[16]; ++ Widget popup, layout, dialog, edit; ++ Window root, child; ++ int x, y, i; ++ int win_x, win_y; ++ unsigned int mask; ++ char def[80]; ++ ++ i = 0; ++ XtSetArg(args[i], XtNresizable, True); i++; ++ XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++; ++ XXXShell = popup = ++ XtCreatePopupShell(_("XXX Menu"), transientShellWidgetClass, ++ shellWidget, args, i); ++ ++ layout = ++ XtCreateManagedWidget(layoutName, formWidgetClass, popup, ++ layoutArgs, XtNumber(layoutArgs)); ++ ++ sprintf(def, "%d\n", appData.defaultFrcPosition); ++ i = 0; ++ XtSetArg(args[i], XtNlabel, ""); i++; ++ XtSetArg(args[i], XtNvalue, def); i++; ++ XtSetArg(args[i], XtNborderWidth, 0); i++; ++ dialog = XtCreateManagedWidget("XXX", dialogWidgetClass, ++ layout, args, i); ++ ++ XawDialogAddButton(dialog, _("ok"), XXXCallback, (XtPointer) dialog); ++ XawDialogAddButton(dialog, _("cancel"), XXXCallback, (XtPointer) dialog); ++ ++ XtRealizeWidget(popup); ++ CatchDeleteWindow(popup, "XXXPopDown"); ++ ++ XQueryPointer(xDisplay, xBoardWindow, &root, &child, ++ &x, &y, &win_x, &win_y, &mask); ++ ++ XtSetArg(args[0], XtNx, x - 10); ++ XtSetArg(args[1], XtNy, y - 30); ++ XtSetValues(popup, args, 2); ++ ++ XtPopup(popup, XtGrabExclusive); ++ XXXUp = True; ++ ++ edit = XtNameToWidget(dialog, "*value"); ++ ++ previous = NULL; ++ SetFocus(engThreshold, popup, (XEvent*) NULL, False); ++} ++ ++void XXXMenuProc(w, event, prms, nprms) ++ Widget w; ++ XEvent *event; ++ String *prms; ++ Cardinal *nprms; ++{ ++ XXXPopUp(); ++} ++#endif ++ diff --cc zippy.c index 564140e,c77276f..9170000 --- a/zippy.c +++ b/zippy.c @@@ -1,1090 -1,1135 +1,1150 @@@ - /* - * zippy.c -- Implements Zippy the Pinhead chess player on ICS in XBoard - * $Id$ - * - * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. - * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. - * - * The following terms apply to Digital Equipment Corporation's copyright - * interest in XBoard: - * ------------------------------------------------------------------------ - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Digital not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * ------------------------------------------------------------------------ - * - * The following terms apply to the enhanced version of XBoard distributed - * by the Free Software Foundation: - * ------------------------------------------------------------------------ - * 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 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * ------------------------------------------------------------------------ - */ - - #include "config.h" - - #include - #include - #include - #include - #include - - #if STDC_HEADERS - # include - # include - #else /* not STDC_HEADERS */ - extern char *getenv(); - # if HAVE_STRING_H - # include - # else /* not HAVE_STRING_H */ - # include - # endif /* not HAVE_STRING_H */ - #endif /* not STDC_HEADERS */ - - #if TIME_WITH_SYS_TIME - # include - # include - #else - # if HAVE_SYS_TIME_H - # include - # else - # include - # endif - #endif - #define HI "hlelo " - - #if HAVE_UNISTD_H - # include - #endif - - #include "common.h" - #include "zippy.h" - #include "frontend.h" - #include "backend.h" - #include "backendz.h" - - static char zippyPartner[MSG_SIZ]; - static char zippyLastOpp[MSG_SIZ]; - static int zippyConsecGames; - static time_t zippyLastGameEnd; - - extern void mysrandom(unsigned int seed); - extern int myrandom(void); - - void ZippyInit() - { - char *p; - - /* Get name of Zippy lines file */ - p = getenv("ZIPPYLINES"); - if (p != NULL) { - appData.zippyLines = p; - } - - /* Get word that Zippy thinks is insulting */ - p = getenv("ZIPPYPINHEAD"); - if (p != NULL) { - appData.zippyPinhead = p; - } - - /* What password is used for remote control? */ - p = getenv("ZIPPYPASSWORD"); - if (p != NULL) { - appData.zippyPassword = p; - } - - /* What password is used for remote commands to gnuchess? */ - p = getenv("ZIPPYPASSWORD2"); - if (p != NULL) { - appData.zippyPassword2 = p; - } - - /* Joke feature for people who try an old password */ - p = getenv("ZIPPYWRONGPASSWORD"); - if (p != NULL) { - appData.zippyWrongPassword = p; - } - - /* While testing, I want to accept challenges from only one person - (namely, my "anonymous" account), so I set an environment - variable ZIPPYACCEPTONLY. */ - p = getenv("ZIPPYACCEPTONLY"); - if ( p != NULL ) { - appData.zippyAcceptOnly = p; - } - - /* Should Zippy use "i" command? */ - /* Defaults to 1=true */ - p = getenv("ZIPPYUSEI"); - if (p != NULL) { - appData.zippyUseI = atoi(p); - } - - /* How does Zippy handle bughouse partnering? */ - /* 0=say we can't play, 1=manual partnering, 2=auto partnering */ - p = getenv("ZIPPYBUGHOUSE"); - if (p != NULL) { - appData.zippyBughouse = atoi(p); - } - - /* Does Zippy abort games with Crafty? */ - /* Defaults to 0=false */ - p = getenv("ZIPPYNOPLAYCRAFTY"); - if (p != NULL) { - appData.zippyNoplayCrafty = atoi(p); - } - - /* What ICS command does Zippy send at game end? Default: "gameend". */ - p = getenv("ZIPPYGAMEEND"); - if (p != NULL) { - appData.zippyGameEnd = p; - } - - /* What ICS command does Zippy send at game start? Default: none. */ - p = getenv("ZIPPYGAMESTART"); - if (p != NULL) { - appData.zippyGameStart = p; - } - - /* Should Zippy accept adjourns? */ - /* Defaults to 0=false */ - p = getenv("ZIPPYADJOURN"); - if (p != NULL) { - appData.zippyAdjourn = atoi(p); - } - - /* Should Zippy accept aborts? */ - /* Defaults to 0=false */ - p = getenv("ZIPPYABORT"); - if (p != NULL) { - appData.zippyAbort = atoi(p); - } - - /* Should Zippy play chess variants (besides bughouse)? */ - p = getenv("ZIPPYVARIANTS"); - if (p != NULL) { - appData.zippyVariants = p; - } - strcpy(first.variants, appData.zippyVariants); - - srandom(time(NULL)); - } - - /* - * Routines to implement Zippy talking - */ - - - char *swifties[] = { - "i acclaims:", "i admonishes:", "i advertises:", "i advises:", - "i advocates:", "i affirms:", "i alleges:", "i anathematizes:", - "i animadverts:", "i announces:", "i apostrophizes:", - "i appeals:", "i applauds:", "i approves:", "i argues:", - "i articulates:", "i asserts:", "i asseverates:", "i attests:", - "i avers:", "i avows:", "i baas:", "i babbles:", "i banters:", - "i barks:", "i bawls:", "i bays:", "i begs:", "i belches:", - "i bellows:", "i belts out:", "i berates:", "i beshrews:", - "i blabbers:", "i blabs:", "i blares:", "i blasphemes:", - "i blasts:", "i blathers:", "i bleats:", "i blithers:", - "i blubbers:", "i blurts out:", "i blusters:", "i boasts:", - "i brags:", "i brays:", "i broadcasts:", "i burbles:", - "i buzzes:", "i cachinnates:", "i cackles:", "i caterwauls:", - "i calumniates:", "i caws:", "i censures:", "i chants:", - "i chatters:", "i cheeps:", "i cheers:", "i chides:", "i chins:", - "i chirps:", "i chortles:", "i chuckles:", "i claims:", - "i clamors:", "i clucks:", "i commands:", "i commends:", - "i comments:", "i commiserates:", "i communicates:", - "i complains:", "i concludes:", "i confabulates:", "i confesses:", - "i coos:", "i coughs:", "i counsels:", "i cries:", "i croaks:", - "i crows:", "i curses:", "i daydreams:", "i debates:", - "i declaims:", "i declares:", "i delivers:", "i denounces:", - "i deposes:", "i directs:", "i discloses:", "i disparages:", - "i discourses:", "i divulges:", "i documents:", "i drawls:", - "i dreams:", "i drivels:", "i drones:", "i effuses:", - /*"i ejaculates:",*/ "i elucidates:", "i emotes:", "i endorses:", - "i enthuses:", "i entreats:", "i enunciates:", "i eulogizes:", - "i exclaims:", "i execrates:", "i exhorts:", "i expatiates:", - "i explains:", "i explicates:", "i explodes:", "i exposes:", - "i exposits:", "i expostulates: ", - "i expounds:", "i expresses:", "i extols:", - "i exults:", "i fantasizes:", "i fibs:", "i filibusters:", - "i flatters:", "i flutes:", "i fools:", "i free-associates:", - "i fulminates:", "i gabbles:", "i gabs:", "i gasps:", - "i giggles:", "i gossips:", "i gripes:", "i groans:", "i growls:", - "i grunts:", "i guesses:", "i guffaws:", "i gushes:", "i hails:", - "i hallucinates:", "i harangues:", "i harmonizes:", "i hectors:", - "i hints:", "i hisses:", "i hollers:", "i honks:", "i hoots:", - "i hosannas:", "i howls:", "i hums:", "i hypothecates:", - "i hypothesizes:", "i imagines:", "i implies:", "i implores:", - "i imprecates:", "i indicates:", "i infers:", - "i informs everyone:", "i instructs:", "i interjects:", - "i interposes:", "i intimates:", "i intones:", "i introspects:", - "i inveighs:", "i jabbers:", "i japes:", "i jests:", "i jibes:", - "i jives:", "i jokes:", "i joshes:", "i keens:", "i laments:", - "i lauds:", "i laughs:", "i lectures:", "i lies:", "i lilts:", - "i lisps:", "i maintains:", "i maledicts:", "i maunders:", - "i meows:", "i mewls:", "i mimes:", "i minces:", "i moans:", - "i moos:", "i mourns:", "i mouths:", "i mumbles:", "i murmurs:", - "i muses:", "i mutters:", "i nags:", "i natters:", "i neighs:", - "i notes:", "i nuncupates:", "i objurgates:", "i observes:", - "i offers:", "i oinks:", "i opines:", "i orates:", "i orders:", - "i panegyrizes:", "i pantomimes:", "i pants:", "i peals:", - "i peeps:", "i perorates:", "i persuades:", "i petitions:", - "i phonates:", "i pipes up:", "i pitches:", "i pleads:", - "i points out:", "i pontificates:", "i postulates:", "i praises:", - "i prates:", "i prattles:", "i preaches:", "i prescribes:", - "i prevaricates:", "i proclaims:", "i projects:", "i pronounces:", - "i proposes:", "i proscribes:", "i quacks:", "i queries:", - "i questions:", "i quips:", "i quotes:", "i rages:", "i rambles:", - "i rants:", "i raps:", "i rasps:", "i rattles:", "i raves:", - "i reacts:", "i recites:", "i recommends:", "i records:", - "i reiterates:", "i rejoins:", "i releases:", "i remarks:", - "i reminisces:", "i remonstrates:", "i repeats:", "i replies:", - "i reports:", "i reprimands:", "i reproaches:", "i reproves:", - "i resounds:", "i responds:", "i retorts:", "i reveals:", - "i reviles:", "i roars:", "i rumbles:", "i sanctions:", - "i satirizes:", "i sauces:", "i scolds:", "i screams:", - "i screeches:", "i semaphores:", "i sends:", "i sermonizes:", - "i shrieks:", "i sibilates:", "i sighs:", "i signals:", - "i signifies:", "i signs:", "i sings:", "i slurs:", "i snaps:", - "i snarls:", "i sneezes:", "i snickers:", "i sniggers:", - "i snivels:", "i snores:", "i snorts:", "i sobs:", - "i soliloquizes:", "i sounds off:", "i sounds out:", "i speaks:", - "i spews:", "i spits out:", "i splutters:", "i spoofs:", - "i spouts:", "i sputters:", "i squalls:", "i squawks:", - "i squeaks:", "i squeals:", "i stammers:", "i states:", - "i stresses:", "i stutters:", "i submits:", "i suggests:", - "i summarizes:", "i sums up:", "i swears:", "i talks:", - "i tattles:", "i teases:", "i telegraphs:", "i testifies:", - "i threatens:", "i thunders:", "i titters:", "i tongue-lashes:", - "i toots:", "i transcribes:", "i transmits:", "i trills:", - "i trumpets:", "i twaddles:", "i tweets:", "i twitters:", - "i types:", "i upbraids:", "i urges:", "i utters:", "i ventures:", - "i vibrates:", "i vilifies:", "i vituperates:", "i vocalizes:", - "i vociferates:", "i voices:", "i waffles:", "i wails:", - "i warbles:", "i warns:", "i weeps:", "i wheezes:", "i whimpers:", - "i whines:", "i whinnies:", "i whistles:", "i wisecracks:", - "i witnesses:", "i woofs:", "i writes:", "i yammers:", "i yawps:", - "i yells:", "i yelps:", "i yodels:", "i yowls:", "i zings:", - }; - - #define MAX_SPEECH 250 - - void Speak(how, whom) - char *how, *whom; - { - static FILE *zipfile = NULL; - static struct stat zipstat; - char zipbuf[MAX_SPEECH + 1]; - static time_t lastShout = 0; - time_t now; - char *p; - int c, speechlen; - Boolean done; - - if (strcmp(how, "shout") == 0) { - now = time((time_t *) NULL); - if (now - lastShout < 1*60) return; - lastShout = now; - if (appData.zippyUseI) { - how = swifties[(unsigned) random() % - (sizeof(swifties)/sizeof(char *))]; - } - } - - if (zipfile == NULL) { - zipfile = fopen(appData.zippyLines, "r"); - if (zipfile == NULL) { - DisplayFatalError("Can't open Zippy lines file", errno, 1); - return; - } - fstat(fileno(zipfile), &zipstat); - } - - for (;;) { - fseek(zipfile, (unsigned) random() % zipstat.st_size, 0); - do { - c = getc(zipfile); - } while (c != NULLCHAR && c != '^' && c != EOF); - if (c == EOF) continue; - while ((c = getc(zipfile)) == '\n') ; - if (c == EOF) continue; - break; - } - done = FALSE; - - /* Don't use ics_prefix; we need to let FICS expand the alias i -> it, - but use the real command "i" on ICC */ - strcpy(zipbuf, how); - strcat(zipbuf, " "); - if (whom != NULL) { - strcat(zipbuf, whom); - strcat(zipbuf, " "); - } - speechlen = strlen(zipbuf); - p = zipbuf + speechlen; - - while (++speechlen < MAX_SPEECH) { - if (c == NULLCHAR || c == '^') { - *p++ = '\n'; - *p = '\0'; - SendToICS(zipbuf); - return; - } else if (c == '\n') { - *p++ = ' '; - do { - c = getc(zipfile); - } while (c == ' '); - } else if (c == EOF) { - break; - } else { - *p++ = c; - c = getc(zipfile); - } - } - /* Tried to say something too long, or junk at the end of the - file. Try something else. */ - Speak(how, whom); /* tail recursion */ - } - - int ZippyCalled(str) - char *str; - { - return ics_handle[0] != NULLCHAR && StrCaseStr(str, ics_handle) != NULL; - } - - static char opp_name[128][32]; - static int num_opps=0; - - int ZippyControl(buf, i) - char *buf; - int *i; - { - char *player, *p; - char reply[MSG_SIZ]; - - #if TRIVIA - #include "trivia.c" - #endif - - /* Possibly reject Crafty as opponent */ - if (appData.zippyPlay && appData.zippyNoplayCrafty && forwardMostMove < 4 - && looking_at(buf, i, "* kibitzes: Hello from Crafty")) { - player = StripHighlightAndTitle(star_match[0]); - if ((gameMode == IcsPlayingWhite && - StrCaseCmp(player, gameInfo.black) == 0) || - (gameMode == IcsPlayingBlack && - StrCaseCmp(player, gameInfo.white) == 0)) { - - sprintf(reply, "%ssay This computer does not play Crafty clones\n%sabort\n%s+noplay %s\n", - ics_prefix, ics_prefix, ics_prefix, player); - SendToICS(reply); - } - return TRUE; - } - - /* If this is a computer, save the name. Then later, once the */ - /* game is really started, we will send the "computer" notice to */ - /* the engine. */ - if (appData.zippyPlay && - looking_at(buf, i, "* is in the computer list")) { - int i; - for (i=0;i= num_opps) strcpy(opp_name[num_opps++],star_match[0]); - } - if (appData.zippyPlay && looking_at(buf, i, "* * is a computer *")) { - int i; - for (i=0;i= num_opps) strcpy(opp_name[num_opps++],star_match[1]); - } - - /* Tells and says */ - if (appData.zippyPlay && - (looking_at(buf, i, "* offers to be your bughouse partner") || - looking_at(buf, i, "* tells you: [automatic message] I chose you"))) { - player = StripHighlightAndTitle(star_match[0]); - if (appData.zippyBughouse > 1 && first.initDone) { - sprintf(reply, "%spartner %s\n", ics_prefix, player); - SendToICS(reply); - if (strcmp(zippyPartner, player) != 0) { - strcpy(zippyPartner, player); - SendToProgram(reply + strlen(ics_prefix), &first); - } - } else if (appData.zippyBughouse > 0) { - sprintf(reply, "%sdecline %s\n", ics_prefix, player); - SendToICS(reply); - } else { - sprintf(reply, "%stell %s This computer cannot play bughouse\n", - ics_prefix, player); - SendToICS(reply); - } - return TRUE; - } - - if (appData.zippyPlay && appData.zippyBughouse && first.initDone && - looking_at(buf, i, "* agrees to be your partner")) { - player = StripHighlightAndTitle(star_match[0]); - sprintf(reply, "partner %s\n", player); - if (strcmp(zippyPartner, player) != 0) { - strcpy(zippyPartner, player); - SendToProgram(reply, &first); - } - return TRUE; - } - - if (appData.zippyPlay && appData.zippyBughouse && first.initDone && - (looking_at(buf, i, "are no longer *'s partner") || - looking_at(buf, i, - "* tells you: [automatic message] I'm no longer your"))) { - player = StripHighlightAndTitle(star_match[0]); - if (strcmp(zippyPartner, player) == 0) { - zippyPartner[0] = NULLCHAR; - SendToProgram("partner\n", &first); - } - return TRUE; - } - - if (appData.zippyPlay && appData.zippyBughouse && first.initDone && - (looking_at(buf, i, "no longer have a bughouse partner") || - looking_at(buf, i, "partner has disconnected") || - looking_at(buf, i, "partner has just chosen a new partner"))) { - zippyPartner[0] = NULLCHAR; - SendToProgram("partner\n", &first); - return TRUE; - } - - if (appData.zippyPlay && appData.zippyBughouse && first.initDone && - looking_at(buf, i, "* (your partner) tells you: *")) { - /* This pattern works on FICS but not ICC */ - player = StripHighlightAndTitle(star_match[0]); - if (strcmp(zippyPartner, player) != 0) { - strcpy(zippyPartner, player); - sprintf(reply, "partner %s\n", player); - SendToProgram(reply, &first); - } - sprintf(reply, "ptell %s\n", star_match[1]); - SendToProgram(reply, &first); - return TRUE; - } - - if (looking_at(buf, i, "* tells you: *") || - looking_at(buf, i, "* says: *")) { - player = StripHighlightAndTitle(star_match[0]); - if (appData.zippyPassword[0] != NULLCHAR && - strncmp(star_match[1], appData.zippyPassword, - strlen(appData.zippyPassword)) == 0) { - p = star_match[1] + strlen(appData.zippyPassword); - while (*p == ' ') p++; - SendToICS(p); - SendToICS("\n"); - } else if (appData.zippyPassword2[0] != NULLCHAR && first.initDone && - strncmp(star_match[1], appData.zippyPassword2, - strlen(appData.zippyPassword2)) == 0) { - p = star_match[1] + strlen(appData.zippyPassword2); - while (*p == ' ') p++; - SendToProgram(p, &first); - SendToProgram("\n", &first); - } else if (appData.zippyWrongPassword[0] != NULLCHAR && - strncmp(star_match[1], appData.zippyWrongPassword, - strlen(appData.zippyWrongPassword)) == 0) { - p = star_match[1] + strlen(appData.zippyWrongPassword); - while (*p == ' ') p++; - sprintf(reply, "wrong %s\n", player); - SendToICS(reply); - } else if (appData.zippyBughouse && first.initDone && - strcmp(player, zippyPartner) == 0) { - SendToProgram("ptell ", &first); - SendToProgram(star_match[1], &first); - SendToProgram("\n", &first); - } else if (strncmp(star_match[1], HI, 6) == 0) { - extern char* programVersion; - sprintf(reply, "%stell %s %s\n", - ics_prefix, player, programVersion); - SendToICS(reply); - } else if (strncmp(star_match[1], "W0W!! ", 6) == 0) { - extern char* programVersion; - sprintf(reply, "%stell %s %s\n", ics_prefix, - player, programVersion); - SendToICS(reply); - } else if (appData.zippyTalk && (((unsigned) random() % 10) < 9)) { - if (strcmp(player, ics_handle) != 0) { - Speak("tell", player); - } - } - return TRUE; - } - - if (looking_at(buf, i, "* spoofs you:")) { - player = StripHighlightAndTitle(star_match[0]); - sprintf(reply, "spoofedby %s\n", player); - SendToICS(reply); - } - return FALSE; - } - - int ZippyConverse(buf, i) - char *buf; - int *i; - { - static char lastgreet[MSG_SIZ]; - char reply[MSG_SIZ]; - int oldi; - - /* Shouts and emotes */ - if (looking_at(buf, i, "--> * *") || - looking_at(buf, i, "* shouts: *")) { - if (appData.zippyTalk) { - char *player = StripHighlightAndTitle(star_match[0]); - if (strcmp(player, ics_handle) == 0) { - return TRUE; - } else if (appData.zippyPinhead[0] != NULLCHAR && - StrCaseStr(star_match[1], appData.zippyPinhead) != NULL) { - sprintf(reply, "insult %s\n", player); - SendToICS(reply); - } else if (ZippyCalled(star_match[1])) { - Speak("shout", NULL); - } - } - return TRUE; - } - - if (looking_at(buf, i, "* kibitzes: *")) { - if (appData.zippyTalk && ((unsigned) random() % 10) < 9) { - char *player = StripHighlightAndTitle(star_match[0]); - if (strcmp(player, ics_handle) != 0) { - Speak("kibitz", NULL); - } - } - return TRUE; - } - - if (looking_at(buf, i, "* whispers: *")) { - if (appData.zippyTalk && ((unsigned) random() % 10) < 9) { - char *player = StripHighlightAndTitle(star_match[0]); - if (strcmp(player, ics_handle) != 0) { - Speak("whisper", NULL); - } - } - return TRUE; - } - - /* Messages */ - if ((looking_at(buf, i, ". * (*:*): *") && isdigit(star_match[1][0])) || - looking_at(buf, i, ". * at *:*: *")) { - if (appData.zippyTalk) { - FILE *f; - char *player = StripHighlightAndTitle(star_match[0]); - - if (strcmp(player, ics_handle) != 0) { - if (((unsigned) random() % 10) < 9) - Speak("message", player); - f = fopen("zippy.messagelog", "a"); - fprintf(f, "%s (%s:%s): %s\n", player, - star_match[1], star_match[2], star_match[3]); - fclose(f); - } - } - return TRUE; - } - - /* Channel tells */ - oldi = *i; - if (looking_at(buf, i, "*(*: *")) { - char *player; - char *channel; - if (star_match[0][0] == NULLCHAR || - strchr(star_match[0], ' ') || - strchr(star_match[1], ' ')) { - /* Oops, did not want to match this; probably a message */ - *i = oldi; - return FALSE; - } - if (appData.zippyTalk) { - player = StripHighlightAndTitle(star_match[0]); - channel = strrchr(star_match[1], '('); - if (channel == NULL) { - channel = star_match[1]; - } else { - channel++; - } - channel[strlen(channel)-1] = NULLCHAR; - #if 0 - /* Always tell to the channel (probability 90%) */ - if (strcmp(player, ics_handle) != 0 && - ((unsigned) random() % 10) < 9) { - Speak("tell", channel); - } - #else - /* Tell to the channel only if someone mentions our name */ - if (ZippyCalled(star_match[2])) { - Speak("tell", channel); - } - #endif - } - return TRUE; - } - - if (!appData.zippyTalk) return FALSE; - - if ((looking_at(buf, i, "You have * message") && - atoi(star_match[0]) != 0) || - looking_at(buf, i, "* has left a message for you") || - looking_at(buf, i, "* just sent you a message")) { - sprintf(reply, "%smessages\n%sclearmessages *\n", - ics_prefix, ics_prefix); - SendToICS(reply); - return TRUE; - } - - if (looking_at(buf, i, "Notification: * has arrived")) { - if (((unsigned) random() % 3) == 0) { - char *player = StripHighlightAndTitle(star_match[0]); - strcpy(lastgreet, player); - sprintf(reply, "greet %s\n", player); - SendToICS(reply); - Speak("tell", player); - } - } - - if (looking_at(buf, i, "Notification: * has departed")) { - if (((unsigned) random() % 3) == 0) { - char *player = StripHighlightAndTitle(star_match[0]); - sprintf(reply, "farewell %s\n", player); - SendToICS(reply); - } - } - - if (looking_at(buf, i, "Not sent -- * is censoring you")) { - char *player = StripHighlightAndTitle(star_match[0]); - if (strcmp(player, lastgreet) == 0) { - sprintf(reply, "%s-notify %s\n", ics_prefix, player); - SendToICS(reply); - } - } - - if (looking_at(buf, i, "command is currently turned off")) { - appData.zippyUseI = 0; - } - - return FALSE; - } - - void ZippyGameStart(white, black) - char *white, *black; - { - if (!first.initDone) { - /* Game is starting prematurely. We can't deal with this */ - SendToICS(ics_prefix); - SendToICS("abort\n"); - SendToICS(ics_prefix); - SendToICS("say Sorry, the chess program is not initialized yet.\n"); - return; - } - - if (appData.zippyGameStart[0] != NULLCHAR) { - SendToICS(appData.zippyGameStart); - SendToICS("\n"); - } - } - - void ZippyGameEnd(result, resultDetails) - ChessMove result; - char *resultDetails; - { - if (appData.zippyAcceptOnly[0] == NULLCHAR && - appData.zippyGameEnd[0] != NULLCHAR) { - SendToICS(appData.zippyGameEnd); - SendToICS("\n"); - } - zippyLastGameEnd = time(0); - } - - /* - * Routines to implement Zippy playing chess - */ - - void ZippyHandleChallenge(srated, swild, sbase, sincrement, opponent) - char *srated, *swild, *sbase, *sincrement, *opponent; - { - char buf[MSG_SIZ]; - int base, increment; - char rated; - VariantClass variant; - char *varname; - - rated = srated[0]; - variant = StringToVariant(swild); - varname = VariantName(variant); - base = atoi(sbase); - increment = atoi(sincrement); - - /* If icsAnalyzeEngine active - we don't accept automatic games */ - if (appData.icsActive) - if (appData.icsEngineAnalyze) return; - - /* If desired, you can insert more code here to decline matches - based on rated, variant, base, and increment, but it is - easier to use the ICS formula feature instead. */ - - if (variant == VariantLoadable) { - sprintf(buf, - "%stell %s This computer can't play wild type %s\n%sdecline %s\n", - ics_prefix, opponent, swild, ics_prefix, opponent); - SendToICS(buf); - return; - } - if (StrStr(appData.zippyVariants, varname) == NULL) { - sprintf(buf, - "%stell %s This computer can't play %s [%s], only %s\n%sdecline %s\n", - ics_prefix, opponent, swild, varname, appData.zippyVariants, - ics_prefix, opponent); - SendToICS(buf); - return; - } - - /* Are we blocking match requests from all but one person? */ - if (appData.zippyAcceptOnly[0] != NULLCHAR && - StrCaseCmp(opponent, appData.zippyAcceptOnly)) { - /* Yes, and this isn't him. Ignore challenge. */ - return; - } - - /* Too many consecutive games with same opponent? If so, make him - wait until someone else has played or a timeout has elapsed. */ - if (appData.zippyMaxGames && - strcmp(opponent, zippyLastOpp) == 0 && - zippyConsecGames >= appData.zippyMaxGames && - difftime(time(0), zippyLastGameEnd) < appData.zippyReplayTimeout) { - sprintf(buf, "%stell %s Sorry, you have just played %d consecutive games against %s. To give others a chance, please wait %d seconds or until someone else has played.\n%sdecline %s\n", - ics_prefix, opponent, zippyConsecGames, ics_handle, - appData.zippyReplayTimeout, ics_prefix, opponent); - SendToICS(buf); - return; - } - - /* Engine not yet initialized or still thinking about last game? */ - if (!first.initDone || first.lastPing != first.lastPong) { - sprintf(buf, "%stell %s I'm not quite ready for a new game yet; try again soon.\n%sdecline %s\n", - ics_prefix, opponent, ics_prefix, opponent); - SendToICS(buf); - return; - } - - sprintf(buf, "%saccept %s\n", ics_prefix, opponent); - SendToICS(buf); - if (appData.zippyTalk) { - Speak("tell", opponent); - } - } - - - /* Accept matches */ - int ZippyMatch(buf, i) - char *buf; - int *i; - { - if (looking_at(buf, i, "* * match * * requested with * (*)")) { - - ZippyHandleChallenge(star_match[0], star_match[1], - star_match[2], star_match[3], - StripHighlightAndTitle(star_match[4])); - return TRUE; - } - - /* Old FICS 0-increment form */ - if (looking_at(buf, i, "* * match * requested with * (*)")) { - - ZippyHandleChallenge(star_match[0], star_match[1], - star_match[2], "0", - StripHighlightAndTitle(star_match[3])); - return TRUE; - } - - if (looking_at(buf, i, - "* has made an alternate proposal of * * match * *.")) { - - ZippyHandleChallenge(star_match[1], star_match[2], - star_match[3], star_match[4], - StripHighlightAndTitle(star_match[0])); - return TRUE; - } - - /* FICS wild/nonstandard forms */ - if (looking_at(buf, i, "Challenge: * (*) *(*) * * * * Loaded from *")) { - /* note: star_match[2] can include "[white] " or "[black] " - before our own name. */ - ZippyHandleChallenge(star_match[4], star_match[8], - star_match[6], star_match[7], - StripHighlightAndTitle(star_match[0])); - return TRUE; - } - - if (looking_at(buf, i, - "Challenge: * (*) *(*) * * * * : * * Loaded from *")) { - /* note: star_match[2] can include "[white] " or "[black] " - before our own name. */ - ZippyHandleChallenge(star_match[4], star_match[10], - star_match[8], star_match[9], - StripHighlightAndTitle(star_match[0])); - return TRUE; - } - - /* Regular forms */ - if (looking_at(buf, i, "Challenge: * (*) *(*) * * * * : * *") | - looking_at(buf, i, "Challenge: * (*) *(*) * * * * * *")) { - /* note: star_match[2] can include "[white] " or "[black] " - before our own name. */ - ZippyHandleChallenge(star_match[4], star_match[5], - star_match[8], star_match[9], - StripHighlightAndTitle(star_match[0])); - return TRUE; - } - - if (looking_at(buf, i, "Challenge: * (*) *(*) * * * *")) { - /* note: star_match[2] can include "[white] " or "[black] " - before our own name. */ - ZippyHandleChallenge(star_match[4], star_match[5], - star_match[6], star_match[7], - StripHighlightAndTitle(star_match[0])); - return TRUE; - } - - if (ics_type == ICS_ICC) { - if (looking_at(buf, i, "Your opponent offers you a draw")) { - if (first.sendDrawOffers && first.initDone) - SendToProgram("draw\n", &first); - return TRUE; - } - } else { - if (looking_at(buf, i, "offers you a draw")) { - if (first.sendDrawOffers && first.initDone) { - SendToProgram("draw\n", &first); - } - return TRUE; - } - } - - if (looking_at(buf, i, "requests that the game be aborted") || - looking_at(buf, i, "would like to abort")) { - if (appData.zippyAbort || - (gameMode == IcsPlayingWhite && whiteTimeRemaining < 0) || - (gameMode == IcsPlayingBlack && blackTimeRemaining < 0)) { - SendToICS(ics_prefix); - SendToICS("abort\n"); - } else { - SendToICS(ics_prefix); - if (appData.zippyTalk) - SendToICS("say Whoa no! I am having FUN!!\n"); - else - SendToICS("say Sorry, this computer doesn't accept aborts.\n"); - } - return TRUE; - } - - if (looking_at(buf, i, "requests adjournment") || - looking_at(buf, i, "would like to adjourn")) { - if (appData.zippyAdjourn) { - SendToICS(ics_prefix); - SendToICS("adjourn\n"); - } else { - SendToICS(ics_prefix); - if (appData.zippyTalk) - SendToICS("say Whoa no! I am having FUN playing NOW!!\n"); - else - SendToICS("say Sorry, this computer doesn't accept adjourns.\n"); - } - return TRUE; - } - - return FALSE; - } - - /* Initialize chess program with data from the first board - * of a new or resumed game. - */ - void ZippyFirstBoard(moveNum, basetime, increment) - int moveNum, basetime, increment; - { - char buf[MSG_SIZ]; - int w, b; - char *opp = (gameMode==IcsPlayingWhite ? gameInfo.black : gameInfo.white); - Boolean sentPos = FALSE; - - if (!first.initDone) { - /* Game is starting prematurely. We can't deal with this */ - SendToICS(ics_prefix); - SendToICS("abort\n"); - SendToICS(ics_prefix); - SendToICS("say Sorry, the chess program is not initialized yet.\n"); - return; - } - - /* Send the variant command if needed */ - if (gameInfo.variant != VariantNormal) { - sprintf(buf, "variant %s\n", VariantName(gameInfo.variant)); - SendToProgram(buf, &first); - } - - if ((startedFromSetupPosition && moveNum == 0) || - (!appData.getMoveList && moveNum > 0)) { - SendToProgram("force\n", &first); - SendBoard(&first, moveNum); - sentPos = TRUE; - } - - sprintf(buf, "level 0 %d %d\n", basetime, increment); - SendToProgram(buf, &first); - - /* Count consecutive games from one opponent */ - if (strcmp(opp, zippyLastOpp) == 0) { - zippyConsecGames++; - } else { - zippyConsecGames = 1; - strcpy(zippyLastOpp, opp); - } - - /* Send the "computer" command if the opponent is in the list - we've been gathering. */ - for (w=0; w= 0) ? gameInfo.whiteRating : 0; - b = (gameInfo.blackRating >= 0) ? gameInfo.blackRating : 0; - - firstMove = FALSE; - if (gameMode == IcsPlayingWhite) { - if (first.sendName) { - sprintf(buf, "name %s\n", gameInfo.black); - SendToProgram(buf, &first); - } - strcpy(ics_handle, gameInfo.white); - sprintf(buf, "rating %d %d\n", w, b); - SendToProgram(buf, &first); - if (sentPos) { - /* Position sent above, engine is in force mode */ - if (WhiteOnMove(moveNum)) { - /* Engine is on move now */ - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); /*gnu kludge*/ - SendTimeRemaining(&first, TRUE); - SendToProgram("white\n", &first); - } else { - SendTimeRemaining(&first, TRUE); - } - } - SendToProgram("go\n", &first); - } else { - /* Engine's opponent is on move now */ - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, TRUE); - } - SendToProgram("playother\n", &first); - } else { - /* Need to send a "go" after opponent moves */ - firstMove = TRUE; - } - } - } else { - /* Position not sent above, move list might be sent later */ - if (moveNum == 0) { - /* No move list coming; at start of game */ - if (first.sendTime) { - if (first.useColors) { - SendToProgram("black\n", &first); /*gnu kludge*/ - SendTimeRemaining(&first, TRUE); - SendToProgram("white\n", &first); - } else { - SendTimeRemaining(&first, TRUE); - } - } - SendToProgram("go\n", &first); - } - } - } else if (gameMode == IcsPlayingBlack) { - if (first.sendName) { - sprintf(buf, "name %s\n", gameInfo.white); - SendToProgram(buf, &first); - } - strcpy(ics_handle, gameInfo.black); - sprintf(buf, "rating %d %d\n", b, w); - SendToProgram(buf, &first); - if (sentPos) { - /* Position sent above, engine is in force mode */ - if (!WhiteOnMove(moveNum)) { - /* Engine is on move now */ - if (first.sendTime) { - if (first.useColors) { - SendToProgram("white\n", &first); /*gnu kludge*/ - SendTimeRemaining(&first, FALSE); - SendToProgram("black\n", &first); - } else { - SendTimeRemaining(&first, FALSE); - } - } - SendToProgram("go\n", &first); - } else { - /* Engine's opponent is on move now */ - if (first.usePlayother) { - if (first.sendTime) { - SendTimeRemaining(&first, FALSE); - } - SendToProgram("playother\n", &first); - } else { - /* Need to send a "go" after opponent moves */ - firstMove = TRUE; - } - } - } else { - /* Position not sent above, move list might be sent later */ - /* Nothing needs to be done here */ - } - } - } - - - void - ZippyHoldings(white_holding, black_holding, new_piece) - char *white_holding, *black_holding, *new_piece; - { - char buf[MSG_SIZ]; - if (gameMode != IcsPlayingBlack && gameMode != IcsPlayingWhite) return; - sprintf(buf, "holding [%s] [%s] %s\n", - white_holding, black_holding, new_piece); - SendToProgram(buf, &first); - } + /* + * zippy.c -- Implements Zippy the Pinhead chess player on ICS in XBoard + * $Id: zippy.c,v 2.2 2003/11/25 05:25:20 mann Exp $ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-2001 Free Software Foundation, Inc. + * + * The following terms apply to Digital Equipment Corporation's copyright + * interest in XBoard: + * ------------------------------------------------------------------------ + * All Rights Reserved + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, + * provided that the above copyright notice appear in all copies and that + * both that copyright notice and this permission notice appear in + * supporting documentation, and that the name of Digital not be + * used in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. + * + * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * ------------------------------------------------------------------------ + * + * The following terms apply to the enhanced version of XBoard distributed + * by the Free Software Foundation: + * ------------------------------------------------------------------------ + * 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 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + + #include "config.h" + + #include + #include + #include + #include + #include + + #if STDC_HEADERS + # include + # include + #else /* not STDC_HEADERS */ + extern char *getenv(); + # if HAVE_STRING_H + # include + # else /* not HAVE_STRING_H */ + # include + # endif /* not HAVE_STRING_H */ + #endif /* not STDC_HEADERS */ + + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + #define HI "hlelo " + + #if HAVE_UNISTD_H + # include + #endif + + #include "common.h" + #include "zippy.h" + #include "frontend.h" + #include "backend.h" + #include "backendz.h" + -char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book - ++char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book ++ + static char zippyPartner[MSG_SIZ]; + static char zippyLastOpp[MSG_SIZ]; + static int zippyConsecGames; + static time_t zippyLastGameEnd; + ++extern void mysrandom(unsigned int seed); ++extern int myrandom(void); ++ + void ZippyInit() + { + char *p; + + /* Get name of Zippy lines file */ + p = getenv("ZIPPYLINES"); + if (p != NULL) { + appData.zippyLines = p; + } + + /* Get word that Zippy thinks is insulting */ + p = getenv("ZIPPYPINHEAD"); + if (p != NULL) { + appData.zippyPinhead = p; + } + + /* What password is used for remote control? */ + p = getenv("ZIPPYPASSWORD"); + if (p != NULL) { + appData.zippyPassword = p; + } + + /* What password is used for remote commands to gnuchess? */ + p = getenv("ZIPPYPASSWORD2"); + if (p != NULL) { + appData.zippyPassword2 = p; + } + + /* Joke feature for people who try an old password */ + p = getenv("ZIPPYWRONGPASSWORD"); + if (p != NULL) { + appData.zippyWrongPassword = p; + } + + /* While testing, I want to accept challenges from only one person + (namely, my "anonymous" account), so I set an environment + variable ZIPPYACCEPTONLY. */ + p = getenv("ZIPPYACCEPTONLY"); + if ( p != NULL ) { + appData.zippyAcceptOnly = p; + } + + /* Should Zippy use "i" command? */ + /* Defaults to 1=true */ + p = getenv("ZIPPYUSEI"); + if (p != NULL) { + appData.zippyUseI = atoi(p); + } + + /* How does Zippy handle bughouse partnering? */ + /* 0=say we can't play, 1=manual partnering, 2=auto partnering */ + p = getenv("ZIPPYBUGHOUSE"); + if (p != NULL) { + appData.zippyBughouse = atoi(p); + } + + /* Does Zippy abort games with Crafty? */ + /* Defaults to 0=false */ + p = getenv("ZIPPYNOPLAYCRAFTY"); + if (p != NULL) { + appData.zippyNoplayCrafty = atoi(p); + } + + /* What ICS command does Zippy send at game end? Default: "gameend". */ + p = getenv("ZIPPYGAMEEND"); + if (p != NULL) { + appData.zippyGameEnd = p; + } + + /* What ICS command does Zippy send at game start? Default: none. */ + p = getenv("ZIPPYGAMESTART"); + if (p != NULL) { + appData.zippyGameStart = p; + } + + /* Should Zippy accept adjourns? */ + /* Defaults to 0=false */ + p = getenv("ZIPPYADJOURN"); + if (p != NULL) { + appData.zippyAdjourn = atoi(p); + } + + /* Should Zippy accept aborts? */ + /* Defaults to 0=false */ + p = getenv("ZIPPYABORT"); + if (p != NULL) { + appData.zippyAbort = atoi(p); + } + + /* Should Zippy play chess variants (besides bughouse)? */ + p = getenv("ZIPPYVARIANTS"); + if (p != NULL) { + appData.zippyVariants = p; + } + strcpy(first.variants, appData.zippyVariants); + + srandom(time(NULL)); + } + + /* + * Routines to implement Zippy talking + */ + + + char *swifties[] = { + "i acclaims:", "i admonishes:", "i advertises:", "i advises:", + "i advocates:", "i affirms:", "i alleges:", "i anathematizes:", + "i animadverts:", "i announces:", "i apostrophizes:", + "i appeals:", "i applauds:", "i approves:", "i argues:", + "i articulates:", "i asserts:", "i asseverates:", "i attests:", + "i avers:", "i avows:", "i baas:", "i babbles:", "i banters:", + "i barks:", "i bawls:", "i bays:", "i begs:", "i belches:", + "i bellows:", "i belts out:", "i berates:", "i beshrews:", + "i blabbers:", "i blabs:", "i blares:", "i blasphemes:", + "i blasts:", "i blathers:", "i bleats:", "i blithers:", + "i blubbers:", "i blurts out:", "i blusters:", "i boasts:", + "i brags:", "i brays:", "i broadcasts:", "i burbles:", + "i buzzes:", "i cachinnates:", "i cackles:", "i caterwauls:", + "i calumniates:", "i caws:", "i censures:", "i chants:", + "i chatters:", "i cheeps:", "i cheers:", "i chides:", "i chins:", + "i chirps:", "i chortles:", "i chuckles:", "i claims:", + "i clamors:", "i clucks:", "i commands:", "i commends:", + "i comments:", "i commiserates:", "i communicates:", + "i complains:", "i concludes:", "i confabulates:", "i confesses:", + "i coos:", "i coughs:", "i counsels:", "i cries:", "i croaks:", + "i crows:", "i curses:", "i daydreams:", "i debates:", + "i declaims:", "i declares:", "i delivers:", "i denounces:", + "i deposes:", "i directs:", "i discloses:", "i disparages:", + "i discourses:", "i divulges:", "i documents:", "i drawls:", + "i dreams:", "i drivels:", "i drones:", "i effuses:", + /*"i ejaculates:",*/ "i elucidates:", "i emotes:", "i endorses:", + "i enthuses:", "i entreats:", "i enunciates:", "i eulogizes:", + "i exclaims:", "i execrates:", "i exhorts:", "i expatiates:", + "i explains:", "i explicates:", "i explodes:", "i exposes:", - "i exposits:", "i expounds:", "i expresses:", "i extols:", ++ "i exposits:", "i expostulates: ", ++ "i expounds:", "i expresses:", "i extols:", + "i exults:", "i fantasizes:", "i fibs:", "i filibusters:", + "i flatters:", "i flutes:", "i fools:", "i free-associates:", + "i fulminates:", "i gabbles:", "i gabs:", "i gasps:", + "i giggles:", "i gossips:", "i gripes:", "i groans:", "i growls:", + "i grunts:", "i guesses:", "i guffaws:", "i gushes:", "i hails:", + "i hallucinates:", "i harangues:", "i harmonizes:", "i hectors:", + "i hints:", "i hisses:", "i hollers:", "i honks:", "i hoots:", + "i hosannas:", "i howls:", "i hums:", "i hypothecates:", + "i hypothesizes:", "i imagines:", "i implies:", "i implores:", + "i imprecates:", "i indicates:", "i infers:", + "i informs everyone:", "i instructs:", "i interjects:", + "i interposes:", "i intimates:", "i intones:", "i introspects:", + "i inveighs:", "i jabbers:", "i japes:", "i jests:", "i jibes:", + "i jives:", "i jokes:", "i joshes:", "i keens:", "i laments:", + "i lauds:", "i laughs:", "i lectures:", "i lies:", "i lilts:", + "i lisps:", "i maintains:", "i maledicts:", "i maunders:", + "i meows:", "i mewls:", "i mimes:", "i minces:", "i moans:", + "i moos:", "i mourns:", "i mouths:", "i mumbles:", "i murmurs:", + "i muses:", "i mutters:", "i nags:", "i natters:", "i neighs:", + "i notes:", "i nuncupates:", "i objurgates:", "i observes:", + "i offers:", "i oinks:", "i opines:", "i orates:", "i orders:", + "i panegyrizes:", "i pantomimes:", "i pants:", "i peals:", + "i peeps:", "i perorates:", "i persuades:", "i petitions:", + "i phonates:", "i pipes up:", "i pitches:", "i pleads:", + "i points out:", "i pontificates:", "i postulates:", "i praises:", + "i prates:", "i prattles:", "i preaches:", "i prescribes:", + "i prevaricates:", "i proclaims:", "i projects:", "i pronounces:", + "i proposes:", "i proscribes:", "i quacks:", "i queries:", + "i questions:", "i quips:", "i quotes:", "i rages:", "i rambles:", + "i rants:", "i raps:", "i rasps:", "i rattles:", "i raves:", + "i reacts:", "i recites:", "i recommends:", "i records:", + "i reiterates:", "i rejoins:", "i releases:", "i remarks:", + "i reminisces:", "i remonstrates:", "i repeats:", "i replies:", + "i reports:", "i reprimands:", "i reproaches:", "i reproves:", + "i resounds:", "i responds:", "i retorts:", "i reveals:", + "i reviles:", "i roars:", "i rumbles:", "i sanctions:", + "i satirizes:", "i sauces:", "i scolds:", "i screams:", + "i screeches:", "i semaphores:", "i sends:", "i sermonizes:", + "i shrieks:", "i sibilates:", "i sighs:", "i signals:", + "i signifies:", "i signs:", "i sings:", "i slurs:", "i snaps:", + "i snarls:", "i sneezes:", "i snickers:", "i sniggers:", + "i snivels:", "i snores:", "i snorts:", "i sobs:", + "i soliloquizes:", "i sounds off:", "i sounds out:", "i speaks:", + "i spews:", "i spits out:", "i splutters:", "i spoofs:", + "i spouts:", "i sputters:", "i squalls:", "i squawks:", + "i squeaks:", "i squeals:", "i stammers:", "i states:", + "i stresses:", "i stutters:", "i submits:", "i suggests:", + "i summarizes:", "i sums up:", "i swears:", "i talks:", + "i tattles:", "i teases:", "i telegraphs:", "i testifies:", + "i threatens:", "i thunders:", "i titters:", "i tongue-lashes:", + "i toots:", "i transcribes:", "i transmits:", "i trills:", + "i trumpets:", "i twaddles:", "i tweets:", "i twitters:", + "i types:", "i upbraids:", "i urges:", "i utters:", "i ventures:", + "i vibrates:", "i vilifies:", "i vituperates:", "i vocalizes:", + "i vociferates:", "i voices:", "i waffles:", "i wails:", + "i warbles:", "i warns:", "i weeps:", "i wheezes:", "i whimpers:", + "i whines:", "i whinnies:", "i whistles:", "i wisecracks:", + "i witnesses:", "i woofs:", "i writes:", "i yammers:", "i yawps:", + "i yells:", "i yelps:", "i yodels:", "i yowls:", "i zings:", + }; + + #define MAX_SPEECH 250 + + void Speak(how, whom) + char *how, *whom; + { + static FILE *zipfile = NULL; + static struct stat zipstat; + char zipbuf[MAX_SPEECH + 1]; + static time_t lastShout = 0; + time_t now; + char *p; + int c, speechlen; + Boolean done; + + if (strcmp(how, "shout") == 0) { + now = time((time_t *) NULL); + if (now - lastShout < 1*60) return; + lastShout = now; + if (appData.zippyUseI) { + how = swifties[(unsigned) random() % + (sizeof(swifties)/sizeof(char *))]; + } + } + + if (zipfile == NULL) { + zipfile = fopen(appData.zippyLines, "r"); + if (zipfile == NULL) { + DisplayFatalError("Can't open Zippy lines file", errno, 1); + return; + } + fstat(fileno(zipfile), &zipstat); + } + + for (;;) { + fseek(zipfile, (unsigned) random() % zipstat.st_size, 0); + do { + c = getc(zipfile); + } while (c != NULLCHAR && c != '^' && c != EOF); + if (c == EOF) continue; + while ((c = getc(zipfile)) == '\n') ; + if (c == EOF) continue; + break; + } + done = FALSE; + + /* Don't use ics_prefix; we need to let FICS expand the alias i -> it, + but use the real command "i" on ICC */ + strcpy(zipbuf, how); + strcat(zipbuf, " "); + if (whom != NULL) { + strcat(zipbuf, whom); + strcat(zipbuf, " "); + } + speechlen = strlen(zipbuf); + p = zipbuf + speechlen; + + while (++speechlen < MAX_SPEECH) { + if (c == NULLCHAR || c == '^') { + *p++ = '\n'; + *p = '\0'; + SendToICS(zipbuf); + return; + } else if (c == '\n') { + *p++ = ' '; + do { + c = getc(zipfile); + } while (c == ' '); + } else if (c == EOF) { + break; + } else { + *p++ = c; + c = getc(zipfile); + } + } + /* Tried to say something too long, or junk at the end of the + file. Try something else. */ + Speak(how, whom); /* tail recursion */ + } + + int ZippyCalled(str) + char *str; + { + return ics_handle[0] != NULLCHAR && StrCaseStr(str, ics_handle) != NULL; + } + + static char opp_name[128][32]; + static int num_opps=0; + + extern ColorClass curColor; + + static void SetCurColor( ColorClass color ) + { + curColor = color; + } + + static void ColorizeEx( ColorClass color, int cont ) + { + if( appData.colorize ) { + Colorize( color, cont ); + SetCurColor( color ); + } + } + + int ZippyControl(buf, i) + char *buf; + int *i; + { + char *player, *p; + char reply[MSG_SIZ]; + + #if TRIVIA + #include "trivia.c" + #endif + + /* Possibly reject Crafty as opponent */ + if (appData.zippyPlay && appData.zippyNoplayCrafty && forwardMostMove < 4 + && looking_at(buf, i, "* kibitzes: Hello from Crafty")) + { + player = StripHighlightAndTitle(star_match[0]); + if ((gameMode == IcsPlayingWhite && + StrCaseCmp(player, gameInfo.black) == 0) || + (gameMode == IcsPlayingBlack && + StrCaseCmp(player, gameInfo.white) == 0)) { + + sprintf(reply, "%ssay This computer does not play Crafty clones\n%sabort\n%s+noplay %s\n", + ics_prefix, ics_prefix, ics_prefix, player); + SendToICS(reply); + } + return TRUE; + } + + /* If this is a computer, save the name. Then later, once the */ + /* game is really started, we will send the "computer" notice to */ + /* the engine. */ + if (appData.zippyPlay && + looking_at(buf, i, "* is in the computer list")) { + int i; + for (i=0;i= num_opps) strcpy(opp_name[num_opps++],star_match[0]); + } + if (appData.zippyPlay && looking_at(buf, i, "* * is a computer *")) { + int i; + for (i=0;i= num_opps) strcpy(opp_name[num_opps++],star_match[1]); + } + + /* Tells and says */ + if (appData.zippyPlay && + (looking_at(buf, i, "* offers to be your bughouse partner") || + looking_at(buf, i, "* tells you: [automatic message] I chose you"))) { + player = StripHighlightAndTitle(star_match[0]); + if (appData.zippyBughouse > 1 && first.initDone) { + sprintf(reply, "%spartner %s\n", ics_prefix, player); + SendToICS(reply); + if (strcmp(zippyPartner, player) != 0) { + strcpy(zippyPartner, player); + SendToProgram(reply + strlen(ics_prefix), &first); + } + } else if (appData.zippyBughouse > 0) { + sprintf(reply, "%sdecline %s\n", ics_prefix, player); + SendToICS(reply); + } else { + sprintf(reply, "%stell %s This computer cannot play bughouse\n", + ics_prefix, player); + SendToICS(reply); + } + return TRUE; + } + + if (appData.zippyPlay && appData.zippyBughouse && first.initDone && + looking_at(buf, i, "* agrees to be your partner")) { + player = StripHighlightAndTitle(star_match[0]); + sprintf(reply, "partner %s\n", player); + if (strcmp(zippyPartner, player) != 0) { + strcpy(zippyPartner, player); + SendToProgram(reply, &first); + } + return TRUE; + } + + if (appData.zippyPlay && appData.zippyBughouse && first.initDone && + (looking_at(buf, i, "are no longer *'s partner") || + looking_at(buf, i, + "* tells you: [automatic message] I'm no longer your"))) { + player = StripHighlightAndTitle(star_match[0]); + if (strcmp(zippyPartner, player) == 0) { + zippyPartner[0] = NULLCHAR; + SendToProgram("partner\n", &first); + } + return TRUE; + } + + if (appData.zippyPlay && appData.zippyBughouse && first.initDone && + (looking_at(buf, i, "no longer have a bughouse partner") || + looking_at(buf, i, "partner has disconnected") || + looking_at(buf, i, "partner has just chosen a new partner"))) { + zippyPartner[0] = NULLCHAR; + SendToProgram("partner\n", &first); + return TRUE; + } + + if (appData.zippyPlay && appData.zippyBughouse && first.initDone && + looking_at(buf, i, "* (your partner) tells you: *")) { + /* This pattern works on FICS but not ICC */ + player = StripHighlightAndTitle(star_match[0]); + if (strcmp(zippyPartner, player) != 0) { + strcpy(zippyPartner, player); + sprintf(reply, "partner %s\n", player); + SendToProgram(reply, &first); + } + sprintf(reply, "ptell %s\n", star_match[1]); + SendToProgram(reply, &first); + return TRUE; + } + + if (looking_at(buf, i, "* tells you: *") || + looking_at(buf, i, "* says: *")) + { + player = StripHighlightAndTitle(star_match[0]); + if (appData.zippyPassword[0] != NULLCHAR && + strncmp(star_match[1], appData.zippyPassword, + strlen(appData.zippyPassword)) == 0) { + p = star_match[1] + strlen(appData.zippyPassword); + while (*p == ' ') p++; + SendToICS(p); + SendToICS("\n"); + } else if (appData.zippyPassword2[0] != NULLCHAR && first.initDone && + strncmp(star_match[1], appData.zippyPassword2, + strlen(appData.zippyPassword2)) == 0) { + p = star_match[1] + strlen(appData.zippyPassword2); + while (*p == ' ') p++; + SendToProgram(p, &first); + SendToProgram("\n", &first); + } else if (appData.zippyWrongPassword[0] != NULLCHAR && + strncmp(star_match[1], appData.zippyWrongPassword, + strlen(appData.zippyWrongPassword)) == 0) { + p = star_match[1] + strlen(appData.zippyWrongPassword); + while (*p == ' ') p++; + sprintf(reply, "wrong %s\n", player); + SendToICS(reply); + } else if (appData.zippyBughouse && first.initDone && + strcmp(player, zippyPartner) == 0) { + SendToProgram("ptell ", &first); + SendToProgram(star_match[1], &first); + SendToProgram("\n", &first); + } else if (strncmp(star_match[1], HI, 6) == 0) { + extern char* programVersion; + sprintf(reply, "%stell %s %s\n", + ics_prefix, player, programVersion); + SendToICS(reply); + } else if (strncmp(star_match[1], "W0W!! ", 6) == 0) { + extern char* programVersion; + sprintf(reply, "%stell %s %s\n", ics_prefix, + player, programVersion); + SendToICS(reply); + } else if (appData.zippyTalk && (((unsigned) random() % 10) < 9)) { + if (strcmp(player, ics_handle) != 0) { + Speak("tell", player); + } + } + + ColorizeEx( ColorTell, FALSE ); + + return TRUE; + } + + if( appData.colorize && looking_at(buf, i, "* (*) seeking") ) { + ColorizeEx(ColorSeek, FALSE); + return FALSE; + } + + if (looking_at(buf, i, "* spoofs you:")) { + player = StripHighlightAndTitle(star_match[0]); + sprintf(reply, "spoofedby %s\n", player); + SendToICS(reply); + } + + return FALSE; + } + + int ZippyConverse(buf, i) + char *buf; + int *i; + { + static char lastgreet[MSG_SIZ]; + char reply[MSG_SIZ]; + int oldi; + + /* Shouts and emotes */ + if (looking_at(buf, i, "--> * *") || + looking_at(buf, i, "* shouts: *")) + { + if (appData.zippyTalk) { + char *player = StripHighlightAndTitle(star_match[0]); + if (strcmp(player, ics_handle) == 0) { + return TRUE; + } else if (appData.zippyPinhead[0] != NULLCHAR && + StrCaseStr(star_match[1], appData.zippyPinhead) != NULL) { + sprintf(reply, "insult %s\n", player); + SendToICS(reply); + } else if (ZippyCalled(star_match[1])) { + Speak("shout", NULL); + } + } + + ColorizeEx(ColorShout, FALSE); + + return TRUE; + } + + if (looking_at(buf, i, "* kibitzes: *")) { + if (appData.zippyTalk && ((unsigned) random() % 10) < 9) { + char *player = StripHighlightAndTitle(star_match[0]); + if (strcmp(player, ics_handle) != 0) { + Speak("kibitz", NULL); + } + } + + ColorizeEx(ColorKibitz, FALSE); + + return TRUE; + } + + if (looking_at(buf, i, "* whispers: *")) { + if (appData.zippyTalk && ((unsigned) random() % 10) < 9) { + char *player = StripHighlightAndTitle(star_match[0]); + if (strcmp(player, ics_handle) != 0) { + Speak("whisper", NULL); + } + } + + ColorizeEx(ColorKibitz, FALSE); + + return TRUE; + } + + /* Messages */ + if ((looking_at(buf, i, ". * (*:*): *") && isdigit(star_match[1][0])) || + looking_at(buf, i, ". * at *:*: *")) { + if (appData.zippyTalk) { + FILE *f; + char *player = StripHighlightAndTitle(star_match[0]); + + if (strcmp(player, ics_handle) != 0) { + if (((unsigned) random() % 10) < 9) + Speak("message", player); + f = fopen("zippy.messagelog", "a"); + fprintf(f, "%s (%s:%s): %s\n", player, + star_match[1], star_match[2], star_match[3]); + fclose(f); + } + } + return TRUE; + } + + /* Channel tells */ + oldi = *i; + if (looking_at(buf, i, "*(*: *")) { + char *player; + char *channel; + if (star_match[0][0] == NULLCHAR || + strchr(star_match[0], ' ') || + strchr(star_match[1], ' ')) { + /* Oops, did not want to match this; probably a message */ + *i = oldi; + return FALSE; + } + if (appData.zippyTalk) { + player = StripHighlightAndTitle(star_match[0]); + channel = strrchr(star_match[1], '('); + if (channel == NULL) { + channel = star_match[1]; + } else { + channel++; + } + channel[strlen(channel)-1] = NULLCHAR; + #if 0 + /* Always tell to the channel (probability 90%) */ + if (strcmp(player, ics_handle) != 0 && + ((unsigned) random() % 10) < 9) { + Speak("tell", channel); + } + #else + /* Tell to the channel only if someone mentions our name */ + if (ZippyCalled(star_match[2])) { + Speak("tell", channel); + } + #endif + + ColorizeEx( atoi(channel) == 1 ? ColorChannel1 : ColorChannel, FALSE ); + } + return TRUE; + } + + if (!appData.zippyTalk) return FALSE; + + if ((looking_at(buf, i, "You have * message") && + atoi(star_match[0]) != 0) || + looking_at(buf, i, "* has left a message for you") || + looking_at(buf, i, "* just sent you a message")) { + sprintf(reply, "%smessages\n%sclearmessages *\n", + ics_prefix, ics_prefix); + SendToICS(reply); + return TRUE; + } + + if (looking_at(buf, i, "Notification: * has arrived")) { + if (((unsigned) random() % 3) == 0) { + char *player = StripHighlightAndTitle(star_match[0]); + strcpy(lastgreet, player); + sprintf(reply, "greet %s\n", player); + SendToICS(reply); + Speak("tell", player); + } + } + + if (looking_at(buf, i, "Notification: * has departed")) { + if (((unsigned) random() % 3) == 0) { + char *player = StripHighlightAndTitle(star_match[0]); + sprintf(reply, "farewell %s\n", player); + SendToICS(reply); + } + } + + if (looking_at(buf, i, "Not sent -- * is censoring you")) { + char *player = StripHighlightAndTitle(star_match[0]); + if (strcmp(player, lastgreet) == 0) { + sprintf(reply, "%s-notify %s\n", ics_prefix, player); + SendToICS(reply); + } + } + + if (looking_at(buf, i, "command is currently turned off")) { + appData.zippyUseI = 0; + } + + return FALSE; + } + + void ZippyGameStart(white, black) + char *white, *black; + { + if (!first.initDone) { + /* Game is starting prematurely. We can't deal with this */ + SendToICS(ics_prefix); + SendToICS("abort\n"); + SendToICS(ics_prefix); + SendToICS("say Sorry, the chess program is not initialized yet.\n"); + return; + } + + if (appData.zippyGameStart[0] != NULLCHAR) { + SendToICS(appData.zippyGameStart); + SendToICS("\n"); + } + } + + void ZippyGameEnd(result, resultDetails) + ChessMove result; + char *resultDetails; + { + if (appData.zippyAcceptOnly[0] == NULLCHAR && + appData.zippyGameEnd[0] != NULLCHAR) { + SendToICS(appData.zippyGameEnd); + SendToICS("\n"); + } + zippyLastGameEnd = time(0); + } + + /* + * Routines to implement Zippy playing chess + */ + + void ZippyHandleChallenge(srated, swild, sbase, sincrement, opponent) + char *srated, *swild, *sbase, *sincrement, *opponent; + { + char buf[MSG_SIZ]; + int base, increment, i=0; + char rated; + VariantClass variant; + char *varname; + + rated = srated[0]; + variant = StringToVariant(swild); + varname = VariantName(variant); + base = atoi(sbase); + increment = atoi(sincrement); + ++ /* [DM] If icsAnalyzeEngine active we don't accept automatic games */ ++ if (appData.icsActive && appData.icsEngineAnalyze) return; ++ + /* If desired, you can insert more code here to decline matches + based on rated, variant, base, and increment, but it is + easier to use the ICS formula feature instead. */ + + if (variant == VariantLoadable) { + sprintf(buf, + "%stell %s This computer can't play wild type %s\n%sdecline %s\n", + ics_prefix, opponent, swild, ics_prefix, opponent); + SendToICS(buf); + return; + } + if (StrStr(appData.zippyVariants, varname) == NULL || + (i=first.protocolVersion) != 1 && StrStr(first.variants, varname) == NULL /* [HGM] zippyvar */ + ) { + sprintf(buf, + "%stell %s This computer can't play %s [%s], only %s\n%sdecline %s\n", + ics_prefix, opponent, swild, varname, + i ? first.variants : appData.zippyVariants, /* [HGM] zippyvar */ + ics_prefix, opponent); + SendToICS(buf); + return; + } + + /* Are we blocking match requests from all but one person? */ + if (appData.zippyAcceptOnly[0] != NULLCHAR && + StrCaseCmp(opponent, appData.zippyAcceptOnly)) { + /* Yes, and this isn't him. Ignore challenge. */ + return; + } + + /* Too many consecutive games with same opponent? If so, make him + wait until someone else has played or a timeout has elapsed. */ + if (appData.zippyMaxGames && + strcmp(opponent, zippyLastOpp) == 0 && + zippyConsecGames >= appData.zippyMaxGames && + difftime(time(0), zippyLastGameEnd) < appData.zippyReplayTimeout) { + sprintf(buf, "%stell %s Sorry, you have just played %d consecutive games against %s. To give others a chance, please wait %d seconds or until someone else has played.\n%sdecline %s\n", + ics_prefix, opponent, zippyConsecGames, ics_handle, + appData.zippyReplayTimeout, ics_prefix, opponent); + SendToICS(buf); + return; + } + + /* Engine not yet initialized or still thinking about last game? */ + if (!first.initDone || first.lastPing != first.lastPong) { + sprintf(buf, "%stell %s I'm not quite ready for a new game yet; try again soon.\n%sdecline %s\n", + ics_prefix, opponent, ics_prefix, opponent); + SendToICS(buf); + return; + } + + sprintf(buf, "%saccept %s\n", ics_prefix, opponent); + SendToICS(buf); + if (appData.zippyTalk) { + Speak("tell", opponent); + } + } + + + /* Accept matches */ + int ZippyMatch(buf, i) + char *buf; + int *i; + { + if (looking_at(buf, i, "* * match * * requested with * (*)")) { + + ZippyHandleChallenge(star_match[0], star_match[1], + star_match[2], star_match[3], + StripHighlightAndTitle(star_match[4])); + return TRUE; + } + + /* Old FICS 0-increment form */ + if (looking_at(buf, i, "* * match * requested with * (*)")) { + + ZippyHandleChallenge(star_match[0], star_match[1], + star_match[2], "0", + StripHighlightAndTitle(star_match[3])); + return TRUE; + } + + if (looking_at(buf, i, + "* has made an alternate proposal of * * match * *.")) { + + ZippyHandleChallenge(star_match[1], star_match[2], + star_match[3], star_match[4], + StripHighlightAndTitle(star_match[0])); + return TRUE; + } + + /* FICS wild/nonstandard forms */ + if (looking_at(buf, i, "Challenge: * (*) *(*) * * * * Loaded from *")) { + /* note: star_match[2] can include "[white] " or "[black] " + before our own name. */ + if(star_match[8] == NULL || star_match[8][0] == 0) // [HGM] chessd: open-source ICS has file on next line + ZippyHandleChallenge(star_match[4], star_match[5], - star_match[6], star_match[7], - StripHighlightAndTitle(star_match[0])); ++ star_match[6], star_match[7], StripHighlightAndTitle(star_match[0])); + else ZippyHandleChallenge(star_match[4], star_match[8], + star_match[6], star_match[7], + StripHighlightAndTitle(star_match[0])); + return TRUE; + } + + if (looking_at(buf, i, + "Challenge: * (*) *(*) * * * * : * * Loaded from *")) { + /* note: star_match[2] can include "[white] " or "[black] " + before our own name. */ + ZippyHandleChallenge(star_match[4], star_match[10], + star_match[8], star_match[9], + StripHighlightAndTitle(star_match[0])); + return TRUE; + } + + /* Regular forms */ + if (looking_at(buf, i, "Challenge: * (*) *(*) * * * * : * *") | + looking_at(buf, i, "Challenge: * (*) *(*) * * * * * *")) { + /* note: star_match[2] can include "[white] " or "[black] " + before our own name. */ + ZippyHandleChallenge(star_match[4], star_match[5], + star_match[8], star_match[9], + StripHighlightAndTitle(star_match[0])); + return TRUE; + } + + if (looking_at(buf, i, "Challenge: * (*) *(*) * * * *")) { + /* note: star_match[2] can include "[white] " or "[black] " + before our own name. */ + ZippyHandleChallenge(star_match[4], star_match[5], + star_match[6], star_match[7], + StripHighlightAndTitle(star_match[0])); + return TRUE; + } + - if (looking_at(buf, i, "offers you a draw")) { - if (first.sendDrawOffers && first.initDone) { - SendToProgram("draw\n", &first); - } - return TRUE; ++ ++ if (ics_type == ICS_ICC) { // [DM] ++ if (looking_at(buf, i, "Your opponent offers you a draw")) { ++ if (first.sendDrawOffers && first.initDone) ++ SendToProgram("draw\n", &first); ++ return TRUE; ++ } ++ } else { ++ if (looking_at(buf, i, "offers you a draw")) { ++ if (first.sendDrawOffers && first.initDone) { ++ SendToProgram("draw\n", &first); ++ } ++ return TRUE; ++ } + } + + if (looking_at(buf, i, "requests that the game be aborted") || + looking_at(buf, i, "would like to abort")) { + if (appData.zippyAbort || + (gameMode == IcsPlayingWhite && whiteTimeRemaining < 0) || + (gameMode == IcsPlayingBlack && blackTimeRemaining < 0)) { + SendToICS(ics_prefix); + SendToICS("abort\n"); + } else { + SendToICS(ics_prefix); + if (appData.zippyTalk) + SendToICS("say Whoa no! I am having FUN!!\n"); + else + SendToICS("say Sorry, this computer doesn't accept aborts.\n"); + } + return TRUE; + } + + if (looking_at(buf, i, "requests adjournment") || + looking_at(buf, i, "would like to adjourn")) { + if (appData.zippyAdjourn) { + SendToICS(ics_prefix); + SendToICS("adjourn\n"); + } else { + SendToICS(ics_prefix); + if (appData.zippyTalk) + SendToICS("say Whoa no! I am having FUN playing NOW!!\n"); + else + SendToICS("say Sorry, this computer doesn't accept adjourns.\n"); + } + return TRUE; + } + + return FALSE; + } + + /* Initialize chess program with data from the first board + * of a new or resumed game. + */ + void ZippyFirstBoard(moveNum, basetime, increment) + int moveNum, basetime, increment; + { + char buf[MSG_SIZ]; + int w, b; + char *opp = (gameMode==IcsPlayingWhite ? gameInfo.black : gameInfo.white); - Boolean sentPos = FALSE; ++ Boolean sentPos = FALSE; + char *bookHit = NULL; // [HGM] book + + if (!first.initDone) { + /* Game is starting prematurely. We can't deal with this */ + SendToICS(ics_prefix); + SendToICS("abort\n"); + SendToICS(ics_prefix); + SendToICS("say Sorry, the chess program is not initialized yet.\n"); + return; + } + + /* Send the variant command if needed */ + if (gameInfo.variant != VariantNormal) { + sprintf(buf, "variant %s\n", VariantName(gameInfo.variant)); + SendToProgram(buf, &first); + } + + if ((startedFromSetupPosition && moveNum == 0) || + (!appData.getMoveList && moveNum > 0)) { + SendToProgram("force\n", &first); + SendBoard(&first, moveNum); + sentPos = TRUE; + } + + sprintf(buf, "level 0 %d %d\n", basetime, increment); + SendToProgram(buf, &first); + + /* Count consecutive games from one opponent */ + if (strcmp(opp, zippyLastOpp) == 0) { + zippyConsecGames++; + } else { + zippyConsecGames = 1; + strcpy(zippyLastOpp, opp); + } + + /* Send the "computer" command if the opponent is in the list + we've been gathering. */ + for (w=0; w= 0) ? gameInfo.whiteRating : 0; + b = (gameInfo.blackRating >= 0) ? gameInfo.blackRating : 0; + + firstMove = FALSE; + if (gameMode == IcsPlayingWhite) { + if (first.sendName) { + sprintf(buf, "name %s\n", gameInfo.black); + SendToProgram(buf, &first); + } + strcpy(ics_handle, gameInfo.white); + sprintf(buf, "rating %d %d\n", w, b); + SendToProgram(buf, &first); + if (sentPos) { + /* Position sent above, engine is in force mode */ + if (WhiteOnMove(moveNum)) { + /* Engine is on move now */ + if (first.sendTime) { + if (first.useColors) { + SendToProgram("black\n", &first); /*gnu kludge*/ + SendTimeRemaining(&first, TRUE); + SendToProgram("white\n", &first); + } else { + SendTimeRemaining(&first, TRUE); + } + } + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move + } else { + /* Engine's opponent is on move now */ + if (first.usePlayother) { + if (first.sendTime) { + SendTimeRemaining(&first, TRUE); + } + SendToProgram("playother\n", &first); + } else { + /* Need to send a "go" after opponent moves */ + firstMove = TRUE; + } + } + } else { + /* Position not sent above, move list might be sent later */ + if (moveNum == 0) { + /* No move list coming; at start of game */ + if (first.sendTime) { + if (first.useColors) { + SendToProgram("black\n", &first); /*gnu kludge*/ + SendTimeRemaining(&first, TRUE); + SendToProgram("white\n", &first); + } else { + SendTimeRemaining(&first, TRUE); + } + } + // SendToProgram("go\n", &first); + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move + } + } + } else if (gameMode == IcsPlayingBlack) { + if (first.sendName) { + sprintf(buf, "name %s\n", gameInfo.white); + SendToProgram(buf, &first); + } + strcpy(ics_handle, gameInfo.black); + sprintf(buf, "rating %d %d\n", b, w); + SendToProgram(buf, &first); + if (sentPos) { + /* Position sent above, engine is in force mode */ + if (!WhiteOnMove(moveNum)) { + /* Engine is on move now */ + if (first.sendTime) { + if (first.useColors) { + SendToProgram("white\n", &first); /*gnu kludge*/ + SendTimeRemaining(&first, FALSE); + SendToProgram("black\n", &first); + } else { + SendTimeRemaining(&first, FALSE); + } + } + // SendToProgram("go\n", &first); + bookHit = SendMoveToBookUser(forwardMostMove-1, &first, TRUE); // [HGM] book: send go or retrieve book move + } else { + /* Engine's opponent is on move now */ + if (first.usePlayother) { + if (first.sendTime) { + SendTimeRemaining(&first, FALSE); + } + SendToProgram("playother\n", &first); + } else { + /* Need to send a "go" after opponent moves */ + firstMove = TRUE; + } + } + } else { + /* Position not sent above, move list might be sent later */ + /* Nothing needs to be done here */ + } + } - - if(bookHit) { // [HGM] book: simulate book reply - static char bookMove[MSG_SIZ]; // a bit generous? - - programStats.depth = programStats.nodes = programStats.time = - programStats.score = programStats.got_only_move = 0; - sprintf(programStats.movelist, "%s (xbook)", bookHit); - - strcpy(bookMove, "move "); - strcat(bookMove, bookHit); - HandleMachineMove(bookMove, &first); - } ++ ++ if(bookHit) { // [HGM] book: simulate book reply ++ static char bookMove[MSG_SIZ]; // a bit generous? ++ ++ programStats.depth = programStats.nodes = programStats.time = ++ programStats.score = programStats.got_only_move = 0; ++ sprintf(programStats.movelist, "%s (xbook)", bookHit); ++ ++ strcpy(bookMove, "move "); ++ strcat(bookMove, bookHit); ++ HandleMachineMove(bookMove, &first); ++ } + } + + + void + ZippyHoldings(white_holding, black_holding, new_piece) + char *white_holding, *black_holding, *new_piece; + { + char buf[MSG_SIZ]; + if (gameMode != IcsPlayingBlack && gameMode != IcsPlayingWhite) return; + sprintf(buf, "holding [%s] [%s] %s\n", + white_holding, black_holding, new_piece); + SendToProgram(buf, &first); + }