-/* $NetBSD: setup.c,v 1.17 2007/12/18 08:45:04 dogcow Exp $ */
+/* $NetBSD: setup.c,v 1.22 2017/10/02 22:03:10 joerg Exp $ */
/*
* setup.c - set up all files for Phantasia
* n.b.: this is used at build-time - i.e. during build.sh.
*/
+#ifdef __NetBSD__
#include <sys/cdefs.h>
-#include <sys/param.h>
+#endif
+
#include <sys/stat.h>
#include <fcntl.h>
-#include "include.h"
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
#ifndef __dead /* Not NetBSD */
-#define __dead ;
+#define __dead
#endif
+#include "phantdefs.h"
+#include "phantstruct.h"
+#include "phantglobs.h"
+#include "pathnames.h"
+
int main(int, char *[]);
void Error(const char *, const char *) __dead;
double drandom(void);
const char *monsterfile = "monsters.asc";
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
const char *const *filename; /* for pointing to file names */
int fd; /* file descriptor */
/ ************************************************************************/
void
-Error(str, file)
- const char *str, *file;
+Error(const char *str, const char *file)
{
fprintf(stderr, "Error: ");
fprintf(stderr, str, file);
/ ************************************************************************/
double
-drandom()
+drandom(void)
{
if (sizeof(int) != 2)
return((double) (random() & 0x7fff) / 32768.0);