Source:NetHack 3.6.2/include/vmsconf.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to vmsconf.h from the source code of NetHack 3.6.2. To link to a particular line, write [[Source:NetHack 3.6.2/include/vmsconf.h#line12]], for example.

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. /* 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.  * The remainder of the file should not need to be changed.
173.  */
174. 
175. /* data librarian defs */
176. #ifdef DLB
177. #define DLBFILE "nh-data.dlb"
178. /*
179.  * Since we can do without case insensitive filename comparison,
180.  * avoid enabling it because that requires compiling and linking
181.  * src/hacklib into util/dlb_main.
182.  */
183. /* # define FILENAME_CMP strcmpi */ /* case insensitive */
184. #endif
185. 
186. #if defined(VAXC) && !defined(ANCIENT_VAXC)
187. #ifdef volatile
188. #undef volatile
189. #endif
190. #ifdef const
191. #undef const
192. #endif
193. #endif
194. 
195. #ifdef __DECC
196. #define STRICT_REF_DEF /* used in lev_main.c */
197. #endif
198. #ifdef STRICT_REF_DEF
199. #define DEFINE_OSPEED
200. #endif
201. 
202. #ifndef alloca
203. /* bison generated foo_yacc.c might try to use alloca() */
204. #ifdef __GNUC__
205. #define alloca __builtin_alloca
206. #else
207. #define ALLOCA_HACK /* used in util/panic.c */
208. #endif
209. #endif
210. 
211. #ifdef _DECC_V4_SOURCE
212. /* <types.h> excludes some necessary typedefs when _DECC_V4_SOURCE is defined
213.  */
214. #include <types.h>
215. #ifndef __PID_T
216. #define __PID_T
217. typedef __pid_t pid_t;
218. #endif
219. #ifndef __UID_T
220. #define __UID_T
221. typedef __uid_t uid_t;
222. #endif
223. #ifndef __GID_T
224. #define __GID_T
225. typedef __gid_t gid_t;
226. #endif
227. #ifndef __MODE_T
228. #define __MODE_T
229. typedef __mode_t mode_t;
230. #endif
231. #endif /* _DECC_V4_SOURCE */
232. 
233. #include <time.h>
234. #if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
235. #include <file.h>
236. #else /* values needed from missing include file */
237. #define O_RDONLY 0
238. #define O_WRONLY 1
239. #define O_RDWR 2
240. #define O_CREAT 0x200
241. #define O_TRUNC 0x400
242. #endif
243. 
244. #define tgetch vms_getchar
245. 
246. #if defined(__DECC_VER) && (__DECC_VER >= 50000000)
247.  /* for cc/Standard=ANSI89, suppress notification that '$' in identifiers
248.     is an extension; sys/vms/*.c needs it regardless of strict ANSI mode */
249. # pragma message disable DOLLARID
250. #endif
251. 
252. #include "system.h"
253. 
254. #define index strchr
255. #define rindex strrchr
256. 
257. /* Use the high quality random number routines. */
258. #ifndef USE_ISAAC64
259. # if defined(RANDOM)
260. #  define Rand() random()
261. /* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
262.    code to avoid having to deal with version-specific conditionalized builds */
263. #  define random nh_random
264. #  define srandom nh_srandom
265. #  define initstate nh_initstate
266. #  define setstate nh_setstate
267. # else
268. #  define Rand() rand()
269. # endif
270. #endif
271. 
272. #ifndef __GNUC__
273. #ifndef bcopy
274. #define bcopy(s, d, n) memcpy((d), (s), (n)) /* vaxcrtl */
275. #endif
276. #endif
277. #define abort() vms_abort()             /* vmsmisc.c */
278. #define creat(f, m) vms_creat(f, m)     /* vmsfiles.c */
279. #define exit(sts) vms_exit(sts)         /* vmsmisc.c */
280. #define getuid() vms_getuid()           /* vmsunix.c */
281. #define link(f1, f2) vms_link(f1, f2)   /* vmsfiles.c */
282. #define open(f, k, m) vms_open(f, k, m) /* vmsfiles.c */
283. #define fopen(f, m) vms_fopen(f, m)     /* vmsfiles.c */
284. /* #define unlink(f0) vms_unlink(f0)       /* vmsfiles.c */
285. #ifdef VERYOLD_VMS
286. #define unlink(f0) delete (f0) /* vaxcrtl */
287. #else
288. #define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */
289. #endif
290. #define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */
291. 
292. /* VMS global names are case insensitive... */
293. #define An vms_an
294. #define The vms_the
295. #define Shk_Your vms_shk_your
296. 
297. /* avoid global symbol in Alpha/VMS V1.5 STARLET library (link trouble) */
298. #define ospeed vms_ospeed
299. 
300. /* used in several files which don't #include "extern.h" */
301. extern void FDECL(vms_exit, (int));
302. extern int FDECL(vms_open, (const char *, int, unsigned));
303. extern FILE *FDECL(vms_fopen, (const char *, const char *));
304. char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
305. 
306. #endif /* VMSCONF_H */
307. #endif /* VMS */