=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rpcgen/rpc_main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/rpcgen/rpc_main.c 2001/01/21 22:02:52 1.5 +++ src/usr.bin/rpcgen/rpc_main.c 2001/07/17 02:23:59 1.6 @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_main.c,v 1.5 2001/01/21 22:02:52 deraadt Exp $ */ +/* $OpenBSD: rpc_main.c,v 1.6 2001/07/17 02:23:59 pvalchev Exp $ */ /* $NetBSD: rpc_main.c,v 1.9 1996/02/19 11:12:43 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -32,7 +32,7 @@ #ifndef lint static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; -static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.5 2001/01/21 22:02:52 deraadt Exp $"; +static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.6 2001/07/17 02:23:59 pvalchev Exp $"; #endif /* @@ -44,12 +44,14 @@ #include #include #include +#include #include #ifdef __TURBOC__ #define MAXPATHLEN 80 #include #include #else +#include #include #include #endif @@ -127,24 +129,31 @@ static char *dos_cppfile = NULL; #endif -static c_output __P((char *, char *, int, char *)); -static h_output __P((char *, char *, int, char *)); -static s_output __P((int, char **, char *, char *, int, char *, int, int)); -static l_output __P((char *, char *, int, char *)); -static t_output __P((char *, char *, int, char *)); -static svc_output __P((char *, char *, int, char *)); -static clnt_output __P((char *, char *, int, char *)); -static do_registers __P((int, char **)); +static char *extendfile __P((char *, char *)); +static void open_output __P((char *, char *)); +static void add_warning __P((void)); +static void clear_args __P((void)); +static void find_cpp __P((void)); +static void open_input __P((char *, char *)); +static int check_nettype __P((char *, char *[])); +static void c_output __P((char *, char *, int, char *)); +static void c_initialize __P((void)); +static char *generate_guard __P((char *)); +static void h_output __P((char *, char *, int, char *)); +static void s_output __P((int, char *[], char *, char *, int, char *, int, int)); +static void l_output __P((char *, char *, int, char *)); +static void t_output __P((char *, char *, int, char *)); +static void svc_output __P((char *, char *, int, char *)); +static void clnt_output __P((char *, char *, int, char *)); +static int do_registers __P((int, char *[])); static void addarg __P((char *)); static void putarg __P((int, char *)); -static void clear_args __P((void)); static void checkfiles __P((char *, char *)); -static int parseargs __P((int, char **, struct commandline *)); -static usage __P((void)); -static options_usage __P((void)); +static int parseargs __P((int, char *[], struct commandline *)); +static void usage __P((void)); +static void options_usage __P((void)); - - +int main(argc, argv) int argc; char *argv[]; @@ -248,7 +257,7 @@ /* * Open output file with given extension */ -static +static void open_output(infile, outfile) char *infile; char *outfile; @@ -274,7 +283,7 @@ } -static +static void add_warning() { f_print(fout, "/*\n"); @@ -314,7 +323,7 @@ /* * Open input file with given define for C-preprocessor */ -static +static void open_input(infile, define) char *infile; char *define; @@ -432,7 +441,7 @@ * Compile into an XDR routine output file */ -static +static void c_output(infile, define, extend, outfile) char *infile; char *define; @@ -465,6 +474,7 @@ } +static void c_initialize() { @@ -514,7 +524,7 @@ * Compile into an XDR header file */ -static +static void h_output(infile, define, extend, outfile) char *infile; char *define; @@ -562,7 +572,7 @@ /* * Compile into an RPC service */ -static +static void s_output(argc, argv, infile, define, extend, outfile, nomain, netflag) int argc; char *argv[]; @@ -670,7 +680,7 @@ /* * generate client side stubs */ -static +static void l_output(infile, define, extend, outfile) char *infile; char *define; @@ -706,7 +716,7 @@ /* * generate the dispatch table */ -static +static void t_output(infile, define, extend, outfile) char *infile; char *define; @@ -732,7 +742,7 @@ } /* sample routine for the server template */ -static +static void svc_output(infile, define, extend, outfile) char *infile; char *define; @@ -768,7 +778,7 @@ /* sample main routine for client */ -static +static void clnt_output(infile, define, extend, outfile) char *infile; char *define; @@ -810,8 +820,8 @@ * Perform registrations for service output * Return 0 if failed; 1 otherwise. */ -static -int do_registers(argc, argv) +static int +do_registers(argc, argv) int argc; char *argv[]; { @@ -879,8 +889,8 @@ static void checkfiles(infile, outfile) -char *infile; -char *outfile; + char *infile; + char *outfile; { struct stat buf; @@ -915,7 +925,7 @@ { int i; int j; - char c; + int c; char flag[(1 << 8 * sizeof(char))]; int nflags; @@ -1110,7 +1120,7 @@ return (1); } -static +static void usage() { f_print(stderr, "usage: %s infile\n", cmdname); @@ -1124,7 +1134,7 @@ exit(1); } -static +static void options_usage() { f_print(stderr, "options:\n");