This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / usr.bin / rpcgen / rpc_util.h
CommitLineData
9a4767d3
C
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.
8 *
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
12 *
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
16 *
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
20 *
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
24 *
25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
28 *
29 * from: @(#)rpc_util.h 1.6 87/06/24 (C) 1987 SMI
30 * from: @(#)rpc_util.h 2.1 88/08/01 4.0 RPCSRC
31 * $Id: rpc_util.h,v 1.2 1993/08/01 18:09:24 mycroft Exp $
32 */
33
34/*
35 * rpc_util.h, Useful definitions for the RPC protocol compiler
36 * Copyright (C) 1987, Sun Microsystems, Inc.
37 */
38extern char *malloc();
39
40#define alloc(size) malloc((unsigned)(size))
41#define ALLOC(object) (object *) malloc(sizeof(object))
42
43#define s_print (void) sprintf
44#define f_print (void) fprintf
45
46struct list {
47 char *val;
48 struct list *next;
49};
50typedef struct list list;
51
52/*
53 * Global variables
54 */
55#define MAXLINESIZE 1024
56extern char curline[MAXLINESIZE];
57extern char *where;
58extern int linenum;
59
60extern char *infilename;
61extern FILE *fout;
62extern FILE *fin;
63
64extern list *defined;
65
66/*
67 * rpc_util routines
68 */
69void storeval();
70
71#define STOREVAL(list,item) \
72 storeval(list,(char *)item)
73
74char *findval();
75
76#define FINDVAL(list,item,finder) \
77 findval(list, (char *) item, finder)
78
79char *fixtype();
80char *stringfix();
81void pvname();
82void ptype();
83int isvectordef();
84int streq();
85void error();
86void expected1();
87void expected2();
88void expected3();
89void tabify();
90void record_open();
91
92/*
93 * rpc_cout routines
94 */
95void cprint();
96void emit();
97
98/*
99 * rpc_hout routines
100 */
101void print_datadef();
102
103/*
104 * rpc_svcout routines
105 */
106void write_most();
107void write_register();
108void write_rest();
109
110/*
111 * rpc_clntout routines
112 */
113void write_stubs();