Add absent prototypes to some core routines.
Also add some port function() to function(void) in some win32 routines.
Also updates the Borland C Makefile for win32.
int _RTLENTRY _EXPFUNC creat (const char _FAR *__path, int __amode);
int _RTLENTRY _EXPFUNC close (int __handle);
int _RTLENTRY _EXPFUNC open (const char _FAR *__path, int __access,... /*unsigned mode*/);
+long _RTLENTRY _EXPFUNC lseek (int __handle, long __offset, int __fromwhere);
+int _RTLENTRY _EXPFUNC read (int __handle, void _FAR *__buf, unsigned __len);
#endif
#include <conio.h>
#undef kbhit /* Use our special NT kbhit */
# define FDECL(f,p) f()
# define VDECL(f,p) f()
-# if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) || defined(__DECC)
+# if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) || defined(__DECC) || defined(__BORLANDC__)
# define genericptr void *
# endif
# ifndef genericptr
STATIC_DCL void FDECL(use_figurine, (struct obj *));
STATIC_DCL void FDECL(use_grease, (struct obj *));
STATIC_DCL void FDECL(use_trap, (struct obj *));
+STATIC_DCL void FDECL(use_stone, (struct obj *));
STATIC_PTR int NDECL(set_trap); /* occupation callback */
STATIC_DCL int FDECL(use_whip, (struct obj *));
STATIC_DCL int FDECL(use_pole, (struct obj *));
STATIC_DCL int FDECL(throw_obj, (struct obj *,int));
STATIC_DCL void NDECL(autoquiver);
STATIC_DCL int FDECL(gem_accept, (struct monst *, struct obj *));
+STATIC_DCL void FDECL(tmiss, (struct obj *, struct monst *));
STATIC_DCL int FDECL(throw_gold, (struct obj *));
STATIC_DCL void FDECL(check_shop_obj, (struct obj *,XCHAR_P,XCHAR_P,BOOLEAN_P));
STATIC_DCL void FDECL(breakobj, (struct obj *,XCHAR_P,XCHAR_P,BOOLEAN_P,BOOLEAN_P));
#ifdef SINKS
STATIC_DCL void NDECL(dosinkfall);
#endif
+STATIC_DCL void NDECL(findtravelpath);
STATIC_DCL boolean FDECL(monstinroom, (struct permonst *,int));
STATIC_DCL void FDECL(move_update, (BOOLEAN_P));
#ifdef OVLB
static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P));
#endif
+static void FDECL(add_erosion_words, (struct obj*, char*));
struct Jitem {
int item;
STATIC_DCL int NDECL(in_trouble);
STATIC_DCL void FDECL(fix_worst_trouble,(int));
STATIC_DCL void FDECL(angrygods,(ALIGNTYP_P));
+STATIC_DCL void FDECL(at_your_feet, (const char *));
#ifdef ELBERETH
STATIC_DCL void NDECL(gcrownu);
#endif /*ELBERETH*/
{"evil", "unaligned", "Una", 0, A_NONE}
};
+STATIC_DCL char * FDECL(promptsep, (char *, int));
STATIC_DCL int FDECL(role_gendercount, (int));
STATIC_DCL int FDECL(race_alignmentcount, (int));
S_QUADRUPED, S_UNICORN, S_ANGEL, S_CENTAUR, S_DRAGON, S_JABBERWOCK, '\0'
};
+STATIC_DCL boolean FDECL(landing_spot, (coord*, int));
/*** Putting the saddle on ***/
STATIC_DCL void FDECL(insert_timer, (timer_element *));
STATIC_DCL timer_element *FDECL(remove_timer, (timer_element **, SHORT_P,
genericptr_t));
+STATIC_DCL void FDECL(write_timer, (int, timer_element*));
STATIC_DCL boolean FDECL(mon_is_local, (struct monst *));
STATIC_DCL boolean FDECL(timer_is_local, (timer_element *));
STATIC_DCL int FDECL(maybe_write_timer, (int, int, BOOLEAN_P));
STATIC_DCL boolean FDECL(can_advance, (int, BOOLEAN_P));
STATIC_DCL int FDECL(slots_required, (int));
+STATIC_DCL void FDECL(give_may_advance_msg, (int));
#ifdef OVL1
static struct stat hbuf;
# endif
+#ifdef PC_LOCKING
+static int NDECL(eraseoldlocks);
+#endif
+
void
gethdate(name)
char *name;
-# SCCS Id: @(#)Makefile.bcc 3.4 2002/01/23
+# SCCS Id: @(#)Makefile.bcc 3.4 2002/02/04
# Copyright (c) NetHack PC Development Team 1993-2002
#
-# NetHack 3.4.x Makefile for Borland C++ V5.5 and above and Borland's MAKE
+# NetHack 3.4.x Makefile for Borland C++ V5.5.1 and above and Borland's MAKE
#
# Win32 Compilers Tested:
# - Borland C++ 5.5.1 for Win32
# root, but this can be changed by modifying the bccroot and related
# variables.
#
-# This is used for building a TTY or graphical version of NetHack using
+# This is used for building a TTY or graphical version of NetHack using
# WIN32 Console I/O and API routines only.
#
# In addition to your C compiler,
#
-# if you want to change you will need a
+# if you want to change you will need a
# files with suffix workalike for
-# .y yacc (such as bison)
+# .y yacc (such as bison)
# .l lex (such as flex)
#
#
# Graphical interface
# Set to Y for a graphical version
+# Set to anything else (or undefine) for a tty version
-GRAPHICAL = Y
+#GRAPHICAL = Y
+
+# Debug
+# Set to Y for Debug support (to produce full map files, listing files, and debug information)
+# Set to anything else (or undefine) for a "release" version
+
+DEBUG = Y
!IF "$(APPVER)" == "4.0"
MAKE_WINVER = 0x0400
link = $(bccbin)\ilink32
implib = $(bccbin)\tlib
-cflags = -c -D_X86_=1 -DWINVER=$(MAKE_WINVER) -q -I$(bccinc) -w-pia -w-rch
+cflags = -c -D_X86_=1 -DWINVER=$(MAKE_WINVER) -q -I$(bccinc) -w-pia -w-rch -w-par -w-aus
cdebug = -y -v -O2
cvarsmt = -DWIN32 -D_WIN32 -D_MT
lflags =
+!IF "$(DEBUG)" == "Y"
linkdebug = /v /m /s
+cdebug = -v -y -Q
+!ELSE
+linkdebug = /C /Gn
+cdebug =
+!ENDIF
startobj = $(bcclib)\c0x32.obj
!IF "$(GRAPHICAL)" == "Y"
verlflags = /Gn /Gz /q -L$(bcclib) /c /Tpe /V$(APPVER)
# It must be present prior to compilation.
GAME = NetHack # Game Name
-!IF "$(GRAPHICAL)" == "Y"
-GAMEDIR = \games\nethackwin # Game directory
-!ELSE
-GAMEDIR = \games\nethacktty # Game directory
-!ENDIF
+GAMEDIR = ..\binary # Game directory
#
# Source directories. Makedefs hardcodes these, don't change them.
GAMEFILE = $(GAMEDIR)\$(GAME).exe
-#==========================================
-# Create directory for holding object files
-#==========================================
-
-$(O)obj.tag:
- @if not exist $(O)*.* mkdir $(OBJ)
- @echo directory $(OBJ) created >$@
-
-#==========================================
-# Notify of any CL environment variables
-# in effect since they change the compiler
-# options.
-#==========================================
-
-graphicschk:
-! IF "$(GRAPHICAL)"=="Y"
- @echo ----
- @echo NOTE: This build will include tile support.
- @echo ----
-! ENDIF
- @echo graphicschk > graphicschk
-
#==========================================
#=============== TARGETS ==================
#==========================================
@if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
-copy $(NTSYS)\winnt.cnf $(GAMEDIR)\defaults.nh
copy $(U)recover.exe $(GAMEDIR)
-! IF ("$(GRAPHICAL)"=="Y")
- if exist $(TILEBMP) copy $(TILEBMP) $(GAMEDIR)
-! ENDIF
echo install done > $@
# copy $(NTSYS)\winnt.hlp $(GAMEDIR)
$(GAME)_.ico : $(NTSYS)\$(GAME).ico
@copy $(NTSYS)\$(GAME).ico $@
+
+#==========================================
+# Create directory for holding object files
+#==========================================
+
+$(O)obj.tag:
+ @if not exist $(O)*.* mkdir $(OBJ)
+ @echo directory $(OBJ) created >$@
+
+#==========================================
+# Notify of any CL environment variables
+# in effect since they change the compiler
+# options.
+#==========================================
+
+graphicschk:
+! IF "$(GRAPHICAL)"=="Y"
+ @echo ----
+ @echo NOTE: This build will include tile support.
+ @echo ----
+! ENDIF
+ @echo graphicschk > graphicschk
+
#
# Secondary Targets.
#
clear_screen();
if (GetConsoleScreenBufferInfo(hConOut,&csbi))
{
- int ccnt;
+ DWORD ccnt;
COORD newcoord;
newcoord.X = 0;
nttty_open()
{
HANDLE hStdOut;
- long cmode;
+ DWORD cmode;
long mask;
/* Initialize the function pointer that points to
#define inmap(x) (SCANLO <= (x) && (x) < SCANLO + SIZE(scanmap))
+int FDECL(process_keystroke, (INPUT_RECORD *ir, boolean *valid));
+
int process_keystroke(ir, valid)
INPUT_RECORD *ir;
boolean *valid;
int
tgetch()
{
- int count;
- int valid = 0;
+ DWORD count;
+ boolean valid = 0;
int ch;
valid = 0;
while (!valid)
ntposkey(x, y, mod)
int *x, *y, *mod;
{
- int count;
+ DWORD count;
unsigned short int scan;
unsigned char ch;
unsigned long shiftstate;
int altseq;
int done = 0;
- int valid = 0;
+ boolean valid = 0;
while (!done)
{
count = 0;
{
int done = 0; /* true = "stop searching" */
int retval; /* true = "we had a match" */
- int count;
+ DWORD count;
unsigned short int scan;
unsigned char ch;
unsigned long shiftstate;
xputc(c)
char c;
{
- int count;
+ DWORD count;
if (colorchange) {
SetConsoleTextAttribute(hConOut,
xputs(s)
const char *s;
{
- int count;
+ DWORD count;
if (colorchange) {
SetConsoleTextAttribute(hConOut,
(currentcolor | currenthilite | currentbackground));
int in_ch;
{
char ch = (char)in_ch;
- int count = 1;
+ DWORD count = 1;
int tcolor;
int bckgnd = currentbackground;
void
cl_end()
{
- int count;
+ DWORD count;
ntcoord.X = ttyDisplay->curx;
ntcoord.Y = ttyDisplay->cury;
clear_screen()
{
if (GetConsoleScreenBufferInfo(hConOut,&csbi)) {
- int ccnt;
+ DWORD ccnt;
COORD newcoord;
newcoord.X = 0;
nt_regularize(s) /* normalize file name */
register char *s;
{
- register char *lp;
+ register unsigned char *lp;
for (lp = s; *lp; lp++)
if ( *lp == '?' || *lp == '"' || *lp == '\\' ||
char *get_username(lan_username_size)
int *lan_username_size;
{
- static char username_buffer[BUFSZ];
+ static TCHAR username_buffer[BUFSZ];
unsigned int status;
- int i = 0;
+ DWORD i = BUFSZ - 1;
- i = BUFSZ - 1;
/* i gets updated with actual size */
status = GetUserName(username_buffer, &i);
if (status) username_buffer[i] = '\0';
for(j=0;j<pt->ysize;j++) {
if(!maze->init_lev.init_present ||
pt->xsize > 1 || pt->ysize > 1) {
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(__BORLANDC__)
Write(fd, pt->map[j], pt->xsize * sizeof *pt->map[j]);
#else
/*
- * On MSVC compiler the Write macro above caused:
+ * On MSVC and Borland C compilers the Write macro above caused:
* warning '!=' : signed/unsigned mismatch
*/
unsigned reslt, sz = pt->xsize * sizeof *pt->map[j];
static int nhi_write_pos = 0;
/* initialize input queue */
-void mswin_nh_input_init()
+void mswin_nh_input_init(void)
{
if( !nhi_init_input ) {
nhi_init_input = 1;
#define NHEVENT_KBD(c) { MSNHEvent e; e.type=NHEVENT_CHAR; e.kbd.ch=(c); mswin_input_push(&e); }
#define NHEVENT_MS(_mod, _x, _y) { MSNHEvent e; e.type=NHEVENT_MOUSE; e.ms.mod = (_mod); e.ms.x=(_x); e.ms.y=(_y); mswin_input_push(&e); }
-void mswin_nh_input_init();
-int mswin_have_input();
+void mswin_nh_input_init(void);
+int mswin_have_input(void);
void mswin_input_push(PMSNHEvent event);
-PMSNHEvent mswin_input_pop();
-PMSNHEvent mswin_input_peek();
+PMSNHEvent mswin_input_pop(void);
+PMSNHEvent mswin_input_peek(void);
#endif /* MSWINInput_h */
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
static LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
-static void register_main_window_class();
+static void register_main_window_class(void);
static void select_map_mode(int map_mode);
static int menuid2mapmode(int menuid);
static int mapmode2menuid(int map_mode);
#define NHWND_ALIGN_TOP 2
#define NHWND_ALIGN_BOTTOM 3
-HWND mswin_init_main_window ();
+HWND mswin_init_main_window (void);
void mswin_layout_main_window(HWND changed_child);
#endif /* MSWINMainWindow_h */
static TCHAR szNHMapWindowClass[] = TEXT("MSNethackMapWndClass");
LRESULT CALLBACK MapWndProc(HWND, UINT, WPARAM, LPARAM);
-static void register_map_window_class();
+static void register_map_window_class(void);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam);
#include "global.h"
-HWND mswin_init_map_window ();
+HWND mswin_init_map_window (void);
void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw);
#define NHMAP_VIEW_TILES 0
static TCHAR szMessageWindowClass[] = TEXT("MSNHMessageWndClass");
LRESULT CALLBACK NHMessageWndProc(HWND, UINT, WPARAM, LPARAM);
-static void register_message_window_class();
+static void register_message_window_class(void);
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam);
#ifndef MSG_WRAP_TEXT
#include "config.h"
#include "global.h"
-HWND mswin_init_message_window ();
+HWND mswin_init_message_window (void);
void mswin_message_window_size (HWND hWnd, LPSIZE sz);
#include "config.h"
#include "global.h"
-HWND mswin_init_RIP_window ();
+HWND mswin_init_RIP_window (void);
void mswin_display_RIP_window (HWND hwnd);
#endif /* MSWINRIPWindow_h */
static TCHAR szStatusWindowClass[] = TEXT("MSNHStatusWndClass");
LRESULT CALLBACK StatusWndProc(HWND, UINT, WPARAM, LPARAM);
-static void register_status_window_class();
+static void register_status_window_class(void);
HWND mswin_init_status_window () {
static int run_once = 0;
#include "config.h"
#include "global.h"
-HWND mswin_init_status_window ();
+HWND mswin_init_status_window (void);
void mswin_status_window_size (HWND hWnd, LPSIZE sz);
#endif /* MSWINStatusWindow_h */
#include "config.h"
#include "global.h"
-HWND mswin_init_text_window ();
+HWND mswin_init_text_window (void);
void mswin_display_text_window (HWND hwnd);
#endif /* MSWINTextWindow_h */
void logDebug(const char *fmt, ...) { }
#endif
-static void mswin_main_loop();
+static void mswin_main_loop(void);
/* Interface definition, for windows.c */
struct window_procs mswin_procs = {
char* saved_text;
} NHWinApp, *PNHWinApp;
-extern PNHWinApp GetNHApp();
#define E extern
+E PNHWinApp GetNHApp(void);
E struct window_procs mswin_procs;
#undef E