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