/* Log: warp.h,v
* Revision 7.0.1.2 86/12/12 17:08:42 lwall
* Baseline for net release.
- *
+ *
* Revision 7.0.1.1 86/10/16 10:54:26 lwall
* Added Damage. Fixed random bugs.
- *
+ *
* Revision 7.0 86/10/08 15:17:55 lwall
* Split into separate files. Added amoebas and pirates.
- *
+ *
*/
#ifndef WARP_H
#define WARP_H
-extern int errno;
+#include "config.h"
+#include "warp-config.h" /* generated by Configure script */
-#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 <errno.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
* access.)
*/
-#define SAVEDIR "/var/games"
+#define SAVEDIR LOCALSTATEDIR"/games/warp"
#define NEWSFILE "warp.news"
#define HELPFILE "warp.doc"
#define LOCKFILE ".warp.lock"
# ifdef PRIVLIB
# define WARPLIB PRIVLIB
# else
-# define WARPLIB "/usr/games/warp"
+# define WARPLIB PREFIX"/games/warp"
# endif
#endif
/* 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))
# 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 */
/* preferred shell for use in doshell routine */
/* ksh or sh would be okay here */
#ifndef PREFSHELL
-# define PREFSHELL "/bin/csh"
+# define PREFSHELL "/bin/sh"
#endif
/* path to fastest starting shell */
/* typedefs */
-typedef unsigned int MEM_SIZE; /* for passing to malloc */
-
/* *** end of the machine dependent stuff *** */
/* GLOBAL THINGS */
/* 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 */
#ifdef DEBUGGING
EXT int debug INIT(0); /* -D */
-# define DEB_FILEXP 64
+# define DEB_FILEXP 64
#endif
#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
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;
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