Source:NetHack 5.0.0/include/windconf.h
Jump to navigation
Jump to search
Below is the full text to windconf.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/windconf.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 5.0 windconf.h $NHDT-Date: 1596498552 2020/08/03 23:49:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.89 $ */ 2. /* Copyright (c) NetHack PC Development Team 1993, 1994. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef WINDCONF_H 6. #define WINDCONF_H 7. 8. /* #define SHELL */ /* nt use of pcsys routines caused a hang */ 9. 10. #define EXEPATH /* Allow .exe location to be used as HACKDIR */ 11. #define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */ 12. 13. #define LAN_FEATURES /* Include code for lan-aware features. Untested in \ 14. 3.4.0*/ 15. 16. #define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */ 17. /* without first receiving confirmation. */ 18. 19. #define SELF_RECOVER /* Allow the game itself to recover from an aborted \ 20. game */ 21. 22. #define SYSCF /* Use a global configuration */ 23. #define SYSCF_FILE "sysconf" /* Use a file to hold the SYSCF configuration */ 24. 25. #ifdef DUMPLOG 26. #define DUMPLOG_FILE "%TEMP%/nethack-%n-%d.log" 27. #endif 28. 29. /*#define CHANGE_COLOR*/ /* allow palette changes */ 30. 31. #define QWERTZ_SUPPORT /* when swap_yz is True, numpad 7 is 'z' not 'y' */ 32. 33. #define OPTIONS_AT_RUNTIME /* build info done at runtime not text file */ 34. 35. #define EARLY_CONFIGFILE_PASS 36. #define TTY_PERM_INVENT 37. 38. #ifdef WIN32CON 39. #define IDLECHECKPOINT 40. #endif 41. 42. /* 43. * ----------------------------------------------------------------- 44. * The remaining code shouldn't need modification. 45. * ----------------------------------------------------------------- 46. */ 47. /* #define SHORT_FILENAMES */ /* All NT filesystems support long names now 48. */ 49. 50. #ifdef DLB 51. #define VERSION_IN_DLB_FILENAME /* Append version digits to nhdat */ 52. #endif 53. 54. #ifdef MICRO 55. #undef MICRO /* never define this! */ 56. #endif 57. 58. #define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \ 59. it is defined for WIN32. \ 60. Allow paths to be specified for HACKDIR, \ 61. LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \ 62. SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */ 63. #define NO_TERMS 64. #define ASCIIGRAPH 65. 66. #ifdef OPTIONS_USED 67. #undef OPTIONS_USED 68. #endif 69. #define OPTIONS_USED "options" 70. #define OPTIONS_FILE OPTIONS_USED 71. 72. #define PORT_HELP "porthelp" 73. 74. #define PORT_DEBUG /* include ability to debug international keyboard issues \ 75. */ 76. 77. #define RUNTIME_PORT_ID /* trigger run-time port identification for \ 78. * identification of exe CPU architecture \ 79. */ 80. #define RUNTIME_PASTEBUF_SUPPORT 81. 82. 83. #define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing \ 84. * until the main command loop. 'safer' because it \ 85. * avoids certain cheats and also avoids losing \ 86. * objects being thrown when the hangup occurs. \ 87. */ 88. 89. #define CONFIG_FILE ".nethackrc" 90. #define CONFIG_TEMPLATE "nethackrc.template" 91. #define SYSCF_TEMPLATE "sysconf.template" 92. #define SYMBOLS_TEMPLATE "symbols.template" 93. #define GUIDEBOOK_FILE "Guidebook.txt" 94. 95. /* Stuff to help the user with some common, yet significant errors */ 96. #define INTERJECT_PANIC 0 97. #define INTERJECTION_TYPES (INTERJECT_PANIC + 1) 98. extern void interject_assistance(int, int, genericptr_t, genericptr_t); 99. extern void interject(int); 100. extern char *windows_exepath(void); 101. 102. /* 103. *=============================================== 104. * Compiler-specific adjustments 105. *=============================================== 106. */ 107. 108. #ifdef __GNUC__ 109. #define MD_USE_TMPFILE_S 110. # 111. #ifdef strncasecmp 112. #undef strncasecmp 113. #endif 114. #ifdef strcasecmp 115. #undef strcasecmp 116. /* https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/ */ 117. #endif 118. /* extern int getlock(void); */ 119. #endif /* __GNUC__ */ 120. 121. #ifdef _MSC_VER 122. #define MD_USE_TMPFILE_S 123. #define HAS_STDINT 124. #if (_MSC_VER > 1000) 125. /* Visual C 8 warning elimination */ 126. #ifndef _CRT_SECURE_NO_DEPRECATE 127. #define _CRT_SECURE_NO_DEPRECATE 128. #endif 129. #ifndef _SCL_SECURE_NO_DEPRECATE 130. #define _SCL_SECURE_NO_DEPRECATE 131. #endif 132. #ifndef _CRT_NONSTDC_NO_DEPRECATE 133. #define _CRT_NONSTDC_NO_DEPRECATE 134. #endif 135. #pragma warning(disable : 4996) /* VC8 deprecation warnings */ 136. #pragma warning(disable : 4142) /* benign redefinition */ 137. #pragma warning(disable : 4267) /* conversion from 'size_t' to XX */ 138. #if (_MSC_VER > 1600) 139. #pragma warning(disable : 4459) /* hide global declaration */ 140. #endif /* _MSC_VER > 1600 */ 141. #endif /* _MSC_VER > 1000 */ 142. #pragma warning(disable : 4761) /* integral size mismatch in arg; conv \ 143. supp*/ 144. #ifdef YYPREFIX 145. #pragma warning(disable : 4102) /* unreferenced label */ 146. #endif 147. #ifdef __cplusplus 148. /* suppress a warning in cppregex.cpp */ 149. #pragma warning(disable : 4101) /* unreferenced local variable */ 150. #endif 151. #ifndef HAS_STDINT_H 152. #define HAS_STDINT_H /* force include of stdint.h in integer.h */ 153. #endif 154. /* Turn on some additional warnings */ 155. #pragma warning(3:4389) 156. 157. /* supply ssize_t */ 158. #include <BaseTsd.h> 159. typedef SSIZE_T ssize_t; 160. 161. #endif /* _MSC_VER */ 162. 163. /* The following is needed for prototypes of certain functions */ 164. #if defined(_MSC_VER) 165. #include <process.h> /* Provides prototypes of exit(), spawn() */ 166. #endif 167. 168. #include <string.h> /* Provides prototypes of strncmpi(), etc. */ 169. #ifdef STRNCMPI 170. #define strncmpi(a, b, c) strnicmp(a, b, c) 171. #endif 172. 173. 174. #include <sys/types.h> 175. #ifdef __BORLANDC__ 176. #undef randomize 177. #undef random 178. #endif 179. 180. #define PATHLEN BUFSZ /* maximum pathlength */ 181. #define FILENAME BUFSZ /* maximum filename length (conservative) */ 182. 183. #if defined(_MAX_PATH) && defined(_MAX_FNAME) 184. #if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ) 185. #undef PATHLEN 186. #undef FILENAME 187. #define PATHLEN _MAX_PATH 188. #define FILENAME _MAX_FNAME 189. #endif 190. #endif 191. 192. #define NO_SIGNAL 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) || defined(_MSC_VER) 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. #define ABORT C('a') 229. #define getuid() 1 230. #define getlogin() ((char *) 0) 231. extern void win32_abort(void); 232. extern void consoletty_preference_update(const char *); 233. extern void toggle_mouse_support(void); 234. extern void map_subkeyvalue(char *); 235. extern void set_altkeyhandling(const char *); 236. extern void raw_clear_screen(void); 237. 238. #include <fcntl.h> 239. #ifndef __BORLANDC__ 240. #include <io.h> 241. #include <direct.h> 242. #else 243. int _RTLENTRY _EXPFUNC access(const char _FAR *__path, int __amode); 244. int _RTLENTRY _EXPFUNC _chdrive(int __drive); 245. int _RTLENTRYF _EXPFUNC32 chdir(const char _FAR *__path); 246. char _FAR *_RTLENTRY _EXPFUNC getcwd(char _FAR *__buf, int __buflen); 247. int _RTLENTRY _EXPFUNC 248. write(int __handle, const void _FAR *__buf, unsigned __len); 249. int _RTLENTRY _EXPFUNC creat(const char _FAR *__path, int __amode); 250. int _RTLENTRY _EXPFUNC close(int __handle); 251. int _RTLENTRY _EXPFUNC _close(int __handle); 252. int _RTLENTRY _EXPFUNC 253. open(const char _FAR *__path, int __access, ... /*unsigned mode*/); 254. long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere); 255. int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len); 256. #endif 257. #undef kbhit /* Use our special NT kbhit */ 258. #define kbhit (*nt_kbhit) 259. 260. #ifdef LAN_FEATURES 261. #define MAX_LAN_USERNAME 20 262. #endif 263. 264. #ifndef alloca 265. #define ALLOCA_HACK /* used in util/panic.c */ 266. #endif 267. 268. extern int set_win32_option(const char *, const char *); 269. #define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED 270. #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED 271. #define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED 272. #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON) 273. #ifdef CHANGE_COLOR 274. extern int alternative_palette(char *); 275. #endif 276. 277. #define nethack_enter(argc, argv) nethack_enter_windows() 278. extern boolean file_exists(const char *); 279. extern boolean file_newer(const char *, const char *); 280. #ifndef SYSTEM_H 281. /* #include "system.h" */ 282. #endif 283. 284. #if defined(WIN_CE) 285. #define QSORTCALLBACK __cdecl 286. #endif 287. 288. /* Override the default version of nhassert. The default version is unable 289. * to generate a string form of the expression due to the need to be 290. * compatible with compilers which do not support macro stringization (i.e. 291. * #x to turn x into its string form). 292. */ 293. extern void nt_assert_failed(const char *, const char *, int); 294. #define nhassert(expression) (void)((!!(expression)) || \ 295. (nt_assert_failed(#expression, __FILE__, __LINE__), 0)) 296. 297. #endif /* WINDCONF_H */