From 0d7a0932d927a0295d383b231951d3dc8c89a200 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 28 Mar 2003 10:53:01 +0000 Subject: [PATCH] 2003-03-28 Joseph S. Myers * Makefile.bsd, Makefile.inc.bsd, adventure/Makefile.bsd, arithmetic/arithmetic.6, arithmetic/arithmetic.c, atc/atc.6.in, backgammon/backgammon/backgammon.6.in, backgammon/common_source/Makefile.bsd, backgammon/teachgammon/Makefile.bsd, banner/banner.6, battlestar/battlestar.6, bcd/bcd.6, boggle/Makefile.bsd, boggle/boggle/boggle.6, boggle/boggle/timer.c, boggle/mkdict/Makefile.bsd, boggle/mkindex/Makefile.bsd, caesar/caesar.6, canfield/canfield/canfield.6.in, canfield/cfscores/Makefile.bsd, countmail/countmail, countmail/countmail.6, cribbage/cribbage.6.in, cribbage/cribbage.h, cribbage/extern.c, cribbage/io.c, cribbage/score.c, cribbage/support.c, dm/Makefile.bsd, dm/dm.8.in, dm/dm.c, dm/dm.conf.5.in, factor/Makefile.bsd, factor/factor.6, factor/factor.c, fortune/datfiles/Makefile.bsd, fortune/datfiles/fortunes, fortune/datfiles/fortunes2, fortune/datfiles/fortunes2-o.real, fortune/datfiles/limerick, fortune/datfiles/netbsd, fortune/fortune/fortune.6.in, fortune/fortune/fortune.c, fortune/strfile/strfile.8, fortune/unstr/Makefile.bsd, gomoku/gomoku.6, hack/Makefile.bsd, hack/extern.h, hack/hack.6.in, hack/hack.main.c, hack/hack.mkshop.c, hack/hack.pri.c, hack/hack.topl.c, hack/hack.tty.c, hack/help, hangman/hangman.6.in, hunt/Makefile.inc.bsd, hunt/hunt/hunt.6.in, hunt/hunt/hunt.c, hunt/hunt/playit.c, hunt/huntd/answer.c, hunt/huntd/bsd.h, hunt/huntd/ctl_transact.c, hunt/huntd/driver.c, hunt/huntd/extern.c, hunt/huntd/faketalk.c, hunt/huntd/hunt.h, hunt/huntd/huntd.6.in, hunt/huntd/terminal.c, mille/mille.6, mille/misc.c, monop/Makefile.bsd, monop/cards.c, monop/getinp.c, monop/monop.6.in, monop/roll.c, morse/Makefile.bsd, phantasia/Makefile.bsd, phantasia/misc.c, phantasia/phantasia.6, pom/pom.6, ppt/Makefile.bsd, ppt/ppt.c, primes/Makefile.bsd, quiz/datfiles/posneg, quiz/quiz.6.in, quiz/rxp.c, rain/rain.6, random/random.6, robots/auto.c, robots/init_field.c, robots/move.c, robots/robots.6.in, robots/robots.h, rogue/Makefile.bsd, rogue/USD.doc/Makefile.bsd, rogue/hit.c, rogue/inventory.c, rogue/level.c, rogue/message.c, rogue/rogue.6.in, rogue/rogue.h, rogue/save.c, rogue/score.c, sail/sail.6, snake/snake/snake.6.in, snake/snscore/Makefile.bsd, tetris/input.c, tetris/scores.c, tetris/screen.c, tetris/shapes.c, tetris/tetris.6.in, tetris/tetris.c, trek/USD.doc/Makefile.bsd, trek/damage.c, trek/getpar.c, trek/trek.6.in, wargames/wargames.6, worm/worm.6, worms/worms.6, wtf/acronyms, wtf/wtf.in, wtf/wtf.6.in: Update from NetBSD CVS. * include/sys/poll.h: New file. * lib/strlcpy.c: New file. * configure: Test for strlcpy. * include/string.h: New file. * exec.objs: Use it for rogue. * trek/trek.6.in: Rename to trek.6. * substfiles2: Update. * COPYING: Update. * INSTALL: No longer suggest not using groff's macros. * PACKAGING: Update. * SECURITY: Update. --- COPYING | 32 +- ChangeLog | 58 ++++ INSTALL | 6 - Makefile.bsd | 2 +- Makefile.inc.bsd | 20 +- PACKAGING | 3 +- SECURITY | 3 +- adventure/Makefile.bsd | 4 +- arithmetic/arithmetic.6 | 5 +- arithmetic/arithmetic.c | 17 +- atc/atc.6.in | 269 ++++++++------- backgammon/backgammon/backgammon.6.in | 10 +- backgammon/common_source/Makefile.bsd | 10 +- backgammon/teachgammon/Makefile.bsd | 5 +- banner/banner.6 | 8 +- battlestar/battlestar.6 | 61 ++-- bcd/bcd.6 | 17 +- boggle/Makefile.bsd | 12 +- boggle/boggle/boggle.6 | 9 +- boggle/boggle/timer.c | 28 +- boggle/mkdict/Makefile.bsd | 5 +- boggle/mkindex/Makefile.bsd | 5 +- caesar/caesar.6 | 9 +- canfield/canfield/canfield.6.in | 30 +- canfield/cfscores/Makefile.bsd | 5 +- configure | 15 +- countmail/countmail | 150 ++++---- countmail/countmail.6 | 9 +- cribbage/cribbage.6.in | 46 +-- cribbage/cribbage.h | 4 +- cribbage/extern.c | 6 +- cribbage/io.c | 31 +- cribbage/score.c | 32 +- cribbage/support.c | 6 +- dm/Makefile.bsd | 8 +- dm/dm.8.in | 9 +- dm/dm.c | 5 +- dm/dm.conf.5.in | 16 +- exec.objs | 5 +- factor/Makefile.bsd | 18 +- factor/factor.6 | 15 +- factor/factor.c | 221 +++++++++--- fortune/datfiles/Makefile.bsd | 14 +- fortune/datfiles/fortunes | 14 +- fortune/datfiles/fortunes2 | 206 +++++------ fortune/datfiles/fortunes2-o.real | 2 +- fortune/datfiles/limerick | 2 +- fortune/datfiles/netbsd | 22 +- fortune/fortune/fortune.6.in | 8 +- fortune/fortune/fortune.c | 16 +- fortune/strfile/strfile.8 | 9 +- fortune/unstr/Makefile.bsd | 5 +- gomoku/gomoku.6 | 34 +- hack/Makefile.bsd | 8 +- hack/extern.h | 8 +- hack/hack.6.in | 35 +- hack/hack.main.c | 15 +- hack/hack.mkshop.c | 6 +- hack/hack.pri.c | 16 +- hack/hack.topl.c | 16 +- hack/hack.tty.c | 15 +- hack/help | 2 +- hangman/hangman.6.in | 7 +- hunt/Makefile.inc.bsd | 2 +- hunt/hunt/hunt.6.in | 60 ++-- hunt/hunt/hunt.c | 39 +-- hunt/hunt/playit.c | 30 +- hunt/huntd/answer.c | 24 +- hunt/huntd/bsd.h | 8 +- hunt/huntd/ctl_transact.c | 20 +- hunt/huntd/driver.c | 163 ++++----- hunt/huntd/extern.c | 8 +- hunt/huntd/faketalk.c | 7 +- hunt/huntd/hunt.h | 9 +- hunt/huntd/huntd.6.in | 14 +- hunt/huntd/terminal.c | 24 +- include/string.h | 39 +++ include/sys/poll.h | 38 +++ lib/strlcpy.c | 70 ++++ mille/mille.6 | 44 ++- mille/misc.c | 20 +- monop/Makefile.bsd | 4 +- monop/cards.c | 6 +- monop/getinp.c | 6 +- monop/monop.6.in | 24 +- monop/roll.c | 6 +- morse/Makefile.bsd | 5 +- phantasia/Makefile.bsd | 4 +- phantasia/misc.c | 4 +- phantasia/phantasia.6 | 302 ++++++++++------- pom/pom.6 | 12 +- ppt/Makefile.bsd | 5 +- ppt/ppt.c | 113 +++++- primes/Makefile.bsd | 5 +- quiz/datfiles/posneg | 6 +- quiz/quiz.6.in | 9 +- quiz/rxp.c | 17 +- rain/rain.6 | 7 +- random/random.6 | 6 +- robots/auto.c | 4 +- robots/init_field.c | 17 +- robots/move.c | 8 +- robots/robots.6.in | 9 +- robots/robots.h | 5 +- rogue/Makefile.bsd | 3 +- rogue/USD.doc/Makefile.bsd | 4 +- rogue/hit.c | 12 +- rogue/inventory.c | 18 +- rogue/level.c | 6 +- rogue/message.c | 6 +- rogue/rogue.6.in | 30 +- rogue/rogue.h | 12 +- rogue/save.c | 29 +- rogue/score.c | 8 +- sail/sail.6 | 471 +++++++++++++++----------- snake/snake/snake.6.in | 14 +- snake/snscore/Makefile.bsd | 5 +- substfiles2 | 3 +- tetris/input.c | 32 +- tetris/scores.c | 34 +- tetris/screen.c | 14 +- tetris/shapes.c | 10 +- tetris/tetris.6.in | 8 +- tetris/tetris.c | 16 +- trek/USD.doc/Makefile.bsd | 4 +- trek/damage.c | 6 +- trek/getpar.c | 8 +- trek/{trek.6.in => trek.6} | 9 +- wargames/wargames.6 | 10 +- worm/worm.6 | 19 +- worms/worms.6 | 9 +- wtf/acronyms | 17 +- wtf/wtf.6.in | 5 +- wtf/wtf.in | 4 +- 134 files changed, 2121 insertions(+), 1597 deletions(-) create mode 100644 include/string.h create mode 100644 include/sys/poll.h create mode 100644 lib/strlcpy.c rename trek/{trek.6.in => trek.6} (95%) diff --git a/COPYING b/COPYING index 274fa3d..1ee294e 100644 --- a/COPYING +++ b/COPYING @@ -160,6 +160,34 @@ Hess: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +In the case of "lib/strlcpy.c", the copyright is held by Todd +C. Miller: + + Copyright (c) 1998 Todd C. Miller + 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. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. + The game "atc" bears additional notices in the name of Ed James: Copyright (c) 1987 by Ed James, UC Berkeley. All rights reserved. @@ -267,7 +295,7 @@ insofar as they get compiled into the games; note that the include files are probably irrelevant for this purpose as it is unlikely they are significant enough to make any binary a derived work). - Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 Joseph Samuel Myers. + Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Joseph Samuel Myers. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -315,7 +343,7 @@ the compilation copyright on the package as a whole; ***this has yet to be confirmed with Andy Tefft***: Copyright (c) 1993 Curt Olson, Andy Tefft. - Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 Joseph Samuel Myers. + Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Joseph Samuel Myers. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ChangeLog b/ChangeLog index ac58f46..45796fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,61 @@ +2003-03-28 Joseph S. Myers + + * Makefile.bsd, Makefile.inc.bsd, adventure/Makefile.bsd, + arithmetic/arithmetic.6, arithmetic/arithmetic.c, atc/atc.6.in, + backgammon/backgammon/backgammon.6.in, + backgammon/common_source/Makefile.bsd, + backgammon/teachgammon/Makefile.bsd, banner/banner.6, + battlestar/battlestar.6, bcd/bcd.6, boggle/Makefile.bsd, + boggle/boggle/boggle.6, boggle/boggle/timer.c, + boggle/mkdict/Makefile.bsd, boggle/mkindex/Makefile.bsd, + caesar/caesar.6, canfield/canfield/canfield.6.in, + canfield/cfscores/Makefile.bsd, countmail/countmail, + countmail/countmail.6, cribbage/cribbage.6.in, + cribbage/cribbage.h, cribbage/extern.c, cribbage/io.c, + cribbage/score.c, cribbage/support.c, dm/Makefile.bsd, dm/dm.8.in, + dm/dm.c, dm/dm.conf.5.in, factor/Makefile.bsd, factor/factor.6, + factor/factor.c, fortune/datfiles/Makefile.bsd, + fortune/datfiles/fortunes, fortune/datfiles/fortunes2, + fortune/datfiles/fortunes2-o.real, fortune/datfiles/limerick, + fortune/datfiles/netbsd, fortune/fortune/fortune.6.in, + fortune/fortune/fortune.c, fortune/strfile/strfile.8, + fortune/unstr/Makefile.bsd, gomoku/gomoku.6, hack/Makefile.bsd, + hack/extern.h, hack/hack.6.in, hack/hack.main.c, + hack/hack.mkshop.c, hack/hack.pri.c, hack/hack.topl.c, + hack/hack.tty.c, hack/help, hangman/hangman.6.in, + hunt/Makefile.inc.bsd, hunt/hunt/hunt.6.in, hunt/hunt/hunt.c, + hunt/hunt/playit.c, hunt/huntd/answer.c, hunt/huntd/bsd.h, + hunt/huntd/ctl_transact.c, hunt/huntd/driver.c, + hunt/huntd/extern.c, hunt/huntd/faketalk.c, hunt/huntd/hunt.h, + hunt/huntd/huntd.6.in, hunt/huntd/terminal.c, mille/mille.6, + mille/misc.c, monop/Makefile.bsd, monop/cards.c, monop/getinp.c, + monop/monop.6.in, monop/roll.c, morse/Makefile.bsd, + phantasia/Makefile.bsd, phantasia/misc.c, phantasia/phantasia.6, + pom/pom.6, ppt/Makefile.bsd, ppt/ppt.c, primes/Makefile.bsd, + quiz/datfiles/posneg, quiz/quiz.6.in, quiz/rxp.c, rain/rain.6, + random/random.6, robots/auto.c, robots/init_field.c, + robots/move.c, robots/robots.6.in, robots/robots.h, + rogue/Makefile.bsd, rogue/USD.doc/Makefile.bsd, rogue/hit.c, + rogue/inventory.c, rogue/level.c, rogue/message.c, + rogue/rogue.6.in, rogue/rogue.h, rogue/save.c, rogue/score.c, + sail/sail.6, snake/snake/snake.6.in, snake/snscore/Makefile.bsd, + tetris/input.c, tetris/scores.c, tetris/screen.c, tetris/shapes.c, + tetris/tetris.6.in, tetris/tetris.c, trek/USD.doc/Makefile.bsd, + trek/damage.c, trek/getpar.c, trek/trek.6.in, wargames/wargames.6, + worm/worm.6, worms/worms.6, wtf/acronyms, wtf/wtf.in, + wtf/wtf.6.in: Update from NetBSD CVS. + * include/sys/poll.h: New file. + * lib/strlcpy.c: New file. + * configure: Test for strlcpy. + * include/string.h: New file. + * exec.objs: Use it for rogue. + * trek/trek.6.in: Rename to trek.6. + * substfiles2: Update. + * COPYING: Update. + * INSTALL: No longer suggest not using groff's macros. + * PACKAGING: Update. + * SECURITY: Update. + 2002-06-18 Joseph S. Myers * BUGS, ChangeLog, INSTALL, README, README.non-free, SECURITY, diff --git a/INSTALL b/INSTALL index e2eaa76..e784716 100644 --- a/INSTALL +++ b/INSTALL @@ -72,12 +72,6 @@ versions may produce many warnings in the system headers; these generally represent bugs in the headers whose only impact is cosmetic, and can be ignored. -Some man pages may look better with the tmac.doc macros from NetBSD, -rather than the older ones distributed with groff. If any man pages -look funny or appear to have words missing (especially the program -name or a reference to NetBSD), having older tmac.doc may be the -cause. - Security ======== diff --git a/Makefile.bsd b/Makefile.bsd index e41395b..4089709 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 1999/07/22 01:09:00 mrg Exp $ +# $NetBSD: Makefile,v 1.20 2002/06/16 22:24:00 itojun Exp $ # @(#)Makefile 8.3 (Berkeley) 7/24/94 # Missing: ching dungeon warp diff --git a/Makefile.inc.bsd b/Makefile.inc.bsd index 68a953c..2ae546a 100644 --- a/Makefile.inc.bsd +++ b/Makefile.inc.bsd @@ -1,16 +1,22 @@ -# $NetBSD: Makefile.inc,v 1.9 1997/11/20 00:12:30 mrg Exp $ +# $NetBSD: Makefile.inc,v 1.11 2002/01/27 00:35:16 perry Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 5/31/93 -.if defined(HIDEGAME) && defined(PROG) -BINDIR?= /usr/games/hide -BINGRP?= games +MKHIDEGAME?= no + +.if defined(HIDEGAME) && (MKHIDEGAME!=no) && defined(PROG) +BINDIR= /usr/games/hide +BINGRP= games .if defined(SETGIDGAME) -BINMODE?= 2550 +BINMODE= 2550 .else -BINMODE?= 550 +BINMODE= 550 .endif SYMLINKS+= dm /usr/games/${PROG} .else -BINDIR?= /usr/games +BINDIR= /usr/games +.if defined(SETGIDGAME) +BINGRP= games +BINMODE= 2555 +.endif .endif WARNS?= 1 diff --git a/PACKAGING b/PACKAGING index 6d41214..edd0175 100644 --- a/PACKAGING +++ b/PACKAGING @@ -55,8 +55,7 @@ BSD Users' Supplementary Documents for trek and rogue versions thereof), the AUTHORS and THANKS files, and the year 2000 statement YEAR2000. Note that the trek manpage contains a reference to /usr/doc/trek, which should be updated to point to where you put -trek.me or a formatted version. As noted below, it is better to -update trek.6.in (before configure) than trek.6. +trek.me or a formatted version. Assuming you distribute source for your package (I do not believe any of the games have licences requiring this), and separate your patches diff --git a/SECURITY b/SECURITY index 9bbe3ed..1a25114 100644 --- a/SECURITY +++ b/SECURITY @@ -22,7 +22,8 @@ sail, rogue, hack and tetris do not currently handle their score files in the above way, and so should be considered the most dangerous to install setgid. If you are auditing these games, phantasia, sail, rogue, hack and tetris should be considered the most important to -audit. +audit. In versions before 2.14, rogue had an exploitable buffer +overrun (see NetBSD Security Advisory 2002-021). An effect of this security policy is that in some cases the score files need to be world-readable so that they can be opened for reading diff --git a/adventure/Makefile.bsd b/adventure/Makefile.bsd index dda16ef..adc23f3 100644 --- a/adventure/Makefile.bsd +++ b/adventure/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2000/04/24 15:15:05 pk Exp $ +# $NetBSD: Makefile,v 1.9 2002/03/05 21:28:12 thorpej Exp $ # @(#)Makefile 8.1 (Berkeley) 6/12/93 PROG= adventure @@ -8,7 +8,7 @@ HIDEGAME=hidegame CLEANFILES+=setup data.c data.c: glorkz setup - ${.OBJDIR}/setup ${.CURDIR}/glorkz > data.c + ./setup ${.CURDIR}/glorkz > data.c setup: setup.c hdr.h ${HOST_LINK.c} -o setup ${.CURDIR}/setup.c diff --git a/arithmetic/arithmetic.6 b/arithmetic/arithmetic.6 index 81e29bd..4040d67 100644 --- a/arithmetic/arithmetic.6 +++ b/arithmetic/arithmetic.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: arithmetic.6,v 1.8 2001/04/02 22:42:37 wiz Exp $ +.\" $NetBSD: arithmetic.6,v 1.9 2002/09/26 18:31:58 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -81,7 +81,8 @@ divide by or subtract will be between 0 and .Ar range . (Of course, .Nm -will not ask you to divide by 0.) The default +will not ask you to divide by 0.) +The default .I range is 10. .El diff --git a/arithmetic/arithmetic.c b/arithmetic/arithmetic.c index 1b2a6de..13add74 100644 --- a/arithmetic/arithmetic.c +++ b/arithmetic/arithmetic.c @@ -1,4 +1,4 @@ -/* $NetBSD: arithmetic.c,v 1.17 2001/02/19 22:41:45 cgd Exp $ */ +/* $NetBSD: arithmetic.c,v 1.18 2002/03/31 04:07:22 hubertf Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: arithmetic.c,v 1.17 2001/02/19 22:41:45 cgd Exp $"); +__RCSID("$NetBSD: arithmetic.c,v 1.18 2002/03/31 04:07:22 hubertf Exp $"); #endif #endif /* not lint */ @@ -94,7 +94,7 @@ int main __P((int, char *[])); int opnum __P((int)); void penalise __P((int, int, int)); int problem __P((void)); -void showstats __P((void)); +void showstats __P((int)); void usage __P((void)) __attribute__((__noreturn__)); const char keylist[] = "+-x/"; @@ -157,7 +157,7 @@ main(argc, argv) for (cnt = NQUESTS; cnt--;) if (problem() == EOF) exit(0); - showstats(); + showstats(0); } /* NOTREACHED */ } @@ -167,13 +167,14 @@ void intr(dummy) int dummy __attribute__((__unused__)); { - showstats(); + showstats(1); exit(0); } /* Print score. Original `arithmetic' had a delay after printing it. */ void -showstats() +showstats(bool_sigint) + int bool_sigint; { if (nright + nwrong > 0) { (void)printf("\n\nRights %d; Wrongs %d; Score %d%%", @@ -182,6 +183,10 @@ showstats() (void)printf("\nTotal time %ld seconds; %.1f seconds per problem\n\n", (long)qtime, (float)qtime / nright); } + if(!bool_sigint) { + (void)printf("Press RETURN to continue...\n"); + while(!getchar()) ; + } (void)printf("\n"); } diff --git a/atc/atc.6.in b/atc/atc.6.in index cf5fbb9..3386809 100644 --- a/atc/atc.6.in +++ b/atc/atc.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: atc.6,v 1.11 2001/06/05 11:14:30 wiz Exp $ +.\" $NetBSD: atc.6,v 1.16 2003/02/25 10:34:44 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -52,8 +52,7 @@ .Sh DESCRIPTION .Nm lets you try your hand at the nerve wracking duties of the air traffic -controller without endangering the lives of millions of -travelers each year. +controller without endangering the lives of millions of travelers each year. Your responsibilities require you to direct the flight of jets and prop planes into and out of the flight arena and airports. The speed (update time) and frequency of the planes depend on the @@ -62,7 +61,7 @@ difficulty of the chosen arena. .Bl -tag -width flag .It Fl u Print the usage line and exit. -.It Fl ? +.It Fl \&? Same as .Fl u . .It Fl l @@ -76,18 +75,19 @@ Same as .It Fl p Print the path to the special directory where .Nm -expects to find its private files. This is used during the -installation of the program. +expects to find its private files. +This is used during the installation of the program. .It Fl g Ar game -Play the named game. If the game listed is not one of the -ones printed from the +Play the named game. +If the game listed is not one of the ones printed from the .Fl l option, the default game is played. .It Fl f Ar game Same as .Fl g . .It Fl r Ar seed -Set the random seed. The purpose of this flag is questionable. +Set the random seed. +The purpose of this flag is questionable. .El .Sh GOALS Your goal in @@ -102,28 +102,29 @@ out of exit points. Several things will cause the end of the game. Each plane has a destination (see information area), and sending a plane to the wrong destination is an error. -Planes can run out of fuel, or can collide. Collision is defined as -adjacency in all three dimensions. A plane leaving the arena +Planes can run out of fuel, or can collide. +Collision is defined as adjacency in all three dimensions. +A plane leaving the arena in any other way than through its destination exit is an error as well. .Pp -Scores are sorted in order of the number of planes safe. The other -statistics are provided merely for fun. There is no penalty for +Scores are sorted in order of the number of planes safe. +The other statistics are provided merely for fun. +There is no penalty for taking longer than another player (except in the case of ties). .Pp -Suspending a game is not permitted. If you get a talk message, tough. -When was the last time an Air Traffic Controller got called away to -the phone? -.Sh "THE DISPLAY" +Suspending a game is not permitted. +If you get a talk message, tough. +When was the last time an Air Traffic Controller got called away to the phone? +.Sh THE DISPLAY .Pp Depending on the terminal you run .Nm on, the screen will be divided into 4 areas. It should be stressed that the terminal driver portion of the game was designed to be reconfigurable, so the display format can vary -depending the version you are playing. The descriptions here are based -on the ascii version -of the game. The game rules and input format, however, -should remain consistent. +depending the version you are playing. +The descriptions here are based on the ascii version of the game. +The game rules and input format, however, should remain consistent. Control-L redraws the screen, should it become muddled. .Ss RADAR The first screen area is the radar display, showing the relative locations @@ -131,39 +132,41 @@ of the planes, airports, standard entry/exit points, radar beacons, and ``lines'' which simply serve to aid you in guiding the planes. .Pp -Planes are shown as a single letter with an altitude. If -the numerical altitude is a single digit, then it represents +Planes are shown as a single letter with an altitude. +If the numerical altitude is a single digit, then it represents thousands of feet. -Some distinction is made between the prop -planes and the jets. On ascii terminals, prop planes are +Some distinction is made between the prop planes and the jets. +On ascii terminals, prop planes are represented by a upper case letter, jets by a lower case letter. .Pp Airports are shown as a number and some indication of the direction planes must be going to land at the airport. -On ascii terminals, this is one of `^', `>', `<', and `v', to indicate +On ascii terminals, this is one of `^', `\*[Gt]', `\*[Lt]', and `v', to indicate north (0 degrees), east (90), west (270) and south (180), respectively. -The planes will also -take off in this direction. +The planes will also take off in this direction. .Pp Beacons are represented as circles or asterisks and a number. Their purpose is to offer a place of easy reference to the plane pilots. -See ``the delay command'' under the input section of this manual. +See +.Sx THE DELAY COMMAND +section below. .Pp Entry/exit points are displayed as numbers along the border of the -radar screen. Planes will enter the arena from these points without -warning. These points have a direction associated with them, and -planes will always enter the arena from this direction. On the -ascii version of -.Nm "" , -this direction is not displayed. It will become apparent -what this direction is as the game progresses. +radar screen. +Planes will enter the arena from these points without warning. +These points have a direction associated with them, and +planes will always enter the arena from this direction. +On the ascii version of +.Nm , +this direction is not displayed. +It will become apparent what this direction is as the game progresses. .Pp Incoming planes will always enter at the same altitude: 7000 feet. For a plane to successfully depart through an entry/exit point, it must be flying at 9000 feet. It is not necessary for the planes to be flying in any particular direction when they leave the arena (yet). -.Ss "INFORMATION AREA" +.Ss INFORMATION AREA The second area of the display is the information area, which lists the time (number of updates since start), and the number of planes you have directed safely out of the arena. @@ -171,46 +174,50 @@ Below this is a list of planes currently in the air, followed by a blank line, and then a list of planes on the ground (at airports). Each line lists the plane name and its current altitude, an optional asterisk indicating low fuel, the plane's destination, -and the plane's current command. Changing altitude is not considered -to be a command and is therefore not displayed. The following are -some possible information lines: +and the plane's current command. +Changing altitude is not considered +to be a command and is therefore not displayed. +The following are some possible information lines: .Pp .Bd -literal -unfilled -offset indent B4*A0: Circle @ b1 g7 E4: 225 .Ed .Pp -The first example shows a prop plane named `B' that is flying at 4000 -feet. It is low on fuel (note the `*'). Its destination is -Airport #0. -The next command it expects -to do is circle when it reaches Beacon #1. +The first example shows a prop plane named `B' that is flying at 4000 feet. +It is low on fuel (note the `*'). +Its destination is Airport #0. +The next command it expects to do is circle when it reaches Beacon #1. The second example shows a jet named `g' at 7000 feet, destined for -Exit #4. It is just now executing a turn to 225 degrees (South-West). -.Ss "INPUT AREA" -The third area of the display is the input area. It is here that -your input is reflected. See the INPUT heading of this manual -for more details. -.Ss "AUTHOR AREA" +Exit #4. +It is just now executing a turn to 225 degrees (South-West). +.Ss INPUT AREA +The third area of the display is the input area. +It is here that your input is reflected. +See the +.Sx INPUT +heading of this manual for more details. +.Ss AUTHOR AREA This area is used simply to give credit where credit is due. :-) .Sh INPUT -A command completion interface is built into -the game. At any time, typing `?' will list possible input characters. +A command completion interface is built into the game. +At any time, typing `?' will list possible input characters. Typing a backspace (your erase character) backs up, erasing the last part -of the command. When a command is complete, a return enters it, and -any semantic checking is done at that time. If no errors are detected, -the command is sent to the appropriate plane. If an error is discovered +of the command. +When a command is complete, a return enters it, and +any semantic checking is done at that time. +If no errors are detected, the command is sent to the appropriate plane. +If an error is discovered during the check, the offending statement will be underscored and a (hopefully) descriptive message will be printed under it. .Pp The command syntax is broken into two parts: -.Em "Immediate Only" +.Em Immediate Only and .Em Delayable commands. -.Em "Immediate Only" -commands happen on the next -update. +.Em Immediate Only +commands happen on the next update. .Em Delayable commands also happen on the next update unless they are followed by an optional predicate called the @@ -220,16 +227,17 @@ command. In the following tables, the syntax .Em [0\-9] means any single digit, and -.Em +.Aq Em dir refers to a direction, given by the keys around the `s' key: ``wedcxzaq''. In absolute references, `q' refers to North-West or 315 degrees, and `w' refers to North, or 0 degrees. -In relative references, `q' refers to -45 degrees or 45 degrees left, and `w' +In relative references, `q' refers to \-45 degrees or 45 degrees left, and `w' refers to 0 degrees, or no change in direction. .Pp -All commands start with a plane letter. This indicates the recipient -of the command. Case is ignored. -.Ss "IMMEDIATE ONLY COMMANDS" +All commands start with a plane letter. +This indicates the recipient of the command. +Case is ignored. +.Ss IMMEDIATE ONLY COMMANDS .Bl -tag -width "aaaa" .It "a [ cd+- ]" Em number Altitude: Change a plane's altitude, possibly requesting takeoff. @@ -243,18 +251,18 @@ Climb: relative altitude change. Descend: relative altitude change. .El .It m -Mark: Display in highlighted mode. Plane and command information -is displayed normally. +Mark: Display in highlighted mode. +Plane and command information is displayed normally. .It i -Ignore: Do not display highlighted. Command is displayed as a -line of dashes if there is no command. +Ignore: Do not display highlighted. +Command is displayed as a line of dashes if there is no command. .It u Unmark: Same as ignore, but if a delayed command is processed, -the plane will become marked. This is useful if you want -to forget about a plane during part, but not all, of its -journey. +the plane will become marked. +This is useful if you want to forget about a plane during part, +but not all, of its journey. .El -.Ss "DELAYABLE COMMANDS" +.Ss DELAYABLE COMMANDS .Bl -tag -width "aaaa" .It "c [ lr ]" Circle: Have the plane circle. @@ -267,20 +275,24 @@ Right: Circle clockwise (default). .It "t [ l-r+LR ] [ dir ] or tt [ abe* ]" Em number Turn: Change direction. .Bl -tag -width "aaaaaaaaaa" -compact -.It "t" +.It "t\*[Lt]dir\*[Gt]" Turn to direction: Turn to the absolute compass heading given. The shortest turn will be taken. .It "tl [ dir ]" Left: Turn counterclockwise: 45 degrees by default, or the amount -specified in (not +specified in +.Aq dir +(not .Em to -.) `w' (0 degrees) is no turn. `e' is 45 degrees; `q' gives -45 -degrees counterclockwise, that is, 45 degrees clockwise. +.Aq dir . ) +`w' (0 degrees) is no turn. +`e' is 45 degrees; `q' gives \-45 degrees counterclockwise, that is, +45 degrees clockwise. .It "t- [ dir ]" Same as left. .It "tr [ dir ]" -Right: Turn clockwise, 45 degrees by default, or the amount specified -in . +Right: Turn clockwise, 45 degrees by default, or the amount specified in +.Aq dir . .It "t+ [ dir ]" Same as right. .It tL @@ -288,8 +300,8 @@ Hard left: Turn counterclockwise 90 degrees. .It tR Hard right: Turn clockwise 90 degrees. .It "tt [abe*]" -Towards: Turn towards a beacon, airport or exit. The turn is -just an estimate. +Towards: Turn towards a beacon, airport or exit. +The turn is just an estimate. .It "tta" Em number Turn towards the given airport. .It "ttb" Em number @@ -303,33 +315,33 @@ Same as ttb. .Ss THE DELAY COMMAND The .Em Delay -(a/@) -command may be appended to any +(a/@) command may be appended to any .Em Delayable -command. It allows the controller to instruct a plane to do an action -when the plane reaches a particular beacon (or other objects in future -versions). +command. +It allows the controller to instruct a plane to do an action when the +plane reaches a particular beacon (or other objects in future versions). .Bl -tag -width "aaaa" .It ab Em number -Do the delayable command when the plane reaches the specified -beacon. The `b' for ``beacon'' is redundant to allow for expansion. +Do the delayable command when the plane reaches the specified beacon. +The `b' for ``beacon'' is redundant to allow for expansion. `@' can be used instead of `a'. .El -.Ss "MARKING, UNMARKING AND IGNORING" +.Ss MARKING, UNMARKING AND IGNORING Planes are .Em marked -by default when they enter the arena. This means they are displayed -in highlighted mode on the radar display. A plane may also be either +by default when they enter the arena. +This means they are displayed in highlighted mode on the radar display. +A plane may also be either .Em unmarked or .Em ignored . An .Em ignored plane is drawn in unhighlighted mode, and a line of dashes is displayed in -the command field of the information area. The plane will remain this -way until a mark command has been issued. Any other command will be issued, -but the command line will return to a line of dashes when the command -is completed. +the command field of the information area. +The plane will remain this way until a mark command has been issued. +Any other command will be issued, but the command line will return to a +line of dashes when the command is completed. .Pp An .Em unmarked @@ -337,12 +349,13 @@ plane is treated the same as an .Em ignored plane, except that it will automatically switch to .Em marked -status when a delayed command has been processed. This is useful if -you want to forget about a plane for a while, but its flight path has -not yet been completely set. +status when a delayed command has been processed. +This is useful if you want to forget about a plane for a while, but its +flight path has not yet been completely set. .Pp As with all of the commands, marking, unmarking and ignoring will take effect -at the beginning of the next update. Do not be surprised if the plane does +at the beginning of the next update. +Do not be surprised if the plane does not immediately switch to unhighlighted mode. .Ss EXAMPLES .Bl -tag -width gtte4ab2 -offset indent @@ -359,7 +372,7 @@ Plane S: turn to 315 .It xi Plane X: ignore .El -.Sh "OTHER INFORMATION" +.Sh OTHER INFORMATION .Bl -bullet .It Jets move every update; prop planes move every other update. @@ -372,16 +385,17 @@ Planes flying at an altitude of 0 crash if they are not over an airport. .It Planes waiting at airports can only be told to take off (climb in altitude). .El -.Sh "NEW GAMES" +.Sh NEW GAMES The .Pa Game_List -file lists the currently available play fields. New field description -file names must be placed in this file to be playable. If a player -specifies a game not in this file, his score will not be logged. +file lists the currently available play fields. +New field description file names must be placed in this file to be playable. +If a player specifies a game not in this file, his score will not be logged. .Pp -The game field description files are broken into two parts. The first -part is the definition section. Here, the four tunable game parameters -must be set. These variables are set with the syntax: +The game field description files are broken into two parts. +The first part is the definition section. +Here, the four tunable game parameters must be set. +These variables are set with the syntax: .Pp .Dl "variable = number;" .Pp @@ -412,32 +426,32 @@ The syntax is as follows: .El .Ed .Pp -For beacons, a simple x, y coordinate pair is used (enclosed in -parenthesis). Airports and exits require a third value, which is one -of the directions +For beacons, a simple x, y coordinate pair is used (enclosed in parenthesis). +Airports and exits require a third value, which is one of the directions .Em wedcxzaq . For airports, this is the direction that planes must be going to take off and land, and for exits, this is the direction that planes will going when they .Em enter -the arena. This may not seem intuitive, but as there is no restriction on +the arena. +This may not seem intuitive, but as there is no restriction on direction of exit, this is appropriate. Lines are slightly different, since they need two coordinate pairs to -specify the line endpoints. These endpoints must be enclosed in -square brackets. +specify the line endpoints. +These endpoints must be enclosed in square brackets. .Pp -All statements are semi-colon (;) terminated. Multiple item statements -accumulate. Each definition must occur exactly once, before any -item statements. Comments begin with a hash (#) symbol -and terminate with a newline. -The coordinates are between zero and width-1 and height-1 -inclusive. All of the exit coordinates must lie on the borders, and +All statements are semi-colon (;) terminated. +Multiple item statements accumulate. +Each definition must occur exactly once, before any item statements. +Comments begin with a hash (#) symbol and terminate with a newline. +The coordinates are between zero and width-1 and height-1 inclusive. +All of the exit coordinates must lie on the borders, and all of the beacons and airports must lie inside of the borders. Line endpoints may be anywhere within the field, so long as the lines are horizontal, vertical or .Em exactly diagonal. -.Ss "FIELD FILE EXAMPLE" +.Ss FIELD FILE EXAMPLE .Bd -literal -unfilled # This is the default game. @@ -465,14 +479,16 @@ line: [ ( 1 1 ) ( 6 6 ) ] .Ed .Sh FILES -Files are kept in a special directory. See the OPTIONS for a way to -print this path out. It is normally +Files are kept in a special directory. +See the +.Sx OPTIONS +section for a way to print this path out. +It is normally .Pa @atc_dir@ . .Pp This directory contains the file .Pa Game_List , -which holds the list of playable games, as well as the games -themselves. +which holds the list of playable games, as well as the games themselves. .Pp The scores are kept in .Pa @atc_scorefile@ . @@ -483,8 +499,3 @@ This game is based on someone's description of the overall flavor of a game written for some unknown PC many years ago, maybe. .Sh BUGS The screen sometimes refreshes after you have quit. -.Pp -Yet Another Curses Bug was discovered during the development of this game. -If your curses library clrtobot.o is version 5.1 or earlier, -you will have erase problems with the backspace operator in the input -window. diff --git a/backgammon/backgammon/backgammon.6.in b/backgammon/backgammon/backgammon.6.in index 01ccfea..7657556 100644 --- a/backgammon/backgammon/backgammon.6.in +++ b/backgammon/backgammon/backgammon.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: backgammon.6,v 1.8 2001/04/02 22:47:29 wiz Exp $ +.\" $NetBSD: backgammon.6,v 1.9 2002/09/26 18:31:58 wiz Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,14 +56,12 @@ .Sh DESCRIPTION This program lets you play backgammon against the computer or against a "friend". -All commands only are one letter, -so you don't need to type a carriage return, +All commands only are one letter, so you don't need to type a carriage return, except at the end of a move. The program is mostly self documenting, so that a question mark (?) will usually get some help. If you answer `y' when the program asks if you want the rules, -you will get text explaining the rules of the game, -some hints on strategy, +you will get text explaining the rules of the game, some hints on strategy, instruction on how to use the program, and a tutorial consisting of a practice game against the computer. A description of how to use the program can be @@ -175,7 +173,7 @@ for bar and for home, or 0 or 25 as appropriate. .Sh AUTHOR -Alan Char +.An Alan Char .Sh FILES .Bl -tag -width /usr/share/misc/termcap -compact .It Pa @gamesdir@/teachgammon diff --git a/backgammon/common_source/Makefile.bsd b/backgammon/common_source/Makefile.bsd index 55a513b..1d91ed7 100644 --- a/backgammon/common_source/Makefile.bsd +++ b/backgammon/common_source/Makefile.bsd @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.6 2001/12/12 00:07:47 tv Exp $ - -LIB= common -SRCS= allow.c board.c check.c fancy.c init.c odds.c \ - one.c save.c subs.c table.c +# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:39 lukem Exp $ NOLINKLIB= # defined NOLINT= # defined NOPIC= # defined NOPROFILE= # defined +LIB= common +SRCS= allow.c board.c check.c fancy.c init.c odds.c \ + one.c save.c subs.c table.c + .include diff --git a/backgammon/teachgammon/Makefile.bsd b/backgammon/teachgammon/Makefile.bsd index e57824f..af8662e 100644 --- a/backgammon/teachgammon/Makefile.bsd +++ b/backgammon/teachgammon/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.10 2001/12/12 00:07:47 tv Exp $ +# $NetBSD: Makefile,v 1.11 2002/09/18 06:16:39 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +NOMAN= # defined + PROG= teachgammon SRCS= data.c teach.c ttext1.c ttext2.c tutor.c -NOMAN= # defined .include diff --git a/banner/banner.6 b/banner/banner.6 index a1523ca..0f46ca4 100644 --- a/banner/banner.6 +++ b/banner/banner.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: banner.6,v 1.10 2001/03/07 22:30:38 garbled Exp $ +.\" $NetBSD: banner.6,v 1.12 2002/09/26 18:31:59 wiz Exp $ .\" .\" Copyright (c) 1980, 1993, 1995 .\" The Regents of the University of California. All rights reserved. @@ -57,8 +57,8 @@ suitable for a narrow terminal. The output should be printed on paper of the appropriate width, with no breaks between the pages. .Sh BUGS -Several ASCII characters are not defined, notably <, >, [, ], \\, -^, _, {, }, |, and ~. Also, the characters ", ', and & are funny +Several ASCII characters are not defined, notably \*[Lt], \*[Gt], [, ], \\, +^, _, {, }, |, and ~. Also, the characters ", ', and \*[Am] are funny looking (but in a useful way.) .Pp The @@ -67,4 +67,4 @@ option is implemented by skipping some rows and columns. The smaller it gets, the grainier the output. Sometimes it runs letters together. .Sh AUTHOR -Mark Horton +.An Mark Horton diff --git a/battlestar/battlestar.6 b/battlestar/battlestar.6 index 8806b4b..b8ecf08 100644 --- a/battlestar/battlestar.6 +++ b/battlestar/battlestar.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: battlestar.6,v 1.9 2001/04/02 22:42:37 wiz Exp $ +.\" $NetBSD: battlestar.6,v 1.12 2002/09/26 18:31:59 wiz Exp $ .\" .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,14 +45,12 @@ .Op Ar saved-file .Sh DESCRIPTION .Nm -is an adventure game in the classic style. However, it's slightly less -of a -puzzle and more a game of exploration. There are a few magical words -in the game, but on the whole, simple English +is an adventure game in the classic style. +However, it's slightly less of a puzzle and more a game of exploration. +There are a few magical words in the game, but on the whole, simple English should suffice to make one's desires understandable to the parser. .Sh THE SETTING -In the days before the darkness came, when battlestars ruled the -heavens... +In the days before the darkness came, when battlestars ruled the heavens... .Bd -literal -offset indent Three He made and gave them to His daughters, Beautiful nymphs, the goddesses of the waters. @@ -61,19 +59,18 @@ Two to wash the lands and churn the waves asunder, Three to rule the world and purge the skies with thunder. .Ed .Pp -In those times great wizards were known and their powers were beyond -belief. They could take any object from thin air, and, uttering the -word +In those times great wizards were known and their powers were beyond belief. +They could take any object from thin air, and, uttering the word .Sq su could disappear. .Pp In those times men were known for their lust of gold and desire to -wear fine weapons. Swords and coats of mail were fashioned that could -withstand a laser blast. +wear fine weapons. +Swords and coats of mail were fashioned that could withstand a laser blast. .Pp -But when the darkness fell, the rightful reigns were toppled. Swords -and helms and heads of state went rolling across the grass. The entire -fleet of battlestars was reduced to a single ship. +But when the darkness fell, the rightful reigns were toppled. +Swords and helms and heads of state went rolling across the grass. +The entire fleet of battlestars was reduced to a single ship. .Sh SAMPLE COMMANDS .Bd -literal -offset indent take --- take an object @@ -85,19 +82,19 @@ draw --- carry an object you are wearing puton --- take an object and wear it take off -- draw an object and drop it -throw +throw \*[Lt]object\*[Gt] \*[Lt]direction\*[Gt] -! +! \*[Lt]shell esc\*[Gt] .Ed .Sh IMPLIED OBJECTS .Bd -literal -offset indent ->-: take watermelon +\*[Gt]-: take watermelon watermelon: Taken. ->-: eat +\*[Gt]-: eat watermelon: Eaten. ->-: take knife and sword and apple, drop all +\*[Gt]-: take knife and sword and apple, drop all knife: Taken. broadsword: @@ -110,16 +107,16 @@ broadsword: Dropped. apple: Dropped. ->-: get +\*[Gt]-: get knife: Taken. .Ed .Pp Notice that the "shadow" of the next word stays around if you -want to take advantage of it. That is, saying "take knife" and then -"drop" +want to take advantage of it. +That is, saying "take knife" and then "drop" will drop the knife you just took. -.Sh SCORE & INVEN +.Sh SCORE \*[Am] INVEN The two commands .Dq score and @@ -130,19 +127,17 @@ The command .Dq save will save your game in a file called .Pa .Bstar -in your home directory -by default. +in your home directory by default. You can recover a saved game by using the .Fl r option when you start up the game, or by giving the name of the saved file as an argument. Save files will be saved to and restored from your home directory unless a -path is specified \- i.e., +path is specified - i.e., .Dq Li battlestar -r savedgame will look for .Pa savedgame -in your home directory, -but +in your home directory, but .Dq Li battlestar -r ./savedgame will look in the current directory. .Dq Li battlestar -r @@ -154,7 +149,7 @@ The compass directions N, S, E, and W can be used if you have a compass. If you don't have a compass, you'll have to say R, L, A, or B, which stand for Right, Left, Ahead, and Back. Directions printed in room descriptions are -always printed in R, L, A, & B relative directions. +always printed in R, L, A, and B relative directions. .Sh HISTORY I wrote Battlestar in 1979 in order to experiment with the niceties of the C Language. @@ -162,8 +157,8 @@ Most interesting things that happen in the game are hardwired into the code, so don't send me any hate mail about it! Instead, enjoy art for art's sake! .Sh AUTHOR -David Riggle -.Sh INSPIRATION & ASSISTANCE +.An David Riggle +.Sh INSPIRATION \*[Am] ASSISTANCE .Bl -item -compact .It Chris Guthrie @@ -174,7 +169,7 @@ Kevin Brown .It Edward Wang .It -Ken Arnold & Company +Ken Arnold \*[Am] Company .El .Sh BUGS Countless. diff --git a/bcd/bcd.6 b/bcd/bcd.6 index 793b108..a7a1052 100644 --- a/bcd/bcd.6 +++ b/bcd/bcd.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: bcd.6,v 1.12 2001/06/05 12:41:04 wiz Exp $ +.\" $NetBSD: bcd.6,v 1.15 2003/02/25 10:34:45 wiz Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" .\" @(#)bcd.6 8.1 (Berkeley) 5/31/93 .\" -.Dd May 31, 1993 +.Dd November 26, 2002 .Dt BCD 6 .Os .Sh NAME @@ -45,12 +45,12 @@ .Nm .Op Ar string ... .Nm ppt -.Op Ar string ... +.Op Fl d Ns \&| Ns Ar string ... .Nm morse .Op Fl ds Ar string ... .Sh DESCRIPTION The -.Nm "" , +.Nm , .Nm ppt and .Nm morse @@ -65,10 +65,13 @@ The .Fl s option for morse produces dots and dashes rather than words. .It Fl d -Decode morse output consisting of dots and slashes (as generated -by using the +Decode +.Nm ppt +output, or +.Nm morse +output consisting of dots and slashes (as generated by using the .Fl s -option. +option). .El .Sh SEE ALSO .Rs diff --git a/boggle/Makefile.bsd b/boggle/Makefile.bsd index 4543e37..ecfcfc2 100644 --- a/boggle/Makefile.bsd +++ b/boggle/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2000/12/30 17:51:26 sommerfeld Exp $ +# $NetBSD: Makefile,v 1.19 2002/09/18 02:51:46 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/11/93 .include @@ -9,8 +9,8 @@ MKDICTDIR!= cd $(.CURDIR)/mkdict; ${PRINTOBJDIR} MKDICT=${MKDICTDIR}/mkdict MKINDEXDIR!= cd $(.CURDIR)/mkindex; ${PRINTOBJDIR} MKINDEX=${MKINDEXDIR}/mkindex -WORDS=${.CURDIR}/../../share/dict/web2 -DICTFILES=${.OBJDIR}/dictionary ${.OBJDIR}/dictindex +WORDS=${NETBSDSRCDIR}/share/dict/web2 +DICTFILES=dictionary dictindex .if ${MKSHARE} != "no" FILES=${DICTFILES} FILESDIR=/usr/share/games/boggle @@ -25,13 +25,13 @@ ${MKDICT}: ${MKINDEX}: @cd ${.CURDIR}/mkindex && ${MAKE} -${.OBJDIR}/dictionary: ${WORDS} ${MKDICT} +dictionary: ${WORDS} ${MKDICT} rm -f ${.TARGET} ${MKDICT} < ${WORDS} > ${.TARGET} -${.OBJDIR}/dictindex: ${.OBJDIR}/dictionary ${MKINDEX} +dictindex: dictionary ${MKINDEX} rm -f ${.TARGET} - ${MKINDEX} < ${.OBJDIR}/dictionary > ${.TARGET} + ${MKINDEX} < dictionary > ${.TARGET} .include .include diff --git a/boggle/boggle/boggle.6 b/boggle/boggle/boggle.6 index 6dee882..6615214 100644 --- a/boggle/boggle/boggle.6 +++ b/boggle/boggle/boggle.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: boggle.6,v 1.3 2001/04/02 22:46:18 wiz Exp $ +.\" $NetBSD: boggle.6,v 1.5 2002/09/26 18:31:59 wiz Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -103,8 +103,8 @@ Help is available during play by typing More detailed information on the game is given there. .Sh BUGS If there are a great many words in the cube the final display of the words -may scroll off of the screen. (On a 25 line screen about 130 words can be -displayed.) +may scroll off of the screen. +(On a 25 line screen about 130 words can be displayed.) .Pp No word can contain a .Sq q @@ -115,8 +115,7 @@ When using the .Ar + or .Ar ++ -options the display of words found in the board -doesn't indicate reused cubes. +options the display of words found in the board doesn't indicate reused cubes. .Sh AUTHOR Boggle is a trademark of Parker Brothers. .Pp diff --git a/boggle/boggle/timer.c b/boggle/boggle/timer.c index 5ac733b..1f48077 100644 --- a/boggle/boggle/timer.c +++ b/boggle/boggle/timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: timer.c,v 1.5 2001/02/05 00:27:35 christos Exp $ */ +/* $NetBSD: timer.c,v 1.7 2002/09/19 21:26:56 mycroft Exp $ */ /*- * Copyright (c) 1993 @@ -41,12 +41,13 @@ #if 0 static char sccsid[] = "@(#)timer.c 8.2 (Berkeley) 2/22/94"; #else -__RCSID("$NetBSD: timer.c,v 1.5 2001/02/05 00:27:35 christos Exp $"); +__RCSID("$NetBSD: timer.c,v 1.7 2002/09/19 21:26:56 mycroft Exp $"); #endif #endif /* not lint */ #include #include +#include #include #include @@ -57,7 +58,7 @@ __RCSID("$NetBSD: timer.c,v 1.5 2001/02/05 00:27:35 christos Exp $"); #include "bog.h" #include "extern.h" -static int waitch __P((long)); +static int waitch __P((int)); extern int tlimit; extern time_t start_t; @@ -78,7 +79,7 @@ timerch() getyx(stdscr, row, col); prevt = 0L; for (;;) { - if (waitch(1000L) == 1) + if (waitch(1) == 1) break; time(&t); if (t == prevt) @@ -103,25 +104,22 @@ timerch() */ static int waitch(delay) - long delay; + int delay; { - fd_set fdbits; - struct timeval duration; + struct pollfd set[1]; - duration.tv_sec = 0; - duration.tv_usec = delay; - FD_ZERO(&fdbits); - FD_SET(STDIN_FILENO, &fdbits); - return (select(32, &fdbits, NULL, NULL, &duration)); + set[0].fd = STDIN_FILENO; + set[0].events = POLLIN; + return (poll(set, 1, delay)); } void delay(tenths) int tenths; { - struct timeval duration; + struct timespec duration; - duration.tv_usec = (tenths % 10 ) * 100000L; + duration.tv_nsec = (tenths % 10 ) * 100000000L; duration.tv_sec = (long) (tenths / 10); - select(32, 0, 0, 0, &duration); + nanosleep(&duration, NULL); } diff --git a/boggle/mkdict/Makefile.bsd b/boggle/mkdict/Makefile.bsd index 78945c4..2966798 100644 --- a/boggle/mkdict/Makefile.bsd +++ b/boggle/mkdict/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.11 2001/12/12 00:07:47 tv Exp $ +# $NetBSD: Makefile,v 1.12 2002/09/18 06:16:40 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/11/93 +NOMAN= # defined + HOSTPROG= mkdict HOST_CPPFLAGS+= -I${.CURDIR}/../boggle -NOMAN= # defined .include diff --git a/boggle/mkindex/Makefile.bsd b/boggle/mkindex/Makefile.bsd index 88ebc20..cc5bdbd 100644 --- a/boggle/mkindex/Makefile.bsd +++ b/boggle/mkindex/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.9 2001/12/12 00:07:48 tv Exp $ +# $NetBSD: Makefile,v 1.10 2002/09/18 06:16:40 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/11/93 +NOMAN= # defined + HOSTPROG= mkindex HOST_CPPFLAGS+= -I${.CURDIR}/../boggle -NOMAN= # defined .include diff --git a/caesar/caesar.6 b/caesar/caesar.6 index 9a407df..8a0f8fe 100644 --- a/caesar/caesar.6 +++ b/caesar/caesar.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: caesar.6,v 1.6 1997/11/12 00:48:29 mrg Exp $ +.\" $NetBSD: caesar.6,v 1.8 2002/09/26 18:31:59 wiz Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -39,14 +39,14 @@ .Sh NAME .Nm caesar , .Nm rot13 -.Nd decrypt caesar cyphers +.Nd decrypt caesar ciphers .Sh SYNOPSIS .Nm .Op Ar rotation .Sh DESCRIPTION The .Nm -utility attempts to decrypt caesar cyphers using English letter frequency +utility attempts to decrypt caesar ciphers using English letter frequency statistics. .Nm reads from the standard input and writes to the standard output. @@ -66,8 +66,7 @@ Their frequencies as a percentage are as follows: .Bd -filled -offset indent E(13), T(10.5), A(8.1), O(7.9), N(7.1), R(6.8), I(6.3), S(6.1), H(5.2), D(3.8), L(3.4), F(2.9), C(2.7), M(2.5), U(2.4), G(2), -P(1.9), Y(1.9), -W(1.5), B(1.4), V(.9), K(.4), X(.15), J(.13), Q(.11), Z(.07). +P(1.9), Y(1.9), W(1.5), B(1.4), V(.9), K(.4), X(.15), J(.13), Q(.11), Z(.07). .Ed .Pp Rotated postings to diff --git a/canfield/canfield/canfield.6.in b/canfield/canfield/canfield.6.in index 1c9924d..ea81071 100644 --- a/canfield/canfield/canfield.6.in +++ b/canfield/canfield/canfield.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: canfield.6,v 1.7 2001/04/02 22:47:30 wiz Exp $ +.\" $NetBSD: canfield.6,v 1.8 2002/09/26 18:32:00 wiz Exp $ .\" .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. @@ -61,32 +61,28 @@ keep them open until he wishes to use them. .Pp Cards are dealt from the hand to the talon by threes and this repeats until there are no more cards in the hand -or the player quits. To have cards dealt onto the talon the -player types +or the player quits. +To have cards dealt onto the talon the player types .Sq Ic ht -for his move. Foundation base cards are -also automatically moved to the foundation when they become -available. +for his move. +Foundation base cards are also automatically moved to the foundation +when they become available. .Pp The command .Sq Ic c causes .Nm -to maintain card counting statistics -on the bottom of the screen. -When properly used this can greatly increase one's chances of -winning. +to maintain card counting statistics on the bottom of the screen. +When properly used this can greatly increase one's chances of winning. .Pp The rules for betting are somewhat less strict than those used in the official version of the game. The initial deal costs $13. You may quit at this point or inspect the game. Inspection costs $13 and allows you to make as many -moves as possible without moving any cards from your hand -to the talon. +moves as possible without moving any cards from your hand to the talon. (The initial deal places three cards on the talon; -if all these cards are used, -three more are made available.) +if all these cards are used, three more are made available.) Finally, if the game seems interesting, you must pay the final installment of $26. At this point you are @@ -96,8 +92,7 @@ card that is moved to the foundation. Each run through the hand after the first costs $5. The card counting feature costs $1 for each unknown card that is identified. -If the information is toggled on, -you are only charged for cards +If the information is toggled on, you are only charged for cards that became visible since it was last turned on. Thus the maximum cost of information is $34. Playing time is charged at a rate of $1 per minute. @@ -107,8 +102,7 @@ With no arguments, the program prints out the current status of your canfield account. If a .Ar user -name is specified, -it prints out the status of their canfield account. +name is specified, it prints out the status of their canfield account. If the .Fl a flag is specified, diff --git a/canfield/cfscores/Makefile.bsd b/canfield/cfscores/Makefile.bsd index 312f146..55448e5 100644 --- a/canfield/cfscores/Makefile.bsd +++ b/canfield/cfscores/Makefile.bsd @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.6 2001/12/12 00:07:48 tv Exp $ +# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:40 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +NOMAN= # defined + PROG= cfscores CPPFLAGS+= -I${.CURDIR}/../canfield -NOMAN= # defined HIDEGAME= hidegame .include "../../Makefile.inc" diff --git a/configure b/configure index b28bd55..9f13765 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #!/bin/sh # configure - home-grown configuration script for bsd-games. # -# Copyright (c) 1997, 1998, 1999, 2000 Joseph Samuel Myers. +# Copyright (c) 1997, 1998, 1999, 2000, 2003 Joseph Samuel Myers. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -370,6 +370,19 @@ main(void) } EOF +check_func strlcpy < + +int +main(void) +{ + char s[1] = ""; + char d[1]; + strlcpy(d, s, 1); + return 0; +} +EOF + echo "#endif /* !defined(LINUX_BSD_GAMES_H) */" >>include/bsd-games.h diff --git a/countmail/countmail b/countmail/countmail index 21bb165..e574d6c 100644 --- a/countmail/countmail +++ b/countmail/countmail @@ -1,8 +1,8 @@ #!/bin/sh -# $NetBSD: countmail,v 1.3 1998/08/15 09:16:27 mycroft Exp $ +# $NetBSD: countmail,v 1.5 2002/07/02 17:18:21 mycroft Exp $ # -# Copyright (c) 1998 The NetBSD Foundation, Inc. +# Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. # All rights reserved. # # This code is derived from software contributed to The NetBSD Foundation @@ -61,125 +61,103 @@ v=$1 #done #exec 0<&- -result= +set -- g=0 +v=000$v while :; do case $v in - 0 | '') break ;; - ?) v=00$v ;; - ??) v=0$v ;; - esac - - case $v in + '' | 0 | 00) break ;; *000) ;; *) case $g in - 0) ;; - 1) val=THOUSAND ;; - 2) val=MILLION ;; - 3) val=BILLION ;; - 4) val=TRILLION ;; - 5) val=QUADRILLION ;; - 6) val=QUINTILLION ;; - 7) val=SEXTILLION ;; - 8) val=SEPTILLION ;; + 0) x= ;; + 1) x=THOUSAND ;; + 2) x=MILLION ;; + 3) x=BILLION ;; + 4) x=TRILLION ;; + 5) x=QUADRILLION ;; + 6) x=QUINTILLION ;; + 7) x=SEXTILLION ;; + 8) x=SEPTILLION ;; *) echo "YOU HAVE TOO MUCH MAIL!" 1>&2 exit 1 ;; esac - case $g in - 0) ;; - *) result="$val $result" ;; + case $v in + *10) y=TEN ;; + *11) y=ELEVEN ;; + *12) y=TWELVE ;; + *13) y=THIRTEEN ;; + *14) y=FOURTEEN ;; + *15) y=FIFTEEN ;; + *16) y=SIXTEEN ;; + *17) y=SEVENTEEN ;; + *18) y=EIGHTEEN ;; + *19) y=NINETEEN ;; + *2?) y=TWENTY ;; + *3?) y=THIRTY ;; + *4?) y=FORTY ;; + *5?) y=FIFTY ;; + *6?) y=SIXTY ;; + *7?) y=SEVENTY ;; + *8?) y=EIGHTY ;; + *9?) y=NINETY ;; + *) y= ;; esac - ;; - esac - - g=$(($g + 1)) - case $v in - *?10) val=TEN ;; - *?11) val=ELEVEN ;; - *?12) val=TWELVE ;; - *?13) val=THIRTEEN ;; - *?14) val=FOURTEEN ;; - *?15) val=FIFTEEN ;; - *?16) val=SIXTEEN ;; - *?17) val=SEVENTEEN ;; - *?18) val=EIGHTEEN ;; - *?19) val=NINETEEN ;; - *) case $v in - *?2?) val=TWENTY ;; - *?3?) val=THIRTY ;; - *?4?) val=FOURTY ;; - *?5?) val=FIFTY ;; - *?6?) val=SIXTY ;; - *?7?) val=SEVENTY ;; - *?8?) val=EIGHTY ;; - *?9?) val=NINETY ;; - *) val= ;; + *[01]? | *?0) ;; + *) y=$y- ;; esac case $v in - *?0? | *??0) ;; - *) val=${val}- ;; + *1?) ;; + *1) y=${y}ONE ;; + *2) y=${y}TWO ;; + *3) y=${y}THREE ;; + *4) y=${y}FOUR ;; + *5) y=${y}FIVE ;; + *6) y=${y}SIX ;; + *7) y=${y}SEVEN ;; + *8) y=${y}EIGHT ;; + *9) y=${y}NINE ;; esac case $v in - *??1) val=${val}ONE ;; - *??2) val=${val}TWO ;; - *??3) val=${val}THREE ;; - *??4) val=${val}FOUR ;; - *??5) val=${val}FIVE ;; - *??6) val=${val}SIX ;; - *??7) val=${val}SEVEN ;; - *??8) val=${val}EIGHT ;; - *??9) val=${val}NINE ;; + *1??) z=ONE ;; + *2??) z=TWO ;; + *3??) z=THREE ;; + *4??) z=FOUR ;; + *5??) z=FIVE ;; + *6??) z=SIX ;; + *7??) z=SEVEN ;; + *8??) z=EIGHT ;; + *9??) z=NINE ;; + *) z= ;; esac - ;; - esac - - case $v in - *?00) ;; - *) result="$val $result" ;; - esac - case $v in - *1??) val=ONE ;; - *2??) val=TWO ;; - *3??) val=THREE ;; - *4??) val=FOUR ;; - *5??) val=FIVE ;; - *6??) val=SIX ;; - *7??) val=SEVEN ;; - *8??) val=EIGHT ;; - *9??) val=NINE ;; - esac - - case $v in - *0??) ;; - *) result="$val HUNDRED $result" ;; + set $z ${z:+HUNDRED} $y $x $* + ;; esac + g=$(($g + 1)) v=${v%%???} done -plural=S +p=S -case "$result" in - "") result=ZERO ;; - "ONE ") plural= ;; +case "$*" in + "") set ZERO ;; + ONE) p= ;; esac -set -- $result - echo "$*! -$* MAIL MESSAGE$plural! +$* MAIL MESSAGE$p! HAHAHAHAHA!" diff --git a/countmail/countmail.6 b/countmail/countmail.6 index e3ca9ba..1d4b60a 100644 --- a/countmail/countmail.6 +++ b/countmail/countmail.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: countmail.6,v 1.5 1999/03/22 18:49:11 garbled Exp $ +.\" $NetBSD: countmail.6,v 1.8 2002/09/26 18:32:00 wiz Exp $ .\" .\" Copyright (c) 1997 Matthew R. Green .\" All rights reserved. @@ -44,8 +44,11 @@ The program first appeared in .Nx 1.3 . .Nm -was first written by Noah Friedman in 1993. -This version was written by Charles M. Hannum . +was first written by +.An Noah Friedman Aq friedman@splode.com +in 1993. +This version was written by Charles M. Hannum +.Aq mycroft@netbsd.org . .Sh CAVEATS The read loop is horrendously slow on every shell implementation tried. .Nm diff --git a/cribbage/cribbage.6.in b/cribbage/cribbage.6.in index a1ea331..4eb0677 100644 --- a/cribbage/cribbage.6.in +++ b/cribbage/cribbage.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: cribbage.6,v 1.7 2001/04/02 22:42:37 wiz Exp $ +.\" $NetBSD: cribbage.6,v 1.10 2002/09/30 12:43:22 wiz Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,9 +45,9 @@ .Sh DESCRIPTION .Nm plays the card game cribbage, with the program playing one hand -and the user the other. The program will initially ask the user if -the rules of the game are needed \- if so, it will print out -the appropriate section from +and the user the other. +The program will initially ask the user if the rules of the game are +needed \(en if so, it will print out the appropriate section from .Em According to Hoyle with .Xr more 1 . @@ -57,10 +57,10 @@ options include: .Bl -tag -width indent .It Fl e When the player makes a mistake scoring his hand or crib, provide an -explanation of the correct score. (This is especially useful for -beginning players.) +explanation of the correct score. +(This is especially useful for beginning players.) .It Fl q -Print a shorter form of all messages \- this is only recommended for +Print a shorter form of all messages \(en this is only recommended for users who have played the game without specifying this option. .It Fl r Instead of asking the player to cut the deck, the program will randomly @@ -72,24 +72,23 @@ first asks the player whether he wishes to play a short game ( .Dq once around , to 61) or a long game ( .Dq twice around , -to 121). A -response of +to 121). +A response of .Sq Ic s -will result in a short game, any other response will -play a long game. +will result in a short game, any other response will play a long game. .Pp At the start of the first game, the program -asks the player to cut the deck to determine who gets the -first crib. The user should respond with a number between 0 and -51, indicating how many cards down the deck is to be cut. The player -who cuts the lower ranked card gets the first crib. +asks the player to cut the deck to determine who gets the first crib. +The user should respond with a number between 0 and +51, indicating how many cards down the deck is to be cut. +The player who cuts the lower ranked card gets the first crib. If more than one game is played, the loser of the previous game gets the first crib in the current game. .Pp For each hand, the program first prints the player's hand, whose crib it is, and then asks the player -to discard two cards into the crib. The cards are prompted for -one per line, and are typed as explained below. +to discard two cards into the crib. +The cards are prompted for one per line, and are typed as explained below. .Pp After discarding, the program cuts the deck (if it is the player's crib) or asks the player to cut the deck (if it's its crib); in the latter @@ -98,11 +97,12 @@ how far down the remaining 40 cards are to be cut. .Pp After cutting the deck, play starts with the non-dealer (the person who doesn't have the crib) leading the first card. -Play continues, as per cribbage, until all cards are exhausted. The -program keeps track of the scoring of all points and the total of +Play continues, as per cribbage, until all cards are exhausted. +The program keeps track of the scoring of all points and the total of the cards on the table. .Pp -After play, the hands are scored. The program requests the player to +After play, the hands are scored. +The program requests the player to score his hand (and the crib, if it is his) by printing out the appropriate cards (and the cut card enclosed in brackets). Play continues until one player reaches the game limit (61 or 121). @@ -111,7 +111,8 @@ A carriage return when a numeric input is expected is equivalent to typing the lowest legal value; when cutting the deck this is equivalent to choosing the top card. .Pp -Cards are specified as rank followed by suit. The ranks may be specified +Cards are specified as rank followed by suit. +The ranks may be specified as one of: .Sq a , .Sq 2 , @@ -159,7 +160,8 @@ A card may be specified as: or: .Dq Ao rank Ac of Aq suit . If the single letter rank and suit designations are used, the space -separating the suit and rank may be left out. Also, if only one card +separating the suit and rank may be left out. +Also, if only one card of the desired rank is playable, typing the rank is sufficient. For example, if your hand was .Dq 2H, 4D, 5C, 6H, JC, and KD diff --git a/cribbage/cribbage.h b/cribbage/cribbage.h index 8bdc1d5..bcaa8ea 100644 --- a/cribbage/cribbage.h +++ b/cribbage/cribbage.h @@ -1,4 +1,4 @@ -/* $NetBSD: cribbage.h,v 1.7 1999/09/30 18:01:32 jsm Exp $ */ +/* $NetBSD: cribbage.h,v 1.8 2002/12/06 01:48:24 thorpej Exp $ */ /* * Copyright (c) 1980, 1993 @@ -59,7 +59,7 @@ extern BOOLEAN rflag; /* if all cuts random */ extern BOOLEAN quiet; /* if suppress random mess */ extern BOOLEAN playing; /* currently playing game */ -extern char expl[]; /* string for explanation */ +extern char explan[]; /* string for explanation */ void addmsg __P((const char *, ...)) __attribute__((__format__(__printf__, 1, 2))); diff --git a/cribbage/extern.c b/cribbage/extern.c index c4c9fc3..12e23ba 100644 --- a/cribbage/extern.c +++ b/cribbage/extern.c @@ -1,4 +1,4 @@ -/* $NetBSD: extern.c,v 1.5 1999/09/19 18:12:09 jsm Exp $ */ +/* $NetBSD: extern.c,v 1.6 2002/12/06 01:48:24 thorpej Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: extern.c,v 1.5 1999/09/19 18:12:09 jsm Exp $"); +__RCSID("$NetBSD: extern.c,v 1.6 2002/12/06 01:48:24 thorpej Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,7 @@ BOOLEAN iwon = FALSE; /* if comp won last game */ BOOLEAN quiet = FALSE; /* if suppress random mess */ BOOLEAN rflag = FALSE; /* if all cuts random */ -char expl[128]; /* explanation */ +char explan[128]; /* explanation */ int cgames = 0; /* number games comp won */ int cscore = 0; /* comp score in this game */ diff --git a/cribbage/io.c b/cribbage/io.c index dc61c25..21075e2 100644 --- a/cribbage/io.c +++ b/cribbage/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $ */ +/* $NetBSD: io.c,v 1.15 2002/05/26 00:12:11 wiz Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -38,24 +38,19 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $"); +__RCSID("$NetBSD: io.c,v 1.15 2002/05/26 00:12:11 wiz Exp $"); #endif #endif /* not lint */ #include #include #include +#include #include #include #include #include -#if __STDC__ -#include -#else -#include -#endif - #include "deck.h" #include "cribbage.h" #include "cribcur.h" @@ -392,21 +387,11 @@ int Mpos = 0; static int Newpos = 0; void -#if __STDC__ msg(const char *fmt, ...) -#else -msg(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vsprintf(&Msgbuf[Newpos], fmt, ap); Newpos = strlen(Msgbuf); va_end(ap); @@ -418,21 +403,11 @@ msg(fmt, va_alist) * Add things to the current message */ void -#if __STDC__ addmsg(const char *fmt, ...) -#else -addmsg(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vsprintf(&Msgbuf[Newpos], fmt, ap); Newpos = strlen(Msgbuf); va_end(ap); diff --git a/cribbage/score.c b/cribbage/score.c index 3d2a870..6677314 100644 --- a/cribbage/score.c +++ b/cribbage/score.c @@ -1,4 +1,4 @@ -/* $NetBSD: score.c,v 1.8 1999/09/08 21:45:26 jsm Exp $ */ +/* $NetBSD: score.c,v 1.9 2002/12/06 01:48:24 thorpej Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: score.c,v 1.8 1999/09/08 21:45:26 jsm Exp $"); +__RCSID("$NetBSD: score.c,v 1.9 2002/12/06 01:48:24 thorpej Exp $"); #endif #endif /* not lint */ @@ -122,7 +122,7 @@ scorehand(hand, starter, n, crb, do_explain) CARD h[(CINHAND + 1)]; char buf[32]; - expl[0] = '\0'; /* initialize explanation */ + explan[0] = '\0'; /* initialize explanation */ score = 0; flag = TRUE; k = hand[0].suit; @@ -132,29 +132,29 @@ scorehand(hand, starter, n, crb, do_explain) if (hand[i].suit == starter.suit) { score++; if (do_explain) - strcat(expl, "His Nobs"); + strcat(explan, "His Nobs"); } h[i] = hand[i]; } if (flag && n >= CINHAND) { - if (do_explain && expl[0] != '\0') - strcat(expl, ", "); + if (do_explain && explan[0] != '\0') + strcat(explan, ", "); if (starter.suit == k) { score += 5; if (do_explain) - strcat(expl, "Five-flush"); + strcat(explan, "Five-flush"); } else if (!crb) { score += 4; - if (do_explain && expl[0] != '\0') - strcat(expl, ", Four-flush"); + if (do_explain && explan[0] != '\0') + strcat(explan, ", Four-flush"); else - strcpy(expl, "Four-flush"); + strcpy(explan, "Four-flush"); } } - if (do_explain && expl[0] != '\0') - strcat(expl, ", "); + if (do_explain && explan[0] != '\0') + strcat(explan, ", "); h[n] = starter; sorthand(h, n + 1); /* sort by rank */ i = 2 * fifteens(h, n + 1); @@ -162,9 +162,9 @@ scorehand(hand, starter, n, crb, do_explain) if (do_explain) { if (i > 0) { (void) sprintf(buf, "%d points in fifteens", i); - strcat(expl, buf); + strcat(explan, buf); } else - strcat(expl, "No fifteens"); + strcat(explan, "No fifteens"); } i = pairuns(h, n + 1); score += i; @@ -172,9 +172,9 @@ scorehand(hand, starter, n, crb, do_explain) if (i > 0) { (void) sprintf(buf, ", %d points in pairs, %d in runs", pairpoints, runpoints); - strcat(expl, buf); + strcat(explan, buf); } else - strcat(expl, ", No pairs/runs"); + strcat(explan, ", No pairs/runs"); } return (score); } diff --git a/cribbage/support.c b/cribbage/support.c index 2f3c076..288bb0c 100644 --- a/cribbage/support.c +++ b/cribbage/support.c @@ -1,4 +1,4 @@ -/* $NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $ */ +/* $NetBSD: support.c,v 1.6 2002/12/06 01:48:25 thorpej Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: support.c,v 1.5 1999/09/08 21:17:47 jsm Exp $"); +__RCSID("$NetBSD: support.c,v 1.6 2002/12/06 01:48:25 thorpej Exp $"); #endif #endif /* not lint */ @@ -152,7 +152,7 @@ plyrhand(hand, s) msg("You should have taken %d, not %d!", i, j); } if (explain) - msg("Explanation: %s", expl); + msg("Explanation: %s", explan); do_wait(); } else win = chkscr(&pscore, i); diff --git a/dm/Makefile.bsd b/dm/Makefile.bsd index d32cad7..c3fa4b2 100644 --- a/dm/Makefile.bsd +++ b/dm/Makefile.bsd @@ -1,11 +1,17 @@ -# $NetBSD: Makefile,v 1.8 1997/11/19 08:23:37 mrg Exp $ +# $NetBSD: Makefile,v 1.11 2002/09/18 03:23:00 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +.include + # -DLOG log games PROG= dm +SRCS= dm.c utmpentry.c MAN= dm.8 dm.conf.5 # shouldn't be necessary; just in case. BINGRP= games BINMODE=2555 +.PATH.c: ${NETBSDSRCDIR}/usr.bin/who +CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/who -DSUPPORT_UTMPX -DSUPPORT_UTMP + .include diff --git a/dm/dm.8.in b/dm/dm.8.in index 0bafd99..54e7ad2 100644 --- a/dm/dm.8.in +++ b/dm/dm.8.in @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.8,v 1.6 1998/06/08 12:41:41 lukem Exp $ +.\" $NetBSD: dm.8,v 1.8 2003/02/25 10:34:45 wiz Exp $ .\" .\" Copyright (c) 1987, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -48,7 +48,7 @@ is a program used to regulate game playing. .Nm expects to be invoked with the name of a game that a user wishes to play. This is done by creating symbolic links to -.Nm "" , +.Nm , in the directory .Pa @gamesdir@ for all of the regulated games. @@ -63,8 +63,7 @@ program. determines if the requested game is available and, if so, runs it. The file .Pa @dm_configfile@ -controls the conditions under which games may -be run. +controls the conditions under which games may be run. .Pp The file .Pa @dm_nogamesfile@ @@ -99,7 +98,7 @@ running the games setgid First, all games that allow users to run .Ux commands should carefully -set both the real and effective group id's immediately before executing +set both the real and effective group ids immediately before executing those commands. Probably more important is that .Nm diff --git a/dm/dm.c b/dm/dm.c index 64d63a0..c5a108f 100644 --- a/dm/dm.c +++ b/dm/dm.c @@ -1,4 +1,5 @@ -/* $NetBSD: dm.c,v 1.16 2001/01/25 20:41:41 jdolecek Exp $ */ +/* $NetBSD: dm.c,v 1.17 2002/08/02 03:06:24 christos Exp $ */ +/* For Linux: still using old utmp interface from version 1.16. */ /* * Copyright (c) 1987, 1993 @@ -43,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\ #if 0 static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dm.c,v 1.16 2001/01/25 20:41:41 jdolecek Exp $"); +__RCSID("$NetBSD: dm.c,v 1.17 2002/08/02 03:06:24 christos Exp $"); #endif #endif /* not lint */ diff --git a/dm/dm.conf.5.in b/dm/dm.conf.5.in index f60ad2e..aca057c 100644 --- a/dm/dm.conf.5.in +++ b/dm/dm.conf.5.in @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.conf.5,v 1.6 1999/03/22 18:49:11 garbled Exp $ +.\" $NetBSD: dm.conf.5,v 1.7 2002/09/26 18:32:00 wiz Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -59,8 +59,7 @@ Entries consist of two white-space separated fields: the string .Em badtty and the ttyname as returned by .Xr ttyname 3 . -For example, -to keep the uucp dialout, +For example, to keep the uucp dialout, .Dq tty19 , from being used for games, the entry would be: .Bd -literal -offset indent @@ -94,17 +93,14 @@ in no game limitation or priority based on that field. .Pp The game .Em default -controls the settings for -any game not otherwise listed, and must be the last +controls the settings for any game not otherwise listed, and must be the last .Em game entry in the file. Priorities may not be negative. -For example, the following entries -limits the game +For example, the following entries limits the game .Dq hack -to running only when the system has 10 or less -users and a load average of 5 or less; all other games may be run any time -the system has 15 or less users. +to running only when the system has 10 or less users and a load average of 5 +or less; all other games may be run any time the system has 15 or less users. .Bd -literal -offset indent game hack 5 10 * game default * 15 * diff --git a/exec.objs b/exec.objs index d49c9e1..049c98a 100644 --- a/exec.objs +++ b/exec.objs @@ -1,7 +1,7 @@ # exec.objs - details of objects that go into bsd-games programs. # This file is used for automatic makefile generation. # -# Copyright (c) 1998, 1999, 2000 Joseph Samuel Myers. +# Copyright (c) 1998, 1999, 2000, 2001, 2003 Joseph Samuel Myers. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -106,7 +106,8 @@ robots auto.o extern.o flush_in.o init_field.o main.o \ make_level.o move.o move_robs.o play_level.o query.o rnd_pos.o score.o rogue hit.o init.o inventory.o level.o machdep.o main.o \ message.o monster.o move.o object.o pack.o play.o random.o ring.o \ - room.o save.o score.o spec_hit.o throw.o trap.o use.o zap.o + room.o save.o score.o spec_hit.o throw.o trap.o use.o zap.o \ + lib/strlcpy.o sail assorted.o game.o globals.o dr_1.o dr_2.o dr_3.o \ dr_4.o dr_5.o dr_main.o lo_main.o main.o misc.o parties.o pl_1.o \ pl_2.o pl_3.o pl_4.o pl_5.o pl_6.o pl_7.o pl_main.o sync.o version.o diff --git a/factor/Makefile.bsd b/factor/Makefile.bsd index 8f8baf7..0be0475 100644 --- a/factor/Makefile.bsd +++ b/factor/Makefile.bsd @@ -1,11 +1,23 @@ -# $NetBSD: Makefile,v 1.7 1997/10/22 04:43:26 lukem Exp $ +# $NetBSD: Makefile,v 1.10 2002/09/19 03:15:39 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +# For MKCRYPTO +.include + +PRIMES= ${NETBSDSRCDIR}/games/primes + PROG= factor SRCS= factor.c pr_tbl.c -CPPFLAGS+=-I${.CURDIR}/../primes +CPPFLAGS+=-I${PRIMES} + +.if (${MKCRYPTO} != "no") +CPPFLAGS+=-DHAVE_OPENSSL +LDADD+= -lcrypto +DPADD+= ${LIBCRYPTO} +.endif + MAN= factor.6 MLINKS+=factor.6 primes.6 -.PATH: ${.CURDIR}/../primes +.PATH: ${PRIMES} .include diff --git a/factor/factor.6 b/factor/factor.6 index 93d1146..8ad52fd 100644 --- a/factor/factor.6 +++ b/factor/factor.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: factor.6,v 1.6 2001/04/02 22:42:38 wiz Exp $ +.\" $NetBSD: factor.6,v 1.7 2002/09/26 18:32:01 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -47,8 +47,7 @@ .Sh NAME .Nm factor , .Nm primes -.Nd -factor a number, generate primes +.Nd factor a number, generate primes .Sh SYNOPSIS .Nm .Op Ar number ... @@ -58,18 +57,16 @@ factor a number, generate primes .Sh DESCRIPTION The .Nm -utility will factor integers between -2147483648 and 2147483647 inclusive. +utility will factor integers between \-2147483648 and 2147483647 inclusive. When a number is factored, it is printed, followed by a -.Dq \: , +.Dq \&: , and the list of factors on a single line. Factors are listed in ascending order, and are preceded by a space. -If a factor divides a value more than once, it will be printed -more than once. +If a factor divides a value more than once, it will be printed more than once. .Pp When .Nm -is invoked with one or more arguments, -each argument will be factored. +is invoked with one or more arguments, each argument will be factored. .Pp When .Nm diff --git a/factor/factor.c b/factor/factor.c index 863de13..c18e388 100644 --- a/factor/factor.c +++ b/factor/factor.c @@ -1,4 +1,4 @@ -/* $NetBSD: factor.c,v 1.9 1999/09/08 21:17:48 jsm Exp $ */ +/* $NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: factor.c,v 1.9 1999/09/08 21:17:48 jsm Exp $"); +__RCSID("$NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $"); #endif #endif /* not lint */ @@ -69,37 +69,85 @@ __RCSID("$NetBSD: factor.c,v 1.9 1999/09/08 21:17:48 jsm Exp $"); * If no args are given, the list of numbers are read from stdin. */ -#include #include +#include #include #include #include #include #include +#ifdef HAVE_OPENSSL +#include +#else +typedef long BIGNUM; +typedef u_long BN_ULONG; +int BN_dec2bn(BIGNUM **a, const char *str); +#define BN_new() ((BIGNUM *)calloc(sizeof(BIGNUM), 1)) +#define BN_is_zero(v) (*(v) == 0) +#define BN_is_one(v) (*(v) == 1) +#define BN_new() ((BIGNUM *)calloc(sizeof(BIGNUM), 1)) +#define BN_is_zero(v) (*(v) == 0) +#define BN_is_one(v) (*(v) == 1) +#define BN_mod_word(a, b) (*(a) % (b)) +#endif + #include "primes.h" /* * prime[i] is the (i-1)th prime. * - * We are able to sieve 2^32-1 because this byte table yields all primes + * We are able to sieve 2^32-1 because this byte table yields all primes * up to 65537 and 65537^2 > 2^32-1. */ extern const ubig prime[]; extern const ubig *pr_limit; /* largest prime in the prime array */ -int main __P((int, char *[])); -void pr_fact __P((ubig)); /* print factors of a value */ -void usage __P((void)) __attribute__((__noreturn__)); +#define PRIME_CHECKS 5 + +#ifdef HAVE_OPENSSL +BN_CTX *ctx; /* just use a global context */ +#endif + +int main(int, char *[]); +void pr_fact(BIGNUM *); /* print factors of a value */ +void BN_print_dec_fp(FILE *, const BIGNUM *); +void usage(void) __attribute__((__noreturn__)); +#ifdef HAVE_OPENSSL +void pollard_pminus1(BIGNUM *); /* print factors for big numbers */ +#else +char *BN_bn2dec(const BIGNUM *); +BN_ULONG BN_div_word(BIGNUM *, BN_ULONG); +#endif + + +#ifndef HAVE_OPENSSL +int +BN_dec2bn(BIGNUM **a, const char *str) +{ + char *p; + + errno = 0; + **a = strtoul(str, &p, 10); + if (errno) + err(1, "%s", str); + return (*p == '\n' || *p == '\0'); +} +#endif int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { - ubig val; + BIGNUM *val; int ch; - char *p, buf[100]; /* > max number of digits. */ + char *p, buf[LINE_MAX]; /* > max number of digits. */ + +#ifdef HAVE_OPENSSL + ctx = BN_CTX_new(); +#endif + val = BN_new(); + if (val == NULL) + errx(1, "can't initialise bignum"); /* Revoke setgid privileges */ setregid(getgid(), getgid()); @@ -126,12 +174,8 @@ main(argc, argv) 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); + if (BN_dec2bn(&val, buf) == 0) + errx(1, "%s: illegal numeric format.", argv[0]); pr_fact(val); } /* Factor the arguments. */ @@ -139,11 +183,7 @@ main(argc, argv) 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') + if (BN_dec2bn(&val, argv[0]) == 0) errx(1, "%s: illegal numeric format.", argv[0]); pr_fact(val); } @@ -164,49 +204,152 @@ main(argc, argv) * Factors are printed with leading tabs. */ void -pr_fact(val) - ubig val; /* Factor this value. */ +pr_fact(BIGNUM *val) { const ubig *fact; /* The factor found. */ /* Firewall - catch 0 and 1. */ - if (val == 0) /* Historical practice; 0 just exits. */ + if (BN_is_zero(val)) /* Historical practice; 0 just exits. */ exit(0); - if (val == 1) { - (void)printf("1: 1\n"); + if (BN_is_one(val)) { + printf("1: 1\n"); return; } /* Factor value. */ - (void)printf("%lu:", val); - for (fact = &prime[0]; val > 1; ++fact) { + + BN_print_dec_fp(stdout, val); + putchar(':'); + for (fact = &prime[0]; !BN_is_one(val); ++fact) { /* Look for the smallest factor. */ do { - if (val % (long)*fact == 0) + if (BN_mod_word(val, (BN_ULONG)*fact) == 0) break; } while (++fact <= pr_limit); /* Watch for primes larger than the table. */ if (fact > pr_limit) { - (void)printf(" %lu", val); +#ifdef HAVE_OPENSSL + BIGNUM *bnfact; + + bnfact = BN_new(); + BN_set_word(bnfact, *(fact - 1)); + BN_sqr(bnfact, bnfact, ctx); + if (BN_cmp(bnfact, val) > 0) { + putchar(' '); + BN_print_dec_fp(stdout, val); + } else + pollard_pminus1(val); +#else + printf(" %s", BN_bn2dec(val)); +#endif break; } /* Divide factor out until none are left. */ do { - (void)printf(" %lu", *fact); - val /= (long)*fact; - } while ((val % (long)*fact) == 0); + printf(" %lu", *fact); + BN_div_word(val, (BN_ULONG)*fact); + } while (BN_mod_word(val, (BN_ULONG)*fact) == 0); /* Let the user know we're doing something. */ - (void)fflush(stdout); + fflush(stdout); } - (void)putchar('\n'); + putchar('\n'); +} + +/* + * Sigh.. No _decimal_ output to file functions in BN. + */ +void +BN_print_dec_fp(FILE *fp, const BIGNUM *num) +{ + char *buf; + + buf = BN_bn2dec(num); + if (buf == NULL) + return; /* XXX do anything here? */ + fprintf(fp, buf); + free(buf); } void -usage() +usage(void) { - (void)fprintf(stderr, "usage: factor [value ...]\n"); + fprintf(stderr, "usage: factor [value ...]\n"); exit (0); } + + + + +#ifdef HAVE_OPENSSL +/* pollard rho, algorithm from Jim Gillogly, May 2000 */ + +void +pollard_pminus1(BIGNUM *val) +{ + BIGNUM *base, *num, *i, *x; + + base = BN_new(); + num = BN_new(); + i = BN_new(); + x = BN_new(); + + BN_set_word(i, 2); + BN_set_word(base, 2); + + for (;;) { + BN_mod_exp(base, base, i, val, ctx); + + BN_copy(x, base); + BN_sub_word(x, 1); + BN_gcd(x, x, val, ctx); + + if (!BN_is_one(x)) { + if (BN_is_prime(x, PRIME_CHECKS, NULL, NULL, + NULL) == 1) { + putchar(' '); + BN_print_dec_fp(stdout, x); + } else + pollard_pminus1(x); + fflush(stdout); + + BN_div(num, NULL, val, x, ctx); + if (BN_is_one(num)) + return; + if (BN_is_prime(num, PRIME_CHECKS, NULL, NULL, + NULL) == 1) { + putchar(' '); + BN_print_dec_fp(stdout, num); + fflush(stdout); + return; + } + BN_copy(val, num); + } + BN_add_word(i, 1); + } +} +#else +char * +BN_bn2dec(const BIGNUM *val) +{ + char *buf; + + buf = malloc(100); + if (!buf) + return buf; + snprintf(buf, 100, "%ld", (long)*val); + return buf; +} + +BN_ULONG +BN_div_word(BIGNUM *a, BN_ULONG b) +{ + BN_ULONG mod; + + mod = *a % b; + *a /= b; + return mod; +} +#endif diff --git a/fortune/datfiles/Makefile.bsd b/fortune/datfiles/Makefile.bsd index 3694b7c..0007bcf 100644 --- a/fortune/datfiles/Makefile.bsd +++ b/fortune/datfiles/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.31 2001/10/20 09:33:39 proff Exp $ +# $NetBSD: Makefile,v 1.33 2002/10/22 16:14:04 drochner Exp $ # @(#)Makefile 8.2 (Berkeley) 4/19/94 .include # for INSTALL_OFFENSIVE_FORTUNES @@ -22,7 +22,7 @@ TYPE= real TYPE= fake .endif -CLEANFILES+=${DATFILES} limerick-o +CLEANFILES+=${DATFILES} STRFILEDIR!=cd $(.CURDIR)/../strfile; ${PRINTOBJDIR} STRFILE=${STRFILEDIR}/strfile @@ -49,27 +49,27 @@ farber.dat: farber # Obscene fortunes: we have to build source and data files fortunes-o: fortunes-o.${TYPE} - tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET} + tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET} fortunes-o.dat: fortunes-o ${STRFILE} -rsx ${.ALLSRC} ${.TARGET} fortunes2-o: fortunes2-o.${TYPE} - tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET} + tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET} fortunes2-o.dat: fortunes2-o ${STRFILE} -rsx ${.ALLSRC} ${.TARGET} limerick-o: limerick-o.${TYPE} - tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET} + tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET} limerick-o.dat: limerick-o ${STRFILE} -rsx ${.ALLSRC} ${.TARGET} unamerican-o: unamerican-o.${TYPE} - tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET} + tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET} unamerican-o.dat: unamerican-o ${STRFILE} -rsx ${.ALLSRC} ${.TARGET} netbsd-o: netbsd-o.${TYPE} - tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET} + tr 'a-zA-Z' 'n-za-mN-ZA-M' < ${.ALLSRC} > ${.TARGET} netbsd-o.dat: netbsd-o ${STRFILE} -rsx ${.ALLSRC} ${.TARGET} diff --git a/fortune/datfiles/fortunes b/fortune/datfiles/fortunes index 2626a9d..eac7ca4 100644 --- a/fortune/datfiles/fortunes +++ b/fortune/datfiles/fortunes @@ -309,7 +309,7 @@ ducks. A girl and a boy bump into each other -- surely an accident. A girl and a boy bump and her handkerchief drops -- surely another accident. But when a girl gives a boy a dead squid -- *____that ___had __to ____mean _________something*. - -- S. Morganstern, "The Silent Gondoliers" + -- S. Morgenstern, "The Silent Gondoliers" % A gleekzorp without a tornpee is like a quop without a fertsneet (sort of). @@ -1428,7 +1428,7 @@ tragedy face to face, we have politics. % Andrea: Unhappy the land that has no heroes. Galileo: No, unhappy the land that _____needs heroes. - -- Bertholt Brecht, "Life of Galileo" + -- Bertolt Brecht, "Life of Galileo" % Angels we have heard on High Tell us to go out and Buy. @@ -4899,7 +4899,7 @@ Grelb's Reminder: average drivers. % Grub first, then ethics. - -- Bertholt Brecht + -- Bertolt Brecht % Gurmlish, n.: The red warning flag at the top of a club sandwich which @@ -10307,7 +10307,7 @@ Pity the meek, for they shall inherit the earth. % PL/1, "the fatal disease", belongs more to the problem set than to the solution set. - -- E. W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 + -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 % Plaese porrf raed. -- Prof. Michael O'Longhlin, S.U.N.Y. Purchase @@ -13470,7 +13470,7 @@ world put together. % The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. - -- E. W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 + -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5 % The verdict of a jury is the a priori opinion of that juror who smokes the worst cigars. @@ -15061,7 +15061,7 @@ and the establishment of a Hilton on its peak. -- Bloom County % What is the robbing of a bank compared to the FOUNDING of a bank? - -- Berthold Brecht + -- Bertolt Brecht % What is wanted is not the will to believe, but the will to find out, which is the exact opposite. @@ -15449,7 +15449,7 @@ have told you Mozart was a jerk for nothing. -- Ian Shoales % Why be a man when you can be a success? - -- Berthold Brecht + -- Bertolt Brecht % Why bother building any more nuclear warheads until we use the ones we have? diff --git a/fortune/datfiles/fortunes2 b/fortune/datfiles/fortunes2 index 4dad1d5..96c366a 100644 --- a/fortune/datfiles/fortunes2 +++ b/fortune/datfiles/fortunes2 @@ -1105,7 +1105,7 @@ going to it is so large. electronics more likely to leak than say Bosch? Hmmm... Aha!!! Lucas is British, and all things British leak! British convertible tops leak water, British engines leak oil, British displacer units leak hydrostatic fluid, and -I might add Brititsh tires leak air, and the British defense unit leaks +I might add British tires leak air, and the British defense unit leaks secrets... so naturally British electronics leak smoke. -- Jack Banton, PCC Automotive Electrical School % @@ -1182,7 +1182,7 @@ favorite robot, faithful old Yewtoo Artoo, to carry his gear and do assorted camp chores. The Israelites soon got over their initial fear of the robot and, as the months passed, became very fond of him. Patriarchs took to -discussing abtruse theological problems with him, and each evening the +discussing abstruse theological problems with him, and each evening the children all gathered to hear the many stories with which he was programmed. Therefore it came as a great shock to them when, just as their journey was ending, he abruptly wore out. Even Feghoot couldn't console them. @@ -1367,10 +1367,10 @@ posh hotel. a postcard?" % "Anything else you wish to draw to my attention, Mr. Holmes ?" - "The curious incident of the stable dog in the nightime." + "The curious incident of the stable dog in the nighttime." "But the dog did nothing in the nighttime." "That was the curious incident." - -- A. Conan Doyle, "Silver Blaze" + -- Sir Arthur Conan Doyle, "Silver Blaze" % Approaching the gates of the monastery, Hakuin found Ken the Zen preaching to a group of disciples. @@ -1442,7 +1442,7 @@ Chinese ideogram for NO-THING.) } % Brian Kernighan has an automobile which he helped design. -Unlike most automobiles, it has neither speedometer, nor gas guage, nor +Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the numerous idiot lights which plague the modern driver. Rather, if the driver makes any mistake, a giant "?" lights up in the center of the dashboard. "The experienced driver", he says, "will @@ -1644,7 +1644,7 @@ far to the corner and they have added a hill. I have given up running for the bus; it leaves earlier than it used to. It seems to me they are making the stairs steeper than in the old days. And have you noticed the smaller print they use in the newspapers? - There is no sense in asking anyone to read aloud anymore, as everbody + There is no sense in asking anyone to read aloud anymore, as everybody speaks in such a low voice I can hardly hear them. The material in dresses is so skimpy now, especially around the hips and waist, that it is almost impossible to reach one's shoelaces. And the @@ -1733,7 +1733,7 @@ had the same fiancee, and told him. "Get out of our lives you rascal. We'll teach you that you can't have your Kate and Edith, too." A domineering man married a mere wisp of a girl. He came back from his honeymoon a chastened man. He'd become aware of the will of the wisp. - A young husband with an inferiorty complex insisted he was just a + A young husband with an inferiority complex insisted he was just a little pebble on the beach. The marriage counselor told him, "If you wish to save your marriage, you'd better be a little boulder." % @@ -1845,7 +1845,7 @@ hope in it. Approaching him at the club bar one day, one of them said, found his wife in bed with another man, shot them both, and then turned the gun on himself!" "Terrible," said Harry. "But it could have been worse." - "How in hell," demanded his dumfounded friend, "could it possibly + "How in hell," demanded his dumbfounded friend, "could it possibly have been worse?" "Well," said Harry, "if it had happened the night before, I'd be dead right now." @@ -2036,7 +2036,7 @@ I think very probably he might be cured." things that are called the eyes, and which exist to make an agreeable soft depression in the face, are diseased, in the case of Bogota, in such a way as to affect his brain. They are greatly distended, he has eyelashes, and -his eyelids move, and cosequently his brain is in a state of constant +his eyelids move, and consequently his brain is in a state of constant irritation and distraction." "Yes?" said old Yacob. "Yes?" "And I think I may say with reasonable certainty that, in order @@ -2057,7 +2057,7 @@ at present". myself the pleasure of contradicting him abruptly, and of showing him immediately some absurdity in his proposition. In answering I began by observing that in certain cases or circumstances his opinion would be right, -but in the present case there appeared or semed to me some difference, etc. +but in the present case there appeared or seemed to me some difference, etc. I soon found the advantage of this change in my manner; the conversations I engaged in went on more pleasantly. The modest way in which I proposed my opinions procured them a readier reception and less contradiction. @@ -2096,7 +2096,7 @@ closing the book. -- Susan Brownmiller, "Against Our Will" % [I plan] to see, hear, touch, and destroy everything in my path, -including beets, rutabegas, and most random vegetables, but excluding yams, +including beets, rutabagas, and most random vegetables, but excluding yams, as I am absolutely terrified of yams... Actually, I think my fear of yams began in my early youth, when many of my young comrades pelted me with same for singing songs of far-off lands @@ -2175,7 +2175,7 @@ I'm on my way." % I'm sure that VMS is completely documented, I just haven't found the right manual yet. I've been working my way through the manuals in the document -library and I'm half way through the second cabnet, (3 shelves to go), so I +library and I'm half way through the second cabinet, (3 shelves to go), so I should find what I'm looking for by mid May. I hope I can remember what it was by the time I find it. I had this idea for a new horror film, "VMS Manuals from Hell" or maybe @@ -2225,7 +2225,7 @@ pie-bakers and pie-dividers is way out of whack." Could Dick Butcher have been an efficiency expert? -- Motor Trend, May 1983 % - In the begining, God created the Earth and he said, "Let there be + In the beginning, God created the Earth and he said, "Let there be mud." And there was mud. And God said, "Let Us make living creatures out of mud, so the mud @@ -2249,7 +2249,7 @@ evening and there was morning, one interrupt. -- Rico Tudor, "The Story of Creation or, The Myth of Urk" % In the beginning there was only one kind of Mathematician, created by -the Great Mathamatical Spirit form the Book: the Topologist. And they grew to +the Great Mathematical Spirit form the Book: the Topologist. And they grew to large numbers and prospered. One day they looked up in the heavens and desired to reach up as far as the eye could see. So they set out in building a Mathematical edifice that @@ -2258,7 +2258,7 @@ until one night the edifice collapsed under the weight of paradox. The following morning saw only rubble where there once was a huge structure reaching to the heavens. One by one, the Mathematicians climbed out from under the rubble. It was a miracle that nobody was killed; but when -they began to speak to one another, SUPRISE of all suprises! they could not +they began to speak to one another, SURPRISE of all surprises! they could not understand each other. They all spoke different languages. They all fought amongst themselves and each went about their own way. To this day the Topologists remain the original Mathematicians. @@ -2282,12 +2282,12 @@ sat hacking at the PDP-6. At this Minsky shut his eyes, and Sussman asked his teacher "Why do you close your eyes?" "So that the room will be empty." - At that momment, Sussman was enlightened. + At that moment, Sussman was enlightened. % In the east there is a shark which is larger than all other fish. It changes into a bird whose winds are like clouds filling the sky. When this bird moves across the land, it brings a message from Corporate Headquarters. -This message it drops into the midst of the program mers, like a seagull +This message it drops into the midst of the programmers, like a seagull making its mark upon the beach. Then the bird mounts on the wind and, with the blue sky at its back, returns home. The novice programmer stares in wonder at the bird, for he understands @@ -2661,13 +2661,13 @@ spits in the sergeants face. "Murray!" Esther cries. "Please! Don't make trouble." -- Arthur Naiman % - My friends, I am here to tell you of the wonderous continent known as + My friends, I am here to tell you of the wondrous continent known as Africa. Well we left New York drunk and early on the morning of February 31. We were 15 days on the water, and 3 on the boat when we finally arrived in Africa. Upon our arrival we immediately set up a rigorous schedule: Up at 6:00, breakfast, and back in bed by 7:00. Pretty soon we were back in bed by 6:30. Now Africa is full of big game. The first day I shot two bucks. That -was the biggest game we had. Africa is primerally inhabited by Elks, Moose +was the biggest game we had. Africa is primarily inhabited by Elks, Moose and Knights of Pithiests. The elks live up in the mountains and come down once a year for their annual conventions. And you should see them gathered around the water hole, @@ -2676,7 +2676,7 @@ weren't looking for a water hole. They were looking for an alck hole. One morning I shot an elephant in my pajamas, how he got in my pajamas, I don't know. Then we tried to remove the tusks. That's a tough word to say, tusks. As I said we tried to remove the tusks, but they were -imbedded so firmly we couldn't get them out. But in Alabama the Tusks are +embedded so firmly we couldn't get them out. But in Alabama the Tusks are looser, but that is totally irrelephant to what I was saying. We took some pictures of the native girls, but they weren't developed. So we're going back in a few years... @@ -2714,7 +2714,7 @@ audience, either." Never ask your lover if he'd dive in front of an oncoming train for you. He doesn't know. Never ask your lover if she'd dive in front of an oncoming band of Hell's Angels for you. She doesn't know. Never ask how many -cigarettes your lover has smoked today. Cancer is a personal committment. +cigarettes your lover has smoked today. Cancer is a personal commitment. Never ask to see pictures of your lover's former lovers -- especially the ones who dived in front of trains. If you look like one of them, you are repeating history's mistakes. If you don't, you'll wonder what he or she saw @@ -2867,7 +2867,7 @@ and it was very juicy. I stood up and took aim, and went into the windup, when my mother at the kitchen window called my name in a sharp voice. I had to decide quickly. I decided. A rotten Big Boy hitting the target is a memorable sound, like a fat -man doing a belly-flop. With a whoop and a yell the tomatoee came after +man doing a belly-flop. With a whoop and a yell the tomato came after faster than I knew she could run, and grabbed my shirt and was about to brain me when Mother called her name in a sharp voice. And my sister, who was a good person, obeyed and let go -- and burst into tears. I guess she knew that @@ -3122,7 +3122,7 @@ body functions. Penn's aunts made great apple pies at low prices. No one else in town could compete with the pie rates of Penn's aunts. During the American Revolution, a Britisher tried to raid a farm. He -stumbled across a rock on the ground and fell, whereupon an agressive Rhode +stumbled across a rock on the ground and fell, whereupon an aggressive Rhode Island Red hopped on top. Seeing this, the farmer commented, "Chicken catch a Tory!" A wife started serving chopped meat, Monday hamburger, Tuesday meat @@ -3472,7 +3472,7 @@ to the Berkeley UNIX version of `ls'?" % Strange memories on this nervous night in Las Vegas. Five years later? Six? It seems like a lifetime, or at least a Main Era -- the kind of peak that -never comes again. San Fransisco in the middle sixties was a very special time +never comes again. San Francisco in the middle sixties was a very special time and place to be a part of. Maybe it meant something. Maybe not, in the long run... There was madness in any direction, at any hour. If not across the Bay, then up the Golden Gate or down 101 to Los Altos or La Honda... You could @@ -3649,7 +3649,7 @@ As he turned away, he heard the man say, "Ouch!". -- well, I'll be damned. There goes another one!" % The General disliked trying to explain the highly technical -innerworkings of the U.S. Air Force. +inner workings of the U.S. Air Force. "$7,662 for a ten cup coffee maker, General?" the Senator asked. In his head he ran through his standard explanations. "It's not so," he thought. "It's a deterrent." Soon he came up with, "It's computerized, @@ -4075,7 +4075,7 @@ and escaped. off the tin cans by throwing them against the wall. She was developing a good pitching arm and a new quantum theory. The mathematician had stacked the unopened cans into a surprising -solution to the kissing problem; his dessicated corpse was propped calmly +solution to the kissing problem; his dessiccated corpse was propped calmly against a wall, and this was inscribed on the floor: Theorem: If I can't open these cans, I'll die. Proof: assume the opposite... @@ -4342,7 +4342,7 @@ explain the failure of your three marriages." product." -- Jules Feiffer % - Well, he thought, since neither Aristotilian Logic nor the disciplines + Well, he thought, since neither Aristotelian Logic nor the disciplines of Science seemed to offer much hope, it's time to go beyond them... Drawing a few deep even breaths, he entered a mental state practiced only by Masters of the Universal Way of Zen. In it his mind floated freely, @@ -4670,7 +4670,7 @@ There, that ought to patch it. Dist it out, wouldja?" "The famous scientific criminal, as famous among crooks as --" "My blushes, Watson," Holmes murmured, in a deprecating voice. "I was about to say 'as he is unknown to the public.'" - -- A. Conan Doyle, "The Valley of Fear" + -- Sir Arthur Conan Doyle, "The Valley of Fear" % "You know, it's at times like this when I'm trapped in a Vogon airlock with a man from Betelgeuse and about to die of asphyxiation in @@ -5109,7 +5109,7 @@ civilization began has seen six orders of magnitude in performance-price gain in 30 years. -- Fred Brooks % -... difference of opinion is advantagious in religion. The several sects +... difference of opinion is advantageous in religion. The several sects perform the office of a common censor morum over each other. Is uniformity attainable? Millions of innocent men, women, and children, since the introduction of Christianity, have been burnt, tortured, fined, imprisoned; @@ -5250,7 +5250,7 @@ awareness of the great goals for Man and the society he conspired to erect. canine with innovative maneuvers. -- Eschew the implement of correction and vitiate the scion. -- The temperature of the aqueous content of an unremittingly - galled saucepan does not reach 212 degrees Farenheit. + galled saucepan does not reach 212 degrees Fahrenheit. % ... So the documentary-makers stick with sharks. Generally, their procedure is to scatter bleeding fish pieces around their boat, so as @@ -5308,7 +5308,7 @@ discuss our recent efforts to apply wisdom engineering to oil exploration. optimal cachinnation. -- Eleemosynary deeds have their initial incidence intramurally. % -... there are about 5,000 people who are part of that commitee. These guys +... there are about 5,000 people who are part of that committee. These guys have a hard time sorting out what day to meet, and whether to eat croissants or doughnuts for breakfast -- let alone how to define how all these complex layers that are going to be agreed upon. @@ -6064,7 +6064,7 @@ with the possible exceptions of handguns and Tequilla. % A computer salesman visits a company president for the purpose of selling the president one of the latest talking computers. -Salesman: "This machine knows everything. I can ask it any quesstion +Salesman: "This machine knows everything. I can ask it any question and it'll give the correct answer. Computer, what is the speed of light?" Computer: 186,000 miles per second. @@ -6415,7 +6415,7 @@ Engineer: Well, I've invented a way to weave metallic threads into the saddle blanket so that they will act as the plates of a battery and provide electrical shock to the horse. G: That's very good! But let's hear from the chemist. -Chemist: I've synthesized a powerful stimulant that disolves +Chemist: I've synthesized a powerful stimulant that dissolves into simple blood sugars after ten minutes and therefore cannot be detected in post-race tests. G: Excellent, excellent! But I want to hear from the physicist before @@ -6439,7 +6439,7 @@ when a girl gives a boy a dead squid, *that had to mean SOMETHING!* A girl and a boy bump into each other -- surely an accident. A girl and a boy bump and her handkerchief drops -- surely another accident. But when a girl gives a boy a dead squid -- *that had to mean something*. - -- S. Morganstern, "The Silent Gondoliers" + -- S. Morgenstern, "The Silent Gondoliers" % A girl with a future avoids the man with a past. -- Evan Esar, "The Humor of Humor" @@ -6525,7 +6525,7 @@ when they are merely rearranging their prejudices. % A green hunting cap squeezed the top of the fleshy balloon of a head. The green earflaps, full of large ears and uncut hair and the fine bristles that -grew in the ears themselvse, stuck out on either side like turn signals +grew in the ears themselves, stuck out on either side like turn signals indicating two directions at once. Full, pursed lips protruded beneath the bushy black moustache and, at their corners, sank into little folds filled with disapproval and potato chip crumbs. In the shadow under the green visor @@ -7141,7 +7141,7 @@ but to protect the writer. % A method of solution is perfect if we can forsee from the start, and even prove, that following that method we shall attain our aim. - -- Leibnitz + -- Leibniz % A Mexican newspaper reports that bored Royal Air Force pilots stationed on the Falkland Islands have devised what they consider a marvelous new @@ -7575,7 +7575,7 @@ might be made an Archbishop." "Is there any way that you might go higher than that?" "If all the Saints should smile, I guess I could be made a Cardinal." "Could you be anything higher than a Cardinal?" - Hesitating a little bit, the priest said, "I supose that I could + Hesitating a little bit, the priest said, "I suppose that I could be elected Pope, but only if it's God's will." "And could you be anything higher than that, is there any way to go up from being the Pope?" @@ -7653,7 +7653,7 @@ banana, and on the other end a weight equal to the weight of the monkey. The banana weighs two ounces per inch. The rope is as long (in feet) as the age of the monkey (in years), and the weight of the monkey (in ounces) is the same as the age of the monkey's mother. The combined age of the -monkey and its mother is thirdy years. One half of the weight of the monkey, +monkey and its mother is thirty years. One half of the weight of the monkey, plus the weight of the banana, is one forth as much as the weight of the weight and the weight of the rope. The monkey's mother is half as old as the monkey will be when it is three times as old as its mother was when she @@ -7691,13 +7691,13 @@ I don't know what it's about. I'm just the drummer. Ask Peter. A Scholar asked his Master, "Master, would you advise me of a proper vocation?" The Master replied, "Some men can earn their keep with the power of -their minds. Others must use thier strong backs, legs and hands. This is +their minds. Others must use their strong backs, legs and hands. This is the same in nature as it is with man. Some animals acquire their food easily, such as rabbits, hogs and goats. Other animals must fiercely struggle for their sustenance, like beavers, moles and ants. So you see, the nature of the vocation must fit the individual. "But I have no abilities, desires, or imagination, Master," the -scholer sobbed. +scholar sobbed. Queried the Master... "Have you thought of becoming a salesperson?" % A scientific truth does not triumph by convincing its opponents and @@ -7711,7 +7711,7 @@ the vexation of thinking. % A sense of desolation and uncertainty, of futility, of the baselessness of aspirations, of the vanity of endeavor, and a thirst for a life giving -water which seems suddenly to have failed, are the signs in conciousness +water which seems suddenly to have failed, are the signs in consciousness of this necessary reorganization of our lives. It is difficult to believe that this state of mind can be produced by the @@ -7906,7 +7906,7 @@ A Tale of Two Cities LITE(tm) lady who knits. Crime and Punishment LITE(tm) - -- by Fyodor Dostoevski + -- by Fyodor Dostoyevsky A man sends a nasty letter to a pawnbroker, but later feels guilty and apologizes. @@ -7946,7 +7946,7 @@ sitting in the yard watching the pig. "Sure is, son," the farmer replied. "Why, two years ago, my daughter was swimming in the lake and bumped her head and damned near drowned, but that pig swam out and dragged her back to shore." - "Amazing!" the salesman exlaimed. + "Amazing!" the salesman exclaimed. "And that's not the only thing. Last fall I was cuttin' wood up on the north forty when a tree fell on me. Pinned me to the ground, it did. That pig run up and wiggled underneath that tree and lifted it off of me. @@ -7974,7 +7974,7 @@ when the faculty loses interest in students. % A vacuum is a hell of a lot better than some of the stuff that nature replaces it with. - -- Tenessee Williams + -- Tennessee Williams % A verbal contract isn't worth the paper it's written on. -- Samuel Goldwyn @@ -8025,7 +8025,7 @@ A wise person makes his own decisions, a weak one obeys public opinion. A witty saying proves nothing. -- Voltaire % -"A wizard cannot do everything; a fact most magicians are recticent to admit, +"A wizard cannot do everything; a fact most magicians are reticent to admit, let alone discuss with prospective clients. Still, the fact remains that there are certain objects, and people, that are, for one reason or another, completely immune to any direct magical spell. It is for this group of @@ -8250,7 +8250,7 @@ About the time we think we can make ends meet, somebody moves the ends. % About the use of language: it is impossible to sharpen a pencil with a blunt ax. It is equally vain to try to do it with ten blunt axes instead. - -- Edsger Dijkstra + -- Edsger W. Dijkstra % Above all else - sky. % @@ -8465,7 +8465,7 @@ Actually, my goal is to have a sandwich named after me. Actually, the probability is 100% that the elevator will be going in the right direction. Proof by induction: -N=1. Trivialy true, since both you and the elevator +N=1. Trivially true, since both you and the elevator only have one floor to go to. Assume true for N, prove for N+1: @@ -8844,7 +8844,7 @@ Al didn't smile for forty years. You've got to admire a man like that. Alan Turing thought about criteria to settle the question of whether machines can think, a question of which we now know that it is about as relevant as the question of whether submarines can swim. - -- Dijkstra + -- Edsger W. Dijkstra % Alas, how love can trifle with itself! -- William Shakespeare, "The Two Gentlemen of Verona" @@ -9349,7 +9349,7 @@ Liberties Union gets indignant, and I hope this will always be so. -- Senator Adlai E. Stevenson The ACLU has stood foursquare against the recurring tides of hysteria that -from time to time threaten freedoms everyhere... Indeed, it is difficult +from time to time threaten freedoms everywhere... Indeed, it is difficult to appreciate how far our freedoms might have eroded had it not been for the Union's valiant representation in the courts of the constitutional rights of people of all persuasions, no matter how unpopular or even despised @@ -9661,7 +9661,7 @@ An idealist is one who helps the other fellow to make a profit. % An idle mind is worth two in the bush. % -An infallible method of concilliating a tiger +An infallible method of conciliating a tiger is to allow oneself to be devoured. -- Konrad Adenauer % @@ -10829,7 +10829,7 @@ Answer each of the following items "true" or "false" 2. I use shoe polish to excess. 3. God is love. 4. I like mannish children. - 5. I have always been diturbed by the sight of Lincoln's ears. + 5. I have always been disturbed by the sight of Lincoln's ears. 6. I always let people get ahead of me at swimming pools. 7. Most of the time I go to sleep without saying goodbye. 8. I am not afraid of picking up door knobs. @@ -11086,7 +11086,7 @@ field on track. At the hospital, a doctor is training an intern on how to announce bad news to the patients. The doctor tells the intern "This man in 305 is going to die in six months. Go in and tell him." The intern boldly walks into the -room, over to the man's bedisde and tells him "Seems like you're gonna die!" +room, over to the man's bedside and tells him "Seems like you're gonna die!" The man has a heart attack and is rushed into surgery on the spot. The doctor grabs the intern and screams at him, "What!?!? are you some kind of moron? You've got to take it easy, work your way up to the subject. Now this man in @@ -11131,7 +11131,7 @@ AUCTION: Audacity, and again, audacity, and always audacity. -- G.J. Danton % -audophile, n: +audiophile, n: Someone who listens to the equipment instead of the music. % Auribus teneo lupum. @@ -11547,7 +11547,7 @@ belief, n: % Believe everything you hear about the world; nothing is too impossibly bad. - -- Honore DeBalzac + -- Honore de Balzac % Bell Labs Unix - Reach out and grep someone. % @@ -11738,7 +11738,7 @@ Beware of the man who knows the answer before he understands the question. himself no wiser than before," Bokonon tells us. "He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way." - -- Vonnegut + -- Kurt Vonnegut % Beware of the Turing Tar-pit in which everything is possible but nothing of interest is easy. @@ -13117,7 +13117,7 @@ COBOL: Completely Over and Beyond reason Or Logic. % COBOL is for morons. - -- E.W. Dijkstra + -- Edsger W. Dijkstra % Cobol programmers are down in the dumps. % @@ -13311,8 +13311,8 @@ Coming together is a beginning; Commit the oldest sins the newest kind of ways. -- William Shakespeare, "Henry IV" % -COMMITTMENT: - Committment can be illustrated by a breakfast of ham and eggs. +COMMITMENT: + Commitment can be illustrated by a breakfast of ham and eggs. The chicken was involved, the pig was committed. % Common sense is instinct, and enough of it is genius. @@ -15350,7 +15350,7 @@ Duty, n: % Dying is a very dull, dreary affair. My advice to you is to have nothing whatever to do with it. - -- W. Somerset Maughm, his last words + -- W. Somerset Maugham, his last words % Dying is easy. Comedy is difficult. -- Actor Edmond Gween, on his deathbed. @@ -15374,7 +15374,7 @@ imagery and Appledom. Even words look like decorative filigrees in exotic typefaces. The greatest icon of all, the inviolable Apple itself, stands in the dominate position at the upper-left corner of the screen. A central corporate headquarters decrees the form of all rites and practices. -Infalliable doctrine issues from one executive officer whose selection occurs +Infallible doctrine issues from one executive officer whose selection occurs in a sealed boardroom. Should anyone in his curia question his powers, the offender is excommunicated into outer darkness. The expelled heretic founds a new company, mutters obscurely of the coming age and the next computer, @@ -15717,7 +15717,7 @@ Enjoy your life; be pleasant and gay, like the birds in May. % Enjoy yourself while you're still old. % -Entreprenuer, n: +Entrepreneur, n: A high-rolling risk taker who would rather be a spectacular failure than a dismal success. % @@ -15774,7 +15774,7 @@ Etymology, n: hard to swallow." -- Mike Kellen % -Euch ist becannt, was wir beduerfen; +Euch ist bekannt, was wir beduerfen; Wir wollen stark Getraenke schluerfen. -- Goethe, "Faust" % @@ -16135,7 +16135,7 @@ Everybody is given the same amount of hormones, at birth, and if you want to use yours for growing hair, that's fine with me. % Everybody is somebody else's weirdo. - -- Dykstra + -- Edsger W. Dijkstra % Everybody knows that the dice are loaded. Everybody rolls with their fingers crossed. Everybody knows the war is over. Everybody knows the @@ -16399,13 +16399,13 @@ Extraordinary claims demand extraordinary proof. There are many examples of outsiders who eventually overthrew entrenched scientific orthodoxies, but they prevailed with irrefutable data. More often, egregious findings that contradict well-established research turn out to be artifacts. I have -argued that accepting psychic powers, reincarnation, "cosmic conciousness," +argued that accepting psychic powers, reincarnation, "cosmic consciousness," and the like, would entail fundamental revisions of the foundations of neuroscience. Before abandoning materialist theories of mind that have paid handsome dividends, we should insist on better evidence for psi phenomena than presently exists, especially when neurology and psychology themselves offer more plausible alternatives. - -- Barry L. Beyerstein, "The Brain and Conciousness: + -- Barry L. Beyerstein, "The Brain and Consciousness: Implications for Psi Phenomena". % Extreme fear can neither fight nor fly. @@ -16603,7 +16603,7 @@ Fear is the greatest salesman. -- Robert Klein % feature, n: - A surprising property of a program. Occasionaly documented. To + A surprising property of a program. Occasionally documented. To call a property a feature sometimes means the author did not consider that case, and the program makes an unexpected, though not necessarily wrong response. See BUG. "That's not a bug, it's @@ -16620,16 +16620,16 @@ Feeling amorous, she looked under the sheets and cried, "Oh, no, it's Microsoft!" % Felix Catus is your taxonomic nomenclature, -An endothermic quadroped, carniverous by nature. +An endothermic quadruped, carnivorous by nature. Your visual, olfactory, and auditory senses Contribute to your hunting skills and natural defenses. I find myself intrigued by your sub-vocal oscillations, A singular development of cat communications -That obviates your basic hedonistic predelection +That obviates your basic hedonistic predilection For a rhythmic stroking of your fur to demonstrate affection. A tail is quite essential for your acrobatic talents: You would not be so agile if you lacked its counterbalance; -And when not being utilitized to aid in locomotion, +And when not being utilised to aid in locomotion, It often serves to illustrate the state of your emotion. Oh Spot, the complex levels of behavior you display Connote a fairly well-developed cognitive array. @@ -16905,7 +16905,7 @@ flowchart, n. & v. [From flow "to ripple down in rich profusion, as hair" + chart "a cryptic hidden-treasure map designed to mislead the uninitiated."] 1. n. The solution, if any, to a class of Mascheroni - construction problems in which given algoritms require geometrical + construction problems in which given algorithms require geometrical representation using only the 35 basic ideograms of the ANSI template. 2. n. Neronic doodling while the system burns. 3. n. A low-cost substitute for wallpaper. 4. n. The innumerate @@ -17228,7 +17228,7 @@ FORTRAN, "the infantile disorder", by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use. - -- E.W. Dijkstra + -- Edsger W. Dijkstra % [FORTRAN] will persist for some time -- probably for at least the next decade. @@ -18111,7 +18111,7 @@ Come I to make this gig at Caeser's laying down. % Friendships last when each friend thinks he has a slight superiority over the other. - -- Honore DeBalzac + -- Honore de Balzac % Frisbeetarianism is the belief that when you die, your soul goes up on the roof and gets stuck. @@ -19912,7 +19912,7 @@ He who despises himself nevertheless esteems himself as a self-despiser. -- Friedrich Nietzsche % He who enters his wife's dressing room is a philosopher or a fool. - -- Balzac + -- Honore de Balzac % He who fears the unknown may one day flee from his own backside. -- Sinbad @@ -22020,7 +22020,7 @@ I have a theory that it's impossible to prove anything, but I can't prove it. % I have a very small mind and must live with it. - -- E. Dijkstra + -- Edsger W. Dijkstra % I have a very strange feeling about this... -- Luke Skywalker @@ -22193,7 +22193,7 @@ declare the construction of such machinery impracticable... And at a period when the progress of physical science is obstructed by that exhausting intellectual and manual labor, indispensable for its advancement, which it is the object of the Analytical Engine to relieve, I -think the application of machinery in aid of the most complicated and abtruse +think the application of machinery in aid of the most complicated and abstruse calculations can no longer be deemed unworthy of the attention of the country. In fact, there is no reason why mental as well as bodily labor should not be economized by the aid of machinery. @@ -22303,8 +22303,8 @@ take one along that worked. -- Raymond Chandler % I know if you been talkin' you done said -just how suprised you wuz by the living dead. -You wuz suprised that they could understand you words +just how surprised you wuz by the living dead. +You wuz surprised that they could understand you words and never respond once to all the truth they heard. But don't you get square! There ain't no rule that says they got to care. @@ -22917,7 +22917,7 @@ I stopped believing in Santa Claus when my mother took me to see him in a department store, and he asked for my autograph. -- Shirley Temple % -I suggest a new stategy, Artoo: let the Wookiee win. +I suggest a new strategy, Artoo: let the Wookiee win. -- CP30 % I suppose I could collect my books and get on back to school, @@ -24990,12 +24990,12 @@ If you don't strike oil in twenty minutes, stop boring. If you drink, don't park. Accidents make people. % If you ever want to have a lot of fun, I recommend that you go off and program -an imbedded system. The salient characteristic of an imbedded system is that +an embedded system. The salient characteristic of an embedded system is that it cannot be allowed to get into a state from which only direct intervention -will suffice to remove it. An imbedded system can't permanently trust anything +will suffice to remove it. An embedded system can't permanently trust anything it hears from the outside world. It must sniff around, adapt, consider, sniff around, and adapt again. I'm not talking about ordinary modular programming -carefulness here. No. Programming an imbedded system calls for undiluted +carefulness here. No. Programming an embedded system calls for undiluted raging maniacal paranoia. For example, our ethernet front ends need to know what network number they are on so that they can address and route PUPs properly. How do you find out what your network number is? Easy, you ask a @@ -30717,8 +30717,8 @@ Mark's Dental-Chair Discovery: % MARRIAGE: An old, established institution, entered into by two people deeply - in love and desiring to make a committment to each other expressing - that love. In short, committment to an institution. + in love and desiring to make a commitment to each other expressing + that love. In short, commitment to an institution. % MARRIAGE: Convertible bonds. @@ -31764,7 +31764,7 @@ MSDOS is not dead, it just smells that way. % Much of the excitement we get out of our work is that we don't really know what we are doing. - -- E. Dijkstra + -- Edsger W. Dijkstra % Much to his Mum and Dad's dismay, Horace ate himself one day. He didn't stop to say his grace, he just sat down and ate his face. @@ -35898,7 +35898,7 @@ P-K4 % PL/1, "the fatal disease", belongs more to the problem set than to the solution set. - -- E.W. Dijkstra + -- Edsger W. Dijkstra % Plagiarize, plagiarize, Let no man's work evade your eyes, @@ -38881,7 +38881,7 @@ the second one should have seen it. Seeing a commotion in Harvard Square, a man strolled over and asked what was going on. One of the onlookers explained to him that there was a Mooney who had immersed himself in gasoline and was threatening to set fire to -himself to demonstrate his committment to the Rev. Moon. The man gasped and +himself to demonstrate his commitment to the Rev. Moon. The man gasped and asked what was being done to defuse the obviously dangerous situation. "Well", replied the onlooker, "we're taking up a collection -- so far I've got two Bics, four Zippos and eighteen books of matches." @@ -41174,7 +41174,7 @@ Test for paraquat: the solution will turn blue-green. % Testing can show the presence of bugs, but not their absence. - -- Dijkstra + -- Edsger W. Dijkstra % Test-tube babies shouldn't throw stones. % @@ -42217,7 +42217,7 @@ it to his master. % The duration of passion is proportionate with the original resistance of the woman. - -- Honore DeBalzac + -- Honore de Balzac % The eagle may soar, but the weasel never gets sucked into a jet engine. % @@ -42420,7 +42420,7 @@ either a Q-KR5 check or the loss of his queen. -- Stephen Pile, "The Book of Heroic Failures" % The father, passing through his son's college town late one evening on a -business trip, thought he would pay his boy a suprise visit. Arriving at the +business trip, thought he would pay his boy a surprise visit. Arriving at the lad's fraternity house, dad rapped loudly on the door. After several minutes of knocking, a sleepy voice drifted down from a second-floor window, "Whaddaya want?" @@ -42623,7 +42623,7 @@ if the character does not have fire resistance. -- README file from the NetHack game % [The French Riviera is] a sunny place for shady people. - -- Somerset Maugham + -- W. Somerset Maugham % The full impact of parenthood doesn't hit you until you multiply the number of your kids by thirty-two teeth. @@ -43749,7 +43749,7 @@ The major sin is the sin of being born. % The majority of husbands remind me of an orangutang trying to play the violin. - -- Honore DeBalzac + -- Honore de Balzac % The majority of the stupid is invincible and guaranteed for all time. The terror of their tyranny, however, is alleviated by their lack of @@ -44763,7 +44763,7 @@ for incompetence. The problems of business administration in general, and database management in particular are much to difficult for people that think in IBMese, compounded with sloppy english. - -- Edsger Dijkstra + -- Edsger W. Dijkstra % The profession of book writing makes horse racing seem like a solid, stable business. @@ -44902,7 +44902,7 @@ depends on the unreasonable man. -- George Bernard Shaw % The reasons that each of these countries has had to renege on its -financial committments were all somewhat different: Argentina because of +financial commitments were all somewhat different: Argentina because of a war, Poland because of its vast misguided overinvestment in heavy industry, Honduras because the coffeee price went sour, Zaire because nobody in the government there has a clue as to how to run a country. @@ -45703,7 +45703,7 @@ world put together. % The use of anthropomorphic terminology when dealing with computing systems is a symptom of professional immaturity. - -- Edsger Dijkstra + -- Edsger W. Dijkstra % The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. @@ -45711,7 +45711,7 @@ regarded as a criminal offence. % The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. - -- E.W. Dijkstra + -- Edsger W. Dijkstra % The use of money is all the advantage there is to having money. -- B. Franklin @@ -46098,7 +46098,7 @@ wants and not give in to it, to spend years in silent hurt wondering if something could have materialized -- and never knowing. -- David Viscott % -The Wright Bothers weren't the first to fly. +The Wright Brothers weren't the first to fly. They were just the first not to crash. % The yankees, son, are up north. @@ -50031,7 +50031,7 @@ We can embody the truth, but we cannot know it. % We can found no scientific discipline, nor a healthy profession on the technical mistakes of the Department of Defense and IBM. - -- Edsger Dijkstra + -- Edsger W. Dijkstra % We cannot command nature except by obeying her. -- Sir Francis Bacon @@ -52266,7 +52266,7 @@ is to believe the one in which people appear at their worst. -- H. Allen Smith, "Let the Crabgrass Grow" % When there is an old maid in the house, a watch dog is unnecessary. - -- Balzac + -- Honore de Balzac % When things go well, expect something to explode, erode, collapse or just disappear. @@ -52322,7 +52322,7 @@ When women kiss it always reminds one of prize fighters shaking hands. When women love us, they forgive us everything, even our crimes; when they do not love us, they give us credit for nothing, not even our virtues. - -- Balzac + -- Honore de Balzac % When you are about to die, a wombat is better than no company at all. -- Roger Zelazny, "Doorways in the Sand" @@ -53460,15 +53460,15 @@ than being slapped is when you get on your knees and say you're sorry. % Women waste men's lives and think they have indemnified them by a few gracious words. - -- Balzac + -- Honore de Balzac % Women, when they are not in love, have all the cold blood of an experienced attorney. - -- Balzac + -- Honore de Balzac % Women, when they have made a sheep of a man, always tell him that he is a lion with a will of iron. - -- Balzac + -- Honore de Balzac % Women who desire to be like men, lack ambition. % @@ -53708,7 +53708,7 @@ Would you *really* want to get on a non-stop flight? % "Would you tell me, please, which way I ought to go from here?" "That depends a good deal on where you want to get to," said the Cat. - -- Lewis Carrol + -- Lewis Carroll % Wouldn't this be a great world if being insecure and desperate were a turn-on? diff --git a/fortune/datfiles/fortunes2-o.real b/fortune/datfiles/fortunes2-o.real index e32c083..50170f9 100644 --- a/fortune/datfiles/fortunes2-o.real +++ b/fortune/datfiles/fortunes2-o.real @@ -14324,7 +14324,7 @@ expect it. User friendly software searching for friendly Hardware to interface with. Hardware may present itself in floppy format as software has capability to upgrading same to full size firm. Size is not all that important; but byte -sized bandwith required -- header width is of more concern. Joystick should +sized bandwidth required -- header width is of more concern. Joystick should be able to toggle in different speeds and for some duration. Software is looking for system willing to perform intensive manipulation of keyboard as well as preparing the mainframe and disk drives. Fingering of all files diff --git a/fortune/datfiles/limerick b/fortune/datfiles/limerick index 3a55bd9..7f8919c 100644 --- a/fortune/datfiles/limerick +++ b/fortune/datfiles/limerick @@ -42,7 +42,7 @@ Found programming UNIX a hurdle Ran as slow as did he, And that's not saying much for the turtle. % -There was a young lady of Riga +There was a young lady from Niger Who smiled as she rode on a tiger; They returned from the ride With the lady inside, diff --git a/fortune/datfiles/netbsd b/fortune/datfiles/netbsd index d079e81..8f310b3 100644 --- a/fortune/datfiles/netbsd +++ b/fortune/datfiles/netbsd @@ -1,4 +1,5 @@ -____ __ _ ____ __ __ ___ ___ ___ + +%____ __ _ ____ __ __ ___ ___ ___ ___ / | / /__ _/ /_ / |/ __\ / _ | __ / |/ // _\/_ _/ / ' / \_ \ / / / _ / /| // __/ / /_ / , | __/ // / ,/ @@ -199,7 +200,6 @@ NetBSD: Designed to be {secure, reliable, portable, CORRECT} -- Matthew Orgass % NetBSD: Download one, get ${NUMPORTS}-1 for free. - -- Antti Kantee % NetBSD: Empowering the VAX generation. -- Andy Doran @@ -328,7 +328,6 @@ NetBSD, No Worries! -- Andrew Gillham % NetBSD: Not all of the First Ones have gone away. - -- Antti Kantee % NetBSD. Not Guano. -- Hubert Feyrer @@ -337,7 +336,6 @@ NetBSD: Not your mother's OS (unless you are P. Seebach) -- Tom Harvey % NetBSD: Oh my god! They support my hardware! You hackers! - -- Antti Kantee % NetBSD: Perpetual performance! -- Lars-Johan Liman @@ -362,6 +360,8 @@ NetBSD: Professionalpower! % NetBSD: "Progress on your system is closer than it appears." % +NetBSD: Raiders of the Lost Arch +% NetBSD: Re: NetBSD Slogans -- Mirian Crzig Lennox % @@ -414,7 +414,6 @@ NetBSD: The Last Bastion of the true UNIX Religion. -- Miles Nordin % NetBSD: The OS WORM - Write Once, Run Many - -- Antti Kantee % NetBSD: The Power of Code -- Mason Loring Bliss @@ -435,6 +434,8 @@ NetBSD: the server is up % NetBSD: The Worlds Most Portable Operating System % +NetBSD/toaster: we wish the toaster to be happy too. +% NetBSD: To serve the power. -- Herb Peyerl % @@ -458,7 +459,6 @@ NetBSD: Use the ENTIRE computer! -- Andrew Gillham % NetBSD: userland included - -- Antti Kantee % NetBSD: We Come In Peace. -- Andrew Gillham @@ -531,3 +531,13 @@ It can be a hulking monster in your basement, or fit in the palm of your hand. -- Richard Rauch % +#netbsd - where monks recite their internal dialogue while debugging. + -- Bernhard Riedel +% +I held off from Uni until NetBSD came out. +I decided, ``if there's no NetBSD then I'll just flip burgers'' + -- Roland Dowdeswell +% +NetBSD - love all, serve all. + -- Silke Mueller +% diff --git a/fortune/fortune/fortune.6.in b/fortune/fortune/fortune.6.in index 495cee5..e507da4 100644 --- a/fortune/fortune/fortune.6.in +++ b/fortune/fortune/fortune.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: fortune.6,v 1.8 2001/04/02 22:47:30 wiz Exp $ +.\" $NetBSD: fortune.6,v 1.9 2002/09/26 18:32:01 wiz Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -86,8 +86,7 @@ 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 .Fl o -rather than give us -grief about it, okay?) +rather than give us grief about it, okay?) .Ef .Bd -filled -offset indent \&... let us keep in mind the basic governing philosophy @@ -154,8 +153,7 @@ will pick out 90% of its fortunes from (the ``10% not-funny'' is unnecessary, since 10% is all that's left). The .Fl e -option says to consider all files equal; -thus +option says to consider all files equal; thus .Bd -literal -offset indent fortune -e .Ed diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index 6a05584..844dae3 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.33 2001/12/20 20:10:35 soren Exp $ */ +/* $NetBSD: fortune.c,v 1.38 2002/11/24 18:03:14 christos Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.33 2001/12/20 20:10:35 soren Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.38 2002/11/24 18:03:14 christos Exp $"); #endif #endif /* not lint */ @@ -182,12 +182,14 @@ int maxlen_in_list __P((FILEDESC *)); # define RE_FREE(re) char *Re_pat, *Re_pat13, *Re_use; -char *Re_error; - char *regcmp(), *regex(); + # elif HAVE_RE_COMP +char *Re_pat, *Re_pat13, *Re_use; +char *Re_error; + # define RE_INIT(re) -# define RE_COMP(re, p) ((re) = re_comp(p)) +# define RE_COMP(re, p) (Re_error = re_comp(p)) # define RE_ERROR(re) Re_error # define RE_OK(re) (Re_error == NULL) # define RE_EXEC(re, p) re_exec(p) @@ -595,11 +597,11 @@ add_file(percent, file, dir, head, tail, parent) { if (parent == NULL) warnx("`%s' not a fortune file or directory", path); - free((char *) fp); if (was_malloc) free(tpath); do_free(fp->datfile); do_free(fp->posfile); + free(fp); do_free(offensive); return FALSE; } @@ -768,7 +770,7 @@ add_dir(fp) free(name); } if (fp->num_children == 0) { - warnx("`%s': No fortune files in directory.\n", fp->path); + warnx("`%s': No fortune files in directory.", fp->path); return FALSE; } return TRUE; diff --git a/fortune/strfile/strfile.8 b/fortune/strfile/strfile.8 index e8bedfc..00243a3 100644 --- a/fortune/strfile/strfile.8 +++ b/fortune/strfile/strfile.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: strfile.8,v 1.8 2000/11/07 05:51:55 lukem Exp $ +.\" $NetBSD: strfile.8,v 1.10 2002/09/26 18:32:01 wiz Exp $ .\" .\" Copyright (c) 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -92,7 +92,7 @@ field to be set. Run silently; don't give a summary message when finished. .It Fl x Note that each alphabetic character in the groups of lines is rotated -13 positions in a simple caesar cypher. +13 positions in a simple caesar cipher. This option causes the .Dv STR_ROTATED bit in the header @@ -122,9 +122,8 @@ is to undo the work of .Nm strfile . It prints out the strings contained in the file .Ar source_file -in the order that they are listed in -the header file -.Ar source_file Ns Pa .dat +in the order that they are listed in the header file +.Ar source_file Ns Sy .dat to standard output. It is possible to create sorted versions of input files by using .Fl o diff --git a/fortune/unstr/Makefile.bsd b/fortune/unstr/Makefile.bsd index 628b1f1..f949b57 100644 --- a/fortune/unstr/Makefile.bsd +++ b/fortune/unstr/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.6 2001/12/12 00:07:48 tv Exp $ +# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:40 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 -PROG= unstr NOMAN= # defined + +PROG= unstr CPPFLAGS+= -I${.CURDIR}/../strfile .include diff --git a/gomoku/gomoku.6 b/gomoku/gomoku.6 index 40e76f7..29056b2 100644 --- a/gomoku/gomoku.6 +++ b/gomoku/gomoku.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: gomoku.6,v 1.6 1999/03/22 18:49:12 garbled Exp $ +.\" $NetBSD: gomoku.6,v 1.9 2002/09/26 18:32:01 wiz Exp $ .\" .\" Copyright (c) 1994 .\" The Regents of the University of California. All rights reserved. @@ -50,13 +50,14 @@ .Sh DESCRIPTION .Nm is a two player game were the object is to get 5 in a row horizontally, -vertically or diagonally on a 19 by 19 grid. By convention, black always -moves first. +vertically or diagonally on a 19 by 19 grid. +By convention, black always moves first. With no arguments, .Nm will display a playing board and prompt for moves from the user. Valid moves are a letter for the column and a number for the row of an empty -board location. Entering ``quit" or ``resign" will end the game. +board location. +Entering ``quit" or ``resign" will end the game. You can save the current state of the game by entering ``save" and supplying a file name when prompted. The optional file @@ -66,29 +67,32 @@ can be used to restore a saved game. The options are: .Bl -tag -width Ds .It Fl b -This option sets background mode. Input moves are read from standard input, -the computer picks a move, and prints it to standard output. The first -input line should be either ``black" or ``white" to specify whether +This option sets background mode. +Input moves are read from standard input, +the computer picks a move, and prints it to standard output. +The first input line should be either ``black" or ``white" to specify whether .Nm -has the first move or not respectively. This -option was intended for game tournaments where a referee program handles +has the first move or not respectively. +This option was intended for game tournaments where a referee program handles the board display and pits one program against another. .It Fl c -Computer verses computer. +Computer versus computer. .Nm -will play a game against itself. This is mostly used for testing. +will play a game against itself. +This is mostly used for testing. .It Fl d -Print debugging information. Repeating this option more than -once yields more detailed information. +Print debugging information. +Repeating this option more than once yields more detailed information. .It Fl D Ar debugfile Print the debug information to .Ar debugfile instead of to the standard output. .It Fl u -User verses user. This is mostly used for testing. +User versus user. +This is mostly used for testing. .El .Sh AUTHOR -Ralph Campbell +.An Ralph Campbell .Sh ACKNOWLEDGEMENTS The board display routines were based on the .Nm goref diff --git a/hack/Makefile.bsd b/hack/Makefile.bsd index ff8ee03..e40ece4 100644 --- a/hack/Makefile.bsd +++ b/hack/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.31 2000/09/23 13:53:42 simonb Exp $ +# $NetBSD: Makefile,v 1.33 2002/03/05 21:29:56 thorpej Exp $ # @(#)Makefile 8.2 (Berkeley) 4/27/95 .include @@ -27,7 +27,7 @@ FILES=help hh data FILESDIR=/var/games/hackdir hack.onames.h: makedefs def.objects.h - ${.OBJDIR}/makedefs ${.CURDIR}/def.objects.h > hack.onames.h + ./makedefs ${.CURDIR}/def.objects.h > hack.onames.h makedefs: makedefs.c ${HOST_LINK.c} -o makedefs ${.CURDIR}/makedefs.c @@ -51,9 +51,9 @@ afterinstall: clobber .endif clobber: - ${INSTALL} ${INSTPRIV} ${COPY} -o games -g games -m 660 /dev/null \ + ${INSTALL_FILE} -o games -g games -m 660 /dev/null \ ${DESTDIR}/var/games/hackdir/perm - ${INSTALL} ${INSTPRIV} ${COPY} -o games -g games -m 660 /dev/null \ + ${INSTALL_FILE} -o games -g games -m 660 /dev/null \ ${DESTDIR}/var/games/hackdir/record rm -f ${DESTDIR}/var/games/hackdir/bones* diff --git a/hack/extern.h b/hack/extern.h index 325531b..804498c 100644 --- a/hack/extern.h +++ b/hack/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 2001/03/25 20:43:58 jsm Exp $ */ +/* $NetBSD: extern.h,v 1.5 2002/05/26 00:12:12 wiz Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -37,12 +37,8 @@ */ #ifndef _EXTERN_H_ #define _EXTERN_H_ -#include -#ifndef __STDC__ -#include -#else #include -#endif +#include /* alloc.c */ long *alloc __P((unsigned)); diff --git a/hack/hack.6.in b/hack/hack.6.in index 02df3fc..cbeee0b 100644 --- a/hack/hack.6.in +++ b/hack/hack.6.in @@ -1,28 +1,29 @@ -.\" $NetBSD: hack.6,v 1.7 2001/04/02 22:42:38 wiz Exp $ -*- nroff -*- +.\" $NetBSD: hack.6,v 1.11 2003/02/25 10:34:45 wiz Exp $ -*- nroff -*- .Dd March 31, 1985 .Dt HACK 6 .Os .Sh NAME .Nm hack -.Nd Exploring The Dungeons of Doom +.Nd exploring The Dungeons of Doom .Sh SYNOPSIS -.Nm @gamesdir@/hack +.Nm .Op Fl d Ar directory .Op Fl n .Op Fl u Ar playername -.Nm @gamesdir@/hack +.Nm .Op Fl d Ar directory .Op Fl s .Op Fl X .Op Ar playername ... .Sh DESCRIPTION .Nm -is a display oriented dungeons & dragons - like game. +is a display oriented dungeons \*[Am] dragons-like game. Both display and command structure resemble rogue. (For a game with the same structure but entirely different display - a real cave instead of dull rectangles - try Quest.) .Pp -To get started you really only need to know two commands. The command +To get started you really only need to know two commands. +The command .Ic ? will give you a list of the available commands and the command .Ic / @@ -30,18 +31,18 @@ will identify the things you see on the screen. .Pp 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 heroes. +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 heroes. .Pp When the game ends, either by your death, when you quit, or if you escape from the caves, .Nm -will give you (a fragment of) the list of top scorers. The scoring -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. +will give you (a fragment of) the list of top scorers. +The scoring 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. There is a 10% penalty for getting yourself killed. .Pp The administration of the game is kept in the directory specified with the @@ -80,7 +81,8 @@ then this supplies the answer to the question "What kind of character ... ?". .Pp The .Fl s -option will print out the list of your scores. It may be followed by arguments +option will print out the list of your scores. +It may be followed by arguments .Fl X where X is one of the letters C, F, K, S, T, W to print the scores of Cavemen, Fighters, Knights, Speleologists, Tourists or Wizards. @@ -128,7 +130,8 @@ Pager used instead of default pager. .It Ev MAIL Mailbox file. .It Ev MAILREADER -Reader used instead of default (probably /usr/bin/mail). +Reader used instead of default (probably +.Pa /usr/bin/mail ) . .It Ev HACKDIR Playground. .It Ev HACKOPTIONS diff --git a/hack/hack.main.c b/hack/hack.main.c index a031f75..4919aa2 100644 --- a/hack/hack.main.c +++ b/hack/hack.main.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.main.c,v 1.6 2001/03/25 20:44:01 jsm Exp $ */ +/* $NetBSD: hack.main.c,v 1.7 2002/05/26 00:12:12 wiz Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.main.c,v 1.6 2001/03/25 20:44:01 jsm Exp $"); +__RCSID("$NetBSD: hack.main.c,v 1.7 2002/05/26 00:12:12 wiz Exp $"); #endif /* not lint */ #include @@ -466,22 +466,11 @@ askname() /* VARARGS1 */ void -#ifdef __STDC__ impossible(const char *s, ...) -#else -impossible(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - const char *s; - va_start(ap); - s = va_arg(ap, const char *); -#else va_start(ap, s); -#endif vpline(s, ap); va_end(ap); pline("Program in disorder - perhaps you'd better Quit."); diff --git a/hack/hack.mkshop.c b/hack/hack.mkshop.c index 8ec09f9..a73dce7 100644 --- a/hack/hack.mkshop.c +++ b/hack/hack.mkshop.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.mkshop.c,v 1.6 2001/03/25 20:44:01 jsm Exp $ */ +/* $NetBSD: hack.mkshop.c,v 1.7 2002/08/22 01:49:34 chuck Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.mkshop.c,v 1.6 2001/03/25 20:44:01 jsm Exp $"); +__RCSID("$NetBSD: hack.mkshop.c,v 1.7 2002/08/22 01:49:34 chuck Exp $"); #endif /* not lint */ #include @@ -70,7 +70,7 @@ mkshop() #ifdef WIZARD (wizard && getenv("SHOPTYPE") && sroom->doorct != 0) || #endif /* WIZARD */ - (sroom->doorct <= 2 && sroom->doorct > 0)) + sroom->doorct == 1) break; } diff --git a/hack/hack.pri.c b/hack/hack.pri.c index d86ec4f..4de39ac 100644 --- a/hack/hack.pri.c +++ b/hack/hack.pri.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.pri.c,v 1.6 2001/03/25 20:44:02 jsm Exp $ */ +/* $NetBSD: hack.pri.c,v 1.7 2002/05/26 00:12:12 wiz Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.pri.c,v 1.6 2001/03/25 20:44:02 jsm Exp $"); +__RCSID("$NetBSD: hack.pri.c,v 1.7 2002/05/26 00:12:12 wiz Exp $"); #endif /* not lint */ #include "hack.h" @@ -40,21 +40,11 @@ swallowed() boolean panicking; void -#ifdef __STDC__ panic(const char *fmt, ...) -#else -panic(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - const char *fmt; - va_start(ap); - fmt = va_arg(ap, const char *); -#else + va_start(ap, fmt); -#endif if (panicking++) exit(1); /* avoid loops - this should never happen */ home(); diff --git a/hack/hack.topl.c b/hack/hack.topl.c index 8f4a64d..ced3ca7 100644 --- a/hack/hack.topl.c +++ b/hack/hack.topl.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.topl.c,v 1.5 2001/03/25 20:44:03 jsm Exp $ */ +/* $NetBSD: hack.topl.c,v 1.6 2002/05/26 00:12:12 wiz Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.topl.c,v 1.5 2001/03/25 20:44:03 jsm Exp $"); +__RCSID("$NetBSD: hack.topl.c,v 1.6 2002/05/26 00:12:12 wiz Exp $"); #endif /* not lint */ #include @@ -143,21 +143,11 @@ clrlin() } void -#ifdef __STDC__ pline(const char *fmt, ...) -#else -pline(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - const char *fmt; - va_start(ap); - fmt = va_arg(ap, const char *); -#else + va_start(ap, fmt); -#endif vpline(fmt, ap); va_end(ap); } diff --git a/hack/hack.tty.c b/hack/hack.tty.c index 93831ce..15a17d4 100644 --- a/hack/hack.tty.c +++ b/hack/hack.tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.tty.c,v 1.9 2001/03/25 20:44:03 jsm Exp $ */ +/* $NetBSD: hack.tty.c,v 1.10 2002/05/26 00:12:12 wiz Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: hack.tty.c,v 1.9 2001/03/25 20:44:03 jsm Exp $"); +__RCSID("$NetBSD: hack.tty.c,v 1.10 2002/05/26 00:12:12 wiz Exp $"); #endif #endif /* not lint */ @@ -143,22 +143,11 @@ setftty() /* fatal error */ /* VARARGS1 */ void -#ifdef __STDC__ error(const char *fmt, ...) -#else -error(va_alist) - va_dcl -#endif { va_list ap; -#ifndef __STDC__ - const char *fmt; - va_start(ap); - fmt = va_arg(ap, const char *); -#else va_start(ap, fmt); -#endif if (settty_needed) settty((char *) 0); vprintf(fmt, ap); diff --git a/hack/help b/hack/help index 24b22a5..792a3a7 100644 --- a/hack/help +++ b/hack/help @@ -45,7 +45,7 @@ Commands: > down: go down (just like up). kjhlyubn - go one step in the direction indicated. k: north (i.e., to the top of the screen), - j: south, h: west, l: east, y: ne, u: nw, b: se, n: sw. + j: south, h: west, l: east, y: nw, u: ne, b: sw, n: se. KJHLYUBN - Go in that direction until you hit a wall or run into something. m (followed by one of kjhlyubn): move without picking up diff --git a/hangman/hangman.6.in b/hangman/hangman.6.in index b0e4fc7..a0aefa0 100644 --- a/hangman/hangman.6.in +++ b/hangman/hangman.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: hangman.6,v 1.9 2002/01/20 00:52:22 wiz Exp $ +.\" $NetBSD: hangman.6,v 1.11 2003/02/25 10:34:46 wiz Exp $ .\" .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. @@ -45,7 +45,7 @@ .Op Fl m Ar minlen .Sh DESCRIPTION In -.Nm "" , +.Nm , the computer picks a word from the on-line word list and you must try to guess it. The computer keeps track of which letters have been guessed @@ -57,7 +57,8 @@ Use the specified .Ar wordlist instead of the default one named below. .It Fl m -Set the minimum word length to use. The default is 6 letters. +Set the minimum word length to use. +The default is 6 letters. .El .Sh FILES .Bl -tag -width @hangman_wordsfile@ -compact diff --git a/hunt/Makefile.inc.bsd b/hunt/Makefile.inc.bsd index e350e55..2038362 100644 --- a/hunt/Makefile.inc.bsd +++ b/hunt/Makefile.inc.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.4 2000/04/13 06:07:06 simonb Exp $ +# $NetBSD: Makefile.inc,v 1.6 2002/09/20 21:00:01 mycroft Exp $ # # Hunt # Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold diff --git a/hunt/hunt/hunt.6.in b/hunt/hunt/hunt.6.in index 22632c4..97ab717 100644 --- a/hunt/hunt/hunt.6.in +++ b/hunt/hunt/hunt.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: hunt.6,v 1.4 2001/04/04 11:41:01 wiz Exp $ +.\" $NetBSD: hunt.6,v 1.9 2003/02/25 10:34:46 wiz Exp $ .\" .\" hunt .\" Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -31,8 +31,7 @@ walls and players. The more players you kill before you die, the better your score is. If the .Fl m -flag is given, -you enter the game as a monitor +flag is given, you enter the game as a monitor (you can see the action but you cannot play). .Pp .Nm @@ -44,8 +43,7 @@ argument. This presupposes that a hunt game is already running on that host, see .Xr huntd 6 for details on how to setup a game on a specific host. -If more than one game if found, -you may pick which game to play in. +If more than one game if found, you may pick which game to play in. .Pp If the .Fl q @@ -53,8 +51,9 @@ flag is given, .Nm queries the local network (or specific host) and reports on all active games found. -This is useful for shell startup scripts, e.g.\& -.Xr csh 1 Ns 's No .login . +This is useful for shell startup scripts, e.g., +.Xr csh 1 Ns 's +.Pa .login . .Pp The player name may be specified on the command line by using the .Fl n @@ -107,23 +106,18 @@ mailing list (see .Xr huntd 6 ) . .Sh PLAYING HINTS .Nm -only works on crt (vdt) terminals with at least 24 lines, 80 columns, and +only works on CRT (vdt) terminals with at least 24 lines, 80 columns, and cursor addressing. The screen is divided in to 3 areas. On the right hand side is the status area. -It shows damage sustained, -charges remaining, -who's in the game, +It shows damage sustained, charges remaining, who's in the game, who's scanning (the .Dq * -in front of the name), -who's cloaked (the +in front of the name), who's cloaked (the .Dq + -in front of the name), -and other players' scores. +in front of the name), and other players' scores. The rest of the screen is taken up by your map of the maze. -The 24th line -is used for longer messages that don't fit in the status area. +The 24th line is used for longer messages that don't fit in the status area. .Pp .Nm uses the same keys to move as @@ -205,7 +199,7 @@ bomb small slime .It $ big slime -.It ><^v +.It \*[Gt]\*[Lt]^v you facing right, left, up, or down .It }{i! other players facing right, left, up, or down @@ -226,8 +220,7 @@ You can only fire three shots in a row, then the gun must cool off. .It Shots move 5 times faster than you do. .It -To stab someone, -you face that player and move at them. +To stab someone, you face that player and move at them. .It Stabbing does 2 points worth of damage and shooting does 5 points. .It @@ -246,8 +239,7 @@ The number of squares is equal to the number of charges used. .It One small mine and one large mine is placed in the maze for every new player. A mine has a 2% probability of tripping when you walk forward on to it; -50% when going sideways; -95% when backing up. +50% when going sideways; 95% when backing up. Tripping a mine costs you 5 points or 10 points respectively. Defusing a mine is worth 1 charge or 9 charges respectively. .It @@ -280,17 +272,16 @@ Slime goes around walls, not through them. Walls regenerate, reappearing in the order they were destroyed. One percent of the regenerated walls will be diagonal walls or doors. When a wall is generated directly beneath a player, he is thrown in -a random direction for a random period of time. When he lands, he -sustains damage (up to 20 percent of the amount of damage already -sustained); i.e., -the less damage he had, the more nimble he is and -therefore less likely to hurt himself on landing. +a random direction for a random period of time. +When he lands, he sustains damage (up to 20 percent of the amount of +damage already sustained); i.e., the less damage he had, the more nimble +he is and therefore less likely to hurt himself on landing. .\"MP .\"There is a volcano close to the center of the maze which goes off .\"close to every 30 deaths. .It Every 30 deaths or so, a -.Dq ? +.Dq \&? will appear. It is a wandering bomb which will explode when it hits someone, or when it is slimed. @@ -306,10 +297,8 @@ will ask you what name you want to play under. If you wish to set other options than just your name, you can enumerate the options as follows: .Dl setenv HUNT "name=Sneaky,team=1,cloak,mapkey=zoFfGg1f2g3F4G" -sets the player name to Sneaky, -sets the team to one, -sets the enter game attribute to cloaked, -and the maps +sets the player name to Sneaky, sets the team to one, +sets the enter game attribute to cloaked, and the maps .Ic z to .Ic o , F @@ -333,8 +322,8 @@ option must be last. Other options are: .Ar scan , fly , nobeep , port=string , host=string , and -.Ar message=string -\(em which correspond to the command line options. +.Ar message=string , +which correspond to the command line options. String options cannot contain commas since commas are used to separate options. .It @@ -396,7 +385,6 @@ We thank Don Kneller, John Thomason, Eric Pettersen, Mark Day, and Scott Weiner for providing endless hours of play-testing to improve the character of the game. -We hope their significant others will forgive them; -we certainly don't. +We hope their significant others will forgive them; we certainly don't. .Sh BUGS To keep up the pace, not everything is as realistic as possible. diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c index 26701a1..588dd01 100644 --- a/hunt/hunt/hunt.c +++ b/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.c,v 1.12 2001/02/05 00:40:45 christos Exp $ */ +/* $NetBSD: hunt.c,v 1.16 2002/12/06 01:50:56 thorpej Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,12 +7,13 @@ #include #ifndef lint -__RCSID("$NetBSD: hunt.c,v 1.12 2001/02/05 00:40:45 christos Exp $"); +__RCSID("$NetBSD: hunt.c,v 1.16 2002/12/06 01:50:56 thorpej Exp $"); #endif /* not lint */ # include # include # include +# include # include # include # include @@ -48,10 +49,6 @@ static struct termios saved_tty; # define put_str addstr # endif -#if !defined(BSD_RELEASE) || BSD_RELEASE < 44 -extern int _putchar(); -#endif - #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif @@ -411,8 +408,7 @@ list_drivers() static SOCKET *listv; static unsigned int listmax; unsigned int listc; - fd_set mask; - struct timeval wait; + struct pollfd set[1]; if (initial) { /* do one time initialization */ # ifndef BROADCAST @@ -465,13 +461,7 @@ list_drivers() # ifdef BROADCAST if (initial) - brdc = broadcast_vec(test_socket, (struct sockaddr **) &brdv); - - if (brdc <= 0) { - initial = FALSE; - test.sin_addr = local_address; - goto test_one_host; - } + brdc = broadcast_vec(test_socket, (void *) &brdv); # ifdef SO_BROADCAST /* Sun's will broadcast even though this option can't be set */ @@ -495,6 +485,13 @@ list_drivers() /* NOTREACHED */ } } + test.sin_addr = local_address; + if (sendto(test_socket, (char *) &msg, sizeof msg, 0, + (struct sockaddr *) &test, DAEMON_SIZE) < 0) { + warn("sendto"); + leave(1, "sendto"); + /* NOTREACHED */ + } # else /* !BROADCAST */ /* loop thru all hosts on local net and send msg to them. */ msg = htons(C_TESTMSG()); @@ -512,9 +509,9 @@ list_drivers() get_response: namelen = DAEMON_SIZE; errno = 0; + set[0].fd = test_socket; + set[0].events = POLLIN; for (;;) { - wait.tv_sec = 1; - wait.tv_usec = 0; if (listc + 1 >= listmax) { listmax += 20; listv = (SOCKET *) realloc((char *) listv, @@ -523,9 +520,7 @@ list_drivers() leave(1, "Out of memory!"); } - FD_ZERO(&mask); - FD_SET(test_socket, &mask); - if (select(test_socket + 1, &mask, NULL, NULL, &wait) == 1 && + if (poll(set, 1, 1000) == 1 && recvfrom(test_socket, (char *) &port_num, sizeof(port_num), 0, (struct sockaddr *) &listv[listc], &namelen) > 0) { /* @@ -543,8 +538,8 @@ list_drivers() } if (errno != 0 && errno != EINTR) { - warn("select/recvfrom"); - leave(1, "select/recvfrom"); + warn("poll/recvfrom"); + leave(1, "poll/recvfrom"); /* NOTREACHED */ } diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c index 26726bb..6c85c11 100644 --- a/hunt/hunt/playit.c +++ b/hunt/hunt/playit.c @@ -1,4 +1,4 @@ -/* $NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $ */ +/* $NetBSD: playit.c,v 1.6 2003/02/26 07:14:44 jdc Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,10 +7,11 @@ #include #ifndef lint -__RCSID("$NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $"); +__RCSID("$NetBSD: playit.c,v 1.6 2003/02/26 07:14:44 jdc Exp $"); #endif /* not lint */ # include +# include # include # include # include @@ -82,7 +83,7 @@ playit() { int ch; int y, x; - long version; + u_int32_t version; if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) { bad_con(); @@ -218,26 +219,23 @@ playit() static unsigned char getchr() { - fd_set readfds, s_readfds; - int nfds, s_nfds; + struct pollfd set[2]; + int nfds; - FD_ZERO(&s_readfds); - FD_SET(Socket, &s_readfds); - FD_SET(STDIN, &s_readfds); - s_nfds = (Socket > STDIN) ? Socket : STDIN; - s_nfds++; + set[0].fd = Socket; + set[0].events = POLLIN; + set[1].fd = STDIN; + set[1].events = POLLIN; one_more_time: do { errno = 0; - readfds = s_readfds; - nfds = s_nfds; - nfds = select(nfds, &readfds, NULL, NULL, NULL); + nfds = poll(set, 2, INFTIM); } while (nfds <= 0 && errno == EINTR); - if (FD_ISSET(STDIN, &readfds)) + if (set[1].revents && POLLIN) send_stuff(); - if (! FD_ISSET(Socket, &readfds)) + if (! (set[0].revents & POLLIN)) goto one_more_time; icnt = read(Socket, ibuf, sizeof ibuf); if (icnt < 0) { @@ -620,7 +618,7 @@ redraw_screen() void do_message() { - long version; + u_int32_t version; if (read(Socket, (char *) &version, LONGLEN) != LONGLEN) { bad_con(); diff --git a/hunt/huntd/answer.c b/hunt/huntd/answer.c index dad5d45..935fb4f 100644 --- a/hunt/huntd/answer.c +++ b/hunt/huntd/answer.c @@ -1,4 +1,4 @@ -/* $NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $ */ +/* $NetBSD: answer.c,v 1.5 2003/02/26 07:14:45 jdc Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $"); +__RCSID("$NetBSD: answer.c,v 1.5 2003/02/26 07:14:45 jdc Exp $"); #endif /* not lint */ # include @@ -33,11 +33,12 @@ answer() static int enter_status; static int socklen; static u_long machine; - static u_long uid; + static u_int32_t uid; static SOCKET sockstruct; char *cp1, *cp2; int flags; - long version; + u_int32_t version; + int i; # ifdef INTERNET socklen = sizeof sockstruct; @@ -124,9 +125,10 @@ answer() # endif # ifdef MONITOR if (mode == C_MONITOR) - if (End_monitor < &Monitor[MAXMON]) + if (End_monitor < &Monitor[MAXMON]) { pp = End_monitor++; - else { + i = pp - Monitor + MAXPL + 3; + } else { socklen = 0; (void) write(newsock, (char *) &socklen, sizeof socklen); @@ -135,9 +137,10 @@ answer() } else # endif - if (End_player < &Player[MAXPL]) + if (End_player < &Player[MAXPL]) { pp = End_player++; - else { + i = pp - Player + 3; + } else { socklen = 0; (void) write(newsock, (char *) &socklen, sizeof socklen); @@ -153,9 +156,8 @@ answer() pp->p_output = fdopen(newsock, "w"); pp->p_death[0] = '\0'; pp->p_fd = newsock; - FD_SET(pp->p_fd, &Fds_mask); - if (pp->p_fd >= Num_fds) - Num_fds = pp->p_fd + 1; + fdset[i].fd = newsock; + fdset[i].events = POLLIN; pp->p_y = 0; pp->p_x = 0; diff --git a/hunt/huntd/bsd.h b/hunt/huntd/bsd.h index bfd6c7e..d746f1d 100644 --- a/hunt/huntd/bsd.h +++ b/hunt/huntd/bsd.h @@ -1,4 +1,4 @@ -/* $NetBSD: bsd.h,v 1.2 1998/01/09 08:03:40 perry Exp $ */ +/* $NetBSD: bsd.h,v 1.3 2002/09/20 21:00:02 mycroft Exp $ */ /* * Hunt @@ -9,13 +9,7 @@ # if defined(BSD_RELEASE) && BSD_RELEASE >= 43 # define BROADCAST # define SYSLOG_43 -#ifdef __linux__ -#define TALK_42 /* Kludge around broken */ -#else -# define TALK_43 -#endif # endif # if defined(BSD_RELEASE) && BSD_RELEASE == 42 # define SYSLOG_42 -# define TALK_42 # endif diff --git a/hunt/huntd/ctl_transact.c b/hunt/huntd/ctl_transact.c index fe1b9d9..8d30374 100644 --- a/hunt/huntd/ctl_transact.c +++ b/hunt/huntd/ctl_transact.c @@ -1,4 +1,4 @@ -/* $NetBSD: ctl_transact.c,v 1.4 2001/06/12 15:17:12 wiz Exp $ */ +/* $NetBSD: ctl_transact.c,v 1.5 2002/09/20 20:54:16 mycroft Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +14,7 @@ #if 0 static char sccsid[] = "@(#)ctl_transact.c 5.2 (Berkeley) 3/13/86"; #else -__RCSID("$NetBSD: ctl_transact.c,v 1.4 2001/06/12 15:17:12 wiz Exp $"); +__RCSID("$NetBSD: ctl_transact.c,v 1.5 2002/09/20 20:54:16 mycroft Exp $"); #endif #endif /* not lint */ @@ -38,16 +38,15 @@ ctl_transact(target, msg, type, rp) int type; CTL_RESPONSE *rp; { - fd_set read_mask, ctl_mask; + struct pollfd set[1]; int nready, cc, retries; - struct timeval wait; nready = 0; msg.type = type; daemon_addr.sin_addr = target; daemon_addr.sin_port = daemon_port; - FD_ZERO(&ctl_mask); - FD_SET(ctl_sockt, &ctl_mask); + set[0].fd = ctl_sockt; + set[0].events = POLLIN; /* * Keep sending the message until a response of @@ -56,8 +55,6 @@ ctl_transact(target, msg, type, rp) do { /* resend message until a response is obtained */ for (retries = MAX_RETRY; retries > 0; retries -= 1) { - wait.tv_sec = CTL_WAIT; - wait.tv_usec = 0; cc = sendto(ctl_sockt, (char *)&msg, sizeof (msg), 0, (struct sockaddr *)&daemon_addr, sizeof (daemon_addr)); if (cc != sizeof (msg)) { @@ -65,8 +62,7 @@ ctl_transact(target, msg, type, rp) continue; p_error("Error on write to talk daemon"); } - read_mask = ctl_mask; - nready = select(32, &read_mask, 0, 0, &wait); + nready = poll(set, 1, CTL_WAIT * 1000); if (nready < 0) { if (errno == EINTR) continue; @@ -89,10 +85,8 @@ ctl_transact(target, msg, type, rp) continue; p_error("Error on read from talk daemon"); } - read_mask = ctl_mask; /* an immediate poll */ - timerclear(&wait); - nready = select(32, &read_mask, 0, 0, &wait); + nready = poll(set, 1, 0); } while (nready > 0 && ( #ifdef TALK_43 rp->vers != TALK_VERSION || diff --git a/hunt/huntd/driver.c b/hunt/huntd/driver.c index 2548547..75bfe41 100644 --- a/hunt/huntd/driver.c +++ b/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: driver.c,v 1.7 2001/01/09 23:49:54 lukem Exp $ */ +/* $NetBSD: driver.c,v 1.8 2002/09/20 20:54:16 mycroft Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: driver.c,v 1.7 2001/01/09 23:49:54 lukem Exp $"); +__RCSID("$NetBSD: driver.c,v 1.8 2002/09/20 20:54:16 mycroft Exp $"); #endif /* not lint */ # include @@ -45,12 +45,12 @@ u_short stat_port; /* port # of statistics tcp socket */ # endif static void clear_scores __P((void)); -static int havechar __P((PLAYER *)); +static int havechar __P((PLAYER *, int)); static void init __P((void)); int main __P((int, char *[], char *[])); static void makeboots __P((void)); static void send_stats __P((void)); -static void zap __P((PLAYER *, FLAG)); +static void zap __P((PLAYER *, FLAG, int)); /* @@ -63,18 +63,16 @@ main(ac, av, ep) char **av, **ep; { PLAYER *pp; - int had_char; # ifdef INTERNET u_short msg; short port_num, reply; int namelen; SOCKET test; # endif - static fd_set read_fds; static FLAG first = TRUE; static FLAG server = FALSE; - int c; - struct timeval linger; + int c, i; + const int linger = 90 * 1000; First_arg = av[0]; if (ep == NULL || *ep == NULL) @@ -108,9 +106,8 @@ main(ac, av, ep) again: do { - read_fds = Fds_mask; errno = 0; - while (select(Num_fds, &read_fds, NULL, NULL, NULL) < 0) + while (poll(fdset, 3+MAXPL+MAXMON, INFTIM) < 0) { if (errno != EINTR) # ifdef LOG @@ -120,9 +117,8 @@ main(ac, av, ep) # endif errno = 0; } - Have_inp = read_fds; # ifdef INTERNET - if (FD_ISSET(Test_socket, &read_fds)) { + if (fdset[2].revents & POLLIN) { namelen = DAEMON_SIZE; port_num = htons(sock_port); (void) recvfrom(Test_socket, (char *) &msg, sizeof msg, @@ -154,39 +150,34 @@ main(ac, av, ep) } } # endif - for (;;) { - had_char = FALSE; - for (pp = Player; pp < End_player; pp++) - if (havechar(pp)) { + { + for (pp = Player, i = 0; pp < End_player; pp++, i++) + if (havechar(pp, i + 3)) { execute(pp); pp->p_nexec++; - had_char++; } # ifdef MONITOR - for (pp = Monitor; pp < End_monitor; pp++) - if (havechar(pp)) { + for (pp = Monitor, i = 0; pp < End_monitor; pp++, i++) + if (havechar(pp, i + MAXPL + 3)) { mon_execute(pp); pp->p_nexec++; - had_char++; } # endif - if (!had_char) - break; moveshots(); - for (pp = Player; pp < End_player; ) + for (pp = Player, i = 0; pp < End_player; ) if (pp->p_death[0] != '\0') - zap(pp, TRUE); + zap(pp, TRUE, i + 3); else - pp++; + pp++, i++; # ifdef MONITOR - for (pp = Monitor; pp < End_monitor; ) + for (pp = Monitor, i = 0; pp < End_monitor; ) if (pp->p_death[0] != '\0') - zap(pp, FALSE); + zap(pp, FALSE, i + MAXPL + 3); else - pp++; + pp++, i++; # endif } - if (FD_ISSET(Socket, &read_fds)) + if (fdset[0].revents & POLLIN) if (answer()) { # ifdef INTERNET if (first && standard_port) @@ -194,17 +185,17 @@ main(ac, av, ep) # endif first = FALSE; } - if (FD_ISSET(Status, &read_fds)) + if (fdset[1].revents & POLLIN) send_stats(); - for (pp = Player; pp < End_player; pp++) { - if (FD_ISSET(pp->p_fd, &read_fds)) + for (pp = Player, i = 0; pp < End_player; pp++, i++) { + if (fdset[i + 3].revents & POLLIN) sendcom(pp, READY, pp->p_nexec); pp->p_nexec = 0; (void) fflush(pp->p_output); } # ifdef MONITOR - for (pp = Monitor; pp < End_monitor; pp++) { - if (FD_ISSET(pp->p_fd, &read_fds)) + for (pp = Monitor, i = 0; pp < End_monitor; pp++, i++) { + if (fdset[i + MAXPL + 3].revents & POLLIN) sendcom(pp, READY, pp->p_nexec); pp->p_nexec = 0; (void) fflush(pp->p_output); @@ -212,10 +203,7 @@ main(ac, av, ep) # endif } while (Nplayer > 0); - read_fds = Fds_mask; - linger.tv_sec = 90; - linger.tv_usec = 0; - if (select(Num_fds, &read_fds, NULL, NULL, &linger) > 0) { + if (poll(fdset, 3+MAXPL+MAXMON, linger) > 0) { goto again; } if (server) { @@ -230,8 +218,8 @@ main(ac, av, ep) } # ifdef MONITOR - for (pp = Monitor; pp < End_monitor; ) - zap(pp, FALSE); + for (pp = Monitor, i = 0; pp < End_monitor; i++) + zap(pp, FALSE, i + MAXPL + 3); # endif cleanup(0); /* NOTREACHED */ @@ -376,10 +364,10 @@ init() /* * Initialize minimal select mask */ - FD_ZERO(&Fds_mask); - FD_SET(Socket, &Fds_mask); - FD_SET(Status, &Fds_mask); - Num_fds = ((Socket > Status) ? Socket : Status) + 1; + fdset[0].fd = Socket; + fdset[0].events = POLLIN; + fdset[1].fd = Status; + fdset[1].events = POLLIN; # ifdef INTERNET len = sizeof (SOCKET); @@ -408,9 +396,10 @@ init() (void) listen(Test_socket, 5); } - FD_SET(Test_socket, &Fds_mask); - if (Test_socket + 1 > Num_fds) - Num_fds = Test_socket + 1; + fdset[2].fd = Test_socket; + fdset[2].events = POLLIN; +# else + fdset[2].fd = -1; # endif Seed = getpid() + time((time_t *) NULL); @@ -593,11 +582,12 @@ checkdam(ouch, gotcha, credit, amt, shot_type) * Kill off a player and take him out of the game. */ static void -zap(pp, was_player) +zap(pp, was_player, i) PLAYER *pp; FLAG was_player; + int i; { - int i, len; + int n, len; BULLET *bp; PLAYER *np; int x, y; @@ -614,8 +604,8 @@ zap(pp, was_player) x = (WIDTH - len) / 2; cgoto(pp, HEIGHT / 2, x); outstr(pp, pp->p_death, len); - for (i = 1; i < len; i++) - pp->p_death[i] = '-'; + for (n = 1; n < len; n++) + pp->p_death[n] = '-'; pp->p_death[0] = '+'; pp->p_death[len - 1] = '+'; cgoto(pp, HEIGHT / 2 - 1, x); @@ -636,22 +626,22 @@ zap(pp, was_player) bp->b_over = SPACE; } - i = rand_num(pp->p_ammo); + n = rand_num(pp->p_ammo); x = rand_num(pp->p_ammo); - if (x > i) - i = x; + if (x > n) + n = x; if (pp->p_ammo == 0) x = 0; - else if (i == pp->p_ammo - 1) { + else if (n == pp->p_ammo - 1) { x = pp->p_ammo; len = SLIME; } else { for (x = MAXBOMB - 1; x > 0; x--) - if (i >= shot_req[x]) + if (n >= shot_req[x]) break; for (y = MAXSLIME - 1; y > 0; y--) - if (i >= slime_req[y]) + if (n >= slime_req[y]) break; if (y >= 0 && slime_req[y] > shot_req[x]) { x = slime_req[y]; @@ -739,31 +729,34 @@ zap(pp, was_player) End_player--; if (pp != End_player) { memcpy(pp, End_player, sizeof (PLAYER)); + fdset[i] = fdset[End_player - Player + 3]; + fdset[End_player - Player + 3].fd = -1; (void) sprintf(Buf, "%5.2f%c%-10.10s %c", pp->p_ident->i_score, stat_char(pp), pp->p_ident->i_name, pp->p_ident->i_team); - i = STAT_PLAY_ROW + 1 + (pp - Player); + n = STAT_PLAY_ROW + 1 + (pp - Player); for (np = Player; np < End_player; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); outstr(np, Buf, STAT_NAME_LEN); } # ifdef MONITOR for (np = Monitor; np < End_monitor; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); outstr(np, Buf, STAT_NAME_LEN); } # endif - } + } else + fdset[i].fd = -1; /* Erase the last player */ - i = STAT_PLAY_ROW + 1 + Nplayer; + n = STAT_PLAY_ROW + 1 + Nplayer; for (np = Player; np < End_player; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); ce(np); } # ifdef MONITOR for (np = Monitor; np < End_monitor; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); ce(np); } } @@ -775,50 +768,34 @@ zap(pp, was_player) End_monitor--; if (pp != End_monitor) { memcpy(pp, End_monitor, sizeof (PLAYER)); + fdset[i] = fdset[End_monitor - Monitor + MAXPL + 3]; + fdset[End_monitor - Monitor + MAXPL + 3].fd = -1; (void) sprintf(Buf, "%5.5s %-10.10s %c", " ", pp->p_ident->i_name, pp->p_ident->i_team); - i = STAT_MON_ROW + 1 + (pp - Player); + n = STAT_MON_ROW + 1 + (pp - Player); for (np = Player; np < End_player; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); outstr(np, Buf, STAT_NAME_LEN); } for (np = Monitor; np < End_monitor; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); outstr(np, Buf, STAT_NAME_LEN); } - } + } else + fdset[i].fd = -1; /* Erase the last monitor */ - i = STAT_MON_ROW + 1 + (End_monitor - Monitor); + n = STAT_MON_ROW + 1 + (End_monitor - Monitor); for (np = Player; np < End_player; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); ce(np); } for (np = Monitor; np < End_monitor; np++) { - cgoto(np, i, STAT_NAME_COL); + cgoto(np, n, STAT_NAME_COL); ce(np); } - } # endif - - FD_CLR(savefd, &Fds_mask); - if (Num_fds == savefd + 1) { - Num_fds = Socket; -# ifdef INTERNET - if (Test_socket > Socket) - Num_fds = Test_socket; -# endif - for (np = Player; np < End_player; np++) - if (np->p_fd > Num_fds) - Num_fds = np->p_fd; -# ifdef MONITOR - for (np = Monitor; np < End_monitor; np++) - if (np->p_fd > Num_fds) - Num_fds = np->p_fd; -# endif - Num_fds++; - } } /* @@ -839,15 +816,15 @@ rand_num(range) * FALSE. */ static int -havechar(pp) +havechar(pp, i) PLAYER *pp; + int i; { if (pp->p_ncount < pp->p_nchar) return TRUE; - if (!FD_ISSET(pp->p_fd, &Have_inp)) + if (!(fdset[i].revents & POLLIN)) return FALSE; - FD_CLR(pp->p_fd, &Have_inp); check_again: errno = 0; if ((pp->p_nchar = read(pp->p_fd, pp->p_cbuf, sizeof pp->p_cbuf)) <= 0) diff --git a/hunt/huntd/extern.c b/hunt/huntd/extern.c index e25ba83..d11b0ca 100644 --- a/hunt/huntd/extern.c +++ b/hunt/huntd/extern.c @@ -1,4 +1,4 @@ -/* $NetBSD: extern.c,v 1.2 1997/10/10 16:33:24 lukem Exp $ */ +/* $NetBSD: extern.c,v 1.3 2002/09/20 20:54:16 mycroft Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,7 +7,7 @@ #include #ifndef lint -__RCSID("$NetBSD: extern.c,v 1.2 1997/10/10 16:33:24 lukem Exp $"); +__RCSID("$NetBSD: extern.c,v 1.3 2002/09/20 20:54:16 mycroft Exp $"); #endif /* not lint */ # include "hunt.h" @@ -20,10 +20,8 @@ char Buf[BUFSIZ]; /* general scribbling buffer */ char Maze[HEIGHT][WIDTH2]; /* the maze */ char Orig_maze[HEIGHT][WIDTH2]; /* the original maze */ -fd_set Fds_mask; /* mask for the file descriptors */ -fd_set Have_inp; /* which file descriptors have input */ +struct pollfd fdset[3+MAXPL+MAXMON]; int Nplayer = 0; /* number of players */ -int Num_fds; /* number of maximum file descriptor */ int Socket; /* main socket */ int Status; /* stat socket */ int See_over[NASCII]; /* lookup table for determining whether diff --git a/hunt/huntd/faketalk.c b/hunt/huntd/faketalk.c index f681c71..42b8123 100644 --- a/hunt/huntd/faketalk.c +++ b/hunt/huntd/faketalk.c @@ -1,4 +1,4 @@ -/* $NetBSD: faketalk.c,v 1.6 2001/02/05 00:42:14 christos Exp $ */ +/* $NetBSD: faketalk.c,v 1.7 2002/09/20 20:54:16 mycroft Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -11,10 +11,11 @@ #include #ifndef lint -__RCSID("$NetBSD: faketalk.c,v 1.6 2001/02/05 00:42:14 christos Exp $"); +__RCSID("$NetBSD: faketalk.c,v 1.7 2002/09/20 20:54:16 mycroft Exp $"); #endif /* not lint */ #include "bsd.h" +#include "hunt.h" #if defined(TALK_43) || defined(TALK_42) @@ -26,7 +27,6 @@ __RCSID("$NetBSD: faketalk.c,v 1.6 2001/02/05 00:42:14 christos Exp $"); # include # include # include -# include "hunt.h" # include "talk_ctl.h" # define TRUE 1 @@ -223,6 +223,7 @@ do_announce(s) p_error("send delete remote"); } #else +void faketalk() { return; diff --git a/hunt/huntd/hunt.h b/hunt/huntd/hunt.h index e272c31..77a4cf8 100644 --- a/hunt/huntd/hunt.h +++ b/hunt/huntd/hunt.h @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.h,v 1.6 2000/01/21 17:08:34 mycroft Exp $ */ +/* $NetBSD: hunt.h,v 1.7 2002/09/20 20:54:17 mycroft Exp $ */ /* * Hunt @@ -21,7 +21,7 @@ # endif # include # include -# include +# include # ifdef INTERNET # include # include @@ -82,6 +82,7 @@ # define MAXMON 1 # else # define MAXPL 17 +# define MAXMON 0 # endif # define SHORTLEN 2 /* sizeof (network short) */ # define LONGLEN 4 /* sizeof (network long) */ @@ -348,8 +349,8 @@ extern char Buf[BUFSIZ], Maze[HEIGHT][WIDTH2], Orig_maze[HEIGHT][WIDTH2]; extern char *Sock_name; extern const char *Driver; -extern int Nplayer, Num_fds, Socket, Status; -extern fd_set Fds_mask, Have_inp; +extern int Nplayer, Socket, Status; +extern struct pollfd fdset[]; # ifdef INTERNET extern u_short Test_port; diff --git a/hunt/huntd/huntd.6.in b/hunt/huntd/huntd.6.in index 345a097..a6eb8f2 100644 --- a/hunt/huntd/huntd.6.in +++ b/hunt/huntd/huntd.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: huntd.6,v 1.4 2001/04/04 11:41:01 wiz Exp $ +.\" $NetBSD: huntd.6,v 1.6 2002/09/26 18:32:02 wiz Exp $ .\" .\" Hunt .\" Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -38,17 +38,16 @@ option is for running forever (server mode). This is similar to running it under the control of .Xr inetd 8 -(see below), -but it consumes a process table entry when no one is playing. +(see below), but it consumes a process table entry when no one is playing. .Pp The .Fl p -option changes the udp port number used to rendezvous with the player +option changes the UDP port number used to rendezvous with the player process and thus allows for private games of hunt. This option turns off the notification of players on the .Em hunt-players mailing list. -.Sh INETD +.Ss INETD To run .Nm from @@ -67,7 +66,7 @@ add the following line to .Bd -literal -offset indent -compact hunt dgram udp wait nobody @sbindir@/huntd huntd .Ed -Do not use any of the command line options \(em if you want +Do not use any of the command line options; if you want .Xr inetd 8 to start up .Nm @@ -91,7 +90,7 @@ Otherwise, the .Nm hunt process starts up a .Nm -on the local machine and trys to rendezvous with it. +on the local machine and tries to rendezvous with it. .Sh SEE ALSO .Xr talk 1 , .Xr hunt 6 , @@ -100,4 +99,3 @@ on the local machine and trys to rendezvous with it. Conrad Huang, Ken Arnold, and Greg Couch; .br University of California, San Francisco, Computer Graphics Lab -.\"Sh BUGS diff --git a/hunt/huntd/terminal.c b/hunt/huntd/terminal.c index 8766687..8db22e6 100644 --- a/hunt/huntd/terminal.c +++ b/hunt/huntd/terminal.c @@ -1,4 +1,4 @@ -/* $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $ */ +/* $NetBSD: terminal.c,v 1.3 2002/05/26 00:12:13 wiz Exp $ */ /* * Hunt * Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold @@ -7,16 +7,12 @@ #include #ifndef lint -__RCSID("$NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $"); +__RCSID("$NetBSD: terminal.c,v 1.3 2002/05/26 00:12:13 wiz Exp $"); #endif /* not lint */ -#if __STDC__ #include -#else -#include -#endif -# include "hunt.h" -# define TERM_WIDTH 80 /* Assume terminals are 80-char wide */ +#include "hunt.h" +#define TERM_WIDTH 80 /* Assume terminals are 80-char wide */ /* * cgoto: @@ -110,22 +106,12 @@ ref(pp) * Send a command to the given user */ void -#if __STDC__ sendcom(PLAYER *pp, int command, ...) -#else -sendcom(pp, command, va_alist) - PLAYER *pp; - int command; - va_dcl -#endif { va_list ap; int arg1, arg2; -#if __STDC__ + va_start(ap, command); -#else - va_start(ap); -#endif (void) putc(command, pp->p_output); switch (command & 0377) { case MOVE: diff --git a/include/string.h b/include/string.h new file mode 100644 index 0000000..6842080 --- /dev/null +++ b/include/string.h @@ -0,0 +1,39 @@ +/* string.h - bsd-games wrapper for . + * + * Copyright (c) 2003 Joseph Samuel Myers. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + */ + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +#pragma GCC system_header +#endif + +#include +#include_next + +#ifndef HAVE_strlcpy +extern size_t strlcpy(char *dst, const char *src, size_t siz); +#endif diff --git a/include/sys/poll.h b/include/sys/poll.h new file mode 100644 index 0000000..567dfe2 --- /dev/null +++ b/include/sys/poll.h @@ -0,0 +1,38 @@ +/* poll.h - bsd-games wrapper for . + * + * Copyright (c) 2003 Joseph Samuel Myers. + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + */ + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +#pragma GCC system_header +#endif + +#include_next + +#ifndef INFTIM +#define INFTIM -1 +#endif diff --git a/lib/strlcpy.c b/lib/strlcpy.c new file mode 100644 index 0000000..0d293cc --- /dev/null +++ b/lib/strlcpy.c @@ -0,0 +1,70 @@ +/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ + +/* + * Copyright (c) 1998 Todd C. Miller + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +#ifndef HAVE_strlcpy +/* + * Copy src to string dst of size siz. At most siz-1 characters + * will be copied. Always NUL terminates (unless siz == 0). + * Returns strlen(src); if retval >= siz, truncation occurred. + */ +size_t strlcpy(dst, src, siz) + char *dst; + const char *src; + size_t siz; +{ + register char *d = dst; + register const char *s = src; + register size_t n = siz; + + /* Copy as many bytes as will fit */ + if (n != 0 && --n != 0) { + do { + if ((*d++ = *s++) == 0) + break; + } while (--n != 0); + } + + /* Not enough room in dst, add NUL and traverse rest of src */ + if (n == 0) { + if (siz != 0) + *d = '\0'; /* NUL-terminate dst */ + while (*s++) + ; + } + + return(s - src - 1); /* count does not include NUL */ +} +#endif diff --git a/mille/mille.6 b/mille/mille.6 index 0fb7ac7..b2f5c0e 100644 --- a/mille/mille.6 +++ b/mille/mille.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: mille.6,v 1.6 1997/10/12 00:54:03 lukem Exp $ +.\" $NetBSD: mille.6,v 1.8 2002/09/26 16:12:41 wiz Exp $ .\" .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. @@ -57,12 +57,14 @@ This card is placed in the `P' slot in your hand. .IP D Discard a card from your hand. To indicate which card, type the number of the card in the hand -(or \*(lqP\*(rq for the just-picked card) followed by a or . -The is required to allow recovery from typos +(or \*(lqP\*(rq for the just-picked card) followed +by a \*[Lt]RETURN\*[Gt] or \*[Lt]SPACE\*[Gt]. +The \*[Lt]RETURN or \*[Lt]SPACE\*[Gt] is required to allow recovery from typos which can be very expensive, like discarding safeties. .IP U Use a card. -The card is again indicated by its number, followed by a or . +The card is again indicated by its number, +followed by a \*[Lt]RETURN\*[Gt] or \*[Lt]SPACE\*[Gt]. .IP O Toggle ordering the hand. By default off, if turned on it will sort the cards in your hand appropriately. @@ -70,14 +72,14 @@ This is not recommended for the impatient on slow terminals. .IP Q Quit the game. This will ask for confirmation, just to be sure. -Hitting (or ) is equivalent. +Hitting \*[Lt]DELETE\*[Gt] (or \*[Lt]RUBOUT\*[Gt]) is equivalent. .IP S Save the game in a file. If the game was started from a file, you will be given an opportunity to save it on the same file. If you don't wish to, or you did not start from a file, you will be asked for the file name. -If you type a without a name, +If you type a \*[Lt]RETURN\*[Gt] without a name, the save will be terminated and the game resumed. .IP R Redraw the screen from scratch. @@ -193,9 +195,11 @@ All the Hazard and Remedy Cards are played here, except the .I "Speed Limit" and .I "End of Limit" -cards. Only the top card is displayed, as it is the only effective one. +cards. +Only the top card is displayed, as it is the only effective one. .BR SPEED : -The Speed pile. The +The Speed pile. +The .I "Speed Limit" and .I "End of Limit" @@ -209,8 +213,9 @@ The total of the numbers shown here is the distance traveled so far. The first pick alternates between the two players. Each turn usually starts with a pick from the deck. The player then plays a card, or if this is not possible or desirable, -discards one. Normally, a play or discard of a single card -constitutes a turn. If the card played is a safety, however, +discards one. +Normally, a play or discard of a single card constitutes a turn. +If the card played is a safety, however, the same player takes another turn immediately. .PP This repeats until one of the players reaches 700 points or the deck runs out. @@ -252,7 +257,8 @@ played by your opponent. .RB "\ \ \ \ " "Out of Gas" is played on your opponent's .I Go -card. They must then play a +card. +They must then play a .I Gasoline card, and then a .I Go @@ -261,7 +267,8 @@ card before they can play any more mileage. .RB "\ \ \ \ " "Flat Tire" is played on your opponent's .I Go -card. They must then play a +card. +They must then play a .I "Spare Tire" card, and then a .I Go @@ -271,7 +278,8 @@ card before they can play any more mileage. .RB "\ \ \ \ " "Accident" is played on your opponent's .I Go -card. They must then play a +card. +They must then play a .I Repairs card, and then a .I Go @@ -289,7 +297,8 @@ prevents your opponent from playing both .I Stop and .I "Speed Limit" -cards on you. It also acts as a permanent +cards on you. +It also acts as a permanent .I Go card for the rest of the hand, so you can play mileage as long as there is not a Hazard card on top of your Battle pile. @@ -334,9 +343,10 @@ If an opponent plays a Hazard card, and you have the corresponding Safety in your hand, you play it immediately, even .I before -you draw. This immediately removes the Hazard card from your Battle pile, -and protects you from that card for the rest of the game. This -gives you more points (see \*(lqScoring\*(rq below). +you draw. +This immediately removes the Hazard card from your Battle pile, +and protects you from that card for the rest of the game. +This gives you more points (see \*(lqScoring\*(rq below). .PP .BR Scoring : Scores are totaled at the end of each hand, diff --git a/mille/misc.c b/mille/misc.c index 48f25cb..11e47eb 100644 --- a/mille/misc.c +++ b/mille/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.9 2000/04/27 00:33:49 jdc Exp $ */ +/* $NetBSD: misc.c,v 1.10 2002/05/26 00:12:13 wiz Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,18 +38,14 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: misc.c,v 1.9 2000/04/27 00:33:49 jdc Exp $"); +__RCSID("$NetBSD: misc.c,v 1.10 2002/05/26 00:12:13 wiz Exp $"); #endif #endif /* not lint */ #include #include -#if __STDC__ -#include -#else -#include -#endif +#include #include "mille.h" #ifndef unctrl @@ -64,21 +60,11 @@ __RCSID("$NetBSD: misc.c,v 1.9 2000/04/27 00:33:49 jdc Exp $"); #define NUMSAFE 4 bool -#if __STDC__ error(const char *str, ...) -#else -error(str, va_alist) - const char *str; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, str); -#else - va_start(ap); -#endif wmove(Score, ERR_Y, ERR_X); vwprintw(Score, str, ap); wclrtoeol(Score); diff --git a/monop/Makefile.bsd b/monop/Makefile.bsd index c6ed0e9..795a1da 100644 --- a/monop/Makefile.bsd +++ b/monop/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.21 2001/06/06 17:31:28 lukem Exp $ +# $NetBSD: Makefile,v 1.22 2002/03/05 21:30:41 thorpej Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 .include @@ -20,6 +20,6 @@ initdeck: initdeck.c ${HOST_LINK.c} -o initdeck ${.CURDIR}/initdeck.c cards.pck: initdeck - ${.OBJDIR}/initdeck ${.CURDIR}/cards.inp + ./initdeck ${.CURDIR}/cards.inp .include diff --git a/monop/cards.c b/monop/cards.c index 8430aff..b8372f5 100644 --- a/monop/cards.c +++ b/monop/cards.c @@ -1,4 +1,4 @@ -/* $NetBSD: cards.c,v 1.11 1999/12/30 01:40:08 simonb Exp $ */ +/* $NetBSD: cards.c,v 1.12 2002/08/12 02:38:13 itojun Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: cards.c,v 1.11 1999/12/30 01:40:08 simonb Exp $"); +__RCSID("$NetBSD: cards.c,v 1.12 2002/08/12 02:38:13 itojun Exp $"); #endif #endif /* not lint */ @@ -101,7 +101,7 @@ set_up(dp) int r1, r2; int i; - dp->offsets = (u_int64_t *) calloc(sizeof (u_int64_t), dp->num_cards); + dp->offsets = (u_int64_t *) calloc(dp->num_cards, sizeof (u_int64_t)); if (dp->offsets == NULL) err(1, NULL); if (fread(dp->offsets, sizeof(u_int64_t), dp->num_cards, deckf) != diff --git a/monop/getinp.c b/monop/getinp.c index 6645744..0c4cf32 100644 --- a/monop/getinp.c +++ b/monop/getinp.c @@ -1,4 +1,4 @@ -/* $NetBSD: getinp.c,v 1.9 2000/07/10 10:19:26 itojun Exp $ */ +/* $NetBSD: getinp.c,v 1.10 2003/01/06 13:04:55 wiz Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getinp.c,v 1.9 2000/07/10 10:19:26 itojun Exp $"); +__RCSID("$NetBSD: getinp.c,v 1.10 2003/01/06 13:04:55 wiz Exp $"); #endif #endif /* not lint */ @@ -66,7 +66,7 @@ getinp(prompt, list) printf("%s", prompt); for (sp = buf; (c=getchar()) != '\n'; ) { *sp = c; - if (c == -1) /* check for interupted system call */ + if (c == -1) /* check for interrupted system call */ goto inter; else if (sp != buf || *sp != ' ') sp++; diff --git a/monop/monop.6.in b/monop/monop.6.in index 57bec5f..d44b542 100644 --- a/monop/monop.6.in +++ b/monop/monop.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: monop.6,v 1.10 2001/04/02 22:42:38 wiz Exp $ +.\" $NetBSD: monop.6,v 1.13 2002/09/26 18:32:03 wiz Exp $ .\" .\" Copyright (c) 1980 The Regents of the University of California. .\" All rights reserved. @@ -40,7 +40,7 @@ .Nm monop .Nd Monopoly game .Sh SYNOPSIS -.Nm @gamesdir@/monop +.Nm .Op Ar file .Sh DESCRIPTION .Nm @@ -53,8 +53,7 @@ no auction is held and the property remains unowned. .Nm The game, in effect, lends the player money, so it is possible to buy something which you cannot afford. -However, as soon as a person goes into debt, -he must +However, as soon as a person goes into debt, he must .Dq fix the problem , .Em i.e. , make himself solvent, before play can continue. @@ -73,7 +72,8 @@ It is not possible to input a negative number, nor is it ever necessary. .Em A Summary of Commands : .Bl -tag -width item .It Ic quit -quit game: This allows you to quit the game. It asks you if you're sure. +quit game: This allows you to quit the game. +It asks you if you're sure. .It Ic print print board: This prints out the current board. The columns have the following meanings (column headings are the same for the @@ -101,11 +101,14 @@ If the property is a Utility or Railroad, this is the number of such owned by the owner. If the property is land, this is the number of houses on it. .It Rent -Current rent on the property. If it is not owned, there is no rent. +Current rent on the property. +If it is not owned, there is no rent. .El .It Ic where where players are: Tells you where all the players are. -A `*' indicates the current player. +A +.Sq * +indicates the current player. .It Ic own holdings List your own holdings, .Em i.e. , @@ -170,12 +173,13 @@ Read in a previously saved game from a file. It leaves the file intact. .It Ic roll Roll the dice and move forward to your new location. -If you simply hit the key instead of a command, -it is the same as typing +If you simply hit the +.Aq RETURN +key instead of a command, it is the same as typing .Ic roll . .El .Sh AUTHOR -Ken Arnold +.An Ken Arnold .Sh FILES .Bl -tag -width @monop_cardsfile@ -compact .It Pa @monop_cardsfile@ diff --git a/monop/roll.c b/monop/roll.c index b8210d4..75578ee 100644 --- a/monop/roll.c +++ b/monop/roll.c @@ -1,4 +1,4 @@ -/* $NetBSD: roll.c,v 1.7 1999/08/21 10:40:04 simonb Exp $ */ +/* $NetBSD: roll.c,v 1.8 2002/06/02 22:17:37 wiz Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: roll.c,v 1.7 1999/08/21 10:40:04 simonb Exp $"); +__RCSID("$NetBSD: roll.c,v 1.8 2002/06/02 22:17:37 wiz Exp $"); #endif #endif /* not lint */ @@ -49,8 +49,6 @@ __RCSID("$NetBSD: roll.c,v 1.7 1999/08/21 10:40:04 simonb Exp $"); * This routine rolls ndie nside-sided dice. */ -#define reg register - #if defined(pdp11) #define MAXRAND 32767L diff --git a/morse/Makefile.bsd b/morse/Makefile.bsd index 8a4e320..390a224 100644 --- a/morse/Makefile.bsd +++ b/morse/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.5 2001/12/12 00:07:48 tv Exp $ +# $NetBSD: Makefile,v 1.6 2002/09/18 06:16:40 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 -PROG= morse NOMAN= # defined + +PROG= morse HIDEGAME= hidegame .include diff --git a/phantasia/Makefile.bsd b/phantasia/Makefile.bsd index e0e5f86..60f513f 100644 --- a/phantasia/Makefile.bsd +++ b/phantasia/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.25 2001/12/19 06:18:25 gmcgarry Exp $ +# $NetBSD: Makefile,v 1.26 2002/03/05 21:31:23 thorpej Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 .include @@ -31,7 +31,7 @@ CLEANFILES+=map setup setup.lo host_phantglobs.lo ${ALLFILES} realall: ${FILES} ${FILES}: setup - ${.OBJDIR}/setup -m ${.CURDIR}/monsters.asc + ./setup -m ${.CURDIR}/monsters.asc setup: host_phantglobs.lo setup.lo monsters.asc ${LIBM} ${HOST_LINK.c} host_phantglobs.lo setup.lo -o ${.TARGET} -lm diff --git a/phantasia/misc.c b/phantasia/misc.c index 5be73cc..edf64cf 100644 --- a/phantasia/misc.c +++ b/phantasia/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.7 2000/04/27 00:30:53 jdc Exp $ */ +/* $NetBSD: misc.c,v 1.8 2003/01/20 05:29:55 simonb Exp $ */ /* * misc.c Phantasia miscellaneous support routines @@ -790,7 +790,7 @@ adjuststats() /* calculate effective quickness */ dtemp = ((Player.p_gold + Player.p_gems / 2.0) - 1000.0) / Statptr->c_goldtote - - Player.p_level;; + - Player.p_level; dtemp = MAX(0.0, dtemp);/* gold slows player down */ Player.p_speed = Player.p_quickness + Player.p_quksilver - dtemp; diff --git a/phantasia/phantasia.6 b/phantasia/phantasia.6 index b4139f6..c79ca17 100644 --- a/phantasia/phantasia.6 +++ b/phantasia/phantasia.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: phantasia.6,v 1.4 2001/04/02 22:41:43 wiz Exp $ +.\" $NetBSD: phantasia.6,v 1.9 2002/09/26 18:32:03 wiz Exp $ .\" .Dd April 1, 2001 .Dt PHANTASIA 6 @@ -11,9 +11,8 @@ .Op Fl abHmpSsx .Sh DESCRIPTION .Nm -is a role playing game -which allows players to roll up characters of various types to fight -monsters and other players. +is a role playing game which allows players to roll up characters of +various types to fight monsters and other players. Progression of characters is based upon gaining experience from fighting monsters (and other players). .Pp @@ -48,20 +47,23 @@ Examine/change a particular character on file. .El .Pp The characters are saved on a common file, in order to make the game -interactive between players. The characters are given a password -in order to retrieve them later. Only characters above +interactive between players. +The characters are given a password in order to retrieve them later. +Only characters above .Em level -zero are saved. Characters unused for awhile will be purged. +zero are saved. +Characters unused for awhile will be purged. Characters are only placed on the scoreboard when they die. .Sh AUTHOR -Edward Estes, AT&T Information Systems, Skokie, IL +.An Edward Estes , +AT\*[Am]T Information Systems, Skokie, IL .Sh PARTICULARS -.Ss "Normal Play" +.Ss Normal Play A number of the player's more important statistics are almost always displayed on the screen, with maximums (where applicable) in parentheses. .Pp -The character is placed randomly near the center of a cartesian +The character is placed randomly near the center of a Cartesian system. Most commands are selected with a single letter or digit. For example, one may move by hitting 'W', 'S', 'N', or 'E', @@ -71,7 +73,8 @@ for movement, similar to .Xr vi 1 . To move to a specific (x, y) coordinate, use the .Ic move -('1') command. The distance a character can move is calculated by +('1') command. +The distance a character can move is calculated by 1 plus 1.5 per .Em level . Moving in a compass direction will move the player the maximum @@ -79,19 +82,25 @@ allowed distance in that direction. .Pp A player may see who else is playing by using the .Ic players -('2') option. One may see the coordinates of those who are the same +('2') option. +One may see the coordinates of those who are the same distance or closer to the origin as he/she. .Em Kings , and .Em council of the wise -can see and can be seen by everyone. A +can see and can be seen by everyone. +A .Em palantir removes these restrictions. .Pp One can talk to other players with the .Ic talk -('3') option. In general, this is a line or so of text. To remove a current -message, just type when prompted for a message. +('3') option. +In general, this is a line or so of text. +To remove a current +message, just type +.Aq return +when prompted for a message. .Pp The .Ic stats @@ -101,7 +110,8 @@ One may leave the game either with the .Ic quit ('5') option. .Pp -One may rest by default. Resting lets one regain maximum +One may rest by default. +Resting lets one regain maximum .Em energy level , and also lets one find .Em mana @@ -118,16 +128,17 @@ Several other options become available as the player progresses in .Em level and .Em magic , -or to other stations in the game ( -.Em valar , +or to other stations in the game +.Em ( valar , .Em council of the wise , .Em king ) . These are described elsewhere. In general, a control-L will force the redrawing of the screen. .Pp Other things which may happen are more or less self-explanatory. -.Ss "Fighting Monsters" -A player has several options while fighting monsters. They are as follows: +.Ss Fighting Monsters +A player has several options while fighting monsters. +They are as follows: .Bl -tag -width skirmish -offset indent .It Ic melee Inflicts damage on the monster, based upon @@ -142,8 +153,8 @@ but decreases the monster's .Em quickness instead. .It Ic evade -Attempt to run away. Success is based upon both the player's and -the monster's +Attempt to run away. +Success is based upon both the player's and the monster's .Em brains and .Em quickness . @@ -160,21 +171,20 @@ an amount proportional to the amount granted. This also increases the monster's quickness. Paralyzed monsters wake up very fast when nicked. .It Ic luckout -This is essentially a battle of wits with the monster. Success is based -upon the player's and the monster's +This is essentially a battle of wits with the monster. +Success is based upon the player's and the monster's .Em brains . The player gets credit for slaying the monster if he/she succeeds. Otherwise, nothing happens, and the chance to .Ic luckout is lost. .El -.Ss "Character Statistics" +.Ss Character Statistics .Bl -tag -width quickness -offset indent .It Em strength determines how much damage a character can inflict. .It Em quickness -determines how many chances a character gets to make decisions while -fighting. +determines how many chances a character gets to make decisions while fighting. .It Em energy level specifies how much damage a character may endure before dying. .It Em magic level @@ -206,22 +216,25 @@ As .Em age increases, many personal statistics degenerate. .El -.Ss "Character Types" +.Ss Character Types Character statistics are rolled randomly from the above list, according -to character type. The types are as follows: +to character type. +The types are as follows: .Bl -tag -width "experimento" -offset indent .It Em magic user strong in .Em magic level and .Em brains , -weak in other areas. Must rely on wits and magic to survive. +weak in other areas. +Must rely on wits and magic to survive. .It Em fighter good in .Em strength and .Em energy level , -fairly good in other areas. This adds up to a well-equipped fighter. +fairly good in other areas. +This adds up to a well-equipped fighter. .It Em elf very high .Em quickness @@ -246,7 +259,8 @@ and Born with some .Em experience . .It Em experimento -very mediocre in all areas. However, the +very mediocre in all areas. +However, the .Em experimento may be placed almost anywhere within the playing grid. .El @@ -303,9 +317,10 @@ carry, how long until can overcome the player, and how much .Em poison the player can withstand. -.Ss "Spells" +.Ss Spells During the course of the game, the player may exercise his/her -magic powers. These cases are described below. +magic powers. +These cases are described below. .Bl -tag -width "all or nothing" -offset indent .It Ic cloak .Em magic level necessary : @@ -314,16 +329,18 @@ magic powers. These cases are described below. .Em mana used : 35 plus 3 per rest period .br -Used during normal play. Prevents monsters from finding the character, -as well as hiding the player from other players. His/her coordinates -show up as '?' in the +Used during normal play. +Prevents monsters from finding the character, +as well as hiding the player from other players. +His/her coordinates show up as '?' in the .Ic players -option. Players cannot collect +option. +Players cannot collect .Em mana , find trading posts, or discover the .Em grail -while cloaked. Calling a monster uncloaks, as well as choosing -this option while cloaked. +while cloaked. +Calling a monster uncloaks, as well as choosing this option while cloaked. .It Ic teleport .Em magic level necessary : 40 (plus level 12) @@ -331,11 +348,11 @@ this option while cloaked. .Em mana used : 30 per 75 moved .br -Used during normal play. Allows the player to move with much more freedom -than with the +Used during normal play. +Allows the player to move with much more freedom than with the .Ic move -option, at the price of expending mana. The maximum distance possible -to move is based upon +option, at the price of expending mana. +The maximum distance possible to move is based upon .Em level and .Em magic level . @@ -347,7 +364,8 @@ none 5 times .Em level .br -Used during inter-terminal battle. Damage is based upon +Used during inter-terminal battle. +Damage is based upon .Em magic level and .Em strength . @@ -360,9 +378,9 @@ none 1 .br Used while combating monsters. -Has a 25% chance of working. If it works it hits the monster just enough -to kill it. If it fails, it doesn't hit the monster, and doubles the -monster's +Has a 25% chance of working. +If it works it hits the monster just enough to kill it. +If it fails, it doesn't hit the monster, and doubles the monster's .Em quickness and .Em strength . @@ -374,7 +392,8 @@ Paralyzed monsters wake up much quicker as a result of this spell. .Em mana used : variable .br -Used while combating monsters. Hits the monster based upon the amount +Used while combating monsters. +Hits the monster based upon the amount of .Em mana expended and @@ -388,10 +407,11 @@ Guaranteed to hit at least 10 per .Em mana used : 30 .br -Used during monster combat. Throws up a shield to protect from damage. +Used during monster combat. +Throws up a shield to protect from damage. The shield is added to actual energy level, and is a fixed number, based -upon maximum energy. Normally, damage occurs first to the shield, and -then to the players actual +upon maximum energy. +Normally, damage occurs first to the shield, and then to the players actual .Em energy level . .It Ic transform .Em magic level necessary : @@ -400,8 +420,9 @@ then to the players actual .Em mana used : 50 .br -Used during monster combat. Transforms the monster randomly into one -of the 100 monsters from the monster file. +Used during monster combat. +Transforms the monster randomly into one of the 100 monsters from +the monster file. .It Ic increase might .Em magic level necessary : 35 @@ -409,7 +430,8 @@ of the 100 monsters from the monster file. .Em mana used : 75 .br -Used during combat with monsters. Increases strength up to a maximum. +Used during combat with monsters. +Increases strength up to a maximum. .It Ic invisibility .Em magic level necessary : 45 @@ -417,8 +439,8 @@ Used during combat with monsters. Increases strength up to a maximum. .Em mana used : 90 .br -Used while fighting monsters. Makes it harder for the monster to hit, -by temporarily increasing the player's +Used while fighting monsters. +Makes it harder for the monster to hit, by temporarily increasing the player's .Em quickness . This spell may be thrown several times, but a maximum level will be reached. .It Ic transport @@ -428,15 +450,16 @@ This spell may be thrown several times, but a maximum level will be reached. .Em mana used : 125 .br -Used during monster combat. Transports the monster away from the -player. Success is base upon player's +Used during monster combat. +Transports the monster away from the player. +Success is based upon player's .Em magic and .Em brains , and the monster's .Em experience . -If it fails the player is transported instead. 60% of the time, the monster -will drop any treasure it was carrying. +If it fails the player is transported instead. +60% of the time, the monster will drop any treasure it was carrying. .It Ic paralyze .Em magic level necessary : 75 @@ -448,8 +471,9 @@ Used during monster combat. .Dq Freezes the monster by putting its .Em quickness -slightly negative. The monster will slowly wake up. Success is based -upon player's +slightly negative. +The monster will slowly wake up. +Success is based upon player's .Em magic and the monster's .Em experience . @@ -467,9 +491,10 @@ or .Em council of the wise . Allows the player to pick which monster to fight. .El -.Ss "Monsters" -Monsters get bigger as one moves farther from the origin (0,0). Rings of -distance 125 from the origin determine the size. A monster's +.Ss Monsters +Monsters get bigger as one moves farther from the origin (0,0). +Rings of distance 125 from the origin determine the size. +A monster's .Em experience , .Em energy level , and @@ -480,11 +505,12 @@ is increased 50% per size over one, and .Em quickness remains the same, regardless of size. .Pp -Also, nastier monsters are found as one progress farther out -from the origin. Monsters also may flock. The percent chance of that -happening is designated as +Also, nastier monsters are found as one progress farther out from the origin. +Monsters also may flock. +The percent chance of that happening is designated as .Em flock% -in the monster listing. Monsters outside the first ring +in the monster listing. +Monsters outside the first ring may carry treasure, as determined by their treasure type. Flocking monsters, and bigger monsters increase the chances of treasure. .Pp @@ -496,17 +522,18 @@ can only be subdued if the player is in possession of a .It Em Modnar has random characteristics, including treasure type. .It Em Mimic -will pick another name from the list of monsters in order to -confuse. +will pick another name from the list of monsters in order to confuse. .It Em Dark Lord -very nasty person. Does not like to be hit (especially nicked), +very nasty person. +Does not like to be hit (especially nicked), and many spells do not work well (or at all) against him. One can always .Em evade from the .Em Dark Lord . .It Em Leanan-Sidhe -also a very nasty person. She will permanently sap +also a very nasty person. +She will permanently sap .Em strength from someone. .It Em Saruman @@ -516,8 +543,7 @@ who can steal a .Em palantir . Also, .Em Saruman -may turn a player's gems into gold pieces, -or scramble her/his stats. +may turn a player's gems into gold pieces, or scramble her/his stats. .It Em Thaumaturgist can transport a player. .It Em Balrog @@ -571,10 +597,10 @@ This subtracts from instead of any shield the player may have thrown up. This is a very easy way to die. .It Em Cerberus -loves metal and will steal all the metal treasures from -a player if able. +loves metal and will steal all the metal treasures from a player if able. .It Em Ungoliant -can bite and poison. This inflicts five +can bite and poison. +This inflicts five .Em poisons , and also takes one from the player's .Em quickness . @@ -592,9 +618,10 @@ and .Em ex-valar . Fights with .Em Morgoth -end when either he or the player dies. His characteristics -are calculated based upon the player's. The player is given -the chance to ally with him. No magic, except +end when either he or the player dies. +His characteristics are calculated based upon the player's. +The player is given the chance to ally with him. +No magic, except .Ic force field works when battling .Em Morgoth . @@ -607,7 +634,7 @@ while in battle. .It Em Wraith may make a player blind. .El -.Ss "Treasures" +.Ss Treasures The various treasure types are as follows: .Bl -tag -width "type twelve/thirteen" .It Type zero @@ -672,8 +699,8 @@ and .Pp All the scrolls except .Em general knowledge -automatically call a monster. These preserve any -spells that were already in effect, but are only in +automatically call a monster. +These preserve any spells that were already in effect, but are only in effect while in battle. .It Type five .Em dagger @@ -782,11 +809,14 @@ or .Em gems . These are used at .Em trading posts -to buy things. A +to buy things. +A .Em gem -is worth 1000 gold pieces. Too much +is worth 1000 gold pieces. +Too much .Em gold -will slow a player down. One may carry 1000 plus 200 per +will slow a player down. +One may carry 1000 plus 200 per .Em level of .Em gold . @@ -802,7 +832,7 @@ A cursed treasure knocks .Em energy level very low, and adds 0.25 .Em poison . -.Ss "Rings" +.Ss Rings .Em Rings are only carried by .Em nazguls @@ -851,12 +881,13 @@ It is usually not a good idea to pick one up. The only way to get rid of a .Em ring is to have a monster steal it. -.Ss "King" +.Ss King A player may become .Em king by finding a .Em crown -and going to (0,0). Players must have a +and going to (0,0). +Players must have a .Em level in the range of 10 to 1000 to be able to find a .Em crown . @@ -870,23 +901,26 @@ are converted to .Em gold . .Pp Once a player is king, he/she may do certain things while in -the Lord's Chamber (0,0). These are exercised with the +the Lord's Chamber (0,0). +These are exercised with the .Ic decree ('0') option. .Bl -tag -width "collect taxes" .It Ic transport -This is done to another player. It randomly moves the affected -player about. A +This is done to another player. +It randomly moves the affected player about. +A .Em charm protects from transports. .It Ic curse -This is done to another player. It is analogous to cursed treasure, -but worse. It inflicts two +This is done to another player. +It is analogous to cursed treasure, but worse. +It inflicts two .Em poison , knocks .Em energy level -very low, and degrades the maximum energy. It also -removes a +very low, and degrades the maximum energy. +It also removes a .Em cloak . A .Em blessing @@ -900,12 +934,11 @@ and .Em gold . The energy void disappears after being hit. .It Ic bestow -This is also done to another player. The king may -wish to reward one or more loyal subjects by sharing his/her +This is also done to another player. +The king may wish to reward one or more loyal subjects by sharing his/her riches .Em ( gold ) . -Or it is a convenient way to dispose of some unwanted -deadweight. +Or it is a convenient way to dispose of some unwanted deadweight. .It Ic collect taxes Everyone pays 7% tax on all .Em gold @@ -921,10 +954,11 @@ The may also .Ic teleport anywhere for free by using the origin as a starting place. -.Ss "Council of the Wise, Valar" +.Ss Council of the Wise, Valar A player automatically becomes a member of the .Em council of the wise -upon reaching level 3000. Members of the council cannot have +upon reaching level 3000. +Members of the council cannot have .Em rings . Members of the council have a few extra options which they can exercise. These are exercised with the @@ -937,7 +971,8 @@ One .Ic intervene option is to .Ic heal -another player. This is just a quick way for that player to be rested +another player. +This is just a quick way for that player to be rested to maximum and lose a little .Em poison . The main purpose in life for members of the council is to seek the @@ -946,7 +981,8 @@ This is done with a .Em palantir under the .Ic seek grail -option. The distance cited by the seek is accurate within 10%, in order +option. +The distance cited by the seek is accurate within 10%, in order not to make it too easy to find the grail. A player must have infinitesimally small .Em sin , @@ -972,8 +1008,7 @@ except that the affected player does not get his/her flag set. All .Ic intervention -options which affect other players age the player -who uses them. +options which affect other players age the player who uses them. .Em Valars are essentially immortal, but are actually given five lives. If these are used up, the player is left to die, and becomes an @@ -995,7 +1030,7 @@ encounters are based upon his/her size. Only one valar may exist at a time. The current valar is replaced when another player finds the grail. The valar is then bumped back to the council of the wise. -.Ss "Wizard" +.Ss Wizard The .Em wizard is usually the owner of the game, and the one who maintains @@ -1024,30 +1059,33 @@ The .Em wizard may do all the .Ic intervention -options. One extra option, +options. +One extra option, .Ic vaporize , is added to kill any offensive players. .It Ic super character type -An extra character type is added. This character starts with the +An extra character type is added. +This character starts with the maximum possible in all statistics, selected from the other character types. A .Em super character's statistics also progress at the maximum possible rate, selected from the other character types. .El -.Ss "Special Places" +.Ss Special Places Certain regions of the playing grid have different names. In general, this is only to give the player some idea of -his/her present location. Some special places do exist. +his/her present location. +Some special places do exist. .Bl -tag -width "Trading Posts" .It Em Trading Posts These are located at |x| == |y| == n*n*100 for n = 1, 2, ..., 1000. Trading posts farther out have more things for sale. -Be careful about cheating the merchants there, as they have short -tempers. +Be careful about cheating the merchants there, as they have short tempers. Merchants are dishonest about 5% of the time. .It Em Lord's Chamber -This is located at (0,0). Only players with +This is located at (0,0). +Only players with .Em crowns may enter. .It Em Point of \&No Return @@ -1058,15 +1096,15 @@ or to have a .Em valar relocate the player. .It Em Dead Marshes -This is a band located fairly distant from the origin. The first -fourteen monsters (water monsters) can normally only be found here. +This is a band located fairly distant from the origin. +The first fourteen monsters (water monsters) can normally only be found here. .It Em Valhala This place is where the .Em valar -resides. It is associated with no particular coordinate on the -playing grid. +resides. +It is associated with no particular coordinate on the playing grid. .El -.Ss "Miscellaneous" +.Ss Miscellaneous Once a player reaches .Em level 5, the game will start to time out waiting for input. @@ -1082,8 +1120,8 @@ A .Em medic wants half of a player's .Em gold -to be happy. Offering more than one has, or a negative amount -will anger the +to be happy. +Offering more than one has, or a negative amount will anger the .Em medic , who will make the player worse (add one .Em poison ) . @@ -1122,30 +1160,32 @@ goes away in random time. Players with .Em crowns are identified with a '*' before their character type. -.Ss "Inter-terminal Battle" +.Ss Inter-terminal Battle When two player's coordinates correspond, they may engage in battle. In general, the player with the highest .Em quickness gets the first hit. -If the two players are severely mis-matched, the stronger player +If the two players are severely mismatched, the stronger player is drastically handicapped for the battle. In order to protect from being stuck in an infinite loop, -the player waiting for response may time out. Options for battle are: +the player waiting for response may time out. +Options for battle are: .Bl -tag -width "power blast" .It Ic fight Inflicts damage upon other person. .It Ic run away -Escape from battle. Has a 75% chance of working. +Escape from battle. +Has a 75% chance of working. .It Ic power blast Battle spell. .It Ic luckout -One-time chance to try to win against the foe. Has a 10% chance of -working. +One-time chance to try to win against the foe. +Has a 10% chance of working. .El .Pp Sometimes waits for the other player may be excessive, because -he/she may be battling a monster. Upon slaying a player in battle -the winner gets the other's +he/she may be battling a monster. +Upon slaying a player in battle the winner gets the other's .Em experience and treasures. .Em Rings diff --git a/pom/pom.6 b/pom/pom.6 index 9ac430b..bc3d530 100644 --- a/pom/pom.6 +++ b/pom/pom.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: pom.6,v 1.8 2001/04/02 22:42:38 wiz Exp $ +.\" $NetBSD: pom.6,v 1.11 2002/09/26 18:32:03 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -51,15 +51,16 @@ managerial behavior. .Pp .Bl -tag -width [[[[[cc]yy]mm]dd]HH] .It Ar [[[[[cc]yy]mm]dd]HH] -Display the phase of the moon for a given time. The format is similar to -the canonical representation used by +Display the phase of the moon for a given time. +The format is similar to the canonical representation used by .Xr date 1 . .El .Sh SEE ALSO .Xr date 1 .Sh AUTHOR .Nm -was written by Keith E. Brandt. +was written by +.An Keith E. Brandt . .Sh BUGS Times must be within range of the .Ux @@ -70,4 +71,5 @@ UTC timescales (about one minute at the time of writing). .Sh ACKNOWLEDGEMENTS This program is based on algorithms from .%B Practical Astronomy with Your Calculator, Third Edition -by Peter Duffett-Smith . +by Peter Duffett-Smith +.Aq pjds@mrao.cam.ac.uk . diff --git a/ppt/Makefile.bsd b/ppt/Makefile.bsd index 675b4d0..800c6a2 100644 --- a/ppt/Makefile.bsd +++ b/ppt/Makefile.bsd @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.5 2001/12/12 00:07:49 tv Exp $ +# $NetBSD: Makefile,v 1.6 2002/09/18 06:16:41 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 -PROG= ppt NOMAN= # defined + +PROG= ppt HIDEGAME= hidegame .include diff --git a/ppt/ppt.c b/ppt/ppt.c index 4795f73..c3302ae 100644 --- a/ppt/ppt.c +++ b/ppt/ppt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ppt.c,v 1.9 2000/07/03 03:57:43 matt Exp $ */ +/* $NetBSD: ppt.c,v 1.14 2002/11/26 23:07:36 atatat Exp $ */ /* * Copyright (c) 1988, 1993 @@ -43,39 +43,94 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #if 0 static char sccsid[] = "@(#)ppt.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: ppt.c,v 1.9 2000/07/03 03:57:43 matt Exp $"); +__RCSID("$NetBSD: ppt.c,v 1.14 2002/11/26 23:07:36 atatat Exp $"); #endif #endif /* not lint */ +#include #include #include +#include #include +#define EDGE "___________" + + void usage __P((void)); int main __P((int, char *[])); static void putppt __P((int)); + int getppt __P((const char *)); + +void +usage(void) +{ + extern char *__progname; + fprintf(stderr, "usage: %s [-d] [string ...]\n", __progname); + exit(1); +} int main(argc, argv) int argc; char **argv; { - int c; - char *p; + char *p, buf[132]; + int c, start, neednl, dflag; /* Revoke setgid privileges */ setregid(getgid(), getgid()); - (void) puts("___________"); - if (argc > 1) - while ((p = *++argv) != NULL) { - for (; *p; ++p) - putppt((int)*p); - if ((*(argv + 1))) - putppt((int)' '); + dflag = 0; + while ((c = getopt(argc, argv, "dh")) != -1) + switch(c) { + case 'd': + dflag = 1; + break; + case 'h': + case '?': + default: + usage(); } - else while ((c = getchar()) != EOF) - putppt(c); - (void) puts("___________"); + argc -= optind; + argv += optind; + + if (dflag) { + if (argc > 0) + usage(); + + start = 0; + neednl = 0; + while (fgets(buf, sizeof(buf), stdin) != NULL) { + c = getppt(buf); + if (c < 0) { + if (start) { + /* lost sync? */ + if (neednl) + putchar('\n'); + exit(0); + } else + continue; + } + start = 1; + putchar(c); + neednl = (c != '\n'); + } + if (!feof(stdin)) + err(1, "fgets"); + if (neednl) + putchar('\n'); + } else { + (void) puts(EDGE); + if (argc > 0) + while ((p = *argv++)) { + for (; *p; ++p) + putppt((int)*p); + if ((*(argv))) + putppt((int)' '); + } + else while ((c = getchar()) != EOF) + putppt(c); + (void) puts(EDGE); + } exit(0); } @@ -97,3 +152,33 @@ putppt(c) (void) putchar('|'); (void) putchar('\n'); } + +int +getppt(const char *buf) +{ + const char *p = strchr(buf, '.'); + int c; + + if (p == NULL) + return (-1); + + c = 0; + if (p[ 3] != ' ') + c |= 0001; + if (p[ 2] != ' ') + c |= 0002; + if (p[ 1] != ' ') + c |= 0004; + if (p[-1] != ' ') + c |= 0010; + if (p[-2] != ' ') + c |= 0020; + if (p[-3] != ' ') + c |= 0040; + if (p[-4] != ' ') + c |= 0100; + if (p[-5] != ' ') + c |= 0200; + + return (c); +} diff --git a/primes/Makefile.bsd b/primes/Makefile.bsd index a8dd023..2947e41 100644 --- a/primes/Makefile.bsd +++ b/primes/Makefile.bsd @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.5 2001/12/12 00:07:49 tv Exp $ +# $NetBSD: Makefile,v 1.6 2002/09/18 06:16:41 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +NOMAN= # defined + PROG= primes SRCS= pattern.c pr_tbl.c primes.c -NOMAN= # defined DPADD= ${LIBM} LDADD= -lm diff --git a/quiz/datfiles/posneg b/quiz/datfiles/posneg index 03fde40..23eb616 100644 --- a/quiz/datfiles/posneg +++ b/quiz/datfiles/posneg @@ -26,7 +26,7 @@ dawn:dusk fall down|go to bed:[get|stand|rise] up asleep:awake up:down -open[|ed|]:close[d|] +open[ed|]:close[d|] smile:frown|cry happy|glad:sad hard:soft|easy @@ -38,13 +38,13 @@ good:bad always|sometimes|now:never|sometimes beautiful|pretty:ugly rough:smooth -hairy:bald||smooth +hairy:bald|smooth above:below yin:yang sweet:sour if:unless from|fro:to -with[|in|]:without|against +with[in|]:without|against after:before together:apart plus:minus diff --git a/quiz/quiz.6.in b/quiz/quiz.6.in index d1c4cb5..6eb338c 100644 --- a/quiz/quiz.6.in +++ b/quiz/quiz.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: quiz.6,v 1.7 2001/07/11 16:11:36 wiz Exp $ +.\" $NetBSD: quiz.6,v 1.9 2002/09/26 18:32:03 wiz Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -73,9 +73,8 @@ will ask questions from the first category and it expects answers from the second category. For example, the command .Dq quiz victim killer -asks questions which are -the names of victims, and expects you to answer with the cause of their -untimely demise, whereas the command +asks questions which are the names of victims, and expects you to answer +with the cause of their untimely demise, whereas the command .Dq quiz killer victim works the other way around. .Pp @@ -83,7 +82,7 @@ If you get the answer wrong, .Nm lets you try again. To see the right answer, enter a blank line. -.Sh "Index and Data File Syntax" +.Ss Index and Data File Syntax The index and data files have a similar syntax. Lines in them consist of several categories separated by colons. The categories are regular expressions formed using the following diff --git a/quiz/rxp.c b/quiz/rxp.c index 8531718..26c5951 100644 --- a/quiz/rxp.c +++ b/quiz/rxp.c @@ -1,4 +1,4 @@ -/* $NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $ */ +/* $NetBSD: rxp.c,v 1.10 2002/12/06 01:54:55 thorpej Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)rxp.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $"); +__RCSID("$NetBSD: rxp.c,v 1.10 2002/12/06 01:54:55 thorpej Exp $"); #endif #endif /* not lint */ @@ -68,6 +68,7 @@ __RCSID("$NetBSD: rxp.c,v 1.7 1999/09/08 21:17:56 jsm Exp $"); */ #include +#include #include #include "quiz.h" /* regexp tokens, arg */ @@ -213,7 +214,6 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) static const char *sp; int ch; Rxp_t *grp_end = NULL; - int err; if (first) { rp = rxpbuf; @@ -227,7 +227,7 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) if (ch != *sp++) { rp = j_fail; sp = sp_fail; - return (TRUE); + return (FALSE); } rp++; break; @@ -247,16 +247,17 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) break; case ALT_S: rp++; - if ((err = rxp__match(sp, - FALSE, grp_end, rxpbuf + *rp++, sp)) != TRUE) - return (err); + rxp__match(sp, FALSE, grp_end, rxpbuf + *rp++, sp); break; case ALT_E: rp = j_succ; return (TRUE); case GRP_E: - default: + rp = j_fail; + sp = sp_fail; return (FALSE); + default: + abort(); } return (*rp != END ? FALSE : TRUE); } diff --git a/rain/rain.6 b/rain/rain.6 index c59e3af..b64a061 100644 --- a/rain/rain.6 +++ b/rain/rain.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: rain.6,v 1.8 2001/04/02 22:42:38 wiz Exp $ +.\" $NetBSD: rain.6,v 1.10 2002/09/26 18:32:04 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -52,6 +52,7 @@ To obtain the proper effect, either the terminal must be set for 9600 baud or the .Fl d option must be used to specify a delay, in milliseconds, between each -update. A reasonable delay is 120; the default is 0. +update. +A reasonable delay is 120; the default is 0. .Sh AUTHOR -Eric P. Scott +.An Eric P. Scott diff --git a/random/random.6 b/random/random.6 index f5b89c7..5e21e8b 100644 --- a/random/random.6 +++ b/random/random.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: random.6,v 1.4 1999/03/22 18:49:12 garbled Exp $ +.\" $NetBSD: random.6,v 1.5 2002/09/26 18:32:04 wiz Exp $ .\" .\" Copyright (c) 1994 .\" The Regents of the University of California. All rights reserved. @@ -60,8 +60,8 @@ option is specified, .Nm does not read or write anything, and simply exits with a random exit value of 0 to -.Ar denominator -\&- 1, inclusive. +.Ar denominator Ns -1 , +inclusive. .It Fl r The .Fl r diff --git a/robots/auto.c b/robots/auto.c index c0a15bf..29bba25 100644 --- a/robots/auto.c +++ b/robots/auto.c @@ -1,4 +1,4 @@ -/* $NetBSD: auto.c,v 1.4 1999/09/08 21:17:56 jsm Exp $ */ +/* $NetBSD: auto.c,v 1.5 2002/01/31 17:35:52 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -236,7 +236,7 @@ move_towards(dx, dy) (void)strcpy(ok_moves, find_moves()); best_move = ok_moves[0]; - if (best_move != 'F') { + if (best_move != 't') { mvx = xinc(best_move); mvy = yinc(best_move); move_judge = ABS(mvx - dx) + ABS(mvy - dy); diff --git a/robots/init_field.c b/robots/init_field.c index 57200a4..822ab10 100644 --- a/robots/init_field.c +++ b/robots/init_field.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $ */ +/* $NetBSD: init_field.c,v 1.7 2002/01/31 17:35:52 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,12 +38,15 @@ #if 0 static char sccsid[] = "@(#)init_field.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $"); +__RCSID("$NetBSD: init_field.c,v 1.7 2002/01/31 17:35:52 christos Exp $"); #endif #endif /* not lint */ # include "robots.h" +static int telx = 0; +static int tely = 0; + /* * init_field: * Lay down the initial pattern whih is constant across all levels, @@ -112,6 +115,8 @@ init_field() move(i, X_FIELDSIZE + 2); addstr(desc[i]); } + telx = X_FIELDSIZE + 2; + tely = i; if (first) refresh(); first = FALSE; @@ -120,3 +125,11 @@ init_field() Next_move = &Move_list[-1]; #endif } + +void +telmsg(on) + int on; +{ + move(tely, telx); + addstr(on ? "Teleport!" : " "); +} diff --git a/robots/move.c b/robots/move.c index a74c6c7..c098292 100644 --- a/robots/move.c +++ b/robots/move.c @@ -1,4 +1,4 @@ -/* $NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $ */ +/* $NetBSD: move.c,v 1.10 2002/01/31 17:35:52 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $"); +__RCSID("$NetBSD: move.c,v 1.10 2002/01/31 17:35:52 christos Exp $"); #endif #endif /* not lint */ @@ -175,6 +175,10 @@ get_move() Running = FALSE; mvaddch(My_pos.y, My_pos.x, ' '); My_pos = *rnd_pos(); + telmsg(1); + refresh(); + sleep(1); + telmsg(0); mvaddch(My_pos.y, My_pos.x, PLAYER); leaveok(stdscr, FALSE); refresh(); diff --git a/robots/robots.6.in b/robots/robots.6.in index e54cf9d..6762ff7 100644 --- a/robots/robots.6.in +++ b/robots/robots.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: robots.6,v 1.8 2001/04/02 22:42:39 wiz Exp $ +.\" $NetBSD: robots.6,v 1.11 2002/09/26 18:32:04 wiz Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -61,7 +61,7 @@ you start on the next field. This keeps up until they finally get you. .Pp Robots are represented on the screen by a -.Sq \+ , +.Sq \&+ , the junk heaps from their collisions by a .Sq \(** , and you @@ -91,7 +91,7 @@ move one square down and right (also space) do nothing for one turn .It Ic HJKLBNYU run as far as possible in the given direction -.It Ic \> +.It Ic \*[Gt] do nothing for as long as possible .It Ic t teleport to a random location @@ -139,7 +139,8 @@ very nice. .It Fl a Advance into the higher levels directly, skipping the lower, easier levels. .It Fl A -Auto-bot mode. Let's the game play itself. +Auto-bot mode. +Lets the game play itself. .It Fl n Increase the number of games played by one. .El diff --git a/robots/robots.h b/robots/robots.h index 2e8f6b5..63fa6de 100644 --- a/robots/robots.h +++ b/robots/robots.h @@ -1,4 +1,4 @@ -/* $NetBSD: robots.h,v 1.14 1999/09/30 18:01:33 jsm Exp $ */ +/* $NetBSD: robots.h,v 1.15 2002/01/31 17:35:52 christos Exp $ */ /* * Copyright (c) 1980, 1993 @@ -126,6 +126,7 @@ extern jmp_buf End_move; void add_score __P((int)); bool another __P((void)); +char automove __P((void)); int cmp_sc __P((const void *, const void *)); bool do_move __P((int, int)); bool eaten __P((const COORD *)); @@ -146,4 +147,4 @@ void score __P((int)); void set_name __P((SCORE *)); void show_score __P((void)); int sign __P((int)); -char automove __P((void)); +void telmsg __P((int)); diff --git a/rogue/Makefile.bsd b/rogue/Makefile.bsd index 8c24714..0e64c94 100644 --- a/rogue/Makefile.bsd +++ b/rogue/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 1999/09/13 17:14:07 jsm Exp $ +# $NetBSD: Makefile,v 1.15 2002/07/07 09:35:07 tron Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= rogue @@ -11,6 +11,7 @@ LDADD= -lcurses HIDEGAME=hidegame SETGIDGAME=yes MAN= rogue.6 +WARNS= 2 .if make(install) SUBDIR+=USD.doc diff --git a/rogue/USD.doc/Makefile.bsd b/rogue/USD.doc/Makefile.bsd index 359407d..778e98f 100644 --- a/rogue/USD.doc/Makefile.bsd +++ b/rogue/USD.doc/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 1995/04/22 10:28:47 cgd Exp $ +# $NetBSD: Makefile,v 1.3 2003/01/05 12:34:26 pooka Exp $ # @(#)Makefile 8.1 (Berkeley) 6/8/93 DIR= usd/30.rogue @@ -6,6 +6,6 @@ SRCS= rogue.me MACROS= -me paper.${PRINTER}: ${SRCS} - ${TBL} ${SRCS} | ${ROFF} > ${.TARGET} + ${TBL} ${SRCS} | ${ROFF} ${MACROS} > ${.TARGET} .include diff --git a/rogue/hit.c b/rogue/hit.c index 5ad19e6..a0c69f9 100644 --- a/rogue/hit.c +++ b/rogue/hit.c @@ -1,4 +1,4 @@ -/* $NetBSD: hit.c,v 1.5 1998/11/10 13:01:31 hubertf Exp $ */ +/* $NetBSD: hit.c,v 1.6 2002/07/07 09:35:07 tron Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)hit.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: hit.c,v 1.5 1998/11/10 13:01:31 hubertf Exp $"); +__RCSID("$NetBSD: hit.c,v 1.6 2002/07/07 09:35:07 tron Exp $"); #endif #endif /* not lint */ @@ -213,17 +213,17 @@ get_w_damage(obj) const object *obj; { char new_damage[12]; - int to_hit, damage; + int tmp_to_hit, tmp_damage; int i = 0; if ((!obj) || (obj->what_is != WEAPON)) { return(-1); } - to_hit = get_number(obj->damage) + obj->hit_enchant; + tmp_to_hit = get_number(obj->damage) + obj->hit_enchant; while (obj->damage[i++] != 'd') ; - damage = get_number(obj->damage + i) + obj->d_enchant; + tmp_damage = get_number(obj->damage + i) + obj->d_enchant; - sprintf(new_damage, "%dd%d", to_hit, damage); + sprintf(new_damage, "%dd%d", tmp_to_hit, tmp_damage); return(get_damage(new_damage, 1)); } diff --git a/rogue/inventory.c b/rogue/inventory.c index c68f2c3..ed0f933 100644 --- a/rogue/inventory.c +++ b/rogue/inventory.c @@ -1,4 +1,4 @@ -/* $NetBSD: inventory.c,v 1.6 1998/11/10 13:01:32 hubertf Exp $ */ +/* $NetBSD: inventory.c,v 1.8 2002/10/01 14:18:57 mrg Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: inventory.c,v 1.6 1998/11/10 13:01:32 hubertf Exp $"); +__RCSID("$NetBSD: inventory.c,v 1.8 2002/10/01 14:18:57 mrg Exp $"); #endif #endif /* not lint */ @@ -362,15 +362,15 @@ pr_com_id(ch) } int -get_com_id(index, ch) - int *index; +get_com_id(indexp, ch) + int *indexp; short ch; { short i; for (i = 0; i < COMS; i++) { if (com_id_tab[i].com_char == ch) { - *index = i; + *indexp = i; return(1); } } @@ -421,14 +421,14 @@ void mix_colors() { short i, j, k; - char *t; + char t[MAX_ID_TITLE_LEN]; for (i = 0; i <= 32; i++) { j = get_rand(0, (POTIONS - 1)); k = get_rand(0, (POTIONS - 1)); - t = id_potions[j].title; - id_potions[j].title = id_potions[k].title; - id_potions[k].title = t; + memcpy(t, id_potions[j].title, MAX_ID_TITLE_LEN); + memcpy(id_potions[j].title, id_potions[k].title, MAX_ID_TITLE_LEN); + memcpy(id_potions[k].title, t, MAX_ID_TITLE_LEN); } } diff --git a/rogue/level.c b/rogue/level.c index f366f57..b57e1f2 100644 --- a/rogue/level.c +++ b/rogue/level.c @@ -1,4 +1,4 @@ -/* $NetBSD: level.c,v 1.5 1998/11/10 13:01:32 hubertf Exp $ */ +/* $NetBSD: level.c,v 1.6 2003/01/20 05:29:55 simonb Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)level.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: level.c,v 1.5 1998/11/10 13:01:32 hubertf Exp $"); +__RCSID("$NetBSD: level.c,v 1.6 2003/01/20 05:29:55 simonb Exp $"); #endif #endif /* not lint */ @@ -261,7 +261,7 @@ make_room(rn, r1, r2, r3) case BIG_ROOM: top_row = get_rand(MIN_ROW, MIN_ROW+5); bottom_row = get_rand(DROWS-7, DROWS-2); - left_col = get_rand(0, 10);; + left_col = get_rand(0, 10); right_col = get_rand(DCOLS-11, DCOLS-1); rn = 0; goto B; diff --git a/rogue/message.c b/rogue/message.c index 17af007..20d4e3d 100644 --- a/rogue/message.c +++ b/rogue/message.c @@ -1,4 +1,4 @@ -/* $NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $ */ +/* $NetBSD: message.c,v 1.9 2002/10/01 14:18:57 mrg Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $"); +__RCSID("$NetBSD: message.c,v 1.9 2002/10/01 14:18:57 mrg Exp $"); #endif #endif /* not lint */ @@ -64,7 +64,7 @@ __RCSID("$NetBSD: message.c,v 1.8 2000/07/10 10:19:27 itojun Exp $"); char msgs[NMESSAGES][DCOLS] = {"", "", "", "", ""}; short msg_col = 0, imsg = -1; boolean msg_cleared = 1, rmsg = 0; -char hunger_str[8] = ""; +char hunger_str[HUNGER_STR_LEN] = ""; const char *more = "-more-"; void diff --git a/rogue/rogue.6.in b/rogue/rogue.6.in index af1f41d..2a4d79c 100644 --- a/rogue/rogue.6.in +++ b/rogue/rogue.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: rogue.6,v 1.6 1997/10/12 11:45:49 lukem Exp $ +.\" $NetBSD: rogue.6,v 1.8 2002/09/26 18:32:04 wiz Exp $ .\" .\" Copyright (c) 1988, 1993 .\" The Regents of the University of California. All rights reserved. @@ -38,7 +38,7 @@ .Os .Sh NAME .Nm rogue -.Nd Exploring The Dungeons of Doom +.Nd exploring The Dungeons of Doom .Sh SYNOPSIS .Nm .Op Fl s @@ -47,12 +47,13 @@ .\" .Op Fl d .Sh DESCRIPTION .Nm -is a computer fantasy game with a new twist. It is crt oriented and the -object of the game is to survive the attacks of various monsters and get -a lot of gold, rather than the puzzle solving orientation of most computer -fantasy games. +is a computer fantasy game with a new twist. +It is CRT oriented and the object of the game is to survive the attacks of +various monsters and get a lot of gold, rather than the puzzle solving +orientation of most computer fantasy games. .Pp -To get started you really only need to know two commands. The command +To get started you really only need to know two commands. +The command .Ic \&? will give you a list of the available commands and the command .Ic \&/ @@ -60,16 +61,16 @@ will identify the things you see on the screen. .Pp To win the game (as opposed to merely playing to beat other people's 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, they will probably go down in history as a hero -among heroes. +the 20th level of the dungeon and get it out. +Nobody has achieved this yet and if somebody does, they will probably go +down in history as a hero among heroes. .Pp When the game ends, either by your death, when you quit, or if you (by some miracle) manage to win, .Nm -will give you a list of the top-ten scorers. The scoring is based entirely -upon how much gold you get. There is a 10% penalty for getting yourself -killed. +will give you a list of the top-ten scorers. +The scoring is based entirely upon how much gold you get. +There is a 10% penalty for getting yourself killed. .Pp If .Ar save_file @@ -104,8 +105,7 @@ Default save file .Re .Sh BUGS Probably infinite, although none are known. -However, -that Ice Monsters sometimes transfix you permanently is +However, that Ice Monsters sometimes transfix you permanently is .Em not a bug. It's a feature. diff --git a/rogue/rogue.h b/rogue/rogue.h index ec67cc7..67d104a 100644 --- a/rogue/rogue.h +++ b/rogue/rogue.h @@ -1,4 +1,4 @@ -/* $NetBSD: rogue.h,v 1.12 2001/02/05 01:04:25 christos Exp $ */ +/* $NetBSD: rogue.h,v 1.13 2002/10/01 14:18:57 mrg Exp $ */ /* * Copyright (c) 1988, 1993 @@ -192,9 +192,10 @@ #define MAX_OPT_LEN 40 +#define MAX_ID_TITLE_LEN 64 struct id { short value; - char *title; + char title[MAX_ID_TITLE_LEN]; char *real; unsigned short id_status; }; @@ -658,7 +659,7 @@ int rand_percent __P((int)); void rand_place __P((object *)); void read_pack __P((object *, FILE *, boolean)); void read_scroll __P((void)); -void read_string __P((char *, FILE *)); +void read_string __P((char *, FILE *, size_t)); void recursive_deadend __P((short, const short *, short, short)); boolean reg_move __P((void)); void relight __P((void)); @@ -763,8 +764,9 @@ extern boolean sustain_strength; extern boolean trap_door; extern boolean wizard; extern char hit_message[]; -extern char hunger_str[]; -extern char login_name[]; +#define HUNGER_STR_LEN 8 +extern char hunger_str[HUNGER_STR_LEN]; +extern char login_name[MAX_OPT_LEN]; extern const char *byebye_string; extern const char *curse_message; extern const char *error_file; diff --git a/rogue/save.c b/rogue/save.c index 8c38a4d..01129a2 100644 --- a/rogue/save.c +++ b/rogue/save.c @@ -1,4 +1,4 @@ -/* $NetBSD: save.c,v 1.7 1999/09/18 19:38:54 jsm Exp $ */ +/* $NetBSD: save.c,v 1.8 2002/10/01 14:18:58 mrg Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: save.c,v 1.7 1999/09/18 19:38:54 jsm Exp $"); +__RCSID("$NetBSD: save.c,v 1.8 2002/10/01 14:18:58 mrg Exp $"); #endif #endif /* not lint */ @@ -102,8 +102,8 @@ save_into_file(sfile) } } } - if ( ((fp = fopen(sfile, "w")) == NULL) || - ((file_id = md_get_file_id(sfile)) == -1)) { + if (((fp = fopen(sfile, "w")) == NULL) || + ((file_id = md_get_file_id(sfile)) == -1)) { message("problem accessing the save file", 0); return; } @@ -166,8 +166,8 @@ restore(fname) int new_file_id, saved_file_id; fp = NULL; - if ( ((new_file_id = md_get_file_id(fname)) == -1) || - ((fp = fopen(fname, "r")) == NULL)) { + if (((new_file_id = md_get_file_id(fname)) == -1) || + ((fp = fopen(fname, "r")) == NULL)) { clean_up("cannot open file"); } if (md_link_count(fname) > 1) { @@ -177,10 +177,10 @@ restore(fname) r_read(fp, (char *) &detect_monster, sizeof(detect_monster)); r_read(fp, (char *) &cur_level, sizeof(cur_level)); r_read(fp, (char *) &max_level, sizeof(max_level)); - read_string(hunger_str, fp); + read_string(hunger_str, fp, sizeof hunger_str); - (void) strcpy(tbuf, login_name); - read_string(login_name, fp); + (void) strlcpy(tbuf, login_name, sizeof tbuf); + read_string(login_name, fp, sizeof login_name); if (strcmp(tbuf, login_name)) { clean_up("you're not the original player"); } @@ -269,9 +269,9 @@ read_pack(pack, fp, is_rogue) *new_obj = read_obj; if (is_rogue) { if (new_obj->in_use_flags & BEING_WORN) { - do_wear(new_obj); + do_wear(new_obj); } else if (new_obj->in_use_flags & BEING_WIELDED) { - do_wield(new_obj); + do_wield(new_obj); } else if (new_obj->in_use_flags & (ON_EITHER_HAND)) { do_put_on(new_obj, ((new_obj->in_use_flags & ON_LEFT_HAND) ? 1 : 0)); @@ -326,7 +326,7 @@ rw_id(id_table, fp, n, wr) r_read(fp, (char *) &(id_table[i].value), sizeof(short)); r_read(fp, (char *) &(id_table[i].id_status), sizeof(unsigned short)); - read_string(id_table[i].title, fp); + read_string(id_table[i].title, fp, MAX_ID_TITLE_LEN); } } } @@ -345,13 +345,16 @@ write_string(s, fp) } void -read_string(s, fp) +read_string(s, fp, len) char *s; FILE *fp; + size_t len; { short n; r_read(fp, (char *) &n, sizeof(short)); + if ((size_t)n > len) + clean_up("read_string: corrupt game file"); r_read(fp, s, n); xxxx(s, n); } diff --git a/rogue/score.c b/rogue/score.c index e0f6459..73d34d9 100644 --- a/rogue/score.c +++ b/rogue/score.c @@ -1,4 +1,4 @@ -/* $NetBSD: score.c,v 1.9 2001/08/09 13:02:49 wiz Exp $ */ +/* $NetBSD: score.c,v 1.10 2002/07/07 09:35:08 tron Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: score.c,v 1.9 2001/08/09 13:02:49 wiz Exp $"); +__RCSID("$NetBSD: score.c,v 1.10 2002/07/07 09:35:08 tron Exp $"); #endif #endif /* not lint */ @@ -209,7 +209,7 @@ put_scores(monster, other) char buf[128]; FILE *fp; long s; - boolean pause = score_only; + boolean dopause = score_only; md_lock(1); @@ -322,7 +322,7 @@ put_scores(monster, other) refresh(); fclose(fp); message("", 0); - if (pause) { + if (dopause) { message("", 0); } clean_up(""); diff --git a/sail/sail.6 b/sail/sail.6 index abf2076..1fccdd0 100644 --- a/sail/sail.6 +++ b/sail/sail.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: sail.6,v 1.7 2001/04/02 22:42:39 wiz Exp $ +.\" $NetBSD: sail.6,v 1.11 2002/09/26 16:33:54 wiz Exp $ .\" .\" Copyright (c) 1988, 1993 .\" The Regents of the University of California. All rights reserved. @@ -60,7 +60,8 @@ originally developed by S. Craig Taylor. Players of .I Sail take command of an old fashioned Man of War and fight other -players or the computer. They may re-enact one of the many +players or the computer. +They may re-enact one of the many historical sea battles recorded in the game, or they can choose a fictional battle. .PP @@ -70,7 +71,8 @@ Navy, the player has complete control over the workings of his ship. He must order every maneuver, change the set of his sails, and judge the right moment to let loose the terrible destruction of his broadsides. In addition to fighting the enemy, he must harness the powers of the wind -and sea to make them work for him. The outcome of many battles during the +and sea to make them work for him. +The outcome of many battles during the age of sail was decided by the ability of one captain to hold the `weather gage.' .PP @@ -80,7 +82,8 @@ The flags are: Print the names and ships of the top ten sailors. .TP .B \-l -Show the login name. Only effective with \fB-s\fP. +Show the login name. +Only effective with \fB-s\fP. .TP .B \-x Play the first available ship instead of prompting for a choice. @@ -89,8 +92,9 @@ Play the first available ship instead of prompting for a choice. No bells. .SH IMPLEMENTATION .I Sail -is really two programs in one. Each player starts up a process which -runs his own ship. In addition, a +is really two programs in one. +Each player starts up a process which runs his own ship. +In addition, a .I driver process is forked (by the first player) to run the computer ships and take care of global bookkeeping. @@ -108,12 +112,14 @@ To implement a multi-user game in Version 7 UNIX, which was the operating system .I Sail was first written under, the communicating processes must use a common -temporary file as a place to read and write messages. In addition, a -locking mechanism must be provided to ensure exclusive access to the -shared file. For example, +temporary file as a place to read and write messages. +In addition, a locking mechanism must be provided to ensure exclusive +access to the shared file. +For example, .I Sail uses a temporary file named /tmp/#sailsink.21 for scenario 21, and -corresponding file names for the other scenarios. To provide exclusive +corresponding file names for the other scenarios. +To provide exclusive access to the temporary file, .I Sail uses a technique stolen from an old game called "pubcaves" by Jeff Cohen. @@ -121,18 +127,19 @@ Processes do a busy wait in the loop .br .sp .ce 2 - for (n = 0; link(sync_file, sync_lock) < 0 && n < 30; n++) + for (n = 0; link(sync_file, sync_lock) \*[Lt] 0 \*[Am]\*[Am] n \*[Lt] 30; n++) sleep(2); .br .sp until they are able to create a link to a file named "/tmp/#saillock.??". -The "??" correspond to the scenario number of the game. Since UNIX +The "??" correspond to the scenario number of the game. +Since UNIX guarantees that a link will point to only one file, the process that succeeds in linking will have exclusive access to the temporary file. .PP -Whether or not this really works is open to speculation. When ucbmiro -was rebooted after a crash, the file system check program found 3 links -between the +Whether or not this really works is open to speculation. +When ucbmiro was rebooted after a crash, the file system check program +found 3 links between the .I Sail temporary file and its link file. .SH CONSEQUENCES OF SEPARATE PLAYER AND DRIVER PROCESSES @@ -141,24 +148,29 @@ the driver must coordinate the action with the other ships in the game. For example, if a player wants to move in a certain direction, he writes a message into the temporary file requesting the driver to move his ship. Each ``turn,'' the driver reads all the messages sent from the players and -decides what happened. It then writes back into the temporary file new -values of variables, etc. +decides what happened. +It then writes back into the temporary file new values of variables, etc. .PP The most noticeable effect this communication has on the game is the -delay in moving. Suppose a player types a move for his ship and hits -return. What happens then? The player process saves up messages to -be written to the temporary file in a buffer. Every 7 seconds or so, the -player process gets exclusive access to the temporary file and writes -out its buffer to the file. The driver, running asynchronously, must -read in the movement command, process it, and write out the results. This -takes two exclusive accesses to the temporary file. Finally, when the player -process gets around to doing another 7 second update, the results of the -move are displayed on the screen. Hence, every movement requires four +delay in moving. +Suppose a player types a move for his ship and hits return. +What happens then? +The player process saves up messages to +be written to the temporary file in a buffer. +Every 7 seconds or so, the player process gets exclusive access to +the temporary file and writes out its buffer to the file. +The driver, running asynchronously, must +read in the movement command, process it, and write out the results. +This takes two exclusive accesses to the temporary file. +Finally, when the player process gets around to doing another 7 second +update, the results of the move are displayed on the screen. +Hence, every movement requires four exclusive accesses to the temporary file (anywhere from 7 to 21 seconds depending upon asynchrony) before the player sees the results of his moves. .PP -In practice, the delays are not as annoying as they would appear. There -is room for "pipelining" in the movement. After the player writes out +In practice, the delays are not as annoying as they would appear. +There is room for "pipelining" in the movement. +After the player writes out a first movement message, a second movement command can then be issued. The first message will be in the temporary file waiting for the driver, and the second will be in the file buffer waiting to be written to the file. @@ -166,16 +178,19 @@ Thus, by always typing moves a turn ahead of the time, the player can sail around quite quickly. .PP If the player types several movement commands between two 7 second updates, -only the last movement command typed will be seen by the driver. Movement -commands within the same update "overwrite" each other, in a sense. +only the last movement command typed will be seen by the driver. +Movement commands within the same update "overwrite" each other, in a sense. .SH THE HISTORY OF SAIL I wrote the first version of .I Sail -on a PDP 11/70 in the fall of 1980. Needless to say, the code was horrendous, -not portable in any sense of the word, and didn't work. The program was not -very modular and had fseeks() and fwrites() every few lines. After a -tremendous rewrite from the top down, I got the first working version up by -1981. There were several annoying bugs concerning firing broadsides and +on a PDP 11/70 in the fall of 1980. +Needless to say, the code was horrendous, +not portable in any sense of the word, and didn't work. +The program was not +very modular and had fseeks() and fwrites() every few lines. +After a tremendous rewrite from the top down, +I got the first working version up by 1981. +There were several annoying bugs concerning firing broadsides and finding angles. .I Sail uses no floating point, by the way, so the direction routines are rather @@ -187,12 +202,14 @@ available). .PP Captain Happy (Craig Leres) is responsible for making .I Sail -portable for the first time. This was no easy task, by the way. Constants -like 2 and 10 were very frequent in the code. I also became famous for -using "Riggle Memorial Structures" in +portable for the first time. +This was no easy task, by the way. +Constants like 2 and 10 were very frequent in the code. +I also became famous for using "Riggle Memorial Structures" in .I Sail. Many of my structure references are so long that they run off the line -printer page. Here is an example, if you promise not to laugh. +printer page. +Here is an example, if you promise not to laugh. .br .sp .ce @@ -202,15 +219,19 @@ specs[scene[flog.fgamenum].ship[flog.fshipnum].shipnum].pts .PP .I Sail received its fourth and most thorough rewrite in the summer and fall -of 1983. Ed Wang rewrote and modularized the code (a monumental feat) -almost from scratch. Although he introduced many new bugs, the final -result was very much cleaner and (?) faster. He added window movement -commands and find ship commands. +of 1983. +Ed Wang rewrote and modularized the code (a monumental feat) +almost from scratch. +Although he introduced many new bugs, the final result was very much +cleaner and (?) faster. +He added window movement commands and find ship commands. .SH HISTORICAL INFO Old Square Riggers were very maneuverable ships capable of intricate -sailing. Their only disadvantage was an inability to sail very -close to the wind. The design of a wooden ship allowed only for the -guns to bear to the left and right sides. A few guns of small +sailing. +Their only disadvantage was an inability to sail very close to the wind. +The design of a wooden ship allowed only for the +guns to bear to the left and right sides. +A few guns of small aspect (usually 6 or 9 pounders) could point forward, but their effect was small compared to a 68 gun broadside of 24 or 32 pounders. The guns bear approximately like so: @@ -229,9 +250,10 @@ The guns bear approximately like so: .fi An interesting phenomenon occurred when a broadside was fired -down the length of an enemy ship. The shot tended to bounce along -the deck and did several times more damage. This phenomenon was called -a rake. Because the bows of a ship are very strong and present a smaller +down the length of an enemy ship. +The shot tended to bounce along the deck and did several times more damage. +This phenomenon was called a rake. +Because the bows of a ship are very strong and present a smaller target than the stern, a stern rake (firing from the stern to the bow) causes more damage than a bow rake. .nf @@ -242,91 +264,109 @@ more damage than a bow rake. .fi Most ships were equipped with carronades, which were very large, close -range cannons. American ships from the revolution until the War of 1812 +range cannons. +American ships from the revolution until the War of 1812 were almost entirely armed with carronades. .PP The period of history covered in .I Sail is approximately from the 1770's until the end of Napoleonic France in 1815. -There are many excellent books about the age of sail. My favorite author -is Captain Frederick Marryat. More contemporary authors include C.S. Forester -and Alexander Kent. -.PP -Fighting ships came in several sizes classed by armament. The mainstays of -any fleet were its "Ships of the Line", or "Line of Battle Ships". They -were so named because these ships fought together in great lines. They were +There are many excellent books about the age of sail. +My favorite author is Captain Frederick Marryat. +More contemporary authors include C.S. Forester and Alexander Kent. +.PP +Fighting ships came in several sizes classed by armament. +The mainstays of +any fleet were its "Ships of the Line", or "Line of Battle Ships". +They were so named because these ships fought together in great lines. +They were close enough for mutual support, yet every ship could fire both its broadsides. We get the modern words "ocean liner," or "liner," and "battleship" from -"ship of the line." The most common size was the 74 gun two decked -ship of the line. The two gun decks usually mounted 18 and 24 pounder guns. +"ship of the line." +The most common size was the 74 gun two decked ship of the line. +The two gun decks usually mounted 18 and 24 pounder guns. .PP -The pride of the fleet were the first rates. These were huge three decked -ships of the line mounting 80 to 136 guns. The guns in the three tiers +The pride of the fleet were the first rates. +These were huge three decked ships of the line mounting 80 to 136 guns. +The guns in the three tiers were usually 18, 24, and 32 pounders in that order from top to bottom. .PP -Various other ships came next. They were almost all "razees," or ships -of the line with one deck sawed off. They mounted 40-64 guns and were -a poor cross between a frigate and a line of battle ship. They neither -had the speed of the former nor the firepower of the latter. -.PP -Next came the "eyes of the fleet." Frigates came in many sizes mounting -anywhere from 32 to 44 guns. They were very handy vessels. They could -outsail anything bigger and outshoot anything smaller. Frigates didn't -fight in lines of battle as the much bigger 74's did. Instead, they -harassed the enemy's rear or captured crippled ships. They were much -more useful in missions away from the fleet, such as cutting out expeditions -or boat actions. They could hit hard and get away fast. -.PP -Lastly, there were the corvettes, sloops, and brigs. These were smaller -ships mounting typically fewer than 20 guns. A corvette was only slightly -smaller than a frigate, so one might have up to 30 guns. Sloops were used -for carrying dispatches or passengers. Brigs were something you built for -land-locked lakes. +Various other ships came next. +They were almost all "razees," or ships of the line with one deck sawed off. +They mounted 40-64 guns and were +a poor cross between a frigate and a line of battle ship. +They neither had the speed of the former nor the firepower of the latter. +.PP +Next came the "eyes of the fleet." +Frigates came in many sizes mounting anywhere from 32 to 44 guns. +They were very handy vessels. +They could outsail anything bigger and outshoot anything smaller. +Frigates didn't fight in lines of battle as the much bigger 74's did. +Instead, they harassed the enemy's rear or captured crippled ships. +They were much more useful in missions away from the fleet, +such as cutting out expeditions or boat actions. +They could hit hard and get away fast. +.PP +Lastly, there were the corvettes, sloops, and brigs. +These were smaller ships mounting typically fewer than 20 guns. +A corvette was only slightly +smaller than a frigate, so one might have up to 30 guns. +Sloops were used for carrying dispatches or passengers. +Brigs were something you built for land-locked lakes. .SH SAIL PARTICULARS Ships in .I Sail -are represented by two characters. One character represents the bow of -the ship, and the other represents the stern. Ships have nationalities -and numbers. The first ship of a nationality is number 0, the second -number 1, etc. Therefore, the first British ship in a game would be -printed as "b0". The second Brit would be "b1", and the fifth Don -would be "s4". +are represented by two characters. +One character represents the bow of +the ship, and the other represents the stern. +Ships have nationalities and numbers. +The first ship of a nationality is number 0, the second +number 1, etc. +Therefore, the first British ship in a game would be printed as "b0". +The second Brit would be "b1", and the fifth Don would be "s4". .PP Ships can set normal sails, called Battle Sails, or bend on extra canvas -called Full Sails. A ship under full sail is a beautiful sight indeed, -and it can move much faster than a ship under Battle Sails. The only -trouble is, with full sails set, there is so much tension on sail and +called Full Sails. +A ship under full sail is a beautiful sight indeed, +and it can move much faster than a ship under Battle Sails. +The only trouble is, with full sails set, there is so much tension on sail and rigging that a well aimed round shot can burst a sail into ribbons where -it would only cause a little hole in a loose sail. For this reason, -rigging damage is doubled on a ship with full sails set. Don't let -that discourage you from using full sails. I like to keep them up -right into the heat of battle. A ship -with full sails set has a capital letter for its nationality. E.g., -a Frog, "f0", with full sails set would be printed as "F0". +it would only cause a little hole in a loose sail. +For this reason, rigging damage is doubled on a ship with full sails set. +Don't let that discourage you from using full sails. +I like to keep them up right into the heat of battle. +A ship with full sails set has a capital letter for its nationality. +E.g., a Frog, "f0", with full sails set would be printed as "F0". .PP When a ship is battered into a listing hulk, the last man aboard "strikes -the colors." This ceremony is the ship's formal surrender. The nationality -character -of a surrendered ship is printed as "!". E.g., the Frog of our last example -would soon be "!0". +the colors." +This ceremony is the ship's formal surrender. +The nationality character of a surrendered ship is printed as "!". +E.g., the Frog of our last example would soon be "!0". .PP A ship has a random chance of catching fire or sinking when it reaches the -stage of listing hulk. A sinking ship has a "~" printed for its nationality, +stage of listing hulk. +A sinking ship has a "~" printed for its nationality, and a ship on fire and about to explode has a "#" printed. .PP -Captured ships become the nationality of the prize crew. Therefore, if +Captured ships become the nationality of the prize crew. +Therefore, if an American ship captures a British ship, the British ship will have an -"a" printed for its nationality. In addition, the ship number is changed -to "&","'", "(", ,")", "*", or "+" depending upon the original number, -be it 0,1,2,3,4, or 5. E.g., the "b0" captured by an American becomes the -"a&". The "s4" captured by a Frog becomes the "f*". +"a" printed for its nationality. +In addition, the ship number is changed +to "\*[Am]","'", "(", ,")", "*", or "+" depending upon the original number, +be it 0,1,2,3,4, or 5. +E.g., the "b0" captured by an American becomes the +"a\*[Am]". +The "s4" captured by a Frog becomes the "f*". .PP The ultimate example is, of course, an exploding Brit captured by an -American: "#&". +American: "#\*[Am]". .SH MOVEMENT Movement is the most confusing part of .I Sail -to many. Ships can head in 8 directions: +to many. +Ships can head in 8 directions: .nf 0 0 0 @@ -334,26 +374,31 @@ to many. Ships can head in 8 directions: 0 0 0 .fi -The stern of a ship moves when it turns. The bow remains stationary. +The stern of a ship moves when it turns. +The bow remains stationary. Ships can always turn, regardless of the wind (unless they are becalmed). -All ships drift when they lose headway. If a ship doesn't move forward -at all for two turns, it will begin to drift. If a ship has begun to +All ships drift when they lose headway. +If a ship doesn't move forward at all for two turns, it will begin to drift. +If a ship has begun to drift, then it must move forward before it turns, if it plans to do more than make a right or left turn, which is always possible. .PP Movement commands to .I Sail -are a string of forward moves and turns. An example is "l3". It will -turn a ship left and then move it ahead 3 spaces. In the drawing above, -the "b0" made 7 successive left turns. When +are a string of forward moves and turns. +An example is "l3". +It will turn a ship left and then move it ahead 3 spaces. +In the drawing above, the "b0" made 7 successive left turns. +When .I Sail -prompts you for a move, it prints three characters of import. E.g., +prompts you for a move, it prints three characters of import. +E.g., .nf move (7, 4): .fi -The first number is the maximum number of moves you can make, -including turns. The second number is the maximum number of turns -you can make. Between the numbers is sometimes printed a quote "'". +The first number is the maximum number of moves you can make, including turns. +The second number is the maximum number of turns you can make. +Between the numbers is sometimes printed a quote "'". If the quote is present, it means that your ship has been drifting, and you must move ahead to regain headway before you turn (see note above). Some of the possible moves for the example above are as follows: @@ -371,7 +416,8 @@ Some of the possible moves for the example above are as follows: .fi Because square riggers performed so poorly sailing into the wind, if at any point in a movement command you turn into the wind, the movement stops -there. E.g., +there. +E.g., .ne 1i .nf @@ -381,17 +427,20 @@ there. E.g., .fi Moreover, whenever you make a turn, your movement allowance drops to -min(what's left, what you would have at the new attitude). In short, -if you turn closer to the wind, you most likely won't be able to sail the -full allowance printed in the "move" prompt. +min(what's left, what you would have at the new attitude). +In short, if you turn closer to the wind, you most likely won't be able +to sail the full allowance printed in the "move" prompt. .PP -Old sailing captains had to keep an eye constantly on the wind. Captains -in +Old sailing captains had to keep an eye constantly on the wind. +Captains in .I Sail -are no different. A ship's ability to move depends on its attitude to the -wind. The best angle possible is to have the wind off your quarter, that is, -just off the stern. The direction rose on the side of the screen gives the -possible movements for your ship at all positions to the wind. Battle +are no different. +A ship's ability to move depends on its attitude to the wind. +The best angle possible is to have the wind off your quarter, that is, +just off the stern. +The direction rose on the side of the screen gives the +possible movements for your ship at all positions to the wind. +Battle sail speeds are given first, and full sail speeds are given in parenthesis. .nf @@ -404,17 +453,21 @@ sail speeds are given first, and full sail speeds are given in parenthesis. .fi Pretend the bow of your ship (the "^") is pointing upward and the wind is -blowing from the bottom to the top of the page. The -numbers at the bottom "3(6)" will be your speed under battle or full -sails in such a situation. If the wind is off your quarter, then you -can move "4(7)". If the wind is off your beam, "3(6)". If the wind is -off your bow, then you can only move "1(2)". Facing into the wind, you -can't move at all. Ships facing into the wind were said to be "in irons". +blowing from the bottom to the top of the page. +The numbers at the bottom "3(6)" will be your speed under battle or full +sails in such a situation. +If the wind is off your quarter, then you can move "4(7)". +If the wind is off your beam, "3(6)". +If the wind is off your bow, then you can only move "1(2)". +Facing into the wind, you can't move at all. +Ships facing into the wind were said to be "in irons". .SH WINDSPEED AND DIRECTION The windspeed and direction is displayed as a little weather vane on the -side of the screen. The number in the middle of the vane indicates the wind -speed, and the + to - indicates the wind direction. The wind blows from -the + sign (high pressure) to the - sign (low pressure). E.g., +side of the screen. +The number in the middle of the vane indicates the wind +speed, and the + to - indicates the wind direction. +The wind blows from the + sign (high pressure) to the - sign (low pressure). +E.g., .nf | @@ -426,9 +479,11 @@ The wind speeds are 0 = becalmed, 1 = light breeze, 2 = moderate breeze, 3 = fresh breeze, 4 = strong breeze, 5 = gale, 6 = full gale, 7 = hurricane. If a hurricane shows up, all ships are destroyed. .SH GRAPPLING AND FOULING -If two ships collide, they run the risk of becoming tangled together. This -is called "fouling." Fouled ships are stuck together, and neither can move. -They can unfoul each other if they want to. Boarding parties can only be +If two ships collide, they run the risk of becoming tangled together. +This is called "fouling." +Fouled ships are stuck together, and neither can move. +They can unfoul each other if they want to. +Boarding parties can only be sent across to ships when the antagonists are either fouled or grappled. .PP Ships can grapple each other by throwing grapnels into the rigging of @@ -437,8 +492,8 @@ the other. The number of fouls and grapples you have are displayed on the upper right of the screen. .SH BOARDING -Boarding was a very costly venture in terms of human life. Boarding parties -may be formed in +Boarding was a very costly venture in terms of human life. +Boarding parties may be formed in .I Sail to either board an enemy ship or to defend your own ship against attack. Men organized as Defensive Boarding Parties fight twice as hard to save @@ -447,39 +502,49 @@ their ship as men left unorganized. The boarding strength of a crew depends upon its quality and upon the number of men sent. .SH CREW QUALITY -The British seaman was world renowned for his sailing abilities. American -sailors, however, were actually the best seamen in the world. Because the +The British seaman was world renowned for his sailing abilities. +American sailors, however, were actually the best seamen in the world. +Because the American Navy offered twice the wages of the Royal Navy, British seamen who liked the sea defected to America by the thousands. .PP In .I Sail, -crew quality is quantized into 5 energy levels. "Elite" crews can outshoot -and outfight all other sailors. "Crack" crews are next. "Mundane" crews -are average, and "Green" and "Mutinous" crews are below average. A good -rule of thumb is that "Crack" or "Elite" crews get one extra hit -per broadside compared to "Mundane" crews. Don't expect too much from +crew quality is quantized into 5 energy levels. +"Elite" crews can outshoot and outfight all other sailors. +"Crack" crews are next. +"Mundane" crews +are average, and "Green" and "Mutinous" crews are below average. +A good rule of thumb is that "Crack" or "Elite" crews get one extra hit +per broadside compared to "Mundane" crews. +Don't expect too much from "Green" crews. .pl -1 .SH BROADSIDES Your two broadsides may be loaded with four kinds of shot: grape, chain, -round, and double. You have guns and carronades in both the port and starboard -batteries. Carronades only have a range of two, so you have to get in -close to be able to fire them. You have the choice of firing at the hull -or rigging of another ship. If the range of the ship is greater than 6, +round, and double. +You have guns and carronades in both the port and starboard batteries. +Carronades only have a range of two, so you have to get in +close to be able to fire them. +You have the choice of firing at the hull or rigging of another ship. +If the range of the ship is greater than 6, then you may only shoot at the rigging. .PP The types of shot and their advantages are: .SH ROUND -Range of 10. Good for hull or rigging hits. +Range of 10. +Good for hull or rigging hits. .SH DOUBLE -Range of 1. Extra good for hull or rigging hits. +Range of 1. +Extra good for hull or rigging hits. Double takes two turns to load. .SH CHAIN -Range of 3. Excellent for tearing down rigging. +Range of 3. +Excellent for tearing down rigging. Cannot damage hull or guns, though. .SH GRAPE -Range of 1. Sometimes devastating against enemy crews. +Range of 1. +Sometimes devastating against enemy crews. .PP On the side of the screen is displayed some vital information about your ship: @@ -494,55 +559,65 @@ ship: .fi "Load" shows what your port (left) and starboard (right) broadsides are -loaded with. A "!" after the type of shot indicates that it is an initial -broadside. Initial broadside were loaded with care before battle and before -the decks ran red with blood. As a consequence, initial broadsides are a -little more effective than broadsides loaded later. A "*" after the type of -shot indicates that the gun -crews are still loading it, and you cannot fire yet. "Hull" shows how much -hull you have left. "Crew" shows your three sections of crew. As your -crew dies off, your ability to fire decreases. "Guns" and "Carr" show -your port and starboard guns. As you lose guns, your ability to fire -decreases. "Rigg" shows how much rigging you have on your 3 or 4 masts. +loaded with. +A "!" after the type of shot indicates that it is an initial broadside. +Initial broadside were loaded with care before battle and before +the decks ran red with blood. +As a consequence, initial broadsides are a +little more effective than broadsides loaded later. +A "*" after the type of shot indicates that the gun +crews are still loading it, and you cannot fire yet. +"Hull" shows how much hull you have left. +"Crew" shows your three sections of crew. +As your crew dies off, your ability to fire decreases. +"Guns" and "Carr" show your port and starboard guns. +As you lose guns, your ability to fire decreases. +"Rigg" shows how much rigging you have on your 3 or 4 masts. As rigging is shot away, you lose mobility. .SH EFFECTIVENESS OF FIRE It is very dramatic when a ship fires its thunderous broadsides, but the -mere opportunity to fire them does not guarantee any hits. Many factors -influence the destructive force of a broadside. First of all, and the chief -factor, is distance. It is harder to hit a ship at range ten than it is -to hit one sloshing alongside. Next is raking. Raking fire, as -mentioned before, -can sometimes dismast a ship at range ten. Next, crew size and quality affects -the damage done by a broadside. The number of guns firing also bears on the -point, -so to speak. Lastly, weather affects the accuracy of a broadside. If the -seas are high (5 or 6), then the lower gunports of ships of the line can't -even be opened to run out the guns. This gives frigates and other flush -decked vessels an advantage in a storm. The scenario +mere opportunity to fire them does not guarantee any hits. +Many factors influence the destructive force of a broadside. +First of all, and the chief factor, is distance. +It is harder to hit a ship at range ten than it is +to hit one sloshing alongside. +Next is raking. +Raking fire, as mentioned before, can sometimes dismast a ship at range ten. +Next, crew size and quality affects the damage done by a broadside. +The number of guns firing also bears on the point, so to speak. +Lastly, weather affects the accuracy of a broadside. +If the seas are high (5 or 6), then the lower gunports +of ships of the line can't even be opened to run out the guns. +This gives frigates and other flush decked vessels an advantage in a storm. +The scenario .I Pellew vs. The Droits de L'Homme takes advantage of this peculiar circumstance. .SH REPAIRS Repairs may be made to your Hull, Guns, and Rigging at the slow rate of -two points per three turns. The message "Repairs Completed" will be -printed if no more repairs can be made. +two points per three turns. +The message "Repairs Completed" will be printed if no more repairs can be made. .SH PECULIARITIES OF COMPUTER SHIPS Computer ships in .I Sail -follow all the rules above with a few exceptions. Computer ships never -repair damage. If they did, the players could never beat them. They -play well enough as it is. As a consolation, the computer ships can fire double -shot every turn. That fluke is a good reason to keep your distance. The -.I -Driver -figures out the moves of the computer ships. It computes them with a typical -A.I. distance function and a depth first search to find the maximum "score." +follow all the rules above with a few exceptions. +Computer ships never repair damage. +If they did, the players could never beat them. +They play well enough as it is. +As a consolation, the computer ships can fire double shot every turn. +That fluke is a good reason to keep your distance. +The +.I Driver +figures out the moves of the computer ships. +It computes them with a typical A.I. distance +function and a depth first search to find the maximum "score." It seems to work fairly well, although I'll be the first to admit it isn't perfect. .SH HOW TO PLAY Commands are given to .I Sail -by typing a single character. You will then be prompted for further -input. A brief summary of the commands follows. +by typing a single character. +You will then be prompted for further input. +A brief summary of the commands follows. .br .SH COMMAND SUMMARY .nf @@ -590,7 +665,8 @@ Wind from the N, blowing a fresh breeze. Wind from the S, blowing a fresh breeze. .fi -This is John Paul Jones' first famous battle. Aboard the Bonhomme +This is John Paul Jones' first famous battle. +Aboard the Bonhomme Richard, he was able to overcome the Serapis's greater firepower by quickly boarding her. .nf @@ -761,8 +837,9 @@ Wind from the N, blowing a fresh breeze. Wind from the E, blowing a gale. .fi -A scenario for you Horny fans. Remember, he sank the Natividad -against heavy odds and winds. Hint: don't try to board the Natividad, +A scenario for you Horny fans. +Remember, he sank the Natividad against heavy odds and winds. +Hint: don't try to board the Natividad, her crew is much bigger, albeit green. .nf @@ -788,8 +865,10 @@ Wind from the S, blowing a strong breeze. .nf Wind from the E, blowing a fresh breeze. -The only battle Hornblower ever lost. He was able to dismast one -ship and stern rake the others though. See if you can do as well. +.fi +The only battle Hornblower ever lost. +He was able to dismast one ship and stern rake the others though. +See if you can do as well. .nf (b) Sutherland 74 gun Ship of the Line (crack crew) (26 pts) @@ -881,9 +960,9 @@ Captain Happy Horatio Nelson and many valiant others... .fi -.SH "REFERENCES" +.SH REFERENCES .nf -Wooden Ships & Iron Men, by Avalon Hill +Wooden Ships \*[Am] Iron Men, by Avalon Hill Captain Horatio Hornblower Novels, (13 of them) by C.S. Forester Captain Richard Bolitho Novels, (12 of them) by Alexander Kent The Complete Works of Captain Frederick Marryat, (about 20) especially diff --git a/snake/snake/snake.6.in b/snake/snake/snake.6.in index a53771c..d4fc06c 100644 --- a/snake/snake/snake.6.in +++ b/snake/snake/snake.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: snake.6,v 1.9 2001/04/02 22:47:30 wiz Exp $ +.\" $NetBSD: snake.6,v 1.10 2002/09/26 16:12:43 wiz Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -51,12 +51,14 @@ .Nm is a display-based game which must be played on a CRT terminal. The object of the game is to make as much money as possible without -getting eaten by the snake. The +getting eaten by the snake. +The .Fl l and .Fl w options allow you to specify the length and width of the field. -By default the entire screen is used. The +By default the entire screen is used. +The .Fl t option makes the game assume you are on a slow terminal. .Pp @@ -80,10 +82,12 @@ Other possibilities include: These keys are like hjkl but form a directed pad around the d key. .It Ic HJKL These keys move you all the way in the indicated direction to the -same row or column as the money. This does +same row or column as the money. +This does .Em not let you jump away from the snake, but rather saves you from having -to type a key repeatedly. The snake still gets all his turns. +to type a key repeatedly. +The snake still gets all his turns. .It Ic SEFC Likewise for the upper case versions on the left. .It Ic ATPB diff --git a/snake/snscore/Makefile.bsd b/snake/snscore/Makefile.bsd index 37efef5..7041fb4 100644 --- a/snake/snscore/Makefile.bsd +++ b/snake/snscore/Makefile.bsd @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.6 2001/12/12 00:07:49 tv Exp $ +# $NetBSD: Makefile,v 1.7 2002/09/18 06:16:41 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +NOMAN= # defined + PROG= snscore CPPFLAGS+= -I${.CURDIR}/../snake -NOMAN= # defined HIDEGAME= hidegame .include "../../Makefile.inc" diff --git a/substfiles2 b/substfiles2 index 531889d..4f9ebdb 100644 --- a/substfiles2 +++ b/substfiles2 @@ -1,7 +1,7 @@ # substfiles2 - list of files in which parameters are to be substituted. # These ones get substituted during the make process. # -# Copyright (c) 1997, 1998, 1999, 2000 Joseph Samuel Myers. +# Copyright (c) 1997, 1998, 1999, 2000, 2003 Joseph Samuel Myers. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -46,6 +46,5 @@ robots/robots.6 rogue/rogue.6 snake/snake/snake.6 tetris/tetris.6 -trek/trek.6 wtf/wtf.6 wtf/wtf diff --git a/tetris/input.c b/tetris/input.c index b21ad83..cae49c8 100644 --- a/tetris/input.c +++ b/tetris/input.c @@ -1,4 +1,4 @@ -/* $NetBSD: input.c,v 1.4 1999/01/03 02:00:17 hubertf Exp $ */ +/* $NetBSD: input.c,v 1.8 2002/12/29 15:12:17 kristerw Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -65,44 +66,41 @@ } /* - * Do a `read wait': select for reading from stdin, with timeout *tvp. + * Do a `read wait': poll for reading from stdin, with timeout *tvp. * On return, modify *tvp to reflect the amount of time spent waiting. * It will be positive only if input appeared before the time ran out; * otherwise it will be zero or perhaps negative. * - * If tvp is nil, wait forever, but return if select is interrupted. + * If tvp is nil, wait forever, but return if poll is interrupted. * * Return 0 => no input, 1 => can read() from stdin */ int rwait(tvp) - register struct timeval *tvp; + struct timeval *tvp; { - int i; - struct timeval starttv, endtv, *s; + struct pollfd set[1]; + struct timeval starttv, endtv; + int timeout; #define NILTZ ((struct timezone *)0) - /* - * Someday, select() will do this for us. - * Just in case that day is now, and no one has - * changed this, we use a temporary. - */ if (tvp) { (void) gettimeofday(&starttv, NILTZ); endtv = *tvp; - s = &endtv; + timeout = tvp->tv_sec * 1000 + tvp->tv_usec / 1000; } else - s = 0; + timeout = INFTIM; again: - i = 1; - switch (select(1, (fd_set *)&i, (fd_set *)0, (fd_set *)0, s)) { + set[0].fd = STDIN_FILENO; + set[0].events = POLLIN; + switch (poll(set, 1, timeout)) { case -1: if (tvp == 0) return (-1); if (errno == EINTR) goto again; - stop("select failed, help"); + stop("poll failed, help"); /* NOTREACHED */ case 0: /* timed out */ @@ -120,7 +118,7 @@ rwait(tvp) } /* - * `sleep' for the current turn time (using select). + * `sleep' for the current turn time. * Eat any input that might be available. */ void diff --git a/tetris/scores.c b/tetris/scores.c index 131291e..480b4c1 100644 --- a/tetris/scores.c +++ b/tetris/scores.c @@ -1,4 +1,4 @@ -/* $NetBSD: scores.c,v 1.10 2000/01/21 02:10:56 jsm Exp $ */ +/* $NetBSD: scores.c,v 1.11 2002/06/02 22:17:38 wiz Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -153,8 +153,8 @@ void savescore(level) int level; { - register struct highscore *sp; - register int i; + struct highscore *sp; + int i; int change; FILE *sf; const char *me; @@ -219,9 +219,9 @@ savescore(level) static char * thisuser() { - register const char *p; - register struct passwd *pw; - register size_t l; + const char *p; + struct passwd *pw; + size_t l; static char u[sizeof(scores[0].hs_name)]; if (u[0]) @@ -252,8 +252,8 @@ static int cmpscores(x, y) const void *x, *y; { - register const struct highscore *a, *b; - register long l; + const struct highscore *a, *b; + long l; a = x; b = y; @@ -280,17 +280,17 @@ cmpscores(x, y) */ static int checkscores(hs, num) - register struct highscore *hs; + struct highscore *hs; int num; { - register struct highscore *sp; - register int i, j, k, numnames; + struct highscore *sp; + int i, j, k, numnames; int levelfound[NLEVELS]; struct peruser { char *name; int times; } count[NUMSPOTS]; - register struct peruser *pu; + struct peruser *pu; /* * Sort so that highest totals come first. @@ -356,8 +356,8 @@ void showscores(level) int level; { - register struct highscore *sp; - register int i, n, c; + struct highscore *sp; + int i, n, c; const char *me; int levelfound[NLEVELS]; @@ -408,11 +408,11 @@ showscores(level) static void printem(level, offset, hs, n, me) int level, offset; - register struct highscore *hs; - register int n; + struct highscore *hs; + int n; const char *me; { - register struct highscore *sp; + struct highscore *sp; int nrows, row, col, item, i, highlight; char buf[100]; #define TITLE "Rank Score Name (points/level)" diff --git a/tetris/screen.c b/tetris/screen.c index 2722472..5b81e4f 100644 --- a/tetris/screen.c +++ b/tetris/screen.c @@ -182,13 +182,13 @@ scr_init() stop("cannot find your termcap"); fill = combuf; { - register struct tcsinfo *p; + struct tcsinfo *p; for (p = tcstrings; p->tcaddr; p++) *p->tcaddr = tgetstr(p->tcname, &fill); } { - register struct tcninfo *p; + struct tcninfo *p; for (p = tcflags; p->tcaddr; p++) *p->tcaddr = tgetflag(p->tcname); @@ -378,9 +378,9 @@ typedef cell regcell; void scr_update() { - register cell *bp, *sp; - register regcell so, cur_so = 0; - register int i, ccol, j; + cell *bp, *sp; + regcell so, cur_so = 0; + int i, ccol, j; sigset_t sigset, osigset; static const struct shape *lastshape; @@ -490,12 +490,12 @@ scr_update() */ void scr_msg(s, set) - register char *s; + char *s; int set; { if (set || CEstr == NULL) { - register int l = strlen(s); + int l = strlen(s); moveto(Rows - 2, ((Cols - l) >> 1) - 1); if (set) diff --git a/tetris/shapes.c b/tetris/shapes.c index 86f249c..32c7814 100644 --- a/tetris/shapes.c +++ b/tetris/shapes.c @@ -1,4 +1,4 @@ -/* $NetBSD: shapes.c,v 1.4 1999/09/08 21:18:01 jsm Exp $ */ +/* $NetBSD: shapes.c,v 1.5 2002/06/02 22:17:38 wiz Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -85,9 +85,9 @@ const struct shape shapes[] = { int fits_in(shape, pos) const struct shape *shape; - register int pos; + int pos; { - register int *o = shape->off; + int *o = shape->off; if (board[pos] || board[pos + *o++] || board[pos + *o++] || board[pos + *o]) @@ -102,9 +102,9 @@ fits_in(shape, pos) void place(shape, pos, onoff) const struct shape *shape; - register int pos, onoff; + int pos, onoff; { - register int *o = shape->off; + int *o = shape->off; board[pos] = onoff; board[pos + *o++] = onoff; diff --git a/tetris/tetris.6.in b/tetris/tetris.6.in index a68cf39..16184a1 100644 --- a/tetris/tetris.6.in +++ b/tetris/tetris.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: tetris.6,v 1.7 2001/04/02 22:42:39 wiz Exp $ +.\" $NetBSD: tetris.6,v 1.9 2002/09/26 18:32:05 wiz Exp $ .\" .\" Copyright (c) 1992, 1993 .\" The Regents of the University of California. All rights reserved. @@ -60,14 +60,14 @@ The default level of play is 2. .Pp The default control keys are as follows: .Pp -.Bl -tag -width "" -compact -offset indent +.Bl -tag -width "xxspacexx" -compact -offset indent .It j move left .It k rotate 1/4 turn counterclockwise .It l move right -.It +.It Aq space drop .It p pause @@ -110,7 +110,7 @@ at level 9, they fall 9 times per second. (As the game goes on, things speed up, no matter what your initial selection.) When this shape -.Dq "touches down" +.Dq touches down on the bottom of the field, another will appear at the top. .Pp You can move shapes to the left or right, rotate them counterclockwise, diff --git a/tetris/tetris.c b/tetris/tetris.c index 6e3fc0b..474a662 100644 --- a/tetris/tetris.c +++ b/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $NetBSD: tetris.c,v 1.14 2000/01/21 02:10:57 jsm Exp $ */ +/* $NetBSD: tetris.c,v 1.15 2002/06/02 22:17:38 wiz Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -92,8 +92,8 @@ static void setup_board __P((void)); static void setup_board() { - register int i; - register cell *p; + int i; + cell *p; p = board; for (i = B_SIZE; i; i--) @@ -106,8 +106,8 @@ setup_board() static void elide() { - register int i, j, base; - register cell *p; + int i, j, base; + cell *p; for (i = A_FIRST; i < A_LAST; i++) { base = i * B_COLS + 1; @@ -133,9 +133,9 @@ main(argc, argv) int argc; char *argv[]; { - register int pos, c; - register const char *keys; - register int level = 2; + int pos, c; + const char *keys; + int level = 2; char key_write[6][10]; int ch, i, j; int fd; diff --git a/trek/USD.doc/Makefile.bsd b/trek/USD.doc/Makefile.bsd index ff84826..a01b232 100644 --- a/trek/USD.doc/Makefile.bsd +++ b/trek/USD.doc/Makefile.bsd @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 1995/04/22 10:59:48 cgd Exp $ +# $NetBSD: Makefile,v 1.3 2003/01/05 12:34:27 pooka Exp $ # @(#)Makefile 8.1 (Berkeley) 6/8/93 DIR= usd/31.trek @@ -6,6 +6,6 @@ SRCS= trek.me MACROS= -me paper.ps: ${SRCS} - ${TBL} ${SRCS} | ${ROFF} > ${.TARGET} + ${TBL} ${SRCS} | ${ROFF} ${MACROS} > ${.TARGET} .include diff --git a/trek/damage.c b/trek/damage.c index dfe29f4..2183da6 100644 --- a/trek/damage.c +++ b/trek/damage.c @@ -1,4 +1,4 @@ -/* $NetBSD: damage.c,v 1.4 1997/10/12 21:24:36 christos Exp $ */ +/* $NetBSD: damage.c,v 1.5 2002/07/20 08:36:23 grant Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)damage.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: damage.c,v 1.4 1997/10/12 21:24:36 christos Exp $"); +__RCSID("$NetBSD: damage.c,v 1.5 2002/07/20 08:36:23 grant Exp $"); #endif #endif /* not lint */ @@ -97,5 +97,5 @@ double dam; /* time to repair */ reschedule(e, e->date - Now.date + dam); return; } - errx(1, "Cannot find old damages %d\n", dev); + errx(1, "Cannot find old damages %d", dev); } diff --git a/trek/getpar.c b/trek/getpar.c index 7c13b91..d5f679a 100644 --- a/trek/getpar.c +++ b/trek/getpar.c @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.c,v 1.8 2000/07/03 03:57:44 matt Exp $ */ +/* $NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getpar.c,v 1.8 2000/07/03 03:57:44 matt Exp $"); +__RCSID("$NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $"); #endif #endif /* not lint */ @@ -145,7 +145,7 @@ const struct cvntab *getcodpar(s, tab) if (f) cgetc(0); /* throw out the newline */ scanf("%*[ \t;]"); - if ((c = scanf("%[^ \t;\n]", input)) < 0) + if ((c = scanf("%99[^ \t;\n]", input)) < 0) exit(1); if (c == 0) continue; @@ -291,7 +291,7 @@ testterm() /* -** TEST FOR SPECIFIED DELIMETER +** TEST FOR SPECIFIED DELIMITER ** ** The standard input is scanned for the parameter. If found, ** it is thrown away and non-zero is returned. If not found, diff --git a/trek/trek.6.in b/trek/trek.6 similarity index 95% rename from trek/trek.6.in rename to trek/trek.6 index 4522228..d3376ee 100644 --- a/trek/trek.6.in +++ b/trek/trek.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: trek.6,v 1.8 2001/04/02 22:42:39 wiz Exp $ +.\" $NetBSD: trek.6,v 1.10 2002/09/26 18:32:05 wiz Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. @@ -40,14 +40,15 @@ .Nm trek .Nd trekkie game .Sh SYNOPSIS -.Nm @gamesdir@/trek +.Nm .Oo .Op Fl a .Ar file .Oc .Sh DESCRIPTION .Nm -is a game of space glory and war. Below is a summary of commands. +is a game of space glory and war. +Below is a summary of commands. For complete documentation, see .Em Trek by Eric Allman. @@ -79,7 +80,7 @@ You should normally start out with a novice and work up. In general, throughout the game, if you forget what is appropriate the game will tell you what it expects if you just type in a question mark. .Sh AUTHOR -Eric Allman +.An Eric Allman .Sh SEE ALSO .Pa /usr/share/doc/usd/31.trek .Sh COMMAND SUMMARY diff --git a/wargames/wargames.6 b/wargames/wargames.6 index ac930b4..b2228ae 100644 --- a/wargames/wargames.6 +++ b/wargames/wargames.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: wargames.6,v 1.1 2000/01/23 21:04:56 jsm Exp $ +.\" $NetBSD: wargames.6,v 1.4 2002/09/26 18:32:05 wiz Exp $ .\" .\" Copyright (c) 1998 Joey Hess .\" All rights reserved. @@ -39,11 +39,11 @@ -- computer, .Nm wargames .Pp -Just like in the movie, the computer will happily play a -game with you. The likelihood of Global Thermonuclear Warfare -resulting is much smaller.... +Just like in the movie, the computer will happily play a game with you. +The likelihood of Global Thermonuclear Warfare resulting is much smaller.... .Sh SEE ALSO .Sy Wargames , the movie (an MGM production, PGP 13, directed by John Badham, 1983). .Sh AUTHOR -This manual page was written by Joey Hess . +This manual page was written by Joey Hess +.Aq joeyh@kitenet.net . diff --git a/worm/worm.6 b/worm/worm.6 index 364f197..e031237 100644 --- a/worm/worm.6 +++ b/worm/worm.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: worm.6,v 1.7 2001/08/29 23:25:58 jsm Exp $ +.\" $NetBSD: worm.6,v 1.9 2003/02/25 10:34:47 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -44,22 +44,23 @@ .Op Ar size .Sh DESCRIPTION In -.Nm "" , +.Nm , you are a little worm, your body is the "o"'s on the screen -and your head is the "@". You move with the hjkl keys and the arrow -keys (as in the game -snake). If you don't press any keys, you continue in the direction you -last moved. The upper case HJKL keys move you as if you had pressed +and your head is the "@". +You move with the hjkl keys and the arrow keys (as in the game snake). +If you don't press any keys, you continue in the direction you last moved. +The upper case HJKL keys move you as if you had pressed several (9 for HL and 5 for JK) of the corresponding lower case key (unless you run into a digit, then it stops). .Pp On the screen you will see a digit, if your worm eats the digit is will grow longer, the actual amount longer depends on which digit it was -that you ate. The object of the game is to see how long you can make -the worm grow. +that you ate. +The object of the game is to see how long you can make the worm grow. .Pp The game ends when the worm runs into either the sides of the screen, -or itself. The current score (how much the worm has grown) is kept in +or itself. +The current score (how much the worm has grown) is kept in the upper left corner of the screen. .Pp The optional argument, if present, is the initial length of the worm. diff --git a/worms/worms.6 b/worms/worms.6 index 862165d..a8fd398 100644 --- a/worms/worms.6 +++ b/worms/worms.6 @@ -1,4 +1,4 @@ -.\" $NetBSD: worms.6,v 1.11 2001/04/02 22:42:39 wiz Exp $ +.\" $NetBSD: worms.6,v 1.12 2002/09/26 16:12:43 wiz Exp $ .\" .\" Copyright (c) 1989, 1993 .\" The Regents of the University of California. All rights reserved. @@ -59,9 +59,10 @@ for the worm(s) to eat. .It Fl t Makes each worm leave a trail behind it. .It Fl d -Specifies a delay, in milliseconds, between each update. This is -useful for fast terminals. Reasonable values are around 20-200. The -default is 0. +Specifies a delay, in milliseconds, between each update. +This is useful for fast terminals. +Reasonable values are around 20-200. +The default is 0. .It Fl l Specifies a length for each worm; the default is 16. .It Fl n diff --git a/wtf/acronyms b/wtf/acronyms index 88dc443..de9ff5b 100644 --- a/wtf/acronyms +++ b/wtf/acronyms @@ -1,12 +1,14 @@ -$NetBSD: acronyms,v 1.102 2002/01/19 13:40:33 wiz Exp $ +$NetBSD: acronyms,v 1.113 2003/02/05 20:11:04 mason Exp $ AFAICR as far as I can recall AFAICT as far as I can tell AFAIK as far as I know AFAIR as far as I recall +AFAIU as far as I understand AFD away from desktop AFK away from keyboard AFW away from window +AIU as I understand AIUI as I understand it AKA also known as ASAP as soon as possible @@ -30,6 +32,7 @@ BTTH boot to the head BTW by the way CMIIW correct me if I'm wrong CNP continued [in my] next post +COB close of business [day] CYA see you around DKDC don't know, don't care DSTM don't shoot the messenger @@ -38,6 +41,8 @@ DTWT do the wrong thing DWIM do what I mean EG evil grin EMSG email message +EOB end of business [day] +EOL end of life ETLA extended three letter acronym EWAG experienced wild-ass guess FAQ frequently asked question @@ -53,6 +58,7 @@ FUD fear, uncertainty and doubt FWIW for what it's worth FYI for your information G grin +GIGO garbage in, garbage out GMTA great minds think alike GTFO get the fuck out HAND have a nice day @@ -63,12 +69,14 @@ IHAFC I haven't a fucking clue IHNFC I have no fucking clue IIANM if I am not mistaken IIRC if I recall correctly +IMAO in my arrogant opinion IMCO in my considered opinion IMHO in my humble opinion IMNSHO in my not so humble opinion IMO in my opinion IOW in other words IRL in real life +ISAGN I see a great need ISTM it seems to me ISTR I seem to recall ITYM I think you mean @@ -83,6 +91,7 @@ KNF kernel normal form L8R later LART luser attitude readjustment tool (ie, hammer) LJBF let's just be friends +LMAO laughing my ass off LMSO laughing my socks off LOL laughing out loud LTNS long time no see @@ -103,12 +112,14 @@ NRN no reply necessary OIC oh, I see OTL out to lunch OTOH on the other hand +OTT over the top OTTOMH off the top of my head PFO please fuck off PFY pimply faced youth PITA pain in the ass PKSP pound keys and spew profanity PNG persona non grata +PNP plug and pray POC point of contact POLA principle of least astonishment POS piece of shit @@ -131,6 +142,7 @@ SCNR sorry, could not resist SEP someone else's problem SFA sweet fuck all SHID slaps head in disgust +SIMCA sitting in my chair amused SMLSFB so many losers, so few bullets SMOP simple matter of programming SNAFU situation normal, all fucked up @@ -138,6 +150,7 @@ SNERT snot-nosed egotistical rude teenager SO significant other SOB son of [a] bitch SOL shit out [of] luck +SOP standard operating procedure SSIA subject says it all SUS stupid user syndrome SWAG silly, wild-assed guess @@ -150,8 +163,10 @@ TLA three letter acronym TLB translation lookaside buffer TMA too many abbreviations TMI too much information +TOEFL test of english as a foreign language TTFN ta ta for now TTYL talk to you later +TWIAVBP the world is a very big place TYVM thank you very much UTSL use the source, Luke VEG very evil grin diff --git a/wtf/wtf.6.in b/wtf/wtf.6.in index 412ee6c..93cdc1a 100644 --- a/wtf/wtf.6.in +++ b/wtf/wtf.6.in @@ -1,4 +1,4 @@ -.\" $NetBSD: wtf.6,v 1.4 2001/04/02 22:42:40 wiz Exp $ +.\" $NetBSD: wtf.6,v 1.5 2002/09/26 16:12:44 wiz Exp $ .\" .\" Public Domain .\" @@ -16,7 +16,8 @@ The .Nm utility displays the expansion of the acronyms -specified on the command line. If the acronym is unknown, +specified on the command line. +If the acronym is unknown, .Nm will check to see if the acronym is known by the .Xr whatis 1 diff --git a/wtf/wtf.in b/wtf/wtf.in index 0e8e499..23ac184 100755 --- a/wtf/wtf.in +++ b/wtf/wtf.in @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: wtf,v 1.7 2000/11/21 00:18:52 soren Exp $ +# $NetBSD: wtf,v 1.8 2003/02/06 15:17:01 salo Exp $ # # Public domain # @@ -19,7 +19,7 @@ rv=0 while [ $# -gt 0 ] ; do target=`echo $1 | tr '[a-z]' '[A-Z]'` ans=`fgrep $target < $acronyms 2>/dev/null \ - | sed -ne "/^$target[[:space:]]/s/^$target[[:space:]]*//p"` + | sed -ne "\|^$target[[:space:]]|s|^$target[[:space:]]*||p"` if [ "$ans" != "" ] ; then echo "$target: $ans" else