diff options
author | dholland <dholland@NetBSD.org> | 2012-10-13 19:19:38 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2012-10-13 19:19:38 +0000 |
commit | 83f2ef7227030c4b88ec1006e49d9304aa6f7be0 (patch) | |
tree | 0f69865c3aa850090b15e95a6ae7a6d599c95e11 /backgammon/common_source/back.h | |
parent | f70c1c7e831fd972c1f452e87709f5fe158e6f4d (diff) | |
download | bsdgames-darwin-83f2ef7227030c4b88ec1006e49d9304aa6f7be0.tar.gz bsdgames-darwin-83f2ef7227030c4b88ec1006e49d9304aa6f7be0.tar.zst bsdgames-darwin-83f2ef7227030c4b88ec1006e49d9304aa6f7be0.zip |
Pass the move info around instead of using it as a global.
Diffstat (limited to 'backgammon/common_source/back.h')
-rw-r--r-- | backgammon/common_source/back.h | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/backgammon/common_source/back.h b/backgammon/common_source/back.h index e008a6f9..7c333365 100644 --- a/backgammon/common_source/back.h +++ b/backgammon/common_source/back.h @@ -1,4 +1,4 @@ -/* $NetBSD: back.h,v 1.19 2012/10/13 18:44:14 dholland Exp $ */ +/* $NetBSD: back.h,v 1.20 2012/10/13 19:19:39 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -46,8 +46,7 @@ #define rnum(r) (random()%r) #define D0 dice[0] #define D1 dice[1] -#define mswap(m) {(m)->D0 ^= (m)->D1; (m)->D1 ^= (m)->D0; (m)->D0 ^= (m)->D1; (m)->d0 = 1-(m)->d0;} -#define swap suck it +#define mswap(m) {(m)->D0 ^= (m)->D1; (m)->D1 ^= (m)->D0; (m)->D0 ^= (m)->D1; (m)->d0 = 1-(m)->d0;} struct move { int dice[2]; /* value of dice */ @@ -59,8 +58,6 @@ struct move { original position */ }; -extern struct move gm; - /* * * Some numerical conventions: @@ -135,10 +132,10 @@ extern int begscr; /* 'beginning' of screen (not including board) */ int addbuf(int); -void backone(int); +void backone(struct move *, int); void buflush(void); int canhit(int, int); -int checkmove(int); +int checkmove(struct move *, int); void clear(void); void clend(void); void cline(void); @@ -148,28 +145,28 @@ void errexit(const char *) __dead; void fancyc(int); void fboard(void); void fixtty(struct termios *); -void getarg(char ***); +void getarg(struct move *, char ***); int getcaps(const char *); -void getmove(void); +void getmove(struct move *); void getout(int) __dead; void gwrite(void); void init(void); int main(int, char *[]); -int makmove(int); -int movallow(void); -void movback(int); -void moverr(int); -int movokay(int); +int makmove(struct move *, int); +int movallow(struct move *); +void movback(struct move *, int); +void moverr(struct move *, int); +int movokay(struct move *, int); void newpos(void); void nexturn(void); void odds(int, int, int); -void proll(void); -int quit(void); +void proll(struct move *); +int quit(struct move *); int readc(void); -void recover(const char *); +void recover(struct move *, const char *); void refresh(void); -void roll(void); -void save(int); +void roll(struct move *); +void save(struct move *, int); int wrtext(const char *const *); void wrboard(void); void wrhit(int); @@ -178,3 +175,5 @@ void writec(int); void writel(const char *); void wrscore(void); int yorn(int); + +void move_init(struct move *); |