Source:NetHack 3.4.3/include/ntconf.h

From NetHackWiki
Jump to: navigation, search

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

  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. */

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. #ifndef NTCONF_H
  2. #define NTCONF_H
  3.  
  4. /* #define SHELL	/* nt use of pcsys routines caused a hang */
  5.  
  6. #define RANDOM		/* have Berkeley random(3) */
  7. #define TEXTCOLOR	/* Color text */
  8.  
  9. #define EXEPATH			/* Allow .exe location to be used as HACKDIR */
  10. #define TRADITIONAL_GLYPHMAP	/* Store glyph mappings at level change time */
  11. #ifdef WIN32CON
  12. #define LAN_FEATURES		/* Include code for lan-aware features. Untested in 3.4.0*/
  13. #endif
  14.  
  15. #define PC_LOCKING		/* Prevent overwrites of aborted or in-progress games */
  16. 				/* without first receiving confirmation. */
  17.  
  18. #define HOLD_LOCKFILE_OPEN	/* Keep an exclusive lock on the .0 file */
  19.  
  20. #define SELF_RECOVER		/* Allow the game itself to recover from an aborted game */
  21.  
  22. #define USER_SOUNDS
  23. /*
  24. * -----------------------------------------------------------------
  25. *  The remaining code shouldn't need modification.
  26. * -----------------------------------------------------------------
  27. */
  28. /* #define SHORT_FILENAMES	/* All NT filesystems support long names now */
  29.  
  30. #ifdef MICRO
  31. #undef MICRO			/* never define this! */
  32. #endif
  33.  
  34. #define NOCWD_ASSUMPTIONS	/* Always define this. There are assumptions that
  35. it is defined for WIN32.
  36. 				   Allow paths to be specified for HACKDIR,
  37. 				   LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
  38. 				   SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
  39. #define NO_TERMS
  40. #define ASCIIGRAPH
  41.  
  42. #ifdef OPTIONS_USED
  43. #undef OPTIONS_USED
  44. #endif
  45. #ifdef MSWIN_GRAPHICS
  46. #define OPTIONS_USED	"guioptions"
  47. #else
  48. #define OPTIONS_USED	"ttyoptions"
  49. #endif
  50. #define OPTIONS_FILE OPTIONS_USED
  51.  
  52. #define PORT_HELP	"porthelp"
  53.  
  54. #ifdef WIN32CON
  55. #define PORT_DEBUG	/* include ability to debug international keyboard issues */
  56. #endif
  57.  
  58. /* Stuff to help the user with some common, yet significant errors */
  59. #define INTERJECT_PANIC		0
  60. #define INTERJECTION_TYPES	(INTERJECT_PANIC + 1)
  61. extern void FDECL(interject_assistance, (int,int,genericptr_t,genericptr_t));
  62. extern void FDECL(interject, (int));
  63.  
  64. /* The following is needed for prototypes of certain functions */
  65. #if defined(_MSC_VER)
  66. #include <process.h>	/* Provides prototypes of exit(), spawn()      */
  67. #endif
  68.  
  69. #include <string.h>	/* Provides prototypes of strncmpi(), etc.     */
  70. #ifdef STRNCMPI
  71. #define strncmpi(a,b,c) strnicmp(a,b,c)
  72. #endif
  73.  
  74. #include <sys/types.h>
  75. #include <stdlib.h>
  76. #ifdef __BORLANDC__
  77. #undef randomize
  78. #undef random
  79. #endif
  80.  
  81. #define PATHLEN		BUFSZ /* maximum pathlength */
  82. #define FILENAME	BUFSZ /* maximum filename length (conservative) */
  83.  
  84. #if defined(_MAX_PATH) && defined(_MAX_FNAME)
  85. # if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
  86. #undef PATHLEN
  87. #undef FILENAME
  88. #define PATHLEN		_MAX_PATH
  89. #define FILENAME	_MAX_FNAME
  90. # endif
  91. #endif
  92.  
  93.  
  94. #define NO_SIGNAL
  95. #define index	strchr
  96. #define rindex	strrchr
  97. #include <time.h>
  98. #define USE_STDARG
  99. #ifdef RANDOM
  100. /* Use the high quality random number routines. */
  101. #define Rand()	random()
  102. #else
  103. #define Rand()	rand()
  104. #endif
  105.  
  106. #define FCMASK	0660	/* file creation mask */
  107. #define regularize	nt_regularize
  108. #define HLOCK "NHPERM"
  109.  
  110. #ifndef M
  111. #define M(c)		((char) (0x80 | (c)))
  112. /* #define M(c)		((c) - 128) */
  113. #endif
  114.  
  115. #ifndef C
  116. #define C(c)		(0x1f & (c))
  117. #endif
  118.  
  119. #if defined(DLB)
  120. #define FILENAME_CMP  stricmp		      /* case insensitive */
  121. #endif
  122.  
  123. #if 0
  124. extern char levels[], bones[], permbones[],
  125. #endif /* 0 */
  126.  
  127. /* this was part of the MICRO stuff in the past */
  128. extern const char *alllevels, *allbones;
  129. extern char hackdir[];
  130. #define ABORT C('a')
  131. #define getuid() 1
  132. #define getlogin() ((char *)0)
  133. extern void NDECL(win32_abort);
  134. #ifdef WIN32CON
  135. extern void FDECL(nttty_preference_update, (const char *));
  136. extern void NDECL(toggle_mouse_support);
  137. extern void FDECL(map_subkeyvalue, (char *));
  138. extern void NDECL(load_keyboard_handler);
  139. #endif
  140.  
  141. #include <fcntl.h>
  142. #ifndef __BORLANDC__
  143. #include <io.h>
  144. #include <direct.h>
  145. #else
  146. int  _RTLENTRY _EXPFUNC access  (const char _FAR *__path, int __amode);
  147. int  _RTLENTRY _EXPFUNC _chdrive(int __drive);
  148. int  _RTLENTRYF _EXPFUNC32   chdir( const char _FAR *__path );
  149. char _FAR * _RTLENTRY  _EXPFUNC     getcwd( char _FAR *__buf, int __buflen );
  150. int  _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
  151. int  _RTLENTRY _EXPFUNC creat   (const char _FAR *__path, int __amode);
  152. int  _RTLENTRY _EXPFUNC close   (int __handle);
  153. int  _RTLENTRY _EXPFUNC _close  (int __handle);
  154. int  _RTLENTRY _EXPFUNC open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
  155. long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
  156. int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
  157. #endif
  158. #include <conio.h>
  159. #undef kbhit		/* Use our special NT kbhit */
  160. #define kbhit (*nt_kbhit)
  161.  
  162. #ifdef LAN_FEATURES
  163. #define MAX_LAN_USERNAME 20
  164. #define LAN_RO_PLAYGROUND	/* not implemented in 3.3.0 */
  165. #define LAN_SHARED_BONES	/* not implemented in 3.3.0 */
  166. #include "nhlan.h"
  167. #endif
  168.  
  169. #ifndef alloca
  170. #define ALLOCA_HACK	/* used in util/panic.c */
  171. #endif
  172.  
  173. #ifndef REDO
  174. #undef	Getchar
  175. #define Getchar nhgetch
  176. #endif
  177.  
  178. #ifdef _MSC_VER
  179. #if 0
  180. #pragma warning(disable:4018)	/* signed/unsigned mismatch */
  181. #pragma warning(disable:4305)	/* init, conv from 'const int' to 'char' */
  182. #endif
  183. #pragma warning(disable:4761)	/* integral size mismatch in arg; conv supp*/
  184. #ifdef YYPREFIX
  185. #pragma warning(disable:4102)	/* unreferenced label */
  186. #endif
  187. #endif
  188.  
  189. extern int FDECL(set_win32_option, (const char *, const char *));
  190. #ifdef WIN32CON
  191. #define LEFTBUTTON  FROM_LEFT_1ST_BUTTON_PRESSED
  192. #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
  193. #define MIDBUTTON   FROM_LEFT_2ND_BUTTON_PRESSED
  194. #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
  195. #endif /* WIN32CON */
  196.  
  197. #endif /* NTCONF_H */