diff options
-rw-r--r-- | games/sail/extern.h | 36 | ||||
-rw-r--r-- | games/sail/globals.c | 25 | ||||
-rw-r--r-- | games/sail/pl_7.c | 20 | ||||
-rw-r--r-- | games/sail/player.h | 30 | ||||
-rw-r--r-- | games/tetris/screen.h | 6 | ||||
-rw-r--r-- | games/tetris/tetris.c | 12 | ||||
-rw-r--r-- | games/tetris/tetris.h | 20 |
7 files changed, 98 insertions, 51 deletions
diff --git a/games/sail/extern.h b/games/sail/extern.h index df1efb84510..e239cb3cccc 100644 --- a/games/sail/extern.h +++ b/games/sail/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.2 1999/01/18 21:53:22 pjanzen Exp $ */ +/* $OpenBSD: extern.h,v 1.3 2000/01/03 23:22:41 pjanzen Exp $ */ /* $NetBSD: extern.h,v 1.8 1998/09/13 15:27:30 hubertf Exp $ */ /* @@ -49,21 +49,21 @@ #endif /* program mode */ -int mode; -jmp_buf restart; +extern int mode; +extern jmp_buf restart; #define MODE_PLAYER 1 #define MODE_DRIVER 2 #define MODE_LOGGER 3 /* command line flags */ -char debug; /* -D */ -char randomize; /* -x, give first available ship */ -char longfmt; /* -l, print score in long format */ -char nobells; /* -b, don't ring bell before Signal */ +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 */ /* other initial modes */ -gid_t gid; -gid_t egid; +extern gid_t gid; +extern gid_t egid; #define die() ((random() >> 3) % 6 + 1) #define sqr(a) ((a) * (a)) @@ -264,8 +264,8 @@ struct shipspecs { }; extern struct shipspecs specs[]; -struct scenario *cc; /* the current scenario */ -struct ship *ls; /* &cc->ship[cc->vessels] */ +extern struct scenario *cc; /* the current scenario */ +extern struct ship *ls; /* &cc->ship[cc->vessels] */ #define SHIP(s) (&cc->ship[s]) #define foreachship(sp) for ((sp) = cc->ship; (sp) < ls; (sp)++) @@ -297,13 +297,13 @@ extern const char rangeofshot[]; extern const char dr[], dc[]; -int winddir; -int windspeed; -int turn; -int game; -int alive; -int people; -char hasdriver; +extern int winddir; +extern int windspeed; +extern int turn; +extern int game; +extern int alive; +extern int people; +extern char hasdriver; /* assorted.c */ void table __P((int, int, int, struct ship *, struct ship *, int)); diff --git a/games/sail/globals.c b/games/sail/globals.c index ce09b9476ca..15e46ebac01 100644 --- a/games/sail/globals.c +++ b/games/sail/globals.c @@ -1,4 +1,4 @@ -/* $OpenBSD: globals.c,v 1.4 1999/01/18 06:20:52 pjanzen Exp $ */ +/* $OpenBSD: globals.c,v 1.5 2000/01/03 23:22:41 pjanzen Exp $ */ /* $NetBSD: globals.c,v 1.4 1995/04/22 10:36:57 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: globals.c,v 1.4 1999/01/18 06:20:52 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: globals.c,v 1.5 2000/01/03 23:22:41 pjanzen Exp $"; #endif #endif /* not lint */ @@ -547,3 +547,24 @@ const char loadname[] = { '-', 'G', 'C', 'R', 'D', 'E' }; const char dr[] = { 0, 1, 1, 0, -1, -1, -1, 0, 1 }; const char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 }; + +int mode; +jmp_buf restart; + +char debug; /* -D */ +char randomize; /* -x, give first available ship */ +char longfmt; /* -l, print score in long format */ +char nobells; /* -b, don't ring bell before Signal */ + +gid_t gid, egid; + +struct scenario *cc; /* the current scenario */ +struct ship *ls; /* &cc->ship[cc->vessels] */ + +int winddir; +int windspeed; +int turn; +int game; +int alive; +int people; +char hasdriver; diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index cda98867c30..87032aacb48 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pl_7.c,v 1.2 1999/01/18 06:20:53 pjanzen Exp $ */ +/* $OpenBSD: pl_7.c,v 1.3 2000/01/03 23:22:41 pjanzen Exp $ */ /* $NetBSD: pl_7.c,v 1.6 1995/04/22 10:37:17 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)pl_7.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: pl_7.c,v 1.2 1999/01/18 06:20:53 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: pl_7.c,v 1.3 2000/01/03 23:22:41 pjanzen Exp $"; #endif #endif /* not lint */ @@ -62,6 +62,22 @@ static const char *sc_prompt; static const char *sc_buf; static int sc_line; +WINDOW *view_w; +WINDOW *slot_w; +WINDOW *scroll_w; +WINDOW *stat_w; +WINDOW *turn_w; + +char done_curses; +char loaded, fired, changed, repaired; +char dont_adjust; +int viewrow, viewcol; +char movebuf[sizeof SHIP(0)->file->movebuf]; +int player; +struct ship *ms; /* memorial structure, &cc->ship[player] */ +struct File *mf; /* ms->file */ +struct shipspecs *mc; /* ms->specs */ + void initscreen() { diff --git a/games/sail/player.h b/games/sail/player.h index 8fb605218e2..65c958f1211 100644 --- a/games/sail/player.h +++ b/games/sail/player.h @@ -1,4 +1,4 @@ -/* $OpenBSD: player.h,v 1.5 1999/01/18 06:20:53 pjanzen Exp $ */ +/* $OpenBSD: player.h,v 1.6 2000/01/03 23:22:41 pjanzen Exp $ */ /* $NetBSD: player.h,v 1.4 1995/04/22 10:37:22 cgd Exp $ */ /* @@ -99,22 +99,22 @@ #define SCREENTEST() (initscr() != NULL && STAT_R < COLS && SCROLL_Y > 0) #endif -WINDOW *view_w; -WINDOW *slot_w; -WINDOW *scroll_w; -WINDOW *stat_w; -WINDOW *turn_w; +extern WINDOW *view_w; +extern WINDOW *slot_w; +extern WINDOW *scroll_w; +extern WINDOW *stat_w; +extern WINDOW *turn_w; -char done_curses; -char loaded, fired, changed, repaired; -char dont_adjust; -int viewrow, viewcol; -char movebuf[sizeof SHIP(0)->file->movebuf]; +extern char done_curses; +extern char loaded, fired, changed, repaired; +extern char dont_adjust; +extern int viewrow, viewcol; +extern char movebuf[sizeof SHIP(0)->file->movebuf]; extern char version[]; -int player; -struct ship *ms; /* memorial structure, &cc->ship[player] */ -struct File *mf; /* ms->file */ -struct shipspecs *mc; /* ms->specs */ +extern int player; +extern struct ship *ms; /* memorial structure, &cc->ship[player] */ +extern struct File *mf; /* ms->file */ +extern struct shipspecs *mc; /* ms->specs */ /* condition codes for leave() */ #define LEAVE_QUIT 0 diff --git a/games/tetris/screen.h b/games/tetris/screen.h index efe382da9f6..a21257b87f4 100644 --- a/games/tetris/screen.h +++ b/games/tetris/screen.h @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.h,v 1.2 1998/09/24 06:45:07 pjanzen Exp $ */ +/* $OpenBSD: screen.h,v 1.3 2000/01/03 23:22:45 pjanzen Exp $ */ /* $NetBSD: screen.h,v 1.2 1995/04/22 07:42:42 cgd Exp $ */ /*- @@ -42,8 +42,8 @@ /* * Capabilities from TERMCAP (used in the score code). */ -char *SEstr; /* end standout mode */ -char *SOstr; /* begin standout mode */ +extern char *SEstr; /* end standout mode */ +extern char *SOstr; /* begin standout mode */ /* * putpad() is for padded strings with count=1. diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c index 46308ddf42e..d36b03fcf8a 100644 --- a/games/tetris/tetris.c +++ b/games/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.c,v 1.7 1999/03/22 07:38:28 pjanzen Exp $ */ +/* $OpenBSD: tetris.c,v 1.8 2000/01/03 23:22:45 pjanzen Exp $ */ /* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ /*- @@ -64,6 +64,16 @@ static char copyright[] = #include "screen.h" #include "tetris.h" +cell board[B_SIZE]; +int Rows, Cols; +struct shape *curshape; +struct shape *nextshape; +long fallrate; +int score; +gid_t gid, egid; +char key_msg[100]; +int showpreview; + static void elide __P((void)); static void setup_board __P((void)); struct shape *randshape __P((void)); diff --git a/games/tetris/tetris.h b/games/tetris/tetris.h index c0210123bb0..c0a6305ad4a 100644 --- a/games/tetris/tetris.h +++ b/games/tetris/tetris.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.h,v 1.4 1999/03/22 07:38:30 pjanzen Exp $ */ +/* $OpenBSD: tetris.h,v 1.5 2000/01/03 23:22:45 pjanzen Exp $ */ /* $NetBSD: tetris.h,v 1.2 1995/04/22 07:42:48 cgd Exp $ */ /*- @@ -59,7 +59,7 @@ #define B_SIZE (B_ROWS * B_COLS) typedef unsigned char cell; -cell board[B_SIZE]; /* 1 => occupied, 0 => empty */ +extern cell board[B_SIZE]; /* 1 => occupied, 0 => empty */ /* the displayed area (rows) */ #define D_FIRST 1 @@ -75,7 +75,7 @@ cell board[B_SIZE]; /* 1 => occupied, 0 => empty */ #define MINROWS 23 #define MINCOLS 40 -int Rows, Cols; /* current screen size */ +extern int Rows, Cols; /* current screen size */ /* * Translations from board coordinates to display coordinates. @@ -132,8 +132,8 @@ struct shape { extern struct shape shapes[]; -struct shape *curshape; -struct shape *nextshape; +extern struct shape *curshape; +extern struct shape *nextshape; /* * Shapes fall at a rate faster than once per second. @@ -145,7 +145,7 @@ struct shape *nextshape; * The value eventually reaches a limit, and things stop going faster, * but by then the game is utterly impossible. */ -long fallrate; /* less than 1 million; smaller => faster */ +extern long fallrate; /* less than 1 million; smaller => faster */ #define faster() (fallrate -= fallrate / 3000) /* @@ -169,11 +169,11 @@ long fallrate; /* less than 1 million; smaller => faster */ */ #define PRE_PENALTY 0.75 -int score; /* the obvious thing */ -gid_t gid, egid; +extern int score; /* the obvious thing */ +extern gid_t gid, egid; -char key_msg[100]; -int showpreview; +extern char key_msg[100]; +extern int showpreview; int fits_in __P((struct shape *, int)); void place __P((struct shape *, int, int)); |