rpc_util.h revision 1.8 1 1.8 christos /* $NetBSD: rpc_util.h,v 1.8 2013/12/15 00:40:17 christos 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.8 christos extern int BSDflag;
78 1.3 pk extern int logflag;
79 1.3 pk extern int newstyle;
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.8 christos void reinitialize(void);
105 1.8 christos int streq(const char *, const char *);
106 1.8 christos definition *findval(list *, const char *,
107 1.8 christos int (*)(definition *, const char *));
108 1.8 christos void storeval(list **, definition *);
109 1.8 christos const char *fixtype(const char *);
110 1.8 christos const char *stringfix(const char *);
111 1.8 christos void ptype(const char *, const char *, int);
112 1.8 christos int isvectordef(const char *, relation);
113 1.8 christos char *locase(const char *);
114 1.8 christos void pvname_svc(const char *, const char *);
115 1.8 christos void pvname(const char *, const char *);
116 1.7 joerg void error(const char *) __dead;
117 1.7 joerg void crash(void) __dead;
118 1.8 christos void record_open(const char *);
119 1.7 joerg void expected1(tok_kind) __dead;
120 1.7 joerg void expected2(tok_kind, tok_kind) __dead;
121 1.7 joerg void expected3(tok_kind, tok_kind, tok_kind) __dead;
122 1.8 christos void tabify(FILE *, int);
123 1.8 christos char *make_argname(const char *, const char *);
124 1.8 christos void add_type(int, const char *);
125 1.8 christos bas_type *find_type(const char *);
126 1.1 glass /*
127 1.1 glass * rpc_cout routines
128 1.1 glass */
129 1.8 christos void emit(definition *);
130 1.8 christos void emit_inline(declaration *, int);
131 1.8 christos void emit_single_in_line(declaration *, int, relation);
132 1.8 christos char *upcase(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.8 christos void print_datadef(definition *);
139 1.8 christos void print_progdef(definition *);
140 1.8 christos void print_funcdef(definition *, int *);
141 1.8 christos void print_funcend(int);
142 1.8 christos void pxdrfuncdecl(const char *, int);
143 1.8 christos void pprocdef(proc_list *, version_list *, const char *, int);
144 1.8 christos void pdeclaration(const char *, declaration *, int, const char *);
145 1.1 glass
146 1.1 glass /*
147 1.1 glass * rpc_svcout routines
148 1.1 glass */
149 1.8 christos void write_most(char *, int, int);
150 1.8 christos void write_netid_register(const char *);
151 1.8 christos void write_nettype_register(const char *);
152 1.8 christos void write_rest(void);
153 1.8 christos void write_programs(const char *);
154 1.8 christos int nullproc(proc_list *);
155 1.8 christos void write_svc_aux(int);
156 1.8 christos void write_msg_out(void);
157 1.8 christos void write_inetd_register(const char *);
158 1.4 christos
159 1.3 pk /*
160 1.3 pk * rpc_clntout routines
161 1.3 pk */
162 1.8 christos void write_stubs(void);
163 1.8 christos void printarglist(proc_list *, const char *, const char *, const char *);
164 1.3 pk
165 1.3 pk
166 1.3 pk /*
167 1.3 pk * rpc_tblout routines
168 1.3 pk */
169 1.8 christos void write_tables(void);
170 1.1 glass
171 1.1 glass /*
172 1.3 pk * rpc_sample routines
173 1.1 glass */
174 1.8 christos void write_sample_svc(definition *);
175 1.8 christos int write_sample_clnt(definition *);
176 1.8 christos void add_sample_msg(void);
177 1.8 christos void write_sample_clnt_main(void);
178