2012-01-08 22:17:41 +04:00
|
|
|
/* $NetBSD: extern.h,v 1.16 2012/01/08 18:17:41 dholland Exp $ */
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1998-08-25 02:26:23 +04:00
|
|
|
#include <string.h>
|
2012-01-08 22:17:41 +04:00
|
|
|
#include <stdint.h>
|
1998-08-25 02:26:23 +04:00
|
|
|
|
1997-08-11 18:06:10 +04:00
|
|
|
/* crc.c */
|
2012-01-08 22:16:00 +04:00
|
|
|
struct crcstate {
|
|
|
|
uint32_t crcval;
|
|
|
|
unsigned step;
|
|
|
|
};
|
|
|
|
|
|
|
|
void crc_start(struct crcstate *);
|
|
|
|
void crc_add(struct crcstate *, const void *, size_t);
|
|
|
|
uint32_t crc_get(struct crcstate *);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* done.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
int score(void);
|
2009-08-25 10:58:04 +04:00
|
|
|
void done(int) __dead;
|
2004-01-27 23:30:28 +03:00
|
|
|
void die(int);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* init.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
void init(void);
|
|
|
|
char *decr(int, int, int, int, int);
|
|
|
|
void trapdel(int);
|
|
|
|
void startup(void);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* io.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
void getin(char **, char **);
|
|
|
|
int yes(int, int, int);
|
|
|
|
int yesm(int, int, int);
|
|
|
|
void rdata(void);
|
1998-08-30 02:40:07 +04:00
|
|
|
#ifdef DEBUG
|
2004-01-27 23:30:28 +03:00
|
|
|
void twrite(int);
|
1998-08-30 02:40:07 +04:00
|
|
|
#endif
|
2004-01-27 23:30:28 +03:00
|
|
|
void rspeak(int);
|
|
|
|
void mspeak(int);
|
1997-08-11 18:06:10 +04:00
|
|
|
struct text;
|
2004-01-27 23:30:28 +03:00
|
|
|
void speak(const struct text *);
|
|
|
|
void pspeak(int, int);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* save.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
int save(const char *);
|
|
|
|
int restore(const char *);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* subr.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
int toting(int);
|
|
|
|
int here(int);
|
|
|
|
int at(int);
|
|
|
|
int liq(void);
|
|
|
|
int liqloc(int);
|
|
|
|
int forced(int);
|
|
|
|
int dark(void);
|
|
|
|
int pct(int);
|
|
|
|
int fdwarf(void);
|
|
|
|
int march(void);
|
2009-08-25 10:58:04 +04:00
|
|
|
void bug(int) __dead;
|
2004-01-27 23:30:28 +03:00
|
|
|
void checkhints(void);
|
|
|
|
int trsay(void);
|
|
|
|
int trtake(void);
|
|
|
|
int trdrop(void);
|
|
|
|
int tropen(void);
|
|
|
|
int trkill(void);
|
|
|
|
int trtoss(void);
|
|
|
|
int trfeed(void);
|
|
|
|
int trfill(void);
|
|
|
|
void closing(void);
|
|
|
|
void caveclose(void);
|
1997-08-11 18:06:10 +04:00
|
|
|
|
|
|
|
/* vocab.c */
|
2009-08-25 10:56:52 +04:00
|
|
|
void destroy(int);
|
2004-01-27 23:30:28 +03:00
|
|
|
void juggle(int);
|
|
|
|
void move(int, int);
|
|
|
|
int put(int, int, int);
|
|
|
|
void carry(int, int);
|
|
|
|
void drop(int, int);
|
|
|
|
int vocab(const char *, int, int);
|
1998-08-25 02:26:23 +04:00
|
|
|
|
|
|
|
/* These three used to be functions in vocab.c */
|
|
|
|
#define copystr(src, dest) strcpy((dest), (src))
|
|
|
|
#define weq(str1, str2) (!strncmp((str1), (str2), 5))
|
|
|
|
#define length(str) (strlen((str)) + 1)
|
|
|
|
|
1997-08-11 18:06:10 +04:00
|
|
|
/* wizard.c */
|
2004-01-27 23:30:28 +03:00
|
|
|
void datime(int *, int *);
|
|
|
|
void poof(void);
|
|
|
|
int Start(void);
|
|
|
|
void ciao(void);
|
|
|
|
int ran(int);
|