OSDN Git Service

no bone
[nethackexpress/trunk.git] / include / ntconf.h
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 #ifdef WIN32CON
16 #define LAN_FEATURES            /* Include code for lan-aware features. Untested in 3.4.0*/
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 OPTIONS_USED
47 #undef OPTIONS_USED
48 #endif
49 #ifdef MSWIN_GRAPHICS
50 #define OPTIONS_USED    "guioptions"
51 #else
52 #define OPTIONS_USED    "ttyoptions"
53 #endif
54 #define OPTIONS_FILE 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 #define strncmpi(a,b,c) strnicmp(a,b,c)
76 #endif
77
78 #include <sys/types.h>
79 #include <stdlib.h>
80 #ifdef __BORLANDC__
81 #undef randomize
82 #undef random
83 #endif
84
85 #define PATHLEN         BUFSZ /* maximum pathlength */
86 #define FILENAME        BUFSZ /* maximum filename length (conservative) */
87
88 #if defined(_MAX_PATH) && defined(_MAX_FNAME)
89 # if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
90 #undef PATHLEN
91 #undef FILENAME
92 #define PATHLEN         _MAX_PATH
93 #define FILENAME        _MAX_FNAME
94 # endif
95 #endif
96
97
98 #define NO_SIGNAL
99 #define index   strchr
100 #define rindex  strrchr
101 #include <time.h>
102 #define USE_STDARG
103 #ifdef RANDOM
104 /* Use the high quality random number routines. */
105 #define Rand()  random()
106 #else
107 #define Rand()  rand()
108 #endif
109
110 //#define FCMASK        0660    /* file creation mask */
111 #define FCMASK (0x0180)
112 \r
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 #ifndef __BORLANDC__
149 #include <io.h>
150 #include <direct.h>
151 #else
152 int  _RTLENTRY _EXPFUNC access  (const char _FAR *__path, int __amode);
153 int  _RTLENTRY _EXPFUNC _chdrive(int __drive);
154 int  _RTLENTRYF _EXPFUNC32   chdir( const char _FAR *__path );
155 char _FAR * _RTLENTRY  _EXPFUNC     getcwd( char _FAR *__buf, int __buflen );
156 int  _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
157 int  _RTLENTRY _EXPFUNC creat   (const char _FAR *__path, int __amode);
158 int  _RTLENTRY _EXPFUNC close   (int __handle);
159 int  _RTLENTRY _EXPFUNC _close  (int __handle);
160 int  _RTLENTRY _EXPFUNC open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
161 long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
162 int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
163 #endif
164 #include <conio.h>
165 #undef kbhit            /* Use our special NT kbhit */
166 #define kbhit (*nt_kbhit)
167
168 #ifdef LAN_FEATURES
169 #define MAX_LAN_USERNAME 20
170 #define LAN_RO_PLAYGROUND       /* not implemented in 3.3.0 */
171 #define LAN_SHARED_BONES        /* not implemented in 3.3.0 */
172 #include "nhlan.h"
173 #endif
174
175 #ifndef alloca
176 #define ALLOCA_HACK     /* used in util/panic.c */
177 #endif
178
179 #ifndef REDO
180 #undef  Getchar
181 #define Getchar nhgetch
182 #endif
183
184 #ifdef _MSC_VER
185 #if 0
186 #pragma warning(disable:4018)   /* signed/unsigned mismatch */
187 #pragma warning(disable:4305)   /* init, conv from 'const int' to 'char' */
188 #endif
189 #pragma warning(disable:4761)   /* integral size mismatch in arg; conv supp*/
190 #ifdef YYPREFIX
191 #pragma warning(disable:4102)   /* unreferenced label */
192 #endif
193 #endif
194
195 extern int FDECL(set_win32_option, (const char *, const char *));
196 #ifdef WIN32CON
197 #define LEFTBUTTON  FROM_LEFT_1ST_BUTTON_PRESSED
198 #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
199 #define MIDBUTTON   FROM_LEFT_2ND_BUTTON_PRESSED
200 #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
201 #endif /* WIN32CON */
202
203 #endif /* NTCONF_H */