Source:NetHack 3.4.3/include/config.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/config.h from NetHack 3.4.3. To link to a particular line, write [[config.h#line123]], for example.

  1. /*	SCCS Id: @(#)config.h	3.4	2003/12/06	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */

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. #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
  2. #define CONFIG_H
  3.  
  4.  
  5. /*
  6. * Section 1:	Operating and window systems selection.
  7. *		Select the version of the OS you are using.
  8. *		For "UNIX" select BSD, ULTRIX, SYSV, or HPUX in unixconf.h.
  9. *		A "VMS" option is not needed since the VMS C-compilers
  10. *		provide it (no need to change sec#1, vmsconf.h handles it).
  11. */
  12.  
  13. #define UNIX		/* delete if no fork(), exec() available */
  14.  
  15. /* #define MSDOS */	/* in case it's not auto-detected */
  16.  
  17. /* #define OS2 */	/* define for OS/2 */
  18.  
  19. /* #define TOS */	/* define for Atari ST/TT */
  20.  
  21. /* #define STUPID */	/* avoid some complicated expressions if
  22. 			   your C compiler chokes on them */
  23. /* #define MINIMAL_TERM */
  24. 			/* if a terminal handles highlighting or tabs poorly,
  25. 			   try this define, used in pager.c and termcap.c */
  26. /* #define ULTRIX_CC20 */
  27. 			/* define only if using cc v2.0 on a DECstation */
  28. /* #define ULTRIX_PROTO */
  29. 			/* define for Ultrix 4.0 (or higher) on a DECstation;
  30. 			 * if you get compiler errors, don't define this. */
  31. 			/* Hint: if you're not developing code, don't define
  32. 			   ULTRIX_PROTO. */
  33.  
  34. #include "config1.h"	/* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */
  35.  
  36.  
  37. /* Windowing systems...
  38. * Define all of those you want supported in your binary.
  39. * Some combinations make no sense.  See the installation document.
  40. */
  41. #define TTY_GRAPHICS	/* good old tty based graphics */
  42. /* #define X11_GRAPHICS */	/* X11 interface */
  43. /* #define QT_GRAPHICS */	/* Qt interface */
  44. /* #define GNOME_GRAPHICS */	/* Gnome interface */
  45. /* #define MSWIN_GRAPHICS */	/* Windows NT, CE, Graphics */
  46.  
  47. /*
  48. * Define the default window system.  This should be one that is compiled
  49. * into your system (see defines above).  Known window systems are:
  50. *
  51. *	tty, X11, mac, amii, BeOS, Qt, Gem, Gnome
  52. */
  53.  
  54. /* MAC also means MAC windows */
  55. #ifdef MAC
  56. # ifndef	AUX
  57. #  define DEFAULT_WINDOW_SYS "mac"
  58. # endif
  59. #endif
  60.  
  61. /* Amiga supports AMII_GRAPHICS and/or TTY_GRAPHICS */
  62. #ifdef AMIGA
  63. # define AMII_GRAPHICS			/* (optional) */
  64. # define DEFAULT_WINDOW_SYS "amii"	/* "amii", "amitile" or "tty" */
  65. #endif
  66.  
  67. /* Atari supports GEM_GRAPHICS and/or TTY_GRAPHICS */
  68. #ifdef TOS
  69. # define GEM_GRAPHICS			/* Atari GEM interface (optional) */
  70. # define DEFAULT_WINDOW_SYS "Gem"	/* "Gem" or "tty" */
  71. #endif
  72.  
  73. #ifdef __BEOS__
  74. #define BEOS_GRAPHICS /* (optional) */
  75. #define DEFAULT_WINDOW_SYS "BeOS"  /* "tty" */
  76. #ifndef HACKDIR	/* override the default hackdir below */
  77. # define HACKDIR "/boot/apps/NetHack"
  78. #endif
  79. #endif
  80.  
  81. #ifdef QT_GRAPHICS
  82. # define DEFAULT_WC_TILED_MAP   /* Default to tiles if users doesn't say wc_ascii_map */
  83. # define USER_SOUNDS		/* Use sounds */
  84. # ifndef __APPLE__
  85. #  define USER_SOUNDS_REGEX
  86. # endif
  87. # define USE_XPM		/* Use XPM format for images (required) */
  88. # define GRAPHIC_TOMBSTONE	/* Use graphical tombstone (rip.ppm) */
  89. # ifndef DEFAULT_WINDOW_SYS
  90. #  define DEFAULT_WINDOW_SYS "Qt"
  91. # endif
  92. #endif
  93.  
  94. #ifdef GNOME_GRAPHICS
  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 "Gnome"
  99. # endif
  100. #endif
  101.  
  102. #ifdef MSWIN_GRAPHICS
  103. # ifdef TTY_GRAPHICS
  104. # undef TTY_GRAPHICS
  105. # endif
  106. # ifndef DEFAULT_WINDOW_SYS
  107. #  define DEFAULT_WINDOW_SYS "mswin"
  108. # endif
  109. # define HACKDIR "\\nethack"
  110. #endif
  111.  
  112. #ifndef DEFAULT_WINDOW_SYS
  113. # define DEFAULT_WINDOW_SYS "tty"
  114. #endif
  115.  
  116. #ifdef X11_GRAPHICS
  117. /*
  118. * There are two ways that X11 tiles may be defined.  (1) using a custom
  119. * format loaded by NetHack code, or (2) using the XPM format loaded by
  120. * the free XPM library.  The second option allows you to then use other
  121. * programs to generate tiles files.  For example, the PBMPlus tools
  122. * would allow:
  123. *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
  124. */
  125. /* # define USE_XPM */		/* Disable if you do not have the XPM library */
  126. # ifdef USE_XPM
  127. #  define GRAPHIC_TOMBSTONE	/* Use graphical tombstone (rip.xpm) */
  128. # endif
  129. #endif
  130.  
  131.  
  132. /*
  133. * Section 2:	Some global parameters and filenames.
  134. *		Commenting out WIZARD, LOGFILE, NEWS or PANICLOG removes that
  135. *		feature from the game; otherwise set the appropriate wizard
  136. *		name.  LOGFILE, NEWS and PANICLOG refer to files in the
  137. *		playground.
  138. */
  139.  
  140. #ifndef WIZARD		/* allow for compile-time or Makefile changes */
  141. # ifndef KR1ED
  142. #  define WIZARD  "wizard" /* the person allowed to use the -D option */
  143. # else
  144. #  define WIZARD
  145. #  define WIZARD_NAME "wizard"
  146. # endif
  147. #endif
  148.  
  149. #define LOGFILE "logfile"	/* larger file for debugging purposes */
  150. #define NEWS "news"		/* the file containing the latest hack news */
  151. #define PANICLOG "paniclog"	/* log of panic and impossible events */
  152.  
  153. /*
  154. *	If COMPRESS is defined, it should contain the full path name of your
  155. *	'compress' program.  Defining INTERNAL_COMP causes NetHack to do
  156. *	simpler byte-stream compression internally.  Both COMPRESS and
  157. *	INTERNAL_COMP create smaller bones/level/save files, but require
  158. *	additional code and time.  Currently, only UNIX fully implements
  159. *	COMPRESS; other ports should be able to uncompress save files a
  160. *	la unixmain.c if so inclined.
  161. *	If you define COMPRESS, you must also define COMPRESS_EXTENSION
  162. *	as the extension your compressor appends to filenames after
  163. *	compression.
  164. */
  165.  
  166. #ifdef UNIX
  167. /* path and file name extension for compression program */
  168. #define COMPRESS "/usr/bin/compress"	/* Lempel-Ziv compression */
  169. #define COMPRESS_EXTENSION ".Z"		/* compress's extension */
  170. /* An example of one alternative you might want to use: */
  171. /* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
  172. /* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
  173. #endif
  174.  
  175. #ifndef COMPRESS
  176. # define INTERNAL_COMP	/* control use of NetHack's compression routines */
  177. #endif
  178.  
  179. /*
  180. *	Data librarian.  Defining DLB places most of the support files into
  181. *	a tar-like file, thus making a neater installation.  See *conf.h
  182. *	for detailed configuration.
  183. */
  184. /* #define DLB */	/* not supported on all platforms */
  185.  
  186. /*
  187. *	Defining INSURANCE slows down level changes, but allows games that
  188. *	died due to program or system crashes to be resumed from the point
  189. *	of the last level change, after running a utility program.
  190. */
  191. #define INSURANCE	/* allow crashed game recovery */
  192.  
  193. #ifndef MAC
  194. # define CHDIR		/* delete if no chdir() available */
  195. #endif
  196.  
  197. #ifdef CHDIR
  198. /*
  199. * If you define HACKDIR, then this will be the default playground;
  200. * otherwise it will be the current directory.
  201. */
  202. # ifndef HACKDIR
  203. #  define HACKDIR "/usr/games/lib/nethackdir"
  204. # endif
  205.  
  206. /*
  207. * Some system administrators are stupid enough to make Hack suid root
  208. * or suid daemon, where daemon has other powers besides that of reading or
  209. * writing Hack files.	In such cases one should be careful with chdir's
  210. * since the user might create files in a directory of his choice.
  211. * Of course SECURE is meaningful only if HACKDIR is defined.
  212. */
  213. /* #define SECURE */	/* do setuid(getuid()) after chdir() */
  214.  
  215. /*
  216. * If it is desirable to limit the number of people that can play Hack
  217. * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  218. * #define MAX_NR_OF_PLAYERS 6
  219. */
  220. #endif /* CHDIR */
  221.  
  222.  
  223.  
  224. /*
  225. * Section 3:	Definitions that may vary with system type.
  226. *		For example, both schar and uchar should be short ints on
  227. *		the AT&T 3B2/3B5/etc. family.
  228. */
  229.  
  230. /*
  231. * Uncomment the following line if your compiler doesn't understand the
  232. * 'void' type (and thus would give all sorts of compile errors without
  233. * this definition).
  234. */
  235. /* #define NOVOID */			/* define if no "void" data type. */
  236.  
  237. /*
  238. * Uncomment the following line if your compiler falsely claims to be
  239. * a standard C compiler (i.e., defines __STDC__ without cause).
  240. * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc.
  241. */
  242. /* #define NOTSTDC */			/* define for lying compilers */
  243.  
  244. #include "tradstdc.h"
  245.  
  246. /*
  247. * type schar: small signed integers (8 bits suffice) (eg. TOS)
  248. *
  249. *	typedef char	schar;
  250. *
  251. *	will do when you have signed characters; otherwise use
  252. *
  253. *	typedef short int schar;
  254. */
  255. #ifdef AZTEC
  256. # define schar	char
  257. #else
  258. typedef signed char	schar;
  259. #endif
  260.  
  261. /*
  262. * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not)
  263. *
  264. *	typedef unsigned char	uchar;
  265. *
  266. *	will be satisfactory if you have an "unsigned char" type;
  267. *	otherwise use
  268. *
  269. *	typedef unsigned short int uchar;
  270. */
  271. #ifndef _AIX32		/* identical typedef in system file causes trouble */
  272. typedef unsigned char	uchar;
  273. #endif
  274.  
  275. /*
  276. * Various structures have the option of using bitfields to save space.
  277. * If your C compiler handles bitfields well (e.g., it can initialize structs
  278. * containing bitfields), you can define BITFIELDS.  Otherwise, the game will
  279. * allocate a separate character for each bitfield.  (The bitfields used never
  280. * have more than 7 bits, and most are only 1 bit.)
  281. */
  282. #define BITFIELDS	/* Good bitfield handling */
  283.  
  284. /* #define STRNCMPI */	/* compiler/library has the strncmpi function */
  285.  
  286. /*
  287. * There are various choices for the NetHack vision system.  There is a
  288. * choice of two algorithms with the same behavior.  Defining VISION_TABLES
  289. * creates huge (60K) tables at compile time, drastically increasing data
  290. * size, but runs slightly faster than the alternate algorithm.  (MSDOS in
  291. * particular cannot tolerate the increase in data size; other systems can
  292. * flip a coin weighted to local conditions.)
  293. *

The above comment about MS-DOS, like the line-of-sight vision system itself, has been present since NetHack 3.1.0. It would seem to be true of the old overlaid build, which is no longer supported. The DJGPP build could probably handle the tables. On the other hand, whatever speed increase would come from using VISION_TABLES is probably not noticeable on modern machines.

  1. * If VISION_TABLES is not defined, things will be faster if you can use
  2. * MACRO_CPATH.  Some cpps, however, cannot deal with the size of the
  3. * functions that have been macroized.
  4. */
  5.  
  6. /* #define VISION_TABLES */ /* use vision tables generated at compile time */
  7. #ifndef VISION_TABLES
  8. # ifndef NO_MACRO_CPATH
  9. #  define MACRO_CPATH	/* use clear_path macros instead of functions */
  10. # endif
  11. #endif

See compile-time options for explanation of some of the options enabled or disabled below.

  1. /*
  2. * Section 4:  THE FUN STUFF!!!
  3. *
  4. * Conditional compilation of special options are controlled here.
  5. * If you define the following flags, you will add not only to the
  6. * complexity of the game but also to the size of the load module.
  7. */
  8.  
  9. /* dungeon features */
  10. #define SINKS		/* Kitchen sinks - Janet Walz */
  11. /* dungeon levels */
  12. #define WALLIFIED_MAZE	/* Fancy mazes - Jean-Christophe Collet */
  13. #define REINCARNATION	/* Special Rogue-like levels */
  14. /* monsters & objects */
  15. #define KOPS		/* Keystone Kops by Scott R. Turner */
  16. #define SEDUCE		/* Succubi/incubi seduction, by KAA, suggested by IM */
  17. #define STEED		/* Riding steeds */
  18. #define TOURIST		/* Tourist players with cameras and Hawaiian shirts */
  19. /* difficulty */
  20. #define ELBERETH	/* Engraving the E-word repels monsters */
  21. /* I/O */
  22. #define REDO		/* support for redoing last command - DGK */
  23. #if !defined(MAC)
  24. # define CLIPPING	/* allow smaller screens -- ERS */
  25. #endif
  26.  
  27. #ifdef REDO
  28. # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */
  29. #endif
  30.  
  31. #define EXP_ON_BOTL	/* Show experience on bottom line */
  32. /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson@ucivax) */
  33.  
  34. /*
  35. * Section 5:  EXPERIMENTAL STUFF
  36. *
  37. * Conditional compilation of new or experimental options are controlled here.
  38. * Enable any of these at your own risk -- there are almost certainly
  39. * bugs left here.
  40. */
  41.  
  42. /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
  43. /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
  44.  
  45. /* End of Section 5 */
  46.  
  47. #include "global.h"	/* Define everything else according to choices above */
  48.  
  49. #endif /* CONFIG_H */