EXT
#ifdef EXT
#ifdef EXT
EXT bool blasted;
EXT bool xblasted[XSIZE];
EXT bool yblasted[YSIZE];
EXT char bangy[YSIZE*XSIZE];
EXT char bangx[YSIZE*XSIZE];
EXT char bangs[YSIZE*XSIZE];
EXT long bangm[YSIZE*XSIZE];
EXT int xx[MAXBDIST];
EXT int yy[MAXBDIST];
EXT int nxtbang;
EXT bool banging;
EXT long blast[YSIZE][XSIZE];
EXT char *origdir INIT(NULL); /* cwd when warp invoked */
EXT char *homedir INIT(NULL); /* login directory */
EXT char *dotdir INIT(NULL); /* where . files go */
EXT char *logname INIT(NULL); /* login id */
EXT char *hostname; /* host name */
EXT char *realname INIT(NULL); /* real name from /etc/passwd */
EXT OBJECT root;
EXT OBJECT free_root;
EXT OBJECT *ent;
EXT OBJECT *base;
EXT OBJECT *enemies;
EXT OBJECT *movers;
EXT OBJECT *realapollo;
EXT OBJECT *nuke;
EXT OBJECT *occupant[YSIZE][XSIZE];
EXT int timer;
EXT int finish INIT(0);
EXT int oldstatus;
EXT int oldetorp;
EXT int oldbtorp;
EXT int oldstrs;
EXT int oldenemies;
EXT long totalscore;
EXT long lastscore INIT(0);
EXT long curscore;
EXT long possiblescore;
EXT long oldeenergy;
EXT long oldbenergy;
EXT long oldcurscore;
EXT char savefilename[512];
EXT char longlognam[128];
EXT char c INIT(' ');
EXT char circlebuf[PUSHSIZE];
EXT int nextin INIT(0);
EXT int nextout INIT(0);
EXT long iocount INIT(0);
EXT int devtty INIT(0);
EXT long iocount INIT(0);
EXT int devtty INIT(0);
EXT bool is_input INIT(false);
EXT char pending_ch INIT(0);
EXT struct termios _tty, _oldtty;
EXT struct termio _tty, _oldtty;
EXT struct sgttyb _tty;
EXT int _res_flg INIT(0);
EXT int _tty_ch INIT(2);
EXT bool bizarre INIT(false); /* do we need to restore terminal? */
EXT char *BC INIT(NULL); /* backspace character */
EXT char *UP INIT(NULL); /* move cursor up one line */
EXT char *myUP;
EXT char *ND INIT(NULL); /* non-destructive cursor right */
EXT char *myND;
EXT char *DO INIT(NULL); /* move cursor down one line */
EXT char *myDO;
EXT char *CR INIT(NULL); /* get to left margin, somehow */
EXT char *VB INIT(NULL); /* visible bell */
EXT char *CL INIT(NULL); /* home and clear screen */
EXT char *CE INIT(NULL); /* clear to end of line */
EXT char *CM INIT(NULL); /* cursor motion -- PWP */
EXT char *HO INIT(NULL); /* home cursor -- PWP */
EXT char *CD INIT(NULL); /* clear to end of display -- PWP */
EXT char *SO INIT(NULL); /* begin standout mode */
EXT char *SE INIT(NULL); /* end standout mode */
EXT int SG INIT(0); /* blanks left by SO and SE */
EXT char *US INIT(NULL); /* start underline mode */
EXT char *UE INIT(NULL); /* end underline mode */
EXT char *UC INIT(NULL); /* underline a character, if that's how it's done */
EXT int UG INIT(0); /* blanks left by US and UE */
EXT bool AM INIT(false); /* does terminal have automatic margins? */
EXT bool XN INIT(false); /* does it eat 1st newline after automatic wrap? */
EXT char PC INIT(0); /* pad character for use by tputs() */
EXT short ospeed INIT(0); /* terminal output speed, for use by tputs() */
EXT int LINES INIT(0), COLS INIT(0); /* size of screen */
EXT int just_a_sec INIT(960); /* 1 sec at current baud rate */
EXT char ERASECH; /* rubout character */
EXT char KILLCH; /* line delete character */
EXT size_t tmplen;
EXT const char *tmpstr;
EXT int CMsize;
EXT int BCsize INIT(1);
EXT int DOsize INIT(1000);
EXT int UPsize INIT(1000);
EXT int NDsize INIT(1000);
EXT int charsperhalfsec;
EXT int real_y INIT(-100);
EXT int real_x INIT(-100);
EXT char filler[];
EXT char *bsptr INIT(filler+1);
EXT char term[12];
EXT char gfillen INIT(25);
EXT char *maxcmstring;
EXT char cmbuffer[512];
EXT char INTRCH INIT('\03');
EXT bool cloaking;
EXT bool cloaked;
EXT int status;
EXT int entmode;
EXT int evely;
EXT int evelx;
EXT int bvely;
EXT int bvelx;
EXT int dam INIT(0);
EXT int lastdam INIT(-1);
EXT int damage INIT(0);
EXT int olddamage INIT(-1);
EXT int len_last_line_got INIT(0);
EXT char amb[YSIZE][XSIZE];
EXT struct stat filestat;
EXT char buf[LBUFLEN+1]; /* general purpose line buffer */
EXT char *cwd INIT(NULL); /* current working directory */
EXT int debug INIT(0); /* -D */
EXT bool verbose INIT(true); /* +t */
EXT FILE *tmpfp INIT(NULL); /* scratch fp */
EXT char nullstr[] INIT("");
EXT char readerr[] INIT("warp read error");
EXT char cantopen[] INIT("Can't open %s\r\n");
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 int panic INIT(0);
EXT bool madgorns;
EXT int madfriends;
EXT int inumpirates;
EXT int numpirates;
EXT int inumfriends;
EXT int numfriends;
EXT int inumamoebas;
EXT int numamoebas;
EXT int inumstars;
EXT int numstars;
EXT int inumenemies;
EXT int numenemies;
EXT int inumroms;
EXT int inumthols;
EXT int inumapollos;
EXT int numapollos;
EXT int apolloflag;
EXT int inumcrushes;
EXT int numcrushes;
EXT int inumgorns;
EXT int numgorns;
EXT int deados;
EXT int deadmudds;
EXT int smarts;
EXT int ismarts INIT(0);
EXT int numos INIT(0);
EXT int numxes INIT(0);
EXT int ient;
EXT int numents;
EXT int ibase;
EXT int numbases;
EXT int inuminhab;
EXT int numinhab;
EXT int wave;
EXT int cumsmarts;
EXT int prescene INIT(-1);
EXT int scandist;
EXT int antibase;
EXT int sm35;
EXT int sm45;
EXT int sm50;
EXT int sm55;
EXT int sm80;
EXT int sm95;
EXT int entmax;
EXT int basemax;
EXT int enemshields;
EXT int super;
EXT int whenok;
EXT int yamblast;
EXT int xamblast;
EXT int ambsize;
EXT char spbuf[1024];
EXT char *warplib;
EXT int etorp;
EXT int btorp;
EXT OBJECT *isatorp[2][3][3];
EXT int aretorps;
EXT int tractor INIT(0);
if (EXT(statp).ext == NULL)
if (statp->nscount == 0 || EXT(statp).ext == NULL) {
if (EXT(statp).nscount != 0) {
if (EXT(statp).nscount != statp->nscount)
(struct sockaddr *)(void *)&EXT(statp).ext->nsaddrs[ns])) {
if (EXT(statp).nssocks[ns] == -1)
if (getpeername(EXT(statp).nssocks[ns],
EXT(statp).nscount = 0;
if (EXT(statp).nscount == 0) {
EXT(statp).nstimes[ns] = RES_MAXTIME;
EXT(statp).nssocks[ns] = -1;
EXT(statp).ext->nsaddrs[ns].sin =
EXT(statp).nscount = statp->nscount;
if (EXT(statp).ext != NULL)
inu = EXT(statp).ext->nsaddrs[0];
fd = EXT(statp).nssocks[0];
nstime = EXT(statp).nstimes[0];
if (EXT(statp).ext != NULL)
EXT(statp).ext->nsaddrs[ns] =
EXT(statp).ext->nsaddrs[ns + 1];
EXT(statp).nssocks[ns] = EXT(statp).nssocks[ns + 1];
EXT(statp).nstimes[ns] = EXT(statp).nstimes[ns + 1];
if (EXT(statp).ext != NULL)
EXT(statp).ext->nsaddrs[lastns] = inu;
EXT(statp).nssocks[lastns] = fd;
EXT(statp).nstimes[lastns] = nstime;
if (!statp->nsaddr_list[n].sin_family && EXT(statp).ext) {
return (struct sockaddr *)(void *)&EXT(statp).ext->nsaddrs[n];
if (EXT(statp).nssocks[ns] == -1) {
EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM
fcntl(EXT(statp)nssocks[ns], F_SETFD, FD_CLOEXEC);
if (EXT(statp).nssocks[ns] > highestFD) {
if (EXT(statp).nssocks[ns] < 0) {
connect(EXT(statp).nssocks[ns], nsap, nsaplen) < 0) {
s = EXT(statp).nssocks[ns];