Source:NetHack 3.6.2/include/ntconf.h
Jump to navigation
Jump to search
Below is the full text to ntconf.h from the source code of NetHack 3.6.2. To link to a particular line, write [[Source:NetHack 3.6.2/include/ntconf.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 ntconf.h $NHDT-Date: 1447424077 2015/11/13 14:14:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.48 $ */ 2. /* Copyright (c) NetHack PC Development Team 1993, 1994. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef NTCONF_H 6. #define NTCONF_H 7. 8. /* #define SHELL */ /* nt use of pcsys routines caused a hang */ 9. 10. #define TEXTCOLOR /* Color text */ 11. 12. #define EXEPATH /* Allow .exe location to be used as HACKDIR */ 13. #define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */ 14. 15. #define LAN_FEATURES /* Include code for lan-aware features. Untested in \ 16. 3.4.0*/ 17. 18. #define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */ 19. /* without first receiving confirmation. */ 20. 21. #define HOLD_LOCKFILE_OPEN /* Keep an exclusive lock on the .0 file */ 22. 23. #define SELF_RECOVER /* Allow the game itself to recover from an aborted \ 24. game */ 25. 26. #define SYSCF /* Use a global configuration */ 27. #define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration */ 28. 29. #define DUMPLOG /* Enable dumplog files */ 30. /*#define DUMPLOG_FILE "nethack-%n-%d.log"*/ 31. #define DUMPLOG_MSG_COUNT 50 32. 33. #define USER_SOUNDS 34. 35. /*#define CHANGE_COLOR*/ /* allow palette changes */ 36. #define SELECTSAVED /* Provide menu of saved games to choose from at start */ 37. 38. /* 39. * ----------------------------------------------------------------- 40. * The remaining code shouldn't need modification. 41. * ----------------------------------------------------------------- 42. */ 43. /* #define SHORT_FILENAMES */ /* All NT filesystems support long names now 44. */ 45. 46. #ifdef MICRO 47. #undef MICRO /* never define this! */ 48. #endif 49. 50. #define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \ 51. it is defined for WIN32. \ 52. Allow paths to be specified for HACKDIR, \ 53. LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \ 54. SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */ 55. #define NO_TERMS 56. #define ASCIIGRAPH 57. 58. #ifdef OPTIONS_USED 59. #undef OPTIONS_USED 60. #endif 61. #define OPTIONS_USED "options" 62. #define OPTIONS_FILE OPTIONS_USED 63. 64. #define PORT_HELP "porthelp" 65. 66. #define PORT_DEBUG /* include ability to debug international keyboard issues \ 67. */ 68. 69. #define RUNTIME_PORT_ID /* trigger run-time port identification for \ 70. * identification of exe CPU architecture \ 71. */ 72. #define RUNTIME_PASTEBUF_SUPPORT 73. 74. 75. #define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing \ 76. * until the main command loop. 'safer' because it \ 77. * avoids certain cheats and also avoids losing \ 78. * objects being thrown when the hangup occurs. \ 79. */ 80. 81. /* Stuff to help the user with some common, yet significant errors */ 82. #define INTERJECT_PANIC 0 83. #define INTERJECTION_TYPES (INTERJECT_PANIC + 1) 84. extern void FDECL(interject_assistance, 85. (int, int, genericptr_t, genericptr_t)); 86. extern void FDECL(interject, (int)); 87. 88. /* 89. *=============================================== 90. * Compiler-specific adjustments 91. *=============================================== 92. */ 93. 94. #ifdef __MINGW32__ 95. #ifdef strncasecmp 96. #undef strncasecmp 97. #endif 98. #ifdef strcasecmp 99. #undef strcasecmp 100. #endif 101. extern void NDECL(getlock); 102. #endif 103. 104. #ifdef _MSC_VER 105. #if (_MSC_VER > 1000) 106. /* Visual C 8 warning elimination */ 107. #ifndef _CRT_SECURE_NO_DEPRECATE 108. #define _CRT_SECURE_NO_DEPRECATE 109. #endif 110. #ifndef _SCL_SECURE_NO_DEPRECATE 111. #define _SCL_SECURE_NO_DEPRECATE 112. #endif 113. #ifndef _CRT_NONSTDC_NO_DEPRECATE 114. #define _CRT_NONSTDC_NO_DEPRECATE 115. #endif 116. #pragma warning(disable : 4996) /* VC8 deprecation warnings */ 117. #pragma warning(disable : 4142) /* benign redefinition */ 118. #pragma warning(disable : 4267) /* conversion from 'size_t' to XX */ 119. #if (_MSC_VER > 1600) 120. #pragma warning(disable : 4459) /* hide global declaration */ 121. #endif /* _MSC_VER > 1600 */ 122. #endif /* _MSC_VER > 1000 */ 123. #pragma warning(disable : 4761) /* integral size mismatch in arg; conv \ 124. supp*/ 125. #ifdef YYPREFIX 126. #pragma warning(disable : 4102) /* unreferenced label */ 127. #endif 128. #ifdef __cplusplus 129. /* suppress a warning in cppregex.cpp */ 130. #pragma warning(disable : 4101) /* unreferenced local variable */ 131. #endif 132. #ifndef HAS_STDINT_H 133. #define HAS_STDINT_H /* force include of stdint.h in integer.h */ 134. #endif 135. #endif /* _MSC_VER */ 136. 137. /* The following is needed for prototypes of certain functions */ 138. #if defined(_MSC_VER) 139. #include <process.h> /* Provides prototypes of exit(), spawn() */ 140. #endif 141. 142. #include <string.h> /* Provides prototypes of strncmpi(), etc. */ 143. #ifdef STRNCMPI 144. #define strncmpi(a, b, c) strnicmp(a, b, c) 145. #endif 146. 147. #ifdef _MSC_VER 148. /* Visual Studio defines this in their own headers, which we don't use */ 149. #ifndef snprintf 150. #define snprintf _snprintf 151. #pragma warning( \ 152. disable : 4996) /* deprecation warning suggesting snprintf_s */ 153. #endif 154. #endif 155. 156. #include <sys/types.h> 157. #include <stdlib.h> 158. #include <stdio.h> 159. #ifdef __BORLANDC__ 160. #undef randomize 161. #undef random 162. #endif 163. 164. #define PATHLEN BUFSZ /* maximum pathlength */ 165. #define FILENAME BUFSZ /* maximum filename length (conservative) */ 166. 167. #if defined(_MAX_PATH) && defined(_MAX_FNAME) 168. #if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ) 169. #undef PATHLEN 170. #undef FILENAME 171. #define PATHLEN _MAX_PATH 172. #define FILENAME _MAX_FNAME 173. #endif 174. #endif 175. 176. #define NO_SIGNAL 177. #define index strchr 178. #define rindex strrchr 179. 180. /* Time stuff */ 181. #include <time.h> 182. 183. #define USE_STDARG 184. 185. /* Use the high quality random number routines. */ 186. #ifdef USE_ISAAC64 187. #undef RANDOM 188. #else 189. #define RANDOM 190. #define Rand() random() 191. #endif 192. 193. /* Fall back to C's if nothing else, but this really isn't acceptable */ 194. #if !defined(USE_ISAAC64) && !defined(RANDOM) 195. #define Rand() rand() 196. #endif 197. 198. #include <sys/stat.h> 199. #define FCMASK (_S_IREAD | _S_IWRITE) /* file creation mask */ 200. #define regularize nt_regularize 201. #define HLOCK "NHPERM" 202. 203. #ifndef M 204. #define M(c) ((char) (0x80 | (c))) 205. /* #define M(c) ((c) - 128) */ 206. #endif 207. 208. #ifndef C 209. #define C(c) (0x1f & (c)) 210. #endif 211. 212. #if defined(DLB) 213. #define FILENAME_CMP stricmp /* case insensitive */ 214. #endif 215. 216. /* this was part of the MICRO stuff in the past */ 217. extern const char *alllevels, *allbones; 218. extern char hackdir[]; 219. #define ABORT C('a') 220. #define getuid() 1 221. #define getlogin() ((char *) 0) 222. extern void NDECL(win32_abort); 223. extern void FDECL(nttty_preference_update, (const char *)); 224. extern void NDECL(toggle_mouse_support); 225. extern void FDECL(map_subkeyvalue, (char *)); 226. #if defined(WIN32CON) 227. extern void FDECL(set_altkeyhandler, (const char *)); 228. #endif 229. extern void NDECL(raw_clear_screen); 230. 231. #include <fcntl.h> 232. #ifndef __BORLANDC__ 233. #include <io.h> 234. #include <direct.h> 235. #else 236. int _RTLENTRY _EXPFUNC access(const char _FAR *__path, int __amode); 237. int _RTLENTRY _EXPFUNC _chdrive(int __drive); 238. int _RTLENTRYF _EXPFUNC32 chdir(const char _FAR *__path); 239. char _FAR *_RTLENTRY _EXPFUNC getcwd(char _FAR *__buf, int __buflen); 240. int _RTLENTRY _EXPFUNC 241. write(int __handle, const void _FAR *__buf, unsigned __len); 242. int _RTLENTRY _EXPFUNC creat(const char _FAR *__path, int __amode); 243. int _RTLENTRY _EXPFUNC close(int __handle); 244. int _RTLENTRY _EXPFUNC _close(int __handle); 245. int _RTLENTRY _EXPFUNC 246. open(const char _FAR *__path, int __access, ... /*unsigned mode*/); 247. long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere); 248. int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len); 249. #endif 250. #ifndef CURSES_GRAPHICS 251. #include <conio.h> /* conflicting definitions with curses.h */ 252. #endif 253. #undef kbhit /* Use our special NT kbhit */ 254. #define kbhit (*nt_kbhit) 255. 256. #ifdef LAN_FEATURES 257. #define MAX_LAN_USERNAME 20 258. #endif 259. 260. #ifndef alloca 261. #define ALLOCA_HACK /* used in util/panic.c */ 262. #endif 263. 264. extern int FDECL(set_win32_option, (const char *, const char *)); 265. #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED 266. #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED 267. #define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED 268. #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON) 269. #ifdef CHANGE_COLOR 270. extern int FDECL(alternative_palette, (char *)); 271. #endif 272. 273. #ifdef NDEBUG 274. #define nhassert(expression) ((void)0) 275. #else 276. extern void FDECL(nhassert_failed, (const char * exp, const char * file, 277. int line)); 278. 279. #define nhassert(expression) (void)((!!(expression)) || \ 280. (nhassert_failed(#expression, __FILE__, __LINE__), 0)) 281. #endif 282. 283. #define nethack_enter(argc, argv) nethack_enter_winnt() 284. extern void FDECL(nethack_exit, (int)) NORETURN; 285. #endif /* NTCONF_H */