Source:NetHack 3.6.1/include/ntconf.h

From NetHackWiki
(Redirected from Ntconf.h)
Jump to: navigation, search

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