2 * Copyright (c) 2009, Sun Microsystems, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
30 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
34 * rpc_main.c, Top level of the RPC protocol compiler.
37 #include <sys/types.h>
38 #include <sys/param.h>
47 #include "rpc_parse.h"
52 int cflag; /* xdr C routines */
53 int hflag; /* header file */
54 int lflag; /* client side stubs */
55 int mflag; /* server side stubs */
56 int nflag; /* netid flag */
57 int sflag; /* server stubs for the given transport */
58 int tflag; /* dispatch Table file */
59 int Ssflag; /* produce server sample code */
60 int Scflag; /* produce client sample code */
61 char *infile; /* input module name */
62 char *outfile; /* output module name */
65 static char * extendfile(char *file, char *ext);
66 static void open_output(char *infile, char *outfile);
67 static void add_warning(void);
68 static void clear_args(void);
69 static void open_input(char *infile, char *define);
70 static int check_nettype(char *name, char **list_to_check);
71 static void c_output(char *infile, char *define, int extend, char *outfile);
72 static void c_initialize(void);
73 static char * generate_guard(char *pathname);
74 static void h_output(char *infile, char *define, int extend, char *outfile);
75 static void s_output(int argc, char **argv, char *infile,
76 char *define, int extend, char *outfile,
77 int nomain, int netflag);
78 static void l_output(char *infile, char *define, int extend, char *outfile);
79 static void t_output(char *infile, char *define, int extend, char *outfile);
80 static void svc_output(char *, char *, int, char *);
81 static void clnt_output(char *, char *, int, char *);
82 static int do_registers(int argc, char **argv);
83 static void addarg(char *cp);
84 static void putarg(int where, char *cp);
85 static void checkfiles(char *infile, char *outfile);
86 static int parseargs(int argc, char **argv, struct commandline *cmd);
87 static void usage(void);
88 static void options_usage(void);
91 extern void write_sample_svc();
92 int write_sample_clnt();
93 void write_sample_clnt_main();
98 #define EXTEND 1 /* alias for TRUE */
99 #define DONT_EXTEND 0 /* alias for FALSE */
101 #define SVR4_CPP "/usr/ccs/lib/cpp"
102 #define SUNOS_CPP "/lib/cpp"
103 static int cppDefined = 0; /* explicit path for C preprocessor */
106 static char *cmdname;
108 static char *svcclosetime = "120";
109 static char *CPP = SVR4_CPP;
110 static char CPPFLAGS[] = "-C";
111 static char pathbuf[MAXPATHLEN + 1];
112 static char *allv[] = {
113 "rpcgen", "-s", "udp", "-s", "tcp",
115 static int allc = sizeof(allv)/sizeof(allv[0]);
116 static char *allnv[] = {
117 "rpcgen", "-s", "netpath",
119 static int allnc = sizeof(allnv)/sizeof(allnv[0]);
122 * machinations for handling expanding argument list
125 static void addarg(); /* add another argument to the list */
126 static void putarg(); /* put argument at specified location */
127 static void clear_args(); /* clear argument list */
128 static void checkfiles(); /* check if out file already exists */
133 #define ARGLISTLEN 20
136 static char *arglist[ARGLISTLEN];
137 static int argcount = FIXEDARGS;
140 int nonfatalerrors; /* errors */
141 int inetdflag/* = 1*/; /* Support for inetd */ /* is now the default */
142 int pmflag; /* Support for port monitors */
143 int logflag; /* Use syslog instead of fprintf for errors */
144 int tblflag; /* Support for dispatch table file */
146 /* length at which to start doing an inline */
149 int Inline = INLINE; /* length at which to start doing an inline. 3 = default
150 * if 0, no xdr_inline code */
152 int indefinitewait; /* If started by port monitors, hang till it wants */
153 int exitnow; /* If started by port monitors, exit after the call */
154 int timerflag; /* TRUE if !indefinite && !exitnow */
155 int newstyle; /* newstyle of passing arguments (by value) */
156 int Cflag = 0 ; /* ANSI C syntax */
157 static int allfiles; /* generate all files */
159 int tirpcflag = 0; /* no tirpc by default */
161 int tirpcflag = 1; /* generating code for tirpc, by default */
165 main(int argc, char **argv)
167 struct commandline cmd;
169 (void) memset((char *) &cmd, 0, sizeof(struct commandline));
171 if (!parseargs(argc, argv, &cmd))
174 if (cmd.cflag || cmd.hflag || cmd.lflag || cmd.tflag || cmd.sflag ||
175 cmd.mflag || cmd.nflag || cmd.Ssflag || cmd.Scflag) {
176 checkfiles(cmd.infile, cmd.outfile);
178 checkfiles(cmd.infile, NULL);
181 c_output(cmd.infile, "-DRPC_XDR", DONT_EXTEND, cmd.outfile);
182 } else if (cmd.hflag) {
183 h_output(cmd.infile, "-DRPC_HDR", DONT_EXTEND, cmd.outfile);
184 } else if (cmd.lflag) {
185 l_output(cmd.infile, "-DRPC_CLNT", DONT_EXTEND, cmd.outfile);
186 } else if (cmd.sflag || cmd.mflag || (cmd.nflag)) {
187 s_output(argc, argv, cmd.infile, "-DRPC_SVC", DONT_EXTEND,
188 cmd.outfile, cmd.mflag, cmd.nflag);
189 } else if (cmd.tflag) {
190 t_output(cmd.infile, "-DRPC_TBL", DONT_EXTEND, cmd.outfile);
191 } else if (cmd.Ssflag) {
192 svc_output(cmd.infile, "-DRPC_SERVER", DONT_EXTEND, cmd.outfile);
193 } else if (cmd.Scflag) {
194 clnt_output(cmd.infile, "-DRPC_CLIENT", DONT_EXTEND, cmd.outfile);
196 /* the rescans are required, since cpp may effect input */
197 c_output(cmd.infile, "-DRPC_XDR", EXTEND, "_xdr.c");
199 h_output(cmd.infile, "-DRPC_HDR", EXTEND, ".h");
201 l_output(cmd.infile, "-DRPC_CLNT", EXTEND, "_clnt.c");
203 if (inetdflag || !tirpcflag)
204 s_output(allc, allv, cmd.infile, "-DRPC_SVC", EXTEND,
205 "_svc.c", cmd.mflag, cmd.nflag);
207 s_output(allnc, allnv, cmd.infile, "-DRPC_SVC",
208 EXTEND, "_svc.c", cmd.mflag, cmd.nflag);
211 t_output(cmd.infile, "-DRPC_TBL", EXTEND, "_tbl.i");
215 svc_output(cmd.infile, "-DRPC_SERVER", EXTEND, "_server.c");
219 clnt_output(cmd.infile, "-DRPC_CLIENT", EXTEND, "_client.c");
222 exit(nonfatalerrors);
227 * add extension to filename
230 extendfile(char *file, char *ext)
235 res = alloc(strlen(file) + strlen(ext) + 1);
239 p = strrchr(file, '.');
241 p = file + strlen(file);
243 (void) strcpy(res, file);
244 (void) strcpy(res + (p - file), ext);
249 * Open output file with given extension
252 open_output(char *infile, char *outfile)
255 if (outfile == NULL) {
260 if (infile != NULL && streq(outfile, infile)) {
261 f_print(stderr, "%s: output would overwrite %s\n", cmdname,
265 fout = fopen(outfile, "w");
267 f_print(stderr, "%s: unable to open ", cmdname);
271 record_open(outfile);
278 f_print(fout, "/*\n");
279 f_print(fout, " * Please do not edit this file.\n");
280 f_print(fout, " * It was generated using rpcgen.\n");
281 f_print(fout, " */\n\n");
284 /* clear list of arguments */
289 for( i=FIXEDARGS; i<ARGLISTLEN; i++ )
291 argcount = FIXEDARGS;
295 * Open input file with given define for C-preprocessor
298 open_input(char *infile, char *define)
302 infilename = (infile == NULL) ? "<stdin>" : infile;
310 addarg((char *)NULL);
312 (void) dup2(pd[1], 1);
317 execvp("cpp", arglist);
319 execvp(SVR4_CPP, arglist);
321 execvp(SUNOS_CPP, arglist);
330 fin = fdopen(pd[0], "r");
332 f_print(stderr, "%s: ", cmdname);
338 /* valid tirpc nettypes */
339 static char* valid_ti_nettypes[] =
353 /* valid inetd nettypes */
354 static char* valid_i_nettypes[] =
362 check_nettype(char *name, char **list_to_check)
365 for( i = 0; list_to_check[i] != NULL; i++ ) {
366 if( strcmp( name, list_to_check[i] ) == 0 ) {
370 f_print( stderr, "illegal nettype :\'%s\'\n", name );
375 * Compile into an XDR routine output file
379 c_output(char *infile, char *define, int extend, char *outfile)
387 open_input(infile, define);
388 outfilename = extend ? extendfile(infile, outfile) : outfile;
389 open_output(infile, outfilename);
391 if (infile && (include = extendfile(infile, ".h"))) {
392 f_print(fout, "#include \"%s\"\n", include);
394 /* .h file already contains rpc/rpc.h */
396 f_print(fout, "#include <rpc/rpc.h>\n");
398 while ((def = get_definition()) != NULL) {
401 if (extend && tell == ftell(fout)) {
402 (void) unlink(outfilename);
411 /* add all the starting basic types */
414 add_type(1,"int32_t");
419 add_type(1,"u_int32_t");
420 add_type(1,"u_short");
424 char rpcgen_table_dcl[] = "struct rpcgen_table {\n\
426 xdrproc_t xdr_arg;\n\
428 xdrproc_t xdr_res;\n\
434 generate_guard(char *pathname)
436 char* filename, *guard, *tmp;
438 filename = strrchr(pathname, '/' ); /* find last component */
439 filename = ((filename == 0) ? pathname : filename+1);
440 guard = strdup(filename);
441 /* convert to upper case */
445 *tmp = toupper(*tmp);
449 guard = extendfile(guard, "_H_RPCGEN");
454 * Compile into an XDR header file
457 h_output(char *infile, char *define, int extend, char *outfile)
465 open_input(infile, define);
466 outfilename = extend ? extendfile(infile, outfile) : outfile;
467 open_output(infile, outfilename);
469 guard = generate_guard( outfilename ? outfilename: infile );
471 f_print(fout,"#ifndef _%s\n#define _%s\n\n", guard,
474 f_print(fout, "#include <rpc/rpc.h>\n\n");
476 f_print(fout, "#ifndef IXDR_GET_INT32\n");
477 f_print(fout, "#define IXDR_GET_INT32(buf) IXDR_GET_LONG((buf))\n");
478 f_print(fout, "#endif\n");
479 f_print(fout, "#ifndef IXDR_PUT_INT32\n");
480 f_print(fout, "#define IXDR_PUT_INT32(buf, v) IXDR_PUT_LONG((buf), (v))\n");
481 f_print(fout, "#endif\n");
482 f_print(fout, "#ifndef IXDR_GET_U_INT32\n");
483 f_print(fout, "#define IXDR_GET_U_INT32(buf) IXDR_GET_U_LONG((buf))\n");
484 f_print(fout, "#endif\n");
485 f_print(fout, "#ifndef IXDR_PUT_U_INT32\n");
486 f_print(fout, "#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_U_LONG((buf), (v))\n");
487 f_print(fout, "#endif\n");
490 /* print data definitions */
491 while ((def = get_definition()) != NULL) {
495 /* print function declarations.
496 Do this after data definitions because they might be used as
497 arguments for functions */
498 for (l = defined; l != NULL; l = l->next) {
499 print_funcdef(l->val);
501 if (extend && tell == ftell(fout)) {
502 (void) unlink(outfilename);
503 } else if (tblflag) {
504 f_print(fout, rpcgen_table_dcl);
506 f_print(fout, "\n#endif /* !_%s */\n", guard);
510 * Compile into an RPC service
513 s_output(int argc, char **argv, char *infile, char *define, int extend,
514 char *outfile, int nomain, int netflag)
518 int foundprogram = 0;
521 open_input(infile, define);
522 outfilename = extend ? extendfile(infile, outfile) : outfile;
523 open_output(infile, outfilename);
525 if (infile && (include = extendfile(infile, ".h"))) {
526 f_print(fout, "#include \"%s\"\n", include);
529 f_print(fout, "#include <rpc/rpc.h>\n");
531 f_print(fout, "#include <stdio.h>\n");
532 f_print(fout, "#include <stdlib.h>/* getenv, exit */\n");
534 f_print (fout, "#include <rpc/pmap_clnt.h> /* for pmap_unset */\n");
535 f_print (fout, "#include <string.h> /* strcmp */ \n");
537 if (strcmp(svcclosetime, "-1") == 0)
539 else if (strcmp(svcclosetime, "0") == 0)
541 else if (inetdflag || pmflag) {
542 f_print(fout, "#include <signal.h>\n");
547 if( !tirpcflag && inetdflag )
548 f_print(fout, "#include <sys/ttycom.h>/* TIOCNOTTY */\n");
551 f_print(fout, "#include <sys/ioctl.h>/* TIOCNOTTY */\n");
553 if( Cflag && (inetdflag || pmflag ) ) {
554 f_print(fout, "#ifdef __cplusplus\n");
555 f_print(fout, "#include <sysent.h> /* getdtablesize, open */\n");
556 f_print(fout, "#endif /* __cplusplus */\n");
559 f_print(fout, "#include <unistd.h> /* setsid */\n");
562 f_print(fout, "#include <sys/types.h>\n");
564 f_print(fout, "#include <memory.h>\n");
566 f_print(fout, "#include <stropts.h>\n");
568 if (inetdflag || !tirpcflag ) {
569 f_print(fout, "#include <sys/socket.h>\n");
570 f_print(fout, "#include <netinet/in.h>\n");
573 if ( (netflag || pmflag) && tirpcflag ) {
574 f_print(fout, "#include <netconfig.h>\n");
576 if (/*timerflag &&*/ tirpcflag)
577 f_print(fout, "#include <sys/resource.h> /* rlimit */\n");
578 if (logflag || inetdflag || pmflag) {
580 f_print(fout, "#include <syslog.h>\n");
582 f_print(fout, "#ifdef SYSLOG\n");
583 f_print(fout, "#include <syslog.h>\n");
584 f_print(fout, "#else\n");
585 f_print(fout, "#define LOG_ERR 1\n");
586 f_print(fout, "#define openlog(a, b, c)\n");
587 f_print(fout, "#endif\n");
592 f_print(fout, "\n#ifdef __STDC__\n#define SIG_PF void(*)(int)\n#endif\n");
594 f_print(fout, "\n#ifdef DEBUG\n#define RPC_SVC_FG\n#endif\n");
596 f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime);
597 while ((def = get_definition()) != NULL) {
598 foundprogram |= (def->def_kind == DEF_PROGRAM);
600 if (extend && !foundprogram) {
601 (void) unlink(outfilename);
604 write_most(infile, netflag, nomain);
606 if( !do_registers(argc, argv) ) {
608 (void) unlink(outfilename);
616 * generate client side stubs
619 l_output(char *infile, char *define, int extend, char *outfile)
623 int foundprogram = 0;
626 open_input(infile, define);
627 outfilename = extend ? extendfile(infile, outfile) : outfile;
628 open_output(infile, outfilename);
631 f_print (fout, "#include <memory.h> /* for memset */\n");
632 if (infile && (include = extendfile(infile, ".h"))) {
633 f_print(fout, "#include \"%s\"\n", include);
636 f_print(fout, "#include <rpc/rpc.h>\n");
637 while ((def = get_definition()) != NULL) {
638 foundprogram |= (def->def_kind == DEF_PROGRAM);
640 if (extend && !foundprogram) {
641 (void) unlink(outfilename);
648 * generate the dispatch table
651 t_output(char *infile, char *define, int extend, char *outfile)
654 int foundprogram = 0;
657 open_input(infile, define);
658 outfilename = extend ? extendfile(infile, outfile) : outfile;
659 open_output(infile, outfilename);
661 while ((def = get_definition()) != NULL) {
662 foundprogram |= (def->def_kind == DEF_PROGRAM);
664 if (extend && !foundprogram) {
665 (void) unlink(outfilename);
671 /* sample routine for the server template */
673 svc_output(char *infile, char *define, int extend, char *outfile)
680 open_input(infile, define);
681 outfilename = extend ? extendfile(infile, outfile) : outfile;
682 checkfiles(infile,outfilename); /*check if outfile already exists.
683 if so, print an error message and exit*/
684 open_output(infile, outfilename);
687 if (infile && (include = extendfile(infile, ".h"))) {
688 f_print(fout, "#include \"%s\"\n", include);
691 f_print(fout, "#include <rpc/rpc.h>\n");
694 while ((def = get_definition()) != NULL) {
695 write_sample_svc(def);
697 if (extend && tell == ftell(fout)) {
698 (void) unlink(outfilename);
703 /* sample main routine for client */
705 clnt_output(char *infile, char *define, int extend, char *outfile)
713 open_input(infile, define);
714 outfilename = extend ? extendfile(infile, outfile) : outfile;
715 checkfiles(infile, outfilename); /*check if outfile already exists.
716 if so, print an error message and exit*/
718 open_output(infile, outfilename);
720 if (infile && (include = extendfile(infile, ".h"))) {
721 f_print(fout, "#include \"%s\"\n", include);
724 f_print(fout, "#include <rpc/rpc.h>\n");
726 while ((def = get_definition()) != NULL) {
727 has_program += write_sample_clnt(def);
731 write_sample_clnt_main();
733 if (extend && tell == ftell(fout)) {
734 (void) unlink(outfilename);
739 * Perform registrations for service output
740 * Return 0 if failed; 1 otherwise.
743 do_registers(int argc, char **argv)
747 if (inetdflag || !tirpcflag) {
748 for (i = 1; i < argc; i++) {
749 if (streq(argv[i], "-s")) {
750 if (!check_nettype(argv[i + 1], valid_i_nettypes))
752 write_inetd_register(argv[i + 1]);
757 for (i = 1; i < argc; i++)
758 if (streq(argv[i], "-s")) {
759 if (!check_nettype(argv[i + 1], valid_ti_nettypes))
761 write_nettype_register(argv[i + 1]);
763 } else if (streq(argv[i], "-n")) {
764 write_netid_register(argv[i + 1]);
772 * Add another argument to the arg list
777 if (argcount >= ARGLISTLEN) {
778 f_print(stderr, "rpcgen: too many defines\n");
782 arglist[argcount++] = cp;
787 putarg(int where, char *cp)
789 if (where >= ARGLISTLEN) {
790 f_print(stderr, "rpcgen: arglist coding error\n");
799 * if input file is stdin and an output file is specified then complain
800 * if the file already exists. Otherwise the file may get overwritten
801 * If input file does not exist, exit with an error
805 checkfiles(char *infile, char *outfile)
810 if(infile) /* infile ! = NULL */
811 if(stat(infile,&buf) < 0)
817 if (stat(outfile, &buf) < 0)
818 return; /* file does not exist */
821 "file '%s' already exists and may be overwritten\n", outfile);
828 * Parse command line arguments
831 parseargs(int argc, char **argv, struct commandline *cmd)
836 char flag[(1 << 8 * sizeof(char))];
840 cmd->infile = cmd->outfile = NULL;
855 for (i = 1; i < argc; i++) {
856 if (argv[i][0] != '-') {
858 f_print( stderr, "Cannot specify more than one input file!\n");
862 cmd->infile = argv[i];
864 for (j = 1; argv[i][j] != 0; j++) {
881 /* sample flag: Ss or Sc.
882 Ss means set flag['S'];
883 Sc means set flag['C']; */
884 c = argv[i][++j]; /* get next char */
897 case 'C': /* ANSI C syntax */
901 case 'b': /* turn TIRPC flag off for
902 generating backward compatible
920 svcclosetime = argv[i];
929 Inline = atoi(argv[i]);
934 if (argv[i][j - 1] != '-' ||
935 argv[i][j + 1] != 0) {
943 if (!streq(argv[i], "udp") &&
944 !streq(argv[i], "tcp")) {
947 } else if (c == 'o') {
951 cmd->outfile = argv[i];
955 if (argv[i][j - 1] != '-') {
958 (void) addarg(argv[i]);
964 (void) strcpy(pathbuf, argv[i]);
965 (void) strcat(pathbuf, "/cpp");
981 cmd->cflag = flag['c'];
982 cmd->hflag = flag['h'];
983 cmd->lflag = flag['l'];
984 cmd->mflag = flag['m'];
985 cmd->nflag = flag['n'];
986 cmd->sflag = flag['s'];
987 cmd->tflag = flag['t'];
988 cmd->Ssflag = flag['S'];
989 cmd->Scflag = flag['C'];
992 pmflag = inetdflag ? 0 : 1; /* pmflag or inetdflag is always TRUE */
993 if( (inetdflag && cmd->nflag)) { /* netid not allowed with inetdflag */
994 f_print(stderr, "Cannot use netid flag with inetd flag!\n");
997 } else { /* 4.1 mode */
998 pmflag = 0; /* set pmflag only in tirpcmode */
999 inetdflag = 1; /* inetdflag is TRUE by default */
1000 if( cmd->nflag ) { /* netid needs TIRPC */
1001 f_print( stderr, "Cannot use netid flag without TIRPC!\n");
1006 if( newstyle && ( tblflag || cmd->tflag) ) {
1007 f_print( stderr, "Cannot use table flags with newstyle!\n");
1011 /* check no conflicts with file generation flags */
1012 nflags = cmd->cflag + cmd->hflag + cmd->lflag + cmd->mflag +
1013 cmd->sflag + cmd->nflag + cmd->tflag + cmd->Ssflag + cmd->Scflag;
1016 if (cmd->outfile != NULL || cmd->infile == NULL) {
1019 } else if (nflags > 1) {
1020 f_print( stderr, "Cannot have more than one file generation flag!\n");
1029 f_print(stderr, "usage: %s infile\n", cmdname);
1030 f_print(stderr, "\t%s [-a][-b][-C][-Dname[=value]] -i size [-I [-K seconds]] [-L][-N][-T] infile\n",
1032 f_print(stderr, "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss] [-o outfile] [infile]\n",
1034 f_print(stderr, "\t%s [-s nettype]* [-o outfile] [infile]\n", cmdname);
1035 f_print(stderr, "\t%s [-n netid]* [-o outfile] [infile]\n", cmdname);
1043 f_print(stderr, "options:\n");
1044 f_print(stderr, "-a\t\tgenerate all files, including samples\n");
1045 f_print(stderr, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n");
1046 f_print(stderr, "-c\t\tgenerate XDR routines\n");
1047 f_print(stderr, "-C\t\tANSI C mode\n");
1048 f_print(stderr, "-Dname[=value]\tdefine a symbol (same as #define)\n");
1049 f_print(stderr, "-h\t\tgenerate header file\n");
1050 f_print(stderr, "-i size\t\tsize at which to start generating inline code\n");
1051 f_print(stderr, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n");
1052 f_print(stderr, "-K seconds\tserver exits after K seconds of inactivity\n");
1053 f_print(stderr, "-l\t\tgenerate client side stubs\n");
1054 f_print(stderr, "-L\t\tserver errors will be printed to syslog\n");
1055 f_print(stderr, "-m\t\tgenerate server side stubs\n");
1056 f_print(stderr, "-n netid\tgenerate server code that supports named netid\n");
1057 f_print(stderr, "-N\t\tsupports multiple arguments and call-by-value\n");
1058 f_print(stderr, "-o outfile\tname of the output file\n");
1059 f_print(stderr, "-s nettype\tgenerate server code that supports named nettype\n");
1060 f_print(stderr, "-Sc\t\tgenerate sample client code that uses remote procedures\n");
1061 f_print(stderr, "-Ss\t\tgenerate sample server code that defines remote procedures\n");
1062 f_print(stderr, "-t\t\tgenerate RPC dispatch table\n");
1063 f_print(stderr, "-T\t\tgenerate code to support RPC dispatch tables\n");
1064 f_print(stderr, "-Y path\t\tdirectory name to find C preprocessor (cpp)\n");