-/* $NetBSD: alloc.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: alloc.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: alloc.c,v 1.7 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
return ((long *) ptr);
}
-long *
+#if 0 /* unused */
+static long *
enlarge(char *ptr, unsigned lth)
{
char *nptr;
panic("Cannot reallocate %d bytes", lth);
return ((long *) nptr);
}
+#endif
#endif /* LINT */
-/* $NetBSD: def.func_tab.h,v 1.7 2004/01/27 20:30:29 jsm Exp $ */
+/* $NetBSD: def.func_tab.h,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
int (*f_funct)(void);
};
-extern const struct func_tab cmdlist[];
+/*extern const struct func_tab cmdlist[];*/
struct ext_func_tab {
const char *ef_txt;
int (*ef_funct)(void);
};
-extern const struct ext_func_tab extcmdlist[];
+/*extern const struct ext_func_tab extcmdlist[];*/
#endif /* _DEF_FUNC_TAB_H_ */
-/* $NetBSD: extern.h,v 1.11 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.12 2009/08/12 07:28:40 dholland Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
/* alloc.c */
long *alloc(unsigned);
-long *enlarge(char *, unsigned);
/* hack.apply.c */
int doapply(void);
void unsee(void);
void seeoff(int);
void domove(void);
-void movobj(struct obj *, int, int);
int dopickup(void);
void pickup(int);
void lookaround(void);
void losehp_m(int, struct monst *);
void losexp(void);
int inv_weight(void);
-int inv_cnt(void);
long newuexp(void);
/* hack.cmd.c */
void rhack(const char *);
-int doextcmd(void);
-char lowc(int);
-char unctrl(int);
int movecmd(int);
int getdir(boolean);
void confdir(void);
/* hack.do.c */
int dodrop(void);
void dropx(struct obj *);
-void dropy(struct obj *);
int doddrop(void);
int dodown(void);
int doup(void);
/* hack.do_name.c */
coord getpos(int, const char *);
int do_mname(void);
-void do_oname(struct obj *);
int ddocall(void);
void docall(struct obj *);
-char *xmonnam(struct monst *, int);
-char *lmonnam(struct monst *);
char *monnam(struct monst *);
char *Monnam(struct monst *);
char *amonnam(struct monst *, const char *);
char *Amonnam(struct monst *, const char *);
char *Xmonnam(struct monst *);
-char *visctrl(int);
/* hack.do_wear.c */
-void off_msg(struct obj *);
int doremarm(void);
int doremring(void);
-int dorr(struct obj *);
-int cursed(struct obj *);
int armoroff(struct obj *);
int doweararm(void);
int dowearring(void);
/* hack.dog.c */
void makedog(void);
-void initedog(struct monst *);
void losedogs(void);
void keepdogs(void);
void fall_down(struct monst *);
-int dogfood(struct obj *);
int dog_move(struct monst *, int);
int inroom(xchar, xchar);
int tamedog(struct monst *, struct obj *);
/* hack.eat.c */
void init_uhunger(void);
-int opentin(void);
-int Meatdone(void);
int doeat(void);
void gethungry(void);
void morehungry(int);
void lesshungry(int);
-int unfaint(void);
-void newuhs(boolean);
int poisonous(struct obj *);
-int eatcorpse(struct obj *);
/* hack.end.c */
int dodone(void);
void done1(int);
-void done_intr(int);
-void done_hangup(int);
void done_in_by(struct monst *);
void done(const char *);
-void topten(void);
-void outheader(void);
-struct toptenentry;
-int outentry(int, struct toptenentry *, int);
-char *itoa(int);
-const char *ordin(int);
void clearlocks(void);
void hangup(int) __attribute__((__noreturn__));
char *eos(char *);
void prscore(int, char **);
/* hack.engrave.c */
-struct engr *engr_at(xchar, xchar);
int sengr_at(const char *, xchar, xchar);
void u_wipe_engr(int);
void wipe_engr_at(xchar, xchar, xchar);
int doengrave(void);
void save_engravings(int);
void rest_engravings(int);
-void del_engr(struct engr *);
/* hack.fight.c */
int hitmm(struct monst *, struct monst *);
void mondied(struct monst *);
-void monstone(struct monst *);
int fightm(struct monst *);
int thitu(int, int, const char *);
boolean hmon(struct monst *, struct obj *, int);
struct obj *o_on(unsigned int, struct obj *);
struct trap *t_at(int, int);
struct gold *g_at(int, int);
-struct obj *mkgoldobj(long);
struct obj *getobj(const char *, const char *);
-int ckunpaid(struct obj *);
int ggetobj(const char *, int (*fn)(struct obj *), int);
int askchain(struct obj *, char *, int, int (*)(struct obj *),
int (*)(struct obj *), int);
-char obj_to_let(struct obj *);
void prinv(struct obj *);
int ddoinv(void);
-void doinv(char *);
int dotypeinv(void);
int dolook(void);
void stackobj(struct obj *);
-int merged(struct obj *, struct obj *, int);
-int countgold(void);
int doprgold(void);
int doprwep(void);
int doprarm(void);
void bwrite(int, const void *, size_t);
void saveobjchn(int, struct obj *);
void savemonchn(int, struct monst *);
-void savegoldchn(int, struct gold *);
-void savetrapchn(int, struct trap *);
void getlev(int, int, xchar);
void mread(int, char *, unsigned);
void mklev(void);
int hitu(struct monst *, int);
/* hack.mklev.c */
-void makelevel(void);
-int makerooms(void);
-void addrs(int, int, int, int);
-void addrsx(int, int, int, int, boolean);
struct mkroom;
-int comp(const void *, const void *);
-coord finddpos(int, int, int, int);
-int okdoor(int, int);
-void dodoor(int, int, struct mkroom *);
-void dosdoor(int, int, struct mkroom *, int);
-int maker(schar, schar, schar, schar);
-void makecorridors(void);
-void join(int, int);
-void make_niches(void);
-void makevtele(void);
-void makeniche(boolean);
+void makelevel(void);
void mktrap(int, int, struct mkroom *);
/* hack.mkmaze.c */
void makemaz(void);
-void walkfrom(int, int);
-void move(int *, int *, int);
-int okay(int, int, int);
coord mazexy(void);
/* hack.mkobj.c */
/* hack.mkshop.c */
void mkshop(void);
void mkzoo(int);
-const struct permonst *morguemon(void);
void mkswamp(void);
-int nexttodoor(int, int);
-int has_dnstairs(struct mkroom *);
-int has_upstairs(struct mkroom *);
-int isbig(struct mkroom *);
-int dist2(int, int, int, int);
-int sq(int);
/* hack.mon.c */
void movemon(void);
void justswld(struct monst *, const char *);
void youswld(struct monst *, int, int, const char *);
-int dochugw(struct monst *);
int dochug(struct monst *);
int m_move(struct monst *, int);
-void mpickgold(struct monst *);
-void mpickgems(struct monst *);
int mfndpos(struct monst *, coord[9 ], int[9 ], int);
int dist(int, int);
void poisoned(const char *, const char *);
void replmon(struct monst *, struct monst *);
void relmon(struct monst *);
void monfree(struct monst *);
-void dmonsfree(void);
void unstuck(struct monst *);
void killed(struct monst *);
void kludge(const char *, const char *);
void rescham(void);
int newcham(struct monst *, const struct permonst *);
void mnexto(struct monst *);
-int ishuman(struct monst *);
void setmangry(struct monst *);
int canseemon(struct monst *);
int letindex(int);
void init_objects(void);
int probtype(int);
-void setgemprobs(void);
void oinit(void);
void savenames(int);
void restnames(int);
int dodiscovered(void);
-int interesting_to_discover(int);
/* hack.objnam.c */
-char *strprepend(char *, char *);
-char *sitoa(int);
char *typename(int);
char *xname(struct obj *);
char *doname(struct obj *);
/* hack.options.c */
void initoptions(void);
-void parseoptions(char *, boolean);
int doset(void);
/* hack.pager.c */
int dowhatis(void);
-void intruph(int);
-void page_more(FILE *, int);
void set_whole_screen(void);
int readnews(void);
void set_pager(int);
int page_line(const char *);
void cornline(int, const char *);
int dohelp(void);
-int page_file(const char *, boolean);
int dosh(void);
-int child(int);
/* hack.potion.c */
int dodrink(void);
void potionhit(struct monst *, struct obj *);
void potionbreathe(struct obj *);
int dodip(void);
-void ghost_from_bottle(void);
/* hack.pri.c */
void swallowed(void);
void pmon(struct monst *);
void unpmon(struct monst *);
void nscr(void);
-void cornbot(int);
void bot(void);
void mstatusline(struct monst *);
void cls(void);
/* hack.read.c */
int doread(void);
-int identify(struct obj *);
void litroom(boolean);
-int monstersym(int);
/* hack.rip.c */
void outrip(void);
-void center(int, char *);
/* hack.rumors.c */
-void init_rumors(FILE *);
-int skipline(FILE *);
-void outline(FILE *);
void outrumor(void);
-int used(int);
/* hack.save.c */
int dosave(void);
-int dosave0(int);
int dorecover(int);
struct obj *restobjchn(int);
struct monst *restmonchn(int);
int inshop(void);
int dopay(void);
struct bill_x;
-struct obj *bp_to_obj(struct bill_x *);
void addtobill(struct obj *);
void splitbill(struct obj *, struct obj *);
void subfrombill(struct obj *);
/* hack.steal.c */
long somegold(void);
void stealgold(struct monst *);
-int stealarm(void);
int steal(struct monst *);
void mpickobj(struct monst *, struct obj *);
int stealamulet(struct monst *);
void start_screen(void);
void end_screen(void);
void curs(int, int);
-void nocmov(int, int);
-void cmov(int, int);
-int xputc(int);
-void xputs(const char *);
void cl_end(void);
void clear_screen(void);
void home(void);
/* hack.timeout.c */
void timeout(void);
-void stoned_dialogue(void);
/* hack.topl.c */
int doredotopl(void);
-void redotoplin(void);
void remember_topl(void);
void addtopl(const char *);
-void xmore(const char *);
void more(void);
void cmore(const char *);
void clrlin(void);
void selftouch(const char *);
void float_up(void);
void float_down(void);
-void vtele(void);
void tele(void);
-void teleds(int, int);
-int teleok(int, int);
int dotele(void);
void placebc(int);
void unplacebc(void);
/* hack.tty.c */
void gettty(void);
void settty(const char *);
-void setctty(void);
void setftty(void);
void error(const char *, ...)
__attribute__((__format__(__printf__, 1, 2),__noreturn__));
/* hack.u_init.c */
void u_init(void);
struct trobj;
-void ini_inv(struct trobj *);
-void wiz_inv(void);
void plnamesuffix(void);
-int role_index(int);
/* hack.unix.c */
void setrandom(void);
-struct tm *getlt(void);
int getyear(void);
char *getdatestr(void);
int phase_of_the_moon(void);
int midnight(void);
void gethdate(char *);
int uptodate(int);
-int veryold(int);
void getlock(void);
void getmailstatus(void);
void ckmailstatus(void);
void amulet(void);
int wiz_hit(struct monst *);
void inrange(struct monst *);
-void aggravate(void);
-void clonewiz(struct monst *);
/* hack.worm.c */
#ifndef NOWORM
struct wseg;
void pwseg(struct wseg *);
void cutworm(struct monst *, xchar, xchar, uchar);
-void remseg(struct wseg *);
#endif
/* hack.worn.c */
void setnotworn(struct obj *);
/* hack.zap.c */
-void bhitm(struct monst *, struct obj *);
-int bhito(struct obj *, struct obj *);
int dozap(void);
const char *exclam(int);
void hit(const char *, struct monst *, const char *);
int (*)(struct obj *, struct obj *),
struct obj *);
struct monst *boomhit(int, int);
-char dirlet(int, int);
void buzz(int, xchar, xchar, int, int);
-int zhit(struct monst *, int);
-int revive(struct obj *);
-void rloco(struct obj *);
void fracture_rock(struct obj *);
-void burn_scrolls(void);
/* rnd.c */
int rn1(int, int);
-/* $NetBSD: hack.bones.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.bones.c,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.bones.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.bones.c,v 1.8 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include <fcntl.h>
#include <unistd.h>
-char bones[] = "bones_xx";
+static char bones[] = "bones_xx";
/* save bones and possessions of a deceased adventurer */
void
-/* $NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void movobj(struct obj *, int, int);
+static int inv_cnt(void);
+
/*
* called on movement: 1. when throwing ball+chain far away 2. when
* teleporting 3. when walking out of a lit room
read_engr_at(u.ux, u.uy);
}
-void
+static void
movobj(struct obj *obj, int ox, int oy)
{
/* Some dirty programming to get display right */
return (wt - carrcap);
}
-int
+static int
inv_cnt(void)
{
struct obj *otmp = invent;
-/* $NetBSD: hack.cmd.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.cmd.c,v 1.10 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.cmd.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.cmd.c,v 1.10 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
#include "def.func_tab.h"
-const struct func_tab cmdlist[] = {
+static int doextcmd(void);
+
+static const struct func_tab cmdlist[] = {
{ '\020', doredotopl },
{ '\022', doredraw },
{ '\024', dotele },
{ 0, 0 }
};
-const struct ext_func_tab extcmdlist[] = {
+static const struct ext_func_tab extcmdlist[] = {
{ "dip", dodip },
{ "pray", dopray },
{ (char *) 0, donull }
};
+static char lowc(int);
+static char unctrl(int);
+
void
rhack(const char *cmd)
{
multi = flags.move = 0;
}
-int
+static int
doextcmd(void)
{ /* here after # - now read a full-word
* command */
return (0);
}
-char
+static char
lowc(int sym)
{
return ((sym >= 'A' && sym <= 'Z') ? sym + 'a' - 'A' : sym);
}
-char
+static char
unctrl(int sym)
{
return ((sym >= ('A' & 037) && sym <= ('Z' & 037)) ? sym + 0140 : sym);
char sdir[] = "hykulnjb><";
schar xdir[10] = {-1, -1, 0, 1, 1, 1, 0, -1, 0, 0};
schar ydir[10] = {0, -1, -1, -1, 0, 1, 1, 1, 0, 0};
-schar zdir[10] = {0, 0, 0, 0, 0, 0, 0, 0, 1, -1};
+static schar zdir[10] = {0, 0, 0, 0, 0, 0, 0, 0, 1, -1};
int
movecmd(int sym) /* also sets u.dz, but returns false for <> */
-/* $NetBSD: hack.do.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.do.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.do.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
/* Contains code for 'd', 'D' (drop), '>', '<' (up, down) and 't' (throw) */
static int drop(struct obj *);
+static void dropy(struct obj *);
int
dodrop(void)
dropy(obj);
}
-void
+static void
dropy(struct obj *obj)
{
if (obj->otyp == CRYSKNIFE)
-/* $NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.do_name.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static void do_oname(struct obj *);
+static char *xmonnam(struct monst *, int);
+static char *lmonnam(struct monst *);
+static char *visctrl(int);
+
coord
getpos(int force, const char *goal)
{
* when there might be pointers around in unknown places. For now: only
* when obj is in the inventory.
*/
-void
+static void
do_oname(struct obj *obj)
{
struct obj *otmp, *otmp2;
*str1 = str;
}
-const char *const ghostnames[] = {/* these names should have length < PL_NSIZ */
+static const char *const ghostnames[] = {
+ /* these names should have length < PL_NSIZ */
"adri", "andries", "andreas", "bert", "david", "dirk", "emile",
"frans", "fred", "greg", "hether", "jay", "john", "jon", "kay",
"kenny", "maud", "michiel", "mike", "peter", "robert", "ron",
"tom", "wilmar"
};
-char *
+static char *
xmonnam(struct monst *mtmp, int vb)
{
static char buf[BUFSZ]; /* %% */
return (buf);
}
-char *
+static char *
lmonnam(struct monst *mtmp)
{
return (xmonnam(mtmp, 1));
return (bp);
}
-char *
+static char *
visctrl(int c)
{
static char ccc[3];
-/* $NetBSD: hack.do_wear.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.do_wear.c,v 1.7 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do_wear.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.do_wear.c,v 1.7 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-void
+static int dorr(struct obj *);
+static int cursed(struct obj *);
+
+static void
off_msg(struct obj *otmp)
{
pline("You were wearing %s.", doname(otmp));
return (0);
}
-int
+static int
dorr(struct obj *otmp)
{
if (cursed(otmp))
return (1);
}
-int
+static int
cursed(struct obj *otmp)
{
if (otmp->cursed) {
-/* $NetBSD: hack.dog.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.dog.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
const struct permonst la_dog =
{"large dog", 'd', 6, 15, 4, 2, 4, sizeof(struct edog)};
+static void initedog(struct monst *);
+static int dogfood(struct obj *);
void
makedog(void)
initedog(mtmp);
}
-void
+static void
initedog(struct monst *mtmp)
{
mtmp->mtame = mtmp->mpeaceful = 1;
#define APPORT 4
#define POISON 5
#define UNDEF 6
-int
+static int
dogfood(struct obj *obj)
{
switch (obj->olet) {
-/* $NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.eat.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.eat.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-char POISONOUS[] = "ADKSVabhks";
+static char POISONOUS[] = "ADKSVabhks";
/* hunger texts used on bottom line (each 8 chars long) */
#define SATIATED 0
"Starved "
};
+static int opentin(void);
+static int Meatdone(void);
+static int unfaint(void);
+static void newuhs(boolean);
+static int eatcorpse(struct obj *);
+
void
init_uhunger(void)
{
}
#define TTSZ SIZE(tintxts)
-const struct {
+static const struct {
const char *txt;
int nut;
} tintxts[] = {
int usedtime, reqtime;
} tin;
-int
+static int
opentin(void)
{
int r;
return (0);
}
-int
+static int
Meatdone(void)
{
u.usym = '@';
newuhs(FALSE);
}
-int
+static int
unfaint(void)
{
u.uhs = FAINTING;
return 0;
}
-void
+static void
newuhs(boolean incr)
{
int newhs, h = u.uhunger;
}
/* returns 1 if some text was printed */
-int
+static int
eatcorpse(struct obj *otmp)
{
char let = CORPSE_I_TO_C(otmp->otyp);
-/* $NetBSD: hack.end.c,v 1.12 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.end.c,v 1.13 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.end.c,v 1.12 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.end.c,v 1.13 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <signal.h>
xchar maxdlevel = 1;
+struct toptenentry;
+
+static void topten(void);
+static void outheader(void);
+static int outentry(int, struct toptenentry *, int);
+static char *itoa(int);
+static const char *ordin(int);
+
int
dodone(void)
{
/* NOTREACHED */
}
-int done_stopprint;
-int done_hup;
+static int done_stopprint;
+static int done_hup;
/*ARGSUSED*/
-void
+static void
done_intr(int n __unused)
{
done_stopprint++;
(void) signal(SIGQUIT, SIG_IGN);
}
-void
+static void
done_hangup(int n)
{
done_hup++;
char name[NAMSZ + 1];
char death[DTHSZ + 1];
char date[7];/* yymmdd */
-} *tt_head;
+};
-void
+static struct toptenentry *tt_head;
+
+static void
topten(void)
{
int uid = getuid();
(void) unlink(reclock);
}
-void
+static void
outheader(void)
{
char linebuf[BUFSZ];
}
/* so>0: standout line; so=0: ordinary line; so<0: no output, return length */
-int
+static int
outentry(int rank, struct toptenentry *t1, int so)
{
boolean quit = FALSE, gotkilled = FALSE, starv = FALSE;
return /*(strlen(linebuf))*/ pos;
}
-char *
+static char *
itoa(int a)
{
static char buf[12];
return (buf);
}
-const char *
+static const char *
ordin(int n)
{
int dg = n % 10;
-/* $NetBSD: hack.engrave.c,v 1.8 2009/06/07 20:30:49 dholland Exp $ */
+/* $NetBSD: hack.engrave.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.engrave.c,v 1.8 2009/06/07 20:30:49 dholland Exp $");
+__RCSID("$NetBSD: hack.engrave.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#define DUST 1
#define ENGRAVE 2
#define BURN 3
-} *head_engr;
+};
-struct engr *
+static struct engr *head_engr;
+
+static void del_engr(struct engr *);
+
+static struct engr *
engr_at(xchar x, xchar y)
{
struct engr *ep = head_engr;
}
}
-void
+static void
del_engr(struct engr *ep)
{
struct engr *ept;
-/* $NetBSD: hack.fight.c,v 1.11 2009/06/07 20:31:10 dholland Exp $ */
+/* $NetBSD: hack.fight.c,v 1.12 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.fight.c,v 1.11 2009/06/07 20:31:10 dholland Exp $");
+__RCSID("$NetBSD: hack.fight.c,v 1.12 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
static boolean far_noise;
static long noisetime;
+static void monstone(struct monst *);
+
/* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */
int
hitmm(struct monst *magr, struct monst *mdef)
}
/* drop a rock and remove monster */
-void
+static void
monstone(struct monst *mdef)
{
if (strchr(mlarge, mdef->data->mlet))
-/* $NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.invent.c,v 1.14 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.invent.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.invent.c,v 1.14 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <assert.h>
static int lastinvnr = 51; /* 0 ... 51 */
-static void assigninvlet(struct obj *);
static char *xprname(struct obj *, char);
+static void doinv(char *);
+static int merged(struct obj *, struct obj *, int);
static void
assigninvlet(struct obj *otmp)
}
/* make dummy object structure containing gold - for temporary use only */
-struct obj *
+static struct obj *
mkgoldobj(long q)
{
struct obj *otmp;
return (otmp);
}
-int
+static int
ckunpaid(struct obj *otmp)
{
return (otmp->unpaid);
}
/* should of course only be called for things in invent */
-char
+static char
obj_to_let(struct obj *obj)
{
struct obj *otmp;
pline(xprname(obj, obj_to_let(obj)));
}
-static char *
+static char *
xprname(struct obj *obj, char let)
{
static char li[BUFSZ];
/* called with 0 or "": all objects in inventory */
/* otherwise: all objects with (serial) letter in lets */
-void
+static void
doinv(char *lets)
{
struct obj *otmp;
}
/* merge obj with otmp and delete obj if types agree */
-int
+static int
merged(struct obj *otmp, struct obj *obj, int lose)
{
if (obj->otyp == otmp->otyp &&
* it may take a while before you have counted it all.
* [Bug: d$ and pickup still tell you how much it was.]
*/
-int
+static int
countgold(void)
{
if ((goldcounted += 100 * (u.ulevel + 1)) >= u.ugold) {
-/* $NetBSD: hack.ioctl.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.ioctl.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.ioctl.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
/*
#include <termios.h>
#include "hack.h"
#include "extern.h"
-struct termios termios;
+static struct termios termios;
void
getioctls(void)
-/* $NetBSD: hack.lev.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.lev.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.lev.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.lev.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
boolean level_exists[MAXLEVEL + 1];
+static void savegoldchn(int, struct gold *);
+static void savetrapchn(int, struct trap *);
+
void
savelev(int fd, xchar lev)
{
bwrite(fd, (char *) &minusone, sizeof(int));
}
-void
+static void
savegoldchn(int fd, struct gold *gold)
{
struct gold *gold2;
bwrite(fd, nul, sizeof(struct gold));
}
-void
+static void
savetrapchn(int fd, struct trap *trap)
{
struct trap *trap2;
-/* $NetBSD: hack.main.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.main.c,v 1.14 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.main.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.main.c,v 1.14 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <signal.h>
#endif
char SAVEF[PL_NSIZ + 11] = "save/"; /* save/99999player */
char *hname; /* name of the game (argv[0] of call) */
-char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
+
+static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
int main(int, char *[]);
static void chdirx(const char *, boolean);
-/* $NetBSD: hack.makemon.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.makemon.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.makemon.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.makemon.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-struct monst zeromonst;
+static const struct monst zeromonst;
/*
* called with [x,y] = coordinates;
-/* $NetBSD: hack.mklev.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mklev.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mklev.c,v 1.8 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include <unistd.h>
#define XLIM 4 /* define minimum required space around a
* room */
#define YLIM 3
-boolean secret; /* TRUE while making a vault: increase
+static boolean secret; /* TRUE while making a vault: increase
* [XY]LIM */
-int smeq[MAXNROFROOMS + 1];
+static int smeq[MAXNROFROOMS + 1];
+static const struct rm zerorm;
+static schar nxcor;
+static boolean goldseen;
+
int doorindex;
-struct rm zerorm;
-schar nxcor;
-boolean goldseen;
int nroom;
/* Definitions used by makerooms() and addrs() */
#define MAXRS 50 /* max lth of temp rectangle table -
* arbitrary */
-struct rectangle {
+static struct rectangle {
xchar rlx, rly, rhx, rhy;
-} rs[MAXRS + 1];
-int rscnt, rsmax; /* 0..rscnt-1: currently under consideration */
+} rs[MAXRS + 1];
+static int rscnt, rsmax; /* 0..rscnt-1: currently under consideration */
/* rscnt..rsmax: discarded */
+static int makerooms(void);
+static void addrs(int, int, int, int);
+static void addrsx(int, int, int, int, boolean);
+static int comp(const void *, const void *);
+static coord finddpos(int, int, int, int);
+static int okdoor(int, int);
+static void dodoor(int, int, struct mkroom *);
+static void dosdoor(int, int, struct mkroom *, int);
+static int maker(schar, schar, schar, schar);
+static void makecorridors(void);
+static void join(int, int);
+static void make_niches(void);
+static void makevtele(void);
+static void makeniche(boolean);
+
void
makelevel(void)
{
#endif /* QUEST */
}
-int
+static int
makerooms(void)
{
struct rectangle *rsp;
return (0); /* failed to make vault - very strange */
}
-void
+static void
addrs(int lowx, int lowy, int hix, int hiy)
{
struct rectangle *rsp;
}
/* discarded: piece of a discarded area */
-void
+static void
addrsx(int lx, int ly, int hx, int hy, boolean discarded)
{
struct rectangle *rsp;
rsp->rhy = hy;
}
-int
+static int
comp(const void *vx, const void *vy)
{
const struct mkroom *x = vx, *y = vy;
return (x->lx > y->lx);
}
-coord
+static coord
finddpos(int xl, int yl, int xh, int yh)
{
coord ff;
}
/* see whether it is allowable to create a door at [x,y] */
-int
+static int
okdoor(int x, int y)
{
if (levl[x - 1][y].typ == DOOR || levl[x + 1][y].typ == DOOR ||
return (1);
}
-void
+static void
dodoor(int x, int y, struct mkroom *aroom)
{
if (doorindex >= DOORMAX) {
dosdoor(x, y, aroom, rn2(8) ? DOOR : SDOOR);
}
-void
+static void
dosdoor(int x, int y, struct mkroom *aroom, int type)
{
struct mkroom *broom;
}
/* Only called from makerooms() */
-int
+static int
maker(schar lowx, schar ddx, schar lowy, schar ddy)
{
struct mkroom *croom;
return (1);
}
-void
+static void
makecorridors(void)
{
int a, b;
}
}
-void
+static void
join(int a, int b)
{
coord cc, tt;
smeq[a] = smeq[b];
}
-void
+static void
make_niches(void)
{
int ct = rnd(nroom / 2 + 1);
makeniche(FALSE);
}
-void
+static void
makevtele(void)
{
makeniche(TRUE);
}
-void
+static void
makeniche(boolean with_trap)
{
struct mkroom *aroom;
-/* $NetBSD: hack.mkmaze.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkmaze.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkmaze.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkmaze.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
#include "def.mkroom.h" /* not really used */
-const struct permonst hell_hound =
+
+static const struct permonst hell_hound =
{"hell hound", 'd', 12, 14, 2, 3, 6, 0};
+static void walkfrom(int, int);
+static void move(int *, int *, int);
+static int okay(int, int, int);
+
void
makemaz(void)
{
xdnstair = ydnstair = 0;
}
-void
+static void
walkfrom(int x, int y)
{
int q, a, dir;
}
}
-void
+static void
move(int *x, int *y, int dir)
{
switch (dir) {
}
}
-int
+static int
okay(int x, int y, int dir)
{
move(&x, &y, dir);
-/* $NetBSD: hack.mkobj.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkobj.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
+static const char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
struct obj *
mkobj_at(int let, int x, int y)
-/* $NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mkshop.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mkshop.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mkshop.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "extern.h"
#include "def.mkroom.h"
#include "def.eshk.h"
+
#define ESHK ((struct eshk *)(&(shk->mextra[0])))
-const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50}; /* their probabilities */
+
+/* their probabilities */
+static const schar shprobs[] = {3, 3, 5, 5, 10, 10, 14, 50};
+
+static const struct permonst *morguemon(void);
+static int nexttodoor(int, int);
+static int has_dnstairs(struct mkroom *);
+static int has_upstairs(struct mkroom *);
+static int isbig(struct mkroom *);
+static int dist2(int, int, int, int);
+static int sq(int);
void
mkshop(void)
}
}
-const struct permonst *
+static const struct permonst *
morguemon(void)
{
int i = rn2(100), hd = rn2(dlevel);
}
}
-int
+static int
nexttodoor(int sx, int sy)
{
int dx, dy;
return (0);
}
-int
+static int
has_dnstairs(struct mkroom *sroom)
{
return (sroom->lx <= xdnstair && xdnstair <= sroom->hx &&
sroom->ly <= ydnstair && ydnstair <= sroom->hy);
}
-int
+static int
has_upstairs(struct mkroom *sroom)
{
return (sroom->lx <= xupstair && xupstair <= sroom->hx &&
sroom->ly <= yupstair && yupstair <= sroom->hy);
}
-int
+static int
isbig(struct mkroom *sroom)
{
int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly);
return (area > 20);
}
-int
+static int
dist2(int x0, int y0, int x1, int y1)
{
return ((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));
}
-int
+static int
sq(int a)
{
return (a * a);
-/* $NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.mon.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.mon.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#define NULL (char *) 0
#endif
-int warnlevel; /* used by movemon and dochugw */
-long lastwarntime;
-int lastwarnlev;
-const char *const warnings[] = {
+static int warnlevel; /* used by movemon and dochugw */
+static long lastwarntime;
+static int lastwarnlev;
+
+static const char *const warnings[] = {
"white", "pink", "red", "ruby", "purple", "black"
};
+static int dochugw(struct monst *);
+static void mpickgold(struct monst *);
+static void mpickgems(struct monst *);
+static void dmonsfree(void);
+static int ishuman(struct monst *);
+
void
movemon(void)
{
#endif
}
-int
+static int
dochugw(struct monst *mtmp)
{
int x = mtmp->mx;
return (mmoved);
}
-void
+static void
mpickgold(struct monst *mtmp)
{
struct gold *gold;
}
}
-void
+static void
mpickgems(struct monst *mtmp)
{
struct obj *otmp;
* we do not free monsters immediately, in order to have their name available
* shortly after their demise
*/
-struct monst *fdmon; /* chain of dead monsters, need not to be
+static struct monst *fdmon; /* chain of dead monsters, need not to be
* saved */
void
fdmon = mtmp;
}
-void
+static void
dmonsfree(void)
{
struct monst *mtmp;
pmon(mtmp);
}
-int
+static int
ishuman(struct monst *mtmp)
{
return (mtmp->data->mlet == '@');
-/* $NetBSD: hack.o_init.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.o_init.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.o_init.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.o_init.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <string.h>
#include "def.objects.h"
#include "hack.onames.h" /* for LAST_GEM */
+static void setgemprobs(void);
+static int interesting_to_discover(int);
+
int
letindex(int let)
{
return (i);
}
-void
+static void
setgemprobs(void)
{
int j, first;
return (0);
}
-int
+static int
interesting_to_discover(int i)
{
return (
-/* $NetBSD: hack.objnam.c,v 1.9 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.objnam.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.objnam.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.objnam.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#define Strcpy (void) strcpy
#define PREFIX 15
-char *
+static char *strprepend(char *, char *);
+static char *sitoa(int);
+
+static char *
strprepend(char *s, char *pref)
{
int i = strlen(pref);
return (s);
}
-char *
+static char *
sitoa(int a)
{
static char buf[13];
return (s);
}
-const char *const wrp[] = {"wand", "ring", "potion", "scroll", "gem"};
-const char wrpsym[] = {WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM};
+static const char *const wrp[] = {"wand", "ring", "potion", "scroll", "gem"};
+static const char wrpsym[] = {WAND_SYM, RING_SYM, POTION_SYM, SCROLL_SYM, GEM_SYM};
struct obj *
readobjnam(char *bp)
-/* $NetBSD: hack.options.c,v 1.9 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.options.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.options.c,v 1.9 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.options.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static void parseoptions(char *, boolean);
+
void
initoptions(void)
{
parseoptions(opts, TRUE);
}
-void
+static void
parseoptions(char *opts, boolean from_env)
{
char *op, *op2;
-/* $NetBSD: hack.pager.c,v 1.12 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.pager.c,v 1.13 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.pager.c,v 1.12 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.pager.c,v 1.13 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* This file contains the command routine dowhatis() and a pager. */
#include "hack.h"
#include "extern.h"
+static void intruph(int);
+static void page_more(FILE *, int);
+static int page_file(const char *, boolean);
+static int child(int);
+
int
dowhatis(void)
{
/* make the paging of a file interruptible */
static int got_intrup;
-void
+static void
intruph(int n __unused)
{
got_intrup++;
/* simple pager, also used from dohelp() */
/* strip: nr of chars to be stripped from each line (0 or 1) */
-void
+static void
page_more(FILE *fp, int strip)
{
char *bufr, *ep;
}
/* return: 0 - cannot open fnam; 1 - otherwise */
-int
+static int
page_file(const char *fnam, boolean silent)
{
#ifdef DEF_PAGER /* this implies that UNIX is defined */
#endif /* BSD */
#endif /* NOWAITINCLUDE */
-int
+static int
child(int wt)
{
int status;
-/* $NetBSD: hack.potion.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.potion.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.potion.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.potion.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void ghost_from_bottle(void);
+
int
dodrink(void)
{
useup(obj);
}
-const char *const bottlenames[] = {
+static const char *const bottlenames[] = {
"bottle", "phial", "flagon", "carafe", "flask", "jar", "vial"
};
return (1);
}
-void
+static void
ghost_from_bottle(void)
{
struct monst *mtmp;
-/* $NetBSD: hack.pri.c,v 1.11 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.pri.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.pri.c,v 1.11 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.pri.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-xchar scrlx, scrhx, scrly, scrhy; /* corners of new area on
+
+static xchar scrlx, scrhx, scrly, scrhy; /* corners of new area on
* screen */
+static void cornbot(int);
+
void
swallowed(void)
{
/* VARARGS1 */
-boolean panicking;
+static boolean panicking;
void
panic(const char *fmt, ...)
}
/* 100 suffices for bot(); no relation with COLNO */
-char oldbot[100], newbot[100];
+static char oldbot[100], newbot[100];
void
cornbot(int lth)
{
-/* $NetBSD: hack.read.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.read.c,v 1.9 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.read.c,v 1.10 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static int identify(struct obj *);
+static int monstersym(int);
+
int
doread(void)
{
return (1);
}
-int
+static int
identify(struct obj *otmp) /* also called by newmail() */
{
objects[otmp->otyp].oc_name_known = 1;
}
/* Test whether we may genocide all monsters with symbol ch */
-int
+static int
monstersym(int ch) /* arnold@ucsfcgl */
{
const struct permonst *mp;
-/* $NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.rip.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.rip.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
*| * * * | *\n\
_________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______";
+static void center(int, char *);
+
void
outrip(void)
{
getret();
}
-void
+static void
center(int line __unused, char *text)
{
int n = strlen(text) / 2;
-/* $NetBSD: hack.rumors.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.rumors.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.rumors.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.rumors.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h" /* for RUMORFILE and BSD (strchr) */
#include "extern.h"
#define CHARSZ 8 /* number of bits in a char */
-int n_rumors = 0;
-int n_used_rumors = -1;
-char *usedbits;
-void
+static int n_rumors = 0;
+static int n_used_rumors = -1;
+static char *usedbits;
+
+static void init_rumors(FILE *);
+static int skipline(FILE *);
+static void outline(FILE *);
+static int used(int);
+
+static void
init_rumors(FILE *rumf)
{
int i;
usedbits[i] = 0;
}
-int
+static int
skipline(FILE *rumf)
{
char line[COLNO];
}
}
-void
+static void
outline(FILE *rumf)
{
char line[COLNO];
(void) fclose(rumf);
}
-int
+static int
used(int i)
{
return (usedbits[i / CHARSZ] & (1 << (i % CHARSZ)));
-/* $NetBSD: hack.save.c,v 1.12 2009/06/07 20:25:38 dholland Exp $ */
+/* $NetBSD: hack.save.c,v 1.13 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.save.c,v 1.12 2009/06/07 20:25:38 dholland Exp $");
+__RCSID("$NetBSD: hack.save.c,v 1.13 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <signal.h>
#include "hack.h"
#include "extern.h"
+static int dosave0(int);
int
dosave(void)
#endif /* NOSAVEONHANGUP */
/* returns 1 if save successful */
-int
+static int
dosave0(int hu)
{
int fd, ofd;
-/* $NetBSD: hack.shk.c,v 1.10 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.shk.c,v 1.10 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.shk.c,v 1.11 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
static struct bill_x *onbill(struct obj *);
static void pay(long, struct monst *);
static int dopayobj(struct bill_x *);
+static struct obj *bp_to_obj(struct bill_x *);
static int getprice(struct obj *);
static int realhunger(void);
#endif
}
/* find obj on one of the lists */
-struct obj *
+static struct obj *
bp_to_obj(struct bill_x *bp)
{
struct obj *obj;
-/* $NetBSD: hack.shknam.c,v 1.6 2003/04/02 18:36:40 jsm Exp $ */
+/* $NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.shknam.c,v 1.6 2003/04/02 18:36:40 jsm Exp $");
+__RCSID("$NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-const char *const shkliquors[] = {
+static const char *const shkliquors[] = {
/* Ukraine */
"Njezjin", "Tsjernigof", "Gomel", "Ossipewsk", "Gorlowka",
/* N. Russia */
0
};
-const char *const shkbooks[] = {
+static const char *const shkbooks[] = {
/* Eire */
"Skibbereen", "Kanturk", "Rath Luirc", "Ennistymon", "Lahinch",
"Loughrea", "Croagh", "Maumakeogh", "Ballyjamesduff",
0
};
-const char *const shkarmors[] = {
+static const char *const shkarmors[] = {
/* Turquie */
"Demirci", "Kalecik", "Boyabai", "Yildizeli", "Gaziantep",
"Siirt", "Akhalataki", "Tirebolu", "Aksaray", "Ermenak",
0
};
-const char *const shkwands[] = {
+static const char *const shkwands[] = {
/* Wales */
"Yr Wyddgrug", "Trallwng", "Mallwyd", "Pontarfynach",
"Rhaeader", "Llandrindod", "Llanfair-ym-muallt",
0
};
-const char *const shkrings[] = {
+static const char *const shkrings[] = {
/* Hollandse familienamen */
"Feyfer", "Flugi", "Gheel", "Havic", "Haynin", "Hoboken",
"Imbyze", "Juyn", "Kinsky", "Massis", "Matray", "Moy",
0
};
-const char *const shkfoods[] = {
+static const char *const shkfoods[] = {
/* Indonesia */
"Djasinga", "Tjibarusa", "Tjiwidej", "Pengalengan",
"Bandjar", "Parbalingga", "Bojolali", "Sarangan",
0
};
-const char *const shkweapons[] = {
+static const char *const shkweapons[] = {
/* Perigord */
"Voulgezac", "Rouffiac", "Lerignac", "Touverac", "Guizengeard",
"Melac", "Neuvicq", "Vanzac", "Picq", "Urignac", "Corignac",
0
};
-const char *const shkgeneral[] = {
+static const char *const shkgeneral[] = {
/* Suriname */
"Hebiwerie", "Possogroenoe", "Asidonhopo", "Manlobbi",
"Adjama", "Pakka Pakka", "Kabalebo", "Wonotobo",
0
};
-const struct shk_nx {
+static const struct shk_nx {
char x;
const char *const *xn;
} shk_nx[] = {
-/* $NetBSD: hack.steal.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.steal.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.steal.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static int stealarm(void);
+
/*
* actually returns something that fits in an int
*/
}
/* steal armor after he finishes taking it off */
-unsigned stealoid; /* object to be stolen */
-unsigned stealmid; /* monster doing the stealing */
-int
+static unsigned stealoid; /* object to be stolen */
+static unsigned stealmid; /* monster doing the stealing */
+static int
stealarm(void)
{
struct monst *mtmp;
-/* $NetBSD: hack.termcap.c,v 1.17 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.termcap.c,v 1.18 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.termcap.c,v 1.17 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.termcap.c,v 1.18 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <string.h>
char *CD; /* tested in pri.c: docorner() */
int CO, LI; /* used in pri.c and whatis.c */
+static void nocmov(int, int);
+static void cmov(int, int);
+static int xputc(int);
+static void xputs(const char *);
+
void
startup(void)
{
cmov(x, y);
}
-void
+static void
nocmov(int x, int y)
{
if (cury > y) {
}
}
-void
+static void
cmov(int x, int y)
{
char buf[256];
}
}
-int
+static int
xputc(int c)
{
return (fputc(c, stdout));
}
-void
+static void
xputs(const char *s)
{
tputs(s, 1, xputc);
-/* $NetBSD: hack.timeout.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.timeout.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.timeout.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.timeout.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void stoned_dialogue(void);
+
void
timeout(void)
{
}
/* He is being petrified - dialogue by inmet!tower */
-const char *const stoned_texts[] = {
+static const char *const stoned_texts[] = {
"You are slowing down.",/* 5 */
"Your limbs are stiffening.", /* 4 */
"Your limbs have turned to stone.", /* 3 */
"You are a statue." /* 1 */
};
-void
+static void
stoned_dialogue(void)
{
long i = (Stoned & TIMEOUT);
-/* $NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
-char toplines[BUFSZ];
-xchar tlx, tly; /* set by pline; used by addtopl */
+static char toplines[BUFSZ];
+static xchar tlx, tly; /* set by pline; used by addtopl */
-struct topl {
+static struct topl {
struct topl *next_topl;
char *topl_text;
} *old_toplines, *last_redone_topl;
#define OTLMAX 20 /* max nr of old toplines remembered */
+static void redotoplin(void);
+static void xmore(const char *);
+
int
doredotopl(void)
{
return (0);
}
-void
+static void
redotoplin(void)
{
home();
}
/* s = allowed chars besides space/return */
-void
+static void
xmore(const char *s)
{
if (flags.toplin) {
-/* $NetBSD: hack.track.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.track.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.track.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.track.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#define UTSZ 50
-coord utrack[UTSZ];
-int utcnt = 0;
-int utpnt = 0;
+static coord utrack[UTSZ];
+static int utcnt = 0;
+static int utpnt = 0;
void
initrack(void)
-/* $NetBSD: hack.trap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.trap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.trap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.trap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
" mimic"
};
+static void vtele(void);
+static void teleds(int, int);
+static int teleok(int, int);
+
struct trap *
maketrap(int x, int y, int typ)
{
pickup(1);
}
-void
+static void
vtele(void)
{
struct mkroom *croom;
teleds(nux, nuy);
}
-void
+static void
teleds(int nux, int nuy)
{
if (Punished)
read_engr_at(u.ux, u.uy);
}
-int
+static int
teleok(int x, int y)
{ /* might throw him into a POOL */
return (isok(x, y) && !IS_ROCK(levl[x][y].typ) && !m_at(x, y) &&
-/* $NetBSD: hack.tty.c,v 1.13 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.tty.c,v 1.14 2009/08/12 07:28:41 dholland Exp $ */
/*-
* Copyright (c) 1988, 1993
#if 0
static char sccsid[] = "@(#)hack.tty.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: hack.tty.c,v 1.13 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.tty.c,v 1.14 2009/08/12 07:28:41 dholland Exp $");
#endif
#endif /* not lint */
static char erase_char, kill_char;
static boolean settty_needed = FALSE;
-struct termios inittyb, curttyb;
+static struct termios inittyb, curttyb;
+
+static void setctty(void);
/*
* Get initial state of terminal, set ospeed (for termcap routines)
setioctls();
}
-void
+static void
setctty(void)
{
if (tcsetattr(0, TCSADRAIN, &curttyb) < 0)
-/* $NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.u_init.c,v 1.11 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.u_init.c,v 1.10 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.u_init.c,v 1.11 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <ctype.h>
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
-struct you zerou;
-char pl_character[PL_CSIZ];
-const char *(roles[]) = { /* must all have distinct first letter */
+char pl_character[PL_CSIZ];
+
+static const struct you zerou;
+static const char *(roles[]) = { /* must all have distinct first letter */
/* roles[4] may be changed to -woman */
"Tourist", "Speleologist", "Fighter", "Knight",
"Cave-man", "Wizard"
};
#define NR_OF_ROLES SIZE(roles)
-char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
+static char rolesyms[NR_OF_ROLES + 1]; /* filled by u_init() */
struct trobj {
uchar trotyp;
};
#ifdef WIZARD
-struct trobj Extra_objs[] = {
+static struct trobj Extra_objs[] = {
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}
};
#endif /* WIZARD */
-struct trobj Cave_man[] = {
+static struct trobj Cave_man[] = {
{MACE, 1, WEAPON_SYM, 1, 1},
{BOW, 1, WEAPON_SYM, 1, 1},
{ARROW, 0, WEAPON_SYM, 25, 1}, /* quan is variable */
{0, 0, 0, 0, 0}
};
-struct trobj Fighter[] = {
+static struct trobj Fighter[] = {
{TWO_HANDED_SWORD, 0, WEAPON_SYM, 1, 1},
{RING_MAIL, 0, ARMOR_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Knight[] = {
+static struct trobj Knight[] = {
{LONG_SWORD, 0, WEAPON_SYM, 1, 1},
{SPEAR, 2, WEAPON_SYM, 1, 1},
{RING_MAIL, 1, ARMOR_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Speleologist[] = {
+static struct trobj Speleologist[] = {
{STUDDED_LEATHER_ARMOR, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, 0, POTION_SYM, 2, 0},
{FOOD_RATION, 0, FOOD_SYM, 3, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Tinopener[] = {
+static struct trobj Tinopener[] = {
{CAN_OPENER, 0, TOOL_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Tourist[] = {
+static struct trobj Tourist[] = {
{UNDEF_TYP, 0, FOOD_SYM, 10, 1},
{POT_EXTRA_HEALING, 0, POTION_SYM, 2, 0},
{EXPENSIVE_CAMERA, 0, TOOL_SYM, 1, 1},
{0, 0, 0, 0, 0}
};
-struct trobj Wizard[] = {
+static struct trobj Wizard[] = {
{ELVEN_CLOAK, 0, ARMOR_SYM, 1, 1},
{UNDEF_TYP, UNDEF_SPE, WAND_SYM, 2, 0},
{UNDEF_TYP, UNDEF_SPE, RING_SYM, 2, 0},
{0, 0, 0, 0, 0}
};
+static void ini_inv(struct trobj *);
+static void wiz_inv(void);
+static int role_index(int);
+
void
u_init(void)
{
-/* $NetBSD: hack.unix.c,v 1.13 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.unix.c,v 1.13 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.unix.c,v 1.14 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* This file collects some Unix dependencies; hack.pager.c contains some more */
extern int locknum;
+static struct tm *getlt(void);
+static int veryold(int);
+
void
setrandom(void)
(void) srandom((int) time((time_t *) 0));
}
-struct tm *
+static struct tm *
getlt(void)
{
time_t date;
return (getlt()->tm_hour == 0);
}
-struct stat buf, hbuf;
+static struct stat buf, hbuf;
void
gethdate(char *name)
}
/* see whether we should throw away this xlock file */
-int
+static int
veryold(int fd)
{
int i;
-/* $NetBSD: hack.wizard.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.wizard.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.wizard.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.wizard.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
/* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */
#define BOLT_LIM 8 /* from this distance D and 1 will try to hit
* you */
-const char wizapp[] = "@DNPTUVXcemntx";
+static const char wizapp[] = "@DNPTUVXcemntx";
+
+static void aggravate(void);
+static void clonewiz(struct monst *);
+
/* If he has found the Amulet, make the wizard appear after some time */
void
-/* $NetBSD: hack.worm.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worm.c,v 1.7 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.worm.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
struct wseg *wheads[32];
long wgrowtime[32];
+static void remseg(struct wseg *);
+
int
getwn(struct monst *mtmp)
{
panic("Cannot find worm segment");
}
-void
+static void
remseg(struct wseg *wtmp)
{
if (wtmp->wdispl)
-/* $NetBSD: hack.worn.c,v 1.6 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.worn.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.worn.c,v 1.6 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.worn.c,v 1.7 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-struct worn {
+static struct worn {
long w_mask;
struct obj **w_obj;
} worn[] = {
-/* $NetBSD: hack.zap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.zap.c,v 1.8 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-const char *const fl[] = {
+static const char *const fl[] = {
"magic missile",
"bolt of fire",
"sleep ray",
"death ray"
};
+static void bhitm(struct monst *, struct obj *);
+static int bhito(struct obj *, struct obj *);
+static char dirlet(int, int);
+static int zhit(struct monst *, int);
+static int revive(struct obj *);
+static void rloco(struct obj *);
+static void burn_scrolls(void);
+
/* Routines for IMMEDIATE wands. */
/* bhitm: monster mtmp was hit by the effect of wand otmp */
-void
+static void
bhitm(struct monst *mtmp, struct obj *otmp)
{
wakeup(mtmp);
* object obj was hit by the effect of wand otmp
* returns TRUE if sth was done
*/
-int
+static int
bhito(struct obj *obj, struct obj *otmp)
{
int res = TRUE;
return (0);
}
-char
+static char
dirlet(int dx, int dy)
{
return
Tmp_at(-1, -1);
}
-int
+static int
zhit(struct monst *mon, int type) /* returns damage to mon */
{
int tmp = 0;
#define CORPSE_I_TO_C(otyp) (char) ((otyp >= DEAD_ACID_BLOB)\
? 'a' + (otyp - DEAD_ACID_BLOB)\
: '@' + (otyp - DEAD_HUMAN))
-int
+static int
revive(struct obj *obj)
{
struct monst *mtmp = NULL;
return (!!mtmp); /* TRUE if some monster created */
}
-void
+static void
rloco(struct obj *obj)
{
int tx, ty, otx, oty;
prl(obj->ox, obj->oy);
}
-void
+static void
burn_scrolls(void)
{
struct obj *obj, *obj2;