-/* $NetBSD: extern.h,v 1.19 2001/01/04 01:53:24 jwise Exp $ */
+/* $NetBSD: extern.h,v 1.28 2006/03/18 01:43:52 abs Exp $ */
/*
* Copyright (c) 1983, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* @(#)externs.h 8.1 (Berkeley) 5/31/93
*/
-#include <stdio.h>
-#include <signal.h>
-#include <string.h>
-#include <ctype.h>
-#include <setjmp.h>
#include <sys/types.h>
+
#include "machdep.h"
/* program mode */
extern int mode;
-extern jmp_buf restart;
#define MODE_PLAYER 1
#define MODE_DRIVER 2
#define MODE_LOGGER 3
/* command line flags */
-extern char debug; /* -D */
-extern char randomize; /* -x, give first available ship */
-extern char longfmt; /* -l, print score in long format */
-extern char nobells; /* -b, don't ring bell before Signal */
+extern int randomize; /* -x, give first available ship */
+extern int longfmt; /* -l, print score in long format */
+extern int nobells; /* -b, don't ring bell before Signal */
/* other initial modes */
extern gid_t gid;
#define dieroll() ((random()) % 6 + 1)
#define sqr(a) ((a) * (a))
-#define abs(a) ((a) > 0 ? (a) : -(a))
#define min(a,b) ((a) < (b) ? (a) : (b))
#define grappled(a) ((a)->file->ngrap)
};
struct BP {
- short turnsent;
struct ship *toship;
+ short turnsent;
short mensent;
};
extern int game;
extern int alive;
extern int people;
-extern char hasdriver;
+extern int hasdriver;
/* assorted.c */
-void table (int, int, int, struct ship *, struct ship *, int);
+void table (struct ship *, struct ship *, int, int, int, int);
void Cleansnag (struct ship *, struct ship *, int, int);
/* dr_1.c */
void grap (struct ship *, struct ship *);
/* dr_5.c */
-void subtract (struct ship *, int, int [3], struct ship *, int);
+void subtract (struct ship *, struct ship *, int, int [3], int);
int mensent (struct ship *, struct ship *, int[3], struct ship **, int *,
int);
/* misc.c */
int range (struct ship *, struct ship *);
struct ship *closestenemy (struct ship *, int, int);
-int angle (int, int);
int gunsbear (struct ship *, struct ship *);
int portside (struct ship *, struct ship *, int);
int colours (struct ship *);
/* pl_5.c */
void acceptmove (void);
void acceptboard (void);
-void parties (int[3], struct ship *, int, int);
/* pl_6.c */
void repair (void);
-int turned (void);
void loadplayer (void);
/* pl_7.c */
__attribute__((__format__(__printf__,1,3)));
void Msg (const char *, ...)
__attribute__((__format__(__printf__,1,2)));
-void Scroll (void);
void prompt (const char *, struct ship *);
-void endprompt (int);
int sgetch (const char *, struct ship *, int);
void sgetstr (const char *, char *, int);
void draw_screen (void);
void downview (void);
void leftview (void);
void rightview (void);
-void adjustview (void);
/* pl_main.c */
int pl_main (void);
-void initialize (void);
/* sync.c */
void fmtship (char *, size_t, const char *, struct ship *);
void Write (int, struct ship *, long, long, long, long);
void Writestr (int, struct ship *, const char *);
int Sync (void);
-int sync_update (int, struct ship *, const char *, long, long, long, long);