rpc_util.h revision 1.6 1 1.6 dholland /* $NetBSD: rpc_util.h,v 1.6 2013/08/11 08:03:10 dholland Exp $ */
2 1.1 glass /*
3 1.1 glass * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 1.1 glass * unrestricted use provided that this legend is included on all tape
5 1.1 glass * media and as a part of the software program in whole or part. Users
6 1.1 glass * may copy or modify Sun RPC without charge, but are not authorized
7 1.1 glass * to license or distribute it to anyone else except as part of a product or
8 1.3 pk * program developed by the user or with the express written consent of
9 1.3 pk * Sun Microsystems, Inc.
10 1.3 pk *
11 1.1 glass * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 1.1 glass * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 1.1 glass * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 1.3 pk *
15 1.1 glass * Sun RPC is provided with no support and without any obligation on the
16 1.1 glass * part of Sun Microsystems, Inc. to assist in its use, correction,
17 1.1 glass * modification or enhancement.
18 1.3 pk *
19 1.1 glass * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20 1.1 glass * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21 1.1 glass * OR ANY PART THEREOF.
22 1.3 pk *
23 1.1 glass * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24 1.1 glass * or profits or other special, indirect and consequential damages, even if
25 1.1 glass * Sun has been advised of the possibility of such damages.
26 1.3 pk *
27 1.1 glass * Sun Microsystems, Inc.
28 1.1 glass * 2550 Garcia Avenue
29 1.1 glass * Mountain View, California 94043
30 1.1 glass */
31 1.1 glass
32 1.3 pk /* @(#)rpc_util.h 1.5 90/08/29 (C) 1987 SMI */
33 1.3 pk
34 1.1 glass /*
35 1.1 glass * rpc_util.h, Useful definitions for the RPC protocol compiler
36 1.1 glass */
37 1.1 glass
38 1.3 pk #define alloc(size) (void *)malloc((unsigned)(size))
39 1.1 glass #define ALLOC(object) (object *) malloc(sizeof(object))
40 1.1 glass
41 1.1 glass #define s_print (void) sprintf
42 1.1 glass #define f_print (void) fprintf
43 1.1 glass
44 1.1 glass struct list {
45 1.3 pk definition *val;
46 1.1 glass struct list *next;
47 1.1 glass };
48 1.1 glass typedef struct list list;
49 1.1 glass
50 1.3 pk #define PUT 1
51 1.3 pk #define GET 2
52 1.3 pk
53 1.1 glass /*
54 1.1 glass * Global variables
55 1.1 glass */
56 1.1 glass #define MAXLINESIZE 1024
57 1.1 glass extern char curline[MAXLINESIZE];
58 1.1 glass extern char *where;
59 1.1 glass extern int linenum;
60 1.1 glass
61 1.6 dholland extern const char *infilename;
62 1.1 glass extern FILE *fout;
63 1.1 glass extern FILE *fin;
64 1.1 glass
65 1.1 glass extern list *defined;
66 1.1 glass
67 1.3 pk
68 1.3 pk extern bas_type *typ_list_h;
69 1.3 pk extern bas_type *typ_list_t;
70 1.3 pk
71 1.3 pk /*
72 1.3 pk * All the option flags
73 1.3 pk */
74 1.3 pk extern int inetdflag;
75 1.3 pk extern int pmflag;
76 1.3 pk extern int tblflag;
77 1.3 pk extern int logflag;
78 1.3 pk extern int newstyle;
79 1.3 pk extern int Cflag; /* C++ flag */
80 1.5 mycroft extern int Mflag; /* multithread flag */
81 1.3 pk extern int tirpcflag; /* flag for generating tirpc code */
82 1.4 christos extern int doinline; /* if this is 0, then do not generate inline code */
83 1.3 pk extern int callerflag;
84 1.3 pk
85 1.3 pk /*
86 1.3 pk * Other flags related with inetd jumpstart.
87 1.3 pk */
88 1.3 pk extern int indefinitewait;
89 1.3 pk extern int exitnow;
90 1.3 pk extern int timerflag;
91 1.3 pk
92 1.3 pk extern int nonfatalerrors;
93 1.3 pk
94 1.1 glass /*
95 1.1 glass * rpc_util routines
96 1.1 glass */
97 1.1 glass
98 1.1 glass #define STOREVAL(list,item) \
99 1.3 pk storeval(list,item)
100 1.1 glass
101 1.1 glass #define FINDVAL(list,item,finder) \
102 1.3 pk findval(list, item, finder)
103 1.1 glass
104 1.4 christos void reinitialize __P((void));
105 1.6 dholland int streq __P((const char *, const char *));
106 1.6 dholland definition *findval __P((list *, const char *,
107 1.6 dholland int (*)(definition *, const char *)));
108 1.4 christos void storeval __P((list **, definition *));
109 1.6 dholland const char *fixtype __P((const char *));
110 1.6 dholland const char *stringfix __P((const char *));
111 1.6 dholland void ptype __P((const char *, const char *, int));
112 1.6 dholland int isvectordef __P((const char *, relation));
113 1.6 dholland char *locase __P((const char *));
114 1.6 dholland void pvname_svc __P((const char *, const char *));
115 1.6 dholland void pvname __P((const char *, const char *));
116 1.6 dholland void error __P((const char *));
117 1.4 christos void crash __P((void));
118 1.6 dholland void record_open __P((const char *));
119 1.4 christos void expected1 __P((tok_kind));
120 1.4 christos void expected2 __P((tok_kind, tok_kind ));
121 1.4 christos void expected3 __P((tok_kind, tok_kind, tok_kind));
122 1.3 pk void tabify __P((FILE *, int));
123 1.6 dholland char *make_argname __P((const char *, const char *));
124 1.6 dholland void add_type __P((int, const char *));
125 1.6 dholland bas_type *find_type __P((const char *));
126 1.1 glass /*
127 1.1 glass * rpc_cout routines
128 1.1 glass */
129 1.3 pk void emit __P((definition *));
130 1.4 christos void emit_inline __P((declaration *, int));
131 1.4 christos void emit_single_in_line __P((declaration *, int, relation));
132 1.6 dholland char *upcase __P((const char *));
133 1.1 glass
134 1.1 glass /*
135 1.1 glass * rpc_hout routines
136 1.1 glass */
137 1.4 christos
138 1.3 pk void print_datadef __P((definition *));
139 1.3 pk void print_funcdef __P((definition *));
140 1.6 dholland void pxdrfuncdecl __P((const char *, int));
141 1.6 dholland void pprocdef __P((proc_list *, version_list *, const char *, int, int));
142 1.6 dholland void pdeclaration __P((const char *, declaration *, int, const char *));
143 1.1 glass
144 1.1 glass /*
145 1.1 glass * rpc_svcout routines
146 1.1 glass */
147 1.3 pk void write_most __P((char *, int, int));
148 1.6 dholland void write_netid_register __P((const char *));
149 1.6 dholland void write_nettype_register __P((const char *));
150 1.3 pk void write_rest __P((void));
151 1.6 dholland void write_programs __P((const char *));
152 1.4 christos int nullproc __P((proc_list *));
153 1.3 pk void write_svc_aux __P((int));
154 1.4 christos void write_msg_out __P((void));
155 1.6 dholland void write_inetd_register __P((const char *));
156 1.4 christos
157 1.3 pk /*
158 1.3 pk * rpc_clntout routines
159 1.3 pk */
160 1.3 pk void write_stubs __P((void));
161 1.6 dholland void printarglist __P((proc_list *, const char *, const char *, const char *));
162 1.3 pk
163 1.3 pk
164 1.3 pk /*
165 1.3 pk * rpc_tblout routines
166 1.3 pk */
167 1.3 pk void write_tables __P((void));
168 1.1 glass
169 1.1 glass /*
170 1.3 pk * rpc_sample routines
171 1.1 glass */
172 1.3 pk void write_sample_svc __P((definition *));
173 1.3 pk int write_sample_clnt __P((definition *));
174 1.4 christos void add_sample_msg __P((void));
175 1.3 pk void write_sample_clnt_main __P((void));
176