new upstream

git-svn-id: file:///srv/svn/joey/trunk/src/packages/bsdgames@10080 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2004-02-14 21:35:37 +00:00
parent 26fb70d304
commit a02c126403
224 changed files with 5624 additions and 2217 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: cards.c,v 1.13 2003/08/07 09:37:27 agc Exp $ */
/* $NetBSD: cards.c,v 1.14 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: cards.c,v 1.13 2003/08/07 09:37:27 agc Exp $");
__RCSID("$NetBSD: cards.c,v 1.14 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -57,8 +57,8 @@ static const char *cardfile = "cards.pck";
static FILE *deckf;
static void set_up __P((DECK *));
static void printmes __P((void));
static void set_up(DECK *);
static void printmes(void);
/*
* This routine initializes the decks from the data file,

View File

@@ -1,4 +1,4 @@
/* $NetBSD: execute.c,v 1.10 2003/08/07 09:37:27 agc Exp $ */
/* $NetBSD: execute.c,v 1.11 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: execute.c,v 1.10 2003/08/07 09:37:27 agc Exp $");
__RCSID("$NetBSD: execute.c,v 1.11 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -57,7 +57,7 @@ static char buf[257];
static bool new_play; /* set if move on to new player */
extern void *heapstart;
static void show_move __P((void));
static void show_move(void);
/*
* This routine executes the given command by index number

View File

@@ -1,4 +1,4 @@
/* $NetBSD: getinp.c,v 1.11 2003/08/07 09:37:27 agc Exp $ */
/* $NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: getinp.c,v 1.11 2003/08/07 09:37:27 agc Exp $");
__RCSID("$NetBSD: getinp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: getinp.c,v 1.11 2003/08/07 09:37:27 agc Exp $");
static char buf[257];
static int comp __P((const char *));
static int comp(const char *);
int
getinp(prompt, list)

View File

@@ -1,4 +1,4 @@
/* $NetBSD: houses.c,v 1.7 2003/08/07 09:37:27 agc Exp $ */
/* $NetBSD: houses.c,v 1.8 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)houses.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: houses.c,v 1.7 2003/08/07 09:37:27 agc Exp $");
__RCSID("$NetBSD: houses.c,v 1.8 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -45,9 +45,9 @@ static char cur_prop[80];
static MON *monops[N_MON];
static void buy_h __P((MON *));
static void sell_h __P((MON *));
static void list_cur __P((MON *));
static void buy_h(MON *);
static void sell_h(MON *);
static void list_cur(MON *);
/*
* These routines deal with buying and selling houses
*/

View File

@@ -1,4 +1,4 @@
/* $NetBSD: malloc.c,v 1.2 2003/08/07 09:37:28 agc Exp $ */
/* $NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: malloc.c,v 1.2 2003/08/07 09:37:28 agc Exp $");
__RCSID("$NetBSD: malloc.c,v 1.3 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -120,16 +120,16 @@ static u_int nmalloc[NBUCKETS];
static mutex_t malloc_mutex = MUTEX_INITIALIZER;
static void morecore __P((int));
static int findbucket __P((union overhead *, int));
static void morecore(int);
static int findbucket(union overhead *, int);
#ifdef MSTATS
void mstats __P((const char *));
void mstats(const char *);
#endif
#if defined(DEBUG) || defined(RCHECK)
#define ASSERT(p) if (!(p)) botch(__STRING(p))
static void botch __P((const char *));
static void botch(const char *);
/*
* NOTE: since this may be called while malloc_mutex is locked, stdio must not

View File

@@ -1,4 +1,4 @@
/* $NetBSD: misc.c,v 1.11 2003/08/07 09:37:28 agc Exp $ */
/* $NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: misc.c,v 1.11 2003/08/07 09:37:28 agc Exp $");
__RCSID("$NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $");
#endif
#endif /* not lint */
@@ -53,7 +53,7 @@ getyn(prompt)
int com;
for (;;)
if ((com=getinp(prompt, yn)) < 2)
if ((com=getinp(prompt, yncoms)) < 2)
return com;
else
(*func[com-2])();

View File

@@ -1,4 +1,4 @@
/* $NetBSD: monop.c,v 1.14 2003/08/07 09:37:28 agc Exp $ */
/* $NetBSD: monop.c,v 1.15 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: monop.c,v 1.14 2003/08/07 09:37:28 agc Exp $");
__RCSID("$NetBSD: monop.c,v 1.15 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -49,11 +49,11 @@ __RCSID("$NetBSD: monop.c,v 1.14 2003/08/07 09:37:28 agc Exp $");
#include <unistd.h>
#include "monop.def"
int main __P((int, char *[]));
static void getplayers __P((void));
static void init_players __P((void));
static void init_monops __P((void));
static void do_quit __P((int));
int main(int, char *[]);
static void getplayers(void);
static void init_players(void);
static void init_monops(void);
static void do_quit(int);
void *heapstart;
/*

View File

@@ -1,4 +1,4 @@
/* $NetBSD: monop.def,v 1.7 2003/08/07 09:37:28 agc Exp $ */
/* $NetBSD: monop.def,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -52,7 +52,7 @@ const char *name_list[MAX_PL+2], /* list of players' names */
"", /* 16 */
0
},
*const yn[] = { /* list of commands for yes/no answers */
*const yncoms[] = { /* list of commands for yes/no answers */
"yes", /* 0 */ "no", /* 1 */
"quit", /* 2 */ "print", /* 3 */
"where", /* 4 */ "own holdings", /* 5 */
@@ -76,7 +76,7 @@ int player, /* current player number */
num_luck = sizeof lucky_mes / sizeof (char *);
/* list of command functions */
void (*const func[]) __P((void)) = { /* array of function calls for commands */
void (*const func[])(void) = { /* array of function calls for commands */
quit, /* quit game |* 0 *| */
printboard, /* print board |* 1 *| */
where, /* where players are |* 2 *| */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: monop.ext,v 1.5 2003/08/07 09:37:29 agc Exp $ */
/* $NetBSD: monop.ext,v 1.7 2004/01/27 20:30:30 jsm Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -36,11 +36,11 @@
extern bool trading, spec, fixing, told_em;
extern const char *const yn[], *const comlist[], *name_list[], *const lucky_mes[];
extern const char *const yncoms[], *const comlist[], *name_list[], *const lucky_mes[];
extern int num_play, player, num_doub, num_luck;
extern void (*const func[]) __P((void));
extern void (*const func[])(void);
extern DECK deck[2];

View File

@@ -1,4 +1,4 @@
/* $NetBSD: monop.h,v 1.11 2003/08/07 09:37:29 agc Exp $ */
/* $NetBSD: monop.h,v 1.12 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -134,74 +134,74 @@ typedef struct prp_st UTIL_S;
/* cards.c */
void init_decks __P((void));
void get_card __P((DECK *));
void init_decks(void);
void get_card(DECK *);
/* execute.c */
void execute __P((int));
void do_move __P((void));
void move __P((int));
void save __P((void));
void restore __P((void));
int rest_f __P((const char *));
void execute(int);
void do_move(void);
void move(int);
void save(void);
void restore(void);
int rest_f(const char *);
/* getinp.c */
int getinp __P((const char *, const char *const []));
int getinp(const char *, const char *const []);
/* houses.c */
void buy_houses __P((void));
void sell_houses __P((void));
void buy_houses(void);
void sell_houses(void);
/* jail.c */
void card __P((void));
void ret_card __P((PLAY *));
void pay __P((void));
int move_jail __P((int, int ));
void printturn __P((void));
void card(void);
void ret_card(PLAY *);
void pay(void);
int move_jail(int, int );
void printturn(void);
/* misc.c */
int getyn __P((const char *));
void notify __P((void));
void next_play __P((void));
int get_int __P((const char *));
void set_ownlist __P((int));
void is_monop __P((MON *, int));
void is_not_monop __P((MON *));
void list __P((void));
void list_all __P((void));
void quit __P((void));
int getyn(const char *);
void notify(void);
void next_play(void);
int get_int(const char *);
void set_ownlist(int);
void is_monop(MON *, int);
void is_not_monop(MON *);
void list(void);
void list_all(void);
void quit(void);
/* morg.c */
void mortgage __P((void));
void unmortgage __P((void));
void force_morg __P((void));
void mortgage(void);
void unmortgage(void);
void force_morg(void);
/* print.c */
void printboard __P((void));
void where __P((void));
void printsq __P((int, bool));
void printhold __P((int));
void printboard(void);
void where(void);
void printsq(int, bool);
void printhold(int);
/* prop.c */
void buy __P((int, SQUARE *));
void add_list __P((int, OWN **, int));
void del_list __P((int, OWN **, short));
void bid __P((void));
int prop_worth __P((PLAY *));
void buy(int, SQUARE *);
void add_list(int, OWN **, int);
void del_list(int, OWN **, short);
void bid(void);
int prop_worth(PLAY *);
/* rent.c */
void rent __P((SQUARE *));
void rent(SQUARE *);
/* roll.c */
int roll __P((int, int));
int roll(int, int);
/* spec.c */
void inc_tax __P((void));
void goto_jail __P((void));
void lux_tax __P((void));
void cc __P((void));
void chance __P((void));
void inc_tax(void);
void goto_jail(void);
void lux_tax(void);
void cc(void);
void chance(void);
/* trade.c */
void trade __P((void));
void resign __P((void));
void trade(void);
void resign(void);

View File

@@ -1,4 +1,4 @@
/* $NetBSD: morg.c,v 1.9 2003/08/07 09:37:29 agc Exp $ */
/* $NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: morg.c,v 1.9 2003/08/07 09:37:29 agc Exp $");
__RCSID("$NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,11 +69,11 @@ static short square[MAX_PRP+2];
static int num_good,got_houses;
static int set_mlist __P((void));
static void m __P((int));
static int set_umlist __P((void));
static void unm __P((int));
static void fix_ex __P((int));
static int set_mlist(void);
static void m(int);
static int set_umlist(void);
static void unm(int);
static void fix_ex(int);
/*
* This routine is the command level response the mortgage command.

View File

@@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.7 2003/08/07 09:37:29 agc Exp $ */
/* $NetBSD: print.c,v 1.8 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: print.c,v 1.7 2003/08/07 09:37:29 agc Exp $");
__RCSID("$NetBSD: print.c,v 1.8 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -42,7 +42,7 @@ __RCSID("$NetBSD: print.c,v 1.7 2003/08/07 09:37:29 agc Exp $");
static const char *header = "Name Own Price Mg # Rent";
static void printmorg __P((const SQUARE *));
static void printmorg(const SQUARE *);
/*
* This routine prints out the current board

View File

@@ -1,4 +1,4 @@
/* $NetBSD: prop.c,v 1.8 2003/08/07 09:37:29 agc Exp $ */
/* $NetBSD: prop.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,14 +34,14 @@
#if 0
static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: prop.c,v 1.8 2003/08/07 09:37:29 agc Exp $");
__RCSID("$NetBSD: prop.c,v 1.9 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
#include <stdlib.h>
#include "monop.ext"
static int value __P((SQUARE *));
static int value(SQUARE *);
/*
* This routine deals with buying property, setting all the

View File

@@ -1,4 +1,4 @@
/* $NetBSD: trade.c,v 1.8 2003/08/07 09:37:30 agc Exp $ */
/* $NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: trade.c,v 1.8 2003/08/07 09:37:30 agc Exp $");
__RCSID("$NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
@@ -55,11 +55,11 @@ static int used[MAX_PRP];
static TRADE trades[2];
static void get_list __P((int, int ));
static int set_list __P((OWN *));
static void summate __P((void));
static void do_trade __P((void));
static void move_em __P((TRADE *, TRADE *));
static void get_list(int, int );
static int set_list(OWN *);
static void summate(void);
static void do_trade(void);
static void move_em(TRADE *, TRADE *);
void
trade()