#ifndef XLVAR_H
#define XLVAR_H

/* from xlglob.c */
/* symbols */
extern LVAL true,obarray;
extern LVAL s_unbound,s_dot;
extern LVAL s_quote,s_function;
extern LVAL s_bquote,s_comma,s_comat;
extern LVAL s_evalhook,s_applyhook,s_tracelist;
extern LVAL s_lambda,s_macro;
extern LVAL s_stdin,s_stdout,s_stderr,s_debugio,s_traceout;
extern LVAL s_rtable;
extern LVAL s_tracenable,s_tlimit,s_breakenable;
extern LVAL s_setf,s_car,s_cdr,s_nth,s_aref,s_get;
extern LVAL s_svalue,s_sfunction,s_splist;
extern LVAL s_eql,s_gcflag,s_gchook;
extern LVAL s_ifmt,s_ffmt;
extern LVAL s_1plus,s_2plus,s_3plus;
extern LVAL s_1star,s_2star,s_3star;
extern LVAL s_minus,s_printcase;

/* keywords */
extern LVAL k_test,k_tnot;
extern LVAL k_wspace,k_const,k_nmacro,k_tmacro;
extern LVAL k_sescape,k_mescape;
extern LVAL k_direction,k_input,k_output;
extern LVAL k_start,k_end,k_1start,k_1end;
extern LVAL k_2start,k_2end,k_count,k_key;
extern LVAL k_verbose,k_print;
extern LVAL k_upcase,k_downcase;

/* lambda list keywords */
extern LVAL lk_optional,lk_rest,lk_key,lk_aux;
extern LVAL lk_allow_other_keys;

/* type names */
extern LVAL a_subr,a_fsubr;
extern LVAL a_cons,a_symbol,a_fixnum,a_flonum;
extern LVAL a_string,a_object,a_stream,a_vector;
extern LVAL a_closure,a_char,a_ustream;
extern LVAL a_complex;         /* L. Tierney */
extern LVAL a_array;           /* L. Tierney */

/* evaluation variables */
extern LVAL **xlstack,**xlstkbase,**xlstktop;
extern LVAL xlenv,xlfenv,xldenv;

/* argument stack */
extern LVAL *xlargstkbase;	/* argument stack base */
extern LVAL *xlargstktop;	/* argument stack top */
extern LVAL *xlfp;		/* argument frame pointer */
extern LVAL *xlsp;		/* argument stack pointer */
extern LVAL *xlargv;		/* current argument vector */
extern int xlargc;			/* current argument count */

/* exception handling variables */
extern CONTEXT *xlcontext;	/* current exception handler */
extern CONTEXT *xltarget;	/* target context (for xljump) */
extern LVAL xlvalue;		/* exception value (for xljump) */
extern int xlmask;			/* exception type (for xljump) */

/* debugging variables */
extern int xldebug;		/* debug level */
extern int xlsample;		/* control character sample rate */
extern int xltrcindent;		/* trace indent level */

/* gensym variables */
extern char gsprefix[];  	/* gensym prefix string */
extern int gsnumber;		/* gensym number */

/* i/o variables */
extern int xlfsize;		/* flat size of current print call */
extern FILE *tfp;		/* transcript file pointer */

/* general purpose string buffer */
extern char buf[];


/* from xlinit.c */
extern LVAL true,s_dot,s_unbound;
extern LVAL s_quote,s_function,s_bquote,s_comma,s_comat;
extern LVAL s_lambda,s_macro;
extern LVAL s_stdin,s_stdout,s_stderr,s_debugio,s_traceout;
extern LVAL s_evalhook,s_applyhook,s_tracelist;
extern LVAL s_tracenable,s_tlimit,s_breakenable;
extern LVAL s_setf,s_car,s_cdr,s_nth,s_aref,s_get,s_eql;
extern LVAL s_svalue,s_sfunction,s_splist;
extern LVAL s_rtable,k_wspace,k_const,k_nmacro,k_tmacro;
extern LVAL k_sescape,k_mescape;
extern LVAL s_ifmt,s_ffmt,s_printcase;
extern LVAL s_1plus,s_2plus,s_3plus,s_1star,s_2star,s_3star,s_minus;
extern LVAL k_test,k_tnot;
extern LVAL k_direction,k_input,k_output;
extern LVAL k_start,k_end,k_1start,k_1end,k_2start,k_2end;
extern LVAL k_verbose,k_print,k_count,k_key,k_upcase,k_downcase;
extern LVAL lk_optional,lk_rest,lk_key,lk_aux,lk_allow_other_keys;
extern LVAL a_subr,a_fsubr,a_cons,a_symbol;
extern LVAL a_fixnum,a_flonum,a_string,a_stream,a_object;
extern LVAL a_vector,a_closure,a_char,a_ustream;
extern LVAL a_complex;      /* L. Tierney */
extern LVAL a_array;        /* L. Tierney */
extern LVAL s_gcflag,s_gchook;
extern FUNDEF funtab[];


/* external variables from xlimage.c */
extern LVAL obarray,xlenv,xlfenv,xldenv;
extern long nnodes,nfree,total;
extern int anodes,nsegs,gccalls;
extern struct segment *segs,*lastseg,*fixseg,*charseg;
extern CONTEXT *xlcontext;
extern LVAL fnodes;

#endif XLVAR_H