4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
29 * University Copyright- Copyright (c) 1982, 1986, 1988
30 * The Regents of the University of California
33 * University Acknowledgment- Portions of this document are derived from
34 * software developed by the University of California, Berkeley, and its
41 #include <sys/types.h>
50 * rpc_util.h, Useful definitions for the RPC protocol compiler
54 /* Current version number of rpcgen. */
55 #define RPCGEN_MAJOR 1
56 #define RPCGEN_MINOR 1
58 #define f_print (void) fprintf
64 typedef struct list list
;
71 typedef struct xdrfunc xdrfunc
;
74 int cflag
; /* xdr C routines */
75 int hflag
; /* header file */
76 int lflag
; /* client side stubs */
77 int mflag
; /* server side stubs */
78 int nflag
; /* netid flag */
79 int sflag
; /* server stubs for the given transport */
80 int tflag
; /* dispatch Table file */
81 int Ssflag
; /* produce server sample code */
82 int Scflag
; /* produce client sample code */
83 int makefileflag
; /* Generate a template Makefile */
84 char *infile
; /* input module name */
85 char *outfile
; /* output module name */
94 #define MAXLINESIZE 1024
95 extern char curline
[MAXLINESIZE
];
99 extern char *infilename
;
103 extern list
*defined
;
105 extern bas_type
*typ_list_h
;
106 extern bas_type
*typ_list_t
;
107 extern xdrfunc
*xdrfunc_head
, *xdrfunc_tail
;
110 * All the option flags
112 extern int inetdflag
;
117 extern int Cflag
; /* ANSI-C/C++ flag */
118 extern int CCflag
; /* C++ flag */
119 extern int tirpcflag
; /* flag for generating tirpc code */
120 extern int inlinelen
; /* if this is 0, then do not generate inline code */
126 * Other flags related with inetd jumpstart.
128 extern int indefinitewait
;
130 extern int timerflag
;
132 extern int nonfatalerrors
;
134 extern pid_t childpid
;
139 extern void storeval(list
**, definition
*);
141 #define STOREVAL(list, item) \
144 extern definition
*findval(list
*, char *, int (*)());
146 #define FINDVAL(list, item, finder) \
147 findval(list, item, finder)
149 extern char *fixtype(char *);
150 extern char *stringfix(char *);
151 extern char *locase(char *);
152 extern void pvname_svc(char *, char *);
153 extern void pvname(char *, char *);
154 extern void ptype(char *, char *, int);
155 extern int isvectordef(char *, relation
);
156 extern int streq(char *, char *);
157 extern void error(char *);
158 extern void expected1(tok_kind
);
159 extern void expected2(tok_kind
, tok_kind
);
160 extern void expected3(tok_kind
, tok_kind
, tok_kind
);
161 extern void tabify(FILE *, int);
162 extern void record_open(char *);
163 extern bas_type
*find_type(char *);
168 extern void emit(definition
*);
173 extern void print_datadef(definition
*);
174 extern void print_funcdef(definition
*);
175 extern void print_xdr_func_def(char *, int, int);
178 * rpc_svcout routines
180 extern void write_most(char *, int, int);
181 extern void write_rest(void);
182 extern void write_inetd_register(char *);
183 extern void write_netid_register(char *);
184 extern void write_nettype_register(char *);
187 * rpc_clntout routines
189 extern void write_stubs(void);
192 * rpc_tblout routines
194 extern void write_tables(void);
200 #endif /* !_RPC_UTIL_H */