-/* $NetBSD: extern.h,v 1.16 2000/11/30 22:02:20 jwise Exp $ */
+/* $NetBSD: extern.h,v 1.24 2001/01/04 06:16:51 jwise Exp $ */
/*
* Copyright (c) 1983, 1993
* @(#)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;
extern gid_t egid;
-#define dieroll() ((rand() >> 3) % 6 + 1)
+#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))
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 unfoul (void);
void boardcomp (void);
-int fightitout (struct ship *, struct ship *, int);
void resolve (void);
void compcombat (void);
int next (void);
void thinkofgrapples (void);
void checkup (void);
void prizecheck (void);
-int str_end (const char *);
-void closeon (struct ship *, struct ship *, char[], int, int, int);
-int score (char[], struct ship *, struct ship *, int);
-void move_ship (const char *, struct ship *, unsigned char *, short *, short *, char *);
-void try (char[], char [], int, int, int, int, int, struct ship *,
- struct ship *, int *, int);
-void rmend (char *);
+void closeon (struct ship *, struct ship *, char *, int, int, int);
/* dr_3.c */
void moveall (void);
-int stillmoving (int);
-int is_isolated (struct ship *);
-int push (struct ship *, struct ship *);
-void step (int, struct ship *, char *);
void sendbp (struct ship *, struct ship *, int, int);
int is_toughmelee (struct ship *, struct ship *, int, int);
void reload (void);
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);