]> git.ipfire.org Git - thirdparty/glibc.git/blob - sunrpc/rpc_parse.h
Once again change RPC copyright notices.
[thirdparty/glibc.git] / sunrpc / rpc_parse.h
1 /* @(#)rpc_parse.h 1.3 90/08/29
2
3 /*
4 * Copyright (c) 2010, Oracle America, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 * * Neither the name of the "Oracle America, Inc." nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * rpc_parse.h, Definitions for the RPCL parser
33 */
34
35 enum defkind {
36 DEF_CONST,
37 DEF_STRUCT,
38 DEF_UNION,
39 DEF_ENUM,
40 DEF_TYPEDEF,
41 DEF_PROGRAM
42 };
43 typedef enum defkind defkind;
44
45 typedef const char *const_def;
46
47 enum relation {
48 REL_VECTOR, /* fixed length array */
49 REL_ARRAY, /* variable length array */
50 REL_POINTER, /* pointer */
51 REL_ALIAS /* simple */
52 };
53 typedef enum relation relation;
54
55 struct typedef_def {
56 const char *old_prefix;
57 const char *old_type;
58 relation rel;
59 const char *array_max;
60 };
61 typedef struct typedef_def typedef_def;
62
63 struct enumval_list {
64 const char *name;
65 const char *assignment;
66 struct enumval_list *next;
67 };
68 typedef struct enumval_list enumval_list;
69
70 struct enum_def {
71 enumval_list *vals;
72 };
73 typedef struct enum_def enum_def;
74
75 struct declaration {
76 const char *prefix;
77 const char *type;
78 const char *name;
79 relation rel;
80 const char *array_max;
81 };
82 typedef struct declaration declaration;
83
84 struct decl_list {
85 declaration decl;
86 struct decl_list *next;
87 };
88 typedef struct decl_list decl_list;
89
90 struct struct_def {
91 decl_list *decls;
92 };
93 typedef struct struct_def struct_def;
94
95 struct case_list {
96 const char *case_name;
97 int contflag;
98 declaration case_decl;
99 struct case_list *next;
100 };
101 typedef struct case_list case_list;
102
103 struct union_def {
104 declaration enum_decl;
105 case_list *cases;
106 declaration *default_decl;
107 };
108 typedef struct union_def union_def;
109
110 struct arg_list {
111 const char *argname; /* name of struct for arg*/
112 decl_list *decls;
113 };
114
115 typedef struct arg_list arg_list;
116
117 struct proc_list {
118 const char *proc_name;
119 const char *proc_num;
120 arg_list args;
121 int arg_num;
122 const char *res_type;
123 const char *res_prefix;
124 struct proc_list *next;
125 };
126 typedef struct proc_list proc_list;
127
128 struct version_list {
129 const char *vers_name;
130 const char *vers_num;
131 proc_list *procs;
132 struct version_list *next;
133 };
134 typedef struct version_list version_list;
135
136 struct program_def {
137 const char *prog_num;
138 version_list *versions;
139 };
140 typedef struct program_def program_def;
141
142 struct definition {
143 const char *def_name;
144 defkind def_kind;
145 union {
146 const_def co;
147 struct_def st;
148 union_def un;
149 enum_def en;
150 typedef_def ty;
151 program_def pr;
152 } def;
153 };
154 typedef struct definition definition;
155
156 definition *get_definition(void);
157
158
159 struct bas_type
160 {
161 const char *name;
162 int length;
163 struct bas_type *next;
164 };
165
166 typedef struct bas_type bas_type;