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