xref: /minix3/games/adventure/extern.h (revision 0819c9f89b6d110be1d10f1cda48f41db00ca70f)
1*0819c9f8SThomas Cort /*	$NetBSD: extern.h,v 1.16 2012/01/08 18:17:41 dholland Exp $	*/
2*0819c9f8SThomas Cort 
3*0819c9f8SThomas Cort /*
4*0819c9f8SThomas Cort  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
5*0819c9f8SThomas Cort  *
6*0819c9f8SThomas Cort  * Redistribution and use in source and binary forms, with or without
7*0819c9f8SThomas Cort  * modification, are permitted provided that the following conditions
8*0819c9f8SThomas Cort  * are met:
9*0819c9f8SThomas Cort  * 1. Redistributions of source code must retain the above copyright
10*0819c9f8SThomas Cort  *    notice, this list of conditions and the following disclaimer.
11*0819c9f8SThomas Cort  * 2. Redistributions in binary form must reproduce the above copyright
12*0819c9f8SThomas Cort  *    notice, this list of conditions and the following disclaimer in the
13*0819c9f8SThomas Cort  *    documentation and/or other materials provided with the distribution.
14*0819c9f8SThomas Cort  *
15*0819c9f8SThomas Cort  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*0819c9f8SThomas Cort  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*0819c9f8SThomas Cort  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*0819c9f8SThomas Cort  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*0819c9f8SThomas Cort  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*0819c9f8SThomas Cort  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*0819c9f8SThomas Cort  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*0819c9f8SThomas Cort  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*0819c9f8SThomas Cort  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*0819c9f8SThomas Cort  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*0819c9f8SThomas Cort  */
26*0819c9f8SThomas Cort 
27*0819c9f8SThomas Cort #include <string.h>
28*0819c9f8SThomas Cort #include <stdint.h>
29*0819c9f8SThomas Cort 
30*0819c9f8SThomas Cort /* crc.c */
31*0819c9f8SThomas Cort struct crcstate {
32*0819c9f8SThomas Cort 	uint32_t crcval;
33*0819c9f8SThomas Cort 	unsigned step;
34*0819c9f8SThomas Cort };
35*0819c9f8SThomas Cort 
36*0819c9f8SThomas Cort void crc_start(struct crcstate *);
37*0819c9f8SThomas Cort void crc_add(struct crcstate *, const void *, size_t);
38*0819c9f8SThomas Cort uint32_t crc_get(struct crcstate *);
39*0819c9f8SThomas Cort 
40*0819c9f8SThomas Cort /* done.c */
41*0819c9f8SThomas Cort int score(void);
42*0819c9f8SThomas Cort void done(int) __dead;
43*0819c9f8SThomas Cort void die(int);
44*0819c9f8SThomas Cort 
45*0819c9f8SThomas Cort /* init.c */
46*0819c9f8SThomas Cort void init(void);
47*0819c9f8SThomas Cort char   *decr(int, int, int, int, int);
48*0819c9f8SThomas Cort void trapdel(int);
49*0819c9f8SThomas Cort void startup(void);
50*0819c9f8SThomas Cort 
51*0819c9f8SThomas Cort /* io.c */
52*0819c9f8SThomas Cort void getin(char **, char **);
53*0819c9f8SThomas Cort int yes(int, int, int);
54*0819c9f8SThomas Cort int yesm(int, int, int);
55*0819c9f8SThomas Cort void rdata(void);
56*0819c9f8SThomas Cort #ifdef DEBUG
57*0819c9f8SThomas Cort void twrite(int);
58*0819c9f8SThomas Cort #endif
59*0819c9f8SThomas Cort void rspeak(int);
60*0819c9f8SThomas Cort void mspeak(int);
61*0819c9f8SThomas Cort struct text;
62*0819c9f8SThomas Cort void speak(const struct text *);
63*0819c9f8SThomas Cort void pspeak(int, int);
64*0819c9f8SThomas Cort 
65*0819c9f8SThomas Cort /* save.c */
66*0819c9f8SThomas Cort int save(const char *);
67*0819c9f8SThomas Cort int restore(const char *);
68*0819c9f8SThomas Cort 
69*0819c9f8SThomas Cort /* subr.c */
70*0819c9f8SThomas Cort int toting(int);
71*0819c9f8SThomas Cort int here(int);
72*0819c9f8SThomas Cort int at(int);
73*0819c9f8SThomas Cort int liq(void);
74*0819c9f8SThomas Cort int liqloc(int);
75*0819c9f8SThomas Cort int forced(int);
76*0819c9f8SThomas Cort int dark(void);
77*0819c9f8SThomas Cort int pct(int);
78*0819c9f8SThomas Cort int fdwarf(void);
79*0819c9f8SThomas Cort int march(void);
80*0819c9f8SThomas Cort void bug(int) __dead;
81*0819c9f8SThomas Cort void checkhints(void);
82*0819c9f8SThomas Cort int trsay(void);
83*0819c9f8SThomas Cort int trtake(void);
84*0819c9f8SThomas Cort int trdrop(void);
85*0819c9f8SThomas Cort int tropen(void);
86*0819c9f8SThomas Cort int trkill(void);
87*0819c9f8SThomas Cort int trtoss(void);
88*0819c9f8SThomas Cort int trfeed(void);
89*0819c9f8SThomas Cort int trfill(void);
90*0819c9f8SThomas Cort void closing(void);
91*0819c9f8SThomas Cort void caveclose(void);
92*0819c9f8SThomas Cort 
93*0819c9f8SThomas Cort /* vocab.c */
94*0819c9f8SThomas Cort void destroy(int);
95*0819c9f8SThomas Cort void juggle(int);
96*0819c9f8SThomas Cort void move(int, int);
97*0819c9f8SThomas Cort int put(int, int, int);
98*0819c9f8SThomas Cort void carry(int, int);
99*0819c9f8SThomas Cort void drop(int, int);
100*0819c9f8SThomas Cort int vocab(const char *, int, int);
101*0819c9f8SThomas Cort 
102*0819c9f8SThomas Cort /* These three used to be functions in vocab.c */
103*0819c9f8SThomas Cort #define copystr(src, dest)	strcpy((dest), (src))
104*0819c9f8SThomas Cort #define weq(str1, str2)		(!strncmp((str1), (str2), 5))
105*0819c9f8SThomas Cort #define length(str)		(strlen((str)) + 1)
106*0819c9f8SThomas Cort 
107*0819c9f8SThomas Cort /* wizard.c */
108*0819c9f8SThomas Cort void datime(int *, int *);
109*0819c9f8SThomas Cort void poof(void);
110*0819c9f8SThomas Cort int Start(void);
111*0819c9f8SThomas Cort void ciao(void);
112*0819c9f8SThomas Cort int ran(int);
113