OSDN Git Service

adjust for patch
[jnethack/source.git] / include / ntconf.h
1 /* NetHack 3.6  ntconf.h        $NHDT-Date: 1447424077 2015/11/13 14:14:37 $  $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */
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
16 #define LAN_FEATURES /* Include code for lan-aware features. Untested in \
17                         3.4.0*/
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 \
25                         game */
26
27 #define SYSCF                /* Use a global configuration */
28 #define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration \
29                                 */
30
31 #define USER_SOUNDS
32
33 /*#define CHANGE_COLOR*/ /* allow palette changes */
34 #define SELECTSAVED /* Provide menu of saved games to choose from at start \
35                        */
36
37 /*
38  * -----------------------------------------------------------------
39  *  The remaining code shouldn't need modification.
40  * -----------------------------------------------------------------
41  */
42 /* #define SHORT_FILENAMES      /* All NT filesystems support long names now
43  */
44
45 #ifdef MICRO
46 #undef MICRO /* never define this! */
47 #endif
48
49 #define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \
50                              it is defined for WIN32.                       \
51                              Allow paths to be specified for HACKDIR,       \
52                              LEVELDIR, SAVEDIR, BONESDIR, DATADIR,          \
53                              SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
54 #define NO_TERMS
55 #define ASCIIGRAPH
56
57 #ifdef OPTIONS_USED
58 #undef OPTIONS_USED
59 #endif
60 #define OPTIONS_USED "options"
61 #define OPTIONS_FILE OPTIONS_USED
62
63 #define PORT_HELP "porthelp"
64
65 #define PORT_DEBUG /* include ability to debug international keyboard issues \
66                       */
67
68 #define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing   \
69                      * until the main command loop. 'safer' because it \
70                      * avoids certain cheats and also avoids losing    \
71                      * objects being thrown when the hangup occurs.    \
72                      */
73
74 /* Stuff to help the user with some common, yet significant errors */
75 #define INTERJECT_PANIC 0
76 #define INTERJECTION_TYPES (INTERJECT_PANIC + 1)
77 extern void FDECL(interject_assistance,
78                   (int, int, genericptr_t, genericptr_t));
79 extern void FDECL(interject, (int));
80
81 /*
82  *===============================================
83  * Compiler-specific adjustments
84  *===============================================
85  */
86 #ifdef _MSC_VER
87 #if (_MSC_VER > 1000)
88 /* Visual C 8 warning elimination */
89 #ifndef _CRT_SECURE_NO_DEPRECATE
90 #define _CRT_SECURE_NO_DEPRECATE
91 #endif
92 #ifndef _SCL_SECURE_NO_DEPRECATE
93 #define _SCL_SECURE_NO_DEPRECATE
94 #endif
95 #ifndef _CRT_NONSTDC_NO_DEPRECATE
96 #define _CRT_NONSTDC_NO_DEPRECATE
97 #endif
98 #pragma warning(disable : 4996) /* VC8 deprecation warnings */
99 #pragma warning(disable : 4142) /* benign redefinition */
100 #pragma warning(disable : 4267) /* conversion from 'size_t' to XX */
101 #if (_MSC_VER > 1600)
102 #pragma warning(disable : 4459) /* hide global declaration */
103 #endif                          /* _MSC_VER > 1600 */
104 #endif                          /* _MSC_VER > 1000 */
105 #pragma warning(disable : 4761) /* integral size mismatch in arg; conv \
106                                    supp*/
107 #ifdef YYPREFIX
108 #pragma warning(disable : 4102) /* unreferenced label */
109 #endif
110 #ifdef __cplusplus
111 /* suppress a warning in cppregex.cpp */
112 #pragma warning(disable : 4101) /* unreferenced local variable */
113 #endif
114 #endif /* _MSC_VER */
115
116
117 #define RUNTIME_PORT_ID /* trigger run-time port identification for \
118                          * identification of exe CPU architecture   \
119                          */
120
121 /* The following is needed for prototypes of certain functions */
122 #if defined(_MSC_VER)
123 #include <process.h> /* Provides prototypes of exit(), spawn()      */
124 #endif
125
126 #include <string.h> /* Provides prototypes of strncmpi(), etc.     */
127 #ifdef STRNCMPI
128 #define strncmpi(a, b, c) strnicmp(a, b, c)
129 #endif
130
131 /* Visual Studio defines this in their own headers, which we don't use */
132 #ifndef snprintf
133 #define snprintf _snprintf
134 #pragma warning( \
135     disable : 4996) /* deprecation warning suggesting snprintf_s */
136 #endif
137
138 #include <sys/types.h>
139 #include <stdlib.h>
140 #include <stdio.h>
141 #ifdef __BORLANDC__
142 #undef randomize
143 #undef random
144 #endif
145
146 #define PATHLEN BUFSZ  /* maximum pathlength */
147 #define FILENAME BUFSZ /* maximum filename length (conservative) */
148
149 #if defined(_MAX_PATH) && defined(_MAX_FNAME)
150 #if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
151 #undef PATHLEN
152 #undef FILENAME
153 #define PATHLEN _MAX_PATH
154 #define FILENAME _MAX_FNAME
155 #endif
156 #endif
157
158 #define NO_SIGNAL
159 #define index strchr
160 #define rindex strrchr
161
162 /* Time stuff */
163 #include <time.h>
164
165 #define USE_STDARG
166 #ifdef RANDOM
167 /* Use the high quality random number routines. */
168 #define Rand() random()
169 #else
170 #define Rand() rand()
171 #endif
172
173 #include <sys/stat.h>
174 #define FCMASK (_S_IREAD | _S_IWRITE) /* file creation mask */
175 #define regularize nt_regularize
176 #define HLOCK "NHPERM"
177
178 #ifndef M
179 #define M(c) ((char) (0x80 | (c)))
180 /* #define M(c)         ((c) - 128) */
181 #endif
182
183 #ifndef C
184 #define C(c) (0x1f & (c))
185 #endif
186
187 #if defined(DLB)
188 #define FILENAME_CMP stricmp /* case insensitive */
189 #endif
190
191 /* this was part of the MICRO stuff in the past */
192 extern const char *alllevels, *allbones;
193 extern char hackdir[];
194 #define ABORT C('a')
195 #define getuid() 1
196 #define getlogin() ((char *) 0)
197 extern void NDECL(win32_abort);
198 extern void FDECL(nttty_preference_update, (const char *));
199 extern void NDECL(toggle_mouse_support);
200 extern void FDECL(map_subkeyvalue, (char *));
201 extern void NDECL(load_keyboard_handler);
202 extern void NDECL(raw_clear_screen);
203
204 #include <fcntl.h>
205 #ifndef __BORLANDC__
206 #include <io.h>
207 #include <direct.h>
208 #else
209 int _RTLENTRY _EXPFUNC access(const char _FAR *__path, int __amode);
210 int _RTLENTRY _EXPFUNC _chdrive(int __drive);
211 int _RTLENTRYF _EXPFUNC32 chdir(const char _FAR *__path);
212 char _FAR *_RTLENTRY _EXPFUNC getcwd(char _FAR *__buf, int __buflen);
213 int _RTLENTRY _EXPFUNC
214 write(int __handle, const void _FAR *__buf, unsigned __len);
215 int _RTLENTRY _EXPFUNC creat(const char _FAR *__path, int __amode);
216 int _RTLENTRY _EXPFUNC close(int __handle);
217 int _RTLENTRY _EXPFUNC _close(int __handle);
218 int _RTLENTRY _EXPFUNC
219 open(const char _FAR *__path, int __access, ... /*unsigned mode*/);
220 long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere);
221 int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len);
222 #endif
223 #include <conio.h>
224 #undef kbhit /* Use our special NT kbhit */
225 #define kbhit (*nt_kbhit)
226
227 #ifdef LAN_FEATURES
228 #define MAX_LAN_USERNAME 20
229 #endif
230
231 #ifndef alloca
232 #define ALLOCA_HACK /* used in util/panic.c */
233 #endif
234
235 extern int FDECL(set_win32_option, (const char *, const char *));
236 #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
237 #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
238 #define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
239 #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
240 #ifdef CHANGE_COLOR
241 extern int FDECL(alternative_palette, (char *));
242 #endif
243
244 #endif /* NTCONF_H */