BSD-SCCS END release
[unix-history] / usr / src / usr.bin / pascal / pc3 / pc3.h
CommitLineData
8c1e6983 1/*-
4040b365
KB
2 * Copyright (c) 1980, 1982, 1983, 1993
3 * The Regents of the University of California. All rights reserved.
252367af 4 *
8c1e6983
KB
5 * %sccs.include.redist.c%
6 *
4040b365 7 * @(#)pc3.h 8.1 (Berkeley) %G%
252367af 8 */
701fddb1 9
701fddb1
PK
10 /*
11 * a symbol table entry.
12 */
13struct symbol {
14 char *name; /* pointer to string table */
99f6998f 15 short desc; /* symbol description */
701fddb1 16 int lookup; /* whether new or old */
2dc241d5 17 struct symbol *fromp; /* its defining .p file */
701fddb1
PK
18 union { /* either */
19 struct { /* for a symbol, */
701fddb1
PK
20 struct symbol *fromi; /* its defining .i file */
21 long iline; /* the .i file line */
22 struct symbol *rfilep; /* its resolving file */
23 long rline; /* resolving file line */
99f6998f 24 } sym_str;
2dc241d5 25 long checksum; /* for a file, its checksum */
701fddb1
PK
26 } sym_un;
27};
28
8e79e0ed
PK
29 /*
30 * struct for an argument .o file.
31 */
701fddb1
PK
32struct fileinfo {
33 FILE *file;
34 char *name;
701fddb1
PK
35 off_t nextoffset;
36};
37
8e79e0ed
PK
38 /*
39 * old archive magic for error detection.
40 */
701fddb1
PK
41#define OARMAG 0177545
42
43 /*
44 * this is used to trim pointers into the range of a mod of a prime.
45 */
46#define SHORT_ABS( n ) ( n & 077777 )
47
48 /*
8e79e0ed
PK
49 * a prime number which gets sizeof( struct symboltableinfo )
50 * up to a multiple of BUFSIZ.
701fddb1
PK
51 */
52#define SYMBOLPRIME 1021
8e79e0ed 53
701fddb1
PK
54 /*
55 * number of entries used in this symbol table,
56 * a chain to the next symbol table,
57 * and the entries. (pointers to struct symbols.)
58 */
59struct symboltableinfo {
60 long used;
61 struct symboltableinfo *chain;
62 struct symbol *entry[ SYMBOLPRIME ];
63};
64
65 /*
66 * if new struct symbols are needed,
67 * allocate this much space and hack it up into struct symbols.
68 */
69#define SYMBOLALLOC BUFSIZ
70
71 /*
8e79e0ed
PK
72 * a prime number which gets sizeof( struct stringtableinfo )
73 * up to a multiple of BUFSIZ.
701fddb1
PK
74 */
75#define STRINGPRIME 1021
76
77 /*
78 * number of entries used in this string table,
79 * a chain to the next string table,
80 * and the entries. (pointers to the character table.)
81 */
82struct stringtableinfo {
83 long used;
84 struct stringtableinfo *chain;
85 char *entry[ STRINGPRIME ];
86};
87
88 /*
89 * if more character table space is needed,
90 * allocate this much and hack it up into strings.
91 */
92#define CHARALLOC BUFSIZ
93
8e79e0ed
PK
94 /*
95 * uninitialized pointer
96 */
97#define NIL 0
98
701fddb1
PK
99 /*
100 * an enumeration for error types
101 */
f54dd2f6 102#define NONE 0
701fddb1 103#define WARNING 1
f54dd2f6
PK
104#define ERROR 2
105#define FATAL 3
701fddb1
PK
106
107 /*
108 * an enumeration for lookups
109 */
110#define NEW 0
111#define OLD 1
112
113 /*
114 * booleans
115 */
116#define BOOL int
117#define FALSE 0
118#define TRUE 1
119
120 /*
121 * function types.
122 */
123struct symbol *entersymbol();
124struct symbol *symbolalloc();
125long stringhash();
126char *enterstring();
127char *charalloc();
128BOOL nextelement();
129time_t mtime();
130char *classify();
a65b6a9e 131char *article();