1 /* $NetBSD: extern.h,v 1.11 2009/06/07 20:13:18 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.
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);
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 hangup(int) __attribute__((__noreturn__
));
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, char *, unsigned);
211 void impossible(const char *, ...)
212 __attribute__((__format__(__printf__
, 1, 2)));
213 void stop_occupation(void);
216 struct monst
*makemon(const struct permonst
*, int, int);
217 coord
enexto(xchar
, xchar
);
218 int goodpos(int, int);
219 void rloc(struct monst
*);
220 struct monst
*mkmon_at(int, int, int);
223 int mhitu(struct monst
*);
224 int hitu(struct monst
*, int);
228 void makelevel(void);
229 void mktrap(int, int, struct mkroom
*);
236 struct obj
*mkobj_at(int, int, int);
237 void mksobj_at(int, int, int);
238 struct obj
*mkobj(int);
239 struct obj
*mksobj(int);
241 int weight(struct obj
*);
242 void mkgold(long, int, int);
251 void justswld(struct monst
*, const char *);
252 void youswld(struct monst
*, int, int, const char *);
253 int dochug(struct monst
*);
254 int m_move(struct monst
*, int);
255 int mfndpos(struct monst
*, coord
[9 ], int[9 ], int);
257 void poisoned(const char *, const char *);
258 void mondead(struct monst
*);
259 void replmon(struct monst
*, struct monst
*);
260 void relmon(struct monst
*);
261 void monfree(struct monst
*);
262 void unstuck(struct monst
*);
263 void killed(struct monst
*);
264 void kludge(const char *, const char *);
266 int newcham(struct monst
*, const struct permonst
*);
267 void mnexto(struct monst
*);
268 void setmangry(struct monst
*);
269 int canseemon(struct monst
*);
275 void init_objects(void);
280 int dodiscovered(void);
284 char *xname(struct obj
*);
285 char *doname(struct obj
*);
286 void setan(const char *, char *, size_t);
287 char *aobjnam(struct obj
*, const char *);
288 char *Doname(struct obj
*);
289 struct obj
*readobjnam(char *);
292 void initoptions(void);
297 void set_whole_screen(void);
300 int page_line(const char *);
301 void cornline(int, const char *);
308 void strange_feeling(struct obj
*, const char *);
309 void potionhit(struct monst
*, struct obj
*);
310 void potionbreathe(struct obj
*);
314 void swallowed(void);
315 void panic(const char *, ...)
316 __attribute__((__format__(__printf__
, 1, 2)));
317 void atl(int, int, int);
318 void on_scr(int, int);
319 void tmp_at(schar
, schar
);
320 void Tmp_at(schar
, schar
);
321 void setclipped(void) __attribute__((__noreturn__
));
322 void at(xchar
, xchar
, int);
326 void docorner(int, int);
327 void curs_on_u(void);
330 char news0(xchar
, xchar
);
331 void newsym(int, int);
332 void mnewsym(int, int);
333 void nosee(int, int);
335 void nose1(int, int);
336 int vism_at(int, int);
337 void pobj(struct obj
*);
338 void unpobj(struct obj
*);
341 void pmon(struct monst
*);
342 void unpmon(struct monst
*);
345 void mstatusline(struct monst
*);
350 void litroom(boolean
);
361 struct obj
*restobjchn(int);
362 struct monst
*restmonchn(int);
368 void wakeup(struct monst
*);
369 void seemimic(struct monst
*);
372 void obfree(struct obj
*, struct obj
*);
374 char *shkname(struct monst
*);
375 void shkdead(struct monst
*);
376 void replshk(struct monst
*, struct monst
*);
380 void addtobill(struct obj
*);
381 void splitbill(struct obj
*, struct obj
*);
382 void subfrombill(struct obj
*);
384 int shkcatch(struct obj
*);
385 int shk_move(struct monst
*);
387 int online(int, int);
388 int follower(struct monst
*);
391 void findname(char *, int);
395 void stealgold(struct monst
*);
396 int steal(struct monst
*);
397 void mpickobj(struct monst
*, struct obj
*);
398 int stealamulet(struct monst
*);
399 void relobj(struct monst
*, int);
403 void start_screen(void);
404 void end_screen(void);
407 void clear_screen(void);
409 void standoutbeg(void);
410 void standoutend(void);
413 void delay_output(void);
420 int doredotopl(void);
421 void remember_topl(void);
422 void addtopl(const char *);
424 void cmore(const char *);
426 void pline(const char *, ...)
427 __attribute__((__format__(__printf__
, 1, 2)));
428 void vpline(const char *, va_list)
429 __attribute__((__format__(__printf__
, 1, 0)));
431 void putstr(const char *);
436 coord
*gettrack(int, int);
439 struct trap
*maketrap(int, int, int);
440 void dotrap(struct trap
*);
441 int mintrap(struct monst
*);
442 void selftouch(const char *);
444 void float_down(void);
448 void unplacebc(void);
449 void level_tele(void);
454 void settty(const char *);
456 void error(const char *, ...)
457 __attribute__((__format__(__printf__
, 1, 2),__noreturn__
));
460 void cgetret(const char *);
461 void xwaitforspace(const char *);
464 void end_of_input(void) __attribute__((__noreturn__
));
469 void plnamesuffix(void);
472 void setrandom(void);
474 char *getdatestr(void);
475 int phase_of_the_moon(void);
478 void gethdate(char *);
481 void getmailstatus(void);
482 void ckmailstatus(void);
484 void mdrush(struct monst
*, boolean
);
486 void regularize(char *);
492 void replgd(struct monst
*, struct monst
*);
499 void setuwep(struct obj
*);
501 void corrode_weapon(void);
502 int chwepon(struct obj
*, int);
506 int wiz_hit(struct monst
*);
507 void inrange(struct monst
*);
511 int getwn(struct monst
*);
512 void initworm(struct monst
*);
513 void worm_move(struct monst
*);
514 void worm_nomove(struct monst
*);
515 void wormdead(struct monst
*);
516 void wormhit(struct monst
*);
517 void wormsee(unsigned);
519 void pwseg(struct wseg
*);
520 void cutworm(struct monst
*, xchar
, xchar
, uchar
);
524 void setworn(struct obj
*, long);
525 void setnotworn(struct obj
*);
529 const char *exclam(int);
530 void hit(const char *, struct monst
*, const char *);
531 void miss(const char *, struct monst
*);
532 struct monst
*bhit(int, int, int, int,
533 void (*)(struct monst
*, struct obj
*),
534 int (*)(struct obj
*, struct obj
*),
536 struct monst
*boomhit(int, int);
537 void buzz(int, xchar
, xchar
, int, int);
538 void fracture_rock(struct obj
*);
545 #endif /* _EXTERN_H_ */