security fix: replaced sprintf with snprintf
[xboard.git] / xboard.texi
index 408288e..21fea41 100644 (file)
@@ -128,11 +128,47 @@ are playing a bughouse game on an Internet Chess Server, a list of the
 off-board pieces that each player has available is shown in the window
 title after the player's name; in addition, the piece menus show the
 number of pieces available of each type. From version 4.3.14 on, it is
-also possible in crazyhouse, bughouse or shogi to dag and drop pieces
+also possible in crazyhouse, bughouse or shogi to drag and drop pieces
 to the board from the holdings squares displayed next to the board.
-
-All other XBoard commands are available from the menu bar. The most
+This latter method for dropping pieces during a game is preferred,
+and the piece-drop menu is now deprecated (except for editing a position).
+Although the old behavior can still be selected through a command-line
+option, the default function of the right mouse button is to display
+the position the chess program thinks it will end up in,
+while moving the mouse vertically with this button pressed will step
+through the principal variation to show how this position will be 
+reached.
+Lines of play displayed in the engine-output window an similarly
+be played out on the board, by right-clicking on them.
+
+When connected to an ICS, it is possible to call up a graphical
+representation of players seeking a game in stead of the chess board,
+when the latter is not in use
+(i.e. when you are not playing or observing).
+Left-clicking the display area will switch between this 'seek graph'
+and the chess board.
+Hovering the mouse pointer over a dot will show the details of the
+seek ad in the message field above the board.
+Left-clicking the dot will challenge that player.
+Right-clicking a dot will 'push it to the back',
+to reveal any dots that were hidden behind it.
+Right-clicking off dots will refresh the graph.
+
+Most other XBoard commands are available from the menu bar. The most
 frequently used commands also have shortcut keys or on-screen buttons.
+Some rarely used parameters can only be set through options on the
+command line used to invoke XBoard.
+
+XBoard uses a settings file, in which it can remember any changes to
+the settings that are made through menus or command-line options,
+so they will still apply when you restart XBoard for another session.
+The settings can be saved into this file automatically when XBoard exits,
+or on explicit request of the user.
+The default name for the settings file is /etc/xboard/xboard.conf,
+but in a standard install this file is only used as a master settings
+file that determines the system-wide default settings,
+and defers reading and writing of user settings to a user-specific
+file like ~/.xboardrc in the user's home directory.
 
 When XBoard is iconized, its graphical icon is a white knight if
 it is White's turn to move, a black knight if it is Black's turn.  See
@@ -206,11 +242,20 @@ 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; XBoard is not able to walk
-variation trees.
+parentheses) also are treated as comments;
+however, if you rights-click them in the comment window,
+XBoard will shelve the current line, and load the the selected variation,
+so you can step through it.
+You can later revert to the previous line with the @samp{Revert} command.
+This way you can walk quite complex varation trees with XBoard.
+(The XBoard PGN parser is currenty limited to three nested levels of variations
+on top of the main game, however.)
 The nonstandard PGN tag [Variant "varname"] functions similarly to
 the -variant command-line option (see below), allowing games in certain chess
-variants to be loaded.  There is also a heuristic to 
+variants to be loaded.  
+Note that it must appear before any FEN tag for XBoard to recognize
+variant FENs appropriately.
+There is also a heuristic to 
 recognize chess variants from the Event tag, by looking for the strings
 that the Internet Chess Servers put there when saving variant ("wild") games.
 @item Load Next Game
@@ -416,6 +461,24 @@ If the move played is incorrect, an error message is displayed.  You
 can select this mode only while loading a game (that is, after
 selecting @samp{Load Game} from the File menu).  While XBoard is in 
 @samp{Training} mode, the navigation buttons are disabled.
+@item Show Engine Output
+@cindex Show Engine Output, Menu Item
+Shows or hides a window in which the thinking output of any loaded engines
+is displayed.
+XBoard will display lines of thinking output of the same depth ordered by score, 
+(highest score on top), rather than in the order the engine produced them. 
+Usually this amounts to the same, as a normal engine search will only find new PV 
+(and emit it as thinking output) 
+when it searches a move with a higher score than the previous variation. 
+But when the engine is in multi-variation mode this needs not always be true, 
+and it is more convenient for someone analyzing games to see the moves sorted by score. 
+The order in which the engine found them is only of interest to the engine author, 
+and can still be deduced from the time or node count printed with the line.
+@item Show Evaluation Graph
+@cindex Show Evaluation Graph, Menu Item
+Shows or hides a window which displays a graph of how the engine score(s)
+evolved as a function of the move number. Clicking on the graph will bring
+the corresponding position in the board display.
 @item Show Game List
 @cindex Show Game List, Menu Item
 Shows or hides the list of games generated by the last @samp{Load Game}
@@ -425,10 +488,6 @@ command.
 Shows or hides a list of moves of the current game.
 This list allows you to move the display to any earlier position in the game
 by clicking on the corresponding move.
-@item Show Engine Output
-@cindex Show Engine Output, Menu Item
-Shows or hides a window in which the thinking output of any loaded engines
-is displayed.
 @item Edit Tags
 @cindex Edit Tags, Menu Item
 Lets you edit the PGN (portable game notation)
@@ -545,6 +604,12 @@ observe command with no arguments. ICS mode only.
 @cindex Stop Examining, Menu Item
 Ends your participation in examining a game, by issuing the ICS
 unexamine command. ICS mode only.
+@item Upload to Examine
+@cindex Upload to Examine, Menu Item
+Create an examined game of the proper variant on the ICS,
+and send the game there that is currenty loaded in XBoard
+(e.g. through pasting or loading from file).
+You must be connected to an ICS for this to work.
 @item Adjudicate to White
 @itemx Adjudicate to Black
 @itemx Adjudicate Draw
@@ -633,9 +698,28 @@ the current line. If Pause mode is on, @samp{Forward to End} only moves
 your local view forward, and it will not go past the position
 that the game was in when you paused.
 @item Revert
+@itemx Annotate
 @cindex Revert, Menu Item
+@cindex Annotate, Menu Item
 If you are examining an ICS game and Pause mode is off, issues
 the ICS command @samp{revert}.
+In local mode, when you were editing or analyzing a game, 
+and have been entering a number of moves by hand, starting from 
+a position not at the end of the game, 
+the revert command restores the game to the variation you started from. 
+This can be applied recursively, 
+so that you can analyze variations on variations; 
+each time you create a new variation by entering an alternative move, 
+the current variation will be shelved. 
+Revert allows you to return to the most recently shelved variation.
+The difference between Revert and Annotate is that with the latter,
+the variation you had been entering and are now abandoning
+is currently added as a comment 
+(in PGN variation syntax, i.e. between parentheses)
+to the original move where you deviated.
+Note that such 'variation comments' can be played out on the board again
+(also when they were loaded from file)
+by clicking them in the comment window.
 @item Truncate Game
 @cindex Truncate Game, Menu Item
 Discards all remembered moves of the game beyond the current
@@ -684,7 +768,8 @@ of them is behind more than a user-adjustable score threshold.
 For the latter adjudication to work, XBoard should be able to properly understand
 the engine's scores. To facilitate the latter, you can inform xboard here if
 the engines report scores from the viewpoint of white, or from that of their own color.
-@item Engine Settings
+@item General Settings
+@cindex General Settings, Menu Item
 Pops up a sub-menu where you can set some engine parameters common to most engines,
 such as hash-table size, tablebase cache size, maximum number of processors
 that SMP engines can use, and where to find the Polyglot adapter needed
@@ -696,6 +781,25 @@ book that XBoard consults for any position a playing engine gets in.
 It then forces the engine to play the book move, rather than to think up its own,
 if that position is found in the book.
 The book can switched on and off independently for either engine.
+@item Engine #N Settings
+@cindex Engine Settings, Menu Item
+@cindex Engine #1 Settings, Menu Item
+@cindex Engine #2 Settings, Menu Item
+Pop up a menu dialog to alter the settings specific to the applicable engine.
+(The second engine is only accessible once it has been used in Two-Machines mode.)
+For each parameter the engine allows to be set,
+a control element will appear in this dialog that can be used to alter the value.
+Depending on the type of parameter (text string, number, multiple choice,
+on/off switch, instantaneous signal) the appropriate control will appear,
+with a description next to it.
+XBoard has no idea what these values mean; it just passes them on to the engine.
+How this dialog looks is completely determined by the engine,
+and XBoard just passes it on to the user.
+Many engines do not have any parameters that can be set by the user,
+and in that case the dialog will be empty (except for the OK and cancel buttons).
+UCI engines usually have many parameters. (But these are only visible with
+a sufficiently modern version of the Polyglot adapter needed to run UCI engines,
+e.g. Polyglot 1.4.55b.) For native XBoard engines this is less common.
 @item Time Control
 @cindex Time Control, Menu Item
 Pops up a sub-menu where you can set the time-control parameters interactively.
@@ -809,6 +913,13 @@ to keep from wasting time and network bandwidth fetching the move lists over
 and over.
 When you turn this option on from the menu, XBoard
 immediately fetches the move list of the current game (if any).
+@item Highlight Dragging
+@cindex Highlight Dragging, Menu Item
+If Highlight Dragging is on, and the option -showTargetSquares is also on
+in the settings file, all squares a piece that is 'picked up' with the mouse
+can legally move to are highighted with a fat colored dot in the
+highlightColor (non-captures) or premoveHighlightColor (captures).
+Legality testing must be on for XBoard to know how the piece moves.
 @item Highlight Last Move
 @cindex Highlight Last Move, Menu Item
 If Highlight Last Move is on, after a move is made, the starting and
@@ -917,6 +1028,26 @@ off this option is useful if you are playing a chess variant with
 rules that XBoard does not understand.  (Bughouse, suicide, and wild
 variants where the king may castle after starting on the d file are
 generally supported with Test Legality on.)
+@item Save Settings Now
+@cindex Save Settings Now, Menu Item
+Selecting this menu item causes the current XBoard settings to be
+written to the settings file, so they will also apply in future sessions.
+Note that some settings are 'volatile', and are not saved,
+because XBoard considers it too unlikely that you want those to apply
+next time.
+In particular this applies to the Chess program names, and all options
+giving information on those Chess programs (such as their directory,
+if they have their own opening book, if they are UCI or native XBoard),
+or the variant you are playing.
+Such options would still be understood when they appear in the settings
+file in case they were put there with the aid of a text editor, but they
+would disappear from the file as soon as you save the settings.
+@item Save Settings on Exit
+@cindex Save Settings on Exit, Menu Item
+Setting this option has no immediate effect, but causes the settings
+to be saved when you quit XBoard. What happens then is otherwise 
+identical to what happens when you use select "Save Settings Now",
+see there.
 @end table
 
 @node Help Menu
@@ -1321,6 +1452,12 @@ castling and e.p. fields in variants that do not have castling or e.p.
 (shatranj, courier, xiangqi, shogi) so that XBoard would normally omit them 
 (string = "- -"), or to add variant-specific fields that are not yet supported by XBoard 
 (e.g. to indicate the number of checks in 3check).
+@item -shuffleOpenings
+@cindex shuffleOpenings, option
+Forces shuffling of the opening setup in variants that normally have a fixed initial position.
+Shufflings are symmetric for black and white, and exempt King and Rooks in variants
+with normal castling.
+Remains in force until a new variant is selected.
 @end table
 
 @node UCI + WB Engine Settings
@@ -1549,6 +1686,58 @@ to the ICS, in zippy mode. The option @code{showThinking} must be switched on fo
 this option to work.
 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.
+@item -seekGraph true/false or -sg
+@cindex seekGraph, option
+@cindex sg, option
+Enables displaying of the seek graph by left-clicking the board when
+you are logged on to an ICS and currently idle.
+The seek graph show all players currently seeking games on the ICS,
+plotted according to their rating and the time control of the game they seek,
+in three different colors (for rated, unrated and wild games).
+Computer ads are displayed as squares, human ads are dots.
+Default: false.
+@item -autoRefresh true/false
+@cindex autoRefresh, option
+Enables automatic updating of the seek graph,
+by having the ICS send a running update of all newly placed
+and removed seek ads.
+This consumes a substantial amount of communication bandwidth,
+and is only supported for FICS and ICC.
+Default: false.
+@item -backgroundObserve true/false
+@cindex backgroundObserve, option
+When true, boards sent to you by the ICS from other games while you are playing
+(e.g. because you are observing them)
+will not be automatically displayed.
+Only a summary of time left and material of both players will appear
+in the message field above the board.
+XBoard will remember the last board it has received this way,
+and will display it in stead of the position in your own game
+when you press the right mouse button.
+No other information is stored on such games observed in the background;
+you cannot save such a game later, or step through its moves.
+This feature is provided solely for the benefit of bughouse players,
+to enable them to peek at their partner's game without the need
+to logon twice.
+Default: false.
+@item -dualBoard true/false
+@cindex dualBoard, option
+In combination with -backgroundObserve true, this option will display
+the board of the background game side by side with that of your own game,
+so you can have it in view permanently.
+Any board or holdings info coming in will be displayed on the secondary
+board immediately.
+This feature is still experimental and largely unfinished.
+There is no animation or highlighting of moves on the secondary board.
+Default: false.
+@item -oneClickMove true/false
+@cindex oneClickMove, option
+When set, this option allows you to enter moves by only clicking the to-
+or from-square, when only a single legal move to or from that square
+is possible.
+Double-clicking a piece (or clicking an already selected piece)
+will instruct that piece to make the only capture it can legally do.
+Defaut: false.
 @item -moves/-xmoves or -getMoveList true/false
 @cindex moves, option
 @cindex getMoveList, option
@@ -1699,6 +1888,12 @@ xboard*soundIcsDraw: draw.wav
 xboard*soundIcsUnfinished: unfinished.wav
 xboard*soundIcsAlarm: alarm.wav
 @end example
+@item -dropMenu true|false
+@cindex dropMenu, option
+This option allows you to emulate old behavior, 
+where the right mouse button brings up the (now deprecated) drop menu 
+rather than displaying the position at the end of the principal variation. 
+Default: False.
 @end table
 
 @node Load and Save options
@@ -1790,7 +1985,8 @@ Sets the name used in the PGN event tag to string.
 Default: "Computer Chess Game".
 @item -saveOutOfBookInfo true/false
 @cindex saveOutOfBookInfo, option`
-Include the information on how the engine(s) game out of its opening book in a special 'annotator' tag with the PGN file.
+Include the information on how the engine(s) game out of its opening book 
+in a special 'annotator' tag with the PGN file.
 @item -oldsave/-xoldsave or -oldSaveStyle true/false
 @cindex oldsave, option
 @cindex oldSaveStyle, option
@@ -1800,8 +1996,34 @@ Sets the Old Save Style menu option.  @xref{Options Menu}.  Default: false.
 The character string lists the PGN tags that should be printed in the
 Game List, and their order. The meaning of the codes is e=event,
 s=site, d=date, o=round, p=players, r=result, w=white Elo, b=black Elo,
-t=time control, v=variant, a=out-of-book info.
+t=time control, v=variant, a=out-of-book info, c=result comment.
 Default: "eprd"
+@item -ini or -settingsFile filename
+@itemx -saveSettingsFile filename
+@itemx @@filename
+@cindex saveSettingsFile, option
+@cindex SettingsFile, option
+@cindex init, option
+@cindex at sign, option
+When XBoard encounters an option -settingsFile (or -ini for short),
+or @@filename, it tries to read the mentioned file,
+and substitutes the contents of it (presumaby more command-line options)
+in place of the option.
+In the case of -ini or -settingsFile, the name of a successfully read
+settings file is also remembered as the file to use for saving settings
+(automatically on exit, or on user command).
+An option of the form @@filename does not affect saving.
+The option -saveSettingsFile does specify a name of the file to use
+for saving, without reading any options from it, and is thus also effective
+when the file did not exist yet.
+So the settings will be saved to the file specified in the last
+-saveSettingsFile or succesfull -settingsFile / -ini command,
+if any, and in /etc/xboard/xboard.conf otherwise.
+Usualy the latter is only accessible for the system administrator, though, 
+and will be used to contain system-wide default setings, amongst which
+a -saveSettingsFile and -settingsFile options to specify a settings file
+accessible to the individual user, such as ~/.xboardrc in the user's
+home directory.
 @end table
 
 @node User interface options
@@ -1856,10 +2078,15 @@ 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,
 or Tiny 21x21.
-Pieces of all these sizes are built into XBoard.
+Orthodox pieces of all these sizes are built into XBoard.
 Other sizes can
 be used if you have them; see the pixmapDirectory and bitmapDirectory
 options.
+Complete sets of un-orthodox pieces are only provided in sizes
+Bulky, Middling and (to a lesser extent) Petite;
+Archbishop, Marshall and Amazon are also available in all sizes between
+Bulky and Petite.
+When no bitmap is available, the piece will be displayed as Amazon or King.
 The default depends on the size of your screen; it is approximately the
 largest size that will fit without clipping.
 
@@ -1927,6 +2154,12 @@ shortcuts.  Default: true.
 Determines whether XBoard displays its pieces and squares with
 two colors (true) or four (false). You shouldn't have to
 specify @code{monoMode}; XBoard will determine if it is necessary.
+@item -showTargetSquares true/false
+@cindex showTargetSquares, option
+Determines whether XBoard can highlight the squares a piece has
+legal moves to, when you grab that piece with the mouse.
+If this option is set, this feature can be controlled through
+the Highlight Dragging menu item.
 @item -flashCount count
 @itemx -flashRate rate
 @itemx -flash/-xflash
@@ -2086,6 +2319,19 @@ Sets the Animate Moving menu option. @xref{Options Menu}.  Default: true.
 @cindex -animateSpeed, option
 Number of milliseconds delay between each animation frame when Animate
 Moves is on.
+@item -autoDisplayComment true/false
+@itemx -autoDisplayTags true/false
+@cindex -autoDisplayComment, option
+@cindex -autoDisplayTags, option
+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.  Default: true.
+@item -pasteSelection true/false
+@cindex -pasteSelection, option
+If this option is set to true, the Paste Position and Paste Game
+options paste from the currently selected text.  If false, they paste
+from the clipboard.  Default: false.
 @end table
 
 @node Adjudication Options
@@ -2197,6 +2443,7 @@ berolina      Pawns capture straight ahead, and move diagonal
 cylinder      Pieces wrap around the board edge
 knightmate    King moves as Knight, and vice versa 
 super         Superchess (shuffle variant with 4 exo-pieces)
+makruk        Thai Chess (shatranj-like, P promotes on 6th rank)
 fairy         A catchall variant in which all piece types 
               known to XBoard can participate (8x8)
 unknown       Catchall for other unknown variants
@@ -2669,46 +2916,41 @@ to the main line of development.
 @cindex Contributors
 
 Chris Sears and Dan Sears wrote the original XBoard.  They were
-responsible for versions 1.0 through 1.2.
-
-Evan Welsh wrote @code{CMail}.  Patrick Surry helped in designing,
-testing, and documenting CMail.
+responsible for versions 1.0 through 1.2.  The color scheme was taken
+from Wayne Christopher's @code{XChess} program.
 
 Tim Mann was primarily responsible for XBoard versions 1.3 through
 4.2.7, and for WinBoard (a port of XBoard to Microsoft Win32) from its
 inception through version 4.2.7.
 
-Mark Williams contributed the initial (WinBoard-only) implementation
-of many new features added to both XBoard and WinBoard in version
-4.1.0, including copy/paste, premove, icsAlarm, autoFlipView, training
-mode, auto raise, and blindfold.  Ben Nye contributed X copy/paste
-code for XBoard.
-
-Hugh Fisher added animated piece movement to XBoard, and Henrik Gram
-(henrikg@@funcom.com) added it to WinBoard.  Frank McIngvale added
-click/click moving, the Analysis modes, piece flashing, ZIICS import,
-and ICS text colorization to XBoard.  Jochen Wiedmann ported XBoard to
-the Amiga, creating AmyBoard, and converted the documentation to
-texinfo.  Elmar Bartel contributed the new piece bitmaps introduced in
-version 3.2.  John Chanak contributed the initial implementation of
-ICS mode.  The color scheme and the old 80x80 piece bitmaps were taken
-from Wayne Christopher's @code{XChess} program.
+John Chanak contributed the initial implementation of ICS mode.  Evan
+Welsh wrote @code{CMail}, and Patrick Surry helped in designing,
+testing, and documenting it.  Elmar Bartel contributed the new piece
+bitmaps introduced in version 3.2.  Jochen Wiedmann converted the
+documentation to texinfo.  Frank McIngvale added click/click moving,
+the Analysis modes, piece flashing, ZIICS import, and ICS text
+colorization to XBoard.  Hugh Fisher added animated piece movement to
+XBoard, and Henrik Gram added it to WinBoard.  Mark Williams
+contributed the initial (WinBoard-only) implementation of many new
+features added to both XBoard and WinBoard in version 4.1.0, including
+copy/paste, premove, icsAlarm, autoFlipView, training mode, auto
+raise, and blindfold.  Ben Nye contributed X copy/paste code for
+XBoard.
 
-In a fork from version 4.2.7,
-Alessandro Scotti added many elements to the user interface of WinBoard, 
-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. 
-
-H. G. Muller continued this fork of the project,
-producing version 4.3.
-He 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 more robust in dealing with buggy and crashing engines, 
-and extended time control with a time-odds and node-count-based modes.
-Most of the options that initially were WinBoard only have now been back-ported to XBoard.
+In a fork from version 4.2.7, Alessandro Scotti added many elements to
+the user interface of WinBoard, 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.
+
+H. G. Muller continued this fork of the project, producing version
+4.3.  He 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 more robust in dealing with buggy and crashing engines, and
+extended time control with a time-odds and node-count-based modes.
+Most of the options that initially were WinBoard only have now been
+back-ported to XBoard.
 
 Michel van den Bergh provided the code for reading Polyglot opening books.
 
@@ -2716,7 +2958,7 @@ Meanwhile, some work continued on the GNU XBoard project maintained at
 savannah.gnu.org, but version 4.2.8 was never released.  Daniel
 Mehrmann was responsible for much of this work.
 
-More recently, Arun Persaud worked with H. G. Muller to merge all
+Most recently, Arun Persaud worked with H. G. Muller to merge all
 the features of the never-released XBoard/WinBoard 4.2.8 of the GNU
 XBoard project and the never-released 4.3.16 from H. G.'s fork into a
 unified XBoard/WinBoard 4.4, which is now available both from the