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 or with the express written consent of
8 * Sun Microsystems, Inc.
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.
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.
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.
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.
26 * Sun Microsystems, Inc.
28 * Mountain View, California 94043
31 /* @(#)rpc_util.h 1.5 90/08/29 (C) 1987 SMI */
34 * rpc_util.h, Useful definitions for the RPC protocol compiler
39 #define alloc(size) malloc((unsigned)(size))
40 #define ALLOC(object) (object *) malloc(sizeof(object))
42 #define s_print (void) sprintf
43 #define f_print (void) fprintf
49 typedef struct list list;
57 #define MAXLINESIZE 1024
58 extern char curline[MAXLINESIZE];
62 extern char *infilename;
69 extern bas_type *typ_list_h;
70 extern bas_type *typ_list_t;
73 * All the option flags
80 extern int Cflag; /* C++ flag */
81 extern int tirpcflag; /* flag for generating tirpc code */
82 extern int Inline; /* if this is 0, then do not generate inline code */
85 * Other flags related with inetd jumpstart.
87 extern int indefinitewait;
91 extern int nonfatalerrors;
98 #define STOREVAL(list,item) \
101 definition *findval();
103 #define FINDVAL(list,item,finder) \
104 findval(list, item, finder)
111 void emit(definition *);
116 void print_datadef(definition *);
117 void print_funcdef(definition *);
120 * rpc_svcout routines
122 void write_most(char *, int, int);
123 void write_register(void);
124 void write_netid_register(char *);
125 void write_nettype_register(char *);
126 void write_inetd_register(char *);
127 void write_rest(void);
128 void write_programs(char *);
129 void write_svc_aux(int);
132 * rpc_clntout routines
134 void write_stubs(void);
135 void printarglist(proc_list *, char *, char *);
138 * rpc_tblout routines
140 void write_tables(void);
145 void pvname_svc(char *, char *);
146 void pvname(char *, char *);
147 void ptype(char *, char *, int);
148 char * make_argname(char *, char *);
149 void add_type(int, char *);
150 void reinitialize(void);
153 char *fixtype(char *);
154 char *stringfix(char *);
155 char *locase(char *);
156 int isvectordef(char *, relation);
157 int streq(char *, char *);
158 void tabify(FILE *, int);
159 void record_open(char *);
160 bas_type *find_type(char *type);
165 void write_sample_svc(definition *);
166 int write_sample_clnt(definition *);
167 void write_sample_clnt_main(void);
168 void add_sample_msg(void);