summaryrefslogtreecommitdiffstats
path: root/warp/warp.h
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2020-11-10 22:42:19 +0000
committerchristos <christos@NetBSD.org>2020-11-10 22:42:19 +0000
commita6ad8fb14c6bed68eb8b37750e1b2fea36a8c908 (patch)
tree96a006165d8615e5e0cb4e78ef064e66b8e16437 /warp/warp.h
parent1bb28c57a5d2c06152fff5de57a902bec60cc30d (diff)
downloadbsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.tar.gz
bsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.tar.zst
bsdgames-darwin-a6ad8fb14c6bed68eb8b37750e1b2fea36a8c908.zip
Time warp forward 34 years so that it compiles (but not work)
Diffstat (limited to 'warp/warp.h')
-rw-r--r--warp/warp.h102
1 files changed, 39 insertions, 63 deletions
diff --git a/warp/warp.h b/warp/warp.h
index 77035fdd..f8e54c76 100644
--- a/warp/warp.h
+++ b/warp/warp.h
@@ -15,17 +15,21 @@
#ifndef WARP_H
#define WARP_H
-extern int errno;
-
#include "config.h" /* generated by Configure script */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+
#include <term.h>
+#include <math.h>
#include <stdio.h>
#include <signal.h>
+#include <fcntl.h>
#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <errno.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -136,13 +140,6 @@ EXT char amb[YSIZE][XSIZE];
/* some handy defs */
-#define bool char
-#define TRUE (1)
-#define FALSE (0)
-#define Null(t) ((t)0)
-#define Nullch Null(char *)
-#define Nullfp Null(FILE *)
-
#define Ctl(ch) (ch & 037)
#define strNE(s1,s2) (strcmp(s1,s2))
@@ -201,8 +198,8 @@ EXT char amb[YSIZE][XSIZE];
# define ROOTID 0 /* uid of superuser */
#endif
-# define sigset Signal
-# define sigignore(sig) Signal(sig,SIG_IGN)
+# define sigset signal
+# define sigignore(sig) signal(sig,SIG_IGN)
#ifndef LOGDIRFIELD
# define LOGDIRFIELD 6 /* Which field (origin 1) is the */
@@ -299,8 +296,6 @@ EXT char amb[YSIZE][XSIZE];
/* typedefs */
-typedef unsigned int MEM_SIZE; /* for passing to malloc */
-
/* *** end of the machine dependent stuff *** */
/* GLOBAL THINGS */
@@ -311,15 +306,9 @@ EXT struct stat filestat;
/* various things of type char */
-char *index();
-char *rindex();
-char *getenv();
-char *strcat();
-char *strcpy();
-
EXT char buf[LBUFLEN+1]; /* general purpose line buffer */
-EXT char *cwd INIT(Nullch); /* current working directory */
+EXT char *cwd INIT(NULL); /* current working directory */
/* switches */
@@ -330,13 +319,13 @@ EXT char *cwd INIT(Nullch); /* current working directory */
#ifdef VERBOSE
# ifdef TERSE
- EXT bool verbose INIT(TRUE); /* +t */
+ EXT bool verbose INIT(true); /* +t */
# endif
#endif
/* miscellania */
-EXT FILE *tmpfp INIT(Nullfp); /* scratch fp */
+EXT FILE *tmpfp INIT(NULL); /* scratch fp */
#define NOMARKING 0
#define STANDOUT 1
@@ -349,38 +338,36 @@ EXT char readerr[] INIT("warp read error");
EXT char cantopen[] INIT("Can't open %s\r\n");
#ifdef VERBOSE
- EXT char nocd[] INIT("Can't chdir to directory %s\r\n");
+#define NOCD "Can't chdir to directory %s\r\n"
#else
- EXT char nocd[] INIT("Can't find %s\r\n");
+#define NOCD "Can't find %s\r\n"
#endif
-extern int errno;
-
-EXT bool justonemoretime INIT(TRUE);
-EXT bool keepgoing INIT(TRUE);
-
-EXT bool friendspec INIT(FALSE);
-EXT bool piratespec INIT(FALSE);
-EXT bool amoebaspec INIT(FALSE);
-EXT bool starspec INIT(FALSE);
-EXT bool klingspec INIT(FALSE);
-EXT bool apolspec INIT(FALSE);
-EXT bool crushspec INIT(FALSE);
-EXT bool romspec INIT(FALSE);
-EXT bool prespec INIT(FALSE);
-EXT bool tholspec INIT(FALSE);
-EXT bool gornspec INIT(FALSE);
-EXT bool beginner INIT(FALSE);
-EXT bool massacre INIT(FALSE);
-EXT bool lowspeed INIT(FALSE);
-EXT bool debugging INIT(FALSE);
-EXT bool didkill INIT(FALSE);
-EXT bool experimenting INIT(FALSE);
-EXT bool scorespec INIT(FALSE);
-EXT bool metakey INIT(FALSE);
+EXT bool justonemoretime INIT(true);
+EXT bool keepgoing INIT(true);
+
+EXT bool friendspec INIT(false);
+EXT bool piratespec INIT(false);
+EXT bool amoebaspec INIT(false);
+EXT bool starspec INIT(false);
+EXT bool klingspec INIT(false);
+EXT bool apolspec INIT(false);
+EXT bool crushspec INIT(false);
+EXT bool romspec INIT(false);
+EXT bool prespec INIT(false);
+EXT bool tholspec INIT(false);
+EXT bool gornspec INIT(false);
+EXT bool beginner INIT(false);
+EXT bool massacre INIT(false);
+EXT bool lowspeed INIT(false);
+EXT bool debugging INIT(false);
+EXT bool didkill INIT(false);
+EXT bool experimenting INIT(false);
+EXT bool scorespec INIT(false);
+EXT bool metakey INIT(false);
EXT bool bombed_out;
-EXT bool panic INIT(FALSE);
+EXT int panic INIT(0);
EXT bool madgorns;
EXT int madfriends;
@@ -436,17 +423,6 @@ EXT int yamblast;
EXT int xamblast;
EXT int ambsize;
-EXT char spbuf[512];
-
-#define Fclose (void)fclose
-#define Fflush (void)fflush
-#define Fgets (void)fgets
-#define Sprintf (void)sprintf
-#define Signal (void)signal
-#define Safecpy (void)safecpy
-#define Cpytill (void)cpytill
-#define Tract (void)tract
-#define Make_object (void)make_object
-#define Read_tty (void)read_tty
+EXT char spbuf[1024];
#endif