1 /* @(#)rpc_util.h 1.2 87/11/24 3.9 RPCSRC */
3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4 * unrestricted use provided that this legend is included on all tape
5 * media and as a part of the software program in whole or part. Users
6 * may copy or modify Sun RPC without charge, but are not authorized
7 * to license or distribute it to anyone else except as part of a product or
8 * program developed by the user.
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.
28 * Mountain View, California 94043
32 * rpc_util.h, Useful definitions for the RPC protocol compiler
33 * Copyright (C) 1987, Sun Microsystems, Inc.
36 #include "rxgen_consts.h"
37 #define alloc(size) malloc((unsigned)(size))
38 #define ALLOC(object) (object *) malloc(sizeof(object))
40 #define s_print (void) sprintf
41 #define f_print if (scan_print) (void) fprintf
47 typedef struct list list;
52 #define MAXLINESIZE 1024
53 extern char curline[MAXLINESIZE];
57 extern char Sflag, Cflag, hflag, cflag, xflag;
59 extern list *special_defined, *typedef_defined, *uniondef_defined;
60 extern int PackageIndex, combinepackages, scan_print, master_opcodenumber, master_highest_opcode;
61 extern char *PackagePrefix[MAX_PACKAGES];
62 extern char *PackageStatIndex[MAX_PACKAGES];
63 extern int no_of_stat_funcs;
64 extern int no_of_stat_funcs_header[MAX_PACKAGES];
65 extern char *infilename;
72 * Character arrays to keep list of function names as we process the file
75 extern char function_list[MAX_PACKAGES]
76 [MAX_FUNCTIONS_PER_PACKAGE]
77 [MAX_FUNCTION_NAME_LEN];
78 extern int function_list_index;
85 #define STOREVAL(list,item) \
86 storeval(list,(char *)item)
90 #define FINDVAL(list,item,finder) \
91 findval(list, (char *) item, finder)
116 void print_datadef();
119 * rpc_svcout routines
122 void write_register();
124 void write_programs();
127 * rpc_clntout routines