Source:NetHack 3.6.1/include/config.h
Jump to navigation
Jump to search
Below is the full text to config.h from the source code of NetHack 3.6.1. To link to a particular line, write [[Source:NetHack 3.6.1/include/config.h#line123]], for example.
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.
1. /* NetHack 3.6 config.h $NHDT-Date: 1447728911 2015/11/17 02:55:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */ 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /*-Copyright (c) Robert Patrick Rankin, 2016. */ 4. /* NetHack may be freely redistributed. See license for details. */ 5. 6. #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */ 7. #define CONFIG_H 8. 9. /* 10. * Section 1: Operating and window systems selection. 11. * Select the version of the OS you are using. 12. * For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h. 13. * A "VMS" option is not needed since the VMS C-compilers 14. * provide it (no need to change sec#1, vmsconf.h handles it). 15. * MacOSX uses the UNIX configuration, not the old MAC one. 16. */ 17. 18. #define UNIX /* delete if no fork(), exec() available */ 19. 20. /* #define MSDOS */ /* in case it's not auto-detected */ 21. 22. /* #define OS2 */ /* define for OS/2 */ 23. 24. /* #define TOS */ /* define for Atari ST/TT */ 25. 26. /* #define STUPID */ /* avoid some complicated expressions if 27. your C compiler chokes on them */ 28. /* #define MINIMAL_TERM */ 29. /* if a terminal handles highlighting or tabs poorly, 30. try this define, used in pager.c and termcap.c */ 31. /* #define ULTRIX_CC20 */ 32. /* define only if using cc v2.0 on a DECstation */ 33. /* #define ULTRIX_PROTO */ 34. /* define for Ultrix 4.0 (or higher) on a DECstation; 35. * if you get compiler errors, don't define this. */ 36. /* Hint: if you're not developing code, don't define 37. ULTRIX_PROTO. */ 38. 39. #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */ 40. 41. /* Windowing systems... 42. * Define all of those you want supported in your binary. 43. * Some combinations make no sense. See the installation document. 44. */ 45. #if !defined(NOTTYGRAPHICS) 46. #define TTY_GRAPHICS /* good old tty based graphics */ 47. #endif 48. /* #define X11_GRAPHICS */ /* X11 interface */ 49. /* #define QT_GRAPHICS */ /* Qt interface */ 50. /* #define GNOME_GRAPHICS */ /* Gnome interface */ 51. /* #define MSWIN_GRAPHICS */ /* Windows NT, CE, Graphics */ 52. 53. /* 54. * Define the default window system. This should be one that is compiled 55. * into your system (see defines above). Known window systems are: 56. * 57. * tty, X11, mac, amii, BeOS, Qt, Gem, Gnome 58. */ 59. 60. /* MAC also means MAC windows */ 61. #ifdef MAC 62. #ifndef AUX 63. #define DEFAULT_WINDOW_SYS "mac" 64. #endif 65. #endif 66. 67. /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */ 68. #ifdef AMIGA 69. #define AMII_GRAPHICS /* (optional) */ 70. #define DEFAULT_WINDOW_SYS "amii" /* "amii", "amitile" or "tty" */ 71. #endif 72. 73. /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */ 74. #ifdef TOS 75. #define GEM_GRAPHICS /* Atari GEM interface (optional) */ 76. #define DEFAULT_WINDOW_SYS "Gem" /* "Gem" or "tty" */ 77. #endif 78. 79. #ifdef __BEOS__ 80. #define BEOS_GRAPHICS /* (optional) */ 81. #define DEFAULT_WINDOW_SYS "BeOS" /* "tty" */ 82. #ifndef HACKDIR /* override the default hackdir below */ 83. #define HACKDIR "/boot/apps/NetHack" 84. #endif 85. #endif 86. 87. #ifdef QT_GRAPHICS 88. #ifndef DEFAULT_WC_TILED_MAP 89. #define DEFAULT_WC_TILED_MAP /* Default to tiles if users doesn't say \ 90. wc_ascii_map */ 91. #endif 92. #ifndef NOUSER_SOUNDS 93. #define USER_SOUNDS /* Use sounds */ 94. #endif 95. #define USE_XPM /* Use XPM format for images (required) */ 96. #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */ 97. #ifndef DEFAULT_WINDOW_SYS 98. #define DEFAULT_WINDOW_SYS "Qt" 99. #endif 100. #endif 101. 102. #ifdef GNOME_GRAPHICS 103. #define USE_XPM /* Use XPM format for images (required) */ 104. #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.ppm) */ 105. #ifndef DEFAULT_WINDOW_SYS 106. #define DEFAULT_WINDOW_SYS "Gnome" 107. #endif 108. #endif 109. 110. #ifdef MSWIN_GRAPHICS 111. #ifndef DEFAULT_WINDOW_SYS 112. #define DEFAULT_WINDOW_SYS "mswin" 113. #endif 114. #define HACKDIR "\\nethack" 115. #endif 116. 117. #ifndef DEFAULT_WINDOW_SYS 118. #define DEFAULT_WINDOW_SYS "tty" 119. #endif 120. 121. #ifdef X11_GRAPHICS 122. /* 123. * There are two ways that X11 tiles may be defined. (1) using a custom 124. * format loaded by NetHack code, or (2) using the XPM format loaded by 125. * the free XPM library. The second option allows you to then use other 126. * programs to generate tiles files. For example, the PBMPlus tools 127. * would allow: 128. * xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm 129. */ 130. /* # define USE_XPM */ /* Disable if you do not have the XPM library */ 131. #ifdef USE_XPM 132. #define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */ 133. #endif 134. #ifndef DEFAULT_WC_TILED_MAP 135. #define DEFAULT_WC_TILED_MAP /* Default to tiles */ 136. #endif 137. #endif 138. 139. /* 140. * Section 2: Some global parameters and filenames. 141. * 142. * LOGFILE, XLOGFILE, NEWS and PANICLOG refer to files in 143. * the playground directory. Commenting out LOGFILE, XLOGFILE, 144. * NEWS or PANICLOG removes that feature from the game. 145. * 146. * Building with debugging features enabled is now unconditional; 147. * the old WIZARD setting for that has been eliminated. 148. * If SYSCF is enabled, WIZARD_NAME will be overridden at 149. * runtime by the SYSCF WIZARDS value. 150. * 151. * SYSCF: (not supported by all ports) 152. * If SYSCF is defined, the following configuration info is 153. * available in a global config space, with the compiled-in 154. * entries as defaults: 155. * WIZARDS (a space-separated list of usernames of users who 156. * can run the game in debug mode, aka wizard mode; 157. * a value of * allows anyone to debug; 158. * this does NOT default to compiled-in value) 159. * EXPLORERS (who can use explore mode, aka discover mode) 160. * SHELLERS (who can use ! to execute a shell subprocess) 161. * MAXPLAYERS (see MAX_NR_OF_PLAYERS below and nethack.sh) 162. * SUPPORT (how to get local support) [no default] 163. * RECOVER (how to recover a game at your site) [no default] 164. * For the record file (see topten.c): 165. * PERSMAX (max entries for one person) 166. * ENTRYMAX (max entries in the record file) 167. * POINTSMIN (min points to get an entry) 168. * PERS_IS_UID (0 or 1 - person is name or (numeric) userid) 169. * Can force incubi/succubi behavior to be toned down to nymph-like: 170. * SEDUCE (0 or 1 - runtime disable/enable SEDUCE option) 171. * The following options pertain to crash reporting: 172. * GREPPATH (the path to the system grep(1) utility) 173. * GDBPATH (the path to the system gdb(1) program) 174. * Regular nethack options can also be specified in order to 175. * provide system-wide default values local to your system: 176. * OPTIONS (same as in users' .nethackrc or defaults.nh) 177. * 178. * In the future there may be other ways to supply SYSCF 179. * information (Windows registry, Apple resource forks, etc) 180. * but at present the only supported method is via a text file. 181. * If the program is built with SYSCF enabled, the file *must* 182. * exist and be readable, otherwise the game will complain and 183. * refuse to start. 184. * SYSCF_FILE: file containing the SYSCF options shown above; 185. * default is 'sysconf' in nethack's playground. 186. */ 187. 188. #ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */ 189. #define WIZARD_NAME "wizard" /* value is ignored if SYSCF is enabled */ 190. #endif 191. 192. #ifndef SYSCF 193. #define SYSCF /* use a global configuration */ 194. #define SYSCF_FILE "sysconf" /* global configuration is in a file */ 195. #endif 196. 197. #ifndef GDBPATH 198. #define GDBPATH "/usr/bin/gdb" 199. #endif 200. #ifndef GREPPATH 201. #define GREPPATH "/bin/grep" 202. #endif 203. 204. /* note: "larger" is in comparison with 'record', the high-scores file 205. (whose name can be overridden via #define in global.h if desired) */ 206. #define LOGFILE "logfile" /* larger file for debugging purposes */ 207. #define XLOGFILE "xlogfile" /* even larger logfile */ 208. #define NEWS "news" /* the file containing the latest hack news */ 209. #define PANICLOG "paniclog" /* log of panic and impossible events */ 210. 211. /* alternative paniclog format, better suited for public servers with 212. many players, as it saves the player name and the game start time */ 213. /* #define PANICLOG_FMT2 */ 214. 215. /* 216. * PERSMAX, POINTSMIN, ENTRYMAX, PERS_IS_UID: 217. * These control the contents of 'record', the high-scores file. 218. * They used to be located in topten.c rather than config.h, and 219. * their values can be overridden at runtime (to increase ENTRYMAX, the 220. * maximum number of scores to keep, for example) if SYSCF is enabled. 221. */ 222. #ifndef PERSMAX 223. #define PERSMAX 3 /* entries per name/uid per char. allowed */ 224. #endif 225. #ifndef POINTSMIN 226. #define POINTSMIN 1 /* must be > 0 */ 227. #endif 228. #ifndef ENTRYMAX 229. #define ENTRYMAX 100 /* must be >= 10 */ 230. #endif 231. #ifndef PERS_IS_UID 232. #if !defined(MICRO) && !defined(MAC) && !defined(WIN32) 233. #define PERS_IS_UID 1 /* delete for PERSMAX per name; now per uid */ 234. #else 235. #define PERS_IS_UID 0 236. #endif 237. #endif 238. 239. /* 240. * If COMPRESS is defined, it should contain the full path name of your 241. * 'compress' program. 242. * 243. * If you define COMPRESS, you must also define COMPRESS_EXTENSION 244. * as the extension your compressor appends to filenames after 245. * compression. Currently, only UNIX fully implements 246. * COMPRESS; other ports should be able to uncompress save files a 247. * la unixmain.c if so inclined. 248. * 249. * Defining ZLIB_COMP builds in support for zlib compression. If you 250. * define ZLIB_COMP, you must link with a zlib library. Not all ports 251. * support ZLIB_COMP. 252. * 253. * COMPRESS and ZLIB_COMP are mutually exclusive. 254. * 255. */ 256. 257. #if defined(UNIX) && !defined(ZLIB_COMP) && !defined(COMPRESS) 258. /* path and file name extension for compression program */ 259. #define COMPRESS "/usr/bin/compress" /* Lempel-Ziv compression */ 260. #define COMPRESS_EXTENSION ".Z" /* compress's extension */ 261. /* An example of one alternative you might want to use: */ 262. /* #define COMPRESS "/usr/local/bin/gzip" */ /* FSF gzip compression */ 263. /* #define COMPRESS_EXTENSION ".gz" */ /* normal gzip extension */ 264. #endif 265. 266. #ifndef COMPRESS 267. /* # define ZLIB_COMP */ /* ZLIB for compression */ 268. #endif 269. 270. /* 271. * Internal Compression Options 272. * 273. * Internal compression options RLECOMP and ZEROCOMP alter the data 274. * that gets written to the save file by NetHack, in contrast 275. * to COMPRESS or ZLIB_COMP which compress the entire file after 276. * the NetHack data is written out. 277. * 278. * Defining RLECOMP builds in support for internal run-length 279. * compression of level structures. If RLECOMP support is included 280. * it can be toggled on/off at runtime via the config file option 281. * rlecomp. 282. * 283. * Defining ZEROCOMP builds in support for internal zero-comp 284. * compression of data. If ZEROCOMP support is included it can still 285. * be toggled on/off at runtime via the config file option zerocomp. 286. * 287. * RLECOMP and ZEROCOMP support can be included even if 288. * COMPRESS or ZLIB_COMP support is included. One reason for doing 289. * so would be to provide savefile read compatibility with a savefile 290. * where those options were in effect. With RLECOMP and/or ZEROCOMP 291. * defined, NetHack can read an rlecomp or zerocomp savefile in, yet 292. * re-save without them. 293. * 294. * Using any compression option will create smaller bones/level/save 295. * files at the cost of additional code and time. 296. */ 297. 298. /* # define INTERNAL_COMP */ /* defines both ZEROCOMP and RLECOMP */ 299. /* # define ZEROCOMP */ /* Support ZEROCOMP compression */ 300. /* # define RLECOMP */ /* Support RLECOMP compression */ 301. 302. /* 303. * Data librarian. Defining DLB places most of the support files into 304. * a tar-like file, thus making a neater installation. See *conf.h 305. * for detailed configuration. 306. */ 307. /* #define DLB */ /* not supported on all platforms */ 308. 309. /* 310. * Defining REPRODUCIBLE_BUILD causes 'util/makedefs -v' to construct 311. * date+time in include/date.h (to be shown by nethack's 'v' command) 312. * from SOURCE_DATE_EPOCH in the build environment rather than use 313. * current date+time when makedefs is run. 314. * 315. * [The version string will show "last revision <date> 316. * of "last build <date> 317. * which seems valid at the time date.h is generated. The person 318. * building the program is responsible for setting it correctly, 319. * and the value should be in UTC rather than local time. NetHack 320. * normally uses local time and doesn't display timezone so toggling 321. * REPRODUCIBLE_BUILD on or off might yield a date+time that appears 322. * to be incorrect relative to what the other setting produced.] 323. * 324. * Intent is to be able to rebuild the program with the same value 325. * and obtain an identical copy as was produced by a previous build. 326. * Not necessary for normal game play.... 327. */ 328. /* #define REPRODUCIBLE_BUILD */ /* use getenv("SOURCE_DATE_EPOCH") instead 329. of current time when creating date.h */ 330. 331. /* 332. * Defining INSURANCE slows down level changes, but allows games that 333. * died due to program or system crashes to be resumed from the point 334. * of the last level change, after running a utility program. 335. */ 336. #define INSURANCE /* allow crashed game recovery */ 337. 338. #ifndef MAC 339. #define CHDIR /* delete if no chdir() available */ 340. #endif 341. 342. #ifdef CHDIR 343. /* 344. * If you define HACKDIR, then this will be the default playground; 345. * otherwise it will be the current directory. 346. */ 347. #ifndef HACKDIR 348. #define HACKDIR "/usr/games/lib/nethackdir" 349. #endif 350. 351. /* 352. * Some system administrators are stupid enough to make Hack suid root 353. * or suid daemon, where daemon has other powers besides that of reading or 354. * writing Hack files. In such cases one should be careful with chdir's 355. * since the user might create files in a directory of his choice. 356. * Of course SECURE is meaningful only if HACKDIR is defined. 357. */ 358. /* #define SECURE */ /* do setuid(getuid()) after chdir() */ 359. 360. /* 361. * If it is desirable to limit the number of people that can play Hack 362. * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS (or use 363. * MAXPLAYERS under SYSCF). 364. * #define MAX_NR_OF_PLAYERS 6 365. */ 366. #endif /* CHDIR */ 367. 368. /* 369. * Section 3: Definitions that may vary with system type. 370. * For example, both schar and uchar should be short ints on 371. * the AT&T 3B2/3B5/etc. family. 372. */ 373. 374. /* 375. * Uncomment the following line if your compiler doesn't understand the 376. * 'void' type (and thus would give all sorts of compile errors without 377. * this definition). 378. */ 379. /* #define NOVOID */ /* define if no "void" data type. */ 380. 381. /* 382. * Uncomment the following line if your compiler falsely claims to be 383. * a standard C compiler (i.e., defines __STDC__ without cause). 384. * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc. 385. */ 386. /* #define NOTSTDC */ /* define for lying compilers */ 387. 388. #include "tradstdc.h" 389. 390. /* 391. * type schar: 392. * small signed integers (8 bits suffice) (eg. TOS) 393. * typedef char schar; 394. * will do when you have signed characters; otherwise use 395. * typedef short int schar; 396. */ 397. #ifdef AZTEC 398. #define schar char 399. #else 400. typedef signed char schar; 401. #endif 402. 403. /* 404. * type uchar: 405. * small unsigned integers (8 bits suffice - but 7 bits do not) 406. * typedef unsigned char uchar; 407. * will be satisfactory if you have an "unsigned char" type; otherwise use 408. * typedef unsigned short int uchar; 409. */ 410. #ifndef _AIX32 /* identical typedef in system file causes trouble */ 411. typedef unsigned char uchar; 412. #endif 413. 414. /* 415. * Various structures have the option of using bitfields to save space. 416. * If your C compiler handles bitfields well (e.g., it can initialize structs 417. * containing bitfields), you can define BITFIELDS. Otherwise, the game will 418. * allocate a separate character for each bitfield. (The bitfields used never 419. * have more than 7 bits, and most are only 1 bit.) 420. */ 421. #define BITFIELDS /* Good bitfield handling */ 422. 423. /* #define STRNCMPI */ /* compiler/library has the strncmpi function */ 424. 425. /* 426. * There are various choices for the NetHack vision system. There is a 427. * choice of two algorithms with the same behavior. Defining VISION_TABLES 428. * creates huge (60K) tables at compile time, drastically increasing data 429. * size, but runs slightly faster than the alternate algorithm. (MSDOS in 430. * particular cannot tolerate the increase in data size; other systems can 431. * flip a coin weighted to local conditions.) 432. * 433. * If VISION_TABLES is not defined, things will be faster if you can use 434. * MACRO_CPATH. Some cpps, however, cannot deal with the size of the 435. * functions that have been macroized. 436. */ 437. 438. /* #define VISION_TABLES */ /* use vision tables generated at compile time */ 439. #ifndef VISION_TABLES 440. #ifndef NO_MACRO_CPATH 441. #define MACRO_CPATH /* use clear_path macros instead of functions */ 442. #endif 443. #endif 444. 445. #if !defined(MAC) 446. #if !defined(NOCLIPPING) 447. #define CLIPPING /* allow smaller screens -- ERS */ 448. #endif 449. #endif 450. 451. #define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ 452. 453. /* CONFIG_ERROR_SECURE: If user makes NETHACKOPTIONS point to a file ... 454. * TRUE: Show the first error, nothing else. 455. * FALSE: Show all errors as normal, with line numbers and context. 456. */ 457. #ifndef CONFIG_ERROR_SECURE 458. # define CONFIG_ERROR_SECURE TRUE 459. #endif 460. 461. /* 462. * Section 4: EXPERIMENTAL STUFF 463. * 464. * Conditional compilation of new or experimental options are controlled here. 465. * Enable any of these at your own risk -- there are almost certainly 466. * bugs left here. 467. */ 468. 469. /* TTY_TILES_ESCCODES: Enable output of special console escape codes 470. * which act as hints for external programs such as EbonHack. 471. * 472. * Only for TTY_GRAPHICS. 473. * 474. * All of the escape codes are in the format ESC [ N z, where N can be 475. * one or more positive integer values, separated by semicolons. 476. * For example ESC [ 1 ; 0 ; 120 z 477. * 478. * Possible codes are: 479. * ESC [ 1 ; 0 ; n ; m z Start a glyph (aka a tile) number n, with flags m 480. * ESC [ 1 ; 1 z End a glyph. 481. * ESC [ 1 ; 2 ; n z Select a window n to output to. 482. * ESC [ 1 ; 3 z End of data. NetHack has finished sending data, 483. * and is waiting for input. 484. * 485. * Whenever NetHack outputs anything, it will first output the "select window" 486. * code. Whenever NetHack outputs a tile, it will first output the "start 487. * glyph" code, then the escape codes for color and the glyph character 488. * itself, and then the "end glyph" code. 489. * 490. * To compile NetHack with this, add tile.c to WINSRC and tile.o to WINOBJ 491. * in the hints file or Makefile. 492. * Set boolean option vt_tiledata in your config file to turn this on. 493. * Note that gnome-terminal at least doesn't work with this. */ 494. /* #define TTY_TILES_ESCCODES */ 495. 496. /* NetHack will execute an external program whenever a new message-window 497. * message is shown. The program to execute is given in environment variable 498. * NETHACK_MSGHANDLER. It will get the message as the only parameter. 499. * Only available with POSIX_TYPES or GNU C */ 500. /* #define MSGHANDLER */ 501. 502. #define STATUS_HILITES /* support hilites of status fields */ 503. 504. /* #define WINCHAIN */ /* stacked window systems */ 505. 506. /* #define DEBUG_MIGRATING_MONS */ /* add a wizard-mode command to help debug 507. migrating monsters */ 508. 509. /* SCORE_ON_BOTL is neither experimental nor inadequately tested, 510. but doesn't seem to fit in any other section... */ 511. /* #define SCORE_ON_BOTL */ /* enable the 'showscore' option to 512. show estimated score on status line */ 513. 514. /* FREE_ALL_MEMORY is neither experimental nor inadequately tested, 515. but it isn't necessary for successful operation of the program */ 516. #define FREE_ALL_MEMORY /* free all memory at exit */ 517. 518. /* EDIT_GETLIN makes the string input in TTY, Qt4, and X11 519. so some prompts will remember the previously input text 520. (within the same session) */ 521. /* #define EDIT_GETLIN */ 522. 523. /* #define DUMPLOG */ /* End-of-game dump logs */ 524. #ifdef DUMPLOG 525. 526. #ifndef DUMPLOG_MSG_COUNT 527. #define DUMPLOG_MSG_COUNT 50 528. #endif 529. 530. #ifndef DUMPLOG_FILE 531. #define DUMPLOG_FILE "/tmp/nethack.%n.%d.log" 532. /* DUMPLOG_FILE allows following placeholders: 533. %% literal '%' 534. %v version (eg. "3.6.1-0") 535. %u game UID 536. %t game start time, UNIX timestamp format 537. %T current time, UNIX timestamp format 538. %d game start time, YYYYMMDDhhmmss format 539. %D current time, YYYYMMDDhhmmss format 540. %n player name 541. %N first character of player name 542. DUMPLOG_FILE is not used if SYSCF is defined 543. */ 544. #endif 545. 546. #endif 547. 548. 549. /* End of Section 4 */ 550. 551. #ifdef TTY_TILES_ESCCODES 552. # ifndef USE_TILES 553. # define USE_TILES 554. # endif 555. #endif 556. 557. #include "global.h" /* Define everything else according to choices above */ 558. 559. #endif /* CONFIG_H */