summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-03-23 08:28:00 +0000
committercgd <cgd@NetBSD.org>1995-03-23 08:28:00 +0000
commit42fb1b9d4a67d89ff98133ccd6400928fb7fa4b0 (patch)
tree41b251c6c20998a508908d6c27134c52c43bd8e6
parent6bfd77e43243356df04ed47d6ba7a43ca79ce47f (diff)
merge with Lite, new RCS id conventions, etc.
-rw-r--r--games/factor/Makefile4
-rw-r--r--games/factor/factor.611
-rw-r--r--games/factor/factor.c331
-rw-r--r--games/fish/Makefile6
-rw-r--r--games/fish/fish.611
-rw-r--r--games/fish/fish.c19
-rw-r--r--games/fish/pathnames.h9
-rw-r--r--games/fortune/Makefile4
-rw-r--r--games/fortune/Notes1
-rw-r--r--games/fortune/README1
-rw-r--r--games/fortune/datfiles/Makefile55
-rw-r--r--games/fortune/fortune/Makefile3
-rw-r--r--games/fortune/fortune/fortune.673
-rw-r--r--games/fortune/fortune/fortune.c157
-rw-r--r--games/fortune/fortune/pathnames.h9
-rw-r--r--games/fortune/strfile/Makefile4
-rw-r--r--games/fortune/strfile/strfile.816
-rw-r--r--games/fortune/strfile/strfile.c19
-rw-r--r--games/fortune/strfile/strfile.h9
-rw-r--r--games/fortune/tools/Do_spell1
-rw-r--r--games/fortune/tools/Do_troff1
-rw-r--r--games/fortune/tools/Troff.mac2
-rw-r--r--games/fortune/tools/do_sort1
-rw-r--r--games/fortune/unstr/Makefile4
-rw-r--r--games/fortune/unstr/unstr.c15
-rw-r--r--games/hack/COPYRIGHT2
-rw-r--r--games/hack/Makefile4
-rw-r--r--games/hack/Makequest2
-rw-r--r--games/hack/Original_READ_ME2
-rw-r--r--games/hack/READ_ME2
-rw-r--r--games/hack/alloc.c2
-rw-r--r--games/hack/config.h2
-rw-r--r--games/hack/date.h2
-rw-r--r--games/hack/def.edog.h2
-rw-r--r--games/hack/def.eshk.h2
-rw-r--r--games/hack/def.flag.h2
-rw-r--r--games/hack/def.func_tab.h2
-rw-r--r--games/hack/def.gen.h2
-rw-r--r--games/hack/def.gold.h2
-rw-r--r--games/hack/def.mkroom.h2
-rw-r--r--games/hack/def.monst.h2
-rw-r--r--games/hack/def.obj.h2
-rw-r--r--games/hack/def.objclass.h2
-rw-r--r--games/hack/def.objects.h2
-rw-r--r--games/hack/def.permonst.h2
-rw-r--r--games/hack/def.rm.h2
-rw-r--r--games/hack/def.trap.h2
-rw-r--r--games/hack/def.wseg.h2
-rw-r--r--games/hack/hack.66
-rw-r--r--games/hack/hack.Decl.c2
-rw-r--r--games/hack/hack.apply.c2
-rw-r--r--games/hack/hack.bones.c2
-rw-r--r--games/hack/hack.c2
-rw-r--r--games/hack/hack.cmd.c2
-rw-r--r--games/hack/hack.do.c2
-rw-r--r--games/hack/hack.do_name.c2
-rw-r--r--games/hack/hack.do_wear.c2
-rw-r--r--games/hack/hack.dog.c2
-rw-r--r--games/hack/hack.eat.c2
-rw-r--r--games/hack/hack.end.c2
-rw-r--r--games/hack/hack.engrave.c2
-rw-r--r--games/hack/hack.fight.c2
-rw-r--r--games/hack/hack.fix2
-rw-r--r--games/hack/hack.h2
-rw-r--r--games/hack/hack.invent.c2
-rw-r--r--games/hack/hack.ioctl.c2
-rw-r--r--games/hack/hack.lev.c2
-rw-r--r--games/hack/hack.main.c2
-rw-r--r--games/hack/hack.makemon.c2
-rw-r--r--games/hack/hack.mfndpos.h2
-rw-r--r--games/hack/hack.mhitu.c2
-rw-r--r--games/hack/hack.mklev.c2
-rw-r--r--games/hack/hack.mkmaze.c2
-rw-r--r--games/hack/hack.mkobj.c2
-rw-r--r--games/hack/hack.mkshop.c2
-rw-r--r--games/hack/hack.mon.c2
-rw-r--r--games/hack/hack.monst.c2
-rw-r--r--games/hack/hack.o_init.c2
-rw-r--r--games/hack/hack.objnam.c2
-rw-r--r--games/hack/hack.options.c2
-rw-r--r--games/hack/hack.pager.c2
-rw-r--r--games/hack/hack.potion.c2
-rw-r--r--games/hack/hack.pri.c2
-rw-r--r--games/hack/hack.read.c2
-rw-r--r--games/hack/hack.rip.c2
-rw-r--r--games/hack/hack.rumors.c2
-rw-r--r--games/hack/hack.save.c5
-rw-r--r--games/hack/hack.search.c2
-rw-r--r--games/hack/hack.sh1
-rw-r--r--games/hack/hack.shk.c2
-rw-r--r--games/hack/hack.shknam.c2
-rw-r--r--games/hack/hack.steal.c2
-rw-r--r--games/hack/hack.termcap.c2
-rw-r--r--games/hack/hack.timeout.c2
-rw-r--r--games/hack/hack.topl.c2
-rw-r--r--games/hack/hack.track.c2
-rw-r--r--games/hack/hack.trap.c2
-rw-r--r--games/hack/hack.tty.c11
-rw-r--r--games/hack/hack.u_init.c2
-rw-r--r--games/hack/hack.unix.c2
-rw-r--r--games/hack/hack.vault.c2
-rw-r--r--games/hack/hack.version.c2
-rw-r--r--games/hack/hack.wield.c2
-rw-r--r--games/hack/hack.wizard.c2
-rw-r--r--games/hack/hack.worm.c2
-rw-r--r--games/hack/hack.worn.c2
-rw-r--r--games/hack/hack.zap.c2
-rw-r--r--games/hack/makedefs.c2
-rw-r--r--games/hack/pathnames.h9
-rw-r--r--games/hack/rnd.c2
-rw-r--r--games/hangman/Makefile4
-rw-r--r--games/hangman/endgame.c27
-rw-r--r--games/hangman/extern.c13
-rw-r--r--games/hangman/getguess.c20
-rw-r--r--games/hangman/getword.c26
-rw-r--r--games/hangman/hangman.611
-rw-r--r--games/hangman/hangman.h9
-rw-r--r--games/hangman/main.c19
-rw-r--r--games/hangman/pathnames.h9
-rw-r--r--games/hangman/playgame.c13
-rw-r--r--games/hangman/prdata.c13
-rw-r--r--games/hangman/prman.c13
-rw-r--r--games/hangman/prword.c13
-rw-r--r--games/hangman/setup.c13
-rw-r--r--games/larn/COPYRIGHT2
-rw-r--r--games/larn/Fixed.Bugs2
-rw-r--r--games/larn/Makefile14
-rw-r--r--games/larn/README2
-rw-r--r--games/larn/bill.c266
-rw-r--r--games/larn/config.c2
-rw-r--r--games/larn/create.c2
-rw-r--r--games/larn/data.c9
-rw-r--r--games/larn/diag.c2
-rw-r--r--games/larn/display.c2
-rw-r--r--games/larn/fortune.c138
-rw-r--r--games/larn/global.c2
-rw-r--r--games/larn/header.h5
-rw-r--r--games/larn/help.c2
-rw-r--r--games/larn/io.c2
-rw-r--r--games/larn/larn.613
-rw-r--r--games/larn/main.c2
-rw-r--r--games/larn/monster.c2
-rw-r--r--games/larn/moreobj.c2
-rw-r--r--games/larn/movem.c2
-rw-r--r--games/larn/nap.c2
-rw-r--r--games/larn/object.c2
-rw-r--r--games/larn/pathnames.h5
-rw-r--r--games/larn/regen.c2
-rw-r--r--games/larn/savelev.c2
-rw-r--r--games/larn/scores.c2
-rw-r--r--games/larn/signal.c2
-rw-r--r--games/larn/store.c9
-rw-r--r--games/larn/tok.c2
-rw-r--r--games/monop/Makefile4
-rw-r--r--games/monop/brd.dat2
-rw-r--r--games/monop/cards.c13
-rw-r--r--games/monop/deck.h9
-rw-r--r--games/monop/execute.c13
-rw-r--r--games/monop/getinp.c13
-rw-r--r--games/monop/houses.c13
-rw-r--r--games/monop/initdeck.c19
-rw-r--r--games/monop/jail.c13
-rw-r--r--games/monop/misc.c13
-rw-r--r--games/monop/mon.dat2
-rw-r--r--games/monop/monop.65
-rw-r--r--games/monop/monop.c19
-rw-r--r--games/monop/monop.def9
-rw-r--r--games/monop/monop.ext2
-rw-r--r--games/monop/monop.h9
-rw-r--r--games/monop/morg.c13
-rw-r--r--games/monop/pathnames.h9
-rw-r--r--games/monop/print.c13
-rw-r--r--games/monop/prop.c13
-rw-r--r--games/monop/prop.dat2
-rw-r--r--games/monop/rent.c13
-rw-r--r--games/monop/roll.c13
-rw-r--r--games/monop/spec.c13
-rw-r--r--games/monop/trade.c13
-rw-r--r--games/morse/Makefile4
-rw-r--r--games/morse/morse.c19
-rw-r--r--games/number/Makefile4
-rw-r--r--games/number/number.629
-rw-r--r--games/number/number.c287
-rw-r--r--games/pom/Makefile4
-rw-r--r--games/pom/pom.611
-rw-r--r--games/pom/pom.c19
-rw-r--r--games/ppt/Makefile4
-rw-r--r--games/ppt/ppt.c19
-rw-r--r--games/primes/Makefile4
-rw-r--r--games/primes/pattern.c13
-rw-r--r--games/primes/pr_tbl.c13
-rw-r--r--games/primes/primes.c315
-rw-r--r--games/primes/primes.h25
193 files changed, 1435 insertions, 1259 deletions
diff --git a/games/factor/Makefile b/games/factor/Makefile
index edb6f563432..d63a6204722 100644
--- a/games/factor/Makefile
+++ b/games/factor/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.7 (Berkeley) 4/8/91
-# $Id: Makefile,v 1.3 1994/12/22 09:34:03 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/23 08:28:00 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= factor
SRCS= factor.c pr_tbl.c
diff --git a/games/factor/factor.6 b/games/factor/factor.6
index 4bf869d6f99..d21be552a8e 100644
--- a/games/factor/factor.6
+++ b/games/factor/factor.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: factor.6,v 1.4 1995/03/23 08:28:05 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Landon Curt Noll.
@@ -32,15 +34,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)factor.6 5.3 (Berkeley) 6/23/90
-.\" $Id: factor.6,v 1.3 1993/08/05 01:46:37 jtc Exp $
+.\" @(#)factor.6 8.1 (Berkeley) 5/31/93
.\"
.\"
.\" By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
.\"
.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt FACTOR 6
.Os
.Sh NAME
diff --git a/games/factor/factor.c b/games/factor/factor.c
index 9b5e012014b..c578a747e22 100644
--- a/games/factor/factor.c
+++ b/games/factor/factor.c
@@ -1,6 +1,8 @@
+/* $NetBSD: factor.c,v 1.5 1995/03/23 08:28:07 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Landon Curt Noll.
@@ -35,14 +37,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)factor.c 4.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: factor.c,v 1.4 1994/03/03 03:07:24 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)factor.c 8.3 (Berkeley) 3/30/94";
+#else
+static char rcsid[] = "$NetBSD: factor.c,v 1.5 1995/03/23 08:28:07 cgd Exp $";
+#endif
#endif /* not lint */
/*
@@ -64,9 +69,13 @@ static char rcsid[] = "$Id: factor.c,v 1.4 1994/03/03 03:07:24 deraadt Exp $";
* If no args are given, the list of numbers are read from stdin.
*/
-#include <stdio.h>
-#include <limits.h>
+#include <err.h>
#include <ctype.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include "primes.h"
/*
@@ -76,202 +85,66 @@ static char rcsid[] = "$Id: factor.c,v 1.4 1994/03/03 03:07:24 deraadt Exp $";
* up to 65537 and 65537^2 > 2^32-1.
*/
extern ubig prime[];
-extern ubig *pr_limit; /* largest prime in the prime array */
-
-#define MAX_LINE 255 /* max line allowed on stdin */
+extern ubig *pr_limit; /* largest prime in the prime array */
-void pr_fact(); /* print factors of a value */
-long small_fact(); /* find smallest factor of a value */
-char *read_num_buf(); /* read a number buffer */
-char *program; /* name of this program */
+void pr_fact __P((ubig)); /* print factors of a value */
+void usage __P((void));
+int
main(argc, argv)
- int argc; /* arg count */
- char *argv[]; /* the args */
+ int argc;
+ char *argv[];
{
- int arg; /* which arg to factor */
- long val; /* the value to factor */
- char buf[MAX_LINE+1]; /* input buffer */
-
- /* parse args */
- program = argv[0];
- if (argc >= 2) {
-
- /* factor each arg */
- for (arg=1; arg < argc; ++arg) {
-
- /* process the buffer */
- if (read_num_buf(NULL, argv[arg]) == NULL) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
-
- /* factor the argument */
- if (sscanf(argv[arg], "%ld", &val) == 1) {
- pr_fact(val);
- } else {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
+ ubig val;
+ int ch;
+ char *p, buf[100]; /* > max number of digits. */
+
+ while ((ch = getopt(argc, argv, "")) != EOF)
+ switch (ch) {
+ case '?':
+ default:
+ usage();
}
-
- /* no args supplied, read numbers from stdin */
- } else {
- /*
- * read asciii numbers from input
- */
- while (read_num_buf(stdin, buf) != NULL) {
-
- /* factor the argument */
- if (sscanf(buf, "%ld", &val) == 1) {
- pr_fact(val);
+ argc -= optind;
+ argv += optind;
+
+ /* No args supplied, read numbers from stdin. */
+ if (argc == 0)
+ for (;;) {
+ if (fgets(buf, sizeof(buf), stdin) == NULL) {
+ if (ferror(stdin))
+ err(1, "stdin");
+ exit (0);
}
+ for (p = buf; isblank(*p); ++p);
+ if (*p == '\n' || *p == '\0')
+ continue;
+ if (*p == '-')
+ errx(1, "negative numbers aren't permitted.");
+ errno = 0;
+ val = strtoul(buf, &p, 10);
+ if (errno)
+ err(1, "%s", buf);
+ if (*p != '\n')
+ errx(1, "%s: illegal numeric format.", buf);
+ pr_fact(val);
}
- }
- exit(0);
-}
-
-/*
- * read_num_buf - read a number buffer from a stream
- *
- * Read a number on a line of the form:
- *
- * ^[ \t]*\([+-]?[0-9][0-9]\)*.*$
- *
- * where ? is a 1-or-0 operator and the number is within \( \).
- *
- * If does not match the above pattern, it is ignored and a new
- * line is read. If the number is too large or small, we will
- * print ouch and read a new line.
- *
- * We have to be very careful on how we check the magnitude of the
- * input. We can not use numeric checks because of the need to
- * check values against maximum numeric values.
- *
- * This routine will return a line containing a ascii number between
- * NEG_SEMIBIG and SEMIBIG, or it will return NULL.
- *
- * If the stream is NULL then buf will be processed as if were
- * a single line stream.
- *
- * returns:
- * char * pointer to leading digit, + or -
- * NULL EOF or error
- */
-char *
-read_num_buf(input, buf)
- FILE *input; /* input stream or NULL */
- char *buf; /* input buffer */
-{
- static char limit[MAX_LINE+1]; /* ascii value of SEMIBIG */
- static int limit_len; /* digit count of limit */
- static char neg_limit[MAX_LINE+1]; /* value of NEG_SEMIBIG */
- static int neg_limit_len; /* digit count of neg_limit */
- int len; /* digits in input (excluding +/-) */
- char *s; /* line start marker */
- char *d; /* first digit, skip +/- */
- char *p; /* scan pointer */
- char *z; /* zero scan pointer */
-
- /* form the ascii value of SEMIBIG if needed */
- if (!isascii(limit[0]) || !isdigit(limit[0])) {
- sprintf(limit, "%ld", SEMIBIG);
- limit_len = strlen(limit);
- sprintf(neg_limit, "%ld", NEG_SEMIBIG);
- neg_limit_len = strlen(neg_limit)-1; /* exclude - */
- }
-
- /*
- * the search for a good line
- */
- if (input != NULL && fgets(buf, MAX_LINE, input) == NULL) {
- /* error or EOF */
- return NULL;
- }
- do {
-
- /* ignore leading whitespace */
- for (s=buf; *s && s < buf+MAX_LINE; ++s) {
- if (!isascii(*s) || !isspace(*s)) {
- break;
- }
- }
-
- /* skip over any leading + or - */
- if (*s == '+' || *s == '-') {
- d = s+1;
- } else {
- d = s;
- }
-
- /* note leading zeros */
- for (z=d; *z && z < buf+MAX_LINE; ++z) {
- if (*z != '0') {
- break;
- }
- }
-
- /* scan for the first non-digit */
- for (p=d; *p && p < buf+MAX_LINE; ++p) {
- if (!isascii(*p) || !isdigit(*p)) {
- break;
- }
- }
-
- /* ignore empty lines */
- if (p == d) {
- continue;
- }
- *p = '\0';
-
- /* object if too many digits */
- len = strlen(z);
- len = (len<=0) ? 1 : len;
- if (*s == '-') {
- /* accept if digit count is below limit */
- if (len < neg_limit_len) {
- /* we have good input */
- return s;
-
- /* reject very large numbers */
- } else if (len > neg_limit_len) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
-
- /* carefully check against near limit numbers */
- } else if (strcmp(z, neg_limit+1) > 0) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- /* number is near limit, but is under it */
- return s;
-
- } else {
- /* accept if digit count is below limit */
- if (len < limit_len) {
- /* we have good input */
- return s;
-
- /* reject very large numbers */
- } else if (len > limit_len) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
-
- /* carefully check against near limit numbers */
- } else if (strcmp(z, limit) > 0) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- /* number is near limit, but is under it */
- return s;
+ /* Factor the arguments. */
+ else
+ for (; *argv != NULL; ++argv) {
+ if (argv[0][0] == '-')
+ errx(1, "negative numbers aren't permitted.");
+ errno = 0;
+ val = strtoul(argv[0], &p, 10);
+ if (errno)
+ err(1, "%s", argv[0]);
+ if (*p != '\0')
+ errx(1, "%s: illegal numeric format.", argv[0]);
+ pr_fact(val);
}
- } while (input != NULL && fgets(buf, MAX_LINE, input) != NULL);
-
- /* error or EOF */
- return NULL;
+ exit(0);
}
-
/*
* pr_fact - print the factors of a number
*
@@ -287,62 +160,48 @@ read_num_buf(input, buf)
*/
void
pr_fact(val)
- long val; /* factor this value */
+ ubig val; /* Factor this value. */
{
- ubig *fact; /* the factor found */
+ ubig *fact; /* The factor found. */
- /* firewall - catch 0 and 1 */
- switch (val) {
- case -(2147483648U):
- /* avoid negation problems */
- puts("-2147483648: -1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n");
- return;
- case -1:
- puts("-1: -1\n");
- return;
- case 0:
+ /* Firewall - catch 0 and 1. */
+ if (val == 0) /* Historical practice; 0 just exits. */
exit(0);
- case 1:
- puts("1: 1\n");
+ if (val == 1) {
+ (void)printf("1: 1\n");
return;
- default:
- if (val < 0) {
- val = -val;
- printf("%ld: -1", val);
- } else {
- printf("%ld:", val);
- }
- fflush(stdout);
- break;
}
- /*
- * factor value
- */
- fact = &prime[0];
- while (val > 1) {
-
- /* look for the smallest factor */
+ /* Factor value. */
+ (void)printf("%lu:", val);
+ for (fact = &prime[0]; val > 1; ++fact) {
+ /* Look for the smallest factor. */
do {
- if (val%(long)*fact == 0) {
+ if (val % (long)*fact == 0)
break;
- }
} while (++fact <= pr_limit);
- /* watch for primes larger than the table */
+ /* Watch for primes larger than the table. */
if (fact > pr_limit) {
- printf(" %ld\n", val);
- return;
+ (void)printf(" %lu", val);
+ break;
}
- /* divide factor out until none are left */
+ /* Divide factor out until none are left. */
do {
- printf(" %ld", *fact);
+ (void)printf(" %lu", *fact);
val /= (long)*fact;
} while ((val % (long)*fact) == 0);
- fflush(stdout);
- ++fact;
+
+ /* Let the user know we're doing something. */
+ (void)fflush(stdout);
}
- putchar('\n');
- return;
+ (void)putchar('\n');
+}
+
+void
+usage()
+{
+ (void)fprintf(stderr, "usage: factor [value ...]\n");
+ exit (0);
}
diff --git a/games/fish/Makefile b/games/fish/Makefile
index c798831f113..61ab5d168f7 100644
--- a/games/fish/Makefile
+++ b/games/fish/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.5 (Berkeley) 1/18/91
-# $Id: Makefile,v 1.5 1995/01/12 19:06:53 jtc Exp $
+# $NetBSD: Makefile,v 1.6 1995/03/23 08:28:14 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= fish
MAN= fish.6
@@ -7,6 +7,6 @@ HIDEGAME=hidegame
beforeinstall:
install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fish.instr \
- ${DESTDIR}/usr/share/games
+ ${DESTDIR}/usr/share/games/fish.instr
.include <bsd.prog.mk>
diff --git a/games/fish/fish.6 b/games/fish/fish.6
index 788b0e63238..3c60193c420 100644
--- a/games/fish/fish.6
+++ b/games/fish/fish.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: fish.6,v 1.4 1995/03/23 08:28:16 cgd Exp $
+.\"
+.\" Copyright (c) 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)fish.6 6.2 (Berkeley) 1/18/91
-.\" $Id: fish.6,v 1.3 1993/08/05 01:46:41 jtc Exp $
+.\" @(#)fish.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd January 18, 1991
+.Dd May 31, 1993
.Dt FISH 6
.Os
.Sh NAME
diff --git a/games/fish/fish.c b/games/fish/fish.c
index 9eb93031fe7..14af9c0571d 100644
--- a/games/fish/fish.c
+++ b/games/fish/fish.c
@@ -1,6 +1,8 @@
+/* $NetBSD: fish.c,v 1.3 1995/03/23 08:28:18 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Muffy Barkocy.
@@ -35,14 +37,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1990, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)fish.c 5.4 (Berkeley) 1/18/91";*/
-static char rcsid[] = "$Id: fish.c,v 1.2 1993/08/01 18:54:54 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: fish.c,v 1.3 1995/03/23 08:28:18 cgd Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
diff --git a/games/fish/pathnames.h b/games/fish/pathnames.h
index 3cd156c8c5f..aa257ff83fc 100644
--- a/games/fish/pathnames.h
+++ b/games/fish/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/23 08:28:21 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 1/18/91
- * $Id: pathnames.h,v 1.2 1993/08/01 18:54:53 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_INSTR "/usr/share/games/fish.instr"
diff --git a/games/fortune/Makefile b/games/fortune/Makefile
index d912d0720d8..2a951ab1f9d 100644
--- a/games/fortune/Makefile
+++ b/games/fortune/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.6 (Berkeley) 4/27/91
-# $Id: Makefile,v 1.4 1993/08/01 05:45:23 mycroft Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/23 08:28:23 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
SUBDIR= fortune
diff --git a/games/fortune/Notes b/games/fortune/Notes
index 9be4f4d2264..717682f045f 100644
--- a/games/fortune/Notes
+++ b/games/fortune/Notes
@@ -1,3 +1,4 @@
+# $NetBSD: Notes,v 1.2 1995/03/23 08:28:26 cgd Exp $
# @(#)Notes 8.1 (Berkeley) 5/31/93
Warning:
diff --git a/games/fortune/README b/games/fortune/README
index ee9ef642c15..29de138b268 100644
--- a/games/fortune/README
+++ b/games/fortune/README
@@ -1,3 +1,4 @@
+# $NetBSD: README,v 1.2 1995/03/23 08:28:29 cgd Exp $
# @(#)README 8.1 (Berkeley) 5/31/93
The potentially offensive fortunes are not installed by default on BSD
diff --git a/games/fortune/datfiles/Makefile b/games/fortune/datfiles/Makefile
index d92f8ba4a4f..8c87385be3f 100644
--- a/games/fortune/datfiles/Makefile
+++ b/games/fortune/datfiles/Makefile
@@ -1,37 +1,44 @@
-# from: @(#)Makefile 5.2 (Berkeley) 5/6/91
-# $Id: Makefile,v 1.10 1994/02/10 02:31:32 cgd Exp $
+# $NetBSD: Makefile,v 1.11 1995/03/23 08:28:33 cgd Exp $
+# @(#)Makefile 8.2 (Berkeley) 4/19/94
-#
-# set `OBSCENE' to "real" to have obscene fortunes installed,
-# fake to have a note stating that they're not installed
-# isntalled in their place
-#
-OBSCENE=real
+SRCS= fortunes fortunes2 startrek zippy
+BLDS= fortunes.dat fortunes2.dat startrek.dat zippy.dat \
+ fortunes-o fortunes-o.dat
-NORMDAT= fortunes.dat startrek.dat zippy.dat
-OBSDAT= fortunes-o.dat
-DATFILES= ${NORMDAT} ${OBSDAT}
+# TO INSTALL THE POTENTIALLY OFFENSIVE FORTUNES, UNCOMMENT THE THREE
+# LINES AND COMMENT OUT THE FOURTH LINE.
-CLEANFILES+=${DATFILES}
+# THE THREE LINES
+SRCS+= fortunes2-o limerick
+BLDS+= fortunes2-o.dat limerick.dat
+TYPE= real
+
+# THE FOURTH LINE
+#TYPE= fake
+
+CLEANFILES+=${BLDS}
STRFILE!=cd $(.CURDIR)/../strfile; \
printf "xxx:\n\techo \$${.OBJDIR}/strfile\n" | ${MAKE} -r -s -f - xxx
-all: ${DATFILES}
+all: ${BLDS}
-install:
- install ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${DATFILES} \
- ${DESTDIR}/usr/share/games/fortune
+install: ${SRCS} ${BLDS}
(cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${NORMDAT:R} ${DESTDIR}/usr/share/games/fortune)
- (cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${OBSDAT:R}.${OBSCENE}.rot13 \
- ${DESTDIR}/usr/share/games/fortune/${OBSDAT:R})
-
-fortunes-o.dat: ${.TARGET:R}.${OBSCENE}.rot13
- ${STRFILE} -rsx ${.CURDIR}/${.TARGET:R}.${OBSCENE}.rot13 ${.TARGET}
+ ${SRCS} ${DESTDIR}/usr/share/games/fortune)
+ install -o ${BINOWN} -g ${BINGRP} -m 444 ${BLDS} \
+ ${DESTDIR}/usr/share/games/fortune
-fortunes.dat startrek.dat zippy.dat: ${.TARGET:R}
+fortunes.dat fortunes2.dat fortunes2-o.dat limerick.dat startrek.dat zippy.dat:
${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
+fortunes-o.dat: fortunes-o
+ ${STRFILE} -rsx fortunes-o ${.TARGET}
+
+#fortunes-o: fortunes-o.${TYPE}
+# /usr/games/caesar 13 < ${.ALLSRC} > ${.TARGET}
+
+fortunes-o: fortunes-o.${TYPE}.rot13
+ cat < ${.ALLSRC} > ${.TARGET}
+
.include <bsd.prog.mk>
diff --git a/games/fortune/fortune/Makefile b/games/fortune/fortune/Makefile
index 71cbf376d29..51ba8d99479 100644
--- a/games/fortune/fortune/Makefile
+++ b/games/fortune/fortune/Makefile
@@ -1,4 +1,5 @@
-# $Id: Makefile,v 1.7 1994/12/22 09:34:12 cgd Exp $
+# $NetBSD: Makefile,v 1.8 1995/03/23 08:28:36 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= fortune
MAN= fortune.6
diff --git a/games/fortune/fortune/fortune.6 b/games/fortune/fortune/fortune.6
index d4876e1af9f..da994244607 100644
--- a/games/fortune/fortune/fortune.6
+++ b/games/fortune/fortune/fortune.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1985 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: fortune.6,v 1.4 1995/03/23 08:28:37 cgd Exp $
+.\"
+.\" Copyright (c) 1985, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Ken Arnold.
@@ -32,10 +34,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)fortune.6 6.8 (Berkeley) 6/23/90
-.\" $Id: fortune.6,v 1.3 1993/08/05 02:15:58 jtc Exp $
+.\" @(#)fortune.6 8.3 (Berkeley) 4/19/94
.\"
-.Dd June 23, 1990
+.Dd April 19, 1994
.Dt FORTUNE 6
.Os
.Sh NAME
@@ -57,9 +58,12 @@ Epigrams are divided into several categories, where each category
is subdivided into those which are potentially offensive and those
which are not.
The options are as follows:
-.Bl -tag -width indent
+.Bl -tag -width flag
.It Fl a
Choose from all lists of maxims, both offensive and not.
+(See the
+.Fl o
+option for more information on offensive fortunes.)
.It Fl e
Consider all fortune files to be of equal size (see discussion below
on multiple files).
@@ -76,22 +80,24 @@ See
for a description of patterns.
.It Fl o
Choose only from potentially offensive aphorisms.
-.Pp
+.Bf -symbolic
Please, please, please request a potentially offensive fortune if and
only if you believe, deep down in your heart, that you are willing
to be offended.
-(And that if you are, you'll just quit using -o rather than give us
+(And that if you are, you'll just quit using
+.Fl o
+rather than give us
grief about it, okay?)
-.Pp
+.Ef
.Bd -filled -offset indent
\&... let us keep in mind the basic governing philosophy
of The Brotherhood, as handsomely summarized in these words:
we believe in healthy, hearty laughter -- at the expense of
the whole human race, if needs be.
Needs be.
+.Bd -filled -offset indent-two -compact
+--H. Allen Smith, "Rude Jokes"
.Ed
-.Bd -filled -offset indent-two
--- H. Allen Smith, "Rude Jokes"
.Ed
.It Fl s
Short apothegms only.
@@ -109,12 +115,12 @@ to guarantee that the message can be read before the screen is cleared.
The user may specify alternate sayings.
You can specify a specific file, a directory which contains one or
more files, or the special word
-.Ar all
+.Em all
which says to use all the standard databases.
Any of these may be preceded by a percentage, which is a number
.Ar N
between 0 and 100 inclusive, followed by a
-.Em % .
+.Ar % .
If it is, there will be a
.Ar N
percent probability that an adage will be picked from that file
@@ -125,35 +131,44 @@ and/or directories, in which case the probability of selecting from
one of them will be based on their relative sizes.
.Pp
As an example, given two databases
-.Ar funny
+.Em funny
and
-.Ar not-funny ,
+.Em not-funny ,
with
-.Ar funny
+.Em funny
twice as big, saying
-.Dl fortune funny not-funny
+.Bd -literal -offset indent
+fortune funny not-funny
+.Ed
+.Pp
will get you fortunes out of
-.Ar funny
+.Em funny
two-thirds of the time.
The command
-.Dl fortune 90% funny 10% not-funny
+.Bd -literal -offset indent
+fortune 90% funny 10% not-funny
+.Ed
+.Pp
will pick out 90% of its fortunes from
-.Ar funny
-(the
-.Dq 10% not-funny
-is unnecessary, since 10% is all that's left).
+.Em funny
+(the ``10% not-funny'' is unnecessary, since 10% is all that's left).
The
.Fl e
option says to consider all files equal;
thus
-.Dl fortune Fl e
+.Bd -literal -offset indent
+fortune -e
+.Ed
+.Pp
is equivalent to
-.Dl fortune 50% funny 50% not-funny
+.Bd -literal -offset indent
+fortune 50% funny 50% not
+.Em -funny
+.Ed
.Sh FILES
-.Pa /usr/share/games/fortune
-.Sh AUTHOR
-Ken Arnold
+.Bl -tag -width Pa -compact
+.It Pa /usr/share/games/fortune
+.El
.Sh SEE ALSO
.Xr regex 3 ,
.Xr regcmp 3 ,
-.Xr strfile(8)
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c
index 01811bf0926..c8b96eaa1ca 100644
--- a/games/fortune/fortune/fortune.c
+++ b/games/fortune/fortune/fortune.c
@@ -1,6 +1,8 @@
+/* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */
+
/*-
- * Copyright (c) 1986 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1986, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ken Arnold.
@@ -35,54 +37,33 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1986 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1986, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)fortune.c 5.13 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: fortune.c,v 1.7 1993/12/04 02:19:49 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $";
+#endif
#endif /* not lint */
-# include <machine/endian.h>
# include <sys/param.h>
# include <sys/stat.h>
+
# include <dirent.h>
-# include <stdio.h>
+# include <fcntl.h>
# include <assert.h>
+# include <unistd.h>
+# include <stdio.h>
+# include <ctype.h>
# include <stdlib.h>
# include <string.h>
-# include <time.h>
# include "strfile.h"
# include "pathnames.h"
-#ifdef SYSV
-# define NO_LOCK
-# define REGCMP
-# ifdef NO_REGEX
-# undef NO_REGEX
-# endif /* NO_REGEX */
-# define index strchr
-# define rindex strrchr
-#endif /* SYSV */
-
-#ifndef NO_REGEX
-# include <ctype.h>
-#endif /* NO_REGEX */
-
-# ifndef NO_LOCK
-# include <sys/file.h>
-# endif /* NO_LOCK */
-
-# ifndef F_OK
-/* codes for access() */
-# define F_OK 0 /* does file exist */
-# define X_OK 1 /* is it executable by caller */
-# define W_OK 2 /* writable by caller */
-# define R_OK 4 /* readable by caller */
-# endif /* F_OK */
-
# define TRUE 1
# define FALSE 0
# define bool short
@@ -91,21 +72,21 @@ static char rcsid[] = "$Id: fortune.c,v 1.7 1993/12/04 02:19:49 jtc Exp $";
# define CPERS 20 /* # of chars for each sec */
# define SLEN 160 /* # of chars in short fortune */
-# define POS_UNKNOWN ((unsigned long) -1) /* pos for file unknown */
+# define POS_UNKNOWN ((off_t) -1) /* pos for file unknown */
# define NO_PROB (-1) /* no prob specified for file */
# ifdef DEBUG
# define DPRINTF(l,x) if (Debug >= l) fprintf x; else
# undef NDEBUG
-# else /* DEBUG */
+# else
# define DPRINTF(l,x)
# define NDEBUG 1
-# endif /* DEBUG */
+# endif
typedef struct fd {
int percent;
int fd, datfd;
- unsigned long pos;
+ off_t pos;
FILE *inf;
char *name;
char *path;
@@ -145,12 +126,44 @@ FILEDESC *Fortfile; /* Fortune file to use */
STRFILE Noprob_tbl; /* sum of data for all no prob files */
-char *do_malloc(), *copy(), *off_name();
-
-FILEDESC *pick_child(), *new_fp();
+int add_dir __P((FILEDESC *));
+int add_file __P((int,
+ char *, char *, FILEDESC **, FILEDESC **, FILEDESC *));
+void all_forts __P((FILEDESC *, char *));
+char *copy __P((char *, u_int));
+void display __P((FILEDESC *));
+void do_free __P((void *));
+void *do_malloc __P((u_int));
+int form_file_list __P((char **, int));
+int fortlen __P((void));
+void get_fort __P((void));
+void get_pos __P((FILEDESC *));
+void get_tbl __P((FILEDESC *));
+void getargs __P((int, char *[]));
+void init_prob __P((void));
+int is_dir __P((char *));
+int is_fortfile __P((char *, char **, char **, int));
+int is_off_name __P((char *));
+int max __P((int, int));
+FILEDESC *
+ new_fp __P((void));
+char *off_name __P((char *));
+void open_dat __P((FILEDESC *));
+void open_fp __P((FILEDESC *));
+FILEDESC *
+ pick_child __P((FILEDESC *));
+void print_file_list __P((void));
+void print_list __P((FILEDESC *, int));
+void sum_noprobs __P((FILEDESC *));
+void sum_tbl __P((STRFILE *, STRFILE *));
+void usage __P((void));
+void zero_tbl __P((STRFILE *));
-#ifndef NO_REGEX
-char *conv_pat();
+#ifndef NO_REGEX
+char *conv_pat __P((char *));
+int find_matches __P((void));
+void matches_in_list __P((FILEDESC *));
+int maxlen_in_list __P((FILEDESC *));
#endif
#ifndef NO_REGEX
@@ -167,15 +180,10 @@ char *regcmp(), *regex();
# define BAD_COMP(f) ((f) != NULL)
# define RE_EXEC(p) re_exec(p)
-char *re_comp();
-#ifdef SYSV
-char *re_exec();
-#else
-int re_exec();
-#endif
#endif
#endif
+int
main(ac, av)
int ac;
char *av[];
@@ -229,6 +237,7 @@ char *av[];
/* NOTREACHED */
}
+void
display(fp)
FILEDESC *fp;
{
@@ -236,7 +245,7 @@ FILEDESC *fp;
char line[BUFSIZ];
open_fp(fp);
- (void) fseek(fp->inf, Seekpts[0], 0);
+ (void) fseek(fp->inf, (long)Seekpts[0], 0);
for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL &&
!STR_ENDSTRING(line, fp->tbl); Fort_len++) {
if (fp->tbl.str_flags & STR_ROTATED)
@@ -254,6 +263,7 @@ FILEDESC *fp;
* fortlen:
* Return the length of the fortune.
*/
+int
fortlen()
{
register int nchar;
@@ -263,7 +273,7 @@ fortlen()
nchar = (Seekpts[1] - Seekpts[0] <= SLEN);
else {
open_fp(Fortfile);
- (void) fseek(Fortfile->inf, Seekpts[0], 0);
+ (void) fseek(Fortfile->inf, (long)Seekpts[0], 0);
nchar = 0;
while (fgets(line, sizeof line, Fortfile->inf) != NULL &&
!STR_ENDSTRING(line, Fortfile->tbl))
@@ -276,20 +286,20 @@ fortlen()
/*
* This routine evaluates the arguments on the command line
*/
+void
getargs(argc, argv)
register int argc;
register char **argv;
{
register int ignore_case;
# ifndef NO_REGEX
- register char *pat = NULL; /* 29 Sep 92*/
+ register char *pat = NULL;
# endif /* NO_REGEX */
extern char *optarg;
extern int optind;
int ch;
ignore_case = FALSE;
- /* pat = NULL;*/ /* 29 Sep 92*/
# ifdef DEBUG
while ((ch = getopt(argc, argv, "aDefilm:osw")) != EOF)
@@ -377,6 +387,7 @@ register char **argv;
* form_file_list:
* Form the file list from the file specifications.
*/
+int
form_file_list(files, file_cnt)
register char **files;
register int file_cnt;
@@ -436,6 +447,7 @@ register int file_cnt;
* add_file:
* Add a file to the file list.
*/
+int
add_file(percent, file, dir, head, tail, parent)
int percent;
register char *file;
@@ -602,6 +614,7 @@ char *file;
* is_off_name:
* Is the file an offensive-style name?
*/
+int
is_off_name(file)
char *file;
{
@@ -616,6 +629,7 @@ char *file;
* Modify a FILEDESC element to be the parent of two children if
* there are two children to be a parent of.
*/
+void
all_forts(fp, offensive)
register FILEDESC *fp;
char *offensive;
@@ -665,11 +679,12 @@ char *offensive;
* add_dir:
* Add the contents of an entire directory.
*/
+int
add_dir(fp)
register FILEDESC *fp;
{
register DIR *dir;
- register struct dirent *dirent;
+ register struct dirent *dirent;
auto FILEDESC *tailp;
auto char *name;
@@ -703,6 +718,7 @@ register FILEDESC *fp;
* is_dir:
* Return TRUE if the file is a directory, FALSE otherwise.
*/
+int
is_dir(file)
char *file;
{
@@ -721,9 +737,9 @@ char *file;
* suffixes, as contained in suflist[], are ruled out.
*/
/* ARGSUSED */
+int
is_fortfile(file, datp, posp, check_for_offend)
-char *file;
-char **datp, **posp;
+char *file, **datp, **posp;
int check_for_offend;
{
register int i;
@@ -809,11 +825,11 @@ unsigned int len;
* do_malloc:
* Do a malloc, checking for NULL return.
*/
-char *
+void *
do_malloc(size)
unsigned int size;
{
- char *new;
+ void *new;
if ((new = malloc(size)) == NULL) {
(void) fprintf(stderr, "fortune: out of memory.\n");
@@ -826,8 +842,9 @@ unsigned int size;
* do_free:
* Free malloc'ed space, if any.
*/
+void
do_free(ptr)
-char *ptr;
+void *ptr;
{
if (ptr != NULL)
free(ptr);
@@ -837,6 +854,7 @@ char *ptr;
* init_prob:
* Initialize the fortune probabilities.
*/
+void
init_prob()
{
register FILEDESC *fp, *last;
@@ -908,6 +926,7 @@ init_prob()
* get_fort:
* Get the fortune data file's seek pointer for the next fortune.
*/
+void
get_fort()
{
register FILEDESC *fp;
@@ -1007,6 +1026,7 @@ FILEDESC *parent;
* sum_noprobs:
* Sum up all the noprob probabilities, starting with fp.
*/
+void
sum_noprobs(fp)
register FILEDESC *fp;
{
@@ -1023,6 +1043,7 @@ register FILEDESC *fp;
did_noprobs = TRUE;
}
+int
max(i, j)
register int i, j;
{
@@ -1033,6 +1054,7 @@ register int i, j;
* open_fp:
* Assocatiate a FILE * with the given FILEDESC.
*/
+void
open_fp(fp)
FILEDESC *fp;
{
@@ -1046,6 +1068,7 @@ FILEDESC *fp;
* open_dat:
* Open up the dat file if we need to.
*/
+void
open_dat(fp)
FILEDESC *fp;
{
@@ -1060,6 +1083,7 @@ FILEDESC *fp;
* Get the position from the pos file, if there is one. If not,
* return a random number.
*/
+void
get_pos(fp)
FILEDESC *fp;
{
@@ -1083,13 +1107,14 @@ FILEDESC *fp;
}
if (++(fp->pos) >= fp->tbl.str_numstr)
fp->pos -= fp->tbl.str_numstr;
- DPRINTF(1, (stderr, "pos for %s is %d\n", fp->name, fp->pos));
+ DPRINTF(1, (stderr, "pos for %s is %qd\n", fp->name, fp->pos));
}
/*
* get_tbl:
* Get the tbl data file the datfile.
*/
+void
get_tbl(fp)
FILEDESC *fp;
{
@@ -1129,6 +1154,7 @@ FILEDESC *fp;
* zero_tbl:
* Zero out the fields we care about in a tbl structure.
*/
+void
zero_tbl(tp)
register STRFILE *tp;
{
@@ -1141,6 +1167,7 @@ register STRFILE *tp;
* sum_tbl:
* Merge the tbl data of t2 into t1.
*/
+void
sum_tbl(t1, t2)
register STRFILE *t1, *t2;
{
@@ -1157,6 +1184,7 @@ register STRFILE *t1, *t2;
* print_file_list:
* Print out the file list
*/
+void
print_file_list()
{
print_list(File_list, 0);
@@ -1166,6 +1194,7 @@ print_file_list()
* print_list:
* Print out the actual list, recursively.
*/
+void
print_list(list, lev)
register FILEDESC *list;
int lev;
@@ -1234,6 +1263,7 @@ register char *orig;
* find_matches:
* Find all the fortunes which match the pattern we've been given.
*/
+int
find_matches()
{
Fort_len = maxlen_in_list(File_list);
@@ -1251,6 +1281,7 @@ find_matches()
* maxlen_in_list
* Return the maximum fortune len in the file list.
*/
+int
maxlen_in_list(list)
FILEDESC *list;
{
@@ -1276,6 +1307,7 @@ FILEDESC *list;
* matches_in_list
* Print out the matches from the files in the list.
*/
+void
matches_in_list(list)
FILEDESC *list;
{
@@ -1314,6 +1346,7 @@ FILEDESC *list;
}
# endif /* NO_REGEX */
+void
usage()
{
(void) fprintf(stderr, "fortune [-a");
diff --git a/games/fortune/fortune/pathnames.h b/games/fortune/fortune/pathnames.h
index 739cc60c51a..b74569f8cb5 100644
--- a/games/fortune/fortune/pathnames.h
+++ b/games/fortune/fortune/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/23 08:28:42 cgd Exp $ */
+
/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.2 (Berkeley) 4/8/91
- * $Id: pathnames.h,v 1.2 1993/08/01 18:54:47 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define FORTDIR "/usr/share/games/fortune"
diff --git a/games/fortune/strfile/Makefile b/games/fortune/strfile/Makefile
index 8bc089340bf..a8847445274 100644
--- a/games/fortune/strfile/Makefile
+++ b/games/fortune/strfile/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 4/27/91
-# $Id: Makefile,v 1.4 1994/12/22 09:34:17 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/23 08:28:44 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= strfile
MAN= strfile.8
diff --git a/games/fortune/strfile/strfile.8 b/games/fortune/strfile/strfile.8
index 9178f49d8a2..9883610380a 100644
--- a/games/fortune/strfile/strfile.8
+++ b/games/fortune/strfile/strfile.8
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: strfile.8,v 1.3 1995/03/23 08:28:45 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\"
.\" This code is derived from software contributed to Berkeley by
@@ -33,10 +35,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)strfile.8 5.9 (Berkeley) 3/16/91
-.\" $Id: strfile.8,v 1.2 1993/08/01 07:46:52 mycroft Exp $
+.\" @(#)strfile.8 8.1 (Berkeley) 6/9/93
.\"
-.Dd March 16, 1991
+.Dd June 9, 1993
.Dt STRFILE 8
.Os BSD 4
.Sh NAME
@@ -143,6 +144,5 @@ default output file.
.El
.Sh HISTORY
The
-.Nm
-command
-.Ud
+.Nm strfile
+utility first appeared in 4.4BSD.
diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c
index 47246c08d92..3b8b20d8c75 100644
--- a/games/fortune/strfile/strfile.c
+++ b/games/fortune/strfile/strfile.c
@@ -1,6 +1,8 @@
+/* $NetBSD: strfile.c,v 1.3 1995/03/23 08:28:47 cgd Exp $ */
+
/*-
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ken Arnold.
@@ -35,14 +37,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)strfile.c 5.12 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: strfile.c,v 1.2 1993/08/01 18:54:43 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: strfile.c,v 1.3 1995/03/23 08:28:47 cgd Exp $";
+#endif
#endif /* not lint */
# include <machine/endian.h>
diff --git a/games/fortune/strfile/strfile.h b/games/fortune/strfile/strfile.h
index 1000a88636e..48efc747115 100644
--- a/games/fortune/strfile/strfile.h
+++ b/games/fortune/strfile/strfile.h
@@ -1,6 +1,8 @@
+/* $NetBSD: strfile.h,v 1.3 1995/03/23 08:28:49 cgd Exp $ */
+
/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ken Arnold.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)strfile.h 5.8 (Berkeley) 4/8/91
- * $Id: strfile.h,v 1.2 1993/08/01 18:54:44 mycroft Exp $
+ * @(#)strfile.h 8.1 (Berkeley) 5/31/93
*/
#define STR_ENDSTRING(line,tbl) \
diff --git a/games/fortune/tools/Do_spell b/games/fortune/tools/Do_spell
index d997392e619..1961a112823 100644
--- a/games/fortune/tools/Do_spell
+++ b/games/fortune/tools/Do_spell
@@ -1,4 +1,5 @@
#!/bin/sh -
+# $NetBSD: Do_spell,v 1.2 1995/03/23 08:28:50 cgd Exp $
#
# @(#)Do_spell 8.1 (Berkeley) 5/31/93
#
diff --git a/games/fortune/tools/Do_troff b/games/fortune/tools/Do_troff
index 52cb282b898..6df4ee623de 100644
--- a/games/fortune/tools/Do_troff
+++ b/games/fortune/tools/Do_troff
@@ -1,4 +1,5 @@
#!/bin/csh -f
+# $NetBSD: Do_troff,v 1.2 1995/03/23 08:28:52 cgd Exp $
#
# @(#)Do_troff 8.1 (Berkeley) 5/31/93
#
diff --git a/games/fortune/tools/Troff.mac b/games/fortune/tools/Troff.mac
index c2b433e1b21..43231f3b7ee 100644
--- a/games/fortune/tools/Troff.mac
+++ b/games/fortune/tools/Troff.mac
@@ -1,3 +1,5 @@
+.\" $NetBSD: Troff.mac,v 1.2 1995/03/23 08:28:53 cgd Exp $
+.\"
.nr tp 8
.nr hm 3v
.nr fm 2v
diff --git a/games/fortune/tools/do_sort b/games/fortune/tools/do_sort
index b868a4c22b3..ddae1ace5df 100644
--- a/games/fortune/tools/do_sort
+++ b/games/fortune/tools/do_sort
@@ -1,4 +1,5 @@
#! /bin/sh
+# $NetBSD: do_sort,v 1.2 1995/03/23 08:28:54 cgd Exp $
#
# @(#)do_sort 8.1 (Berkeley) 5/31/93
#
diff --git a/games/fortune/unstr/Makefile b/games/fortune/unstr/Makefile
index c884c67d3e2..2619580a583 100644
--- a/games/fortune/unstr/Makefile
+++ b/games/fortune/unstr/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 4/27/91
-# $Id: Makefile,v 1.2 1993/08/01 05:45:17 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/23 08:28:58 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= unstr
NOMAN= noman
diff --git a/games/fortune/unstr/unstr.c b/games/fortune/unstr/unstr.c
index 59bd4b68f6c..5ea33d26341 100644
--- a/games/fortune/unstr/unstr.c
+++ b/games/fortune/unstr/unstr.c
@@ -1,6 +1,8 @@
+/* $NetBSD: unstr.c,v 1.3 1995/03/23 08:29:00 cgd Exp $ */
+
/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ken Arnold.
@@ -35,14 +37,13 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1991 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1991, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)unstr.c 5.8 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: unstr.c,v 1.2 1993/08/01 18:54:39 mycroft Exp $";
+static char sccsid[] = "@(#)unstr.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
/*
diff --git a/games/hack/COPYRIGHT b/games/hack/COPYRIGHT
index 71a94494a8a..d71c09f5f7e 100644
--- a/games/hack/COPYRIGHT
+++ b/games/hack/COPYRIGHT
@@ -1,3 +1,5 @@
+$NetBSD: COPYRIGHT,v 1.2 1995/03/23 08:29:05 cgd Exp $
+
This entire subtree is copyright the Stichting Mathematisch Centrum.
The following copyright notice applies to all files found here. None of
these files contain AT&T proprietary source code.
diff --git a/games/hack/Makefile b/games/hack/Makefile
index 8058104e035..4fa0fc045d0 100644
--- a/games/hack/Makefile
+++ b/games/hack/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.10 (Berkeley) 12/8/90
-# $Id: Makefile,v 1.15 1994/12/22 09:34:30 cgd Exp $
+# $NetBSD: Makefile,v 1.16 1995/03/23 08:29:07 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= hack
CFLAGS+=-I.
diff --git a/games/hack/Makequest b/games/hack/Makequest
index 9271c2841c9..256d8363155 100644
--- a/games/hack/Makequest
+++ b/games/hack/Makequest
@@ -1,3 +1,5 @@
+# $NetBSD: Makequest,v 1.2 1995/03/23 08:29:08 cgd Exp $
+#
# Hack or Quest Makefile.
# on some systems the termcap library is in -ltermcap
diff --git a/games/hack/Original_READ_ME b/games/hack/Original_READ_ME
index 9d2070be09e..3787a9d101e 100644
--- a/games/hack/Original_READ_ME
+++ b/games/hack/Original_READ_ME
@@ -1,3 +1,5 @@
+$NetBSD: Original_READ_ME,v 1.2 1995/03/23 08:29:10 cgd Exp $
+
This is export hack, my first semester programming project.
To set it up for your system, you will have to do the following:
diff --git a/games/hack/READ_ME b/games/hack/READ_ME
index cfe6ca2fe3e..0f3aa89bafc 100644
--- a/games/hack/READ_ME
+++ b/games/hack/READ_ME
@@ -1,3 +1,5 @@
+$NetBSD: READ_ME,v 1.2 1995/03/23 08:29:12 cgd Exp $
+
Hack is a display oriented dungeons & dragons - like game.
Both display and command structure resemble rogue.
(For a game with the same structure but entirely different display -
diff --git a/games/hack/alloc.c b/games/hack/alloc.c
index 60bf4da558f..f64cc1952a3 100644
--- a/games/hack/alloc.c
+++ b/games/hack/alloc.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: alloc.c,v 1.2 1993/08/02 17:19:10 mycroft Exp $";
+static char rcsid[] = "$NetBSD: alloc.c,v 1.3 1995/03/23 08:29:14 cgd Exp $";
#endif /* not lint */
#ifdef LINT
diff --git a/games/hack/config.h b/games/hack/config.h
index 1af52672441..f7bb5c5c171 100644
--- a/games/hack/config.h
+++ b/games/hack/config.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: config.h,v 1.2 1993/08/02 17:16:36 mycroft Exp $
+ * $NetBSD: config.h,v 1.3 1995/03/23 08:29:15 cgd Exp $
*/
#include "pathnames.h"
diff --git a/games/hack/date.h b/games/hack/date.h
index 36df5333f15..0320b698e2b 100644
--- a/games/hack/date.h
+++ b/games/hack/date.h
@@ -1,3 +1,3 @@
-/* $Id: date.h,v 1.2 1993/08/02 17:16:38 mycroft Exp $ */
+/* $NetBSD: date.h,v 1.3 1995/03/23 08:29:17 cgd Exp $ */
char datestring[] = "Tue Jul 23 1985";
diff --git a/games/hack/def.edog.h b/games/hack/def.edog.h
index 92eabfd183c..00fa911f2e6 100644
--- a/games/hack/def.edog.h
+++ b/games/hack/def.edog.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.edog.h,v 1.2 1993/08/02 17:16:39 mycroft Exp $
+ * $NetBSD: def.edog.h,v 1.3 1995/03/23 08:29:18 cgd Exp $
*/
struct edog {
diff --git a/games/hack/def.eshk.h b/games/hack/def.eshk.h
index 075be7dffd6..781c3461a7b 100644
--- a/games/hack/def.eshk.h
+++ b/games/hack/def.eshk.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.eshk.h,v 1.2 1993/08/02 17:16:41 mycroft Exp $
+ * $NetBSD: def.eshk.h,v 1.3 1995/03/23 08:29:21 cgd Exp $
*/
#define BILLSZ 200
diff --git a/games/hack/def.flag.h b/games/hack/def.flag.h
index 9401be49999..2fff1d3fc6e 100644
--- a/games/hack/def.flag.h
+++ b/games/hack/def.flag.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.flag.h,v 1.2 1993/08/02 17:16:42 mycroft Exp $
+ * $NetBSD: def.flag.h,v 1.3 1995/03/23 08:29:22 cgd Exp $
*/
struct flag {
diff --git a/games/hack/def.func_tab.h b/games/hack/def.func_tab.h
index ca1fd352d28..363c8f3b381 100644
--- a/games/hack/def.func_tab.h
+++ b/games/hack/def.func_tab.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.func_tab.h,v 1.2 1993/08/02 17:16:43 mycroft Exp $
+ * $NetBSD: def.func_tab.h,v 1.3 1995/03/23 08:29:23 cgd Exp $
*/
struct func_tab {
diff --git a/games/hack/def.gen.h b/games/hack/def.gen.h
index 87323845fa4..56e4832bac9 100644
--- a/games/hack/def.gen.h
+++ b/games/hack/def.gen.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.gen.h,v 1.2 1993/08/02 17:16:44 mycroft Exp $
+ * $NetBSD: def.gen.h,v 1.3 1995/03/23 08:29:25 cgd Exp $
*/
struct gen {
diff --git a/games/hack/def.gold.h b/games/hack/def.gold.h
index 5564d3b1418..7333bdd5c05 100644
--- a/games/hack/def.gold.h
+++ b/games/hack/def.gold.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.gold.h,v 1.2 1993/08/02 17:16:45 mycroft Exp $
+ * $NetBSD: def.gold.h,v 1.3 1995/03/23 08:29:27 cgd Exp $
*/
struct gold {
diff --git a/games/hack/def.mkroom.h b/games/hack/def.mkroom.h
index 8b1ce799763..45c215619e0 100644
--- a/games/hack/def.mkroom.h
+++ b/games/hack/def.mkroom.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.mkroom.h,v 1.2 1993/08/02 17:16:46 mycroft Exp $
+ * $NetBSD: def.mkroom.h,v 1.3 1995/03/23 08:29:29 cgd Exp $
*/
struct mkroom {
diff --git a/games/hack/def.monst.h b/games/hack/def.monst.h
index de545f306d3..6d883eaff77 100644
--- a/games/hack/def.monst.h
+++ b/games/hack/def.monst.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.monst.h,v 1.2 1993/08/02 17:16:48 mycroft Exp $
+ * $NetBSD: def.monst.h,v 1.3 1995/03/23 08:29:30 cgd Exp $
*/
struct monst {
diff --git a/games/hack/def.obj.h b/games/hack/def.obj.h
index 818f0653c1d..897046f23bb 100644
--- a/games/hack/def.obj.h
+++ b/games/hack/def.obj.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.obj.h,v 1.2 1993/08/02 17:16:49 mycroft Exp $
+ * $NetBSD: def.obj.h,v 1.3 1995/03/23 08:29:32 cgd Exp $
*/
struct obj {
diff --git a/games/hack/def.objclass.h b/games/hack/def.objclass.h
index fa79f68c7ed..15f7f98d975 100644
--- a/games/hack/def.objclass.h
+++ b/games/hack/def.objclass.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.objclass.h,v 1.2 1993/08/02 17:16:50 mycroft Exp $
+ * $NetBSD: def.objclass.h,v 1.3 1995/03/23 08:29:34 cgd Exp $
*/
/* definition of a class of objects */
diff --git a/games/hack/def.objects.h b/games/hack/def.objects.h
index a7b0138d9e1..3876c2aa5c7 100644
--- a/games/hack/def.objects.h
+++ b/games/hack/def.objects.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.objects.h,v 1.2 1993/08/02 17:16:51 mycroft Exp $
+ * $NetBSD: def.objects.h,v 1.3 1995/03/23 08:29:36 cgd Exp $
*/
/* objects have letter " % ) ( 0 _ ` [ ! ? / = * */
diff --git a/games/hack/def.permonst.h b/games/hack/def.permonst.h
index 2967c1eff40..d3c75f47dae 100644
--- a/games/hack/def.permonst.h
+++ b/games/hack/def.permonst.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.permonst.h,v 1.2 1993/08/02 17:16:52 mycroft Exp $
+ * $NetBSD: def.permonst.h,v 1.3 1995/03/23 08:29:37 cgd Exp $
*/
struct permonst {
diff --git a/games/hack/def.rm.h b/games/hack/def.rm.h
index f9b6b4becbf..b4ffc81c172 100644
--- a/games/hack/def.rm.h
+++ b/games/hack/def.rm.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.rm.h,v 1.2 1993/08/02 17:16:53 mycroft Exp $
+ * $NetBSD: def.rm.h,v 1.3 1995/03/23 08:29:39 cgd Exp $
*/
/* Level location types */
diff --git a/games/hack/def.trap.h b/games/hack/def.trap.h
index 344456697d4..55477e482f4 100644
--- a/games/hack/def.trap.h
+++ b/games/hack/def.trap.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.trap.h,v 1.2 1993/08/02 17:16:54 mycroft Exp $
+ * $NetBSD: def.trap.h,v 1.3 1995/03/23 08:29:41 cgd Exp $
*/
struct trap {
diff --git a/games/hack/def.wseg.h b/games/hack/def.wseg.h
index add0b2434a7..35812db3752 100644
--- a/games/hack/def.wseg.h
+++ b/games/hack/def.wseg.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: def.wseg.h,v 1.2 1993/08/02 17:16:55 mycroft Exp $
+ * $NetBSD: def.wseg.h,v 1.3 1995/03/23 08:29:42 cgd Exp $
*/
#ifndef NOWORM
diff --git a/games/hack/hack.6 b/games/hack/hack.6
index 36749408c2b..42af6082c73 100644
--- a/games/hack/hack.6
+++ b/games/hack/hack.6
@@ -1,4 +1,4 @@
-.\" $Id: hack.6,v 1.3 1993/08/05 17:35:08 jtc Exp $ -*- nroff -*-
+.\" $NetBSD: hack.6,v 1.4 1995/03/23 08:29:44 cgd Exp $ -*- nroff -*-
.Dd March 31, 1985
.Dt HACK 6
.Os
@@ -32,13 +32,13 @@ To win the game (as opposed to merely playing to beat other people high
scores) you must locate the Amulet of Yendor which is somewhere below
the 20th level of the dungeon and get it out. Nobody has achieved this
yet and if somebody does, he will probably go down in history as a hero
-among heros.
+among heroes.
.Pp
When the game ends, either by your death, when you quit, or if you escape
from the caves,
.Nm hack
will give you (a fragment of) the list of top scorers. The scoring
-is based on many aspects of your behaviour but a rough estimate is
+is based on many aspects of your behavior but a rough estimate is
obtained by taking the amount of gold you've found in the cave plus four
times your (real) experience. Precious stones may be worth a lot of gold
when brought to the exit.
diff --git a/games/hack/hack.Decl.c b/games/hack/hack.Decl.c
index af66c621ee2..c7688dc6981 100644
--- a/games/hack/hack.Decl.c
+++ b/games/hack/hack.Decl.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.Decl.c,v 1.2 1993/08/02 17:16:57 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.Decl.c,v 1.3 1995/03/23 08:29:45 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c
index dc51290571f..46bdc64f56c 100644
--- a/games/hack/hack.apply.c
+++ b/games/hack/hack.apply.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.apply.c,v 1.3 1993/08/02 17:16:58 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.apply.c,v 1.4 1995/03/23 08:29:47 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.bones.c b/games/hack/hack.bones.c
index 75bd7cd0f0a..b495294c94b 100644
--- a/games/hack/hack.bones.c
+++ b/games/hack/hack.bones.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.bones.c,v 1.2 1993/08/02 17:16:59 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.bones.c,v 1.3 1995/03/23 08:29:48 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.c b/games/hack/hack.c
index b8af9323034..5261e183b33 100644
--- a/games/hack/hack.c
+++ b/games/hack/hack.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.c,v 1.2 1993/08/02 17:17:01 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.c,v 1.3 1995/03/23 08:29:50 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.cmd.c b/games/hack/hack.cmd.c
index f0034859728..0af29895588 100644
--- a/games/hack/hack.cmd.c
+++ b/games/hack/hack.cmd.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.cmd.c,v 1.2 1993/08/02 17:17:02 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.cmd.c,v 1.3 1995/03/23 08:29:52 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.do.c b/games/hack/hack.do.c
index 7e7fd765178..aec8b91176b 100644
--- a/games/hack/hack.do.c
+++ b/games/hack/hack.do.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.do.c,v 1.2 1993/08/02 17:17:03 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.do.c,v 1.3 1995/03/23 08:29:53 cgd Exp $";
#endif /* not lint */
/* Contains code for 'd', 'D' (drop), '>', '<' (up, down) and 't' (throw) */
diff --git a/games/hack/hack.do_name.c b/games/hack/hack.do_name.c
index baf45a2f372..313b55339c4 100644
--- a/games/hack/hack.do_name.c
+++ b/games/hack/hack.do_name.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.do_name.c,v 1.2 1993/08/02 17:17:05 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.do_name.c,v 1.3 1995/03/23 08:29:56 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.do_wear.c b/games/hack/hack.do_wear.c
index 84021b7d623..2084b630201 100644
--- a/games/hack/hack.do_wear.c
+++ b/games/hack/hack.do_wear.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.do_wear.c,v 1.2 1993/08/02 17:17:06 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.do_wear.c,v 1.3 1995/03/23 08:29:57 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c
index 06a23330538..d9192a4c7c5 100644
--- a/games/hack/hack.dog.c
+++ b/games/hack/hack.dog.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.dog.c,v 1.2 1993/08/02 17:17:07 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.dog.c,v 1.3 1995/03/23 08:29:59 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.eat.c b/games/hack/hack.eat.c
index 94a25b558ad..7745f63feb2 100644
--- a/games/hack/hack.eat.c
+++ b/games/hack/hack.eat.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.eat.c,v 1.2 1993/08/02 17:17:08 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.eat.c,v 1.3 1995/03/23 08:30:01 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.end.c b/games/hack/hack.end.c
index c103d9458b1..20b77e4f689 100644
--- a/games/hack/hack.end.c
+++ b/games/hack/hack.end.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.end.c,v 1.2 1993/08/02 17:17:10 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.end.c,v 1.3 1995/03/23 08:30:05 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.engrave.c b/games/hack/hack.engrave.c
index a51f9a5de73..e32807d3ff1 100644
--- a/games/hack/hack.engrave.c
+++ b/games/hack/hack.engrave.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.engrave.c,v 1.2 1993/08/02 17:17:11 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.engrave.c,v 1.3 1995/03/23 08:30:08 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.fight.c b/games/hack/hack.fight.c
index 1701915eadb..92d11c2ea4a 100644
--- a/games/hack/hack.fight.c
+++ b/games/hack/hack.fight.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.fight.c,v 1.2 1993/08/02 17:17:12 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.fight.c,v 1.3 1995/03/23 08:30:12 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.fix b/games/hack/hack.fix
index 01e6460247d..c01616ce1b1 100644
--- a/games/hack/hack.fix
+++ b/games/hack/hack.fix
@@ -1,3 +1,5 @@
+$NetBSD: hack.fix,v 1.2 1995/03/23 08:30:17 cgd Exp $
+
/***** unido:net.games.hack / ab / 7:23 pm Sep 13, 1985*/
Recently hack (1.0.3) crashed with core dumps during some good games.
diff --git a/games/hack/hack.h b/games/hack/hack.h
index 3acd6845e80..f097252fe8f 100644
--- a/games/hack/hack.h
+++ b/games/hack/hack.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: hack.h,v 1.2 1993/08/02 17:17:14 mycroft Exp $
+ * $NetBSD: hack.h,v 1.3 1995/03/23 08:30:21 cgd Exp $
*/
#include "config.h"
diff --git a/games/hack/hack.invent.c b/games/hack/hack.invent.c
index e971d1a005b..3cc42763a1d 100644
--- a/games/hack/hack.invent.c
+++ b/games/hack/hack.invent.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.invent.c,v 1.3 1993/08/02 17:17:15 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.invent.c,v 1.4 1995/03/23 08:30:25 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.ioctl.c b/games/hack/hack.ioctl.c
index 714dcc51737..af62748fe56 100644
--- a/games/hack/hack.ioctl.c
+++ b/games/hack/hack.ioctl.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.ioctl.c,v 1.3 1995/01/07 04:36:41 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.ioctl.c,v 1.4 1995/03/23 08:30:29 cgd Exp $";
#endif /* not lint */
/* This cannot be part of hack.tty.c (as it was earlier) since on some
diff --git a/games/hack/hack.lev.c b/games/hack/hack.lev.c
index d69ea65efa2..e15d39ee0fd 100644
--- a/games/hack/hack.lev.c
+++ b/games/hack/hack.lev.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.lev.c,v 1.2 1993/08/02 17:17:17 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.lev.c,v 1.3 1995/03/23 08:30:32 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c
index ab6daa5cba7..cdec0b2557e 100644
--- a/games/hack/hack.main.c
+++ b/games/hack/hack.main.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.main.c,v 1.2 1993/08/02 17:17:18 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.main.c,v 1.3 1995/03/23 08:30:35 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
diff --git a/games/hack/hack.makemon.c b/games/hack/hack.makemon.c
index 6b4df69f517..f7fc0ecbe55 100644
--- a/games/hack/hack.makemon.c
+++ b/games/hack/hack.makemon.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.makemon.c,v 1.2 1993/08/02 17:17:19 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.makemon.c,v 1.3 1995/03/23 08:30:38 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.mfndpos.h b/games/hack/hack.mfndpos.h
index 8630dd2b166..f7c98a3ec90 100644
--- a/games/hack/hack.mfndpos.h
+++ b/games/hack/hack.mfndpos.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $Id: hack.mfndpos.h,v 1.2 1993/08/02 17:17:20 mycroft Exp $
+ * $NetBSD: hack.mfndpos.h,v 1.3 1995/03/23 08:30:41 cgd Exp $
*/
#define ALLOW_TRAPS 0777
diff --git a/games/hack/hack.mhitu.c b/games/hack/hack.mhitu.c
index a3b1393b79b..430bfa42204 100644
--- a/games/hack/hack.mhitu.c
+++ b/games/hack/hack.mhitu.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mhitu.c,v 1.2 1993/08/02 17:17:21 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mhitu.c,v 1.3 1995/03/23 08:30:42 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c
index d69021436a9..5e8c7b51f04 100644
--- a/games/hack/hack.mklev.c
+++ b/games/hack/hack.mklev.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mklev.c,v 1.2 1993/08/02 17:17:23 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mklev.c,v 1.3 1995/03/23 08:30:43 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.mkmaze.c b/games/hack/hack.mkmaze.c
index 84a1453a367..f69fe864679 100644
--- a/games/hack/hack.mkmaze.c
+++ b/games/hack/hack.mkmaze.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mkmaze.c,v 1.2 1993/08/02 17:17:24 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mkmaze.c,v 1.3 1995/03/23 08:30:46 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.mkobj.c b/games/hack/hack.mkobj.c
index 788283a3573..d4e37fd7928 100644
--- a/games/hack/hack.mkobj.c
+++ b/games/hack/hack.mkobj.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mkobj.c,v 1.2 1993/08/02 17:17:25 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mkobj.c,v 1.3 1995/03/23 08:30:47 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.mkshop.c b/games/hack/hack.mkshop.c
index d11e9540882..4ecc92af1e9 100644
--- a/games/hack/hack.mkshop.c
+++ b/games/hack/hack.mkshop.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mkshop.c,v 1.3 1993/08/02 17:17:26 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mkshop.c,v 1.4 1995/03/23 08:30:50 cgd Exp $";
#endif /* not lint */
#include <stdlib.h>
diff --git a/games/hack/hack.mon.c b/games/hack/hack.mon.c
index c66c936f184..de3ddb3c72b 100644
--- a/games/hack/hack.mon.c
+++ b/games/hack/hack.mon.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.mon.c,v 1.2 1993/08/02 17:17:28 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.mon.c,v 1.3 1995/03/23 08:30:57 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.monst.c b/games/hack/hack.monst.c
index 4869e55cfcc..5cd2338263b 100644
--- a/games/hack/hack.monst.c
+++ b/games/hack/hack.monst.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.monst.c,v 1.2 1993/08/02 17:17:29 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.monst.c,v 1.3 1995/03/23 08:31:03 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.o_init.c b/games/hack/hack.o_init.c
index fb4f7396742..ccda56b589d 100644
--- a/games/hack/hack.o_init.c
+++ b/games/hack/hack.o_init.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.o_init.c,v 1.2 1993/08/02 17:17:30 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.o_init.c,v 1.3 1995/03/23 08:31:06 cgd Exp $";
#endif /* not lint */
#include "config.h" /* for typedefs */
diff --git a/games/hack/hack.objnam.c b/games/hack/hack.objnam.c
index 533ef17c3d6..2ab2f2ae43e 100644
--- a/games/hack/hack.objnam.c
+++ b/games/hack/hack.objnam.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.objnam.c,v 1.2 1993/08/02 17:17:31 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.objnam.c,v 1.3 1995/03/23 08:31:10 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.options.c b/games/hack/hack.options.c
index 941fa58b7f0..078ec7f0de9 100644
--- a/games/hack/hack.options.c
+++ b/games/hack/hack.options.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.options.c,v 1.2 1993/08/02 17:19:12 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.options.c,v 1.3 1995/03/23 08:31:14 cgd Exp $";
#endif /* not lint */
#include "config.h"
diff --git a/games/hack/hack.pager.c b/games/hack/hack.pager.c
index b9e4ba41b1b..0e3d6817347 100644
--- a/games/hack/hack.pager.c
+++ b/games/hack/hack.pager.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.pager.c,v 1.3 1995/02/28 18:31:36 jtc Exp $";
+static char rcsid[] = "$NetBSD: hack.pager.c,v 1.4 1995/03/23 08:31:16 cgd Exp $";
#endif /* not lint */
/* This file contains the command routine dowhatis() and a pager. */
diff --git a/games/hack/hack.potion.c b/games/hack/hack.potion.c
index 9b0d70f43eb..ed71901d9a1 100644
--- a/games/hack/hack.potion.c
+++ b/games/hack/hack.potion.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.potion.c,v 1.2 1993/08/02 17:19:14 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.potion.c,v 1.3 1995/03/23 08:31:18 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.pri.c b/games/hack/hack.pri.c
index 7e5eb893282..0a8606ace69 100644
--- a/games/hack/hack.pri.c
+++ b/games/hack/hack.pri.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.pri.c,v 1.3 1993/12/02 03:07:18 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.pri.c,v 1.4 1995/03/23 08:31:20 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.read.c b/games/hack/hack.read.c
index 5c7840e11d5..7fbbf8a7e33 100644
--- a/games/hack/hack.read.c
+++ b/games/hack/hack.read.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.read.c,v 1.2 1993/08/02 17:19:17 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.read.c,v 1.3 1995/03/23 08:31:22 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.rip.c b/games/hack/hack.rip.c
index 8bb37559a14..ced3a27b465 100644
--- a/games/hack/hack.rip.c
+++ b/games/hack/hack.rip.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.rip.c,v 1.3 1993/08/02 17:19:18 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.rip.c,v 1.4 1995/03/23 08:31:23 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
diff --git a/games/hack/hack.rumors.c b/games/hack/hack.rumors.c
index e86142df103..0ace09e2600 100644
--- a/games/hack/hack.rumors.c
+++ b/games/hack/hack.rumors.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.rumors.c,v 1.2 1993/08/02 17:19:20 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.rumors.c,v 1.3 1995/03/23 08:31:24 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
diff --git a/games/hack/hack.save.c b/games/hack/hack.save.c
index a60f6c6a3ac..3e7a2543c4d 100644
--- a/games/hack/hack.save.c
+++ b/games/hack/hack.save.c
@@ -3,13 +3,14 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.save.c,v 1.4 1994/03/28 11:21:12 cgd Exp $";
+static char rcsid[] = "$NetBSD: hack.save.c,v 1.5 1995/03/23 08:31:27 cgd Exp $";
#endif /* not lint */
#include "hack.h"
extern char genocided[60]; /* defined in Decl.c */
extern char fut_geno[60]; /* idem */
#include <signal.h>
+#include <unistd.h>
extern char SAVEF[], nul[];
extern char pl_character[PL_CSIZ];
@@ -137,7 +138,7 @@ register fd;
savelev(nfd,tmp);
(void) close(nfd);
}
- (void) lseek(fd, 0, 0);
+ (void) lseek(fd, (off_t)0, 0);
getlev(fd, 0, 0);
(void) close(fd);
(void) unlink(SAVEF);
diff --git a/games/hack/hack.search.c b/games/hack/hack.search.c
index 2180390807d..d1b77f72cd7 100644
--- a/games/hack/hack.search.c
+++ b/games/hack/hack.search.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.search.c,v 1.2 1993/08/02 17:19:22 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.search.c,v 1.3 1995/03/23 08:31:28 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.sh b/games/hack/hack.sh
index 8136ec42055..c3b734c8563 100644
--- a/games/hack/hack.sh
+++ b/games/hack/hack.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# $NetBSD: hack.sh,v 1.2 1995/03/23 08:31:30 cgd Exp $
HACKDIR=/usr/games/lib/hackdir
HACK=$HACKDIR/hack
MAXNROFPLAYERS=4
diff --git a/games/hack/hack.shk.c b/games/hack/hack.shk.c
index ca6bb2a522a..6e216b7adca 100644
--- a/games/hack/hack.shk.c
+++ b/games/hack/hack.shk.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.shk.c,v 1.2 1993/08/02 17:19:23 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.shk.c,v 1.3 1995/03/23 08:31:31 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.shknam.c b/games/hack/hack.shknam.c
index 38cdaac3b6e..152dbdb181c 100644
--- a/games/hack/hack.shknam.c
+++ b/games/hack/hack.shknam.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.shknam.c,v 1.2 1993/08/02 17:19:25 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.shknam.c,v 1.3 1995/03/23 08:31:33 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.steal.c b/games/hack/hack.steal.c
index 0bb4f1cc016..9fdae8f4dbb 100644
--- a/games/hack/hack.steal.c
+++ b/games/hack/hack.steal.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.steal.c,v 1.2 1993/08/02 17:19:26 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.steal.c,v 1.3 1995/03/23 08:31:34 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.termcap.c b/games/hack/hack.termcap.c
index 3999cade08b..939514b7e99 100644
--- a/games/hack/hack.termcap.c
+++ b/games/hack/hack.termcap.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.termcap.c,v 1.2 1993/08/02 17:19:27 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.termcap.c,v 1.3 1995/03/23 08:31:36 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
diff --git a/games/hack/hack.timeout.c b/games/hack/hack.timeout.c
index 38095f83157..fa431368420 100644
--- a/games/hack/hack.timeout.c
+++ b/games/hack/hack.timeout.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.timeout.c,v 1.2 1993/08/02 17:19:29 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.timeout.c,v 1.3 1995/03/23 08:31:37 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.topl.c b/games/hack/hack.topl.c
index 3c1b6f3bfa4..bd671bc5944 100644
--- a/games/hack/hack.topl.c
+++ b/games/hack/hack.topl.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.topl.c,v 1.2 1993/08/02 17:19:30 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.topl.c,v 1.3 1995/03/23 08:31:40 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.track.c b/games/hack/hack.track.c
index 5960ead6d74..1225d06c839 100644
--- a/games/hack/hack.track.c
+++ b/games/hack/hack.track.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.track.c,v 1.2 1993/08/02 17:19:31 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.track.c,v 1.3 1995/03/23 08:31:42 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.trap.c b/games/hack/hack.trap.c
index 15983f97303..dbcb12140a4 100644
--- a/games/hack/hack.trap.c
+++ b/games/hack/hack.trap.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.trap.c,v 1.2 1993/08/02 17:19:32 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.trap.c,v 1.3 1995/03/23 08:31:44 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.tty.c b/games/hack/hack.tty.c
index 1297c3c524b..5a16f31496d 100644
--- a/games/hack/hack.tty.c
+++ b/games/hack/hack.tty.c
@@ -1,6 +1,6 @@
/*-
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +32,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)hack.tty.c 5.3 (Berkeley) 5/13/91";*/
-static char rcsid[] = "$Id: hack.tty.c,v 1.2 1993/08/01 18:54:35 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: hack.tty.c,v 1.3 1995/03/23 08:31:47 cgd Exp $";
+#endif
#endif /* not lint */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
diff --git a/games/hack/hack.u_init.c b/games/hack/hack.u_init.c
index 8cef4170215..f61899d0bf1 100644
--- a/games/hack/hack.u_init.c
+++ b/games/hack/hack.u_init.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.u_init.c,v 1.3 1993/08/02 17:19:33 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.u_init.c,v 1.4 1995/03/23 08:31:51 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c
index fdb8ae009e9..86308446eba 100644
--- a/games/hack/hack.unix.c
+++ b/games/hack/hack.unix.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.unix.c,v 1.2 1993/08/02 17:19:34 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.unix.c,v 1.3 1995/03/23 08:31:55 cgd Exp $";
#endif /* not lint */
/* This file collects some Unix dependencies; hack.pager.c contains some more */
diff --git a/games/hack/hack.vault.c b/games/hack/hack.vault.c
index 0c8a267101e..4564d97463e 100644
--- a/games/hack/hack.vault.c
+++ b/games/hack/hack.vault.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.vault.c,v 1.2 1993/08/02 17:19:36 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.vault.c,v 1.3 1995/03/23 08:31:59 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.version.c b/games/hack/hack.version.c
index ee1381eb30d..538a0a7e0fc 100644
--- a/games/hack/hack.version.c
+++ b/games/hack/hack.version.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.version.c,v 1.2 1993/08/02 17:19:37 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.version.c,v 1.3 1995/03/23 08:32:03 cgd Exp $";
#endif /* not lint */
#include "date.h"
diff --git a/games/hack/hack.wield.c b/games/hack/hack.wield.c
index da92119a516..e0f40b64339 100644
--- a/games/hack/hack.wield.c
+++ b/games/hack/hack.wield.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.wield.c,v 1.2 1993/08/02 17:19:38 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.wield.c,v 1.3 1995/03/23 08:32:06 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.wizard.c b/games/hack/hack.wizard.c
index caec93f72e3..984c8b63eff 100644
--- a/games/hack/hack.wizard.c
+++ b/games/hack/hack.wizard.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.wizard.c,v 1.2 1993/08/02 17:19:39 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.wizard.c,v 1.3 1995/03/23 08:32:09 cgd Exp $";
#endif /* not lint */
/* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */
diff --git a/games/hack/hack.worm.c b/games/hack/hack.worm.c
index b88269e4a86..1849e387f4c 100644
--- a/games/hack/hack.worm.c
+++ b/games/hack/hack.worm.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.worm.c,v 1.2 1993/08/02 17:19:40 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.worm.c,v 1.3 1995/03/23 08:32:12 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.worn.c b/games/hack/hack.worn.c
index 638befbe07c..6dd5c2b1389 100644
--- a/games/hack/hack.worn.c
+++ b/games/hack/hack.worn.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.worn.c,v 1.2 1993/08/02 17:19:42 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.worn.c,v 1.3 1995/03/23 08:32:17 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/hack.zap.c b/games/hack/hack.zap.c
index 85b9dc385f1..a282dc0e5b7 100644
--- a/games/hack/hack.zap.c
+++ b/games/hack/hack.zap.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: hack.zap.c,v 1.2 1993/08/02 17:19:43 mycroft Exp $";
+static char rcsid[] = "$NetBSD: hack.zap.c,v 1.3 1995/03/23 08:32:21 cgd Exp $";
#endif /* not lint */
#include "hack.h"
diff --git a/games/hack/makedefs.c b/games/hack/makedefs.c
index 05d685eda72..550e3e9569b 100644
--- a/games/hack/makedefs.c
+++ b/games/hack/makedefs.c
@@ -3,7 +3,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: makedefs.c,v 1.2 1993/08/02 17:19:44 mycroft Exp $";
+static char rcsid[] = "$NetBSD: makedefs.c,v 1.3 1995/03/23 08:32:24 cgd Exp $";
#endif /* not lint */
#include <stdio.h>
diff --git a/games/hack/pathnames.h b/games/hack/pathnames.h
index 3b4b81dd491..37c496e91e0 100644
--- a/games/hack/pathnames.h
+++ b/games/hack/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/23 08:32:27 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 5/2/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:54:34 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_MAIL "/usr/bin/mail"
diff --git a/games/hack/rnd.c b/games/hack/rnd.c
index d90970afb3f..6bdd0aba9bc 100644
--- a/games/hack/rnd.c
+++ b/games/hack/rnd.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: rnd.c,v 1.2 1993/08/02 17:19:45 mycroft Exp $";
+static char rcsid[] = "$NetBSD: rnd.c,v 1.3 1995/03/23 08:32:28 cgd Exp $";
#endif /* not lint */
#define RND(x) ((random()>>3) % x)
diff --git a/games/hangman/Makefile b/games/hangman/Makefile
index 7785f294045..1c965e9281c 100644
--- a/games/hangman/Makefile
+++ b/games/hangman/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.7 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.4 1994/12/22 09:34:37 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/23 08:32:38 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= hangman
SRCS= endgame.c extern.c getguess.c getword.c main.c playgame.c \
diff --git a/games/hangman/endgame.c b/games/hangman/endgame.c
index 8fb634ae082..300c0efb83b 100644
--- a/games/hangman/endgame.c
+++ b/games/hangman/endgame.c
@@ -1,6 +1,8 @@
+/* $NetBSD: endgame.c,v 1.3 1995/03/23 08:32:40 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)endgame.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: endgame.c,v 1.2 1993/08/01 18:54:28 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)endgame.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: endgame.c,v 1.3 1995/03/23 08:32:40 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
@@ -70,5 +75,17 @@ endgame()
leaveok(stdscr, TRUE);
move(MESGY, MESGX);
- addstr("\n\n\n");
+ deleteln();
+ deleteln();
+ deleteln();
}
+
+
+
+
+
+
+
+
+
+
diff --git a/games/hangman/extern.c b/games/hangman/extern.c
index 91b70d45139..2d5f0082873 100644
--- a/games/hangman/extern.c
+++ b/games/hangman/extern.c
@@ -1,6 +1,8 @@
+/* $NetBSD: extern.c,v 1.3 1995/03/23 08:32:41 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)extern.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: extern.c,v 1.2 1993/08/01 18:54:27 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: extern.c,v 1.3 1995/03/23 08:32:41 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/getguess.c b/games/hangman/getguess.c
index d8c5cc029b9..e7a31acda7e 100644
--- a/games/hangman/getguess.c
+++ b/games/hangman/getguess.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getguess.c,v 1.5 1995/03/23 08:32:43 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,12 +34,15 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)getguess.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: getguess.c,v 1.4 1993/11/10 15:28:25 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)getguess.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: getguess.c,v 1.5 1995/03/23 08:32:43 cgd Exp $";
+#endif
#endif /* not lint */
-# include <termios.h>
-# include "hangman.h"
+#include <sys/ttydefaults.h>
+#include "hangman.h"
/*
* getguess:
@@ -102,7 +107,8 @@ readch()
else if (ch == CTRL('L')) {
wrefresh(curscr);
mvcur(0, 0, curscr->cury, curscr->curx);
- } else
+ }
+ else
return ch;
}
}
diff --git a/games/hangman/getword.c b/games/hangman/getword.c
index c54d293dd3a..e858fabeff6 100644
--- a/games/hangman/getword.c
+++ b/games/hangman/getword.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getword.c,v 1.4 1995/03/23 08:32:45 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,17 +34,15 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)getword.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: getword.c,v 1.3 1994/06/29 21:22:50 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)getword.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: getword.c,v 1.4 1995/03/23 08:32:45 cgd Exp $";
+#endif
#endif /* not lint */
-# include "hangman.h"
-
-# if pdp11
-# define RN (((off_t) rand() << 16) | (off_t) rand())
-# else
-# define RN rand()
-# endif
+#include "hangman.h"
+#include <stdlib.h>
/*
* getword:
@@ -52,10 +52,12 @@ getword()
{
register FILE *inf;
register char *wp, *gp;
+ register long pos;
inf = Dict;
for (;;) {
- fseek(inf, abs(RN % Dict_size), 0);
+ pos = (double)rand() / (RAND_MAX + 1.0) * (double)Dict_size;
+ fseek(inf, pos, 0);
if (fgets(Word, BUFSIZ, inf) == NULL)
continue;
if (fgets(Word, BUFSIZ, inf) == NULL)
diff --git a/games/hangman/hangman.6 b/games/hangman/hangman.6
index be0573ddf70..42040574dc1 100644
--- a/games/hangman/hangman.6
+++ b/games/hangman/hangman.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: hangman.6,v 1.5 1995/03/23 08:32:46 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)hangman.6 6.3 (Berkeley) 6/23/90
-.\" $Id: hangman.6,v 1.4 1993/09/16 17:02:51 jtc Exp $
+.\" @(#)hangman.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt HANGMAN 6
.Os
.Sh NAME
diff --git a/games/hangman/hangman.h b/games/hangman/hangman.h
index e8dbffd6d2f..7d7bf484199 100644
--- a/games/hangman/hangman.h
+++ b/games/hangman/hangman.h
@@ -1,6 +1,8 @@
+/* $NetBSD: hangman.h,v 1.4 1995/03/23 08:32:48 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)hangman.h 5.5 (Berkeley) 2/28/91
- * $Id: hangman.h,v 1.3 1994/06/29 21:22:52 deraadt Exp $
+ * @(#)hangman.h 8.1 (Berkeley) 5/31/93
*/
# include <curses.h>
diff --git a/games/hangman/main.c b/games/hangman/main.c
index a4a44d5ae3b..3da3bac1077 100644
--- a/games/hangman/main.c
+++ b/games/hangman/main.c
@@ -1,6 +1,8 @@
+/* $NetBSD: main.c,v 1.3 1995/03/23 08:32:50 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1983, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)main.c 5.4 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: main.c,v 1.2 1993/08/01 18:54:24 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: main.c,v 1.3 1995/03/23 08:32:50 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/pathnames.h b/games/hangman/pathnames.h
index e46fc9b6665..5b539e37670 100644
--- a/games/hangman/pathnames.h
+++ b/games/hangman/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/23 08:32:51 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:54:29 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_DICT "/usr/share/dict/words"
diff --git a/games/hangman/playgame.c b/games/hangman/playgame.c
index 2663923ac4d..5a591520d71 100644
--- a/games/hangman/playgame.c
+++ b/games/hangman/playgame.c
@@ -1,6 +1,8 @@
+/* $NetBSD: playgame.c,v 1.3 1995/03/23 08:32:53 cgd Exp $ */
+
/*-
- * Copyright (c) 1983 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)playgame.c 5.3 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: playgame.c,v 1.2 1993/08/01 18:54:23 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)playgame.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: playgame.c,v 1.3 1995/03/23 08:32:53 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/prdata.c b/games/hangman/prdata.c
index 02321d0a229..adfff8f3e7e 100644
--- a/games/hangman/prdata.c
+++ b/games/hangman/prdata.c
@@ -1,6 +1,8 @@
+/* $NetBSD: prdata.c,v 1.3 1995/03/23 08:32:54 cgd Exp $ */
+
/*-
- * Copyright (c) 1983 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)prdata.c 5.3 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: prdata.c,v 1.2 1993/08/01 18:54:23 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)prdata.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: prdata.c,v 1.3 1995/03/23 08:32:54 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/prman.c b/games/hangman/prman.c
index a740f053511..2337b6390e3 100644
--- a/games/hangman/prman.c
+++ b/games/hangman/prman.c
@@ -1,6 +1,8 @@
+/* $NetBSD: prman.c,v 1.3 1995/03/23 08:32:56 cgd Exp $ */
+
/*-
- * Copyright (c) 1983 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)prman.c 5.3 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: prman.c,v 1.2 1993/08/01 18:54:22 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)prman.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: prman.c,v 1.3 1995/03/23 08:32:56 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/prword.c b/games/hangman/prword.c
index 0efbb3bb33a..ba2ab634d3b 100644
--- a/games/hangman/prword.c
+++ b/games/hangman/prword.c
@@ -1,6 +1,8 @@
+/* $NetBSD: prword.c,v 1.3 1995/03/23 08:32:58 cgd Exp $ */
+
/*-
- * Copyright (c) 1983 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)prword.c 5.3 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: prword.c,v 1.2 1993/08/01 18:54:21 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)prword.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: prword.c,v 1.3 1995/03/23 08:32:58 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/hangman/setup.c b/games/hangman/setup.c
index d119e7554c5..73c835f9551 100644
--- a/games/hangman/setup.c
+++ b/games/hangman/setup.c
@@ -1,6 +1,8 @@
+/* $NetBSD: setup.c,v 1.3 1995/03/23 08:32:59 cgd Exp $ */
+
/*-
- * Copyright (c) 1983 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)setup.c 5.4 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: setup.c,v 1.2 1993/08/01 18:54:20 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: setup.c,v 1.3 1995/03/23 08:32:59 cgd Exp $";
+#endif
#endif /* not lint */
# include "hangman.h"
diff --git a/games/larn/COPYRIGHT b/games/larn/COPYRIGHT
index 43ff637d722..2f66c0fc8f8 100644
--- a/games/larn/COPYRIGHT
+++ b/games/larn/COPYRIGHT
@@ -1,3 +1,5 @@
+$NetBSD: COPYRIGHT,v 1.2 1995/03/23 08:33:02 cgd Exp $
+
This entire subtree is copyright by Noah Morgan.
The following copyright notice applies to all files found here. None of
these files contain AT&T proprietary source code.
diff --git a/games/larn/Fixed.Bugs b/games/larn/Fixed.Bugs
index d2acae0a93e..e1bc278fd85 100644
--- a/games/larn/Fixed.Bugs
+++ b/games/larn/Fixed.Bugs
@@ -1,3 +1,5 @@
+$NetBSD: Fixed.Bugs,v 1.2 1995/03/23 08:33:03 cgd Exp $
+
This is a list of the fixes/enhancements made to larn V11.0 in Version 12.0.
(Version numbers consist of 2 parts: ver.subver. When the save file format
changes, ver must be bumped. This is why the next release of Larn is 12.0
diff --git a/games/larn/Makefile b/games/larn/Makefile
index 4ad920aed41..04739f9749b 100644
--- a/games/larn/Makefile
+++ b/games/larn/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.9 (Berkeley) 7/25/90
-# $Id: Makefile,v 1.6 1994/12/22 09:34:45 cgd Exp $
+# $NetBSD: Makefile,v 1.7 1995/03/23 08:33:05 cgd Exp $
+# @(#)Makefile 5.12 (Berkeley) 5/30/93
# EXTRA
# Incorporates code to gather additional performance statistics
@@ -54,7 +54,7 @@
PROG= larn
MAN= larn.6
-CFLAGS+=-DBSD -DVER=12 -DSUBVER=0 -DNONAP
+CFLAGS+=-DBSD -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE
SRCS= main.c object.c create.c tok.c display.c global.c data.c io.c \
monster.c store.c diag.c help.c config.c nap.c bill.c scores.c \
signal.c moreobj.c movem.c regen.c fortune.c savelev.c
@@ -63,14 +63,6 @@ LDADD= -ltermcap -lcompat
HIDEGAME=hidegame
beforeinstall:
- @if [ ! -d ${DESTDIR}/usr/share/games/larn ]; then \
- /bin/rm -f ${DESTDIR}/usr/share/games/larn ; \
- mkdir -p ${DESTDIR}/usr/share/games/larn ; \
- chown root.wheel ${DESTDIR}/usr/share/games/larn ; \
- chmod 755 ${DESTDIR}/usr/share/games/larn ; \
- else \
- true ; \
- fi
(cd ${.CURDIR}/datfiles; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
larnmaze larnopts lfortune larn.help \
${DESTDIR}/usr/share/games/larn)
diff --git a/games/larn/README b/games/larn/README
index 71e477b30f6..5abeadbbc3a 100644
--- a/games/larn/README
+++ b/games/larn/README
@@ -1,3 +1,5 @@
+$NetBSD: README,v 1.2 1995/03/23 08:33:07 cgd Exp $
+
Larn is a dungeon type game program. Larn is a adventure/action game similar
in concept to rogue or hack, but with a much different feel.
Try it, you'll like it!
diff --git a/games/larn/bill.c b/games/larn/bill.c
index 3336a06f953..5362502378b 100644
--- a/games/larn/bill.c
+++ b/games/larn/bill.c
@@ -1,136 +1,162 @@
-#ifndef lint
-static char rcsid[] = "$Id: bill.c,v 1.2 1993/08/02 17:19:54 mycroft Exp $";
-#endif /* not lint */
+/* $NetBSD: bill.c,v 1.3 1995/03/23 08:33:10 cgd Exp $ */
-#include "header.h"
-/* bill.c "Larn is copyrighted 1986 by Noah Morgan. */
-static char mail600[32];
-/*
- * function to create the tax bill for the user
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
-static int pid;
-static letter1()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 600 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" the LRS (Larn Revenue Service)\n");
- standout("\nSubject:"); lprcat(" undeclared income\n");
- lprcat("\n We heard you survived the caverns of Larn. Let me be the");
- lprcat("\nfirst to congratulate you on your success. It is quite a feat.");
- lprcat("\nIt must also have been very profitable for you.");
- lprcat("\n\n The Dungeon Master has informed us that you brought");
- lprintf("\n%d gold pieces back with you from your journey. As the",(long)c[GOLD]);
- lprcat("\ncounty of Larn is in dire need of funds, we have spared no time");
- lprintf("\nin preparing your tax bill. You owe %d gold pieces as",
- (long)c[GOLD]*TAXRATE);
- lprcat("\nof this notice, and is due within 5 days. Failure to pay will");
- lprcat("\nmean penalties. Once again, congratulations, We look forward");
- lprcat("\nto your future successful expeditions.\n");
- lwclose(); return(1);
- }
-
-static letter2()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 601 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" His Majesty King Wilfred of Larndom\n");
- standout("\nSubject:"); lprcat(" a noble deed\n");
- lprcat("\n I have heard of your magnificent feat, and I, King Wilfred,");
- lprcat("\nforthwith declare today to be a national holiday. Furthermore,");
- lprcat("\nhence three days, Ye be invited to the castle to receive the");
- lprcat("\nhonour of Knight of the realm. Upon thy name shall it be written. . .");
- lprcat("\nBravery and courage be yours.");
- lprcat("\nMay you live in happiness forevermore . . .\n");
- lwclose(); return(1);
- }
-static letter3()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 602 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" Count Endelford\n");
- standout("\nSubject:"); lprcat(" You Bastard!\n");
- lprcat("\n I heard (from sources) of your journey. Congratulations!");
- lprcat("\nYou Bastard! With several attempts I have yet to endure the");
- lprcat(" caves,\nand you, a nobody, makes the journey! From this time");
- lprcat(" onward, bewarned\nupon our meeting you shall pay the price!\n");
- lwclose(); return(1);
- }
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)bill.c 5.2 (Berkeley) 5/28/91";
+#else
+static char rcsid[] = "$NetBSD: bill.c,v 1.3 1995/03/23 08:33:10 cgd Exp $";
+#endif
+#endif /* not lint */
-static letter4()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 603 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" Mainair, Duke of Larnty\n");
- standout("\nSubject:"); lprcat(" High Praise\n");
- lprcat("\n With a certainty a hero I declare to be amongst us! A nod of");
- lprcat("\nfavour I send to thee. Me thinks Count Endelford this day of");
- lprcat("\nright breath'eth fire as of dragon of whom ye are slayer. I");
- lprcat("\nyearn to behold his anger and jealously. Should ye choose to");
- lprcat("\nunleash some of thy wealth upon those who be unfortunate, I,");
- lprcat("\nDuke Mainair, Shall equal thy gift also.\n");
- lwclose(); return(1);
- }
+#include <sys/file.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "header.h"
-static letter5()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 604 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" St. Mary's Children's Home\n");
- standout("\nSubject:"); lprcat(" these poor children\n");
- lprcat("\n News of your great conquests has spread to all of Larndom.");
- lprcat("\nMight I have a moment of a great man's time. We here at St.");
- lprcat("\nMary's Children's Home are very poor, and many children are");
- lprcat("\nstarving. Disease is widespread and very often fatal without");
- lprcat("\ngood food. Could you possibly find it in your heart to help us");
- lprcat("\nin our plight? Whatever you could give will help much.");
- lprcat("\n(your gift is tax deductible)\n");
- lwclose(); return(1);
- }
+/* bill.c Larn is copyrighted 1986 by Noah Morgan. */
-static letter6()
- {
- sprintf(mail600,"/tmp/#%dmail600",pid); /* prepare path */
- if (lcreat(mail600) < 0) { write(1,"can't write 605 letter\n",23); return(0);}
- lprcat("\n\n\n\n\n\n\n\n\n\n\n\n");
- standout("From:"); lprcat(" The National Cancer Society of Larn\n");
- standout("\nSubject:"); lprcat(" hope\n");
- lprcat("\nCongratulations on your successful expedition. We are sure much");
- lprcat("\ncourage and determination were needed on your quest. There are");
- lprcat("\nmany though, that could never hope to undertake such a journey");
- lprcat("\ndue to an enfeebling disease -- cancer. We at the National");
- lprcat("\nCancer Society of Larn wish to appeal to your philanthropy in");
- lprcat("\norder to save many good people -- possibly even yourself a few");
- lprcat("\nyears from now. Much work needs to be done in researching this");
- lprcat("\ndreaded disease, and you can help today. Could you please see it");
- lprcat("\nin your heart to give generously? Your continued good health");
- lprcat("\ncan be your everlasting reward.\n");
- lwclose(); return(1);
- }
+char *mail[] = {
+ "From: the LRS (Larn Revenue Service)\n",
+ "~s undeclared income\n",
+ "\n We have heard you survived the caverns of Larn. Let me be the",
+ "\nfirst to congratulate you on your success. It was quite a feat.",
+ "\nIt was also very profitable for you...",
+ "\n\n The Dungeon Master has informed us that you brought",
+ "1",
+ "\ncounty of Larn is in dire need of funds, we have spared no time",
+ "2",
+ "\nof this notice, and is due within 5 days. Failure to pay will",
+ "\nmean penalties. Once again, congratulations, We look forward",
+ "\nto your future successful expeditions.\n",
+ NULL,
+ "From: His Majesty King Wilfred of Larndom\n",
+ "~s a noble deed\n",
+ "\n I have heard of your magnificent feat, and I, King Wilfred,",
+ "\nforthwith declare today to be a national holiday. Furthermore,",
+ "\nhence three days, ye be invited to the castle to receive the",
+ "\nhonour of Knight of the realm. Upon thy name shall it be written...",
+ "\n\nBravery and courage be yours.",
+ "\n\nMay you live in happiness forevermore...\n",
+ NULL,
+ "From: Count Endelford\n",
+ "~s You Bastard!\n",
+ "\n I have heard (from sources) of your journey. Congratulations!",
+ "\nYou Bastard! With several attempts I have yet to endure the",
+ " caves,\nand you, a nobody, makes the journey! From this time",
+ " onward, bewarned\nupon our meeting you shall pay the price!\n",
+ NULL,
+ "From: Mainair, Duke of Larnty\n",
+ "~s High Praise\n",
+ "\n With certainty, a hero I declare to be amongst us! A nod of",
+ "\nfavour I send to thee. Me thinks Count Endelford this day of",
+ "\nright breath'eth fire as of dragon of whom ye are slayer. I",
+ "\nyearn to behold his anger and jealously. Should ye choose to",
+ "\nunleash some of thy wealth upon those who be unfortunate, I,",
+ "\nDuke Mainair, shall equal thy gift also.\n",
+ NULL,
+ "From: St. Mary's Children's Home\n",
+ "~s these poor children\n",
+ "\n News of your great conquests has spread to all of Larndom.",
+ "\nMight I have a moment of a great adventurers's time? We here at",
+ "\nSt. Mary's Children's Home are very poor, and many children are",
+ "\nstarving. Disease is widespread and very often fatal without",
+ "\ngood food. Could you possibly find it in your heart to help us",
+ "\nin our plight? Whatever you could give will help much.",
+ "\n(your gift is tax deductible)\n",
+ NULL,
+ "From: The National Cancer Society of Larn\n",
+ "~s hope\n",
+ "\nCongratulations on your successful expedition. We are sure much",
+ "\ncourage and determination were needed on your quest. There are",
+ "\nmany though, that could never hope to undertake such a journey",
+ "\ndue to an enfeebling disease -- cancer. We at the National",
+ "\nCancer Society of Larn wish to appeal to your philanthropy in",
+ "\norder to save many good people -- possibly even yourself a few",
+ "\nyears from now. Much work needs to be done in researching this",
+ "\ndreaded disease, and you can help today. Could you please see it",
+ "\nin your heart to give generously? Your continued good health",
+ "\ncan be your everlasting reward.\n",
+ NULL
+};
/*
* function to mail the letters to the player if a winner
*/
-static int (*pfn[])()= { letter1, letter2, letter3, letter4, letter5, letter6 };
+
+void
mailbill()
- {
+{
register int i;
+ char fname[32];
char buf[128];
- wait(0); pid=getpid();
- if (fork() == 0)
- {
+ char **cp;
+ int fd;
+
+ wait(0);
+ if (fork() == 0) {
resetscroll();
- for (i=0; i<sizeof(pfn)/sizeof(int (*)()); i++)
- if ((*pfn[i])())
- {
- sleep(20); sprintf(buf,"mail %s < %s",loginname,mail600);
- system(buf); unlink(mail600);
- }
- exit();
+ cp = mail;
+ sprintf(fname, "/tmp/#%dlarnmail", getpid());
+ for (i = 0; i < 6; i++) {
+ if ((fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT),
+ 0666) == -1)
+ exit(0);
+ while (*cp != NULL) {
+ if (*cp[0] == '1') {
+ sprintf(buf, "\n%d gold pieces back with you from your journey. As the",
+ (long)c[GOLD]);
+ write(fd, buf, strlen(buf));
+ } else if (*cp[0] == '2') {
+ sprintf(buf, "\nin preparing your tax bill. You owe %d gold pieces as", (long)c[GOLD]*TAXRATE);
+ write(fd, buf, strlen(buf));
+ } else
+ write(fd, *cp, strlen(*cp));
+ cp++;
+ }
+ cp++;
+
+ close(fd);
+ sprintf(buf, "mail -I %s < %s > /dev/null",
+ loginname, fname);
+ system(buf);
+ unlink(fname);
}
}
+ exit(0);
+}
diff --git a/games/larn/config.c b/games/larn/config.c
index cb8b7d2b640..bf29e4dc807 100644
--- a/games/larn/config.c
+++ b/games/larn/config.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: config.c,v 1.2 1993/08/02 17:19:56 mycroft Exp $";
+static char rcsid[] = "$NetBSD: config.c,v 1.3 1995/03/23 08:33:12 cgd Exp $";
#endif /* not lint */
/*
diff --git a/games/larn/create.c b/games/larn/create.c
index ea809a2c132..32426589c1f 100644
--- a/games/larn/create.c
+++ b/games/larn/create.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: create.c,v 1.2 1993/08/02 17:19:57 mycroft Exp $";
+static char rcsid[] = "$NetBSD: create.c,v 1.3 1995/03/23 08:33:14 cgd Exp $";
#endif /* not lint */
/* create.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/data.c b/games/larn/data.c
index f3ed901d5b8..e0e7d43fa43 100644
--- a/games/larn/data.c
+++ b/games/larn/data.c
@@ -1,3 +1,5 @@
+/* $NetBSD: data.c,v 1.5 1995/03/23 08:33:17 cgd Exp $ */
+
/*-
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)data.c 5.3 (Berkeley) 5/13/91";*/
-static char rcsid[] = "$Id: data.c,v 1.4 1994/10/23 05:21:43 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91";
+#else
+static char rcsid[] = "$NetBSD: data.c,v 1.5 1995/03/23 08:33:17 cgd Exp $";
+#endif
#endif /* not lint */
/* data.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/diag.c b/games/larn/diag.c
index 57c8c47f75c..bc4dda7402d 100644
--- a/games/larn/diag.c
+++ b/games/larn/diag.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: diag.c,v 1.4 1994/10/21 21:26:06 mycroft Exp $";
+static char rcsid[] = "$NetBSD: diag.c,v 1.5 1995/03/23 08:33:20 cgd Exp $";
#endif /* not lint */
/* diag.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/display.c b/games/larn/display.c
index 25c52979943..adfcefe3b3f 100644
--- a/games/larn/display.c
+++ b/games/larn/display.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: display.c,v 1.2 1993/08/02 17:19:59 mycroft Exp $";
+static char rcsid[] = "$NetBSD: display.c,v 1.3 1995/03/23 08:33:21 cgd Exp $";
#endif /* not lint */
/* display.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/fortune.c b/games/larn/fortune.c
index 0efd4418619..54a7a955086 100644
--- a/games/larn/fortune.c
+++ b/games/larn/fortune.c
@@ -1,67 +1,91 @@
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
#ifndef lint
-static char rcsid[] = "$Id: fortune.c,v 1.2 1993/08/02 17:20:00 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)fortune.c 5.5 (Berkeley) 6/10/91";
+#else
+static char rcsid[] = "$NetBSD: fortune.c,v 1.3 1995/03/23 08:33:23 cgd Exp $";
+#endif
#endif /* not lint */
/* fortune.c Larn is copyrighted 1986 by Noah Morgan. */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "header.h"
/*
- * function to return a random fortune from the fortune file
+ * function to return a random fortune from the fortune file
*/
-static char *base=0; /* pointer to the fortune text */
-static char **flines=0; /* array of pointers to each fortune */
-static int fd=0; /* true if we have load the fortune info */
-static int nlines=0; /* # lines in fortune database */
-
-char *fortune(file)
- char *file;
- {
- register char *p;
- register int lines,tmp;
- struct stat stat;
- char *malloc();
- if (fd==0)
- {
- if ((fd=open(file,O_RDONLY)) < 0) /* open the file */
- return(0); /* can't find file */
-
- /* find out how big fortune file is and get memory for it */
- stat.st_size = 16384;
- if ((fstat(fd,&stat) < 0) || ((base=malloc(1+stat.st_size)) == 0))
- {
- close(fd); fd= -1; free((char*)base); return(0); /* can't stat file */
- }
-
- /* read in the entire fortune file */
- if (read(fd,base,stat.st_size) != stat.st_size)
- {
- close(fd); fd= -1; free((char*)base); return(0); /* can't read file */
- }
- close(fd); base[stat.st_size]=0; /* final NULL termination */
-
- /* count up all the lines (and NULL terminate) to know memory needs */
- for (p=base,lines=0; p<base+stat.st_size; p++) /* count lines */
- if (*p == '\n') *p=0,lines++;
- nlines = lines;
- /* get memory for array of pointers to each fortune */
- if ((flines=(char**)malloc(nlines*sizeof(char*))) == 0)
- {
- free((char*)base); fd= -1; return(0); /* malloc() failure */
- }
+char *flines[] = {
+ "gem value = gem * 2 ^ perfection",
+ "sitting down can have unexpected results",
+ "don't pry into the affairs of others",
+ "drinking can be hazardous to your health",
+ "beware of the gusher!",
+ "some monsters are greedy",
+ "nymphs have light fingers",
+ "try kissing a disenchantress!",
+ "hammers and brains don't mix",
+ "what does a potion of cure dianthroritis taste like?",
+ "hit point gain/loss when raising a level depends on constitution",
+ "healing a mighty wizard can be exhilarating",
+ "be sure to pay your taxes",
+ "are Vampires afraid of something?",
+ "some dragons can fly",
+ "dos thou strive for perfection?",
+ "patience is a virtue, unless your daughter dies",
+ "what does the Eye of Larn see in its guardian?",
+ "a level 25 player casts like crazy!",
+ "energy rings affect spell regeneration",
+ "difficulty affects regeneration",
+ "control of the pesty spirits is most helpful",
+ "don't fall into a bottomless pit",
+ "dexterity allows you to carry more",
+ "you can get 2 points of WC for the price of one",
+ "never enter the dungeon naked! the monsters will laugh at you!",
+ "did someone put itching powder in your armor?",
+ "you klutz!",
+ "avoid opening doors. you never know whats on the other side.",
+ "infinite regeneration ---> temptation",
+ "the greatest weapon in the game has not the highest Weapon Class",
+ "you can't buy the most powerful scroll",
+ "identify things before you use them",
+ "there's more than one way through a wall"
+};
- /* now assign each pointer to a line */
- for (p=base,tmp=0; tmp<nlines; tmp++)
- {
- flines[tmp]=p; while (*p++); /* advance to next line */
- }
- }
+#define NFORTUNES 34
- if (fd > 2) /* if we have a database to look at */
- return(flines[rund((nlines<=0)?1:nlines)]);
- else
- return(0);
- }
+char *
+fortune()
+{
+ return (flines[random() % NFORTUNES]);
+}
diff --git a/games/larn/global.c b/games/larn/global.c
index de724d7c902..9be6c0d61db 100644
--- a/games/larn/global.c
+++ b/games/larn/global.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: global.c,v 1.2 1993/08/02 17:20:02 mycroft Exp $";
+static char rcsid[] = "$NetBSD: global.c,v 1.3 1995/03/23 08:33:26 cgd Exp $";
#endif /* not lint */
/* global.c Larn is copyrighted 1986 by Noah Morgan.
diff --git a/games/larn/header.h b/games/larn/header.h
index 371dd11884c..aa853c4759d 100644
--- a/games/larn/header.h
+++ b/games/larn/header.h
@@ -1,4 +1,4 @@
-/* $Id: header.h,v 1.4 1994/10/21 21:26:08 mycroft Exp $ */
+/* $NetBSD: header.h,v 1.5 1995/03/23 08:33:29 cgd Exp $ */
/* header.h Larn is copyrighted 1986 by Noah Morgan. */
@@ -353,10 +353,11 @@ extern struct monst monster[];
extern struct sphere *spheres;
extern struct _itm itm[];
-char *fortune(),*malloc(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime();
+char *fortune(),*getenv(),*getlogin(),*lgetw(),*lgetl(),*ctime();
char *tmcapcnv(),*tgetstr(),*tgoto();
long paytaxes(),lgetc(),lrint(),time();
unsigned long readnum();
+void *malloc();
/* macro to create scroll #'s with probability of occurrence */
#define newscroll() (scprob[rund(81)])
diff --git a/games/larn/help.c b/games/larn/help.c
index 57ae59e3dff..8cbae3a119b 100644
--- a/games/larn/help.c
+++ b/games/larn/help.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: help.c,v 1.2 1993/08/02 17:20:04 mycroft Exp $";
+static char rcsid[] = "$NetBSD: help.c,v 1.3 1995/03/23 08:33:33 cgd Exp $";
#endif /* not lint */
/* help.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/io.c b/games/larn/io.c
index b41d64a90aa..ded2ac2abcf 100644
--- a/games/larn/io.c
+++ b/games/larn/io.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: io.c,v 1.2 1993/08/02 17:20:05 mycroft Exp $";
+static char rcsid[] = "$NetBSD: io.c,v 1.3 1995/03/23 08:33:38 cgd Exp $";
#endif /* not lint */
/* io.c Larn is copyrighted 1986 by Noah Morgan.
diff --git a/games/larn/larn.6 b/games/larn/larn.6
index 83177dbd008..d55362621b0 100644
--- a/games/larn/larn.6
+++ b/games/larn/larn.6
@@ -1,3 +1,5 @@
+.\" $NetBSD: larn.6,v 1.3 1995/03/23 08:33:42 cgd Exp $
+.\"
.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,15 +31,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)larn.6 5.4 (Berkeley) 8/1/91
-.\" $Id: larn.6,v 1.2 1993/08/01 07:46:47 mycroft Exp $
+.\" @(#)larn.6 5.5 (Berkeley) 12/30/93
.\"
-.Dd August 1, 1991
+.Dd December 30, 1993
.Dt LARN 6
.Os
.Sh NAME
.Nm larn
-.Nd Exploring the caverns of Larn
+.Nd exploring the caverns of Larn
.Sh SYNOPSIS
.Nm larn
.Op Fl r
@@ -138,8 +139,8 @@ separated from other words by whitespace.
When
.Sy dropping gold ,
if you type '*' as your amount, all your gold gets dropped.
-In general, typing in '*' means all of what your interested in. This is true
-when visiting the bank, or when contributing at altars.
+In general, typing in '*' means all of what you are interested in.
+This is true when visiting the bank, or when contributing at altars.
.Pp
You can get out of the store, trading post, school, or home by hitting
.Sy <esc> .
diff --git a/games/larn/main.c b/games/larn/main.c
index 964a482b923..1d0743cc9c8 100644
--- a/games/larn/main.c
+++ b/games/larn/main.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.4 1994/10/21 21:26:10 mycroft Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.5 1995/03/23 08:33:46 cgd Exp $";
#endif /* not lint */
/* main.c */
diff --git a/games/larn/monster.c b/games/larn/monster.c
index 45a64bc49df..1178bd663bc 100644
--- a/games/larn/monster.c
+++ b/games/larn/monster.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: monster.c,v 1.2 1993/08/02 17:20:10 mycroft Exp $";
+static char rcsid[] = "$NetBSD: monster.c,v 1.3 1995/03/23 08:33:50 cgd Exp $";
#endif /* not lint */
/*
diff --git a/games/larn/moreobj.c b/games/larn/moreobj.c
index e30629a3bea..737154f2f80 100644
--- a/games/larn/moreobj.c
+++ b/games/larn/moreobj.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: moreobj.c,v 1.2 1993/08/02 17:20:12 mycroft Exp $";
+static char rcsid[] = "$NetBSD: moreobj.c,v 1.3 1995/03/23 08:33:54 cgd Exp $";
#endif /* not lint */
/* moreobj.c Larn is copyrighted 1986 by Noah Morgan.
diff --git a/games/larn/movem.c b/games/larn/movem.c
index ccc6c9fb984..82b361e3c20 100644
--- a/games/larn/movem.c
+++ b/games/larn/movem.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: movem.c,v 1.2 1993/08/02 17:20:14 mycroft Exp $";
+static char rcsid[] = "$NetBSD: movem.c,v 1.3 1995/03/23 08:33:58 cgd Exp $";
#endif /* not lint */
/*
diff --git a/games/larn/nap.c b/games/larn/nap.c
index 732974d2bc2..c6d2775d7ee 100644
--- a/games/larn/nap.c
+++ b/games/larn/nap.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: nap.c,v 1.2 1993/08/02 17:20:15 mycroft Exp $";
+static char rcsid[] = "$NetBSD: nap.c,v 1.3 1995/03/23 08:34:01 cgd Exp $";
#endif /* not lint */
/* nap.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/object.c b/games/larn/object.c
index b3d4bc9db3c..d71f6734240 100644
--- a/games/larn/object.c
+++ b/games/larn/object.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: object.c,v 1.4 1994/10/21 21:26:12 mycroft Exp $";
+static char rcsid[] = "$NetBSD: object.c,v 1.5 1995/03/23 08:34:05 cgd Exp $";
#endif /* not lint */
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/pathnames.h b/games/larn/pathnames.h
index 62c428fc838..9d921a9cbc1 100644
--- a/games/larn/pathnames.h
+++ b/games/larn/pathnames.h
@@ -1,3 +1,5 @@
+/* $NetBSD: pathnames.h,v 1.4 1995/03/23 08:34:09 cgd Exp $ */
+
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 5/2/90
- * $Id: pathnames.h,v 1.3 1994/09/18 00:21:38 mycroft Exp $
+ * @(#)pathnames.h 5.1 (Berkeley) 5/2/90
*/
#define _PATH_LOG "/var/games/larn/llog12.0"
diff --git a/games/larn/regen.c b/games/larn/regen.c
index e65be75b4c8..2f68643a5de 100644
--- a/games/larn/regen.c
+++ b/games/larn/regen.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: regen.c,v 1.2 1993/08/02 17:20:17 mycroft Exp $";
+static char rcsid[] = "$NetBSD: regen.c,v 1.3 1995/03/23 08:34:11 cgd Exp $";
#endif /* not lint */
/* regen.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/savelev.c b/games/larn/savelev.c
index 993eaa86321..4761233c52f 100644
--- a/games/larn/savelev.c
+++ b/games/larn/savelev.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: savelev.c,v 1.2 1993/08/02 17:20:18 mycroft Exp $";
+static char rcsid[] = "$NetBSD: savelev.c,v 1.3 1995/03/23 08:34:13 cgd Exp $";
#endif /* not lint */
/* savelev.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/scores.c b/games/larn/scores.c
index a0b1c47804d..cd9fd9e24ca 100644
--- a/games/larn/scores.c
+++ b/games/larn/scores.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: scores.c,v 1.3 1993/08/02 17:20:19 mycroft Exp $";
+static char rcsid[] = "$NetBSD: scores.c,v 1.4 1995/03/23 08:34:15 cgd Exp $";
#endif /* not lint */
/* scores.c Larn is copyrighted 1986 by Noah Morgan.
diff --git a/games/larn/signal.c b/games/larn/signal.c
index a7c751f8ed3..e12b13143e8 100644
--- a/games/larn/signal.c
+++ b/games/larn/signal.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: signal.c,v 1.2 1993/08/02 17:20:21 mycroft Exp $";
+static char rcsid[] = "$NetBSD: signal.c,v 1.3 1995/03/23 08:34:18 cgd Exp $";
#endif /* not lint */
#include <signal.h>
diff --git a/games/larn/store.c b/games/larn/store.c
index 24783ea1e59..3f49ba61faf 100644
--- a/games/larn/store.c
+++ b/games/larn/store.c
@@ -1,3 +1,5 @@
+/* $NetBSD: store.c,v 1.4 1995/03/23 08:34:20 cgd Exp $ */
+
/*-
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)store.c 5.4 (Berkeley) 5/13/91";*/
-static char rcsid[] = "$Id: store.c,v 1.3 1994/10/21 21:26:14 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
+#else
+static char rcsid[] = "$NetBSD: store.c,v 1.4 1995/03/23 08:34:20 cgd Exp $";
+#endif
#endif /* not lint */
/* store.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/larn/tok.c b/games/larn/tok.c
index 6804dd521df..5b9e26103f3 100644
--- a/games/larn/tok.c
+++ b/games/larn/tok.c
@@ -1,5 +1,5 @@
#ifndef lint
-static char rcsid[] = "$Id: tok.c,v 1.2 1993/08/02 17:20:22 mycroft Exp $";
+static char rcsid[] = "$NetBSD: tok.c,v 1.3 1995/03/23 08:34:23 cgd Exp $";
#endif /* not lint */
/* tok.c Larn is copyrighted 1986 by Noah Morgan. */
diff --git a/games/monop/Makefile b/games/monop/Makefile
index 67d9eed7d39..0b692e3d6c4 100644
--- a/games/monop/Makefile
+++ b/games/monop/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.8 (Berkeley) 9/2/92
-# $Id: Makefile,v 1.11 1994/12/22 09:34:57 cgd Exp $
+# $NetBSD: Makefile,v 1.12 1995/03/23 08:34:32 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= monop
SRCS= monop.c cards.c execute.c getinp.c houses.c jail.c misc.c morg.c \
diff --git a/games/monop/brd.dat b/games/monop/brd.dat
index ff8498d0fc8..987fa293727 100644
--- a/games/monop/brd.dat
+++ b/games/monop/brd.dat
@@ -1,3 +1,5 @@
+/* $NetBSD: brd.dat,v 1.2 1995/03/23 08:34:34 cgd Exp $ */
+
/*-
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/games/monop/cards.c b/games/monop/cards.c
index 8d3ce142cb0..b65f0f268ca 100644
--- a/games/monop/cards.c
+++ b/games/monop/cards.c
@@ -1,6 +1,8 @@
+/* $NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)cards.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: cards.c,v 1.2 1993/08/01 18:53:44 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/deck.h b/games/monop/deck.h
index f8857a6cfa1..5516623b8d6 100644
--- a/games/monop/deck.h
+++ b/games/monop/deck.h
@@ -1,6 +1,8 @@
+/* $NetBSD: deck.h,v 1.3 1995/03/23 08:34:36 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)deck.h 5.3 (Berkeley) 6/1/90
- * $Id: deck.h,v 1.2 1993/08/01 18:53:47 mycroft Exp $
+ * @(#)deck.h 8.1 (Berkeley) 5/31/93
*/
# define bool char
diff --git a/games/monop/execute.c b/games/monop/execute.c
index 6649f0ca292..f4f49ab4ad8 100644
--- a/games/monop/execute.c
+++ b/games/monop/execute.c
@@ -1,6 +1,8 @@
+/* $NetBSD: execute.c,v 1.3 1995/03/23 08:34:38 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)execute.c 5.5 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: execute.c,v 1.2 1993/08/01 18:53:43 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: execute.c,v 1.3 1995/03/23 08:34:38 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/getinp.c b/games/monop/getinp.c
index 0972412895d..d46a9a0fdb1 100644
--- a/games/monop/getinp.c
+++ b/games/monop/getinp.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getinp.c,v 1.3 1995/03/23 08:34:39 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)getinp.c 5.4 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: getinp.c,v 1.2 1993/08/01 18:53:42 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: getinp.c,v 1.3 1995/03/23 08:34:39 cgd Exp $";
+#endif
#endif /* not lint */
# include <stdio.h>
diff --git a/games/monop/houses.c b/games/monop/houses.c
index 2da11cc1840..1cb4b0a3ed2 100644
--- a/games/monop/houses.c
+++ b/games/monop/houses.c
@@ -1,6 +1,8 @@
+/* $NetBSD: houses.c,v 1.3 1995/03/23 08:34:40 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)houses.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: houses.c,v 1.2 1993/08/01 18:53:40 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)houses.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: houses.c,v 1.3 1995/03/23 08:34:40 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/initdeck.c b/games/monop/initdeck.c
index f378ed6a5c6..c2ff831052c 100644
--- a/games/monop/initdeck.c
+++ b/games/monop/initdeck.c
@@ -1,6 +1,8 @@
+/* $NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)initdeck.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: initdeck.c,v 1.2 1993/08/01 18:53:39 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)initdeck.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $";
+#endif
#endif /* not lint */
# include <stdio.h>
diff --git a/games/monop/jail.c b/games/monop/jail.c
index b976b119703..060553150bd 100644
--- a/games/monop/jail.c
+++ b/games/monop/jail.c
@@ -1,6 +1,8 @@
+/* $NetBSD: jail.c,v 1.3 1995/03/23 08:34:44 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)jail.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: jail.c,v 1.2 1993/08/01 18:53:38 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)jail.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: jail.c,v 1.3 1995/03/23 08:34:44 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/misc.c b/games/monop/misc.c
index 114994e56ea..1a71653bdd4 100644
--- a/games/monop/misc.c
+++ b/games/monop/misc.c
@@ -1,6 +1,8 @@
+/* $NetBSD: misc.c,v 1.4 1995/03/23 08:34:47 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)misc.c 5.6 (Berkeley) 3/25/93";*/
-static char rcsid[] = "$Id: misc.c,v 1.3 1993/08/07 08:27:57 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: misc.c,v 1.4 1995/03/23 08:34:47 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/mon.dat b/games/monop/mon.dat
index 8d5ab4de62d..bfafa4c027b 100644
--- a/games/monop/mon.dat
+++ b/games/monop/mon.dat
@@ -1,3 +1,5 @@
+/* $NetBSD: mon.dat,v 1.2 1995/03/23 08:34:49 cgd Exp $ */
+
/*-
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/games/monop/monop.6 b/games/monop/monop.6
index 43915791fb8..5412a616901 100644
--- a/games/monop/monop.6
+++ b/games/monop/monop.6
@@ -1,3 +1,5 @@
+.\" $NetBSD: monop.6,v 1.8 1995/03/23 08:34:50 cgd Exp $
+.\"
.\" Copyright (c) 1980 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,8 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)monop.6 6.4 (Berkeley) 6/23/90
-.\" $Id: monop.6,v 1.7 1994/03/19 08:01:23 cgd Exp $
+.\" @(#)monop.6 6.5 (Berkeley) 3/25/93
.\"
.Dd March 25, 1993
.Dt MONOP 6
diff --git a/games/monop/monop.c b/games/monop/monop.c
index bbc20698c7b..8e33522688c 100644
--- a/games/monop/monop.c
+++ b/games/monop/monop.c
@@ -1,6 +1,8 @@
+/* $NetBSD: monop.c,v 1.3 1995/03/23 08:34:52 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)monop.c 5.7 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: monop.c,v 1.2 1993/08/01 18:53:35 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)monop.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: monop.c,v 1.3 1995/03/23 08:34:52 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.def"
diff --git a/games/monop/monop.def b/games/monop/monop.def
index 1e063e4ee70..344c4f49b4c 100644
--- a/games/monop/monop.def
+++ b/games/monop/monop.def
@@ -1,6 +1,8 @@
+/* $NetBSD: monop.def,v 1.3 1995/03/23 08:34:54 cgd Exp $ */
+
/*-
- * Copyright (c) 1980 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)monop.def 5.4 (Berkeley) 3/25/93
- * $Id: monop.def,v 1.2 1993/08/07 08:28:03 mycroft Exp $
+ * @(#)monop.def 5.5 (Berkeley) 5/31/93
*/
# include "monop.h"
diff --git a/games/monop/monop.ext b/games/monop/monop.ext
index a5fc616c2c8..ea955a88fc9 100644
--- a/games/monop/monop.ext
+++ b/games/monop/monop.ext
@@ -1,3 +1,5 @@
+/* $NetBSD: monop.ext,v 1.2 1995/03/23 08:34:58 cgd Exp $ */
+
/*-
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/games/monop/monop.h b/games/monop/monop.h
index 2198d7dde2f..1f6110c1ae1 100644
--- a/games/monop/monop.h
+++ b/games/monop/monop.h
@@ -1,6 +1,8 @@
+/* $NetBSD: monop.h,v 1.3 1995/03/23 08:35:00 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)monop.h 5.5 (Berkeley) 6/1/90
- * $Id: monop.h,v 1.2 1993/08/01 18:53:46 mycroft Exp $
+ * @(#)monop.h 8.1 (Berkeley) 5/31/93
*/
# include <stdio.h>
diff --git a/games/monop/morg.c b/games/monop/morg.c
index b54d56a0d20..957085644c1 100644
--- a/games/monop/morg.c
+++ b/games/monop/morg.c
@@ -1,6 +1,8 @@
+/* $NetBSD: morg.c,v 1.4 1995/03/23 08:35:02 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)morg.c 5.4 (Berkeley) 3/25/93";*/
-static char rcsid[] = "$Id: morg.c,v 1.3 1993/08/07 08:28:05 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: morg.c,v 1.4 1995/03/23 08:35:02 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/pathnames.h b/games/monop/pathnames.h
index a1c347bd080..e0cc52f2d4a 100644
--- a/games/monop/pathnames.h
+++ b/games/monop/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/23 08:35:03 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:53:45 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_CARDS "/usr/share/games/cards.pck"
diff --git a/games/monop/print.c b/games/monop/print.c
index e2cdad5cc52..eb49d1fc0f5 100644
--- a/games/monop/print.c
+++ b/games/monop/print.c
@@ -1,6 +1,8 @@
+/* $NetBSD: print.c,v 1.3 1995/03/23 08:35:05 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)print.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: print.c,v 1.2 1993/08/01 18:53:33 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: print.c,v 1.3 1995/03/23 08:35:05 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/prop.c b/games/monop/prop.c
index cb4b310a631..77b1f6f1b8e 100644
--- a/games/monop/prop.c
+++ b/games/monop/prop.c
@@ -1,6 +1,8 @@
+/* $NetBSD: prop.c,v 1.3 1995/03/23 08:35:06 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)prop.c 5.6 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: prop.c,v 1.2 1993/08/01 18:53:33 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: prop.c,v 1.3 1995/03/23 08:35:06 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/prop.dat b/games/monop/prop.dat
index f9fc072d2f9..6e83098d2ff 100644
--- a/games/monop/prop.dat
+++ b/games/monop/prop.dat
@@ -1,3 +1,5 @@
+/* $NetBSD: prop.dat,v 1.2 1995/03/23 08:35:09 cgd Exp $ */
+
/*-
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
diff --git a/games/monop/rent.c b/games/monop/rent.c
index 5c596e0fea2..ef915bb8ce8 100644
--- a/games/monop/rent.c
+++ b/games/monop/rent.c
@@ -1,6 +1,8 @@
+/* $NetBSD: rent.c,v 1.3 1995/03/23 08:35:11 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)rent.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: rent.c,v 1.2 1993/08/01 18:53:32 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)rent.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: rent.c,v 1.3 1995/03/23 08:35:11 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/roll.c b/games/monop/roll.c
index 5d01fe9c4cd..ddf38a2e790 100644
--- a/games/monop/roll.c
+++ b/games/monop/roll.c
@@ -1,6 +1,8 @@
+/* $NetBSD: roll.c,v 1.5 1995/03/23 08:35:13 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)roll.c 5.6 (Berkeley) 9/29/92";*/
-static char rcsid[] = "$Id: roll.c,v 1.4 1993/08/07 08:28:06 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: roll.c,v 1.5 1995/03/23 08:35:13 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdlib.h>
diff --git a/games/monop/spec.c b/games/monop/spec.c
index a8e39a1e120..5b8f32e1425 100644
--- a/games/monop/spec.c
+++ b/games/monop/spec.c
@@ -1,6 +1,8 @@
+/* $NetBSD: spec.c,v 1.3 1995/03/23 08:35:16 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)spec.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: spec.c,v 1.2 1993/08/01 18:53:30 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: spec.c,v 1.3 1995/03/23 08:35:16 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/monop/trade.c b/games/monop/trade.c
index 9a090b61f07..e8207f996f5 100644
--- a/games/monop/trade.c
+++ b/games/monop/trade.c
@@ -1,6 +1,8 @@
+/* $NetBSD: trade.c,v 1.3 1995/03/23 08:35:19 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)trade.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: trade.c,v 1.2 1993/08/01 18:53:28 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: trade.c,v 1.3 1995/03/23 08:35:19 cgd Exp $";
+#endif
#endif /* not lint */
# include "monop.ext"
diff --git a/games/morse/Makefile b/games/morse/Makefile
index a189d968ac3..0f28e4f8b3c 100644
--- a/games/morse/Makefile
+++ b/games/morse/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.2 1993/08/01 05:44:57 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/23 08:35:22 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= morse
NOMAN= noman
diff --git a/games/morse/morse.c b/games/morse/morse.c
index 46eb1a40f21..a90450187fa 100644
--- a/games/morse/morse.c
+++ b/games/morse/morse.c
@@ -1,6 +1,8 @@
+/* $NetBSD: morse.c,v 1.3 1995/03/23 08:35:24 cgd Exp $ */
+
/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1988 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1988, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)morse.c 5.3 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: morse.c,v 1.2 1993/08/01 18:53:21 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: morse.c,v 1.3 1995/03/23 08:35:24 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdio.h>
diff --git a/games/number/Makefile b/games/number/Makefile
index 20aea694f92..7f20784dc5c 100644
--- a/games/number/Makefile
+++ b/games/number/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.2 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.3 1994/12/22 09:35:02 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/23 08:35:27 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= number
MAN= number.6
diff --git a/games/number/number.6 b/games/number/number.6
index a35b1c9f977..c50c1fb5509 100644
--- a/games/number/number.6
+++ b/games/number/number.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: number.6,v 1.4 1995/03/23 08:35:29 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1993, 1994
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)number.6 6.4 (Berkeley) 6/23/90
-.\" $Id: number.6,v 1.3 1993/08/05 01:46:49 jtc Exp $
+.\" @(#)number.6 8.2 (Berkeley) 3/31/94
.\"
-.Dd June 23, 1990
+.Dd March 31, 1994
.Dt NUMBER 6
.Os
.Sh NAME
@@ -44,12 +45,18 @@
.Sh DESCRIPTION
The
.Nm number
-utility
-prints the English equivalent of the specified number to the
-standard output.
+utility prints the English equivalent of the number to the standard
+output, with each 10^3 magnitude displayed on a separate line.
If no argument is specified,
.Nm number
-reads a number from the standard input.
+reads lines from the standard input.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl l
+Display the number on a single line.
+.El
.Sh BUGS
-.Nm Number
-doesn't understand exponents.
+Although
+.Nm number
+understand fractions, it doesn't understand exponents.
diff --git a/games/number/number.c b/games/number/number.c
index 29b8effa4eb..509f0125d00 100644
--- a/games/number/number.c
+++ b/games/number/number.c
@@ -1,6 +1,8 @@
+/* $NetBSD: number.c,v 1.3 1995/03/23 08:35:30 cgd Exp $ */
+
/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,23 +34,28 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1988 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1988, 1993, 1994\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)number.c 5.1 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: number.c,v 1.2 1993/08/01 18:53:19 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)number.c 8.2 (Berkeley) 3/31/94";
+#else
+static char rcsid[] = "$NetBSD: number.c,v 1.3 1995/03/23 08:35:30 cgd Exp $";
+#endif
#endif /* not lint */
-#include <stdio.h>
+#include <sys/types.h>
+
#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <err.h>
-#define YES 1
-#define NO 0
-#define EOS '\0'
-#define MAXNUM 65 /* biggest number we handle */
+#define MAXNUM 65 /* Biggest number we handle. */
static char *name1[] = {
"", "one", "two", "three",
@@ -72,173 +79,219 @@ static char *name1[] = {
"novemdecillion", "vigintillion",
};
-main(argc,argv)
- int argc;
- char **argv;
+void convert __P((char *));
+int number __P((char *, int));
+void pfract __P((int));
+void toobig __P((void));
+int unit __P((int, char *));
+void usage __P((void));
+
+int lflag;
+
+int
+main(argc, argv)
+ int argc;
+ char *argv[];
{
- register int cnt;
- char line[MAXNUM * 2 + 2]; /* MAXNUM '.' MAXNUM '\0' */
+ int ch, first;
+ char line[256];
- if (argc > 1)
- for (cnt = 1;cnt < argc;++cnt) {
- convert(argv[cnt]);
- puts("...");
+ lflag = 0;
+ while ((ch = getopt(argc, argv, "l")) != EOF)
+ switch (ch) {
+ case 'l':
+ lflag = 1;
+ break;
+ case '?':
+ default:
+ usage();
}
- else
- while (fgets(line,sizeof(line),stdin)) {
+ argc -= optind;
+ argv += optind;
+
+ if (*argv == NULL)
+ for (first = 1;
+ fgets(line, sizeof(line), stdin) != NULL; first = 0) {
+ if (strchr(line, '\n') == NULL)
+ errx(1, "line too long.");
+ if (!first)
+ (void)printf("...\n");
convert(line);
- puts("...");
+ }
+ else
+ for (first = 1; *argv != NULL; first = 0, ++argv) {
+ if (!first)
+ (void)printf("...\n");
+ convert(*argv);
}
exit(0);
}
+void
convert(line)
- char *line;
+ char *line;
{
- register int len,
- ret;
- register char *C,
- *fraction;
-
- for (fraction = NULL, C = line;*C && *C != '\n';++C)
- if (!isdigit(*C))
- switch(*C) {
- case '-':
- if (C != line)
- usage(NO);
- break;
- case '.':
- if (!fraction) {
- fraction = C + 1;
- *C = EOS;
- break;
- }
- default:
- usage(NO);
+ register flen, len, rval;
+ register char *p, *fraction;
+
+ fraction = NULL;
+ for (p = line; *p != '\0' && *p != '\n'; ++p) {
+ if (isblank(*p)) {
+ if (p == line) {
+ ++line;
+ continue;
}
- *C = EOS;
+ goto badnum;
+ }
+ if (isdigit(*p))
+ continue;
+ switch (*p) {
+ case '.':
+ if (fraction != NULL)
+ goto badnum;
+ fraction = p + 1;
+ *p = '\0';
+ break;
+ case '-':
+ if (p == line)
+ break;
+ /* FALLTHROUGH */
+ default:
+badnum: errx(1, "illegal number: %s", line);
+ break;
+ }
+ }
+ *p = '\0';
+
+ if ((len = strlen(line)) > MAXNUM ||
+ fraction != NULL && (flen = strlen(fraction)) > MAXNUM)
+ errx(1, "number too large, max %d digits.", MAXNUM);
+
if (*line == '-') {
- puts("minus");
+ (void)printf("minus%s", lflag ? " " : "\n");
++line;
}
- ret = NO;
- if (len = strlen(line)) {
- if (len > MAXNUM)
- usage(YES);
- ret = unit(len,line);
- }
- if (fraction && (len = strlen(fraction))) {
- if (len > MAXNUM)
- usage(YES);
- for (C = fraction;*C;++C)
- if (*C != '0') {
- if (ret)
- puts("and");
- if (unit(len,fraction)) {
- ++ret;
- pfract(len);
+
+ rval = len > 0 ? unit(len, line) : 0;
+ if (fraction != NULL && flen != 0)
+ for (p = fraction; *p != '\0'; ++p)
+ if (*p != '0') {
+ if (rval)
+ (void)printf("%sand%s",
+ lflag ? " " : "",
+ lflag ? " " : "\n");
+ if (unit(flen, fraction)) {
+ if (lflag)
+ (void)printf(" ");
+ pfract(flen);
+ rval = 1;
}
break;
}
- }
- if (!ret)
- puts("zero.");
+ if (!rval)
+ (void)printf("zero%s", lflag ? "" : ".\n");
+ if (lflag)
+ (void)printf("\n");
}
-unit(len,C)
- register int len;
- register char *C;
+int
+unit(len, p)
+ register int len;
+ register char *p;
{
- register int off,
- ret;
+ register int off, rval;
- ret = NO;
+ rval = 0;
if (len > 3) {
if (len % 3) {
off = len % 3;
len -= off;
- if (number(C,off)) {
- ret = YES;
- printf(" %s.\n",name3[len / 3]);
+ if (number(p, off)) {
+ rval = 1;
+ (void)printf(" %s%s",
+ name3[len / 3], lflag ? " " : ".\n");
}
- C += off;
+ p += off;
}
- for (;len > 3;C += 3) {
+ for (; len > 3; p += 3) {
len -= 3;
- if (number(C,3)) {
- ret = YES;
- printf(" %s.\n",name3[len / 3]);
+ if (number(p, 3)) {
+ rval = 1;
+ (void)printf(" %s%s",
+ name3[len / 3], lflag ? " " : ".\n");
}
}
}
- if (number(C,len)) {
- puts(".");
- ret = YES;
+ if (number(p, len)) {
+ if (!lflag)
+ (void)printf(".\n");
+ rval = 1;
}
- return(ret);
+ return (rval);
}
-number(C,len)
- register char *C;
- int len;
+int
+number(p, len)
+ register char *p;
+ int len;
{
- register int val,
- ret;
+ register int val, rval;
- ret = 0;
- switch(len) {
+ rval = 0;
+ switch (len) {
case 3:
- if (*C != '0') {
- ++ret;
- printf("%s hundred",name1[*C - '0']);
+ if (*p != '0') {
+ rval = 1;
+ (void)printf("%s hundred", name1[*p - '0']);
}
- ++C;
- /*FALLTHROUGH*/
+ ++p;
+ /* FALLTHROUGH */
case 2:
- val = (C[1] - '0') + (C[0] - '0') * 10;
+ val = (p[1] - '0') + (p[0] - '0') * 10;
if (val) {
- if (ret++)
- putchar(' ');
+ if (rval)
+ (void)printf(" ");
if (val < 20)
- fputs(name1[val],stdout);
+ (void)printf("%s", name1[val]);
else {
- fputs(name2[val / 10],stdout);
+ (void)printf("%s", name2[val / 10]);
if (val % 10)
- printf("-%s",name1[val % 10]);
+ (void)printf("-%s", name1[val % 10]);
}
+ rval = 1;
}
break;
case 1:
- if (*C != '0') {
- ++ret;
- fputs(name1[*C - '0'],stdout);
+ if (*p != '0') {
+ rval = 1;
+ (void)printf("%s", name1[*p - '0']);
}
}
- return(ret);
+ return (rval);
}
+void
pfract(len)
- register int len;
+ int len;
{
- static char *pref[] = { "", "ten-", "hundred-" };
+ static char *pref[] = { "", "ten-", "hundred-" };
switch(len) {
case 1:
- puts("tenths.");
+ (void)printf("tenths.\n");
break;
case 2:
- puts("hundredths.");
+ (void)printf("hundredths.\n");
break;
default:
- printf("%s%sths.\n",pref[len % 3],name3[len / 3]);
+ (void)printf("%s%sths.\n", pref[len % 3], name3[len / 3]);
+ break;
}
}
-usage(toobig)
- int toobig;
+void
+usage()
{
- if (toobig)
- fprintf(stderr,"number: number too large, max %d digits.\n",MAXNUM);
- fputs("usage: number # ...\n",stderr);
- exit(-1);
+ (void)fprintf(stderr, "usage: number [# ...]\n");
+ exit(1);
}
diff --git a/games/pom/Makefile b/games/pom/Makefile
index ae49b458cd9..7f251b626f9 100644
--- a/games/pom/Makefile
+++ b/games/pom/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.3 1994/12/22 09:35:29 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/23 08:35:33 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= pom
MAN= pom.6
diff --git a/games/pom/pom.6 b/games/pom/pom.6
index 17598fc12bb..3529a465bde 100644
--- a/games/pom/pom.6
+++ b/games/pom/pom.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: pom.6,v 1.4 1995/03/23 08:35:35 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)pom.6 5.2 (Berkeley) 6/23/90
-.\" $Id: pom.6,v 1.3 1993/08/05 01:46:54 jtc Exp $
+.\" @(#)pom.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt POM 6
.Os
.Sh NAME
diff --git a/games/pom/pom.c b/games/pom/pom.c
index 071981786ea..7b1ecc0966f 100644
--- a/games/pom/pom.c
+++ b/games/pom/pom.c
@@ -1,6 +1,8 @@
+/* $NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software posted to USENET.
*
@@ -34,14 +36,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)pom.c 5.3 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: pom.c,v 1.3 1995/02/03 18:15:02 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/games/ppt/Makefile b/games/ppt/Makefile
index 13700cbead2..580a7c1a911 100644
--- a/games/ppt/Makefile
+++ b/games/ppt/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.2 1993/08/01 05:44:46 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/23 08:35:38 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= ppt
NOMAN= noman
diff --git a/games/ppt/ppt.c b/games/ppt/ppt.c
index 67b41f21747..c86c1dc080b 100644
--- a/games/ppt/ppt.c
+++ b/games/ppt/ppt.c
@@ -1,6 +1,8 @@
+/* $NetBSD: ppt.c,v 1.4 1995/03/23 08:35:40 cgd Exp $ */
+
/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1988 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1988, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)ppt.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: ppt.c,v 1.3 1993/08/01 18:53:13 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)ppt.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: ppt.c,v 1.4 1995/03/23 08:35:40 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdio.h>
diff --git a/games/primes/Makefile b/games/primes/Makefile
index a410af9425f..0a6747f14cb 100644
--- a/games/primes/Makefile
+++ b/games/primes/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.2 1993/08/01 05:44:42 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/23 08:35:43 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= primes
SRCS= pattern.c pr_tbl.c primes.c
diff --git a/games/primes/pattern.c b/games/primes/pattern.c
index 50e21ab57d9..c770791ced8 100644
--- a/games/primes/pattern.c
+++ b/games/primes/pattern.c
@@ -1,6 +1,8 @@
+/* $NetBSD: pattern.c,v 1.3 1995/03/23 08:35:47 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Landon Curt Noll.
@@ -35,8 +37,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)pattern.c 5.2 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: pattern.c,v 1.2 1993/08/01 18:53:08 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: pattern.c,v 1.3 1995/03/23 08:35:47 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/games/primes/pr_tbl.c b/games/primes/pr_tbl.c
index f6a42cfb024..f92f21f3ffe 100644
--- a/games/primes/pr_tbl.c
+++ b/games/primes/pr_tbl.c
@@ -1,6 +1,8 @@
+/* $NetBSD: pr_tbl.c,v 1.3 1995/03/23 08:35:52 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Landon Curt Noll.
@@ -35,8 +37,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)pr_tbl.c 5.2 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: pr_tbl.c,v 1.2 1993/08/01 18:53:05 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: pr_tbl.c,v 1.3 1995/03/23 08:35:52 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/games/primes/primes.c b/games/primes/primes.c
index d9f27fe06d6..57e00731a09 100644
--- a/games/primes/primes.c
+++ b/games/primes/primes.c
@@ -1,6 +1,8 @@
+/* $NetBSD: primes.c,v 1.4 1995/03/23 08:35:55 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Landon Curt Noll.
@@ -35,22 +37,25 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)primes.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: primes.c,v 1.3 1994/03/01 01:07:48 cgd Exp $";
+#if 0
+static char sccsid[] = "@(#)primes.c 8.4 (Berkeley) 3/21/94";
+#else
+static char rcsid[] = "$NetBSD: primes.c,v 1.4 1995/03/23 08:35:55 cgd Exp $";
+#endif
#endif /* not lint */
/*
* primes - generate a table of primes between two values
*
- * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
+ * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
*
- * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
+ * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
*
* usage:
* primes [start [stop]]
@@ -59,16 +64,18 @@ static char rcsid[] = "$Id: primes.c,v 1.3 1994/03/01 01:07:48 cgd Exp $";
* the value 4294967295 (2^32-1) is assumed. If start is
* omitted, start is read from standard input.
*
- * Prints "ouch" if start or stop is bogus.
- *
* validation check: there are 664579 primes between 0 and 10^7
*/
-#include <stdio.h>
-#include <math.h>
-#include <memory.h>
#include <ctype.h>
+#include <err.h>
+#include <errno.h>
#include <limits.h>
+#include <math.h>
+#include <memory.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include "primes.h"
/*
@@ -99,197 +106,112 @@ extern ubig *pr_limit; /* largest prime in the prime array */
extern char pattern[];
extern int pattern_size; /* length of pattern array */
-#define MAX_LINE 255 /* max line allowed on stdin */
-
-char *read_num_buf(); /* read a number buffer */
-void primes(); /* print the primes in range */
-char *program; /* our name */
+void primes __P((ubig, ubig));
+ubig read_num_buf __P((void));
+void usage __P((void));
+int
main(argc, argv)
- int argc; /* arg count */
- char *argv[]; /* args */
+ int argc;
+ char *argv[];
{
- char buf[MAX_LINE+1]; /* input buffer */
- char *ret; /* return result */
- ubig start; /* where to start generating */
- ubig stop; /* don't generate at or above this value */
+ ubig start; /* where to start generating */
+ ubig stop; /* don't generate at or above this value */
+ int ch;
+ char *p;
+
+ while ((ch = getopt(argc, argv, "")) != EOF)
+ switch (ch) {
+ case '?':
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
- /*
- * parse args
- */
- program = argv[0];
start = 0;
stop = BIG;
- if (argc == 3) {
- /* convert low and high args */
- if (read_num_buf(NULL, argv[1]) == NULL) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- if (read_num_buf(NULL, argv[2]) == NULL) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- if (sscanf(argv[1], "%lu", &start) != 1) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- if (sscanf(argv[2], "%lu", &stop) != 1) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
-
- } else if (argc == 2) {
- /* convert low arg */
- if (read_num_buf(NULL, argv[1]) == NULL) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- if (sscanf(argv[1], "%lu", &start) != 1) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
-
- } else {
- /* read input until we get a good line */
- if (read_num_buf(stdin, buf) != NULL) {
- /* convert the buffer */
- if (sscanf(buf, "%lu", &start) != 1) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
- }
- } else {
- exit(0);
- }
- }
- if (start > stop) {
- fprintf(stderr, "%s: ouch\n", program);
- exit(1);
+ /*
+ * Convert low and high args. Strtoul(3) sets errno to
+ * ERANGE if the number is too large, but, if there's
+ * a leading minus sign it returns the negation of the
+ * result of the conversion, which we'd rather disallow.
+ */
+ switch (argc) {
+ case 2:
+ /* Start and stop supplied on the command line. */
+ if (argv[0][0] == '-' || argv[1][0] == '-')
+ errx(1, "negative numbers aren't permitted.");
+
+ errno = 0;
+ start = strtoul(argv[0], &p, 10);
+ if (errno)
+ err(1, "%s", argv[0]);
+ if (*p != '\0')
+ errx(1, "%s: illegal numeric format.", argv[0]);
+
+ errno = 0;
+ stop = strtoul(argv[1], &p, 10);
+ if (errno)
+ err(1, "%s", argv[1]);
+ if (*p != '\0')
+ errx(1, "%s: illegal numeric format.", argv[1]);
+ break;
+ case 1:
+ /* Start on the command line. */
+ if (argv[0][0] == '-')
+ errx(1, "negative numbers aren't permitted.");
+
+ errno = 0;
+ start = strtoul(argv[0], &p, 10);
+ if (errno)
+ err(1, "%s", argv[0]);
+ if (*p != '\0')
+ errx(1, "%s: illegal numeric format.", argv[0]);
+ break;
+ case 0:
+ start = read_num_buf();
+ break;
+ default:
+ usage();
}
+
+ if (start > stop)
+ errx(1, "start value must be less than stop value.");
primes(start, stop);
exit(0);
}
/*
- * read_num_buf - read a number buffer from a stream
- *
- * Read a number on a line of the form:
- *
- * ^[ \t]*\(+?[0-9][0-9]\)*.*$
- *
- * where ? is a 1-or-0 operator and the number is within \( \).
- *
- * If does not match the above pattern, it is ignored and a new
- * line is read. If the number is too large or small, we will
- * print ouch and read a new line.
- *
- * We have to be very careful on how we check the magnitude of the
- * input. We can not use numeric checks because of the need to
- * check values against maximum numeric values.
- *
- * This routine will return a line containing a ascii number between
- * 0 and BIG, or it will return NULL.
- *
- * If the stream is NULL then buf will be processed as if were
- * a single line stream.
- *
- * returns:
- * char * pointer to leading digit or +
- * NULL EOF or error
+ * read_num_buf --
+ * This routine returns a number n, where 0 <= n && n <= BIG.
*/
-char *
-read_num_buf(input, buf)
- FILE *input; /* input stream or NULL */
- char *buf; /* input buffer */
+ubig
+read_num_buf()
{
- static char limit[MAX_LINE+1]; /* ascii value of BIG */
- static int limit_len; /* digit count of limit */
- int len; /* digits in input (excluding +/-) */
- char *s; /* line start marker */
- char *d; /* first digit, skip +/- */
- char *p; /* scan pointer */
- char *z; /* zero scan pointer */
-
- /* form the ascii value of BIG if needed */
- if (!isascii(limit[0]) || !isdigit(limit[0])) {
- sprintf(limit, "%lu", BIG);
- limit_len = strlen(limit);
- }
-
- /*
- * the search for a good line
- */
- if (input != NULL && fgets(buf, MAX_LINE, input) == NULL) {
- /* error or EOF */
- return NULL;
- }
- do {
-
- /* ignore leading whitespace */
- for (s=buf; *s && s < buf+MAX_LINE; ++s) {
- if (!isascii(*s) || !isspace(*s)) {
- break;
- }
- }
-
- /* object if - */
- if (*s == '-') {
- fprintf(stderr, "%s: ouch for minuses\n", program);
- continue;
- }
-
- /* skip over any leading + */
- if (*s == '+') {
- d = s+1;
- } else {
- d = s;
- }
-
- /* note leading zeros */
- for (z=d; *z && z < buf+MAX_LINE; ++z) {
- if (*z != '0') {
- break;
- }
- }
-
- /* scan for the first non-digit/non-plus/non-minus */
- for (p=d; *p && p < buf+MAX_LINE; ++p) {
- if (!isascii(*p) || !isdigit(*p)) {
- break;
- }
- }
+ ubig val;
+ char *p, buf[100]; /* > max number of digits. */
- /* ignore empty lines */
- if (p == d) {
- continue;
+ for (;;) {
+ if (fgets(buf, sizeof(buf), stdin) == NULL) {
+ if (ferror(stdin))
+ err(1, "stdin");
+ exit(0);
}
- *p = '\0';
-
- /* object if too many digits */
- len = strlen(z);
- len = (len<=0) ? 1 : len;
- /* accept if digit count is below limit */
- if (len < limit_len) {
- /* we have good input */
- return s;
-
- /* reject very large numbers */
- } else if (len > limit_len) {
- fprintf(stderr, "%s: %s too big\n", program, z);
+ for (p = buf; isblank(*p); ++p);
+ if (*p == '\n' || *p == '\0')
continue;
-
- /* carefully check against near limit numbers */
- } else if (strcmp(z, limit) > 0) {
- fprintf(stderr, "%s: %s a bit too big\n", program, z);
- continue;
- }
- /* number is near limit, but is under it */
- return s;
- } while (input != NULL && fgets(buf, MAX_LINE, input) != NULL);
-
- /* error or EOF */
- return NULL;
+ if (*p == '-')
+ errx(1, "negative numbers aren't permitted.");
+ errno = 0;
+ val = strtoul(buf, &p, 10);
+ if (errno)
+ err(1, "%s", buf);
+ if (*p != '\n')
+ errx(1, "%s: illegal numeric format.", buf);
+ return (val);
+ }
}
/*
@@ -307,9 +229,9 @@ primes(start, stop)
register ubig fact_lim; /* highest prime for current block */
/*
- * NetBSD has no problems with handling conversion
- * between doubles and unsigned long, so we can go
- * all the way to BIG.
+ * A number of systems can not convert double values into unsigned
+ * longs when the values are larger than the largest signed value.
+ * We don't have this problem, so we can go all the way to BIG.
*/
if (start < 3) {
start = (ubig)2;
@@ -337,8 +259,7 @@ primes(start, stop)
if (start <= *pr_limit) {
/* skip primes up to the start value */
for (p = &prime[0], factor = prime[0];
- factor < stop && p <= pr_limit;
- factor = *(++p)) {
+ factor < stop && p <= pr_limit; factor = *(++p)) {
if (factor >= start) {
printf("%u\n", factor);
}
@@ -363,8 +284,7 @@ primes(start, stop)
memcpy(table, &pattern[factor], pattern_size-factor);
/* main block pattern copies */
for (fact_lim=pattern_size-factor;
- fact_lim+pattern_size<=TABSIZE;
- fact_lim+=pattern_size) {
+ fact_lim+pattern_size<=TABSIZE; fact_lim+=pattern_size) {
memcpy(&table[fact_lim], pattern, pattern_size);
}
/* final block pattern copy */
@@ -409,3 +329,10 @@ primes(start, stop)
}
}
}
+
+void
+usage()
+{
+ (void)fprintf(stderr, "usage: primes [start [stop]]\n");
+ exit(1);
+}
diff --git a/games/primes/primes.h b/games/primes/primes.h
index 72504c75eb8..3197d271b78 100644
--- a/games/primes/primes.h
+++ b/games/primes/primes.h
@@ -1,6 +1,8 @@
+/* $NetBSD: primes.h,v 1.4 1995/03/23 08:35:58 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Landon Curt Noll.
@@ -33,25 +35,20 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)primes.h 5.2 (Berkeley) 6/1/90
- * $Id: primes.h,v 1.3 1994/03/01 01:07:51 cgd Exp $
+ * @(#)primes.h 8.2 (Berkeley) 3/1/94
*/
/*
* primes - generate a table of primes between two values
*
- * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
+ * By: Landon Curt Noll chongo@toad.com, ...!{sun,tolsoft}!hoptoad!chongo
*
- * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
+ * chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
*/
/* ubig is the type that holds a large unsigned value */
-typedef unsigned long ubig; /* must be >=32 bit unsigned value */
+typedef unsigned long ubig; /* must be >=32 bit unsigned value */
+#define BIG ULONG_MAX /* largest value will sieve */
-/*
- * sieve parameters
- */
-#define BIG ULONG_MAX /* highest value we will sieve */
-#define SEMIBIG ((ubig)LONG_MAX) /* highest signed value */
-#define NEG_SEMIBIG ((ubig)LONG_MIN) /* lowest signed value */
-#define TABSIZE 256*1024 /* bytes in sieve table (must be > 3*5*7*11) */
+/* bytes in sieve table (must be > 3*5*7*11) */
+#define TABSIZE 256*1024