Pristine Ack-5.5
[Ack-5.5.git] / mach / proto / as / comm1.h
1 /* $Id: comm1.h,v 2.17 1994/06/24 13:21:55 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 /* @(#)comm1.h  1.5 */
7 /*
8  * variable declarations
9  */
10
11 #ifdef extern
12 #define INIT(x)         = x
13 #else
14 #define INIT(x)         /* empty */
15 #endif
16
17 extern short    pass INIT(PASS_1);
18                                 /* PASS 1, 2 or 3 */
19 extern short    peekc;          /* push back symbol (PASS_1) */
20 extern short    unresolved;     /* number of unresolved references */
21 extern long     lineno;         /* input line number */
22 extern short    hllino;         /* high-level language line number */
23 extern short    nerrors;        /* terminate at end of pass if set */
24 extern short    sflag INIT(SYM_DEF);
25                                 /* -s option (symbol table info) */
26 extern char     *progname;      /* for error messages */
27 extern char     *modulename;    /* for error messages */
28 extern common_t *commons;       /* header of commons list */
29
30 #ifdef ASLD
31 extern short    archmode;       /* scanning archives */
32 extern long     archsize;       /* size of individual archive entries */
33 #else
34 extern short    uflag;          /* if 1 make undefineds extern */
35                                 /* symbol table index for last S_UND */
36 #endif
37
38 #ifdef LISTING
39 extern short    dflag;          /* -d option (list mode) */
40 #endif
41
42 #ifdef ASLD
43 #ifdef RELOCATION
44 extern short    rflag;          /* -r option (relocation info) */
45 #endif /* RELOCATION */
46 #else
47 #define rflag   1
48 extern valu_t   relonami;
49 #endif /* ASLD */
50
51 #ifdef THREE_PASS
52 extern short    bflag;          /* -b option (no optimizations) */
53 #endif
54
55 extern char     *aoutpath INIT("a.out");
56 extern char     temppath[50];
57
58 extern FILE     *input;
59 extern FILE     *tempfile;
60
61 extern char     *stringbuf;     /* contains last string value */
62 extern int      stringlen;      /* contains length of last string value */
63
64 extern sect_t   sect[SECTMAX];
65
66 /*
67  * specials for the location counter
68  */
69 extern sect_t   *DOTSCT;        /* &sect[DOTTYP-S_MIN] or NULL */
70 extern ADDR_T   DOTVAL;         /* DOTSCT->s_size + DOTSCT->s_base */
71 extern short    DOTTYP;         /* S_MIN..S_MAX or S_UND */
72
73 extern unsigned short   nname;          /* Counts name table index in PASS_3 */
74
75 extern item_t   *hashtab[H_TOTAL];
76 extern short    hashindex;      /* see item_search() */
77
78 extern item_t   *fb_ptr[4*FB_SIZE];
79
80 #ifdef THREE_PASS
81 #define BITCHUNK        (8 * MEMINCR)
82 extern int      nbits;
83 extern int      bitindex;       /* bitindex * MEMINCR * 8 + nbits gives
84                                    number of decisions so far
85                                 */
86 #endif
87
88 #ifdef LISTING
89 extern short    listmode;       /* -d option for current pass */
90 extern short    listtemp;       /* listmode if .list seen */
91 extern short    listflag;       /* copied from listtemp at '\n' */
92 extern short    listcolm;       /* column on output */
93 extern short    listeoln INIT(1);
94                                 /* set by endline, tested by emit1 */
95 extern FILE     *listfile;      /* copy of source text */
96 extern char     listpath[50];
97 #endif
98
99 #ifndef extern
100 extern item_t           keytab[];
101 extern struct outhead   outhead;
102 #endif
103
104 extern int      curr_token;
105
106 /* forward function declarations */
107 #ifdef ASLD
108 extern char     *readident();
109 #endif
110 extern char     *remember();
111 extern item_t   *fb_shift();
112 extern item_t   *fb_alloc();
113 extern item_t   *item_alloc();
114 extern item_t   *item_search();
115 extern valu_t   load();
116 extern FILE     *ffcreat();
117 extern FILE     *fftemp();
118
119 /* some library functions used */
120 extern char     *mktemp();
121 extern char     *malloc();
122 extern char     *realloc();
123 extern char     *calloc();
124 extern char     *getenv();
125 extern char     *strncpy();
126
127 /* ========== Machine dependent C declarations ========== */
128
129 #include        "mach1.c"