1 /* The external variables of REXX/imc          (C) Ian Collier 1992 */
2 
3 #ifndef _globals_h
4 #define _globals_h
5 
6 /* Protection against things not having been included... */
7 #ifndef putchar
8 #include<stdio.h>
9 #endif
10 #ifndef Einit
11 #include"const.h"
12 #endif
13 #include<setjmp.h>
14 
15 extern int types[];                /* Three character type tables */
16 extern int alphs[];
17 extern int symbs[];
18 extern char fname[];               /* the current file name */
19 extern char extension[];           /* the default file extension */
20 extern int extlen;                 /* and its length */
21 extern int lines;                  /* number of lines in current source */
22 extern int stmts;                  /* number of statements in current program*/
23 extern char **source;              /* the source of the current program */
24 extern program *prog;              /* the current program, tokenised */
25 extern char *labelptr;             /* start of label table */
26 extern char *vartab;               /* start of variable table */
27 extern int *varstk;                /* offsets to levels in variable table */
28 extern unsigned varstklen;         /* number of elements allocated to varstk */
29 extern unsigned vartablen;         /* space allocated to vartab */
30 extern int varstkptr;              /* current level number */
31 extern char *cstackptr;            /* start of calculator stack */
32 extern unsigned ecstackptr;        /* length of calculator stack */
33 extern unsigned cstacklen;         /* space allocated to calculator stack */
34 extern char *workptr;              /* start of workspace */
35 extern unsigned eworkptr;          /* amount of workspace used */
36 extern unsigned worklen;           /* space allocated to workspace */
37 extern char *pstackptr;            /* start of program stack */
38 extern unsigned epstackptr;        /* length of program stack */
39 extern unsigned pstacklen;         /* space allocated to program stack */
40 extern int pstacklev;              /* prog stack level within current func */
41 extern char* hashptr[];            /* pointers to 3 hash tables */
42 extern unsigned ehashptr[];        /* lengths of hash tables */
43 extern unsigned hashlen[];         /* space allocated to hash tables */
44 extern struct sigstruct {          /* contexts of all calls to interpreter() */
45        short bits;                 /* and which signals to catch by default */
46        short bitson;               /* which signals are caught here */
47        short callon;               /* which signals cause a call */
48        short delay;                /* which signals are set to "delay" */
49        char type;                  /* condition(i) 0=none, 1=signal, 2=call */
50        char which;                 /* condition(c) */
51        char *data;                 /* condition(d) */
52        int ppc[Imax];              /* number of the SIGNAL ON instruction */
53          jmp_buf jmp;              /* for each signal */
54       } *sgstack;
55 extern unsigned sigstacklen;       /* number of elements allocated to sgstack */
56 extern int delayed[Imax];          /* Which signals are pending action */
57 extern char *sigdata[Imax];        /* Descriptions for pending signals */
58 extern jmp_buf interactbuf;        /* context of interactive trace routine */
59 extern jmp_buf *exitbuf;           /* where to go on exit */
60 extern int interplev;              /* nesting level of interpreter() */
61 extern int interact;               /* interplev of interactive trace, or -1 */
62 extern int interactmsg;            /* Whether to emit message at interactive */
63 extern int ppc;                    /* statement number being interpreted */
64 extern int oldppc;                 /* saved position in case of error */
65 extern int newppc;                 /* statement to jump to */
66 extern char **curargs;             /* current arguments, for ARG() */
67 extern int *curarglen;             /* lengths of current arguments */
68 extern char *errordata;            /* data to print after error message */
69 extern int precision;              /* NUMERIC DIGITS */
70 extern int fuzz;                   /* NUMERIC DIGITS minus NUMERIC FUZZ */
71 extern char numform;               /* 0=SCIENTIFIC, 1=ENGINEERING */
72 extern char trcflag;               /* what to trace */
73 extern char trcresult;             /* nesting level of scanning() */
74 extern char otrcflag;              /* temporary store for trace flag */
75 extern char trclp;                 /* whether to input in interactive mode */
76 extern char timeflag;              /* bit 0: used elapsed time counter */
77                                    /* bit 1: timestamp in operation */
78 			           /* bit 2: used random number generator */
79 extern long secs;extern long microsecs; /* time when TIME(r) last called */
80 extern struct timeval timestamp;   /* the timestamp, if in operation */
81 extern int address0;               /* The initial environment */
82 extern int address1;               /* The current environment */
83 extern int address2;               /* The alternate environment */
84 extern char *rxpath;               /* where to find libraries if not in REXXLIB */
85 extern FILE *ttyin,*ttyout;        /* access to the terminal */
86 extern char *pull;                 /* storage used for input */
87 extern unsigned pulllen;           /* space allocated for pull */
88 extern char *returnval;            /* value returned by EXIT */
89 extern int returnlen;              /* length of that value */
90 extern char *returnfree;           /* what to free after returnval is used */
91 extern int rxstacksock;            /* fd number of stack socket */
92 extern char *varnamebuf;           /* workspace for evaluating variable names*/
93 extern int varnamelen;             /* amount of memory allocated for this */
94 extern FILE *traceout;             /* Where to send trace output */
95 extern int lasterror;              /* The last error which occurred on I/O */
96 extern int setrcflag;              /* flag for "options setrc" */
97 extern int exposeflag;             /* flag for "options expose" */
98 extern int sigpipeflag;            /* flag for "options sigpipe" */
99 extern struct _varent *nextvar;    /* next variable for RXSHV_NEXTV */
100 
101 
102 extern char *conditions[];         /* the condition names */
103 
104 extern struct environ {            /* the list of environments */
105    char name[maxenviron+1];
106    unsigned long (*handler)();
107    unsigned char *area;
108    int defined;
109 } *envtable;
110 
111 extern long (*exitlist[])(); /* list of exit addresses */
112 
113 #endif /* !_globals_h */
114