-/* $NetBSD: extern.h,v 1.1 1997/10/19 16:57:28 christos Exp $ */
+/* $NetBSD: extern.h,v 1.5 2002/05/26 00:12:12 wiz Exp $ */
-/*
- * Copyright (c) 1997 Christos Zoulas. All rights reserved.
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by Christos Zoulas.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * 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.
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
*/
#ifndef _EXTERN_H_
#define _EXTERN_H_
-#include <stdio.h>
-#ifndef __STDC__
-#include <varargs.h>
-#else
#include <stdarg.h>
-#endif
+#include <stdio.h>
/* alloc.c */
long *alloc __P((unsigned));
-long *alloc __P((unsigned));
long *enlarge __P((char *, unsigned));
/* hack.apply.c */
void pickup __P((int));
void lookaround __P((void));
int monster_nearby __P((void));
-int cansee __P((xchar, xchar));
int rroom __P((int, int));
int cansee __P((xchar, xchar));
int sgn __P((int));
void setsee __P((void));
-void setsee __P((void));
void nomul __P((int));
int abon __P((void));
int dbon __P((void));
void losestr __P((int));
-void losehp __P((int, char *));
+void losehp __P((int, const char *));
void losehp_m __P((int, struct monst *));
void losexp __P((void));
int inv_weight __P((void));
long newuexp __P((void));
/* hack.cmd.c */
-void rhack __P((char *));
+void rhack __P((const char *));
int doextcmd __P((void));
char lowc __P((int));
char unctrl __P((int));
void heal_legs __P((void));
/* hack.do_name.c */
-coord getpos __P((int, char *));
+coord getpos __P((int, const char *));
int do_mname __P((void));
void do_oname __P((struct obj *));
int ddocall __P((void));
char *lmonnam __P((struct monst *));
char *monnam __P((struct monst *));
char *Monnam __P((struct monst *));
-char *amonnam __P((struct monst *, char *));
-char *Amonnam __P((struct monst *, char *));
+char *amonnam __P((struct monst *, const char *));
+char *Amonnam __P((struct monst *, const char *));
char *Xmonnam __P((struct monst *));
char *visctrl __P((int));
void done_intr __P((int));
void done_hangup __P((int));
void done_in_by __P((struct monst *));
-void done __P((char *));
+void done __P((const char *));
void topten __P((void));
void outheader __P((void));
struct toptenentry;
int outentry __P((int, struct toptenentry *, int));
char *itoa __P((int));
-char *ordin __P((int));
+const char *ordin __P((int));
void clearlocks __P((void));
-void hangup __P((int));
+void hangup __P((int)) __attribute__((__noreturn__));
char *eos __P((char *));
void charcat __P((char *, int));
void prscore __P((int, char **));
/* hack.engrave.c */
struct engr *engr_at __P((xchar, xchar));
-int sengr_at __P((char *, xchar, xchar));
+int sengr_at __P((const char *, xchar, xchar));
void u_wipe_engr __P((int));
void wipe_engr_at __P((xchar, xchar, xchar));
void read_engr_at __P((int, int));
-void make_engr_at __P((int, int, char *));
+void make_engr_at __P((int, int, const char *));
int doengrave __P((void));
void save_engravings __P((int));
void rest_engravings __P((int));
void mondied __P((struct monst *));
void monstone __P((struct monst *));
int fightm __P((struct monst *));
-int thitu __P((int, int, char *));
+int thitu __P((int, int, const char *));
boolean hmon __P((struct monst *, struct obj *, int));
int attack __P((struct monst *));
struct trap *t_at __P((int, int));
struct gold *g_at __P((int, int));
struct obj *mkgoldobj __P((long));
-struct obj *getobj __P((char *, char *));
+struct obj *getobj __P((const char *, const char *));
int ckunpaid __P((struct obj *));
-int ggetobj __P((char *, int (*fn)(struct obj *), int));
+int ggetobj __P((const char *, int (*fn)(struct obj *), int));
int askchain __P((struct obj *, char *, int, int (*)(struct obj *),
int (*)(struct obj *), int));
char obj_to_let __P((struct obj *));
/* hack.lev.c */
void savelev __P((int, xchar));
-void bwrite __P((int, char *, unsigned));
+void bwrite __P((int, const void *, unsigned));
void saveobjchn __P((int, struct obj *));
void savemonchn __P((int, struct monst *));
void savegoldchn __P((int, struct gold *));
void stop_occupation __P((void));
/* hack.makemon.c */
-struct monst *makemon __P((struct permonst *, int, int));
+struct monst *makemon __P((const struct permonst *, int, int));
coord enexto __P((xchar, xchar));
int goodpos __P((int, int));
void rloc __P((struct monst *));
/* hack.mkshop.c */
void mkshop __P((void));
void mkzoo __P((int));
-struct permonst *morguemon __P((void));
+const struct permonst *morguemon __P((void));
void mkswamp __P((void));
int nexttodoor __P((int, int));
int has_dnstairs __P((struct mkroom *));
/* hack.mon.c */
void movemon __P((void));
-void justswld __P((struct monst *, char *));
-void youswld __P((struct monst *, int, int, char *));
+void justswld __P((struct monst *, const char *));
+void youswld __P((struct monst *, int, int, const char *));
int dochugw __P((struct monst *));
int dochug __P((struct monst *));
int m_move __P((struct monst *, int));
void mpickgems __P((struct monst *));
int mfndpos __P((struct monst *, coord[9 ], int[9 ], int));
int dist __P((int, int));
-void poisoned __P((char *, char *));
+void poisoned __P((const char *, const char *));
void mondead __P((struct monst *));
void replmon __P((struct monst *, struct monst *));
void relmon __P((struct monst *));
void dmonsfree __P((void));
void unstuck __P((struct monst *));
void killed __P((struct monst *));
-void kludge __P((char *, char *));
+void kludge __P((const char *, const char *));
void rescham __P((void));
-int newcham __P((struct monst *, struct permonst *));
+int newcham __P((struct monst *, const struct permonst *));
void mnexto __P((struct monst *));
int ishuman __P((struct monst *));
void setmangry __P((struct monst *));
char *typename __P((int));
char *xname __P((struct obj *));
char *doname __P((struct obj *));
-void setan __P((char *, char *));
-char *aobjnam __P((struct obj *, char *));
+void setan __P((const char *, char *));
+char *aobjnam __P((struct obj *, const char *));
char *Doname __P((struct obj *));
struct obj *readobjnam __P((char *));
void set_whole_screen __P((void));
int readnews __P((void));
void set_pager __P((int));
-int page_line __P((char *));
-void cornline __P((int, char *));
+int page_line __P((const char *));
+void cornline __P((int, const char *));
int dohelp __P((void));
-int page_file __P((char *, boolean));
+int page_file __P((const char *, boolean));
int dosh __P((void));
int child __P((int));
/* hack.potion.c */
int dodrink __P((void));
void pluslvl __P((void));
-void strange_feeling __P((struct obj *, char *));
+void strange_feeling __P((struct obj *, const char *));
void potionhit __P((struct monst *, struct obj *));
void potionbreathe __P((struct obj *));
int dodip __P((void));
void on_scr __P((int, int));
void tmp_at __P((schar, schar));
void Tmp_at __P((schar, schar));
-void setclipped __P((void));
+void setclipped __P((void)) __attribute__((__noreturn__));
void at __P((xchar, xchar, int));
void prme __P((void));
int doredraw __P((void));
/* hack.save.c */
int dosave __P((void));
-void hangup __P((int));
int dosave0 __P((int));
int dorecover __P((int));
struct obj *restobjchn __P((int));
/* hack.shk.c */
void obfree __P((struct obj *, struct obj *));
-int inshop __P((void));
-int dopay __P((void));
void paybill __P((void));
-void replshk __P((struct monst *, struct monst *));
char *shkname __P((struct monst *));
void shkdead __P((struct monst *));
void replshk __P((struct monst *, struct monst *));
int inshop __P((void));
-void obfree __P((struct obj *, struct obj *));
int dopay __P((void));
struct bill_x;
struct obj *bp_to_obj __P((struct bill_x *));
void curs __P((int, int));
void nocmov __P((int, int));
void cmov __P((int, int));
-void xputc __P((int));
+int xputc __P((int));
void xputs __P((char *));
void cl_end __P((void));
void clear_screen __P((void));
int doredotopl __P((void));
void redotoplin __P((void));
void remember_topl __P((void));
-void addtopl __P((char *));
-void xmore __P((char *));
+void addtopl __P((const char *));
+void xmore __P((const char *));
void more __P((void));
-void cmore __P((char *));
+void cmore __P((const char *));
void clrlin __P((void));
void pline __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
-void vpline __P((const char *, va_list));
+void vpline __P((const char *, va_list))
+ __attribute__((__format__(__printf__, 1, 0)));
void putsym __P((int));
-void putstr __P((char *));
+void putstr __P((const char *));
/* hack.track.c */
void initrack __P((void));
struct trap *maketrap __P((int, int, int));
void dotrap __P((struct trap *));
int mintrap __P((struct monst *));
-void selftouch __P((char *));
+void selftouch __P((const char *));
void float_up __P((void));
void float_down __P((void));
void vtele __P((void));
/* hack.tty.c */
void gettty __P((void));
-void settty __P((char *));
+void settty __P((const char *));
void setctty __P((void));
void setftty __P((void));
void error __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2),__noreturn__));
void getlin __P((char *));
void getret __P((void));
-void cgetret __P((char *));
-void xwaitforspace __P((char *));
+void cgetret __P((const char *));
+void xwaitforspace __P((const char *));
char *parse __P((void));
char readchar __P((void));
-void end_of_input __P((void));
+void end_of_input __P((void)) __attribute__((__noreturn__));
/* hack.u_init.c */
void u_init __P((void));
void gddead __P((void));
void replgd __P((struct monst *, struct monst *));
void invault __P((void));
-void setgd __P((void));
-void invault __P((void));
-int gd_move __P((void));
-void replgd __P((struct monst *, struct monst *));
/* hack.version.c */
int doversion __P((void));
void bhitm __P((struct monst *, struct obj *));
int bhito __P((struct obj *, struct obj *));
int dozap __P((void));
-char *exclam __P((int));
-void hit __P((char *, struct monst *, char *));
-void miss __P((char *, struct monst *));
+const char *exclam __P((int));
+void hit __P((const char *, struct monst *, const char *));
+void miss __P((const char *, struct monst *));
struct monst *bhit __P((int, int, int, int,
void (*)(struct monst *, struct obj *),
int (*)(struct obj *, struct obj *),