Source:NetHack 2.2a/config.h

From NetHackWiki
Revision as of 01:58, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 2.2a/config.h moved to Source:NetHack 2.2a/config.h: Robot: moved page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is the full text to config.h from the source code of NetHack 2.2a. To link to a particular line, write [[NetHack 2.2a/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	2.2	87/11/11
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    
4.    #ifndef CONFIG	/* make sure the compiler does not see the typedefs twice */
5.    #define	CONFIG
6.    
7.    #define	CHDIR		/* delete if no chdir() available */
8.    
9.    /*
10.    * Some include files are in a different place under SYSV
11.    * 	BSD		   SYSV
12.    * <strings.h>		<string.h>
13.    * <sys/time.h>		<time.h>
14.    * <sgtty.h>		<termio.h>
15.    * Some routines are called differently
16.    * index		strchr
17.    * rindex		strrchr
18.    * Also, the code for suspend and various ioctls is only given for BSD4.2
19.    */
20.   /* #define MSDOS 	/* define for MS-DOS (actually defined by compiler) */
21.   #define	UNIX		/* delete if no fork(), exec() available */
22.   /* #define	GENIX		/* Yet Another Unix Clone */
23.   #define BSD		/* defind for 4.n BSD  */
24.   /* #define SYSV		/* define for System V */
25.   
26.   /* #define BETA		/* if a beta-test copy  [MRS] */
27.   #define VERSION	"2.2a"	/* version number. */
28.   
29.   #define PYRAMID_BUG 	/* avoid a bug on the Pyramid */
30.   /* #define APOLLO		/* same for the Apollo */
31.   /* #define STUPID		/* avoid some complicated expressions if
32.   			   your C compiler chokes on them */
33.   /* #define TERMINFO		/* uses "curses" rather than termcap */
34.   
35.   #ifdef __TURBOC__
36.   #define	alloc	malloc
37.   #define	signal	ssignal
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.   
79.   #ifdef BSD
80.   /* Use the high quality random number routines. */
81.   extern long random();
82.   #define rand()	random()
83.   #define srand(seed) srandom(seed)
84.   #else
85.   extern long lrand48();
86.   #define rand()	lrand48()
87.   #define srand(seed) srand48(seed)
88.   #endif
89.   #endif /* UNIX /**/
90.   
91.   #ifdef CHDIR
92.   /*
93.    * If you define HACKDIR, then this will be the default playground;
94.    * otherwise it will be the current directory.
95.    */
96.   #define HACKDIR	"/usr/games/lib/nethackdir"
97.   
98.   /*
99.    * Some system administrators are stupid enough to make Hack suid root
100.   * or suid daemon, where daemon has other powers besides that of reading or
101.   * writing Hack files. In such cases one should be careful with chdir's
102.   * since the user might create files in a directory of his choice.
103.   * Of course SECURE is meaningful only if HACKDIR is defined.
104.   */
105.  #define SECURE			/* do setuid(getuid()) after chdir() */
106.  
107.  /*
108.   * If it is desirable to limit the number of people that can play Hack
109.   * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
110.   * #define MAX_NR_OF_PLAYERS	6
111.   */
112.  #endif /* CHDIR /**/
113.  
114.  /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
115.  #define	COLNO	80
116.  #define	ROWNO	22
117.  
118.  #ifdef BSD
119.  #include <strings.h>		/* declarations for strcat etc. */
120.  #define memcpy(d, s, n)		bcopy(s, d, n)
121.  #define memcmp(s1, s2, n)	bcmp(s2, s1, n)
122.  #else
123.  #include <string.h>		/* idem on System V */
124.  #define	index	strchr
125.  #define	rindex	strrchr
126.  #endif
127.  
128.  /*
129.   * small signed integers (8 bits suffice)
130.   *	typedef	char	schar;
131.   * will do when you have signed characters; otherwise use
132.   *	typedef	short int schar;
133.   */
134.  typedef	char	schar;
135.  
136.  /*
137.   * small unsigned integers (8 bits suffice - but 7 bits do not)
138.   * - these are usually object types; be careful with inequalities! -
139.   *	typedef	unsigned char	uchar;
140.   * will be satisfactory if you have an "unsigned char" type; otherwise use
141.   *	typedef unsigned short int uchar;
142.   */
143.  typedef	unsigned char	uchar;
144.  
145.  /*
146.   * small integers in the range 0 - 127, usually coordinates
147.   * although they are nonnegative they must not be declared unsigned
148.   * since otherwise comparisons with signed quantities are done incorrectly
149.   */
150.  typedef schar	xchar;
151.  typedef	xchar	boolean;		/* 0 or 1 */
152.  #define	TRUE	1
153.  #define	FALSE	0
154.  
155.  /*
156.   * Declaration of bitfields in various structs; if your C compiler
157.   * doesnt handle bitfields well, e.g., if it is unable to initialize
158.   * structs containing bitfields, then you might use
159.   *	#define Bitfield(x,n)	uchar x
160.   * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
161.   * otherwise:
162.   *	#define	Bitfield(x,n)	unsigned x:n
163.   */
164.  #define	Bitfield(x,n)	uchar x
165.  
166.  #define	SIZE(x)	(int)(sizeof(x) / sizeof(x[0]))
167.  
168.  #ifdef MSDOS
169.  #include <fcntl.h>
170.  #define	exit	msexit		/* do chdir first */
171.  #ifdef getchar
172.  #	undef getchar
173.  #endif /* getchar /**/
174.  #define getchar tgetch
175.  #define DGK			/* MS DOS specific enhancements by dgk */
176.  
177.  #ifdef DGK
178.  #  include "msdos.h"	/* contains necessary externs for msdos.c */
179.  #  define SHELL		/* via exec of COMMAND.COM */
180.  #  define PATHLEN	64	/* maximum pathlength */
181.  #  define FILENAME 80	/* maximum filename length (conservative) */
182.  #  define FROMPERM	1	/* for ramdisk use */
183.  #  define TOPERM	2	/* for ramdisk use */
184.  #  define glo(x)	name_file(lock, x)	/* name_file used for bones */
185.  	extern char *configfile;
186.  #endif /* DGK /**/
187.  #endif /* MSDOS /**/
188.  
189.  /*
190.   *	Conditional compilation of special options are controlled here.
191.   *	If you define the following flags, you will add not only to the
192.   *	complexity of the game but also to the size of the load module.
193.   */ 
194.  
195.  #define	DOGNAME		/* Name of your first dog as an option */ 
196.  #define	SPELLS		/* Spell casting by M. Stephenson */
197.  #define	PRAYERS		/* Prayer code by M. Stephenson */
198.  #define KAA		/* Various changes made by Ken Arromdee */
199.  #define MARKER		/* Magic marker modification from Gil Neiger */
200.  #define	NEWCLASS	/* Samurai/Ninja etc. by M. Stephenson */ 
201.  #define	SAFE_ATTACK 	/* Safe attack code by Don Kneller */
202.  #define	PROBING		/* Wand of probing code by Gil Neiger */
203.  #define	DIAGS		/* Diagnostics after death/quit by Gil Neiger */
204.  #define	SORTING		/* Sorted inventory by Don Kneller */
205.  #define	DGKMOD		/* Additional features by Don Kneller */
206.  #define REDO 		/* support for redoing last command - DGK */
207.  #define	HARD		/* Enhanced wizard code by M. Stephenson */
208.  #define	WALKIES		/* Leash code by M. Stephenson */
209.  #define NEWTRAPS	/* Magic and Squeeky board traps by Scott R. Turner*/
210.  #define FREEHAND	/* Cannot use Pick-axe without wielding it. */
211.  #define SPIDERS		/* Spiders and webs by Scott R. Turner */
212.  #define FOUNTAINS	/* Fountain code by SRT (+ GAN + EB) */
213.  #define KOPS		/* Keystone Kops by Scott R. Turner */
214.  #define ROCKMOLE	/* Rockmoles by Scott R. Turner */
215.  #define COM_COMPL	/* Command line completion by John S. Bien */
216.  #define GRAPHICS	/* Funky screen character support (Eric S. Raymond) */
217.  #define HACKOPTIONS	/* Support DGK-style HACKOPTIONS processing (ESR) */
218.  #define RPH		/* Various hacks by Richard P. Hughey */
219.  #define KJSMODS		/* Various changes made by Kevin Sweet */
220.  #define	BVH		/* Additions by Bruce Holloway */
221.  #define SAC		/* Soldiers, barracks by Steve Creps */
222.  
223.  #if defined(MSDOS) && defined(GRAPHICS)
224.  #define MSDOSCOLOR
225.  #endif
226.  
227.  /*
228.   *	Status Line options.
229.   */
230.  
231.  #define	GOLD_ON_BOTL
232.  #define	EXP_ON_BOTL
233.  	 
234.  #ifdef REDO
235.  #define DOAGAIN	'\001'		/* Used in tty.c and cmd.c */
236.  #endif
237.  
238.  #ifdef DGKMOD
239.  #define LARGEST_INT	((1 << 15) - 1)
240.  #endif
241.  
242.  #endif /* CONFIG /**/