]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/extern.h
18cd2540cb76c00ad8caa8cb5760f7670ed58ceb
1 /* $NetBSD: extern.h,v 1.10 2009/05/06 02:59:12 ginsbach 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.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
37 long *alloc(unsigned);
38 long *enlarge(char *, unsigned);
53 void movobj(struct obj
*, int, int);
56 void lookaround(void);
57 int monster_nearby(void);
59 int cansee(xchar
, xchar
);
66 void losehp(int, const char *);
67 void losehp_m(int, struct monst
*);
74 void rhack(const char *);
87 void dropx(struct obj
*);
88 void dropy(struct obj
*);
92 void goto_level(int, boolean
);
96 struct obj
*splitobj(struct obj
*, int);
97 void more_experienced(int, int);
98 void set_wounded_legs(long, int);
102 coord
getpos(int, const char *);
104 void do_oname(struct obj
*);
106 void docall(struct obj
*);
107 char *xmonnam(struct monst
*, int);
108 char *lmonnam(struct monst
*);
109 char *monnam(struct monst
*);
110 char *Monnam(struct monst
*);
111 char *amonnam(struct monst
*, const char *);
112 char *Amonnam(struct monst
*, const char *);
113 char *Xmonnam(struct monst
*);
117 void off_msg(struct obj
*);
120 int dorr(struct obj
*);
121 int cursed(struct obj
*);
122 int armoroff(struct obj
*);
124 int dowearring(void);
125 void ringoff(struct obj
*);
128 struct obj
*some_armor(void);
129 void corrode_armor(void);
133 void initedog(struct monst
*);
136 void fall_down(struct monst
*);
137 int dogfood(struct obj
*);
138 int dog_move(struct monst
*, int);
139 int inroom(xchar
, xchar
);
140 int tamedog(struct monst
*, struct obj
*);
143 void init_uhunger(void);
147 void gethungry(void);
148 void morehungry(int);
149 void lesshungry(int);
151 void newuhs(boolean
);
152 int poisonous(struct obj
*);
153 int eatcorpse(struct obj
*);
159 void done_hangup(int);
160 void done_in_by(struct monst
*);
161 void done(const char *);
163 void outheader(void);
165 int outentry(int, struct toptenentry
*, int);
167 const char *ordin(int);
168 void clearlocks(void);
169 void hangup(int) __attribute__((__noreturn__
));
171 void charcat(char *, int);
172 void prscore(int, char **);
175 struct engr
*engr_at(xchar
, xchar
);
176 int sengr_at(const char *, xchar
, xchar
);
177 void u_wipe_engr(int);
178 void wipe_engr_at(xchar
, xchar
, xchar
);
179 void read_engr_at(int, int);
180 void make_engr_at(int, int, const char *);
182 void save_engravings(int);
183 void rest_engravings(int);
184 void del_engr(struct engr
*);
187 int hitmm(struct monst
*, struct monst
*);
188 void mondied(struct monst
*);
189 void monstone(struct monst
*);
190 int fightm(struct monst
*);
191 int thitu(int, int, const char *);
192 boolean
hmon(struct monst
*, struct obj
*, int);
193 int attack(struct monst
*);
196 struct obj
*addinv(struct obj
*);
197 void useup(struct obj
*);
198 void freeinv(struct obj
*);
199 void delobj(struct obj
*);
200 void freeobj(struct obj
*);
201 void freegold(struct gold
*);
202 void deltrap(struct trap
*);
203 struct monst
*m_at(int, int);
204 struct obj
*o_at(int, int);
205 struct obj
*sobj_at(int, int, int);
206 int carried(struct obj
*);
208 struct obj
*o_on(unsigned int, struct obj
*);
209 struct trap
*t_at(int, int);
210 struct gold
*g_at(int, int);
211 struct obj
*mkgoldobj(long);
212 struct obj
*getobj(const char *, const char *);
213 int ckunpaid(struct obj
*);
214 int ggetobj(const char *, int (*fn
)(struct obj
*), int);
215 int askchain(struct obj
*, char *, int, int (*)(struct obj
*),
216 int (*)(struct obj
*), int);
217 char obj_to_let(struct obj
*);
218 void prinv(struct obj
*);
223 void stackobj(struct obj
*);
224 int merged(struct obj
*, struct obj
*, int);
233 void getioctls(void);
234 void setioctls(void);
238 void savelev(int, xchar
);
239 void bwrite(int, const void *, size_t);
240 void saveobjchn(int, struct obj
*);
241 void savemonchn(int, struct monst
*);
242 void savegoldchn(int, struct gold
*);
243 void savetrapchn(int, struct trap
*);
244 void getlev(int, int, xchar
);
245 void mread(int, char *, unsigned);
251 void impossible(const char *, ...)
252 __attribute__((__format__(__printf__
, 1, 2)));
253 void stop_occupation(void);
256 struct monst
*makemon(const struct permonst
*, int, int);
257 coord
enexto(xchar
, xchar
);
258 int goodpos(int, int);
259 void rloc(struct monst
*);
260 struct monst
*mkmon_at(int, int, int);
263 int mhitu(struct monst
*);
264 int hitu(struct monst
*, int);
267 void makelevel(void);
269 void addrs(int, int, int, int);
270 void addrsx(int, int, int, int, boolean
);
272 int comp(const void *, const void *);
273 coord
finddpos(int, int, int, int);
274 int okdoor(int, int);
275 void dodoor(int, int, struct mkroom
*);
276 void dosdoor(int, int, struct mkroom
*, int);
277 int maker(schar
, schar
, schar
, schar
);
278 void makecorridors(void);
280 void make_niches(void);
281 void makevtele(void);
282 void makeniche(boolean
);
283 void mktrap(int, int, struct mkroom
*);
287 void walkfrom(int, int);
288 void move(int *, int *, int);
289 int okay(int, int, int);
293 struct obj
*mkobj_at(int, int, int);
294 void mksobj_at(int, int, int);
295 struct obj
*mkobj(int);
296 struct obj
*mksobj(int);
298 int weight(struct obj
*);
299 void mkgold(long, int, int);
304 const struct permonst
*morguemon(void);
306 int nexttodoor(int, int);
307 int has_dnstairs(struct mkroom
*);
308 int has_upstairs(struct mkroom
*);
309 int isbig(struct mkroom
*);
310 int dist2(int, int, int, int);
315 void justswld(struct monst
*, const char *);
316 void youswld(struct monst
*, int, int, const char *);
317 int dochugw(struct monst
*);
318 int dochug(struct monst
*);
319 int m_move(struct monst
*, int);
320 void mpickgold(struct monst
*);
321 void mpickgems(struct monst
*);
322 int mfndpos(struct monst
*, coord
[9 ], int[9 ], int);
324 void poisoned(const char *, const char *);
325 void mondead(struct monst
*);
326 void replmon(struct monst
*, struct monst
*);
327 void relmon(struct monst
*);
328 void monfree(struct monst
*);
329 void dmonsfree(void);
330 void unstuck(struct monst
*);
331 void killed(struct monst
*);
332 void kludge(const char *, const char *);
334 int newcham(struct monst
*, const struct permonst
*);
335 void mnexto(struct monst
*);
336 int ishuman(struct monst
*);
337 void setmangry(struct monst
*);
338 int canseemon(struct monst
*);
344 void init_objects(void);
346 void setgemprobs(void);
350 int dodiscovered(void);
351 int interesting_to_discover(int);
354 char *strprepend(char *, char *);
357 char *xname(struct obj
*);
358 char *doname(struct obj
*);
359 void setan(const char *, char *);
360 char *aobjnam(struct obj
*, const char *);
361 char *Doname(struct obj
*);
362 struct obj
*readobjnam(char *);
365 void initoptions(void);
366 void parseoptions(char *, boolean
);
372 void page_more(FILE *, int);
373 void set_whole_screen(void);
376 int page_line(const char *);
377 void cornline(int, const char *);
379 int page_file(const char *, boolean
);
386 void strange_feeling(struct obj
*, const char *);
387 void potionhit(struct monst
*, struct obj
*);
388 void potionbreathe(struct obj
*);
390 void ghost_from_bottle(void);
393 void swallowed(void);
394 void panic(const char *, ...)
395 __attribute__((__format__(__printf__
, 1, 2)));
396 void atl(int, int, int);
397 void on_scr(int, int);
398 void tmp_at(schar
, schar
);
399 void Tmp_at(schar
, schar
);
400 void setclipped(void) __attribute__((__noreturn__
));
401 void at(xchar
, xchar
, int);
405 void docorner(int, int);
406 void curs_on_u(void);
409 char news0(xchar
, xchar
);
410 void newsym(int, int);
411 void mnewsym(int, int);
412 void nosee(int, int);
414 void nose1(int, int);
415 int vism_at(int, int);
416 void pobj(struct obj
*);
417 void unpobj(struct obj
*);
420 void pmon(struct monst
*);
421 void unpmon(struct monst
*);
425 void mstatusline(struct monst
*);
430 int identify(struct obj
*);
431 void litroom(boolean
);
436 void center(int, char *);
439 void init_rumors(FILE *);
440 int skipline(FILE *);
441 void outline(FILE *);
449 struct obj
*restobjchn(int);
450 struct monst
*restmonchn(int);
456 void wakeup(struct monst
*);
457 void seemimic(struct monst
*);
460 void obfree(struct obj
*, struct obj
*);
462 char *shkname(struct monst
*);
463 void shkdead(struct monst
*);
464 void replshk(struct monst
*, struct monst
*);
468 struct obj
*bp_to_obj(struct bill_x
*);
469 void addtobill(struct obj
*);
470 void splitbill(struct obj
*, struct obj
*);
471 void subfrombill(struct obj
*);
473 int shkcatch(struct obj
*);
474 int shk_move(struct monst
*);
476 int online(int, int);
477 int follower(struct monst
*);
480 void findname(char *, int);
484 void stealgold(struct monst
*);
486 int steal(struct monst
*);
487 void mpickobj(struct monst
*, struct obj
*);
488 int stealamulet(struct monst
*);
489 void relobj(struct monst
*, int);
493 void start_screen(void);
494 void end_screen(void);
496 void nocmov(int, int);
499 void xputs(const char *);
501 void clear_screen(void);
503 void standoutbeg(void);
504 void standoutend(void);
507 void delay_output(void);
512 void stoned_dialogue(void);
515 int doredotopl(void);
516 void redotoplin(void);
517 void remember_topl(void);
518 void addtopl(const char *);
519 void xmore(const char *);
521 void cmore(const char *);
523 void pline(const char *, ...)
524 __attribute__((__format__(__printf__
, 1, 2)));
525 void vpline(const char *, va_list)
526 __attribute__((__format__(__printf__
, 1, 0)));
528 void putstr(const char *);
533 coord
*gettrack(int, int);
536 struct trap
*maketrap(int, int, int);
537 void dotrap(struct trap
*);
538 int mintrap(struct monst
*);
539 void selftouch(const char *);
541 void float_down(void);
544 void teleds(int, int);
545 int teleok(int, int);
548 void unplacebc(void);
549 void level_tele(void);
554 void settty(const char *);
557 void error(const char *, ...)
558 __attribute__((__format__(__printf__
, 1, 2),__noreturn__
));
561 void cgetret(const char *);
562 void xwaitforspace(const char *);
565 void end_of_input(void) __attribute__((__noreturn__
));
570 void ini_inv(struct trobj
*);
572 void plnamesuffix(void);
576 void setrandom(void);
577 struct tm
*getlt(void);
579 char *getdatestr(void);
580 int phase_of_the_moon(void);
583 void gethdate(char *);
587 void getmailstatus(void);
588 void ckmailstatus(void);
590 void mdrush(struct monst
*, boolean
);
592 void regularize(char *);
598 void replgd(struct monst
*, struct monst
*);
605 void setuwep(struct obj
*);
607 void corrode_weapon(void);
608 int chwepon(struct obj
*, int);
612 int wiz_hit(struct monst
*);
613 void inrange(struct monst
*);
614 void aggravate(void);
615 void clonewiz(struct monst
*);
619 int getwn(struct monst
*);
620 void initworm(struct monst
*);
621 void worm_move(struct monst
*);
622 void worm_nomove(struct monst
*);
623 void wormdead(struct monst
*);
624 void wormhit(struct monst
*);
625 void wormsee(unsigned);
627 void pwseg(struct wseg
*);
628 void cutworm(struct monst
*, xchar
, xchar
, uchar
);
629 void remseg(struct wseg
*);
633 void setworn(struct obj
*, long);
634 void setnotworn(struct obj
*);
637 void bhitm(struct monst
*, struct obj
*);
638 int bhito(struct obj
*, struct obj
*);
640 const char *exclam(int);
641 void hit(const char *, struct monst
*, const char *);
642 void miss(const char *, struct monst
*);
643 struct monst
*bhit(int, int, int, int,
644 void (*)(struct monst
*, struct obj
*),
645 int (*)(struct obj
*, struct obj
*),
647 struct monst
*boomhit(int, int);
648 char dirlet(int, int);
649 void buzz(int, xchar
, xchar
, int, int);
650 int zhit(struct monst
*, int);
651 int revive(struct obj
*);
652 void rloco(struct obj
*);
653 void fracture_rock(struct obj
*);
654 void burn_scrolls(void);
661 #endif /* _EXTERN_H_ */