/* vars.c */
#include "vars.h"

char	symtab[SYMTBSZ];	/* symbol table */
char	*staticptr, *autoptr;	/* ptrs to next entries */

int	ws[WSTBLSZ];		/* while stack */
int	*wsptr;			/* ptr to next entry */

/** ucc **/
int	swstcase[SWSTSZ];
int	swstlab[SWSTSZ];
int	swstp;

char	litq[LITABSZ];		/* literal pool */
int	litptr;			/* ptr to next entry */

char	macq[MACQ_SZ];		/* macro string buffer */
int	macptr;			/* and its index */

char	line[LINESIZE];		/* parsing buffer */
char	mline[LINESIZE];	/* temp macro buffer */
int	lptr, mptr;		/* ptrs into each */

/*	Misc storage	*/
int	nxtlab,			/* next avail label # */
	litlab,			/* label # assigned to literal pool */
	Msp,			/* Maximum relative stk ptr */
	Csp,			/* compiler relative stk ptr */
	argstk,			/* function arg sp */
	ncmp,			/* # open compound statements */
	errcnt,			/* # errors in compilation */
	errstop,		/* stop on error */
	eof_flg,		/* set non-zero on final input eof */
	glbflag,		/* non-zero if internal globals */
	ctext,			/* non-zero to intermix c-source */
	cmode,			/* non-zero while parsing c-code */
				/* zero when passing assembly code */
	lastst,			/* last executed statement type */
	mainflg,		/* output is to be first asm file */
	fnstart,		/* line# of start of current fn. */
	lineno,			/* line# in current file */
	infunc,			/* "inside function" flag */
	savestart,		/* copy of fnstart "	" */
	saveline,		/* copy of lineno  "	" */
	saveinfn;		/* copy of infunc  "	" */

char	*currfn,		/* ptr to symtab entry for current fn. */
       	*savecurr;		/* copy of currfn for #include */
char	quote[2];		/* literal string for '"' */
char	*symbptr;		/* work ptr to any char buffer */
int	*iptr;			/* work ptr to any int buffer */

FILE	*fp_input,		/* iob # for input file */
	*fp_output,		/* iob # for output file (if any) */
	*fp_input2,		/* iob # for "include" file */
	*saveout;		/* holds outpt ptr whn diverted to console */