xref: /netbsd/games/hack/extern.h (revision bf9ec67e)
1 /*	$NetBSD: extern.h,v 1.5 2002/05/26 00:12:12 wiz Exp $	*/
2 
3 /*-
4  * Copyright (c) 1997 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Christos Zoulas.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
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.
25  *
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.
37  */
38 #ifndef _EXTERN_H_
39 #define _EXTERN_H_
40 #include <stdarg.h>
41 #include <stdio.h>
42 
43 /* alloc.c */
44 long *alloc __P((unsigned));
45 long *enlarge __P((char *, unsigned));
46 
47 /* hack.apply.c */
48 int doapply __P((void));
49 int holetime __P((void));
50 void dighole __P((void));
51 
52 /* hack.bones.c */
53 void savebones __P((void));
54 int getbones __P((void));
55 
56 /* hack.c */
57 void unsee __P((void));
58 void seeoff __P((int));
59 void domove __P((void));
60 void movobj __P((struct obj *, int, int));
61 int dopickup __P((void));
62 void pickup __P((int));
63 void lookaround __P((void));
64 int monster_nearby __P((void));
65 int rroom __P((int, int));
66 int cansee __P((xchar, xchar));
67 int sgn __P((int));
68 void setsee __P((void));
69 void nomul __P((int));
70 int abon __P((void));
71 int dbon __P((void));
72 void losestr __P((int));
73 void losehp __P((int, const char *));
74 void losehp_m __P((int, struct monst *));
75 void losexp __P((void));
76 int inv_weight __P((void));
77 int inv_cnt __P((void));
78 long newuexp __P((void));
79 
80 /* hack.cmd.c */
81 void rhack __P((const char *));
82 int doextcmd __P((void));
83 char lowc __P((int));
84 char unctrl __P((int));
85 int movecmd __P((int));
86 int getdir __P((boolean));
87 void confdir __P((void));
88 int finddir __P((void));
89 int isroom __P((int, int));
90 int isok __P((int, int));
91 
92 /* hack.do.c */
93 int dodrop __P((void));
94 void dropx __P((struct obj *));
95 void dropy __P((struct obj *));
96 int doddrop __P((void));
97 int dodown __P((void));
98 int doup __P((void));
99 void goto_level __P((int, boolean));
100 int donull __P((void));
101 int dopray __P((void));
102 int dothrow __P((void));
103 struct obj *splitobj __P((struct obj *, int));
104 void more_experienced __P((int, int));
105 void set_wounded_legs __P((long, int));
106 void heal_legs __P((void));
107 
108 /* hack.do_name.c */
109 coord getpos __P((int, const char *));
110 int do_mname __P((void));
111 void do_oname __P((struct obj *));
112 int ddocall __P((void));
113 void docall __P((struct obj *));
114 char *xmonnam __P((struct monst *, int));
115 char *lmonnam __P((struct monst *));
116 char *monnam __P((struct monst *));
117 char *Monnam __P((struct monst *));
118 char *amonnam __P((struct monst *, const char *));
119 char *Amonnam __P((struct monst *, const char *));
120 char *Xmonnam __P((struct monst *));
121 char *visctrl __P((int));
122 
123 /* hack.do_wear.c */
124 void off_msg __P((struct obj *));
125 int doremarm __P((void));
126 int doremring __P((void));
127 int dorr __P((struct obj *));
128 int cursed __P((struct obj *));
129 int armoroff __P((struct obj *));
130 int doweararm __P((void));
131 int dowearring __P((void));
132 void ringoff __P((struct obj *));
133 void find_ac __P((void));
134 void glibr __P((void));
135 struct obj *some_armor __P((void));
136 void corrode_armor __P((void));
137 
138 /* hack.dog.c */
139 void makedog __P((void));
140 void initedog __P((struct monst *));
141 void losedogs __P((void));
142 void keepdogs __P((void));
143 void fall_down __P((struct monst *));
144 int dogfood __P((struct obj *));
145 int dog_move __P((struct monst *, int));
146 int inroom __P((xchar, xchar));
147 int tamedog __P((struct monst *, struct obj *));
148 
149 /* hack.eat.c */
150 void init_uhunger __P((void));
151 int opentin __P((void));
152 int Meatdone __P((void));
153 int doeat __P((void));
154 void gethungry __P((void));
155 void morehungry __P((int));
156 void lesshungry __P((int));
157 int unfaint __P((void));
158 void newuhs __P((boolean));
159 int poisonous __P((struct obj *));
160 int eatcorpse __P((struct obj *));
161 
162 /* hack.end.c */
163 int dodone __P((void));
164 void done1 __P((int));
165 void done_intr __P((int));
166 void done_hangup __P((int));
167 void done_in_by __P((struct monst *));
168 void done __P((const char *));
169 void topten __P((void));
170 void outheader __P((void));
171 struct toptenentry;
172 int outentry __P((int, struct toptenentry *, int));
173 char *itoa __P((int));
174 const char *ordin __P((int));
175 void clearlocks __P((void));
176 void hangup __P((int)) __attribute__((__noreturn__));
177 char *eos __P((char *));
178 void charcat __P((char *, int));
179 void prscore __P((int, char **));
180 
181 /* hack.engrave.c */
182 struct engr *engr_at __P((xchar, xchar));
183 int sengr_at __P((const char *, xchar, xchar));
184 void u_wipe_engr __P((int));
185 void wipe_engr_at __P((xchar, xchar, xchar));
186 void read_engr_at __P((int, int));
187 void make_engr_at __P((int, int, const char *));
188 int doengrave __P((void));
189 void save_engravings __P((int));
190 void rest_engravings __P((int));
191 void del_engr __P((struct engr *));
192 
193 /* hack.fight.c */
194 int hitmm __P((struct monst *, struct monst *));
195 void mondied __P((struct monst *));
196 void monstone __P((struct monst *));
197 int fightm __P((struct monst *));
198 int thitu __P((int, int, const char *));
199 boolean hmon __P((struct monst *, struct obj *, int));
200 int attack __P((struct monst *));
201 
202 /* hack.invent.c */
203 struct obj *addinv __P((struct obj *));
204 void useup __P((struct obj *));
205 void freeinv __P((struct obj *));
206 void delobj __P((struct obj *));
207 void freeobj __P((struct obj *));
208 void freegold __P((struct gold *));
209 void deltrap __P((struct trap *));
210 struct monst *m_at __P((int, int));
211 struct obj *o_at __P((int, int));
212 struct obj *sobj_at __P((int, int, int));
213 int carried __P((struct obj *));
214 int carrying __P((int));
215 struct obj *o_on __P((unsigned int, struct obj *));
216 struct trap *t_at __P((int, int));
217 struct gold *g_at __P((int, int));
218 struct obj *mkgoldobj __P((long));
219 struct obj *getobj __P((const char *, const char *));
220 int ckunpaid __P((struct obj *));
221 int ggetobj __P((const char *, int (*fn)(struct obj *), int));
222 int askchain __P((struct obj *, char *, int, int (*)(struct obj *),
223     int (*)(struct obj *), int));
224 char obj_to_let __P((struct obj *));
225 void prinv __P((struct obj *));
226 int ddoinv __P((void));
227 void doinv __P((char *));
228 int dotypeinv __P((void));
229 int dolook __P((void));
230 void stackobj __P((struct obj *));
231 int merged __P((struct obj *, struct obj *, int));
232 int countgold __P((void));
233 int doprgold __P((void));
234 int doprwep __P((void));
235 int doprarm __P((void));
236 int doprring __P((void));
237 int digit __P((int));
238 
239 /* hack.ioctl.c */
240 void getioctls __P((void));
241 void setioctls __P((void));
242 int dosuspend __P((void));
243 
244 /* hack.lev.c */
245 void savelev __P((int, xchar));
246 void bwrite __P((int, const void *, unsigned));
247 void saveobjchn __P((int, struct obj *));
248 void savemonchn __P((int, struct monst *));
249 void savegoldchn __P((int, struct gold *));
250 void savetrapchn __P((int, struct trap *));
251 void getlev __P((int, int, xchar));
252 void mread __P((int, char *, unsigned));
253 void mklev __P((void));
254 
255 /* hack.main.c */
256 void glo __P((int));
257 void askname __P((void));
258 void impossible __P((const char *, ...))
259     __attribute__((__format__(__printf__, 1, 2)));
260 void stop_occupation __P((void));
261 
262 /* hack.makemon.c */
263 struct monst *makemon __P((const struct permonst *, int, int));
264 coord enexto __P((xchar, xchar));
265 int goodpos __P((int, int));
266 void rloc __P((struct monst *));
267 struct monst *mkmon_at __P((int, int, int));
268 
269 /* hack.mhitu.c */
270 int mhitu __P((struct monst *));
271 int hitu __P((struct monst *, int));
272 
273 /* hack.mklev.c */
274 void makelevel __P((void));
275 int makerooms __P((void));
276 void addrs __P((int, int, int, int));
277 void addrsx __P((int, int, int, int, boolean));
278 struct mkroom;
279 int comp __P((const void *, const void *));
280 coord finddpos __P((int, int, int, int));
281 int okdoor __P((int, int));
282 void dodoor __P((int, int, struct mkroom *));
283 void dosdoor __P((int, int, struct mkroom *, int));
284 int maker __P((schar, schar, schar, schar));
285 void makecorridors __P((void));
286 void join __P((int, int));
287 void make_niches __P((void));
288 void makevtele __P((void));
289 void makeniche __P((boolean));
290 void mktrap __P((int, int, struct mkroom *));
291 
292 /* hack.mkmaze.c */
293 void makemaz __P((void));
294 void walkfrom __P((int, int));
295 void move __P((int *, int *, int));
296 int okay __P((int, int, int));
297 coord mazexy __P((void));
298 
299 /* hack.mkobj.c */
300 struct obj *mkobj_at __P((int, int, int));
301 void mksobj_at __P((int, int, int));
302 struct obj *mkobj __P((int));
303 struct obj *mksobj __P((int));
304 int letter __P((int));
305 int weight __P((struct obj *));
306 void mkgold __P((long, int, int));
307 
308 /* hack.mkshop.c */
309 void mkshop __P((void));
310 void mkzoo __P((int));
311 const struct permonst *morguemon __P((void));
312 void mkswamp __P((void));
313 int nexttodoor __P((int, int));
314 int has_dnstairs __P((struct mkroom *));
315 int has_upstairs __P((struct mkroom *));
316 int isbig __P((struct mkroom *));
317 int dist2 __P((int, int, int, int));
318 int sq __P((int));
319 
320 /* hack.mon.c */
321 void movemon __P((void));
322 void justswld __P((struct monst *, const char *));
323 void youswld __P((struct monst *, int, int, const char *));
324 int dochugw __P((struct monst *));
325 int dochug __P((struct monst *));
326 int m_move __P((struct monst *, int));
327 void mpickgold __P((struct monst *));
328 void mpickgems __P((struct monst *));
329 int mfndpos __P((struct monst *, coord[9 ], int[9 ], int));
330 int dist __P((int, int));
331 void poisoned __P((const char *, const char *));
332 void mondead __P((struct monst *));
333 void replmon __P((struct monst *, struct monst *));
334 void relmon __P((struct monst *));
335 void monfree __P((struct monst *));
336 void dmonsfree __P((void));
337 void unstuck __P((struct monst *));
338 void killed __P((struct monst *));
339 void kludge __P((const char *, const char *));
340 void rescham __P((void));
341 int newcham __P((struct monst *, const struct permonst *));
342 void mnexto __P((struct monst *));
343 int ishuman __P((struct monst *));
344 void setmangry __P((struct monst *));
345 int canseemon __P((struct monst *));
346 
347 /* hack.monst.c */
348 
349 /* hack.o_init.c */
350 int letindex __P((int));
351 void init_objects __P((void));
352 int probtype __P((int));
353 void setgemprobs __P((void));
354 void oinit __P((void));
355 void savenames __P((int));
356 void restnames __P((int));
357 int dodiscovered __P((void));
358 int interesting_to_discover __P((int));
359 
360 /* hack.objnam.c */
361 char *strprepend __P((char *, char *));
362 char *sitoa __P((int));
363 char *typename __P((int));
364 char *xname __P((struct obj *));
365 char *doname __P((struct obj *));
366 void setan __P((const char *, char *));
367 char *aobjnam __P((struct obj *, const char *));
368 char *Doname __P((struct obj *));
369 struct obj *readobjnam __P((char *));
370 
371 /* hack.options.c */
372 void initoptions __P((void));
373 void parseoptions __P((char *, boolean));
374 int doset __P((void));
375 
376 /* hack.pager.c */
377 int dowhatis __P((void));
378 void intruph __P((int));
379 void page_more __P((FILE *, int));
380 void set_whole_screen __P((void));
381 int readnews __P((void));
382 void set_pager __P((int));
383 int page_line __P((const char *));
384 void cornline __P((int, const char *));
385 int dohelp __P((void));
386 int page_file __P((const char *, boolean));
387 int dosh __P((void));
388 int child __P((int));
389 
390 /* hack.potion.c */
391 int dodrink __P((void));
392 void pluslvl __P((void));
393 void strange_feeling __P((struct obj *, const char *));
394 void potionhit __P((struct monst *, struct obj *));
395 void potionbreathe __P((struct obj *));
396 int dodip __P((void));
397 void ghost_from_bottle __P((void));
398 
399 /* hack.pri.c */
400 void swallowed __P((void));
401 void panic __P((const char *, ...))
402     __attribute__((__format__(__printf__, 1, 2)));
403 void atl __P((int, int, int));
404 void on_scr __P((int, int));
405 void tmp_at __P((schar, schar));
406 void Tmp_at __P((schar, schar));
407 void setclipped __P((void)) __attribute__((__noreturn__));
408 void at __P((xchar, xchar, int));
409 void prme __P((void));
410 int doredraw __P((void));
411 void docrt __P((void));
412 void docorner __P((int, int));
413 void curs_on_u __P((void));
414 void pru __P((void));
415 void prl __P((int, int));
416 char news0 __P((xchar, xchar));
417 void newsym __P((int, int));
418 void mnewsym __P((int, int));
419 void nosee __P((int, int));
420 void prl1 __P((int, int));
421 void nose1 __P((int, int));
422 int vism_at __P((int, int));
423 void pobj __P((struct obj *));
424 void unpobj __P((struct obj *));
425 void seeobjs __P((void));
426 void seemons __P((void));
427 void pmon __P((struct monst *));
428 void unpmon __P((struct monst *));
429 void nscr __P((void));
430 void cornbot __P((int));
431 void bot __P((void));
432 void mstatusline __P((struct monst *));
433 void cls __P((void));
434 
435 /* hack.read.c */
436 int doread __P((void));
437 int identify __P((struct obj *));
438 void litroom __P((boolean));
439 int monstersym __P((int));
440 
441 /* hack.rip.c */
442 void outrip __P((void));
443 void center __P((int, char *));
444 
445 /* hack.rumors.c */
446 void init_rumors __P((FILE *));
447 int skipline __P((FILE *));
448 void outline __P((FILE *));
449 void outrumor __P((void));
450 int used __P((int));
451 
452 /* hack.save.c */
453 int dosave __P((void));
454 int dosave0 __P((int));
455 int dorecover __P((int));
456 struct obj *restobjchn __P((int));
457 struct monst *restmonchn __P((int));
458 
459 /* hack.search.c */
460 int findit __P((void));
461 int dosearch __P((void));
462 int doidtrap __P((void));
463 void wakeup __P((struct monst *));
464 void seemimic __P((struct monst *));
465 
466 /* hack.shk.c */
467 void obfree __P((struct obj *, struct obj *));
468 void paybill __P((void));
469 char *shkname __P((struct monst *));
470 void shkdead __P((struct monst *));
471 void replshk __P((struct monst *, struct monst *));
472 int inshop __P((void));
473 int dopay __P((void));
474 struct bill_x;
475 struct obj *bp_to_obj __P((struct bill_x *));
476 void addtobill __P((struct obj *));
477 void splitbill __P((struct obj *, struct obj *));
478 void subfrombill __P((struct obj *));
479 int doinvbill __P((int));
480 int shkcatch __P((struct obj *));
481 int shk_move __P((struct monst *));
482 void shopdig __P((int));
483 int online __P((int, int));
484 int follower __P((struct monst *));
485 
486 /* hack.shknam.c */
487 void findname __P((char *, int));
488 
489 /* hack.steal.c */
490 long somegold __P((void));
491 void stealgold __P((struct monst *));
492 int stealarm __P((void));
493 int steal __P((struct monst *));
494 void mpickobj __P((struct monst *, struct obj *));
495 int stealamulet __P((struct monst *));
496 void relobj __P((struct monst *, int));
497 
498 /* hack.termcap.c */
499 void startup __P((void));
500 void start_screen __P((void));
501 void end_screen __P((void));
502 void curs __P((int, int));
503 void nocmov __P((int, int));
504 void cmov __P((int, int));
505 int xputc __P((int));
506 void xputs __P((char *));
507 void cl_end __P((void));
508 void clear_screen __P((void));
509 void home __P((void));
510 void standoutbeg __P((void));
511 void standoutend __P((void));
512 void backsp __P((void));
513 void bell __P((void));
514 void delay_output __P((void));
515 void cl_eos __P((void));
516 
517 /* hack.timeout.c */
518 void timeout __P((void));
519 void stoned_dialogue __P((void));
520 
521 /* hack.topl.c */
522 int doredotopl __P((void));
523 void redotoplin __P((void));
524 void remember_topl __P((void));
525 void addtopl __P((const char *));
526 void xmore __P((const char *));
527 void more __P((void));
528 void cmore __P((const char *));
529 void clrlin __P((void));
530 void pline __P((const char *, ...))
531     __attribute__((__format__(__printf__, 1, 2)));
532 void vpline __P((const char *, va_list))
533     __attribute__((__format__(__printf__, 1, 0)));
534 void putsym __P((int));
535 void putstr __P((const char *));
536 
537 /* hack.track.c */
538 void initrack __P((void));
539 void settrack __P((void));
540 coord *gettrack __P((int, int));
541 
542 /* hack.trap.c */
543 struct trap *maketrap __P((int, int, int));
544 void dotrap __P((struct trap *));
545 int mintrap __P((struct monst *));
546 void selftouch __P((const char *));
547 void float_up __P((void));
548 void float_down __P((void));
549 void vtele __P((void));
550 void tele __P((void));
551 void teleds __P((int, int));
552 int teleok __P((int, int));
553 int dotele __P((void));
554 void placebc __P((int));
555 void unplacebc __P((void));
556 void level_tele __P((void));
557 void drown __P((void));
558 
559 /* hack.tty.c */
560 void gettty __P((void));
561 void settty __P((const char *));
562 void setctty __P((void));
563 void setftty __P((void));
564 void error __P((const char *, ...))
565     __attribute__((__format__(__printf__, 1, 2),__noreturn__));
566 void getlin __P((char *));
567 void getret __P((void));
568 void cgetret __P((const char *));
569 void xwaitforspace __P((const char *));
570 char *parse __P((void));
571 char readchar __P((void));
572 void end_of_input __P((void)) __attribute__((__noreturn__));
573 
574 /* hack.u_init.c */
575 void u_init __P((void));
576 struct trobj;
577 void ini_inv __P((struct trobj *));
578 void wiz_inv __P((void));
579 void plnamesuffix __P((void));
580 int role_index __P((int));
581 
582 /* hack.unix.c */
583 void setrandom __P((void));
584 struct tm *getlt __P((void));
585 int getyear __P((void));
586 char *getdate __P((void));
587 int phase_of_the_moon __P((void));
588 int night __P((void));
589 int midnight __P((void));
590 void gethdate __P((char *));
591 int uptodate __P((int));
592 int veryold __P((int));
593 void getlock __P((void));
594 void getmailstatus __P((void));
595 void ckmailstatus __P((void));
596 void newmail __P((void));
597 void mdrush __P((struct monst *, boolean));
598 void readmail __P((void));
599 void regularize __P((char *));
600 
601 /* hack.vault.c */
602 void setgd __P((void));
603 int gd_move __P((void));
604 void gddead __P((void));
605 void replgd __P((struct monst *, struct monst *));
606 void invault __P((void));
607 
608 /* hack.version.c */
609 int doversion __P((void));
610 
611 /* hack.wield.c */
612 void setuwep __P((struct obj *));
613 int dowield __P((void));
614 void corrode_weapon __P((void));
615 int chwepon __P((struct obj *, int));
616 
617 /* hack.wizard.c */
618 void amulet __P((void));
619 int wiz_hit __P((struct monst *));
620 void inrange __P((struct monst *));
621 void aggravate __P((void));
622 void clonewiz __P((struct monst *));
623 
624 /* hack.worm.c */
625 #ifndef NOWORM
626 int getwn __P((struct monst *));
627 void initworm __P((struct monst *));
628 void worm_move __P((struct monst *));
629 void worm_nomove __P((struct monst *));
630 void wormdead __P((struct monst *));
631 void wormhit __P((struct monst *));
632 void wormsee __P((unsigned));
633 struct wseg;
634 void pwseg __P((struct wseg *));
635 void cutworm __P((struct monst *, xchar, xchar, uchar));
636 void remseg __P((struct wseg *));
637 #endif
638 
639 /* hack.worn.c */
640 void setworn __P((struct obj *, long));
641 void setnotworn __P((struct obj *));
642 
643 /* hack.zap.c */
644 void bhitm __P((struct monst *, struct obj *));
645 int bhito __P((struct obj *, struct obj *));
646 int dozap __P((void));
647 const char *exclam __P((int));
648 void hit __P((const char *, struct monst *, const char *));
649 void miss __P((const char *, struct monst *));
650 struct monst *bhit __P((int, int, int, int,
651     void (*)(struct monst *, struct obj *),
652     int (*)(struct obj *, struct obj *),
653     struct obj *));
654 struct monst *boomhit __P((int, int));
655 char dirlet __P((int, int));
656 void buzz __P((int, xchar, xchar, int, int));
657 int zhit __P((struct monst *, int));
658 int revive __P((struct obj *));
659 void rloco __P((struct obj *));
660 void fracture_rock __P((struct obj *));
661 void burn_scrolls __P((void));
662 
663 /* rnd.c */
664 int rn1 __P((int, int));
665 int rn2 __P((int));
666 int rnd __P((int));
667 int d __P((int, int));
668 #endif /* _EXTERN_H_ */
669