2004-11-03 Marcus Brinkmann <marcus@gnu.org>
[glibc.git] / sunrpc / rpc_util.h
blobcb1ceb9921676018d20af1d73448781f7d71884e
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 struct xdrfunc {
52 char *name;
53 int pointerp;
54 struct xdrfunc *next;
56 typedef struct xdrfunc xdrfunc;
58 #define PUT 1
59 #define GET 2
62 * Global variables
64 #define MAXLINESIZE 1024
65 extern char curline[MAXLINESIZE];
66 extern const char *where;
67 extern int linenum;
69 extern const char *infilename;
70 extern FILE *fout;
71 extern FILE *fin;
73 extern list *defined;
75 extern bas_type *typ_list_h;
76 extern bas_type *typ_list_t;
77 extern xdrfunc *xdrfunc_head, *xdrfunc_tail;
80 * All the option flags
82 extern int inetdflag;
83 extern int pmflag;
84 extern int tblflag;
85 extern int logflag;
86 extern int newstyle;
87 extern int Cflag; /* C++ flag */
88 extern int CCflag; /* C++ flag */
89 extern int tirpcflag; /* flag for generating tirpc code */
90 extern int inlineflag; /* if this is 0, then do not generate inline code */
91 extern int mtflag;
94 * Other flags related with inetd jumpstart.
96 extern int indefinitewait;
97 extern int exitnow;
98 extern int timerflag;
100 extern int nonfatalerrors;
103 * rpc_util routines
105 void storeval(list **lstp, definition *val);
106 #define STOREVAL(list,item) storeval(list,item)
108 definition *findval(list *lst, const char *val,
109 int (*cmp)(const definition *, const char *));
110 #define FINDVAL(list,item,finder) findval(list, item, finder)
112 const char *fixtype(const char *type);
113 const char *stringfix(const char *type);
114 char *locase(const char *str);
115 void pvname_svc(const char *pname, const char *vnum);
116 void pvname(const char *pname, const char *vnum);
117 void ptype(const char *prefix, const char *type, int follow);
118 int isvectordef(const char *type, relation rel);
119 int streq(const char *a, const char *b);
120 void error(const char *msg);
121 void tabify(FILE *f, int tab);
122 void record_open(const char *file);
123 bas_type *find_type(const char *type);
127 * rpc_cout routines
129 void emit(definition *def);
132 * rpc_hout routines
134 void print_datadef(definition *def);
135 void print_funcdef(definition *def);
138 * rpc_svcout routines
140 void write_most(const char *infile, int netflag, int nomain);
141 void write_register(void);
142 void write_rest(void);
143 void write_programs(const char *storage);
144 void write_svc_aux(int nomain);
145 void write_inetd_register(const char *transp);
146 void write_netid_register(const char *);
147 void write_nettype_register(const char *);
149 * rpc_clntout routines
151 void write_stubs(void);
154 * rpc_tblout routines
156 void write_tables(void);