1 /*
2  *      Small C+ Compiler
3  *
4  *      All those nasty static variables!
5  *
6  *      I'm starting to split these up once more and stick them in
7  *      the relevant files..
8  *
9  *      $Id: data.c,v 1.44 2016-09-01 04:08:32 aralbrec Exp $
10  */
11 
12 #include "../config.h"
13 #include "ccdefs.h"
14 
15 /*      Now reserve some storage words          */
16 
17 char amivers[] = "$VER: sccz80 " Z88DK_VERSION;
18 char titlec[] = "Small-C/Plus - z80 Crosscompiler ";
19 char Banner[] = "* * * * *  Small-C/Plus z88dk * * * * *";
20 char Version[] = "  Version: " Z88DK_VERSION;
21 
22 SYMBOL *symtab, *loctab; /* global and local symbol tables */
23 SYMBOL *locptr; /* ptrs to next entries */
24 int glbcnt; /* number of globals used */
25 
26 
27 WHILE_TAB* wqueue; /* start of while queue */
28 WHILE_TAB* wqptr; /* ptr to next entry */
29 
30 unsigned char *litq, *dubq; /* literal pool */
31 unsigned char* glbq; /* global literal queue */
32 unsigned char* tempq; /* Temp store string lits */
33 int gltptr, litptr, dubptr; /* index of next entry */
34 
35 char macq[MACQSIZE]; /* macro string buffer */
36 int macptr; /* and its index */
37 
38 char* stage; /* staging buffer */
39 char* stagenext; /* next address in stage */
40 char* stagelast; /* last address in stage */
41 
42 SW_TAB* swnext; /* address of next entry in switch table */
43 SW_TAB* swend; /* address of last entry in switch table */
44 
45 char line[LINESIZE]; /* parsing buffer */
46 char mline[LINESIZE]; /* temp macro buffer */
47 int lptr, mptr; /* indexes into buffers */
48 char Filename[FILENAME_LEN + 1]; /* original file name */
49 
50 /*      Misc storage    */
51 
52 /* My stuff for LIB of long common functions */
53 
54 int need_floatpack, ncomp;
55 
56 int stackargs;
57 
58 
59 char c_default_unsigned;
60 
61 int nxtlab, /* next avail label # */
62     glblab, /* For initializing global literals */
63 
64     litlab, /* label # assigned to literal pool */
65     Zsp, /* compiler relative stk ptr */
66     ncmp, /* # open compound statements */
67     errcnt, /* # errors in compilation */
68     c_errstop, /* stop on error */
69     eof, /* set non-zero on final input eof */
70     c_intermix_ccode, /* non-zero to intermix c-source */
71     cmode, /* non-zero while parsing c-code */
72     /* zero when passing assembly code */
73     declared, /* number of local bytes declared, else -1 when done */
74     lastst, /* last executed statement type */
75     lineno, /* line# in current file */
76     infunc, /* "inside function" flag */
77     c_verbose; /* Verbose to screen */
78 
79 int      scope_block; /* */
80 
81 FILE    *input; /* iob # for input file */
82 FILE    *output; /* iob # for output file (if any) */
83 FILE    *inpt2; /* iob # for "include" file */
84 FILE    *saveout; /* holds output ptr when diverted to console */
85 
86 
87 
88 SYMBOL  *currfn; /* ptr to symtab entry for current fn. */
89 
90 
91 /*
92  * Doms debug variable
93  */
94 
95 int debuglevel;
96 
97 
98 
99 
100 
101 
102 /* Doubles stored as strings? */
103 
104 int c_double_strings;
105 
106 /*
107  *        Framepointer stuff - tis broken!
108  */
109 int c_framepointer_is_ix;
110 
111 
112 int c_use_r2l_calling_convention;
113 
114 
115 
116 
117 /* scanf format requirements */
118 uint32_t scanf_format_option;
119 uint32_t printf_format_option;
120 
121 FILE *buffer_fps[200];
122 int   buffer_fps_num = 0 ;
123 
124 struct parser_stack *pstack; /**< Stack of previous saved parsers */
125 
126