/*
	extern.h	rt1 external/global variable declarations
	Copyright 1984 Terry Disz & Dan Sadowski
*/

#ifdef ZEUS
extern char strarea[];		/* for getting strings */
#endif
extern NBLOCK sy_names[];	/* SYSTEM NAME TABLE */
extern NBLOCK cmd_names[];	/* SYSTEM COMMAND TABLE */
extern NBLOCK *cmdhdr[];	/* command headers  - a through z*/
extern CMD argfun[MAXCMDS];	/* CONTAINS ARGS + FUN PTRS */
extern NBLOCK _ab;		/* $AB abv policy */
extern NBLOCK _da;		/* day counter */
extern NBLOCK _er;		/* global system error number */
extern NBLOCK _hr;		/* hour counter */
extern NBLOCK _mn;		/* minute counter */
extern NBLOCK _sc;		/* second counter */
extern NBLOCK _st;		/* system timer */
extern NBLOCK _tk;		/* ticks */
extern NBLOCK _vn;		/* version */
extern NBLOCK _z0;		/* countdown timer */
extern NBLOCK _mx;	    /* mouse x */
extern NBLOCK _my;	    /* mouse y */
extern NBLOCK _ml;	    /* mouse left button */
extern NBLOCK _mr;	    /* mouse right button */
extern NBLOCK _rl;	    /* mouse left button latch */
extern NBLOCK _rr;	    /* mouse right button latch */
extern NBLOCK _xx;	    /* spare */
extern NBLOCK _cx;	    /* shill variable */
extern NBLOCK _d0;		/* A/D channel 0 */
extern NBLOCK _d1;		/* A/D channel 1 */
extern NBLOCK _d2;		/* A/D channel 2 */
extern NBLOCK _d3;		/* A/D channel 3 */
extern NBLOCK _d4;		/* A/D channel 4 */
extern NBLOCK _d5;		/* A/D channel 5 */
extern NBLOCK _d6;		/* A/D channel 6 */
extern NBLOCK _d7;		/* A/D channel 7 */
extern NBLOCK _a0;		/* D/A channel 0 */
extern NBLOCK _a1;		/* D/A channel 1 */
extern NBLOCK _f0;		/* external function switch input */
extern NBLOCK _f1;		/* external function switch input */
extern NBLOCK _f2;		/* external function switch input */
extern NBLOCK _f3;		/* external function switch input */
extern NBLOCK _f4;		/* external function switch input */
extern NBLOCK _f5;		/* external function switch input */
extern NBLOCK _f6;		/* external function switch input */
extern NBLOCK _f7;		/* external function switch input */
				
extern NBLOCK _j0;		/* external digital joy switch input */
extern NBLOCK _j1;		/* external digital joy switch input */
extern NBLOCK _j2;		/* external digital joy switch input */
extern NBLOCK _j3;		/* external digital joy switch input */

extern NBLOCK _jx;		/* external digital joyswitch input  x */
extern NBLOCK _jy;		/* external digital joyswitch input  y */

extern MIB *freetop;		/* free mib list header	 */
extern MIB *mactop;		/* mib list header  */
extern MIB *macsav;		/* place to save mib pointer */
extern MIB freemib[];		/* the free mib list */
extern MIB *dolph;		/* .b list header */
extern MIB *viplh;		/* .f list header */
extern TINY doloop;		/* doloop flag - B, F, or blk */
extern BOOL doflag;		/* doing bg's or not */
extern BOOL ccpass;		/* allows control chars in tty buffer */
extern BOOL editon;		/* TRUE = in editor */
extern BOOL czflag;		/* ^z mode */
extern BOOL control_c;		/* ^c was done */
extern BOOL firstoken;		/* first token on line */
extern short onecnt;		/* used by onerror stuff */
extern TINY argnum;		/* arg number in list for geterror */
extern TINY cwcnt;		/* ^W count */
extern int aed;			/* AED display file desc. */
extern FILE *logfp;		/* ^p logfile fp */
extern int tabfd;		/* tablet file desc. */
extern TABDAT tab;		/* tablet data area */
extern char tty[];		/* term input buffer */
extern short ttyptr;		/* consumer index */
extern short ttyint;		/* producer index */
extern BOOL cntl[];		/* control flags */
extern short typetab[];		/* adm type key values - 2b xlated */
extern short trantab[];		/* system values - xlate to these */
extern TEMP *tmptop;		/* pointer to top of temp list*/
extern TEMP tmpbase;		/* top of temp list*/
extern MIB kbmib;		/* keyboard mib */
extern MIB czmib;		/* ^z mib */
extern char kbblock[];		/* kbd mib buffer */
extern char czblock[];		/* cz mib buffer */
extern short xkursor;		/* for line editing */
extern short xksave;		/* same */
extern char turnbuf[];		/* turnkey buffer */
extern VAL token;		/* storage for general use*/
extern TINY errnum;		/* current error number*/
extern TINY errix;		/* index into errblk*/
extern char *errblk[];		/* place to store error pointers*/
extern char nullstr[];		/* dummy - need to point to nullstring */
extern char workstr[];		/* character work area */
extern BOOL swglob;		/*global for switch parsing*/
extern BOOL arglob;		/*global for no-arg parsing*/
extern unsigned long temptype;	/*flag which types have TEMP structures*/

#ifdef ZWHILE
extern NBLOCK cendnblock;       /* for compiler, sumit */
extern NBLOCK *endptr; 
extern CMD cendcmd;
extern NBLOCK cwhilenblock;       /* for compiler, sumit */
extern NBLOCK *whileptr; 
extern CMD cwhilecmd;
#endif

extern NBLOCK cskipnblock;		/* for compiler*/
extern NBLOCK *skiptr;
extern CMD cskipcmd;			/* for compiler*/
extern NBLOCK cgotonblock;		/* for compiler*/
extern NBLOCK *gotoptr;
extern CMD cgotocmd;			/* for compiler*/
extern NBLOCK conerrnblock;		/* for compiler*/
extern NBLOCK *onerrptr;
extern CMD conerrcmd;			/* for compiler*/
extern NBLOCK cifnblock;		/* for compiler*/
extern NBLOCK *ifptr;
extern CMD cifcmd;			/* for compiler*/
extern NBLOCK cretnblock;		/* for compiler*/
extern NBLOCK *retptr;
extern CMD cretcmd;			/* for compiler*/

extern OPRTAB op_tab[];			/* operator table*/
#define INDIRECT &op_tab[2]		/* for indirect execution*/
extern VAL val_stk[];			/*operand stack*/
extern VAL *valsp;			/*stack pointer*/
extern BITS ctype[];			/*character typing*/

#ifdef BDSC
int _allocp;
#endif

/*extern char tabbuff[];*/
/*extern short tabptr;*/
/*extern short tabint;*/


#ifdef APOLLO  /* diplay bitmap structures. */

	gpr_$attribute_desc_t d_attr;
	gpr_$bitmap_desc_t d_desc;
	gpr_$offset_t d_size;
	gpr_$plane_t d_hipl;
	gpr_$position_t d_orig;
	status_$t d_stat;

#endif