relocate some more outdated code

This commit is contained in:
nhmall
2020-07-05 09:27:59 -04:00
parent 62d9c49338
commit 6c0d522b1a
12 changed files with 24 additions and 59 deletions

35
outdated/include/beconf.h Normal file
View File

@@ -0,0 +1,35 @@
/* NetHack 3.6 beconf.h $NHDT-Date: 1432512783 2015/05/25 00:13:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* Copyright (c) Dean Luick 1996. */
/* NetHack may be freely redistributed. See license for details. */
/* Configuration for Be Inc.'s BeOS */
#ifndef BECONF_H
#define BECONF_H
/*
* We must use UNWIDENED_PROTOTYPES because we mix C++ and C.
*/
#define index strchr
#define rindex strrchr
#define Rand rand /* Be should have a better rand function! */
#define tgetch getchar
#define FCMASK 0666
#define PORT_ID "BeOS"
#define TEXTCOLOR
#define POSIX_TYPES
#define SIG_RET_TYPE __signal_func_ptr
#include <time.h> /* for time_t */
#include <unistd.h> /* for lseek() */
/* could go in extern.h, under bemain.c (or something..) */
void regularize(char *);
/* instead of including system.h... */
#include <string.h>
#include <stdlib.h>
#include <termcap.h>
#endif /* BECONF_H */

213
outdated/include/def_os2.h Normal file
View File

@@ -0,0 +1,213 @@
/* NetHack 3.6 def_os2.h $NHDT-Date: 1432512782 2015/05/25 00:13:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993. */
/* NetHack may be freely redistributed. See license for details. */
/*
* Only a small portion of all OS/2 defines are needed, so the
* actual include files often need not be used. In fact,
* including the full headers may stall the compile in DOS.
*/
#ifdef OS2_USESYSHEADERS
#define INCL_NOPMAPI
#define INCL_DOSFILEMGR
#define INCL_DOS
#define INCL_SUB
#include <os2.h>
#else
typedef char CHAR;
typedef void VOID;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef unsigned char BYTE;
#ifdef OS2_32BITAPI
typedef unsigned long SHANDLE;
typedef USHORT HKBD;
typedef USHORT HVIO;
#define CCHMAXPATHCOMP 256
#ifdef OS2_CSET2
#define API16 _Far16 _Pascal
#define DAT16
#define API32 _System
#define KbdGetStatus KBD16GETSTATUS
#define KbdSetStatus KBD16SETSTATUS
#define KbdCharIn KBD16CHARIN
#define KbdPeek KBD16PEEK
#define VioGetMode VIO16GETMODE
#define VioSetCurPos VIO16SETCURPOS
#else
#define API16
#define DAT16
#define API32
#endif
#define DAT
#else /* OS2_32BITAPI */
typedef unsigned short SHANDLE;
typedef SHANDLE HKBD;
typedef SHANDLE HVIO;
#define CCHMAXPATHCOMP 13
#ifdef OS2_MSC
#define API16 pascal far
#define DAT16
#endif
#define DAT DAT16
#endif /* OS2_32BITAPI */
typedef USHORT *DAT16 PUSHORT;
typedef BYTE *DAT16 PBYTE;
typedef ULONG *DAT PULONG;
typedef VOID *DAT PVOID;
typedef SHANDLE HDIR;
typedef HDIR *DAT PHDIR;
typedef char *DAT16 PCH;
typedef char *DAT PSZ;
/* all supported compilers understand this */
#pragma pack(2)
typedef struct {
UCHAR chChar;
UCHAR chScan;
UCHAR fbStatus;
UCHAR bNlsShift;
USHORT fsState;
ULONG time;
} KBDKEYINFO;
typedef KBDKEYINFO *DAT16 PKBDKEYINFO;
/* File time and date types */
typedef struct {
UINT twosecs : 5;
UINT minutes : 6;
UINT hours : 5;
} FTIME;
typedef struct {
UINT day : 5;
UINT month : 4;
UINT year : 7;
} FDATE;
#ifdef OS2_32BITAPI
typedef struct {
ULONG oNextEntryOffset;
FDATE fdateCreation;
FTIME ftimeCreation;
FDATE fdateLastAccess;
FTIME ftimeLastAccess;
FDATE fdateLastWrite;
FTIME ftimeLastWrite;
ULONG cbFile;
ULONG cbFileAlloc;
ULONG attrFile;
UCHAR cchName;
CHAR achName[CCHMAXPATHCOMP];
} FILEFINDBUF3;
#else
typedef struct {
FDATE fdateCreation;
FTIME ftimeCreation;
FDATE fdateLastAccess;
FTIME ftimeLastAccess;
FDATE fdateLastWrite;
FTIME ftimeLastWrite;
ULONG cbFile;
ULONG cbFileAlloc;
USHORT attrFile;
UCHAR cchName;
CHAR achName[CCHMAXPATHCOMP];
} FILEFINDBUF;
typedef FILEFINDBUF *DAT16 PFILEFINDBUF;
#endif /* OS2_32BITAPI */
typedef struct {
ULONG idFileSystem;
ULONG cSectorUnit;
ULONG cUnit;
ULONG cUnitAvail;
USHORT cbSector;
} FSALLOCATE;
typedef struct {
USHORT cb;
USHORT fsMask;
USHORT chTurnAround;
USHORT fsInterim;
USHORT fsState;
} KBDINFO;
typedef KBDINFO *DAT16 PKBDINFO;
typedef struct {
USHORT cb;
UCHAR fbType;
UCHAR color;
USHORT col;
USHORT row;
USHORT hres;
USHORT vres;
UCHAR fmt_ID;
UCHAR attrib;
ULONG buf_addr;
ULONG buf_length;
ULONG full_length;
ULONG partial_length;
PCH ext_data_addr;
} VIOMODEINFO;
typedef VIOMODEINFO *DAT16 PVIOMODEINFO;
#pragma pack()
/* OS2 API functions */
USHORT API16 KbdGetStatus(PKBDINFO, HKBD);
USHORT API16 KbdSetStatus(PKBDINFO, HKBD);
USHORT API16 KbdCharIn(PKBDKEYINFO, USHORT, HKBD);
USHORT API16 KbdPeek(PKBDKEYINFO, HKBD);
USHORT API16 VioGetMode(PVIOMODEINFO, HVIO);
USHORT API16 VioSetCurPos(USHORT, USHORT, HVIO);
#ifdef OS2_32BITAPI
ULONG API32 DosQueryFSInfo(ULONG, ULONG, PVOID, ULONG);
ULONG API32 DosFindFirst(PSZ, PHDIR, ULONG, PVOID, ULONG, PULONG, ULONG);
ULONG API32 DosFindNext(HDIR, PVOID, ULONG, PULONG);
ULONG API32 DosSetDefaultDisk(ULONG);
#else
USHORT API16 DosQFSInfo(USHORT, USHORT, PBYTE, USHORT);
USHORT API16
DosFindFirst(PSZ, PHDIR, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG);
USHORT API16 DosFindNext(HDIR, PFILEFINDBUF, USHORT, PUSHORT);
USHORT API16 DosSelectDisk(USHORT);
#endif /* OS2_32BITAPI */
#endif /* OS2_USESYSHEADERS */

128
outdated/include/macconf.h Normal file
View File

@@ -0,0 +1,128 @@
/* NetHack 3.6 macconf.h $NHDT-Date: 1432512782 2015/05/25 00:13:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kevin Hugo, 2004. */
/* NetHack may be freely redistributed. See license for details. */
#ifdef MAC
#ifndef MACCONF_H
#define MACCONF_H
/*
* Compiler selection is based on the following symbols:
*
* __SC__ sc, a MPW 68k compiler
* __MRC__ mrc, a MPW PowerPC compiler
* THINK_C Think C compiler
* __MWERKS__ Metrowerks' Codewarrior compiler
*
* We use these early in config.h to define some needed symbols,
* including MAC.
#
# The Metrowerks compiler defines __STDC__ (which sets NHSTC) and uses
# WIDENED_PROTOTYPES (defined if UNWIDENED_PROTOTYPES is undefined and
# NHSTDC is defined).
*/
#ifndef __powerc
#define MAC68K /* 68K mac (non-powerpc) */
#endif
#ifndef TARGET_API_MAC_CARBON
#define TARGET_API_MAC_CARBON 0
#endif
#ifndef __MACH__
#define RANDOM
#endif
#define NO_SIGNAL /* You wouldn't believe our signals ... */
#define FILENAME 256
#define NO_TERMS /* For tty port (see wintty.h) */
#define TEXTCOLOR /* For Mac TTY interface */
#define CHANGE_COLOR
/* Use these two includes instead of system.h. */
#include <string.h>
#include <stdlib.h>
/* Uncomment this line if your headers don't already define off_t */
/*typedef long off_t;*/
#include <time.h> /* for time_t */
/*
* Try and keep the number of files here to an ABSOLUTE minimum !
* include the relevant files in the relevant .c files instead !
*/
#if TARGET_API_MAC_CARBON
#ifdef GNUC
/* Avoid including <CarbonCore/fp.h> -- it has a conflicting expl() */
#define __FP__
#include <Carbon/Carbon.h>
#else
/* Avoid including <fenv.h> -- it uses GENERATINGPOWERPC */
#define __FENV__
#include <machine/types.h>
#include <Carbon.h>
#endif
#else
#include <MacTypes.h>
#endif
/*
* We could use the PSN under sys 7 here ...
* ...but it wouldn't matter...
*/
#define getpid() 1
#define getuid() 1
#define index strchr
#define rindex strrchr
#define Rand random
extern void error(const char *, ...);
#if !defined(O_WRONLY)
#if defined(__MWERKS__) && !TARGET_API_MAC_CARBON
#include <unix.h>
#endif
#include <fcntl.h>
#endif
/*
* Don't redefine these Unix IO functions when making LevComp or DgnComp for
* MPW. With MPW, we make them into MPW tools, which use unix IO. SPEC_LEV
* and DGN_COMP are defined when compiling for LevComp and DgnComp
* respectively.
*/
#if !((defined(__SC__) || defined(__MRC__) || defined(__MACH__)) \
&& (defined(SPEC_LEV) || defined(DGN_COMP)))
#define creat maccreat
#define open macopen
#define close macclose
#define read macread
#define write macwrite
#define lseek macseek
#ifdef __MWERKS__
#define unlink _unlink
#endif
#endif
#define YY_NEVER_INTERACTIVE 1
#define TEXT_TYPE 'TEXT'
#define LEVL_TYPE 'LEVL'
#define BONE_TYPE 'BONE'
#define SAVE_TYPE 'SAVE'
#define PREF_TYPE 'PREF'
#define DATA_TYPE 'DATA'
#define MAC_CREATOR 'nh31' /* Registered with DTS ! */
#define TEXT_CREATOR 'ttxt' /* Something the user can actually edit */
/*
* Define PORT_HELP to be the name of the port-specfic help file.
* This file is included into the resource fork of the application.
*/
#define PORT_HELP "MacHelp"
#define MAC_GRAPHICS_ENV
#endif /* ! MACCONF_H */
#endif /* MAC */

349
outdated/include/wceconf.h Normal file
View File

@@ -0,0 +1,349 @@
/* NetHack 3.6 wceconf.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
#ifndef WCECONF_H
#define WCECONF_H
#pragma warning(disable : 4142) /* benign redefinition of type */
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
/* Detect the target device */
#if defined(WIN32_PLATFORM_PSPC)
#if _WIN32_WCE >= 300
#define WIN_CE_POCKETPC
#else
#define WIN_CE_PS2xx
#endif
#elif defined(WIN32_PLATFORM_HPCPRO)
#define WIN_CE_HPCPRO
#elif defined(WIN32_PLATFORM_WFSP)
#define WIN_CE_SMARTPHONE
#else
#error "Unsupported Windows CE platform"
#endif
/* #define SHELL /* nt use of pcsys routines caused a hang */
#define RANDOM /* have Berkeley random(3) */
#define TEXTCOLOR /* Color text */
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
/* without first receiving confirmation. */
#define SELF_RECOVER /* Allow the game itself to recover from an aborted \
game */
#define NOTSTDC /* no strerror() */
#define USER_SOUNDS
/*
* -----------------------------------------------------------------
* The remaining code shouldn't need modification.
* -----------------------------------------------------------------
*/
/* #define SHORT_FILENAMES /* All NT filesystems support long names now
*/
#ifdef MICRO
#undef MICRO /* never define this! */
#endif
#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that \
it is defined for WIN32. \
Allow paths to be specified for HACKDIR, \
LEVELDIR, SAVEDIR, BONESDIR, DATADIR, \
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
#define NO_TERMS
#define ASCIIGRAPH
#ifdef OPTIONS_USED
#undef OPTIONS_USED
#endif
#ifdef MSWIN_GRAPHICS
#define OPTIONS_USED "guioptions"
#else
#define OPTIONS_USED "ttyoptions"
#endif
#define OPTIONS_FILE OPTIONS_USED
#define PORT_HELP "porthelp"
#define SAFERHANGUP /* Define SAFERHANGUP to delay hangup processing \
* until the main command loop. 'safer' because it \
* avoids certain cheats and also avoids losing \
* objects being thrown when the hangup occurs. \
*/
#if defined(WIN_CE_POCKETPC)
#define PORT_CE_PLATFORM "Pocket PC"
#elif defined(WIN_CE_PS2xx)
#define PORT_CE_PLATFORM "Palm-size PC 2.11"
#elif defined(WIN_CE_HPCPRO)
#define PORT_CE_PLATFORM "H/PC Pro 2.11"
#elif defined(WIN_CE_SMARTPHONE)
#define PORT_CE_PLATFORM "Smartphone 2002"
#endif
#if defined(ARM)
#define PORT_CE_CPU "ARM"
#elif defined(PPC)
#define PORT_CE_CPU "PPC"
#elif defined(ALPHA)
#define PORT_CE_CPU "ALPHA"
#elif defined(SH3)
#define PORT_CE_CPU "SH3"
#elif defined(SH4)
#define PORT_CE_CPU "SH4"
#elif defined(MIPS)
#define PORT_CE_CPU "MIPS"
#elif defined(X86) || defined(_X86_)
#define PORT_CE_CPU "X86"
#else
#error Only ARM, PPC, ALPHA, SH3, SH4, MIPS and X86 supported
#endif
#define RUNTIME_PORT_ID /* trigger run-time port identification since \
Makedefs is bootstrapped on a cross-platform. */
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
#ifdef STRNCMPI
#define strncmpi(a, b, c) _strnicmp(a, b, c)
#endif
#ifdef STRCMPI
#define strcmpi(a, b) _stricmp(a, b)
#define stricmp(a, b) _stricmp(a, b)
#endif
#include <stdlib.h>
#define PATHLEN BUFSZ /* maximum pathlength */
#define FILENAME BUFSZ /* maximum filename length (conservative) */
#if defined(_MAX_PATH) && defined(_MAX_FNAME)
#if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
#undef PATHLEN
#undef FILENAME
#define PATHLEN _MAX_PATH
#define FILENAME _MAX_FNAME
#endif
#endif
#define NO_SIGNAL
#define index strchr
#define rindex strrchr
#define USE_STDARG
/* Use the high quality random number routines. */
#ifndef USE_ISAAC64
# ifdef RANDOM
# define Rand() random()
# else
# define Rand() rand()
# endif
#endif
#define FCMASK 0660 /* file creation mask */
#define regularize nt_regularize
#define HLOCK "NHPERM"
#ifndef M
#define M(c) ((char) (0x80 | (c)))
/* #define M(c) ((c) - 128) */
#endif
#ifndef C
#define C(c) (0x1f & (c))
#endif
#if defined(DLB)
#define FILENAME_CMP _stricmp /* case insensitive */
#endif
#if 0
extern char levels[], bones[], permbones[],
#endif /* 0 */
/* this was part of the MICRO stuff in the past */
extern const char *alllevels, *allbones;
extern char hackdir[];
#define ABORT C('a')
#define getuid() 1
#define getlogin() ((char *) 0)
extern void NDECL(win32_abort);
#ifdef WIN32CON
extern void FDECL(nttty_preference_update, (const char *));
extern void NDECL(toggle_mouse_support);
#endif
#ifndef alloca
#define ALLOCA_HACK /* used in util/panic.c */
#endif
#ifdef _MSC_VER
#if 0
#pragma warning(disable : 4018) /* signed/unsigned mismatch */
#pragma warning(disable : 4305) /* init, conv from 'const int' to 'char' */
#endif
#pragma warning(disable : 4761) /* integral size mismatch in arg; conv \
supp*/
#ifdef YYPREFIX
#pragma warning(disable : 4102) /* unreferenced label */
#endif
#endif
/* UNICODE stuff */
#define NHSTR_BUFSIZE 255
#ifdef UNICODE
#define NH_W2A(w, a, cb) \
(WideCharToMultiByte(CP_ACP, 0, (w), -1, (a), (cb), NULL, NULL), (a))
#define NH_A2W(a, w, cb) \
(MultiByteToWideChar(CP_ACP, 0, (a), -1, (w), (cb)), (w))
#else
#define NH_W2A(w, a, cb) (strncpy((a), (w), (cb)))
#define NH_A2W(a, w, cb) (strncpy((w), (a), (cb)))
#endif
extern int FDECL(set_win32_option, (const char *, const char *));
/*
* 3.4.3 addition - Stuff to help the user with some common, yet significant
* errors
* Let's make it NOP for now
*/
#define interject_assistance(_1, _2, _3, _4)
#define interject(_1)
/* Missing definitions */
extern int mswin_have_input();
#define kbhit mswin_have_input
#define getenv(a) ((char *) NULL)
/* __stdio.h__ */
#define perror(a)
#define freopen(a, b, c) fopen(a, b)
extern int isatty(int);
/* __time.h___ */
#ifndef _TIME_T_DEFINED
typedef __int64 time_t; /* time value */
#define _TIME_T_DEFINED /* avoid multiple def's of time_t */
#endif
#ifndef _TM_DEFINED
struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag - - NOT IMPLEMENTED */
};
#define _TM_DEFINED
#endif
extern struct tm *__cdecl localtime(const time_t *);
extern time_t __cdecl time(time_t *);
extern time_t __cdecl mktime(struct tm *tb);
/* __stdio.h__ */
#ifndef BUFSIZ
#define BUFSIZ 255
#endif
#define rewind(stream) (void) fseek(stream, 0L, SEEK_SET)
/* __io.h__ */
typedef long off_t;
extern int __cdecl close(int);
extern int __cdecl creat(const char *, int);
extern int __cdecl eof(int);
extern long __cdecl lseek(int, long, int);
extern int __cdecl open(const char *, int, ...);
extern int __cdecl read(int, void *, unsigned int);
extern int __cdecl unlink(const char *);
extern int __cdecl write(int, const void *, unsigned int);
extern int __cdecl rename(const char *, const char *);
extern int __cdecl access(const char *, int);
#ifdef DeleteFile
#undef DeleteFile
#endif
#define DeleteFile(a) unlink(a)
int chdir(const char *dirname);
extern char *getcwd(char *buffer, int maxlen);
/* __stdlib.h__ */
#define abort() (void) TerminateProcess(GetCurrentProcess(), 0)
#ifndef strdup
#define strdup _strdup
#endif
/* sys/stat.h */
#define S_IWRITE GENERIC_WRITE
#define S_IREAD GENERIC_READ
/* CE 2.xx is missing even more stuff */
#if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO)
#define ZeroMemory(p, s) memset((p), 0, (s))
extern int __cdecl isupper(int c);
extern int __cdecl isdigit(int c);
extern int __cdecl isspace(int c);
extern int __cdecl isprint(int c);
extern char *__cdecl _strdup(const char *s);
extern char *__cdecl strrchr(const char *string, int c);
extern int __cdecl _stricmp(const char *a, const char *b);
extern FILE *__cdecl fopen(const char *filename, const char *mode);
extern int __cdecl fscanf(FILE *f, const char *format, ...);
extern int __cdecl fprintf(FILE *f, const char *format, ...);
extern int __cdecl vfprintf(FILE *f, const char *format, va_list args);
extern int __cdecl fgetc(FILE *f);
extern char *__cdecl fgets(char *s, int size, FILE *f);
extern int __cdecl printf(const char *format, ...);
extern int __cdecl vprintf(const char *format, va_list args);
extern int __cdecl puts(const char *s);
extern FILE *__cdecl _getstdfilex(int desc);
extern int __cdecl fclose(FILE *f);
extern size_t __cdecl fread(void *p, size_t size, size_t count, FILE *f);
extern size_t __cdecl fwrite(const void *p, size_t size, size_t count,
FILE *f);
extern int __cdecl fflush(FILE *f);
extern int __cdecl feof(FILE *f);
extern int __cdecl fseek(FILE *f, long offset, int from);
extern long __cdecl ftell(FILE *f);
#endif
/* ARM - the processor; avoids conflict with ARM in hack.h */
#ifdef ARM
#undef ARM
#endif
/* leave - Windows CE defines leave as part of exception handling (__leave)
It conflicts with existing sources and since we don't use exceptions it is
safe
to undefine it */
#ifdef leave
#undef leave
#endif
#endif /* WCECONF_H */