Source:NetHack 3.6.6/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.6. To link to a particular line, write [[Source:NetHack 3.6.6/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. /* #define QWERTZ_SUPPORT */ /* when swap_yz is True, numpad 7 is 'z' not 'y' */ 39. 40. /* 41. * ----------------------------------------------------------------- 42. * The remaining code shouldn't need modification. 43. * ----------------------------------------------------------------- 44. */ 45. /* #define SHORT_FILENAMES */ /* All NT filesystems support long names now 46. */ 47. 48. #define VERSION_IN_DLB_FILENAME /* Append version digits to nhdat */ 49. 50. #ifdef MICRO 51. #undef MICRO /* never define this! */ 52. #endif 53. 54. #define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \ 55. it is defined for WIN32. \ 56. Allow paths to be specified for HACKDIR, \ 57. LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \ 58. SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */ 59. #define NO_TERMS 60. #define ASCIIGRAPH 61. 62. #ifdef OPTIONS_USED 63. #undef OPTIONS_USED 64. #endif 65. #define OPTIONS_USED "options" 66. #define OPTIONS_FILE OPTIONS_USED 67. 68. #define PORT_HELP "porthelp" 69. 70. #define PORT_DEBUG /* include ability to debug international keyboard issues \ 71. */ 72. 73. #define RUNTIME_PORT_ID /* trigger run-time port identification for \ 74. * identification of exe CPU architecture \ 75. */ 76. #define RUNTIME_PASTEBUF_SUPPORT 77. 78. 79. #define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing \ 80. * until the main command loop. 'safer' because it \ 81. * avoids certain cheats and also avoids losing \ 82. * objects being thrown when the hangup occurs. \ 83. */ 84. 85. #define CONFIG_FILE ".nethackrc" 86. #define CONFIG_TEMPLATE ".nethackrc.template" 87. #define SYSCF_TEMPLATE "sysconf.template" 88. #define SYMBOLS_TEMPLATE "symbols.template" 89. #define GUIDEBOOK_FILE "Guidebook.txt" 90. 91. /* Stuff to help the user with some common, yet significant errors */ 92. #define INTERJECT_PANIC 0 93. #define INTERJECTION_TYPES (INTERJECT_PANIC + 1) 94. extern void FDECL(interject_assistance, 95. (int, int, genericptr_t, genericptr_t)); 96. extern void FDECL(interject, (int)); 97. 98. /* 99. *=============================================== 100. * Compiler-specific adjustments 101. *=============================================== 102. */ 103. 104. #ifdef __MINGW32__ 105. #ifdef strncasecmp 106. #undef strncasecmp 107. #endif 108. #ifdef strcasecmp 109. #undef strcasecmp 110. #endif 111. /* extern int NDECL(getlock); */ 112. #endif 113. 114. #ifdef _MSC_VER 115. #if (_MSC_VER > 1000) 116. /* Visual C 8 warning elimination */ 117. #ifndef _CRT_SECURE_NO_DEPRECATE 118. #define _CRT_SECURE_NO_DEPRECATE 119. #endif 120. #ifndef _SCL_SECURE_NO_DEPRECATE 121. #define _SCL_SECURE_NO_DEPRECATE 122. #endif 123. #ifndef _CRT_NONSTDC_NO_DEPRECATE 124. #define _CRT_NONSTDC_NO_DEPRECATE 125. #endif 126. #pragma warning(disable : 4996) /* VC8 deprecation warnings */ 127. #pragma warning(disable : 4142) /* benign redefinition */ 128. #pragma warning(disable : 4267) /* conversion from 'size_t' to XX */ 129. #if (_MSC_VER > 1600) 130. #pragma warning(disable : 4459) /* hide global declaration */ 131. #endif /* _MSC_VER > 1600 */ 132. #endif /* _MSC_VER > 1000 */ 133. #pragma warning(disable : 4761) /* integral size mismatch in arg; conv \ 134. supp*/ 135. #ifdef YYPREFIX 136. #pragma warning(disable : 4102) /* unreferenced label */ 137. #endif 138. #ifdef __cplusplus 139. /* suppress a warning in cppregex.cpp */ 140. #pragma warning(disable : 4101) /* unreferenced local variable */ 141. #endif 142. #ifndef HAS_STDINT_H 143. #define HAS_STDINT_H /* force include of stdint.h in integer.h */ 144. #endif 145. #endif /* _MSC_VER */ 146. 147. /* The following is needed for prototypes of certain functions */ 148. #if defined(_MSC_VER) 149. #include <process.h> /* Provides prototypes of exit(), spawn() */ 150. #endif 151. 152. #include <string.h> /* Provides prototypes of strncmpi(), etc. */ 153. #ifdef STRNCMPI 154. #define strncmpi(a, b, c) strnicmp(a, b, c) 155. #endif 156. 157. #ifdef _MSC_VER 158. /* Visual Studio defines this in their own headers, which we don't use */ 159. #ifndef snprintf 160. #define snprintf _snprintf 161. #pragma warning( \ 162. disable : 4996) /* deprecation warning suggesting snprintf_s */ 163. #endif 164. #endif 165. 166. #include <sys/types.h> 167. #include <stdlib.h> 168. #include <stdio.h> 169. #ifdef __BORLANDC__ 170. #undef randomize 171. #undef random 172. #endif 173. 174. #define PATHLEN BUFSZ /* maximum pathlength */ 175. #define FILENAME BUFSZ /* maximum filename length (conservative) */ 176. 177. #if defined(_MAX_PATH) && defined(_MAX_FNAME) 178. #if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ) 179. #undef PATHLEN 180. #undef FILENAME 181. #define PATHLEN _MAX_PATH 182. #define FILENAME _MAX_FNAME 183. #endif 184. #endif 185. 186. #define NO_SIGNAL 187. #define index strchr 188. #define rindex strrchr 189. 190. /* Time stuff */ 191. #include <time.h> 192. 193. #define USE_STDARG 194. 195. /* Use the high quality random number routines. */ 196. #ifdef USE_ISAAC64 197. #undef RANDOM 198. #else 199. #define RANDOM 200. #define Rand() random() 201. #endif 202. 203. /* Fall back to C's if nothing else, but this really isn't acceptable */ 204. #if !defined(USE_ISAAC64) && !defined(RANDOM) 205. #define Rand() rand() 206. #endif 207. 208. #include <sys/stat.h> 209. #define FCMASK (_S_IREAD | _S_IWRITE) /* file creation mask */ 210. #define regularize nt_regularize 211. #define HLOCK "NHPERM" 212. 213. #ifndef M 214. #define M(c) ((char) (0x80 | (c))) 215. /* #define M(c) ((c) - 128) */ 216. #endif 217. 218. #ifndef C 219. #define C(c) (0x1f & (c)) 220. #endif 221. 222. #if defined(DLB) 223. #define FILENAME_CMP stricmp /* case insensitive */ 224. #endif 225. 226. /* this was part of the MICRO stuff in the past */ 227. extern const char *alllevels, *allbones; 228. extern char hackdir[]; 229. #define ABORT C('a') 230. #define getuid() 1 231. #define getlogin() ((char *) 0) 232. extern void NDECL(win32_abort); 233. extern void FDECL(nttty_preference_update, (const char *)); 234. extern void NDECL(toggle_mouse_support); 235. extern void FDECL(map_subkeyvalue, (char *)); 236. #if defined(WIN32CON) 237. extern void FDECL(set_altkeyhandler, (const char *)); 238. #endif 239. extern void NDECL(raw_clear_screen); 240. 241. #include <fcntl.h> 242. #ifndef __BORLANDC__ 243. #include <io.h> 244. #include <direct.h> 245. #else 246. int _RTLENTRY _EXPFUNC access(const char _FAR *__path, int __amode); 247. int _RTLENTRY _EXPFUNC _chdrive(int __drive); 248. int _RTLENTRYF _EXPFUNC32 chdir(const char _FAR *__path); 249. char _FAR *_RTLENTRY _EXPFUNC getcwd(char _FAR *__buf, int __buflen); 250. int _RTLENTRY _EXPFUNC 251. write(int __handle, const void _FAR *__buf, unsigned __len); 252. int _RTLENTRY _EXPFUNC creat(const char _FAR *__path, int __amode); 253. int _RTLENTRY _EXPFUNC close(int __handle); 254. int _RTLENTRY _EXPFUNC _close(int __handle); 255. int _RTLENTRY _EXPFUNC 256. open(const char _FAR *__path, int __access, ... /*unsigned mode*/); 257. long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere); 258. int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len); 259. #endif 260. #ifndef CURSES_GRAPHICS 261. #include <conio.h> /* conflicting definitions with curses.h */ 262. #endif 263. #undef kbhit /* Use our special NT kbhit */ 264. #define kbhit (*nt_kbhit) 265. 266. #ifdef LAN_FEATURES 267. #define MAX_LAN_USERNAME 20 268. #endif 269. 270. #ifndef alloca 271. #define ALLOCA_HACK /* used in util/panic.c */ 272. #endif 273. 274. extern int FDECL(set_win32_option, (const char *, const char *)); 275. #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED 276. #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED 277. #define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED 278. #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON) 279. #ifdef CHANGE_COLOR 280. extern int FDECL(alternative_palette, (char *)); 281. #endif 282. 283. #ifdef NDEBUG 284. #define nhassert(expression) ((void)0) 285. #else 286. extern void FDECL(nhassert_failed, (const char * exp, const char * file, 287. int line)); 288. 289. #define nhassert(expression) (void)((!!(expression)) || \ 290. (nhassert_failed(#expression, __FILE__, __LINE__), 0)) 291. #endif 292. 293. #define nethack_enter(argc, argv) nethack_enter_winnt() 294. extern void FDECL(nethack_exit, (int)) NORETURN; 295. extern boolean FDECL(file_exists, (const char *)); 296. extern boolean FDECL(file_newer, (const char *, const char *)); 297. #endif /* NTCONF_H */