=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rpcgen/rpc_main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/rpcgen/rpc_main.c 2002/05/27 03:14:22 1.13 +++ src/usr.bin/rpcgen/rpc_main.c 2002/06/01 01:40:38 1.14 @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_main.c,v 1.13 2002/05/27 03:14:22 deraadt Exp $ */ +/* $OpenBSD: rpc_main.c,v 1.14 2002/06/01 01:40:38 deraadt 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.13 2002/05/27 03:14:22 deraadt Exp $"; +static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.14 2002/06/01 01:40:38 deraadt Exp $"; #endif /* @@ -258,13 +258,13 @@ return; } if (infile != NULL && streq(outfile, infile)) { - f_print(stderr, "%s: output would overwrite %s\n", cmdname, + fprintf(stderr, "%s: output would overwrite %s\n", cmdname, infile); crash(); } fout = fopen(outfile, "w"); if (fout == NULL) { - f_print(stderr, "%s: unable to open ", cmdname); + fprintf(stderr, "%s: unable to open ", cmdname); perror(outfile); crash(); } @@ -275,10 +275,10 @@ static add_warning() { - f_print(fout, "/*\n"); - f_print(fout, " * Please do not edit this file.\n"); - f_print(fout, " * It was generated using rpcgen.\n"); - f_print(fout, " */\n\n"); + fprintf(fout, "/*\n"); + fprintf(fout, " * Please do not edit this file.\n"); + fprintf(fout, " * It was generated using rpcgen.\n"); + fprintf(fout, " */\n\n"); } /* clear list of arguments */ @@ -355,7 +355,7 @@ fin = fopen(cppfile, "r"); if (fin == NULL) { - f_print(stderr, "%s: ", cmdname); + fprintf(stderr, "%s: ", cmdname); perror(cppfile); crash(); } @@ -389,7 +389,7 @@ fin = fdopen(pd[0], "r"); #endif if (fin == NULL) { - f_print(stderr, "%s: ", cmdname); + fprintf(stderr, "%s: ", cmdname); perror(infilename); crash(); } @@ -426,7 +426,7 @@ if (strcmp(name, list_to_check[i]) == 0) return 1; } - f_print(stderr, "illegal nettype :\'%s\'\n", name); + fprintf(stderr, "illegal nettype :\'%s\'\n", name); return 0; } @@ -452,11 +452,11 @@ open_output(infile, outfilename); add_warning(); if (infile && (include = extendfile(infile, ".h"))) { - f_print(fout, "#include \"%s\"\n", include); + fprintf(fout, "#include \"%s\"\n", include); free(include); /* .h file already contains rpc/rpc.h */ } else - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); tell = ftell(fout); while (def = get_definition()) { emit(def); @@ -536,11 +536,11 @@ add_warning(); guard = generate_guard(outfilename ? outfilename : infile); - f_print(fout, "#ifndef _%s\n#define _%s\n\n", guard, + fprintf(fout, "#ifndef _%s\n#define _%s\n\n", guard, guard); - f_print(fout, "#define RPCGEN_VERSION\t%s\n\n", RPCGEN_VERSION); - f_print(fout, "#include \n\n"); + fprintf(fout, "#define RPCGEN_VERSION\t%s\n\n", RPCGEN_VERSION); + fprintf(fout, "#include \n\n"); tell = ftell(fout); /* print data definitions */ @@ -558,9 +558,9 @@ if (extend && tell == ftell(fout)) { (void) unlink(outfilename); } else if (tblflag) { - f_print(fout, rpcgen_table_dcl); + fprintf(fout, rpcgen_table_dcl); } - f_print(fout, "\n#endif /* !_%s */\n", guard); + fprintf(fout, "\n#endif /* !_%s */\n", guard); } /* @@ -587,63 +587,63 @@ open_output(infile, outfilename); add_warning(); if (infile && (include = extendfile(infile, ".h"))) { - f_print(fout, "#include \"%s\"\n", include); + fprintf(fout, "#include \"%s\"\n", include); free(include); } else - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); - f_print(fout, "#include \n"); - f_print(fout, "#include /* getenv, exit */\n"); + fprintf(fout, "#include \n"); + fprintf(fout, "#include /* getenv, exit */\n"); if (Cflag) { - f_print(fout, + fprintf(fout, "#include /* for pmap_unset */\n"); - f_print(fout, "#include /* strcmp */ \n"); + fprintf(fout, "#include /* strcmp */ \n"); } - f_print(fout, "#include \n"); /* evas */ + fprintf(fout, "#include \n"); /* evas */ if (strcmp(svcclosetime, "-1") == 0) indefinitewait = 1; else if (strcmp(svcclosetime, "0") == 0) exitnow = 1; else if (inetdflag || pmflag) { - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); timerflag = 1; } if (!tirpcflag && inetdflag) - f_print(fout, "#include /* TIOCNOTTY */\n"); + fprintf(fout, "#include /* TIOCNOTTY */\n"); if (Cflag && (inetdflag || pmflag)) { - f_print(fout, "#ifdef __cplusplus\n"); - f_print(fout, "#include /* getdtablesize, open */\n"); - f_print(fout, "#endif /* __cplusplus */\n"); + fprintf(fout, "#ifdef __cplusplus\n"); + fprintf(fout, "#include /* getdtablesize, open */\n"); + fprintf(fout, "#endif /* __cplusplus */\n"); if (tirpcflag) - f_print(fout, "#include /* setsid */\n"); + fprintf(fout, "#include /* setsid */\n"); } if (tirpcflag) - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); if (tirpcflag) - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); if (inetdflag || !tirpcflag) { - f_print(fout, "#include \n"); - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); + fprintf(fout, "#include \n"); } if ((netflag || pmflag) && tirpcflag) { - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); } if ( /* timerflag && */ tirpcflag) - f_print(fout, "#include /* rlimit */\n"); + fprintf(fout, "#include /* rlimit */\n"); if (logflag || inetdflag || pmflag) { - f_print(fout, "#include \n"); - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); + fprintf(fout, "#include \n"); } /* for ANSI-C */ - f_print(fout, "\n#ifdef __STDC__\n#define SIG_PF void(*)(int)\n#endif\n"); + fprintf(fout, "\n#ifdef __STDC__\n#define SIG_PF void(*)(int)\n#endif\n"); - f_print(fout, "\n#ifdef DEBUG\n#define RPC_SVC_FG\n#endif\n"); + fprintf(fout, "\n#ifdef DEBUG\n#define RPC_SVC_FG\n#endif\n"); if (timerflag) - f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime); + fprintf(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime); while (def = get_definition()) { foundprogram |= (def->def_kind == DEF_PROGRAM); } @@ -652,7 +652,7 @@ return; } if (callerflag) /* EVAS */ - f_print(fout, "\nstatic SVCXPRT *caller;\n"); /* EVAS */ + fprintf(fout, "\nstatic SVCXPRT *caller;\n"); /* EVAS */ write_most(infile, netflag, nomain); if (!nomain) { if (!do_registers(argc, argv)) { @@ -684,12 +684,12 @@ open_output(infile, outfilename); add_warning(); if (Cflag) - f_print(fout, "#include /* for memset */\n"); + fprintf(fout, "#include /* for memset */\n"); if (infile && (include = extendfile(infile, ".h"))) { - f_print(fout, "#include \"%s\"\n", include); + fprintf(fout, "#include \"%s\"\n", include); free(include); } else - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); while (def = get_definition()) foundprogram |= (def->def_kind == DEF_PROGRAM); @@ -750,10 +750,10 @@ add_sample_msg(); if (infile && (include = extendfile(infile, ".h"))) { - f_print(fout, "#include \"%s\"\n", include); + fprintf(fout, "#include \"%s\"\n", include); free(include); } else - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); tell = ftell(fout); while (def = get_definition()) @@ -789,10 +789,10 @@ open_output(infile, outfilename); add_sample_msg(); if (infile && (include = extendfile(infile, ".h"))) { - f_print(fout, "#include \"%s\"\n", include); + fprintf(fout, "#include \"%s\"\n", include); free(include); } else - f_print(fout, "#include \n"); + fprintf(fout, "#include \n"); tell = ftell(fout); while (def = get_definition()) has_program += write_sample_clnt(def); @@ -848,7 +848,7 @@ char *cp; { if (argcount >= ARGLISTLEN) { - f_print(stderr, "rpcgen: too many defines\n"); + fprintf(stderr, "rpcgen: too many defines\n"); crash(); /* NOTREACHED */ } @@ -862,7 +862,7 @@ int where; { if (where >= ARGLISTLEN) { - f_print(stderr, "rpcgen: arglist coding error\n"); + fprintf(stderr, "rpcgen: arglist coding error\n"); crash(); /* NOTREACHED */ } @@ -892,7 +892,7 @@ if (stat(outfile, &buf) < 0) return; /* file does not exist */ else { - f_print(stderr, + fprintf(stderr, "file '%s' already exists and may be overwritten\n", outfile); crash(); @@ -932,7 +932,7 @@ for (i = 1; i < argc; i++) { if (argv[i][0] != '-') { if (cmd->infile) { - f_print(stderr, + fprintf(stderr, "Cannot specify more than one input file!\n"); return (0); } @@ -1065,7 +1065,7 @@ * always TRUE */ if (inetdflag && cmd->nflag) { /* netid not allowed with inetdflag */ - f_print(stderr, "Cannot use netid flag with inetd flag!\n"); + fprintf(stderr, "Cannot use netid flag with inetd flag!\n"); return (0); } } else { @@ -1074,13 +1074,13 @@ inetdflag = 1; /* inetdflag is TRUE by default */ if (cmd->nflag) { /* netid needs TIRPC */ - f_print(stderr, "Cannot use netid flag without TIRPC!\n"); + fprintf(stderr, "Cannot use netid flag without TIRPC!\n"); return (0); } } if (newstyle && (tblflag || cmd->tflag)) { - f_print(stderr, "Cannot use table flags with newstyle!\n"); + fprintf(stderr, "Cannot use table flags with newstyle!\n"); return (0); } /* check no conflicts with file generation flags */ @@ -1091,7 +1091,7 @@ if (cmd->outfile != NULL || cmd->infile == NULL) return (0); } else if (nflags > 1) { - f_print(stderr, "Cannot have more than one file generation flag!\n"); + fprintf(stderr, "Cannot have more than one file generation flag!\n"); return (0); } return (1); @@ -1100,10 +1100,10 @@ static usage() { - f_print(stderr, "usage: %s [-abACILNT] [-Dname[=value]] [-i lines] " + fprintf(stderr, "usage: %s [-abACILNT] [-Dname[=value]] [-i lines] " "[-K seconds] infile\n", cmdname); - f_print(stderr, " %s [-c | -h | -l | -m | -t | -Sc | -Ss] " + fprintf(stderr, " %s [-c | -h | -l | -m | -t | -Sc | -Ss] " "[-o outfile] [infile]\n", cmdname); - f_print(stderr, " %s [-s nettype]* [-o outfile] [infile]\n", cmdname); + fprintf(stderr, " %s [-s nettype]* [-o outfile] [infile]\n", cmdname); exit(1); }