OSDN Git Service

fix #48255
[jnethack/source.git] / include / vmsconf.h
1 /* NetHack 3.6  vmsconf.h       $NHDT-Date: 1555361299 2019/04/15 20:48:19 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /*-Copyright (c) Robert Patrick Rankin, 2011. */
4 /* NetHack may be freely redistributed.  See license for details. */
5
6 #ifdef VMS
7 #ifndef VMSCONF_H
8 #define VMSCONF_H
9
10 /*
11  * Edit these to choose values appropriate for your site.
12  * WIZARD is the username allowed to use the debug option of nethack; no harm
13  *   is done by leaving it as a username that doesn't exist at your site.
14  * HACKDIR can be overridden at run-time with the logical name HACKDIR, as in
15  *   $ define hackdir disk$users:[games.nethack]
16  * Trailing NULs are present in the default values in order to make some
17  *   extra room for patching longer values into an existing executable.
18  */
19 #define Local_WIZARD "NHWIZARD\0\0\0\0"
20 #define Local_HACKDIR "DISK$USERS:[GAMES.NETHACK.3_5_X.PLAY]\0\0\0\0\0\0\0\0"
21
22 /*
23  * This section cleans up the stuff done in config.h so that it
24  * shouldn't need to be modified.  It's conservative so that if
25  * config.h is actually edited, the changes won't impact us.
26  */
27 #ifdef UNIX
28 #undef UNIX
29 #endif
30 #ifdef HACKDIR
31 #undef HACKDIR
32 #endif
33 #ifdef WIZARD_NAME
34 #undef WIZARD_NAME
35 #endif
36 #define HACKDIR Local_HACKDIR
37 #define WIZARD_NAME Local_WIZARD
38 #ifndef SYSCF
39 #define SYSCF
40 #endif
41
42 /* filenames require punctuation to avoid redirection via logical names */
43 #undef RECORD
44 #define RECORD "record;1" /* scoreboard file (retains high scores) */
45 #undef LOGFILE
46 #define LOGFILE "logfile;0" /* optional file (records all games) */
47 #undef SYSCF_FILE
48 #define SYSCF_FILE "sysconf;0"
49
50 #define HLOCK "perm;1" /* an empty file used for locking purposes */
51
52 /* want compression--for level & save files--performed within NetHack itself
53  */
54 #ifdef COMPRESS
55 #undef COMPRESS
56 #endif
57 #ifndef INTERNAL_COMP
58 #define INTERNAL_COMP
59 #endif
60
61 /*
62  * If nethack.exe will be installed with privilege so that the playground
63  * won't need to be left unprotected, define SECURE to suppress a couple
64  * of file protection fixups (protection of bones files and ownership of
65  * save files).
66  */
67 /* #define SECURE */
68
69 /*
70  * If you use SECURE you'll need to link /noTraceback, in which case
71  * there's no point trying to get extra PANICTRACE info and this might
72  * as well be commented out.  When enabled, the sysconf file controls
73  * how to handle it (note that we're hijacking the Unix GDB setting):
74 PANICTRACE_GDB=0  #behave as if PANICTRACE was disabled
75 PANICTRACE_GDB=1  #at conclusion of panic, show a call traceback and exit
76 PANICTRACE_GDB=2  #at conclusion of panic, show a call traceback and then
77  *                # remain in the debugger for more interactive debugging
78  *                # (not as useful as it might sound since we're normally
79  *                # linked /noDebug so there's no symbol table accessible)
80  */
81 #define PANICTRACE
82
83 /*
84  * Put the readonly data files into a single container rather than into
85  * separate files in the playground directory.
86  */
87 #define DLB /* use data librarian code */
88
89 /*
90  * Provide menu of saved games to choose from at start.
91  * [Player needs to use ``nethack "-ugames"'' for this to work.]
92  */
93 #define SELECTSAVED
94
95 /*
96  * You may define TEXTCOLOR if your system has any terminals that recognize
97  * ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is
98  * a number between 40 and 47 represented background color, and the second
99  * # is a number between 30 and 37 representing the foreground color.
100  * GIGI terminals and DECterm windows on color VAXstations support these
101  * color escape sequences, as do some 3rd party terminals and many micro
102  * computers.
103  */
104 /* #define TEXTCOLOR */
105
106 /*
107  * If you define USE_QIO_INPUT, then you'll get raw characters from the
108  * keyboard, not unlike those of the unix version of Nethack.  This will
109  * allow you to use the Escape key in normal gameplay, and the appropriate
110  * control characters in Wizard mode.  It will work most like the unix
111  * version.
112  * It will also avoid "<interrupt>" being displayed when ^Y is pressed.
113  *
114  * Otherwise, the VMS SMG calls will be used.  These calls block use of
115  * the escape key, as well as certain control keys, so gameplay is not
116  * the same, although the differences are fairly negligible.  You must
117  * then use a VTxxx function key or two <escape>s to give an ESC response.
118  */
119 #define USE_QIO_INPUT /* use SYS$QIOW instead of SMG$READ_KEYSTROKE */
120
121 /*
122  * Allow the user to decide whether to pause via timer or excess screen
123  * output for various display effects like explosions and moving objects.
124  */
125 #define TIMED_DELAY /* enable the `timed_delay' run-time option */
126
127 /*
128  * If you define MAIL, then NetHack will capture incoming broadcast
129  * messages such as "New mail from so-and-so" and "Print job completed,"
130  * and then deliver them to the player.  For mail and phone broadcasts
131  * a scroll of mail will be created, which when read will cause NetHack
132  * to prompt the player for a command to spawn in order to respond.  The
133  * latter capability will not be available if SHELL is disabled below.
134  * If you undefine MAIL, broadcasts will go straight to the terminal,
135  * resulting in disruption of the screen display; use <ctrl/R> to redraw.
136  */
137 #define MAIL /* enable broadcast trapping */
138
139 /*
140  * SHELL enables the player to 'escape' into a spawned subprocess via
141  * the '!' command.  Logout or attach back to the parent to resume play.
142  * If the player attaches back to NetHack, then a subsequent escape will
143  * re-attach to the existing subprocess.  Any such subprocess left over
144  * at game exit will be deleted by an exit handler.
145  * SUSPEND enables someone running NetHack in a subprocess to reconnect
146  * to the parent process with the <ctrl/Z> command; this is not very
147  * close to Unix job control, but it's better than nothing.
148  */
149 #define SHELL   /* do not delete the '!' command */
150 #define SUSPEND /* don't delete the ^Z command, such as it is */
151
152 /*
153  * Some terminals or terminal emulators send two character sequence "ESC c"
154  * when Alt+c is pressed.  The altmeta run-time option allows the user to
155  * request that "ESC c" be treated as M-c, which means that if nethack sees
156  * ESC when it is waiting for a command, it will wait for another character
157  * (even if user intended that ESC to be standalone to cancel a count prefix).
158  */
159 #define ALTMETA /* support altmeta run-time option */
160
161 #define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
162
163 /* config.h defines USE_ISAAC64; we'll use it on Alpha or IA64 but not VAX;
164    it overrides RANDOM */
165 #if (defined(VAX) || defined(vax) || defined(__vax)) && defined(USE_ISAAC64)
166 #undef ISAAC64
167 #endif
168
169 #define FCMASK 0660 /* file creation mask */
170
171 /*
172  * 
173  */
174 #define NO_VSNPRINTF /* Avoid vsnprintf, use less-safe vsprintf instead. */
175
176 /*
177  * The remainder of the file should not need to be changed.
178  */
179
180 /* data librarian defs */
181 #ifdef DLB
182 #define DLBFILE "nh-data.dlb"
183 /*
184  * Since we can do without case insensitive filename comparison,
185  * avoid enabling it because that requires compiling and linking
186  * src/hacklib into util/dlb_main.
187  */
188 /* # define FILENAME_CMP strcmpi */ /* case insensitive */
189 #endif
190
191 #if defined(VAXC) && !defined(ANCIENT_VAXC)
192 #ifdef volatile
193 #undef volatile
194 #endif
195 #ifdef const
196 #undef const
197 #endif
198 #endif
199
200 #ifdef __DECC
201 #define STRICT_REF_DEF /* used in lev_main.c */
202 #endif
203 #ifdef STRICT_REF_DEF
204 #define DEFINE_OSPEED
205 #endif
206
207 #ifndef alloca
208 /* bison generated foo_yacc.c might try to use alloca() */
209 #ifdef __GNUC__
210 #define alloca __builtin_alloca
211 #else
212 #define ALLOCA_HACK /* used in util/panic.c */
213 #endif
214 #endif
215
216 #ifdef _DECC_V4_SOURCE
217 /* <types.h> excludes some necessary typedefs when _DECC_V4_SOURCE is defined
218  */
219 #include <types.h>
220 #ifndef __PID_T
221 #define __PID_T
222 typedef __pid_t pid_t;
223 #endif
224 #ifndef __UID_T
225 #define __UID_T
226 typedef __uid_t uid_t;
227 #endif
228 #ifndef __GID_T
229 #define __GID_T
230 typedef __gid_t gid_t;
231 #endif
232 #ifndef __MODE_T
233 #define __MODE_T
234 typedef __mode_t mode_t;
235 #endif
236 #endif /* _DECC_V4_SOURCE */
237
238 #include <time.h>
239 #if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
240 #include <file.h>
241 #else /* values needed from missing include file */
242 #define O_RDONLY 0
243 #define O_WRONLY 1
244 #define O_RDWR 2
245 #define O_CREAT 0x200
246 #define O_TRUNC 0x400
247 #endif
248
249 #define tgetch vms_getchar
250
251 #if defined(__DECC_VER) && (__DECC_VER >= 50000000)
252  /* for cc/Standard=ANSI89, suppress notification that '$' in identifiers
253     is an extension; sys/vms/*.c needs it regardless of strict ANSI mode */
254 # pragma message disable DOLLARID
255 #endif
256
257 #include "system.h"
258
259 #define index strchr
260 #define rindex strrchr
261
262 /* Use the high quality random number routines. */
263 #ifndef USE_ISAAC64
264 # if defined(RANDOM)
265 #  define Rand() random()
266 /* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
267    code to avoid having to deal with version-specific conditionalized builds */
268 #  define random nh_random
269 #  define srandom nh_srandom
270 #  define initstate nh_initstate
271 #  define setstate nh_setstate
272 # else
273 #  define Rand() rand()
274 # endif
275 #endif
276
277 #ifndef __GNUC__
278 #ifndef bcopy
279 #define bcopy(s, d, n) memcpy((d), (s), (n)) /* vaxcrtl */
280 #endif
281 #endif
282 #define abort() vms_abort()             /* vmsmisc.c */
283 #define creat(f, m) vms_creat(f, m)     /* vmsfiles.c */
284 #define exit(sts) vms_exit(sts)         /* vmsmisc.c */
285 #define getuid() vms_getuid()           /* vmsunix.c */
286 #define link(f1, f2) vms_link(f1, f2)   /* vmsfiles.c */
287 #define open(f, k, m) vms_open(f, k, m) /* vmsfiles.c */
288 #define fopen(f, m) vms_fopen(f, m)     /* vmsfiles.c */
289 /* #define unlink(f0) vms_unlink(f0)       /* vmsfiles.c */
290 #ifdef VERYOLD_VMS
291 #define unlink(f0) delete (f0) /* vaxcrtl */
292 #else
293 #define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */
294 #endif
295 #define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */
296
297 /* VMS global names are case insensitive... */
298 #define An vms_an
299 #define The vms_the
300 #define Shk_Your vms_shk_your
301
302 /* avoid global symbol in Alpha/VMS V1.5 STARLET library (link trouble) */
303 #define ospeed vms_ospeed
304
305 /* used in several files which don't #include "extern.h" */
306 extern void FDECL(vms_exit, (int));
307 extern int FDECL(vms_open, (const char *, int, unsigned));
308 extern FILE *FDECL(vms_fopen, (const char *, const char *));
309 char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
310
311 #endif /* VMSCONF_H */
312 #endif /* VMS */