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