]>
git.cameronkatri.com Git - apple_cmds.git/blob - developer_cmds/rpcgen/rpc_util.h
1 /* $NetBSD: rpc_util.h,v 1.4 1997/10/11 21:01:58 christos Exp $ */
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user or with the express written consent of
9 * Sun Microsystems, Inc.
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15 * Sun RPC is provided with no support and without any obligation on the
16 * part of Sun Microsystems, Inc. to assist in its use, correction,
17 * modification or enhancement.
19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21 * OR ANY PART THEREOF.
23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24 * or profits or other special, indirect and consequential damages, even if
25 * Sun has been advised of the possibility of such damages.
27 * Sun Microsystems, Inc.
29 * Mountain View, California 94043
32 /* @(#)rpc_util.h 1.5 90/08/29 (C) 1987 SMI */
35 * rpc_util.h, Useful definitions for the RPC protocol compiler
37 #include <sys/types.h>
40 #define alloc(size) (void *)malloc((unsigned)(size))
41 #define ALLOC(object) (object *) malloc(sizeof(object))
43 #define s_print (void) sprintf
44 #define f_print (void) fprintf
50 typedef struct list list
;
58 #define MAXLINESIZE 1024
59 extern char curline
[MAXLINESIZE
];
63 extern char *infilename
;
70 extern bas_type
*typ_list_h
;
71 extern bas_type
*typ_list_t
;
74 * All the option flags
81 extern int Cflag
; /* C++ flag */
82 extern int tirpcflag
; /* flag for generating tirpc code */
83 extern int doinline
; /* if this is 0, then do not generate inline code */
84 extern int callerflag
;
87 * Other flags related with inetd jumpstart.
89 extern int indefinitewait
;
93 extern int nonfatalerrors
;
95 extern pid_t childpid
;
101 #define STOREVAL(list,item) \
104 #define FINDVAL(list,item,finder) \
105 findval(list, item, finder)
107 void reinitialize
__P((void));
108 int streq
__P((char *, char *));
109 definition
*findval
__P((list
*, char *, int (*)(definition
*, char *)));
110 void storeval
__P((list
**, definition
*));
111 char *fixtype
__P((char *));
112 char *stringfix
__P((char *));
113 void ptype
__P((char *, char *, int));
114 int isvectordef
__P((char *, relation
));
115 char *locase
__P((char *));
116 void pvname_svc
__P((char *, char *));
117 void pvname
__P((char *, char *));
118 void error
__P((char *));
119 void crash
__P((void));
120 void record_open
__P((char *));
121 void expected1
__P((tok_kind
));
122 void expected2
__P((tok_kind
, tok_kind
));
123 void expected3
__P((tok_kind
, tok_kind
, tok_kind
));
124 void tabify
__P((FILE *, int));
125 void record_open
__P((char *));
126 char *make_argname
__P((char *, char *));
127 void add_type
__P((int, char *));
128 bas_type
*find_type
__P((char *));
132 void emit
__P((definition
*));
133 void emit_inline
__P((declaration
*, int));
134 void emit_single_in_line
__P((declaration
*, int, relation
));
135 char *upcase
__P((char *));
141 void print_datadef
__P((definition
*));
142 void print_funcdef
__P((definition
*));
143 void pxdrfuncdecl
__P((char *, int));
144 void pprocdef
__P((proc_list
*, version_list
*, char *, int, int));
145 void pdeclaration
__P((char *, declaration
*, int, char *));
148 * rpc_svcout routines
150 void write_most
__P((char *, int, int));
151 void write_netid_register
__P((char *));
152 void write_nettype_register
__P((char *));
153 void write_rest
__P((void));
154 void write_programs
__P((char *));
155 int nullproc
__P((proc_list
*));
156 void write_svc_aux
__P((int));
157 void write_msg_out
__P((void));
158 void write_inetd_register
__P((char *));
161 * rpc_clntout routines
163 void write_stubs
__P((void));
164 void printarglist
__P((proc_list
*, char *, char *));
168 * rpc_tblout routines
170 void write_tables
__P((void));
173 * rpc_sample routines
175 void write_sample_svc
__P((definition
*));
176 int write_sample_clnt
__P((definition
*));
177 void add_sample_msg
__P((void));
178 void write_sample_clnt_main
__P((void));