Change bug-glibc-manual@prep.ai.mit.edu to bug-glibc-manual@gnu.org.
[glibc.git] / sunrpc / rpc_util.h
blobbdbe183caa82d940cd8cdf435fec6a754b968761
1 /*
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.
27 * 2550 Garcia Avenue
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
37 #include <stdlib.h>
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
45 struct list {
46 definition *val;
47 struct list *next;
49 typedef struct list list;
51 #define PUT 1
52 #define GET 2
55 * Global variables
57 #define MAXLINESIZE 1024
58 extern char curline[MAXLINESIZE];
59 extern const char *where;
60 extern int linenum;
62 extern const char *infilename;
63 extern FILE *fout;
64 extern FILE *fin;
66 extern list *defined;
69 extern bas_type *typ_list_h;
70 extern bas_type *typ_list_t;
73 * All the option flags
75 extern int inetdflag;
76 extern int pmflag;
77 extern int tblflag;
78 extern int logflag;
79 extern int newstyle;
80 extern int Cflag; /* C++ flag */
81 extern int tirpcflag; /* flag for generating tirpc code */
82 extern int inlineflag; /* if this is 0, then do not generate inline code */
85 * Other flags related with inetd jumpstart.
87 extern int indefinitewait;
88 extern int exitnow;
89 extern int timerflag;
91 extern int nonfatalerrors;
94 * rpc_util routines
96 void storeval(list **lstp, definition *val);
97 #define STOREVAL(list,item) storeval(list,item)
99 definition *findval(list *lst, const char *val,
100 int (*cmp)(const definition *, const char *));
101 #define FINDVAL(list,item,finder) findval(list, item, finder)
103 const char *fixtype(const char *type);
104 const char *stringfix(const char *type);
105 char *locase(const char *str);
106 void pvname_svc(const char *pname, const char *vnum);
107 void pvname(const char *pname, const char *vnum);
108 void ptype(const char *prefix, const char *type, int follow);
109 int isvectordef(const char *type, relation rel);
110 int streq(const char *a, const char *b);
111 void error(const char *msg);
112 void tabify(FILE *f, int tab);
113 void record_open(const char *file);
114 bas_type *find_type(const char *type);
118 * rpc_cout routines
120 void emit(definition *def);
123 * rpc_hout routines
125 void print_datadef(definition *def);
126 void print_funcdef(definition *def);
129 * rpc_svcout routines
131 void write_most(const char *infile, int netflag, int nomain);
132 void write_register(void);
133 void write_rest(void);
134 void write_programs(const char *storage);
135 void write_svc_aux(int nomain);
136 void write_inetd_register(const char *transp);
137 void write_netid_register(const char *);
138 void write_nettype_register(const char *);
140 * rpc_clntout routines
142 void write_stubs(void);
145 * rpc_tblout routines
147 void write_tables(void);