Commit | Line | Data |
---|---|---|
74441096 C |
1 | %BEGIN(PEPSY)% |
2 | /* pepsy.h - definitions for pepsy */ | |
3 | %END(PEPSY)% | |
4 | %BEGIN(PEPY)% | |
5 | /* pepy.h - definitions for pepy */ | |
6 | %END(PEPY)% | |
7 | %BEGIN(ROSY)% | |
8 | /* rosy-defs.h - definitions for rosy */ | |
9 | %END(ROSY)% | |
10 | %BEGIN(MOSY)% | |
11 | /* mosy-defs.h - definitions for mosy */ | |
12 | %END(MOSY)% | |
13 | /* %WARNING% */ | |
14 | ||
15 | /* | |
16 | * $Header: /f/osi/pepsy/RCS/pepsy.h.gnrc,v 7.1 91/02/22 09:49:47 mrose Interim $ | |
17 | * | |
18 | * | |
19 | * $Log: pepsy.h.gnrc,v $ | |
20 | * Revision 7.1 91/02/22 09:49:47 mrose | |
21 | * Interim 6.8 | |
22 | * | |
23 | * Revision 7.0 90/07/01 19:54:36 mrose | |
24 | * *** empty log message *** | |
25 | * | |
26 | * Revision 7.0 89/11/23 22:11:48 mrose | |
27 | * Release 6.0 | |
28 | * | |
29 | * Revision 6.1 89/07/30 12:16:16 mrose | |
30 | */ | |
31 | ||
32 | /* | |
33 | * NOTICE | |
34 | * | |
35 | * Acquisition, use, and distribution of this module and related | |
36 | * materials are subject to the restrictions of a license agreement. | |
37 | * Consult the Preface in the User's Manual for the full terms of | |
38 | * this agreement. | |
39 | * | |
40 | */ | |
41 | ||
42 | ||
43 | #include "psap.h" | |
44 | ||
45 | struct tuple { | |
46 | int t_type; | |
47 | char *t_class; | |
48 | char *t_form; | |
49 | char *t_id; | |
50 | PElementClass t_classnum; | |
51 | int t_idnum; | |
52 | }; | |
53 | ||
54 | typedef struct ypv { | |
55 | int yv_code; | |
56 | #define YV_UNDF 0x00 /* ??? */ | |
57 | #define YV_NUMBER 0x01 /* LITNUMBER */ | |
58 | #define YV_BOOL 0x02 /* TRUE | FALSE */ | |
59 | #define YV_STRING 0x03 /* LITSTRING */ | |
60 | #define YV_IDEFINED 0x04 /* ID */ | |
61 | #define YV_IDLIST 0x05 /* IdentifierList */ | |
62 | #define YV_VALIST 0x06 /* { Values } */ | |
63 | #define YV_NULL 0x07 /* NULL */ | |
64 | #define YV_ABSENT 0x08 /* WITH COMPONENTS .. ABSENT */ | |
65 | #define YV_PRESENT 0x09 /* " " .. PRESENT */ | |
66 | #define YV_INCLUDES 0x0a /* INCLUDES ... */ | |
67 | #define YV_WITHCOMPS 0x0b /* WITH COMPONENTS */ | |
68 | #define YV_OIDLIST 0x0c /* { object identifier } */ | |
69 | #define YV_REAL 0x0d /* real value */ | |
70 | ||
71 | union { | |
72 | int yv_un_number; /* code = YV_NUMBER | |
73 | code = YV_BOOL */ | |
74 | ||
75 | double yv_un_real; /* code = YV_REAL */ | |
76 | ||
77 | char *yv_un_string; /* code = YV_STRING */ | |
78 | ||
79 | struct { /* code = YV_IDEFINED */ | |
80 | char *yv_st_module; | |
81 | char *yv_st_modid; | |
82 | char *yv_st_identifier; | |
83 | } yv_st; | |
84 | ||
85 | struct ypv *yv_un_idlist; /* code = YV_IDLIST | |
86 | code = YV_VALIST | |
87 | code = YV_OIDLIST */ | |
88 | } yv_un; | |
89 | #define yv_number yv_un.yv_un_number | |
90 | #define yv_string yv_un.yv_un_string | |
91 | #define yv_identifier yv_un.yv_st.yv_st_identifier | |
92 | #define yv_module yv_un.yv_st.yv_st_module | |
93 | #define yv_modid yv_un.yv_st.yv_st_modid | |
94 | #define yv_idlist yv_un.yv_un_idlist | |
95 | #define yv_real yv_un.yv_un_real | |
96 | ||
97 | char *yv_action; | |
98 | int yv_act_lineno; | |
99 | ||
100 | int yv_flags; | |
101 | #define YV_NOFLAGS 0x00 /* no flags */ | |
102 | #define YV_ID 0x01 /* ID Value */ | |
103 | #define YV_NAMED 0x02 /* NamedNumber */ | |
104 | #define YV_TYPE 0x04 /* TYPE Value */ | |
105 | #define YV_BOUND 0x08 /* named value */ | |
106 | #define YVBITS "\020\01ID\02NAMED\03TYPE\04BOUND" | |
107 | ||
108 | char *yv_id; /* flags & YV_ID */ | |
109 | ||
110 | char *yv_named; /* flags & YV_NAMED */ | |
111 | ||
112 | struct ype *yv_type; /* flags & YV_TYPE */ | |
113 | ||
114 | struct ypv *yv_next; | |
115 | } ypv, *YV; | |
116 | #define NULLYV ((YV) 0) | |
117 | ||
118 | YV new_value (), add_value (), copy_value (); | |
119 | ||
120 | /* \f */ | |
121 | ||
122 | typedef struct ypt { | |
123 | PElementClass yt_class; | |
124 | ||
125 | YV yt_value; | |
126 | } ypt, *YT; | |
127 | #define NULLYT ((YT) 0) | |
128 | ||
129 | YT new_tag (), copy_tag (); | |
130 | ||
131 | /* \f */ | |
132 | ||
133 | typedef struct ype { | |
134 | int yp_code; | |
135 | #define YP_UNDF 0x00 /* type not yet known */ | |
136 | #define YP_BOOL 0x01 /* BOOLEAN */ | |
137 | #define YP_INT 0x02 /* INTEGER */ | |
138 | #define YP_INTLIST 0x03 /* INTEGER [ NamedNumberList ] */ | |
139 | #define YP_BIT 0x04 /* BITSTRING */ | |
140 | #define YP_BITLIST 0x05 /* BITSTRING [ NamedNumberList ] */ | |
141 | #define YP_OCT 0x06 /* OCTETSTRING */ | |
142 | #define YP_NULL 0x07 /* NULL */ | |
143 | #define YP_SEQ 0x08 /* SEQUENCE */ | |
144 | #define YP_SEQTYPE 0x09 /* SEQUENCE OF Type */ | |
145 | #define YP_SEQLIST 0x0a /* SEQUENCE [ ElementTypes ] */ | |
146 | #define YP_SET 0x0b /* SET */ | |
147 | #define YP_SETTYPE 0x0c /* SET OF Type */ | |
148 | #define YP_SETLIST 0x0d /* SET [ MemberTypes ] */ | |
149 | #define YP_CHOICE 0x0e /* CHOICE [ AlternativeTypeList ] */ | |
150 | #define YP_ANY 0x0f /* ANY */ | |
151 | #define YP_OID 0x10 /* OBJECT IDENTIFIER */ | |
152 | #define YP_IDEFINED 0x11 /* identifier */ | |
153 | #define YP_ENUMLIST 0x12 /* ENUMERATED */ | |
154 | #define YP_REAL 0x13 /* Real (floating-point) */ | |
155 | ||
156 | int yp_direction; | |
157 | #define YP_DECODER 0x01 | |
158 | #define YP_ENCODER 0x02 | |
159 | #define YP_PRINTER 0x04 | |
160 | ||
161 | union { | |
162 | struct { /* code = YP_IDEFINED */ | |
163 | char *yp_st_module; /* module name */ | |
164 | OID yp_st_modid; /* module id */ | |
165 | char *yp_st_identifier; /* definition name */ | |
166 | } yp_st; | |
167 | ||
168 | struct ype *yp_un_type; /* code = YP_SEQTYPE | |
169 | code = YP_SEQLIST | |
170 | code = YP_SETTYPE | |
171 | code = YP_SETLIST | |
172 | code = YP_CHOICE */ | |
173 | ||
174 | YV yp_un_value; /* code = YP_INTLIST | |
175 | code = YP_BITLIST */ | |
176 | } yp_un; | |
177 | #define yp_identifier yp_un.yp_st.yp_st_identifier | |
178 | #define yp_module yp_un.yp_st.yp_st_module | |
179 | #define yp_modid yp_un.yp_st.yp_st_modid | |
180 | #define yp_type yp_un.yp_un_type | |
181 | #define yp_value yp_un.yp_un_value | |
182 | ||
183 | char *yp_intexp; /* expressions to pass (use) as extra */ | |
184 | char *yp_strexp; /* parameters (primitive values) */ | |
185 | char yp_prfexp; | |
186 | ||
187 | char *yp_declexp; | |
188 | char *yp_varexp; | |
189 | ||
190 | char *yp_structname; | |
191 | char *yp_ptrname; | |
192 | ||
193 | char *yp_param_type; | |
194 | ||
195 | char *yp_action0; | |
196 | int yp_act0_lineno; | |
197 | ||
198 | char *yp_action05; | |
199 | int yp_act05_lineno; | |
200 | ||
201 | char *yp_action1; | |
202 | int yp_act1_lineno; | |
203 | ||
204 | char *yp_action2; | |
205 | int yp_act2_lineno; | |
206 | ||
207 | char *yp_action3; | |
208 | int yp_act3_lineno; | |
209 | ||
210 | int yp_flags; | |
211 | #define YP_NOFLAGS 0x0000 /* no flags */ | |
212 | #define YP_OPTIONAL 0x0001 /* OPTIONAL */ | |
213 | #define YP_COMPONENTS 0x0002 /* COMPONENTS OF */ | |
214 | #define YP_IMPLICIT 0x0004 /* IMPLICIT */ | |
215 | #define YP_DEFAULT 0x0008 /* DEFAULT */ | |
216 | #define YP_ID 0x0010 /* ID */ | |
217 | #define YP_TAG 0x0020 /* Tag */ | |
218 | #define YP_BOUND 0x0040 /* ID LANGLE */ | |
219 | #define YP_PULLEDUP 0x0080 /* member is a choice */ | |
220 | #define YP_PARMVAL 0x0100 /* value to be passed to parm is present */ | |
221 | #define YP_CONTROLLED 0x0200 /* encoding item has a controller */ | |
222 | #define YP_OPTCONTROL 0x0400 /* .. */ | |
223 | #define YP_ACTION1 0x0800 /* action1 acted upon */ | |
224 | #define YP_PARMISOID 0x1000 /* value to be passed to parm is OID */ | |
225 | #define YP_ENCRYPTED 0x2000 /* encypted - which is a bit hazy */ | |
226 | #define YP_IMPORTED 0x4000 /* value imported from another module */ | |
227 | #define YP_EXPORTED 0x8000 /* value exported to another module */ | |
228 | #define YPBITS "\020\01OPTIONAL\02COMPONENTS\03IMPLICIT\04DEFAULT\05ID\06TAG\ | |
229 | \07BOUND\010PULLEDUP\011PARMVAL\012CONTROLLED\013OPTCONTROL\ | |
230 | \014ACTION1\015PARMISOID\016ENCRYPTED\017IMPORTED\020EXPORTED" | |
231 | ||
232 | YV yp_default; /* flags & YP_DEFAULT */ | |
233 | ||
234 | char *yp_id; /* flags & YP_ID */ | |
235 | ||
236 | YT yp_tag; /* flags & YP_TAG */ | |
237 | ||
238 | char *yp_bound; /* flags & YP_BOUND */ | |
239 | ||
240 | char *yp_parm; /* flags & YP_PARMVAL */ | |
241 | ||
242 | char *yp_control; /* flags & YP_CONTROLLED */ | |
243 | ||
244 | char *yp_optcontrol; /* flags & YP_OPTCONTROL */ | |
245 | ||
246 | char *yp_offset; | |
247 | ||
248 | struct ype *yp_next; | |
249 | } ype, *YP; | |
250 | #define NULLYP ((YP) 0) | |
251 | ||
252 | YP new_type (), add_type (), copy_type (); | |
253 | ||
254 | char *new_string (); | |
255 | ||
256 | #define TBL_EXPORT 0 | |
257 | #define TBL_IMPORT 1 | |
258 | #define MAX_TBLS 2 | |
259 | ||
260 | extern int tagcontrol; | |
261 | #define TAG_UNKNOWN 0 | |
262 | #define TAG_IMPLICIT 1 | |
263 | #define TAG_EXPLICIT 2 | |
264 | ||
265 | #define CH_FULLY 0 | |
266 | #define CH_PARTIAL 1 | |
267 | ||
268 | typedef struct yop { | |
269 | char *yo_name; | |
270 | ||
271 | YP yo_arg; | |
272 | YP yo_result; | |
273 | YV yo_errors; | |
274 | YV yo_linked; | |
275 | ||
276 | int yo_opcode; | |
277 | } yop, *YO; | |
278 | #define NULLYO ((YO) 0) | |
279 | ||
280 | ||
281 | typedef struct yerr { | |
282 | char *ye_name; | |
283 | ||
284 | YP ye_param; | |
285 | ||
286 | int ye_errcode; | |
287 | ||
288 | int ye_offset; | |
289 | } yerr, *YE; | |
290 | #define NULLYE ((YE) 0) | |
291 | ||
292 | /* \f */ | |
293 | ||
294 | %BEGIN(PEPSY)% | |
295 | extern char *pepsyversion; | |
296 | %END(PEPSY)% | |
297 | %BEGIN(PEPY)% | |
298 | extern char *pepyversion; | |
299 | %END(PEPY)% | |
300 | %BEGIN(ROSY)% | |
301 | extern char *rosyversion; | |
302 | %END(ROSY)% | |
303 | %BEGIN(MOSY)% | |
304 | extern char *mosyversion; | |
305 | %END(MOSY)% | |
306 | ||
307 | extern int yysection; | |
308 | extern char *yyencpref; | |
309 | extern char *yydecpref; | |
310 | extern char *yyprfpref; | |
311 | extern char *yyencdflt; | |
312 | extern char *yydecdflt; | |
313 | extern char *yyprfdflt; | |
314 | ||
315 | extern int yydebug; | |
316 | extern int yylineno; | |
317 | ||
318 | #ifndef HPUX | |
319 | extern char yytext[]; | |
320 | #else | |
321 | extern unsigned char yytext[]; | |
322 | #endif | |
323 | ||
324 | extern char *mymodule; | |
325 | ||
326 | extern OID mymoduleid; | |
327 | ||
328 | extern char *bflag; | |
329 | extern int Cflag; | |
330 | extern int dflag; | |
331 | extern int Pflag; | |
332 | extern char *sysin; | |
333 | ||
334 | extern char *module_actions; | |
335 | ||
336 | OID addoid (); | |
337 | OID int2oid (); | |
338 | OID oidlookup (); | |
339 | char *oidname (); | |
340 | char *oidprint (); | |
341 | ||
342 | extern int errno; |