-/* $NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $ */
+/* $NetBSD: dm.c,v 1.22 2005/07/02 08:35:29 jmc Exp $ */
/*
* Copyright (c) 1987, 1993
#if 0
static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dm.c,v 1.21 2004/11/05 21:30:32 dsl Exp $");
+__RCSID("$NetBSD: dm.c,v 1.22 2005/07/02 08:35:29 jmc Exp $");
#endif
#endif /* not lint */
void c_tty(const char *);
const char *hour(int);
double load(void);
-int main(int, char *[]);
void nogamefile(void);
void play(char **) __attribute__((__noreturn__));
void read_config(void);
int users(void);
int
-main(argc, argv)
- int argc __attribute__((__unused__));
- char *argv[];
+main(int argc __attribute__((__unused__)), char *argv[])
{
char *cp;
* play the game
*/
void
-play(args)
- char **args;
+play(char **args)
{
char pbuf[MAXPATHLEN];
* read through config file, looking for key words.
*/
void
-read_config()
+read_config(void)
{
FILE *cfp;
char lbuf[BUFSIZ], f1[40], f2[40], f3[40], f4[40], f5[40];
* if day is today, see if okay to play
*/
void
-c_day(s_day, s_start, s_stop)
- const char *s_day, *s_start, *s_stop;
+c_day(const char *s_day, const char *s_start, const char *s_stop)
{
static const char *const days[] = {
"sunday", "monday", "tuesday", "wednesday",
ct = localtime(&now);
if (strcasecmp(s_day, days[ct->tm_wday]))
return;
- if (!isdigit((unsigned char)*s_start) || !isdigit((unsigned char)*s_stop))
+ if (!isdigit((unsigned char)*s_start) ||
+ !isdigit((unsigned char)*s_stop))
return;
start = atoi(s_start);
stop = atoi(s_stop);
* decide if this tty can be used for games.
*/
void
-c_tty(tty)
- const char *tty;
+c_tty(const char *tty)
{
static int first = 1;
static char *p_tty;
* see if game can be played now.
*/
void
-c_game(s_game, s_load, s_users, s_priority)
- const char *s_game, *s_load, *s_users, *s_priority;
+c_game(const char *s_game, const char *s_load, const char *s_users,
+ const char *s_priority)
{
static int found;
* return 15 minute load average
*/
double
-load()
+load(void)
{
double avenrun[3];
* count them.
*/
int
-users()
+users(void)
{
static struct utmpentry *ohead = NULL;
struct utmpentry *ep;
}
void
-nogamefile()
+nogamefile(void)
{
int fd, n;
char buf[BUFSIZ];
* print out the hour in human form
*/
const char *
-hour(h)
- int h;
+hour(int h)
{
static const char *const hours[] = {
"midnight", "1am", "2am", "3am", "4am", "5am",
* logfile --
* log play of game
*/
-logfile()
+logfile(void)
{
struct passwd *pw;
FILE *lp;
-/* $NetBSD: fish.c,v 1.16 2005/02/15 12:56:20 jsm Exp $ */
+/* $NetBSD: fish.c,v 1.17 2005/07/02 08:38:24 jmc Exp $ */
/*-
* Copyright (c) 1990, 1993
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.16 2005/02/15 12:56:20 jsm Exp $");
+__RCSID("$NetBSD: fish.c,v 1.17 2005/07/02 08:38:24 jmc Exp $");
#endif
#endif /* not lint */
void goodmove(int, int, int *, int *);
void init(void);
void instructions(void);
-int main(int, char *[]);
int nrandom(int);
void printhand(const int *);
void printplayer(int);
int usermove(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int ch, move;
}
int
-usermove()
+usermove(void)
{
int n;
const char *const *p;
}
int
-compmove()
+compmove(void)
{
static int lmove;
}
int
-promove()
+promove(void)
{
int i, max;
}
int
-drawcard(player, hand)
- int player;
- int *hand;
+drawcard(int player, int *hand)
{
int card;
}
int
-gofish(askedfor, player, hand)
- int askedfor, player;
- int *hand;
+gofish(int askedfor, int player, int *hand)
{
printplayer(OTHER(player));
(void)printf("say \"GO FISH!\"\n");
}
void
-goodmove(player, move, hand, opphand)
- int player, move;
- int *hand, *opphand;
+goodmove(int player, int move, int *hand, int *opphand)
{
printplayer(OTHER(player));
(void)printf("have %d %s%s.\n",
}
void
-chkwinner(player, hand)
- int player;
- const int *hand;
+chkwinner(int player, const int *hand)
{
int cb, i, ub;
}
void
-printplayer(player)
- int player;
+printplayer(int player)
{
switch (player) {
case COMPUTER:
}
void
-printhand(hand)
- const int *hand;
+printhand(const int *hand)
{
int book, i, j;
}
int
-countcards(hand)
- const int *hand;
+countcards(const int *hand)
{
int i, count;
}
int
-countbooks(hand)
- const int *hand;
+countbooks(const int *hand)
{
int i, count;
}
void
-init()
+init(void)
{
int i, j, temp;
}
int
-nrandom(n)
- int n;
+nrandom(int n)
{
return((int)random() % n);
}
void
-instructions()
+instructions(void)
{
int input;
pid_t pid;
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: fish [-p]\n");
exit(1);