Bring in a transport-independent RPC (TI-RPC).
[dragonfly.git] / usr.bin / rpcgen / rpc_parse.h
bloba24c0df627df763e1bb4fa1ee559dec42d4b606e
1 /*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
29 * @(#)rpc_parse.h 1.10 94/05/15 SMI; 1.3 90/08/29 (C) 1987 SMI
30 * $FreeBSD: src/usr.bin/rpcgen/rpc_parse.h,v 1.7 2005/11/13 21:17:24 dwmalone Exp $
31 * $DragonFly: src/usr.bin/rpcgen/rpc_parse.h,v 1.2 2004/06/19 16:40:36 joerg Exp $
34 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
35 /* All Rights Reserved */
37 /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
38 /* The copyright notice above does not evidence any */
39 /* actual or intended publication of such source code. */
42 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
43 * PROPRIETARY NOTICE (Combined)
45 * This source code is unpublished proprietary information
46 * constituting, or derived under license from AT&T's UNIX(r) System V.
47 * In addition, portions of such source code were derived from Berkeley
48 * 4.3 BSD under license from the Regents of the University of
49 * California.
53 * Copyright Notice
55 * Notice of copyright on this source code product does not indicate
56 * publication.
58 * (c) 1986,1987,1988.1989 Sun Microsystems, Inc
59 * (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
60 * All rights reserved.
64 * rpc_parse.h, Definitions for the RPCL parser
67 enum defkind {
68 DEF_CONST,
69 DEF_STRUCT,
70 DEF_UNION,
71 DEF_ENUM,
72 DEF_TYPEDEF,
73 DEF_PROGRAM
75 typedef enum defkind defkind;
77 typedef const char *const_def;
79 enum relation {
80 REL_VECTOR, /* fixed length array */
81 REL_ARRAY, /* variable length array */
82 REL_POINTER, /* pointer */
83 REL_ALIAS, /* simple */
85 typedef enum relation relation;
87 struct typedef_def {
88 const char *old_prefix;
89 const char *old_type;
90 relation rel;
91 const char *array_max;
93 typedef struct typedef_def typedef_def;
95 struct enumval_list {
96 const char *name;
97 const char *assignment;
98 struct enumval_list *next;
100 typedef struct enumval_list enumval_list;
102 struct enum_def {
103 enumval_list *vals;
105 typedef struct enum_def enum_def;
107 struct declaration {
108 const char *prefix;
109 const char *type;
110 const char *name;
111 relation rel;
112 const char *array_max;
114 typedef struct declaration declaration;
116 struct decl_list {
117 declaration decl;
118 struct decl_list *next;
120 typedef struct decl_list decl_list;
122 struct struct_def {
123 decl_list *decls;
125 typedef struct struct_def struct_def;
127 struct case_list {
128 const char *case_name;
129 int contflag;
130 declaration case_decl;
131 struct case_list *next;
133 typedef struct case_list case_list;
135 struct union_def {
136 declaration enum_decl;
137 case_list *cases;
138 declaration *default_decl;
140 typedef struct union_def union_def;
142 struct arg_list {
143 char *argname; /* name of struct for arg*/
144 decl_list *decls;
147 typedef struct arg_list arg_list;
149 struct proc_list {
150 const char *proc_name;
151 const char *proc_num;
152 arg_list args;
153 int arg_num;
154 const char *res_type;
155 const char *res_prefix;
156 struct proc_list *next;
158 typedef struct proc_list proc_list;
160 struct version_list {
161 const char *vers_name;
162 const char *vers_num;
163 proc_list *procs;
164 struct version_list *next;
166 typedef struct version_list version_list;
168 struct program_def {
169 const char *prog_num;
170 version_list *versions;
172 typedef struct program_def program_def;
174 struct definition {
175 const char *def_name;
176 defkind def_kind;
177 union {
178 const_def co;
179 struct_def st;
180 union_def un;
181 enum_def en;
182 typedef_def ty;
183 program_def pr;
184 } def;
186 typedef struct definition definition;
188 definition *get_definition(void);
190 struct bas_type
192 const char *name;
193 int length;
194 struct bas_type *next;
197 typedef struct bas_type bas_type;