summaryrefslogtreecommitdiffstats
path: root/src/isode/pepsy/pepsy.h.gnrc
blob: 9e0c8c43030bee3ca56198893645bbfd30f2cf37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
%BEGIN(PEPSY)%
/* pepsy.h - definitions for pepsy */
%END(PEPSY)%
%BEGIN(PEPY)%
/* pepy.h - definitions for pepy */
%END(PEPY)%
%BEGIN(ROSY)%
/* rosy-defs.h - definitions for rosy */
%END(ROSY)%
%BEGIN(MOSY)%
/* mosy-defs.h - definitions for mosy */
%END(MOSY)%
/* %WARNING% */

/* 
 * $Header$
 *
 *
 * $Log$
 * Revision 1.1  1994/06/10 03:31:20  eichin
 * autoconfed isode for kerberos work
 *
# Revision 1.1  1994/05/31 20:40:08  eichin
# reduced-isode release from /mit/isode/isode-subset/src
#
 * Revision 8.0  91/07/17  12:43:09  isode
 * Release 7.0
 * 
 *
 */

/*
 *				  NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#include "psap.h"

struct tuple {
    int     t_type;
    char   *t_class;
    char   *t_form;
    char   *t_id;
    PElementClass t_classnum;
    int	    t_idnum;
};

typedef struct ypv {
    int     yv_code;
#define	YV_UNDF		0x00	/* ??? */
#define	YV_NUMBER	0x01	/* LITNUMBER */
#define	YV_BOOL		0x02	/* TRUE | FALSE */
#define	YV_STRING	0x03	/* LITSTRING */
#define	YV_IDEFINED	0x04	/* ID */
#define	YV_IDLIST	0x05	/* IdentifierList */
#define	YV_VALIST	0x06	/* { Values } */
#define	YV_NULL		0x07	/* NULL */
#define YV_ABSENT	0x08	/* WITH COMPONENTS .. ABSENT */
#define YV_PRESENT	0x09	/*  "	"	   .. PRESENT */
#define YV_INCLUDES	0x0a	/* INCLUDES ... */
#define YV_WITHCOMPS	0x0b	/* WITH COMPONENTS */
#define	YV_OIDLIST	0x0c	/* { object identifier } */
#define YV_REAL		0x0d	/* real value */

    union {
	int	    yv_un_number;		/* code = YV_NUMBER
						   code = YV_BOOL */

	double	    yv_un_real;			/* code = YV_REAL */

	char	   *yv_un_string;		/* code = YV_STRING */

	struct {				/* code = YV_IDEFINED */
	    char   *yv_st_module;
	    char   *yv_st_modid;
	    char   *yv_st_identifier;
	}		yv_st;

        struct ypv *yv_un_idlist;		/* code = YV_IDLIST
						   code = YV_VALIST
						   code = YV_OIDLIST */
    }                   yv_un;
#define	yv_number	yv_un.yv_un_number
#define	yv_string	yv_un.yv_un_string
#define	yv_identifier	yv_un.yv_st.yv_st_identifier
#define	yv_module	yv_un.yv_st.yv_st_module
#define yv_modid	yv_un.yv_st.yv_st_modid
#define yv_idlist	yv_un.yv_un_idlist
#define yv_real		yv_un.yv_un_real

    char   *yv_action;
    int	    yv_act_lineno;

    int	    yv_flags;
#define	YV_NOFLAGS	0x00	/* no flags */
#define	YV_ID		0x01	/* ID Value */
#define	YV_NAMED	0x02	/* NamedNumber */
#define	YV_TYPE		0x04	/* TYPE Value */
#define	YV_BOUND	0x08	/* named value */
#define	YVBITS	"\020\01ID\02NAMED\03TYPE\04BOUND"

    char   *yv_id;				/* flags & YV_ID */

    char   *yv_named;				/* flags & YV_NAMED */

    struct ype *yv_type;			/* flags & YV_TYPE */

    struct ypv *yv_next;
}			ypv, *YV;
#define	NULLYV	((YV) 0)

YV	new_value (), add_value (), copy_value ();

/*  */

typedef struct ypt {
    PElementClass   yt_class;

    YV		    yt_value;
}			ypt, *YT;
#define	NULLYT	((YT) 0)

YT	new_tag (), copy_tag ();

/*  */

typedef struct ype {
    int     yp_code;
#define	YP_UNDF		0x00	/* type not yet known */
#define	YP_BOOL		0x01	/* BOOLEAN */
#define	YP_INT		0x02	/* INTEGER */
#define	YP_INTLIST	0x03	/* INTEGER [ NamedNumberList ] */
#define	YP_BIT		0x04	/* BITSTRING */
#define	YP_BITLIST	0x05	/* BITSTRING [ NamedNumberList ] */
#define	YP_OCT		0x06	/* OCTETSTRING */
#define	YP_NULL		0x07	/* NULL */
#define	YP_SEQ		0x08	/* SEQUENCE */
#define	YP_SEQTYPE	0x09	/* SEQUENCE OF Type */
#define	YP_SEQLIST	0x0a	/* SEQUENCE [ ElementTypes ] */
#define	YP_SET		0x0b	/* SET */
#define	YP_SETTYPE	0x0c	/* SET OF Type */
#define	YP_SETLIST	0x0d	/* SET [ MemberTypes ] */
#define	YP_CHOICE	0x0e	/* CHOICE [ AlternativeTypeList ] */
#define	YP_ANY		0x0f	/* ANY */
#define	YP_OID		0x10	/* OBJECT IDENTIFIER */
#define	YP_IDEFINED	0x11	/* identifier */
#define YP_ENUMLIST	0x12	/* ENUMERATED */
#define YP_REAL		0x13	/* Real (floating-point) */

    int     yp_direction;
#define YP_DECODER	0x01
#define YP_ENCODER	0x02
#define	YP_PRINTER	0x04

    union {
	struct {				/* code = YP_IDEFINED */
	    char   *yp_st_module;		    /* module name */
	    OID	    yp_st_modid;		    /* module id */
	    char   *yp_st_identifier;		    /* definition name */
	}		yp_st;

	struct ype *yp_un_type;			/* code = YP_SEQTYPE
						   code = YP_SEQLIST
						   code = YP_SETTYPE
						   code = YP_SETLIST
						   code = YP_CHOICE */

	YV	    yp_un_value;		/* code = YP_INTLIST
						   code = YP_BITLIST */
    }                   yp_un;
#define	yp_identifier	yp_un.yp_st.yp_st_identifier
#define	yp_module	yp_un.yp_st.yp_st_module
#define yp_modid	yp_un.yp_st.yp_st_modid
#define	yp_type		yp_un.yp_un_type
#define	yp_value	yp_un.yp_un_value

    char   *yp_intexp;		/* expressions to pass (use) as extra */
    char   *yp_strexp;		/* parameters (primitive values) */
    char    yp_prfexp;

    char   *yp_declexp;
    char   *yp_varexp;

    char   *yp_structname;
    char   *yp_ptrname;

    char   *yp_param_type;

    char   *yp_action0;
    int     yp_act0_lineno;

    char   *yp_action05;
    int	    yp_act05_lineno;

    char   *yp_action1;
    int	    yp_act1_lineno;

    char   *yp_action2;
    int	    yp_act2_lineno;

    char   *yp_action3;
    int	    yp_act3_lineno;

    int     yp_flags;
#define	YP_NOFLAGS	0x0000	/* no flags */
#define	YP_OPTIONAL	0x0001	/* OPTIONAL */
#define	YP_COMPONENTS	0x0002	/* COMPONENTS OF */
#define	YP_IMPLICIT	0x0004	/* IMPLICIT */
#define	YP_DEFAULT	0x0008	/* DEFAULT */
#define	YP_ID		0x0010	/* ID */
#define	YP_TAG		0x0020	/* Tag */
#define	YP_BOUND	0x0040	/* ID LANGLE */
#define	YP_PULLEDUP	0x0080	/* member is a choice */
#define YP_PARMVAL	0x0100	/* value to be passed to parm is present */
#define YP_CONTROLLED	0x0200	/* encoding item has a controller */
#define	YP_OPTCONTROL	0x0400	/*   .. */
#define	YP_ACTION1	0x0800	/* action1 acted upon */
#define	YP_PARMISOID	0x1000	/* value to be passed to parm is OID */
#define YP_ENCRYPTED	0x2000	/* encypted - which is a bit hazy */
#define YP_IMPORTED	0x4000  /* value imported from another module */
#define YP_EXPORTED	0x8000  /* value exported to another module */
#define	YPBITS	"\020\01OPTIONAL\02COMPONENTS\03IMPLICIT\04DEFAULT\05ID\06TAG\
\07BOUND\010PULLEDUP\011PARMVAL\012CONTROLLED\013OPTCONTROL\
\014ACTION1\015PARMISOID\016ENCRYPTED\017IMPORTED\020EXPORTED"

    YV	    yp_default;				/* flags & YP_DEFAULT */

    char   *yp_id;				/* flags & YP_ID */

    YT	    yp_tag;				/* flags & YP_TAG */

    char   *yp_bound;				/* flags & YP_BOUND */

    char   *yp_parm;				/* flags & YP_PARMVAL */

    char   *yp_control;				/* flags & YP_CONTROLLED */

    char   *yp_optcontrol;			/* flags & YP_OPTCONTROL */

    char   *yp_offset;

    struct ype *yp_next;
} 			ype, *YP;
#define	NULLYP	((YP) 0)

YP	new_type (), add_type (), copy_type ();

char   *new_string ();

#define	TBL_EXPORT	0
#define TBL_IMPORT	1
#define MAX_TBLS	2

extern int tagcontrol;
#define TAG_UNKNOWN 	0
#define TAG_IMPLICIT	1
#define TAG_EXPLICIT	2

#define CH_FULLY	0
#define CH_PARTIAL	1

typedef struct yop {
    char   *yo_name;

    YP	    yo_arg;
    YP	    yo_result;
    YV	    yo_errors;
    YV	    yo_linked;

    int	    yo_opcode;
}		yop, *YO;
#define	NULLYO	((YO) 0)


typedef struct yerr {
    char   *ye_name;

    YP	    ye_param;

    int	    ye_errcode;

    int	    ye_offset;
}	    yerr, *YE;
#define	NULLYE	((YE) 0)

/*  */

%BEGIN(PEPSY)%
extern char *pepsyversion;
%END(PEPSY)%
%BEGIN(PEPY)%
extern char *pepyversion;
%END(PEPY)%
%BEGIN(ROSY)%
extern char *rosyversion;
%END(ROSY)%
%BEGIN(MOSY)%
extern char *mosyversion;
%END(MOSY)%

extern int yysection;
extern char *yyencpref;
extern char *yydecpref;
extern char *yyprfpref;
extern char *yyencdflt;
extern char *yydecdflt;
extern char *yyprfdflt;

extern int yydebug;
extern int yylineno;

#ifndef	HPUX
extern char yytext[];
#else
extern unsigned char yytext[];
#endif

extern char *mymodule;

extern OID   mymoduleid;

extern char *bflag;
extern int   Cflag;
extern int   dflag;
extern int   Pflag;
extern char *sysin;

extern char *module_actions;

OID	addoid ();
OID	int2oid ();
OID	oidlookup ();
char	*oidname ();
char	*oidprint ();

extern int errno;