Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / rxgen / rpc_parse.h
1 /* @(#)rpc_parse.h 1.3 87/03/09 (C) 1987 SMI */
2 /*
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user.
9 *
10 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 *
14 * Sun RPC is provided with no support and without any obligation on the
15 * part of Sun Microsystems, Inc. to assist in its use, correction,
16 * modification or enhancement.
17 *
18 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 * OR ANY PART THEREOF.
21 *
22 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 * or profits or other special, indirect and consequential damages, even if
24 * Sun has been advised of the possibility of such damages.
25 *
26 * Sun Microsystems, Inc.
27 * 2550 Garcia Avenue
28 * Mountain View, California 94043
29 */
30
31 /*
32 * rpc_parse.h, Definitions for the RPCL parser
33 * Copyright (C) 1987, Sun Microsystems, Inc.
34 */
35
36 enum defkind {
37 DEF_INPARAM,
38 DEF_OUTPARAM,
39 DEF_INOUTPARAM,
40 DEF_PACKAGE,
41 DEF_PREFIX,
42 DEF_PARAM,
43 DEF_SPECIAL,
44 DEF_STARTINGOPCODE,
45 DEF_CUSTOMIZED,
46 DEF_SPLITPREFIX,
47 DEF_PROC,
48 DEF_NULL,
49 DEF_CONST,
50 DEF_STRUCT,
51 DEF_UNION,
52 DEF_ENUM,
53 DEF_TYPEDEF,
54 };
55 typedef enum defkind defkind;
56
57 typedef char *const_def;
58
59 enum relation {
60 REL_VECTOR, /* fixed length array */
61 REL_ARRAY, /* variable length array */
62 REL_POINTER, /* pointer */
63 REL_ALIAS /* simple */
64 };
65 typedef enum relation relation;
66
67 struct typedef_def {
68 char *old_prefix;
69 char *old_type;
70 relation rel;
71 char *array_max;
72 };
73 typedef struct typedef_def typedef_def;
74
75
76 struct enumval_list {
77 char *name;
78 char *assignment;
79 struct enumval_list *next;
80 };
81 typedef struct enumval_list enumval_list;
82
83 struct enum_def {
84 enumval_list *vals;
85 };
86 typedef struct enum_def enum_def;
87
88
89 struct declaration {
90 char *prefix;
91 char *type;
92 char *name;
93 relation rel;
94 char *array_max;
95 };
96 typedef struct declaration declaration;
97
98
99 struct decl_list {
100 declaration decl;
101 struct decl_list *next;
102 };
103 typedef struct decl_list decl_list;
104
105 struct struct_def {
106 decl_list *decls;
107 };
108 typedef struct struct_def struct_def;
109
110
111 struct case_list {
112 char *case_name;
113 declaration case_decl;
114 struct case_list *next;
115 };
116 typedef struct case_list case_list;
117
118 struct union_def {
119 declaration enum_decl;
120 case_list *cases;
121 declaration *default_decl;
122 };
123 typedef struct union_def union_def;
124
125 struct param_list {
126 defkind param_kind;
127 char *param_name;
128 char *param_type;
129 char *string_name;
130 #define INDIRECT_PARAM 1
131 #define PROCESSED_PARAM 2
132 #define ARRAYNAME_PARAM 4
133 #define ARRAYSIZE_PARAM 8
134 #define FREETHIS_PARAM 16
135 #define OUT_STRING 32
136 char param_flag;
137 };
138 typedef struct param_list param_list;
139
140 struct proc1_list {
141 defkind component_kind;
142 char *code, *scode;
143 param_list pl;
144 struct proc1_list *next;
145 };
146 typedef struct proc1_list proc1_list;
147
148 struct procedure_def {
149 char *proc_name;
150 char *proc_prefix;
151 char *proc_opcodename;
152 int proc_opcodenum;
153 char *proc_serverstub;
154 #undef IN
155 #define IN 0
156 #undef OUT
157 #define OUT 1
158 #undef INOUT
159 #define INOUT 2
160 short paramtypes[3];
161 char split_flag;
162 char multi_flag;
163 relation rel;
164 proc1_list *plists;
165 };
166 typedef struct procedure_def procedure_def;
167
168 struct special_def {
169 char *string_name;
170 char *string_value;
171 };
172 typedef struct special_def special_def;
173
174 struct spec_list {
175 special_def sdef;
176 struct spec_list *next;
177 };
178 typedef struct spec_list spec_list;
179
180 struct spec_def {
181 spec_list *specs;
182 };
183 typedef struct spec_def spec_def;
184
185 struct definition {
186 char *def_name;
187 defkind def_kind;
188 union {
189 const_def co;
190 struct_def st;
191 union_def un;
192 enum_def en;
193 typedef_def ty;
194 spec_def sd;
195 } def;
196 procedure_def pc;
197 int can_fail;
198 int statindex;
199 };
200 typedef struct definition definition;