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