Source:NetHack 3.4.3/include/vmsconf.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/vmsconf.h from NetHack 3.4.3. To link to a particular line, write [[vmsconf.h#line123]], for example.

  1. /*	SCCS Id: @(#)vmsconf.h	3.4	2003/05/19	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */

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