X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/dfc4e173d46d915ee76e5e481a35c6ce6c385633..053f2cb3f40dbb587e71b330841d5f4dd6598877:/hack/hack.read.c diff --git a/hack/hack.read.c b/hack/hack.read.c index 53717f0f..3a232eed 100644 --- a/hack/hack.read.c +++ b/hack/hack.read.c @@ -1,20 +1,80 @@ -/* $NetBSD: hack.read.c,v 1.6 2001/02/05 00:37:43 christos Exp $ */ +/* $NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */ /* - * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. + * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, + * Amsterdam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - 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. + * + * - Neither the name of the Stichting Centrum voor Wiskunde en + * Informatica, nor the names of its contributors may be used to endorse or + * promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982 Jay Fenlason + * 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. */ #include #ifndef lint -__RCSID("$NetBSD: hack.read.c,v 1.6 2001/02/05 00:37:43 christos Exp $"); +__RCSID("$NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $"); #endif /* not lint */ #include #include "hack.h" #include "extern.h" +static int identify(struct obj *); +static int monstersym(int); + int -doread() +doread(void) { struct obj *scroll; boolean confused = (Confusion != 0); @@ -470,9 +530,8 @@ doread() return (1); } -int -identify(otmp) /* also called by newmail() */ - struct obj *otmp; +static int +identify(struct obj *otmp) /* also called by newmail() */ { objects[otmp->otyp].oc_name_known = 1; otmp->known = otmp->dknown = 1; @@ -481,8 +540,7 @@ identify(otmp) /* also called by newmail() */ } void -litroom(on) - boolean on; +litroom(boolean on) { #ifndef QUEST int num, zx, zy; @@ -569,11 +627,10 @@ do_it: } /* Test whether we may genocide all monsters with symbol ch */ -int -monstersym(ch) /* arnold@ucsfcgl */ - char ch; +static int +monstersym(int ch) /* arnold@ucsfcgl */ { - struct permonst *mp; + const struct permonst *mp; /* * can't genocide certain monsters