Deleted Added
full compact
rpc_tblout.c (149709) rpc_tblout.c (152398)
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 *

--- 21 unchanged lines hidden (view full) ---

30#if 0
31#ifndef lint
32#ident "@(#)rpc_tblout.c 1.11 93/07/05 SMI"
33static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI";
34#endif
35#endif
36
37#include <sys/cdefs.h>
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 *

--- 21 unchanged lines hidden (view full) ---

30#if 0
31#ifndef lint
32#ident "@(#)rpc_tblout.c 1.11 93/07/05 SMI"
33static char sccsid[] = "@(#)rpc_tblout.c 1.4 89/02/22 (C) 1988 SMI";
34#endif
35#endif
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/usr.bin/rpcgen/rpc_tblout.c 149709 2005-09-02 10:23:26Z stefanf $");
38__FBSDID("$FreeBSD: head/usr.bin/rpcgen/rpc_tblout.c 152398 2005-11-13 21:17:24Z dwmalone $");
39
40/*
41 * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler
42 * Copyright (C) 1989, Sun Microsystems, Inc.
43 */
44#include <err.h>
45#include <stdio.h>
46#include <string.h>

--- 12 unchanged lines hidden (view full) ---

59
60static char null_entry[] = "\n\t(char *(*)())0,\n\
61 \t(xdrproc_t) xdr_void,\t\t\t0,\n\
62 \t(xdrproc_t) xdr_void,\t\t\t0,\n";
63
64
65static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n";
66
39
40/*
41 * rpc_tblout.c, Dispatch table outputter for the RPC protocol compiler
42 * Copyright (C) 1989, Sun Microsystems, Inc.
43 */
44#include <err.h>
45#include <stdio.h>
46#include <string.h>

--- 12 unchanged lines hidden (view full) ---

59
60static char null_entry[] = "\n\t(char *(*)())0,\n\
61 \t(xdrproc_t) xdr_void,\t\t\t0,\n\
62 \t(xdrproc_t) xdr_void,\t\t\t0,\n";
63
64
65static char tbl_nproc[] = "int %s_nproc =\n\tsizeof(%s_table)/sizeof(%s_table[0]);\n\n";
66
67extern int nullproc( proc_list * );
68static void write_table( definition * );
67static void write_table( definition * );
69static void printit( char *, char * );
68static void printit(const char *, const char *);
70
71void
69
70void
72write_tables()
71write_tables(void)
73{
74 list *l;
75 definition *def;
76
77 f_print(fout, "\n");
78 for (l = defined; l != NULL; l = l->next) {
79 def = (definition *) l->val;
80 if (def->def_kind == DEF_PROGRAM) {
81 write_table(def);
82 }
83 }
84}
85
86static void
72{
73 list *l;
74 definition *def;
75
76 f_print(fout, "\n");
77 for (l = defined; l != NULL; l = l->next) {
78 def = (definition *) l->val;
79 if (def->def_kind == DEF_PROGRAM) {
80 write_table(def);
81 }
82 }
83}
84
85static void
87write_table(def)
88 definition *def;
86write_table(definition *def)
89{
90 version_list *vp;
91 proc_list *proc;
92 int current;
93 int expected;
94 char progvers[100];
95 int warning;
96

--- 47 unchanged lines hidden (view full) ---

144
145 /* print the table trailer */
146 f_print(fout, tbl_end);
147 f_print(fout, tbl_nproc, progvers, progvers, progvers);
148 }
149}
150
151static void
87{
88 version_list *vp;
89 proc_list *proc;
90 int current;
91 int expected;
92 char progvers[100];
93 int warning;
94

--- 47 unchanged lines hidden (view full) ---

142
143 /* print the table trailer */
144 f_print(fout, tbl_end);
145 f_print(fout, tbl_nproc, progvers, progvers, progvers);
146 }
147}
148
149static void
152printit(prefix, type)
153 char *prefix;
154 char *type;
150printit(const char *prefix, const char *type)
155{
156 int len;
157 int tabs;
158
159
160 len = fprintf(fout, "\txdr_%s,", stringfix(type));
161 /* account for leading tab expansion */
162 len += TABSIZE - 1;

--- 14 unchanged lines hidden ---
151{
152 int len;
153 int tabs;
154
155
156 len = fprintf(fout, "\txdr_%s,", stringfix(type));
157 /* account for leading tab expansion */
158 len += TABSIZE - 1;

--- 14 unchanged lines hidden ---