-/* $NetBSD: main.c,v 1.17 2006/06/07 09:35:03 jnemeth Exp $ */
+/* $NetBSD: main.c,v 1.20 2009/08/12 04:48:03 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
#include <sys/cdefs.h>
#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
- The Regents of the University of California. All rights reserved.\n");
+__COPYRIGHT("@(#) Copyright (c) 1990, 1993\
+ The Regents of the University of California. All rights reserved.");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.17 2006/06/07 09:35:03 jnemeth Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2009/08/12 04:48:03 dholland Exp $");
#endif
#endif /* not lint */
extern FILE *yyin;
+static int read_file(const char *);
+static const char *default_game(void);
+static const char *okay_game(const char *);
+static int list_games(void);
+
int
main(int argc, char *argv[])
{
- int seed;
+ unsigned long seed;
int f_usage = 0, f_list = 0, f_showscore = 0;
int f_printpath = 0;
const char *file = NULL;
open_score_file();
(void)setgid(getgid());
- start_time = seed = time(NULL);
+ start_time = time(NULL);
+ seed = start_time;
while ((ch = getopt(argc, argv, ":u?lstpg:f:r:")) != -1) {
switch (ch) {
}
if (optind < argc)
f_usage++;
- srandom((unsigned long)seed);
+ srandom(seed);
if (f_usage)
(void)fprintf(stderr,
}
}
-int
+static int
read_file(const char *s)
{
int retval;
return (0);
}
-const char *
+static const char *
default_game(void)
{
FILE *fp;
return (file);
}
-const char *
+static const char *
okay_game(const char *s)
{
FILE *fp;
return (ret);
}
-int
+static int
list_games(void)
{
FILE *fp;