Fix libchess move pointer corruption.
[cboard.git] / src / conf.h
blob0d04362fdcaacc743192cc497988cf08bb9af593
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2013 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef CONFIG_H
20 #define CONFIG_H
22 #ifdef HAVE_LIMITS_H
23 #include <limits.h>
24 #endif
26 #ifdef HAVE_SYS_PARAM_H
27 #include <sys/param.h>
28 #endif
30 // See init_color_pairs() in colors.c.
31 enum {
32 CONF_BWHITE, CONF_BBLACK, CONF_BSELECTED, CONF_BCURSOR, CONF_BGRAPHICS,
33 CONF_BCOORDS, CONF_BMOVESW, CONF_BMOVESB, CONF_BCOUNT, CONF_BDWINDOW,
34 CONF_TWINDOW, CONF_TTITLE, CONF_TBORDER,
35 CONF_SWINDOW, CONF_STITLE, CONF_SBORDER, CONF_SNOTIFY, CONF_SENGINE,
36 CONF_HWINDOW, CONF_HTITLE, CONF_HBORDER,
37 CONF_MWINDOW, CONF_MTITLE, CONF_MBORDER, CONF_MPROMPT,
38 CONF_IWINDOW, CONF_ITITLE, CONF_IBORDER, CONF_IPROMPT, CONF_MENU,
39 CONF_MENUS, CONF_MENUH, CONF_HISTORY_MENU_LG, CONF_BCASTLING,
40 CONF_BENPASSANT, CONF_BATTACK, CONF_MAX_COLORS
43 struct color_s {
44 short fg; // Foreground color.
45 short bg; // Background color.
46 int attrs; // Attributes for a color terminal.
47 int nattrs; // Attributes for a non-color terminal.
50 enum {
51 KEY_DEFAULT,
52 KEY_REPEAT,
53 KEY_SET
56 struct config_key_s {
57 int c;
58 int type;
59 char *str;
62 struct {
63 int jumpcount; // KEY_UP and KEY_DOWN in history mode.
64 int linegraphics; // Board line graphics.
65 int saveprompt; // Prompt to save modified games on quit. FIXME
66 int deleteprompt; // Prompt when deleting a game.
67 int clevel; // Compression level for compressed files.
68 int validmoves; // Display valid squares a selected piece can move to.
69 struct passwd *pwd; // Used throughout (tags/home directory).
70 char *nagfile; // The pathname to the NAG data file.
71 char *configfile; // The pathname to the configuration file (default or
72 // from the command line).
73 char *ccfile; // The pathname to the Country Code data file.
74 char *savedirectory; // Directory where saved games are stored.
75 char *datadir; // ~/.cboard
76 char *engine_cmd; // Alternate chess engine command. FIXME
77 int engine_protocol; // XBoard protocol: 1 or 2
78 struct color_s color[CONF_MAX_COLORS]; // Color configuration.
79 TAG **tag; // Custom PGN tags.
80 char *pattern; // Filename filter in the file browser.
81 char **einit; /* Strings to send to the chess engine upon each reset
82 * or new game.
84 struct config_key_s **keys; // Custom commands to send to the engine.
85 int details; // Board details.
86 int showattacks; // When board details is enabled.
87 char coordsyleft;
88 char fmpolyglot; // first move with polyglot
89 char boardleft;
90 char exitdialogbox;
91 char enginecmdblacktag;
92 int utf8_pieces; // For the board only.
93 } config;
95 #endif