ntconf.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)ntconf.h   3.4     2002/03/10      */
00002 /* Copyright (c) NetHack PC Development Team 1993, 1994.  */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef NTCONF_H
00006 #define NTCONF_H
00007 
00008 /* #define SHELL */     /* nt use of pcsys routines caused a hang */
00009 
00010 #define RANDOM          /* have Berkeley random(3) */
00011 #define TEXTCOLOR       /* Color text */
00012 
00013 #define EXEPATH                 /* Allow .exe location to be used as HACKDIR */
00014 #define TRADITIONAL_GLYPHMAP    /* Store glyph mappings at level change time */
00015 #ifdef WIN32CON
00016 #define LAN_FEATURES            /* Include code for lan-aware features. Untested in 3.4.0*/
00017 #endif
00018 
00019 #define PC_LOCKING              /* Prevent overwrites of aborted or in-progress games */
00020                                 /* without first receiving confirmation. */
00021 
00022 #define HOLD_LOCKFILE_OPEN      /* Keep an exclusive lock on the .0 file */
00023 
00024 #define SELF_RECOVER            /* Allow the game itself to recover from an aborted game */
00025 
00026 //#define USER_SOUNDS
00027 /*
00028  * -----------------------------------------------------------------
00029  *  The remaining code shouldn't need modification.
00030  * -----------------------------------------------------------------
00031  */
00032 /* #define SHORT_FILENAMES */   /* All NT filesystems support long names now */
00033 
00034 #ifdef MICRO
00035 #undef MICRO                    /* never define this! */
00036 #endif
00037 
00038 #define NOCWD_ASSUMPTIONS       /* Always define this. There are assumptions that
00039                                    it is defined for WIN32.
00040                                    Allow paths to be specified for HACKDIR,
00041                                    LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
00042                                    SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
00043 #define NO_TERMS
00044 #define ASCIIGRAPH
00045 
00046 #ifdef OPTIONS_USED
00047 #undef OPTIONS_USED
00048 #endif
00049 #ifdef MSWIN_GRAPHICS
00050 #define OPTIONS_USED    "guioptions"
00051 #else
00052 #define OPTIONS_USED    "options"
00053 #endif
00054 #define OPTIONS_FILE OPTIONS_USED
00055 
00056 #define PORT_HELP       "porthelp"
00057 
00058 #ifdef WIN32CON
00059 #define PORT_DEBUG      /* include ability to debug international keyboard issues */
00060 #endif
00061 
00062 /* Stuff to help the user with some common, yet significant errors */
00063 #define INTERJECT_PANIC         0
00064 #define INTERJECTION_TYPES      (INTERJECT_PANIC + 1)
00065 extern void FDECL(interject_assistance, (int,int,genericptr_t,genericptr_t));
00066 extern void FDECL(interject, (int));
00067 
00068 /* The following is needed for prototypes of certain functions */
00069 #if defined(_MSC_VER)
00070 #include <process.h>    /* Provides prototypes of exit(), spawn()      */
00071 #endif
00072 
00073 #include <string.h>     /* Provides prototypes of strncmpi(), etc.     */
00074 #ifdef STRNCMPI
00075 #define strncmpi(a,b,c) strnicmp(a,b,c)
00076 #endif
00077 
00078 #include <sys/types.h>
00079 #include <stdlib.h>
00080 #ifdef __BORLANDC__
00081 #undef randomize
00082 #undef random
00083 #endif
00084 
00085 #define PATHLEN         BUFSZ /* maximum pathlength */
00086 #define FILENAME        BUFSZ /* maximum filename length (conservative) */
00087 
00088 #if defined(_MAX_PATH) && defined(_MAX_FNAME)
00089 # if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
00090 #undef PATHLEN
00091 #undef FILENAME
00092 #define PATHLEN         _MAX_PATH
00093 #define FILENAME        _MAX_FNAME
00094 # endif
00095 #endif
00096 
00097 
00098 #define NO_SIGNAL
00099 #define index   strchr
00100 #define rindex  strrchr
00101 #include <time.h>
00102 #define USE_STDARG
00103 #ifdef RANDOM
00104 /* Use the high quality random number routines. */
00105 #define Rand()  random()
00106 #else
00107 #define Rand()  rand()
00108 #endif
00109 
00110 #define FCMASK  0660    /* file creation mask */
00111 #define regularize      nt_regularize
00112 #define HLOCK "NHPERM"
00113 
00114 #ifndef M
00115 #define M(c)            ((char) (0x80 | (c)))
00116 /* #define M(c)         ((c) - 128) */
00117 #endif
00118 
00119 #ifndef C
00120 #define C(c)            (0x1f & (c))
00121 #endif
00122 
00123 #if defined(DLB)
00124 #define FILENAME_CMP  stricmp                 /* case insensitive */
00125 #endif
00126 
00127 #if 0
00128 extern char levels[], bones[], permbones[],
00129 #endif /* 0 */
00130 
00131 /* this was part of the MICRO stuff in the past */
00132 extern const char *alllevels, *allbones;
00133 extern char hackdir[];
00134 #define ABORT C('a')
00135 #define getuid() 1
00136 #define getlogin() ((char *)0)
00137 extern void NDECL(win32_abort);
00138 #ifdef WIN32CON
00139 extern void FDECL(nttty_preference_update, (const char *));
00140 extern void NDECL(toggle_mouse_support);
00141 extern void FDECL(map_subkeyvalue, (char *));
00142 extern void NDECL(load_keyboard_handler);
00143 #endif
00144 
00145 #include <fcntl.h>
00146 #ifndef __BORLANDC__
00147 #include <io.h>
00148 #include <direct.h>
00149 #else
00150 int  _RTLENTRY _EXPFUNC access  (const char _FAR *__path, int __amode);
00151 int  _RTLENTRY _EXPFUNC _chdrive(int __drive);
00152 int  _RTLENTRYF _EXPFUNC32   chdir( const char _FAR *__path );
00153 char _FAR * _RTLENTRY  _EXPFUNC     getcwd( char _FAR *__buf, int __buflen );
00154 int  _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
00155 int  _RTLENTRY _EXPFUNC creat   (const char _FAR *__path, int __amode);
00156 int  _RTLENTRY _EXPFUNC close   (int __handle);
00157 int  _RTLENTRY _EXPFUNC _close  (int __handle);
00158 int  _RTLENTRY _EXPFUNC open  (const char _FAR *__path, int __access,... /*unsigned mode*/);
00159 long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
00160 int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
00161 #endif
00162 #ifndef CURSES_GRAPHICS
00163 # include <conio.h>
00164 #endif
00165 #undef kbhit            /* Use our special NT kbhit */
00166 #define kbhit (*nt_kbhit)
00167 
00168 #ifdef LAN_FEATURES
00169 #define MAX_LAN_USERNAME 20
00170 #define LAN_RO_PLAYGROUND       /* not implemented in 3.3.0 */
00171 #define LAN_SHARED_BONES        /* not implemented in 3.3.0 */
00172 #include "nhlan.h"
00173 #endif
00174 
00175 #ifndef alloca
00176 #define ALLOCA_HACK     /* used in util/panic.c */
00177 #endif
00178 
00179 #ifndef REDO
00180 #undef  Getchar
00181 #define Getchar nhgetch
00182 #endif
00183 
00184 #ifdef _MSC_VER
00185 #if 0
00186 #pragma warning(disable:4018)   /* signed/unsigned mismatch */
00187 #pragma warning(disable:4305)   /* init, conv from 'const int' to 'char' */
00188 #endif
00189 #pragma warning(disable:4761)   /* integral size mismatch in arg; conv supp*/
00190 #ifdef YYPREFIX
00191 #pragma warning(disable:4102)   /* unreferenced label */
00192 #endif
00193 #endif
00194 
00195 extern int FDECL(set_win32_option, (const char *, const char *));
00196 #ifdef WIN32CON
00197 #define LEFTBUTTON  FROM_LEFT_1ST_BUTTON_PRESSED
00198 #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
00199 #define MIDBUTTON   FROM_LEFT_2ND_BUTTON_PRESSED
00200 #define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
00201 #endif /* WIN32CON */
00202 
00203 #endif /* NTCONF_H */