]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/extern.h
1 /* $NetBSD: extern.h,v 1.7 2008/01/28 06:55:41 dholland Exp $ */
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
44 long *alloc(unsigned);
45 long *enlarge(char *, unsigned);
60 void movobj(struct obj
*, int, int);
63 void lookaround(void);
64 int monster_nearby(void);
66 int cansee(xchar
, xchar
);
73 void losehp(int, const char *);
74 void losehp_m(int, struct monst
*);
81 void rhack(const char *);
94 void dropx(struct obj
*);
95 void dropy(struct obj
*);
99 void goto_level(int, boolean
);
103 struct obj
*splitobj(struct obj
*, int);
104 void more_experienced(int, int);
105 void set_wounded_legs(long, int);
106 void heal_legs(void);
109 coord
getpos(int, const char *);
111 void do_oname(struct obj
*);
113 void docall(struct obj
*);
114 char *xmonnam(struct monst
*, int);
115 char *lmonnam(struct monst
*);
116 char *monnam(struct monst
*);
117 char *Monnam(struct monst
*);
118 char *amonnam(struct monst
*, const char *);
119 char *Amonnam(struct monst
*, const char *);
120 char *Xmonnam(struct monst
*);
124 void off_msg(struct obj
*);
127 int dorr(struct obj
*);
128 int cursed(struct obj
*);
129 int armoroff(struct obj
*);
131 int dowearring(void);
132 void ringoff(struct obj
*);
135 struct obj
*some_armor(void);
136 void corrode_armor(void);
140 void initedog(struct monst
*);
143 void fall_down(struct monst
*);
144 int dogfood(struct obj
*);
145 int dog_move(struct monst
*, int);
146 int inroom(xchar
, xchar
);
147 int tamedog(struct monst
*, struct obj
*);
150 void init_uhunger(void);
154 void gethungry(void);
155 void morehungry(int);
156 void lesshungry(int);
158 void newuhs(boolean
);
159 int poisonous(struct obj
*);
160 int eatcorpse(struct obj
*);
166 void done_hangup(int);
167 void done_in_by(struct monst
*);
168 void done(const char *);
170 void outheader(void);
172 int outentry(int, struct toptenentry
*, int);
174 const char *ordin(int);
175 void clearlocks(void);
176 void hangup(int) __attribute__((__noreturn__
));
178 void charcat(char *, int);
179 void prscore(int, char **);
182 struct engr
*engr_at(xchar
, xchar
);
183 int sengr_at(const char *, xchar
, xchar
);
184 void u_wipe_engr(int);
185 void wipe_engr_at(xchar
, xchar
, xchar
);
186 void read_engr_at(int, int);
187 void make_engr_at(int, int, const char *);
189 void save_engravings(int);
190 void rest_engravings(int);
191 void del_engr(struct engr
*);
194 int hitmm(struct monst
*, struct monst
*);
195 void mondied(struct monst
*);
196 void monstone(struct monst
*);
197 int fightm(struct monst
*);
198 int thitu(int, int, const char *);
199 boolean
hmon(struct monst
*, struct obj
*, int);
200 int attack(struct monst
*);
203 struct obj
*addinv(struct obj
*);
204 void useup(struct obj
*);
205 void freeinv(struct obj
*);
206 void delobj(struct obj
*);
207 void freeobj(struct obj
*);
208 void freegold(struct gold
*);
209 void deltrap(struct trap
*);
210 struct monst
*m_at(int, int);
211 struct obj
*o_at(int, int);
212 struct obj
*sobj_at(int, int, int);
213 int carried(struct obj
*);
215 struct obj
*o_on(unsigned int, struct obj
*);
216 struct trap
*t_at(int, int);
217 struct gold
*g_at(int, int);
218 struct obj
*mkgoldobj(long);
219 struct obj
*getobj(const char *, const char *);
220 int ckunpaid(struct obj
*);
221 int ggetobj(const char *, int (*fn
)(struct obj
*), int);
222 int askchain(struct obj
*, char *, int, int (*)(struct obj
*),
223 int (*)(struct obj
*), int);
224 char obj_to_let(struct obj
*);
225 void prinv(struct obj
*);
230 void stackobj(struct obj
*);
231 int merged(struct obj
*, struct obj
*, int);
240 void getioctls(void);
241 void setioctls(void);
245 void savelev(int, xchar
);
246 void bwrite(int, const void *, unsigned);
247 void saveobjchn(int, struct obj
*);
248 void savemonchn(int, struct monst
*);
249 void savegoldchn(int, struct gold
*);
250 void savetrapchn(int, struct trap
*);
251 void getlev(int, int, xchar
);
252 void mread(int, char *, unsigned);
258 void impossible(const char *, ...)
259 __attribute__((__format__(__printf__
, 1, 2)));
260 void stop_occupation(void);
263 struct monst
*makemon(const struct permonst
*, int, int);
264 coord
enexto(xchar
, xchar
);
265 int goodpos(int, int);
266 void rloc(struct monst
*);
267 struct monst
*mkmon_at(int, int, int);
270 int mhitu(struct monst
*);
271 int hitu(struct monst
*, int);
274 void makelevel(void);
276 void addrs(int, int, int, int);
277 void addrsx(int, int, int, int, boolean
);
279 int comp(const void *, const void *);
280 coord
finddpos(int, int, int, int);
281 int okdoor(int, int);
282 void dodoor(int, int, struct mkroom
*);
283 void dosdoor(int, int, struct mkroom
*, int);
284 int maker(schar
, schar
, schar
, schar
);
285 void makecorridors(void);
287 void make_niches(void);
288 void makevtele(void);
289 void makeniche(boolean
);
290 void mktrap(int, int, struct mkroom
*);
294 void walkfrom(int, int);
295 void move(int *, int *, int);
296 int okay(int, int, int);
300 struct obj
*mkobj_at(int, int, int);
301 void mksobj_at(int, int, int);
302 struct obj
*mkobj(int);
303 struct obj
*mksobj(int);
305 int weight(struct obj
*);
306 void mkgold(long, int, int);
311 const struct permonst
*morguemon(void);
313 int nexttodoor(int, int);
314 int has_dnstairs(struct mkroom
*);
315 int has_upstairs(struct mkroom
*);
316 int isbig(struct mkroom
*);
317 int dist2(int, int, int, int);
322 void justswld(struct monst
*, const char *);
323 void youswld(struct monst
*, int, int, const char *);
324 int dochugw(struct monst
*);
325 int dochug(struct monst
*);
326 int m_move(struct monst
*, int);
327 void mpickgold(struct monst
*);
328 void mpickgems(struct monst
*);
329 int mfndpos(struct monst
*, coord
[9 ], int[9 ], int);
331 void poisoned(const char *, const char *);
332 void mondead(struct monst
*);
333 void replmon(struct monst
*, struct monst
*);
334 void relmon(struct monst
*);
335 void monfree(struct monst
*);
336 void dmonsfree(void);
337 void unstuck(struct monst
*);
338 void killed(struct monst
*);
339 void kludge(const char *, const char *);
341 int newcham(struct monst
*, const struct permonst
*);
342 void mnexto(struct monst
*);
343 int ishuman(struct monst
*);
344 void setmangry(struct monst
*);
345 int canseemon(struct monst
*);
351 void init_objects(void);
353 void setgemprobs(void);
357 int dodiscovered(void);
358 int interesting_to_discover(int);
361 char *strprepend(char *, char *);
364 char *xname(struct obj
*);
365 char *doname(struct obj
*);
366 void setan(const char *, char *);
367 char *aobjnam(struct obj
*, const char *);
368 char *Doname(struct obj
*);
369 struct obj
*readobjnam(char *);
372 void initoptions(void);
373 void parseoptions(char *, boolean
);
379 void page_more(FILE *, int);
380 void set_whole_screen(void);
383 int page_line(const char *);
384 void cornline(int, const char *);
386 int page_file(const char *, boolean
);
393 void strange_feeling(struct obj
*, const char *);
394 void potionhit(struct monst
*, struct obj
*);
395 void potionbreathe(struct obj
*);
397 void ghost_from_bottle(void);
400 void swallowed(void);
401 void panic(const char *, ...)
402 __attribute__((__format__(__printf__
, 1, 2)));
403 void atl(int, int, int);
404 void on_scr(int, int);
405 void tmp_at(schar
, schar
);
406 void Tmp_at(schar
, schar
);
407 void setclipped(void) __attribute__((__noreturn__
));
408 void at(xchar
, xchar
, int);
412 void docorner(int, int);
413 void curs_on_u(void);
416 char news0(xchar
, xchar
);
417 void newsym(int, int);
418 void mnewsym(int, int);
419 void nosee(int, int);
421 void nose1(int, int);
422 int vism_at(int, int);
423 void pobj(struct obj
*);
424 void unpobj(struct obj
*);
427 void pmon(struct monst
*);
428 void unpmon(struct monst
*);
432 void mstatusline(struct monst
*);
437 int identify(struct obj
*);
438 void litroom(boolean
);
443 void center(int, char *);
446 void init_rumors(FILE *);
447 int skipline(FILE *);
448 void outline(FILE *);
456 struct obj
*restobjchn(int);
457 struct monst
*restmonchn(int);
463 void wakeup(struct monst
*);
464 void seemimic(struct monst
*);
467 void obfree(struct obj
*, struct obj
*);
469 char *shkname(struct monst
*);
470 void shkdead(struct monst
*);
471 void replshk(struct monst
*, struct monst
*);
475 struct obj
*bp_to_obj(struct bill_x
*);
476 void addtobill(struct obj
*);
477 void splitbill(struct obj
*, struct obj
*);
478 void subfrombill(struct obj
*);
480 int shkcatch(struct obj
*);
481 int shk_move(struct monst
*);
483 int online(int, int);
484 int follower(struct monst
*);
487 void findname(char *, int);
491 void stealgold(struct monst
*);
493 int steal(struct monst
*);
494 void mpickobj(struct monst
*, struct obj
*);
495 int stealamulet(struct monst
*);
496 void relobj(struct monst
*, int);
500 void start_screen(void);
501 void end_screen(void);
503 void nocmov(int, int);
506 void xputs(const char *);
508 void clear_screen(void);
510 void standoutbeg(void);
511 void standoutend(void);
514 void delay_output(void);
519 void stoned_dialogue(void);
522 int doredotopl(void);
523 void redotoplin(void);
524 void remember_topl(void);
525 void addtopl(const char *);
526 void xmore(const char *);
528 void cmore(const char *);
530 void pline(const char *, ...)
531 __attribute__((__format__(__printf__
, 1, 2)));
532 void vpline(const char *, va_list)
533 __attribute__((__format__(__printf__
, 1, 0)));
535 void putstr(const char *);
540 coord
*gettrack(int, int);
543 struct trap
*maketrap(int, int, int);
544 void dotrap(struct trap
*);
545 int mintrap(struct monst
*);
546 void selftouch(const char *);
548 void float_down(void);
551 void teleds(int, int);
552 int teleok(int, int);
555 void unplacebc(void);
556 void level_tele(void);
561 void settty(const char *);
564 void error(const char *, ...)
565 __attribute__((__format__(__printf__
, 1, 2),__noreturn__
));
568 void cgetret(const char *);
569 void xwaitforspace(const char *);
572 void end_of_input(void) __attribute__((__noreturn__
));
577 void ini_inv(struct trobj
*);
579 void plnamesuffix(void);
583 void setrandom(void);
584 struct tm
*getlt(void);
587 int phase_of_the_moon(void);
590 void gethdate(char *);
594 void getmailstatus(void);
595 void ckmailstatus(void);
597 void mdrush(struct monst
*, boolean
);
599 void regularize(char *);
605 void replgd(struct monst
*, struct monst
*);
612 void setuwep(struct obj
*);
614 void corrode_weapon(void);
615 int chwepon(struct obj
*, int);
619 int wiz_hit(struct monst
*);
620 void inrange(struct monst
*);
621 void aggravate(void);
622 void clonewiz(struct monst
*);
626 int getwn(struct monst
*);
627 void initworm(struct monst
*);
628 void worm_move(struct monst
*);
629 void worm_nomove(struct monst
*);
630 void wormdead(struct monst
*);
631 void wormhit(struct monst
*);
632 void wormsee(unsigned);
634 void pwseg(struct wseg
*);
635 void cutworm(struct monst
*, xchar
, xchar
, uchar
);
636 void remseg(struct wseg
*);
640 void setworn(struct obj
*, long);
641 void setnotworn(struct obj
*);
644 void bhitm(struct monst
*, struct obj
*);
645 int bhito(struct obj
*, struct obj
*);
647 const char *exclam(int);
648 void hit(const char *, struct monst
*, const char *);
649 void miss(const char *, struct monst
*);
650 struct monst
*bhit(int, int, int, int,
651 void (*)(struct monst
*, struct obj
*),
652 int (*)(struct obj
*, struct obj
*),
654 struct monst
*boomhit(int, int);
655 char dirlet(int, int);
656 void buzz(int, xchar
, xchar
, int, int);
657 int zhit(struct monst
*, int);
658 int revive(struct obj
*);
659 void rloco(struct obj
*);
660 void fracture_rock(struct obj
*);
661 void burn_scrolls(void);
668 #endif /* _EXTERN_H_ */