]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/extern.h
1 /* $NetBSD: extern.h,v 1.19 2021/05/02 12:50:44 rillig 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.
54 void lookaround(void);
55 int monster_nearby(void);
57 int cansee(xchar
, xchar
);
64 void losehp(int, const char *);
65 void losehp_m(int, struct monst
*);
71 void rhack(const char *);
81 void dropx(struct obj
*);
85 void goto_level(int, boolean
);
89 struct obj
*splitobj(struct obj
*, int);
90 void more_experienced(int, int);
91 void set_wounded_legs(long, int);
95 coord
getpos(int, const char *);
98 void docall(struct obj
*);
99 char *monnam(struct monst
*);
100 char *Monnam(struct monst
*);
101 char *amonnam(struct monst
*, const char *);
102 char *Amonnam(struct monst
*, const char *);
103 char *Xmonnam(struct monst
*);
108 int armoroff(struct obj
*);
110 int dowearring(void);
111 void ringoff(struct obj
*);
114 struct obj
*some_armor(void);
115 void corrode_armor(void);
121 void fall_down(struct monst
*);
122 int dog_move(struct monst
*, int);
123 int inroom(xchar
, xchar
);
124 int tamedog(struct monst
*, struct obj
*);
127 void init_uhunger(void);
129 void gethungry(void);
130 void morehungry(int);
131 void lesshungry(int);
132 int poisonous(struct obj
*);
137 void done_in_by(struct monst
*);
138 void done(const char *);
139 void clearlocks(void);
140 void hang_up(int) __dead
;
142 void charcat(char *, int);
143 void prscore(int, char **);
146 int sengr_at(const char *, xchar
, xchar
);
147 void u_wipe_engr(int);
148 void wipe_engr_at(xchar
, xchar
, xchar
);
149 void read_engr_at(int, int);
150 void make_engr_at(int, int, const char *);
152 void save_engravings(int);
153 void rest_engravings(int);
156 int hitmm(struct monst
*, struct monst
*);
157 void mondied(struct monst
*);
158 int fightm(struct monst
*);
159 int thitu(int, int, const char *);
160 boolean
hmon(struct monst
*, struct obj
*, int);
161 int attack(struct monst
*);
164 struct obj
*addinv(struct obj
*);
165 void useup(struct obj
*);
166 void freeinv(struct obj
*);
167 void delobj(struct obj
*);
168 void freeobj(struct obj
*);
169 void freegold(struct gold
*);
170 void deltrap(struct trap
*);
171 struct monst
*m_at(int, int);
172 struct obj
*o_at(int, int);
173 struct obj
*sobj_at(int, int, int);
174 int carried(struct obj
*);
176 struct obj
*o_on(unsigned int, struct obj
*);
177 struct trap
*t_at(int, int);
178 struct gold
*g_at(int, int);
179 struct obj
*getobj(const char *, const char *);
180 int ggetobj(const char *, int (*fn
)(struct obj
*), int);
181 int askchain(struct obj
*, char *, int, int (*)(struct obj
*),
182 int (*)(struct obj
*), int);
183 void prinv(struct obj
*);
187 void stackobj(struct obj
*);
195 void getioctls(void);
196 void setioctls(void);
200 void savelev(int, xchar
);
201 void bwrite(int, const void *, size_t);
202 void saveobjchn(int, struct obj
*);
203 void savemonchn(int, struct monst
*);
204 void getlev(int, int, xchar
);
205 void mread(int, void *, size_t);
211 void impossible(const char *, ...) __printflike(1, 2);
212 void stop_occupation(void);
215 struct monst
*makemon(const struct permonst
*, int, int);
216 coord
enexto(xchar
, xchar
);
217 int goodpos(int, int);
218 void rloc(struct monst
*);
219 struct monst
*mkmon_at(int, int, int);
222 int mhitu(struct monst
*);
223 int hitu(struct monst
*, int);
227 void makelevel(void);
228 void mktrap(int, int, struct mkroom
*);
235 struct obj
*mkobj_at(int, int, int);
236 void mksobj_at(int, int, int);
237 struct obj
*mkobj(int);
238 struct obj
*mksobj(int);
240 int weight(struct obj
*);
241 void mkgold(long, int, int);
250 void justswld(struct monst
*, const char *);
251 void youswld(struct monst
*, int, unsigned int, const char *);
252 int dochug(struct monst
*);
253 int m_move(struct monst
*, int);
254 int mfndpos(struct monst
*, coord
[9 ], int[9 ], int);
256 void poisoned(const char *, const char *);
257 void mondead(struct monst
*);
258 void replmon(struct monst
*, struct monst
*);
259 void relmon(struct monst
*);
260 void monfree(struct monst
*);
261 void unstuck(struct monst
*);
262 void killed(struct monst
*);
263 void kludge(const char *, const char *);
265 int newcham(struct monst
*, const struct permonst
*);
266 void mnexto(struct monst
*);
267 void setmangry(struct monst
*);
268 int canseemon(struct monst
*);
274 void init_objects(void);
279 int dodiscovered(void);
283 char *xname(struct obj
*);
284 char *doname(struct obj
*);
285 void setan(const char *, char *, size_t);
286 char *aobjnam(struct obj
*, const char *);
287 char *Doname(struct obj
*);
288 struct obj
*readobjnam(char *);
291 void initoptions(void);
296 void set_whole_screen(void);
299 int page_line(const char *);
300 void cornline(int, const char *);
307 void strange_feeling(struct obj
*, const char *);
308 void potionhit(struct monst
*, struct obj
*);
309 void potionbreathe(struct obj
*);
313 void swallowed(void);
314 void panic(const char *, ...) __printflike(1, 2);
315 void atl(int, int, int);
316 void on_scr(int, int);
317 void tmp_at(schar
, schar
);
318 void Tmp_at(schar
, schar
);
319 void setclipped(void) __dead
;
320 void at(xchar
, xchar
, int);
324 void docorner(int, int);
325 void curs_on_u(void);
328 char news0(xchar
, xchar
);
329 void newsym(int, int);
330 void mnewsym(int, int);
331 void nosee(int, int);
333 void nose1(int, int);
334 int vism_at(int, int);
335 void pobj(struct obj
*);
336 void unpobj(struct obj
*);
339 void pmon(struct monst
*);
340 void unpmon(struct monst
*);
343 void mstatusline(struct monst
*);
348 void litroom(boolean
);
359 struct obj
*restobjchn(int);
360 struct monst
*restmonchn(int);
366 void wakeup(struct monst
*);
367 void seemimic(struct monst
*);
370 void obfree(struct obj
*, struct obj
*);
372 char *shkname(struct monst
*);
373 void shkdead(struct monst
*);
374 void replshk(struct monst
*, struct monst
*);
378 void addtobill(struct obj
*);
379 void splitbill(struct obj
*, struct obj
*);
380 void subfrombill(struct obj
*);
382 int shkcatch(struct obj
*);
383 int shk_move(struct monst
*);
385 int online(int, int);
386 int follower(struct monst
*);
389 void findname(char *, int);
393 void stealgold(struct monst
*);
394 int steal(struct monst
*);
395 void mpickobj(struct monst
*, struct obj
*);
396 int stealamulet(struct monst
*);
397 void relobj(struct monst
*, int);
401 void startscreen(void);
402 void endscreen(void);
405 void clearscreen(void);
407 void standoutbeg(void);
408 void standoutend(void);
410 void sound_bell(void);
411 void delay_output(void);
418 int doredotopl(void);
419 void remember_topl(void);
420 void addtopl(const char *);
422 void cmore(const char *);
424 void pline(const char *, ...) __printflike(1, 2);
425 void vpline(const char *, va_list) __printflike(1, 0);
427 void putstr(const char *);
432 coord
*gettrack(int, int);
435 struct trap
*maketrap(int, int, int);
436 void dotrap(struct trap
*);
437 int mintrap(struct monst
*);
438 void selftouch(const char *);
440 void float_down(void);
444 void unplacebc(void);
445 void level_tele(void);
450 void settty(const char *);
452 void error(const char *, ...) __printflike(1, 2) __dead
;
455 void cgetret(const char *);
456 void xwaitforspace(const char *);
459 void end_of_input(void) __dead
;
464 void plnamesuffix(void);
467 void setrandom(void);
469 char *getdatestr(void);
470 int phase_of_the_moon(void);
473 void gethdate(char *);
476 void getmailstatus(void);
477 void ckmailstatus(void);
479 void mdrush(struct monst
*, boolean
);
481 void regularize(char *);
487 void replgd(struct monst
*, struct monst
*);
494 void setuwep(struct obj
*);
496 void corrode_weapon(void);
497 int chwepon(struct obj
*, int);
501 int wiz_hit(struct monst
*);
502 void inrange(struct monst
*);
506 int getwn(struct monst
*);
507 void initworm(struct monst
*);
508 void worm_move(struct monst
*);
509 void worm_nomove(struct monst
*);
510 void wormdead(struct monst
*);
511 void wormhit(struct monst
*);
512 void wormsee(unsigned);
514 void pwseg(struct wseg
*);
515 void cutworm(struct monst
*, xchar
, xchar
, uchar
);
519 void setworn(struct obj
*, long);
520 void setnotworn(struct obj
*);
524 const char *exclam(int);
525 void hit(const char *, struct monst
*, const char *);
526 void miss(const char *, struct monst
*);
527 struct monst
*bhit(int, int, int, int,
528 void (*)(struct monst
*, struct obj
*),
529 int (*)(struct obj
*, struct obj
*),
531 struct monst
*boomhit(int, int);
532 void buzz(int, xchar
, xchar
, int, int);
533 void fracture_rock(struct obj
*);
540 #endif /* _EXTERN_H_ */