1 /* xlglobals - xlisp global variables */
2 /*	Copyright (c) 1985, by David Michael Betz
3         All Rights Reserved
4         Permission is granted for unrestricted non-commercial use
5 
6  * 3-Apr-88	Dale Amon at CMU-CSD
7  *	Added a_extern to xlisp 2.0
8  *
9  * 18-Oct-87	Dale Amon at CMU-CSD
10  *	Added global pointer a_extern for node defining new EXTERN
11  *	node type.
12  *
13  * 12 Oct 90	RBD Added s_profile, profile_fixnum
14  */
15 
16 
17 #include "xlisp.h"
18 
19 /* symbols */
20 LVAL s_true=NIL,obarray=NIL;
21 LVAL s_unbound=NIL,s_dot=NIL;
22 LVAL s_quote=NIL,s_function=NIL;
23 LVAL s_bquote=NIL,s_comma=NIL,s_comat=NIL;
24 LVAL s_evalhook=NIL,s_applyhook=NIL,s_tracelist;
25 LVAL s_lambda=NIL,s_macro=NIL;
26 LVAL s_stdin=NIL,s_stdout=NIL,s_stderr=NIL,s_debugio=NIL,s_traceout=NIL;
27 LVAL s_rtable=NIL;
28 LVAL s_tracenable=NIL,s_tlimit=NIL,s_breakenable=NIL;
29 LVAL s_loadingfiles=NIL;
30 LVAL s_profile = NIL, profile_fixnum = NIL;
31 LVAL s_setf=NIL,s_car=NIL,s_cdr=NIL,s_nth=NIL,s_aref=NIL,s_get=NIL;
32 LVAL s_svalue=NIL,s_sfunction=NIL,s_splist=NIL;
33 LVAL s_eql=NIL,s_gcflag=NIL,s_gchook=NIL;
34 LVAL s_ifmt=NIL,s_ffmt=NIL;
35 LVAL s_1plus=NIL,s_2plus=NIL,s_3plus=NIL;
36 LVAL s_1star=NIL,s_2star=NIL,s_3star=NIL;
37 LVAL s_minus=NIL,s_printcase=NIL;
38 LVAL s_search_path=NIL;
39 
40 /* keywords */
41 LVAL k_test=NIL,k_tnot=NIL;
42 LVAL k_wspace=NIL,k_const=NIL,k_nmacro=NIL,k_tmacro=NIL;
43 LVAL k_sescape=NIL,k_mescape=NIL;
44 LVAL k_direction=NIL,k_input=NIL,k_output=NIL;
45 LVAL k_start=NIL,k_end=NIL,k_1start=NIL,k_1end=NIL;
46 LVAL k_2start=NIL,k_2end=NIL,k_count=NIL,k_key=NIL;
47 LVAL k_verbose=NIL,k_print=NIL;
48 LVAL k_upcase=NIL,k_downcase=NIL;
49 
50 /* lambda list keywords */
51 LVAL lk_optional=NIL,lk_rest=NIL,lk_key=NIL,lk_aux=NIL;
52 LVAL lk_allow_other_keys=NIL;
53 
54 /* type names */
55 LVAL a_subr=NIL,a_fsubr=NIL;
56 LVAL a_cons=NIL,a_symbol=NIL,a_fixnum=NIL,a_flonum=NIL;
57 LVAL a_string=NIL,a_object=NIL,a_stream=NIL,a_vector=NIL;
58 LVAL a_extern = NIL;
59 LVAL a_closure=NIL,a_char=NIL,a_ustream=NIL;
60 
61 /* evaluation variables */
62 LVAL **xlstack = NULL,**xlstkbase = NULL,**xlstktop = NULL;
63 LVAL xlenv=NIL,xlfenv=NIL,xldenv=NIL;
64 
65 /* argument stack */
66 LVAL *xlargstkbase = NULL;	/* argument stack base */
67 LVAL *xlargstktop = NULL;	/* argument stack top */
68 LVAL *xlfp = NULL;		/* argument frame pointer */
69 LVAL *xlsp = NULL;		/* argument stack pointer */
70 LVAL *xlargv = NULL;		/* current argument vector */
71 int xlargc = 0;			/* current argument count */
72 
73 /* exception handling variables */
74 XLCONTEXT *xlcontext = NULL;	/* current exception handler */
75 XLCONTEXT *xltarget = NULL;	/* target context (for xljump) */
76 LVAL xlvalue=NIL;		/* exception value (for xljump) */
77 int xlmask=0;			/* exception type (for xljump) */
78 
79 /* debugging variables */
80 int xldebug = 0;		/* debug level */
81 int xlsample = 0;		/* control character sample rate */
82 int xltrcindent = 0;		/* trace indent level */
83 
84 /* gensym variables */
85 char gsprefix[STRMAX+1] = { 'G',0 };	/* gensym prefix string */
86 int gsnumber = 1;		/* gensym number */
87 
88 /* i/o variables */
89 int xlfsize = 0;		/* flat size of current print call */
90 FILE *tfp = NULL;		/* transcript file pointer */
91 
92 /* general purpose string buffer */
93 char buf[STRMAX+1] = { 0 };
94 
95 int xlatomcount	= 0;	/* how many atoms are there? */
96