
/*
   CC65 global var declarations.  These are extern'ed
   in cc65.h
*/
#include <stdio.h>
#include "cc65.h"

#ifndef CCPAGE0
/* only declare these of not doing page 0 stuff */

int curtok;		/* current token seen by parser */
int curval;		/* something or other, depending on curtok */
int nxttok;
int nxtval;
int absdecl;
/* int	critic;		*/
int glblbl;
char * gsptr;
int hashval;
int lovptr;
char * lsptr;
char macdef;		/* T if any defines defined */
char * outqi;
int outqsz;
int tbllen;
char * tblptr;
int * wqptr;		/* ptr to next entry */
int litptr;		/* ptr to next entry in literal pool */

char * lptr;
char * mptr;		/* ptrs into each */

#endif /* ccpage0 */

/* char	glbspace[GSPACE]; */
char * gblspace;	/* global heap */
char * gblend;		/* global space limit */

struct hashent * glvptr;
int i_ifdef;
char locspace[LSPACE];
char outq[OUTQSZ];	/* buf for asm stuff being output */
/* int	ret_addr; */
char s_ifdef[N_IFDEF];

int litlab;		/* current lit pool labl */
int litspace = 0;	/* total lit space used */

/*	Misc storage	*/

int nxtlab,		/* next avail label # */
/* compiler relative stk ptr */
#ifndef CCPAGE0
    oursp, argstk,	/* function arg sp */
#endif
/* # open compound statements */
    ncmp,
/* # errors in compilation */
    errcnt,
/* set non-zero on final input eof */
    eof,
/* non-zero if internal globals */
    glbflag;

struct filent filetab[MAXFILES];
int ifile;

FILE * inp;
FILE * output;

int ln;
char * fin;

char fname[80];

/*
  Canned typespecs
*/
/* char * type_char = "\021"; unused? */
char * type_int = "\022";
char * type_ifunc = "\007\022";

char linebuf[linesize];
char * line = linebuf;
char mlinebuf[linesize];
char * mline = mlinebuf;
char macltab[256];
int wq[wqtabsz]; /* while queue */
char litq[litabsz];
struct hashent * lvtab[128];
int * kwptr;

#ifdef M6502

#else
struct hashent * htab[HTABSZ];
char * macarg[MACARGSZ];
char * machtab[HTABSZ];
#endif

char optimize = 0;		/* optimize flag */
char verbose = 0;		/* verbose flag */
int n_funargs = 0;		/* for use by funarg parser */
int asm_kludge = 0;		/* see preproc, lex */
char * incl_dir = 0;		/* dir for include files */

/* char get_test = 0;	/* flag for doif etc to tell getmem to
			   generate a test, not a load */
#ifndef M6502
char source = 0;	/* include 
source in m65 */
#endif
