2 * Copyright (c) 2009, Sun Microsystems, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
29 /* @(#)rpc_util.h 1.5 90/08/29 (C) 1987 SMI */
32 * rpc_util.h, Useful definitions for the RPC protocol compiler
37 #define alloc(size) malloc((unsigned)(size))
38 #define ALLOC(object) (object *) malloc(sizeof(object))
40 #define s_print (void) sprintf
41 #define f_print (void) fprintf
47 typedef struct list list;
55 #define MAXLINESIZE 1024
56 extern char curline[MAXLINESIZE];
60 extern char *infilename;
67 extern bas_type *typ_list_h;
68 extern bas_type *typ_list_t;
71 * All the option flags
78 extern int Cflag; /* C++ flag */
79 extern int tirpcflag; /* flag for generating tirpc code */
80 extern int Inline; /* if this is 0, then do not generate inline code */
83 * Other flags related with inetd jumpstart.
85 extern int indefinitewait;
89 extern int nonfatalerrors;
96 #define STOREVAL(list,item) \
99 definition *findval();
101 #define FINDVAL(list,item,finder) \
102 findval(list, item, finder)
109 void emit(definition *);
114 void print_datadef(definition *);
115 void print_funcdef(definition *);
118 * rpc_svcout routines
120 void write_most(char *, int, int);
121 void write_register(void);
122 void write_netid_register(char *);
123 void write_nettype_register(char *);
124 void write_inetd_register(char *);
125 void write_rest(void);
126 void write_programs(char *);
127 void write_svc_aux(int);
130 * rpc_clntout routines
132 void write_stubs(void);
133 void printarglist(proc_list *, char *, char *);
136 * rpc_tblout routines
138 void write_tables(void);
143 void pvname_svc(char *, char *);
144 void pvname(char *, char *);
145 void ptype(char *, char *, int);
146 char * make_argname(char *, char *);
147 void add_type(int, char *);
148 void reinitialize(void);
151 char *fixtype(char *);
152 char *stringfix(char *);
153 char *locase(char *);
154 int isvectordef(char *, relation);
155 int streq(char *, char *);
156 void tabify(FILE *, int);
157 void record_open(char *);
158 bas_type *find_type(char *type);
163 void write_sample_svc(definition *);
164 int write_sample_clnt(definition *);
165 void write_sample_clnt_main(void);
166 void add_sample_msg(void);