Source:NetHack 1.3d/config.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to config.h from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/config.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

Screenshots and source code from Hack are used under the CWI license.

1.    /*	SCCS Id: @(#)config.h	1.3	87/07/14
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* config.h - version 1.0.3 */
4.    
5.    #ifndef CONFIG	/* make sure the compiler does not see the typedefs twice */
6.    #define	CONFIG
7.    
8.    #define	CHDIR		/* delete if no chdir() available */
9.    
10.   /*
11.    * Some include files are in a different place under SYSV
12.    * 	BSD		   SYSV
13.    * <strings.h>		<string.h>
14.    * <sys/wait.h>		<wait.h>
15.    * <sys/time.h>		<time.h>
16.    * <sgtty.h>		<termio.h>
17.    * Some routines are called differently
18.    * index		strchr
19.    * rindex		strrchr
20.    * Also, the code for suspend and various ioctls is only given for BSD4.2
21.    * (I do not have access to a SYSV system.)
22.    */
23.   /* #define MSDOS 	/* define for MS-DOS (actually defined by compiler) */
24.   #define	UNIX		/* delete if no fork(), exec() available */
25.   #define BSD		/* defind for 4.n BSD  */
26.   /* #define SYSV		/* define for System V */
27.   
28.   /* #define BETA		/* if a beta-test copy  [MRS] */
29.   #define VERSION	"1.3d"	/* version number. */
30.   
31.   #define PYRAMID_BUG 	/* avoid a bug on the Pyramid */
32.   /* #define APOLLO		/* same for the Apollo */
33.   /* #define STUPID		/* avoid some complicated expressions if
34.   			   your C compiler chokes on them */
35.   /* #define NOWAITINCLUDE	/* neither <wait.h> nor <sys/wait.h> exists */
36.   #ifdef MSDOS
37.   #define	NOWAITINCLUDE
38.   #endif
39.   
40.   #define WIZARD  "mike"	/* the person allowed to use the -D option */
41.   #define RECORD	"record"/* the file containing the list of topscorers */
42.   #define	NEWS	"news"	/* the file containing the latest hack news */
43.   #define	HELP	"help"	/* the file containing a description of the commands */
44.   #define	SHELP	"hh"	/* abbreviated form of the same */
45.   #define	RUMORFILE	"rumors"	/* a file with fortune cookies */
46.   #define	DATAFILE	"data"	/* a file giving the meaning of symbols used */
47.   #define	FMASK	0660	/* file creation mask */
48.   
49.   #ifdef UNIX
50.   #define	HLOCK	"perm"	/* an empty file used for locking purposes */
51.   #define LLOCK	"safelock"	/* link to previous */
52.   
53.   /*
54.    * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
55.    * If defined, it can be overridden by the environment variable PAGER.
56.    * Hack will use its internal pager if DEF_PAGER is not defined.
57.    * (This might be preferable for security reasons.)
58.    * #define DEF_PAGER	".../mydir/mypager"
59.    */
60.   
61.   /*
62.    * If you define MAIL, then the player will be notified of new mail
63.    * when it arrives. If you also define DEF_MAILREADER then this will
64.    * be the default mail reader, and can be overridden by the environment
65.    * variable MAILREADER; otherwise an internal pager will be used.
66.    * A stat system call is done on the mailbox every MAILCKFREQ moves.
67.    */
68.   #define	MAIL
69.   #define	DEF_MAILREADER	"/usr/bin/mail"		/* or e.g. /bin/mail */
70.   #define	MAILCKFREQ	1
71.   
72.   
73.   #define SHELL		/* do not delete the '!' command */
74.   
75.   #ifdef BSD
76.   #define	SUSPEND		/* let ^Z suspend the game */
77.   #endif
78.   #endif /* UNIX /**/
79.   
80.   #ifdef CHDIR
81.   /*
82.    * If you define HACKDIR, then this will be the default playground;
83.    * otherwise it will be the current directory.
84.    */
85.   #define HACKDIR	"/usr/games/lib/nethackdir"
86.   
87.   /*
88.    * Some system administrators are stupid enough to make Hack suid root
89.    * or suid daemon, where daemon has other powers besides that of reading or
90.    * writing Hack files. In such cases one should be careful with chdir's
91.    * since the user might create files in a directory of his choice.
92.    * Of course SECURE is meaningful only if HACKDIR is defined.
93.    */
94.   #define SECURE			/* do setuid(getuid()) after chdir() */
95.   
96.   /*
97.    * If it is desirable to limit the number of people that can play Hack
98.    * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
99.    * #define MAX_NR_OF_PLAYERS	6
100.   */
101.  #endif /* CHDIR /**/
102.  
103.  /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
104.  #define	COLNO	80
105.  #define	ROWNO	22
106.  
107.  #ifdef BSD
108.  #include <strings.h>		/* declarations for strcat etc. */
109.  #else
110.  #include <string.h>		/* idem on System V */
111.  #define	index	strchr
112.  #define	rindex	strrchr
113.  #endif
114.  
115.  /*
116.   * small signed integers (8 bits suffice)
117.   *	typedef	char	schar;
118.   * will do when you have signed characters; otherwise use
119.   *	typedef	short int schar;
120.   */
121.  typedef	char	schar;
122.  
123.  /*
124.   * small unsigned integers (8 bits suffice - but 7 bits do not)
125.   * - these are usually object types; be careful with inequalities! -
126.   *	typedef	unsigned char	uchar;
127.   * will be satisfactory if you have an "unsigned char" type; otherwise use
128.   *	typedef unsigned short int uchar;
129.   */
130.  typedef	unsigned char	uchar;
131.  
132.  /*
133.   * small integers in the range 0 - 127, usually coordinates
134.   * although they are nonnegative they must not be declared unsigned
135.   * since otherwise comparisons with signed quantities are done incorrectly
136.   */
137.  typedef schar	xchar;
138.  typedef	xchar	boolean;		/* 0 or 1 */
139.  #define	TRUE	1
140.  #define	FALSE	0
141.  
142.  /*
143.   * Declaration of bitfields in various structs; if your C compiler
144.   * doesnt handle bitfields well, e.g., if it is unable to initialize
145.   * structs containing bitfields, then you might use
146.   *	#define Bitfield(x,n)	uchar x
147.   * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
148.   */
149.  #define	Bitfield(x,n)	uchar x
150.  
151.  #define	SIZE(x)	(int)(sizeof(x) / sizeof(x[0]))
152.  
153.  #ifdef MSDOS
154.  #include <fcntl.h>
155.  #define	exit	msexit		/* do chdir first */
156.  #ifdef getchar
157.  #	undef getchar
158.  #endif /* getchar /**/
159.  #define getchar tgetch
160.  #define DGK			/* MS DOS specific enhancements by dgk */
161.  
162.  #ifdef DGK
163.  #  include "msdos.h"	/* contains necessary externs for msdos.c */
164.  #  define SHELL		/* via exec of COMMAND.COM */
165.  #  define PATHLEN	64	/* maximum pathlength */
166.  #  define FILENAME 80	/* maximum filename length (conservative) */
167.  #  define FROMPERM	1	/* for ramdisk use */
168.  #  define TOPERM	2	/* for ramdisk use */
169.  #  define glo(x)	name_file(lock, x)	/* name_file used for bones */
170.  #  define IS_CORNER(x)	((x) == symbol.tlcorn || (x) == symbol.trcorn\
171.  				|| (x) == symbol.blcorn || (x)==symbol.brcorn)
172.  	/* screen symbols for using character graphics. */
173.  	struct symbols {
174.  		unsigned char vwall, hwall, tlcorn, trcorn, blcorn, brcorn;
175.  		unsigned char door, room, corr;
176.  	};
177.  	extern struct symbols symbol;
178.  	extern char *configfile;
179.  #endif /* DGK /**/
180.  #endif /* MSDOS /**/
181.  
182.  /*
183.   *	Conditional compilation of special options are controlled here.
184.   *	If you define the following flags, you will add not only to the
185.   *	complexity of the game but also to the size of the load module.
186.   */ 
187.   
188.  #define	SPELLS		/* Spell casting by M. Stephenson */
189.  #define	PRAYERS		/* Prayer code by M. Stephenson */
190.  #define KAA		/* Various changes made by Ken Arromdee */
191.  #define MARKER		/* Magic marker modification from Gil Neiger */
192.  #define	NEWCLASS	/* Samurai/Ninja etc. by M. Stephenson */ 
193.  #define	SAFE_ATTACK 	/* Safe attack code by Don Kneller */
194.  #define	PROBING		/* Wand of probing code by Gil Neiger */
195.  #define	DIAGS		/* Diagnostics after death/quit by Gil Neiger */
196.  #define	SORTING		/* Sorted inventory by Don Kneller */
197.  #define	DGKMOD		/* Additional features by Don Kneller */
198.  #define REDO 		/* support for redoing last command - DGK */
199.  #define	HARD		/* Enhanced wizard code by M. Stephenson */
200.  #define	WALKIES		/* Leash code by M. Stephenson */
201.  #define NEWTRAPS	/* Magic and Squeeky board traps by Scott R. Turner*/
202.  #define FREEHAND	/* Cannot use Pick-axe without wielding it. */
203.  #define SPIDERS		/* Spiders and webs by Scott R. Turner */
204.  #define FOUNTAINS	/* Fountain code by SRT (+ GAN + EB) */
205.  #define KOPS		/* Keystone Kops by Scott R. Turner */
206.  #define ROCKMOLE	/* Rockmoles by Scott R. Turner */
207.  
208.  /*
209.   *	Status Line options.
210.   */
211.  
212.  #define	GOLD_ON_BOTL
213.  #define	EXP_ON_BOTL
214.  	 
215.  #ifdef REDO
216.  #define DOAGAIN	'\001'		/* Used in tty.c and cmd.c */
217.  #endif
218.  
219.  #ifdef DGKMOD
220.  #define LARGEST_INT	((1 << 15) - 1)
221.  #endif
222.  
223.  #endif /* CONFIG /**/