Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 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.
9
 *
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.
13
 *
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.
17
 *
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.
21
 *
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.
25
 *
26
 * Sun Microsystems, Inc.
27
 * 2550 Garcia Avenue
28
 * Mountain View, California  94043
29
 */
30
 
31
/*      @(#)rpc_util.h  1.5  90/08/29  (C) 1987 SMI   */
32
 
33
/*
34
 * rpc_util.h, Useful definitions for the RPC protocol compiler 
35
 */
36
 
37
#include <stdlib.h>
38
 
39
#define alloc(size)		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 */
82
extern int inline; /* if this is 0, then do not generate inline code */
83
 
84
#if defined(EMBEDDED)
85
extern int  embeddedflag;
86
extern char *embeddedname;
87
#endif
88
 
89
/*
90
 * Other flags related with inetd jumpstart.
91
 */
92
extern int indefinitewait;
93
extern int exitnow;
94
extern int timerflag;
95
 
96
extern int nonfatalerrors;
97
 
98
/*
99
 * rpc_util routines 
100
 */
101
void storeval();
102
 
103
#define STOREVAL(list,item)	\
104
	storeval(list,item)
105
 
106
definition *findval();
107
 
108
#define FINDVAL(list,item,finder) \
109
	findval(list, item, finder)
110
 
111
char *fixtype();
112
char *stringfix();
113
char *locase();
114
void pvname_svc();
115
void pvname();
116
void ptype();
117
int isvectordef();
118
int streq();
119
void error();
120
void expected1();
121
void expected2();
122
void expected3();
123
void tabify();
124
void record_open();
125
bas_type *find_type();
126
/*
127
 * rpc_cout routines 
128
 */
129
void cprint();
130
void emit();
131
 
132
/*
133
 * rpc_hout routines 
134
 */
135
void print_datadef();
136
void print_funcdef();
137
 
138
/*
139
 * rpc_svcout routines 
140
 */
141
void write_most();
142
void write_register();
143
void write_rest();
144
void write_programs();
145
void write_svc_aux();
146
void write_inetd_register();
147
void write_netid_register();
148
void write_nettype_register();
149
/*
150
 * rpc_clntout routines
151
 */
152
void write_stubs();
153
 
154
/*
155
 * rpc_tblout routines
156
 */
157
void write_tables();