Source:SLASH'EM 0.0.7E7F2/ntconf.h

From NetHackWiki
Revision as of 18:08, 7 March 2008 by Kernigh bot (talk | contribs) (SLASH'EM 0.0.7E7F2/ntconf.h moved to Source:SLASH'EM 0.0.7E7F2/ntconf.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 ntconf.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/ntconf.h#line123]], for example.

The latest source code for vanilla NetHack is at Source code.


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.    /*	SCCS Id: @(#)ntconf.h	3.4	2002/03/10	*/
2.    /* Copyright (c) NetHack PC Development Team 1993, 1994.  */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef NTCONF_H
6.    #define NTCONF_H
7.    
8.    /* #define SHELL */	/* nt use of pcsys routines caused a hang */
9.    
10.   #define RANDOM		/* have Berkeley random(3) */
11.   #define TEXTCOLOR	/* Color text */
12.   
13.   #define EXEPATH			/* Allow .exe location to be used as HACKDIR */
14.   #define TRADITIONAL_GLYPHMAP	/* Store glyph mappings at level change time */
15.   #if defined(WIN32CON) && !defined(__CYGWIN__)
16.   # define LAN_FEATURES		/* Include code for lan-aware features. */
17.   #endif
18.   
19.   #define PC_LOCKING		/* Prevent overwrites of aborted or in-progress games */
20.   				/* without first receiving confirmation. */
21.   
22.   #define HOLD_LOCKFILE_OPEN	/* Keep an exclusive lock on the .0 file */
23.   
24.   #define SELF_RECOVER		/* Allow the game itself to recover from an aborted game */
25.   
26.   #define USER_SOUNDS
27.   /*
28.    * -----------------------------------------------------------------
29.    *  The remaining code shouldn't need modification.
30.    * -----------------------------------------------------------------
31.    */
32.   /* #define SHORT_FILENAMES */	/* All NT filesystems support long names now */
33.   
34.   #ifdef MICRO
35.   #undef MICRO			/* never define this! */
36.   #endif
37.   
38.   #define NOCWD_ASSUMPTIONS	/* Always define this. There are assumptions that
39.                                      it is defined for WIN32.
40.   				   Allow paths to be specified for HACKDIR,
41.   				   LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
42.   				   SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
43.   #define NO_TERMS
44.   #define ASCIIGRAPH
45.   
46.   #ifdef NH_OPTIONS_USED
47.   #undef NH_OPTIONS_USED
48.   #endif
49.   #if defined(MSWIN_GRAPHICS) || defined(GTK_GRAPHICS)
50.   #define NH_OPTIONS_USED	"guioptions"
51.   #else
52.   #define NH_OPTIONS_USED	"ttyoptions"
53.   #endif
54.   #define NH_OPTIONS_FILE NH_OPTIONS_USED
55.   
56.   #define PORT_HELP	"porthelp"
57.   
58.   #ifdef WIN32CON
59.   #define PORT_DEBUG	/* include ability to debug international keyboard issues */
60.   #endif
61.   
62.   /* Stuff to help the user with some common, yet significant errors */
63.   #define INTERJECT_PANIC		0
64.   #define INTERJECTION_TYPES	(INTERJECT_PANIC + 1)
65.   extern void FDECL(interject_assistance, (int,int,genericptr_t,genericptr_t));
66.   extern void FDECL(interject, (int));
67.   
68.   /* The following is needed for prototypes of certain functions */
69.   #if defined(_MSC_VER)
70.   #include <process.h>	/* Provides prototypes of exit(), spawn()      */
71.   #endif
72.   
73.   #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
74.   #ifdef STRNCMPI
75.   #ifndef __CYGWIN__
76.   #define strncmpi(a,b,c) strnicmp(a,b,c)
77.   #endif
78.   #endif
79.   
80.   #include <sys/types.h>
81.   #include <stdlib.h>
82.   #ifdef __BORLANDC__
83.   #undef randomize
84.   #undef random
85.   #endif
86.   
87.   #define PATHLEN		BUFSZ /* maximum pathlength */
88.   #define FILENAME	BUFSZ /* maximum filename length (conservative) */
89.   
90.   #if defined(_MAX_PATH) && defined(_MAX_FNAME)
91.   # if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
92.   #undef PATHLEN
93.   #undef FILENAME
94.   #define PATHLEN		_MAX_PATH
95.   #define FILENAME	_MAX_FNAME
96.   # endif
97.   #endif
98.   
99.   
100.  #define NO_SIGNAL
101.  #define index	strchr
102.  #define rindex	strrchr
103.  #include <time.h>
104.  #define USE_STDARG
105.  #ifdef RANDOM
106.  /* Use the high quality random number routines. */
107.  #define Rand()	random()
108.  #else
109.  #define Rand()	rand()
110.  #endif
111.  
112.  #define FCMASK	0660	/* file creation mask */
113.  #define regularize	nt_regularize
114.  #define HLOCK "NHPERM"
115.  
116.  #ifndef M
117.  #define M(c)		((char) (0x80 | (c)))
118.  /* #define M(c)		((c) - 128) */
119.  #endif
120.  
121.  #ifndef C
122.  #define C(c)		(0x1f & (c))
123.  #endif
124.  
125.  #if defined(DLB)
126.  #define FILENAME_CMP  stricmp		      /* case insensitive */
127.  #endif
128.  
129.  #if 0
130.  extern char levels[], bones[], permbones[],
131.  #endif /* 0 */
132.  
133.  /* this was part of the MICRO stuff in the past */
134.  extern const char *alllevels, *allbones;
135.  extern char hackdir[];
136.  #define ABORT C('a')
137.  #define getuid() 1
138.  #define getlogin() ((char *)0)
139.  extern void NDECL(win32_abort);
140.  #ifdef WIN32CON
141.  extern void FDECL(nttty_preference_update, (const char *));
142.  extern void NDECL(toggle_mouse_support);
143.  extern void FDECL(map_subkeyvalue, (char *));
144.  extern void NDECL(load_keyboard_handler);
145.  #endif
146.  
147.  #include <fcntl.h>
148.  #if !defined(__BORLANDC__) && !defined(__CYGWIN__)
149.  # include <io.h>
150.  # include <direct.h>
151.  # include <conio.h>
152.  #elif defined(__CYGWIN__)
153.  # include <io.h>
154.  #else
155.  int  _RTLENTRY _EXPFUNC access  (const char _FAR *__path, int __amode);
156.  int  _RTLENTRY _EXPFUNC _chdrive(int __drive);
157.  int  _RTLENTRYF _EXPFUNC32   chdir( const char _FAR *__path );
158.  char _FAR * _RTLENTRY  _EXPFUNC     getcwd( char _FAR *__buf, int __buflen );
159.  int  _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
160.  int  _RTLENTRY _EXPFUNC creat   (const char _FAR *__path, int __amode);
161.  int  _RTLENTRY _EXPFUNC close   (int __handle);
162.  int  _RTLENTRY _EXPFUNC _close  (int __handle);
163.  int  _RTLENTRY _EXPFUNC open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
164.  long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
165.  int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
166.  # include <conio.h>
167.  #endif
168.  #undef kbhit		/* Use our special NT kbhit */
169.  #define kbhit (*nt_kbhit)
170.  
171.  #ifdef LAN_FEATURES
172.  #define MAX_LAN_USERNAME 20
173.  #define LAN_RO_PLAYGROUND	/* not implemented in 3.3.0 */
174.  #define LAN_SHARED_BONES	/* not implemented in 3.3.0 */
175.  #include "nhlan.h"
176.  #endif
177.  
178.  #ifndef alloca
179.  #define ALLOCA_HACK	/* used in util/panic.c */
180.  #endif
181.  
182.  #ifndef REDO
183.  #undef	Getchar
184.  #define Getchar nhgetch
185.  #endif
186.  
187.  #ifdef _MSC_VER
188.  #if 0
189.  #pragma warning(disable:4018)	/* signed/unsigned mismatch */
190.  #pragma warning(disable:4305)	/* init, conv from 'const int' to 'char' */
191.  #endif
192.  #pragma warning(disable:4761)	/* integral size mismatch in arg; conv supp*/
193.  #ifdef YYPREFIX
194.  #pragma warning(disable:4102)	/* unreferenced label */
195.  #endif
196.  #endif
197.  
198.  extern int FDECL(set_win32_option, (const char *, const char *));
199.  #ifdef WIN32CON
200.  #define LEFTBUTTON  FROM_LEFT_1ST_BUTTON_PRESSED
201.  #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
202.  #define MIDBUTTON   FROM_LEFT_2ND_BUTTON_PRESSED
203.  #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
204.  #endif /* WIN32CON */
205.  
206.  #endif /* NTCONF_H */