1/* SCCS Id: @(#)ntconf.h 3.4 2002/03/10 */ 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#ifdef WIN32CON 16#define LAN_FEATURES /* Include code for lan-aware features. Untested in 3.4.0*/ 17#endif 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 game */ 25 26#define USER_SOUNDS 27/* 28 * ----------------------------------------------------------------- 29 * The remaining code shouldn't need modification. 30 * ----------------------------------------------------------------- 31 */ 32/* #define SHORT_FILENAMES /* All NT filesystems support long names now */ 33 34#ifdef MICRO 35#undef MICRO /* never define this! */ 36#endif 37 38#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that 39 it is defined for WIN32. 40 Allow paths to be specified for HACKDIR, 41 LEVELDIR, SAVEDIR, BONESDIR, DATADIR, 42 SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */ 43#define NO_TERMS 44#define ASCIIGRAPH 45 46#ifdef OPTIONS_USED 47#undef OPTIONS_USED 48#endif 49#ifdef MSWIN_GRAPHICS 50#define OPTIONS_USED "guioptions" 51#else 52#define OPTIONS_USED "ttyoptions" 53#endif 54#define OPTIONS_FILE OPTIONS_USED 55 56#define PORT_HELP "porthelp" 57 58#ifdef WIN32CON 59#define PORT_DEBUG /* include ability to debug international keyboard issues */ 60#endif 61 62/* Stuff to help the user with some common, yet significant errors */ 63#define INTERJECT_PANIC 0 64#define INTERJECTION_TYPES (INTERJECT_PANIC + 1) 65extern void FDECL(interject_assistance, (int,int,genericptr_t,genericptr_t)); 66extern void FDECL(interject, (int)); 67 68/* The following is needed for prototypes of certain functions */ 69#if defined(_MSC_VER) 70#include <process.h> /* Provides prototypes of exit(), spawn() */ 71#endif 72 73#include <string.h> /* Provides prototypes of strncmpi(), etc. */ 74#ifdef STRNCMPI 75#define strncmpi(a,b,c) strnicmp(a,b,c) 76#endif 77 78#include <sys/types.h> 79#include <stdlib.h> 80#ifdef __BORLANDC__ 81#undef randomize 82#undef random 83#endif 84 85#define PATHLEN BUFSZ /* maximum pathlength */ 86#define FILENAME BUFSZ /* maximum filename length (conservative) */ 87 88#if defined(_MAX_PATH) && defined(_MAX_FNAME) 89# if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ) 90#undef PATHLEN 91#undef FILENAME 92#define PATHLEN _MAX_PATH 93#define FILENAME _MAX_FNAME 94# endif 95#endif 96 97 98#define NO_SIGNAL 99#define index strchr 100#define rindex strrchr 101#include <time.h> 102#define USE_STDARG 103#ifdef RANDOM 104/* Use the high quality random number routines. */ 105#define Rand() random() 106#else 107#define Rand() rand() 108#endif 109 110#define FCMASK 0660 /* file creation mask */ 111#define regularize nt_regularize 112#define HLOCK "NHPERM" 113 114#ifndef M 115#define M(c) ((char) (0x80 | (c))) 116/* #define M(c) ((c) - 128) */ 117#endif 118 119#ifndef C 120#define C(c) (0x1f & (c)) 121#endif 122 123#if defined(DLB) 124#define FILENAME_CMP stricmp /* case insensitive */ 125#endif 126 127#if 0 128extern char levels[], bones[], permbones[], 129#endif /* 0 */ 130 131/* this was part of the MICRO stuff in the past */ 132extern const char *alllevels, *allbones; 133extern char hackdir[]; 134#define ABORT C('a') 135#define getuid() 1 136#define getlogin() ((char *)0) 137extern void NDECL(win32_abort); 138#ifdef WIN32CON 139extern void FDECL(nttty_preference_update, (const char *)); 140extern void NDECL(toggle_mouse_support); 141extern void FDECL(map_subkeyvalue, (char *)); 142extern void NDECL(load_keyboard_handler); 143#endif 144 145#include <fcntl.h> 146#ifndef __BORLANDC__ 147#include <io.h> 148#include <direct.h> 149#else 150int _RTLENTRY _EXPFUNC access (const char _FAR *__path, int __amode); 151int _RTLENTRY _EXPFUNC _chdrive(int __drive); 152int _RTLENTRYF _EXPFUNC32 chdir( const char _FAR *__path ); 153char _FAR * _RTLENTRY _EXPFUNC getcwd( char _FAR *__buf, int __buflen ); 154int _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len); 155int _RTLENTRY _EXPFUNC creat (const char _FAR *__path, int __amode); 156int _RTLENTRY _EXPFUNC close (int __handle); 157int _RTLENTRY _EXPFUNC _close (int __handle); 158int _RTLENTRY _EXPFUNC open (const char _FAR *__path, int __access,... /*unsigned mode*/); 159long _RTLENTRY _EXPFUNC lseek (int __handle, long __offset, int __fromwhere); 160int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len); 161#endif 162#include <conio.h> 163#undef kbhit /* Use our special NT kbhit */ 164#define kbhit (*nt_kbhit) 165 166#ifdef LAN_FEATURES 167#define MAX_LAN_USERNAME 20 168#define LAN_RO_PLAYGROUND /* not implemented in 3.3.0 */ 169#define LAN_SHARED_BONES /* not implemented in 3.3.0 */ 170#include "nhlan.h" 171#endif 172 173#ifndef alloca 174#define ALLOCA_HACK /* used in util/panic.c */ 175#endif 176 177#ifndef REDO 178#undef Getchar 179#define Getchar nhgetch 180#endif 181 182#ifdef _MSC_VER 183#if 0 184#pragma warning(disable:4018) /* signed/unsigned mismatch */ 185#pragma warning(disable:4305) /* init, conv from 'const int' to 'char' */ 186#endif 187#pragma warning(disable:4761) /* integral size mismatch in arg; conv supp*/ 188#ifdef YYPREFIX 189#pragma warning(disable:4102) /* unreferenced label */ 190#endif 191#endif 192 193extern int FDECL(set_win32_option, (const char *, const char *)); 194#ifdef WIN32CON 195#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED 196#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED 197#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED 198#define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON) 199#endif /* WIN32CON */ 200 201#endif /* NTCONF_H */ 202