* @(#)extern.h 2.4 84/02/23
#define die() ((rand() >> 3) % 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)
#define fouled(a) ((a)->file->nfoul)
#define snagged(a) (grappled(a) + fouled(a))
#define grappled2(a, b) ((a)->file->grap[(b)->file->index].sn_count)
#define fouled2(a, b) ((a)->file->foul[(b)->file->index].sn_count)
#define snagged2(a, b) (grappled2(a, b) + fouled2(a, b))
#define Xgrappled2(a, b) ((a)->file->grap[(b)->file->index].sn_turn < turn-1 ? grappled2(a, b) : 0)
#define Xfouled2(a, b) ((a)->file->foul[(b)->file->index].sn_turn < turn-1 ? fouled2(a, b) : 0)
#define Xsnagged2(a, b) (Xgrappled2(a, b) + Xfouled2(a, b))
#define cleangrapple(a, b, c) Cleansnag(a, b, c, 1)
#define cleanfoul(a, b, c) Cleansnag(a, b, c, 2)
#define cleansnag(a, b, c) Cleansnag(a, b, c, 3)
#define sterncolour(sp) ((sp)->file->stern+'0'-((sp)->file->captured?10:0))
#define sternrow(sp) ((sp)->file->row + dr[(sp)->file->dir])
#define sterncol(sp) ((sp)->file->col + dc[(sp)->file->dir])
#define capship(sp) ((sp)->file->captured?(sp)->file->captured:(sp))
#define readyname(r) ((r) & R_LOADING ? '*' : ((r) & R_INITIAL ? '!' : ' '))
/* loadL and loadR, should match loadname[] */
#define L_EMPTY 0 /* should be 0, don't change */
* readyL and readyR, these are bits, except R_EMPTY
#define R_EMPTY 0 /* not loaded and not loading */
#define R_LOADING 1 /* loading */
#define R_DOUBLE 2 /* loading double */
#define R_LOADED 4 /* loaded */
#define R_INITIAL 8 /* loaded initial */
char captain
[20]; /* 0 */
struct BP OBP
[NBP
]; /* 30 */
struct BP DBP
[NBP
]; /* 48 */
struct ship
*captured
; /* 68 */
char movebuf
[10]; /* 72 */
struct snag foul
[NSHIP
]; /* 84 */
struct snag grap
[NSHIP
]; /* 124 */
struct shipspecs
*specs
; /* 2 */
char nationality
; /* 4 */
struct File
*file
; /* 12 */
struct ship ship
[NSHIP
]; /* 16 */
struct shipspecs specs
[];
struct scenario
*cc
; /* the current scenario */
struct ship
*ls
; /* &cc->ship[cc->vessels] */
#define SHIP(s) (&cc->ship[s])
#define foreachship(sp) for ((sp) = cc->ship; (sp) < ls; (sp)++)
struct windeffects WET
[7][6];
struct Tables RigTable
[11][6];
struct Tables HullTable
[11][6];
struct ship
*closestenemy();