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 or with the express written consent of
8 * Sun Microsystems, Inc.
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 static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
36 * rpc_main.c, Top level of the RPC protocol compiler.
39 #include <sys/types.h>
40 #include <sys/param.h>
48 #include "rpc_parse.h"
53 int cflag; /* xdr C routines */
54 int hflag; /* header file */
55 int lflag; /* client side stubs */
56 int mflag; /* server side stubs */
57 int nflag; /* netid flag */
58 int sflag; /* server stubs for the given transport */
59 int tflag; /* dispatch Table file */
60 int Ssflag; /* produce server sample code */
61 int Scflag; /* produce client sample code */
62 char *infile; /* input module name */
63 char *outfile; /* output module name */
66 static char * extendfile(char *file, char *ext);
67 static void open_output(char *infile, char *outfile);
68 static void add_warning(void);
69 static void clear_args(void);
70 static void find_cpp(void);
71 static void open_input(char *infile, char *define);
72 static int check_nettype(char *name, char **list_to_check);
73 static void c_output(char *infile, char *define, int extend, char *outfile);
74 static void c_initialize(void);
75 static char * generate_guard(char *pathname);
76 static void h_output(char *infile, char *define, int extend, char *outfile);
77 static void s_output(int argc, char **argv, char *infile,
78 char *define, int extend, char *outfile,
79 int nomain, int netflag);
80 static void l_output(char *infile, char *define, int extend, char *outfile);
81 static void t_output(char *infile, char *define, int extend, char *outfile);
82 static void svc_output(char *, char *, int, char *);
83 static void clnt_output(char *, char *, int, char *);
84 static int do_registers(int argc, char **argv);
85 static void addarg(char *cp);
86 static void putarg(int where, char *cp);
87 static void checkfiles(char *infile, char *outfile);
88 static int parseargs(int argc, char **argv, struct commandline *cmd);
89 static void usage(void);
90 static void options_usage(void);
93 extern void write_sample_svc();
94 int write_sample_clnt();
95 void write_sample_clnt_main();
100 #define EXTEND 1 /* alias for TRUE */
101 #define DONT_EXTEND 0 /* alias for FALSE */
103 #define SVR4_CPP "/usr/ccs/lib/cpp"
104 #define SUNOS_CPP "/lib/cpp"
105 static int cppDefined = 0; /* explicit path for C preprocessor */
108 static char *cmdname;
110 static char *svcclosetime = "120";
111 static char *CPP = SVR4_CPP;
112 static char CPPFLAGS[] = "-C";
113 static char pathbuf[MAXPATHLEN + 1];
114 static char *allv[] = {
115 "rpcgen", "-s", "udp", "-s", "tcp",
117 static int allc = sizeof(allv)/sizeof(allv[0]);
118 static char *allnv[] = {
119 "rpcgen", "-s", "netpath",
121 static int allnc = sizeof(allnv)/sizeof(allnv[0]);
124 * machinations for handling expanding argument list
127 static void addarg(); /* add another argument to the list */
128 static void putarg(); /* put argument at specified location */
129 static void clear_args(); /* clear argument list */
130 static void checkfiles(); /* check if out file already exists */
135 #define ARGLISTLEN 20
138 static char *arglist[ARGLISTLEN];
139 static int argcount = FIXEDARGS;
142 int nonfatalerrors; /* errors */
143 int inetdflag/* = 1*/; /* Support for inetd */ /* is now the default */
144 int pmflag; /* Support for port monitors */
145 int logflag; /* Use syslog instead of fprintf for errors */
146 int tblflag; /* Support for dispatch table file */
148 /* length at which to start doing an inline */
151 int Inline = INLINE; /* length at which to start doing an inline. 3 = default
152 * if 0, no xdr_inline code */
154 int indefinitewait; /* If started by port monitors, hang till it wants */
155 int exitnow; /* If started by port monitors, exit after the call */
156 int timerflag; /* TRUE if !indefinite && !exitnow */
157 int newstyle; /* newstyle of passing arguments (by value) */
158 int Cflag = 0 ; /* ANSI C syntax */
159 static int allfiles; /* generate all files */
161 int tirpcflag = 0; /* no tirpc by default */
163 int tirpcflag = 1; /* generating code for tirpc, by default */
167 main(int argc, char **argv)
169 struct commandline cmd;
171 (void) memset((char *) &cmd, 0, sizeof(struct commandline));
173 if (!parseargs(argc, argv, &cmd))
176 if (cmd.cflag || cmd.hflag || cmd.lflag || cmd.tflag || cmd.sflag ||
177 cmd.mflag || cmd.nflag || cmd.Ssflag || cmd.Scflag) {
178 checkfiles(cmd.infile, cmd.outfile);
180 checkfiles(cmd.infile, NULL);
183 c_output(cmd.infile, "-DRPC_XDR", DONT_EXTEND, cmd.outfile);
184 } else if (cmd.hflag) {
185 h_output(cmd.infile, "-DRPC_HDR", DONT_EXTEND, cmd.outfile);
186 } else if (cmd.lflag) {
187 l_output(cmd.infile, "-DRPC_CLNT", DONT_EXTEND, cmd.outfile);
188 } else if (cmd.sflag || cmd.mflag || (cmd.nflag)) {
189 s_output(argc, argv, cmd.infile, "-DRPC_SVC", DONT_EXTEND,
190 cmd.outfile, cmd.mflag, cmd.nflag);
191 } else if (cmd.tflag) {
192 t_output(cmd.infile, "-DRPC_TBL", DONT_EXTEND, cmd.outfile);
193 } else if (cmd.Ssflag) {
194 svc_output(cmd.infile, "-DRPC_SERVER", DONT_EXTEND, cmd.outfile);
195 } else if (cmd.Scflag) {
196 clnt_output(cmd.infile, "-DRPC_CLIENT", DONT_EXTEND, cmd.outfile);
198 /* the rescans are required, since cpp may effect input */
199 c_output(cmd.infile, "-DRPC_XDR", EXTEND, "_xdr.c");
201 h_output(cmd.infile, "-DRPC_HDR", EXTEND, ".h");
203 l_output(cmd.infile, "-DRPC_CLNT", EXTEND, "_clnt.c");
205 if (inetdflag || !tirpcflag)
206 s_output(allc, allv, cmd.infile, "-DRPC_SVC", EXTEND,
207 "_svc.c", cmd.mflag, cmd.nflag);
209 s_output(allnc, allnv, cmd.infile, "-DRPC_SVC",
210 EXTEND, "_svc.c", cmd.mflag, cmd.nflag);
213 t_output(cmd.infile, "-DRPC_TBL", EXTEND, "_tbl.i");
217 svc_output(cmd.infile, "-DRPC_SERVER", EXTEND, "_server.c");
221 clnt_output(cmd.infile, "-DRPC_CLIENT", EXTEND, "_client.c");
224 exit(nonfatalerrors);
229 * add extension to filename
232 extendfile(char *file, char *ext)
237 res = alloc(strlen(file) + strlen(ext) + 1);
241 p = strrchr(file, '.');
243 p = file + strlen(file);
245 (void) strcpy(res, file);
246 (void) strcpy(res + (p - file), ext);
251 * Open output file with given extension
254 open_output(char *infile, char *outfile)
257 if (outfile == NULL) {
262 if (infile != NULL && streq(outfile, infile)) {
263 f_print(stderr, "%s: output would overwrite %s\n", cmdname,
267 fout = fopen(outfile, "w");
269 f_print(stderr, "%s: unable to open ", cmdname);
273 record_open(outfile);
280 f_print(fout, "/*\n");
281 f_print(fout, " * Please do not edit this file.\n");
282 f_print(fout, " * It was generated using rpcgen.\n");
283 f_print(fout, " */\n\n");
286 /* clear list of arguments */
291 for( i=FIXEDARGS; i<ARGLISTLEN; i++ )
293 argcount = FIXEDARGS;
296 /* make sure that a CPP exists */
302 if (stat(CPP, &buf) < 0) { /* SVR4 or explicit cpp does not exist */
304 fprintf(stderr, "cannot find C preprocessor: %s \n", CPP);
306 } else { /* try the other one */
308 if (stat(CPP, &buf) < 0) { /* can't find any cpp */
309 fprintf(stderr, "cannot find any C preprocessor (cpp)\n");
317 * Open input file with given define for C-preprocessor
320 open_input(char *infile, char *define)
324 infilename = (infile == NULL) ? "<stdin>" : infile;
333 addarg((char *)NULL);
335 (void) dup2(pd[1], 1);
337 execv(arglist[0], arglist);
345 fin = fdopen(pd[0], "r");
347 f_print(stderr, "%s: ", cmdname);
353 /* valid tirpc nettypes */
354 static char* valid_ti_nettypes[] =
368 /* valid inetd nettypes */
369 static char* valid_i_nettypes[] =
377 check_nettype(char *name, char **list_to_check)
380 for( i = 0; list_to_check[i] != NULL; i++ ) {
381 if( strcmp( name, list_to_check[i] ) == 0 ) {
385 f_print( stderr, "illegal nettype :\'%s\'\n", name );
390 * Compile into an XDR routine output file
394 c_output(char *infile, char *define, int extend, char *outfile)
402 open_input(infile, define);
403 outfilename = extend ? extendfile(infile, outfile) : outfile;
404 open_output(infile, outfilename);
406 if (infile && (include = extendfile(infile, ".h"))) {
407 f_print(fout, "#include \"%s\"\n", include);
409 /* .h file already contains rpc/rpc.h */
411 f_print(fout, "#include <rpc/rpc.h>\n");
413 while ((def = get_definition()) != NULL) {
416 if (extend && tell == ftell(fout)) {
417 (void) unlink(outfilename);
426 /* add all the starting basic types */
429 add_type(1,"int32_t");
434 add_type(1,"u_int32_t");
435 add_type(1,"u_short");
439 char rpcgen_table_dcl[] = "struct rpcgen_table {\n\
441 xdrproc_t xdr_arg;\n\
443 xdrproc_t xdr_res;\n\
449 generate_guard(char *pathname)
451 char* filename, *guard, *tmp;
453 filename = strrchr(pathname, '/' ); /* find last component */
454 filename = ((filename == 0) ? pathname : filename+1);
455 guard = strdup(filename);
456 /* convert to upper case */
460 *tmp = toupper(*tmp);
464 guard = extendfile(guard, "_H_RPCGEN");
469 * Compile into an XDR header file
472 h_output(char *infile, char *define, int extend, char *outfile)
480 open_input(infile, define);
481 outfilename = extend ? extendfile(infile, outfile) : outfile;
482 open_output(infile, outfilename);
484 guard = generate_guard( outfilename ? outfilename: infile );
486 f_print(fout,"#ifndef _%s\n#define _%s\n\n", guard,
489 f_print(fout, "#include <rpc/rpc.h>\n\n");
491 f_print(fout, "#ifndef IXDR_GET_INT32\n");
492 f_print(fout, "#define IXDR_GET_INT32(buf) IXDR_GET_LONG((buf))\n");
493 f_print(fout, "#endif\n");
494 f_print(fout, "#ifndef IXDR_PUT_INT32\n");
495 f_print(fout, "#define IXDR_PUT_INT32(buf, v) IXDR_PUT_LONG((buf), (v))\n");
496 f_print(fout, "#endif\n");
497 f_print(fout, "#ifndef IXDR_GET_U_INT32\n");
498 f_print(fout, "#define IXDR_GET_U_INT32(buf) IXDR_GET_U_LONG((buf))\n");
499 f_print(fout, "#endif\n");
500 f_print(fout, "#ifndef IXDR_PUT_U_INT32\n");
501 f_print(fout, "#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_U_LONG((buf), (v))\n");
502 f_print(fout, "#endif\n");
505 /* print data definitions */
506 while ((def = get_definition()) != NULL) {
510 /* print function declarations.
511 Do this after data definitions because they might be used as
512 arguments for functions */
513 for (l = defined; l != NULL; l = l->next) {
514 print_funcdef(l->val);
516 if (extend && tell == ftell(fout)) {
517 (void) unlink(outfilename);
518 } else if (tblflag) {
519 f_print(fout, rpcgen_table_dcl);
521 f_print(fout, "\n#endif /* !_%s */\n", guard);
525 * Compile into an RPC service
528 s_output(int argc, char **argv, char *infile, char *define, int extend,
529 char *outfile, int nomain, int netflag)
533 int foundprogram = 0;
536 open_input(infile, define);
537 outfilename = extend ? extendfile(infile, outfile) : outfile;
538 open_output(infile, outfilename);
540 if (infile && (include = extendfile(infile, ".h"))) {
541 f_print(fout, "#include \"%s\"\n", include);
544 f_print(fout, "#include <rpc/rpc.h>\n");
546 f_print(fout, "#include <stdio.h>\n");
547 f_print(fout, "#include <stdlib.h>/* getenv, exit */\n");
549 f_print (fout, "#include <rpc/pmap_clnt.h> /* for pmap_unset */\n");
550 f_print (fout, "#include <string.h> /* strcmp */ \n");
552 if (strcmp(svcclosetime, "-1") == 0)
554 else if (strcmp(svcclosetime, "0") == 0)
556 else if (inetdflag || pmflag) {
557 f_print(fout, "#include <signal.h>\n");
562 if( !tirpcflag && inetdflag )
563 f_print(fout, "#include <sys/ttycom.h>/* TIOCNOTTY */\n");
565 if( Cflag && (inetdflag || pmflag ) ) {
566 f_print(fout, "#ifdef __cplusplus\n");
567 f_print(fout, "#include <sysent.h> /* getdtablesize, open */\n");
568 f_print(fout, "#endif /* __cplusplus */\n");
571 f_print(fout, "#include <unistd.h> /* setsid */\n");
574 f_print(fout, "#include <sys/types.h>\n");
576 f_print(fout, "#include <memory.h>\n");
578 f_print(fout, "#include <stropts.h>\n");
580 if (inetdflag || !tirpcflag ) {
581 f_print(fout, "#include <sys/socket.h>\n");
582 f_print(fout, "#include <netinet/in.h>\n");
585 if ( (netflag || pmflag) && tirpcflag ) {
586 f_print(fout, "#include <netconfig.h>\n");
588 if (/*timerflag &&*/ tirpcflag)
589 f_print(fout, "#include <sys/resource.h> /* rlimit */\n");
590 if (logflag || inetdflag || pmflag) {
592 f_print(fout, "#include <syslog.h>\n");
594 f_print(fout, "#ifdef SYSLOG\n");
595 f_print(fout, "#include <syslog.h>\n");
596 f_print(fout, "#else\n");
597 f_print(fout, "#define LOG_ERR 1\n");
598 f_print(fout, "#define openlog(a, b, c)\n");
599 f_print(fout, "#endif\n");
604 f_print(fout, "\n#ifdef __STDC__\n#define SIG_PF void(*)(int)\n#endif\n");
606 f_print(fout, "\n#ifdef DEBUG\n#define RPC_SVC_FG\n#endif\n");
608 f_print(fout, "\n#define _RPCSVC_CLOSEDOWN %s\n", svcclosetime);
609 while ((def = get_definition()) != NULL) {
610 foundprogram |= (def->def_kind == DEF_PROGRAM);
612 if (extend && !foundprogram) {
613 (void) unlink(outfilename);
616 write_most(infile, netflag, nomain);
618 if( !do_registers(argc, argv) ) {
620 (void) unlink(outfilename);
628 * generate client side stubs
631 l_output(char *infile, char *define, int extend, char *outfile)
635 int foundprogram = 0;
638 open_input(infile, define);
639 outfilename = extend ? extendfile(infile, outfile) : outfile;
640 open_output(infile, outfilename);
643 f_print (fout, "#include <memory.h> /* for memset */\n");
644 if (infile && (include = extendfile(infile, ".h"))) {
645 f_print(fout, "#include \"%s\"\n", include);
648 f_print(fout, "#include <rpc/rpc.h>\n");
649 while ((def = get_definition()) != NULL) {
650 foundprogram |= (def->def_kind == DEF_PROGRAM);
652 if (extend && !foundprogram) {
653 (void) unlink(outfilename);
660 * generate the dispatch table
663 t_output(char *infile, char *define, int extend, char *outfile)
666 int foundprogram = 0;
669 open_input(infile, define);
670 outfilename = extend ? extendfile(infile, outfile) : outfile;
671 open_output(infile, outfilename);
673 while ((def = get_definition()) != NULL) {
674 foundprogram |= (def->def_kind == DEF_PROGRAM);
676 if (extend && !foundprogram) {
677 (void) unlink(outfilename);
683 /* sample routine for the server template */
685 svc_output(char *infile, char *define, int extend, char *outfile)
692 open_input(infile, define);
693 outfilename = extend ? extendfile(infile, outfile) : outfile;
694 checkfiles(infile,outfilename); /*check if outfile already exists.
695 if so, print an error message and exit*/
696 open_output(infile, outfilename);
699 if (infile && (include = extendfile(infile, ".h"))) {
700 f_print(fout, "#include \"%s\"\n", include);
703 f_print(fout, "#include <rpc/rpc.h>\n");
706 while ((def = get_definition()) != NULL) {
707 write_sample_svc(def);
709 if (extend && tell == ftell(fout)) {
710 (void) unlink(outfilename);
715 /* sample main routine for client */
717 clnt_output(char *infile, char *define, int extend, char *outfile)
725 open_input(infile, define);
726 outfilename = extend ? extendfile(infile, outfile) : outfile;
727 checkfiles(infile, outfilename); /*check if outfile already exists.
728 if so, print an error message and exit*/
730 open_output(infile, outfilename);
732 if (infile && (include = extendfile(infile, ".h"))) {
733 f_print(fout, "#include \"%s\"\n", include);
736 f_print(fout, "#include <rpc/rpc.h>\n");
738 while ((def = get_definition()) != NULL) {
739 has_program += write_sample_clnt(def);
743 write_sample_clnt_main();
745 if (extend && tell == ftell(fout)) {
746 (void) unlink(outfilename);
751 * Perform registrations for service output
752 * Return 0 if failed; 1 otherwise.
755 do_registers(int argc, char **argv)
759 if (inetdflag || !tirpcflag) {
760 for (i = 1; i < argc; i++) {
761 if (streq(argv[i], "-s")) {
762 if (!check_nettype(argv[i + 1], valid_i_nettypes))
764 write_inetd_register(argv[i + 1]);
769 for (i = 1; i < argc; i++)
770 if (streq(argv[i], "-s")) {
771 if (!check_nettype(argv[i + 1], valid_ti_nettypes))
773 write_nettype_register(argv[i + 1]);
775 } else if (streq(argv[i], "-n")) {
776 write_netid_register(argv[i + 1]);
784 * Add another argument to the arg list
789 if (argcount >= ARGLISTLEN) {
790 f_print(stderr, "rpcgen: too many defines\n");
794 arglist[argcount++] = cp;
799 putarg(int where, char *cp)
801 if (where >= ARGLISTLEN) {
802 f_print(stderr, "rpcgen: arglist coding error\n");
811 * if input file is stdin and an output file is specified then complain
812 * if the file already exists. Otherwise the file may get overwritten
813 * If input file does not exist, exit with an error
817 checkfiles(char *infile, char *outfile)
822 if(infile) /* infile ! = NULL */
823 if(stat(infile,&buf) < 0)
829 if (stat(outfile, &buf) < 0)
830 return; /* file does not exist */
833 "file '%s' already exists and may be overwritten\n", outfile);
840 * Parse command line arguments
843 parseargs(int argc, char **argv, struct commandline *cmd)
848 char flag[(1 << 8 * sizeof(char))];
852 cmd->infile = cmd->outfile = NULL;
867 for (i = 1; i < argc; i++) {
868 if (argv[i][0] != '-') {
870 f_print( stderr, "Cannot specify more than one input file!\n");
874 cmd->infile = argv[i];
876 for (j = 1; argv[i][j] != 0; j++) {
893 /* sample flag: Ss or Sc.
894 Ss means set flag['S'];
895 Sc means set flag['C']; */
896 c = argv[i][++j]; /* get next char */
909 case 'C': /* ANSI C syntax */
913 case 'b': /* turn TIRPC flag off for
914 generating backward compatible
932 svcclosetime = argv[i];
941 Inline = atoi(argv[i]);
946 if (argv[i][j - 1] != '-' ||
947 argv[i][j + 1] != 0) {
955 if (!streq(argv[i], "udp") &&
956 !streq(argv[i], "tcp")) {
959 } else if (c == 'o') {
963 cmd->outfile = argv[i];
967 if (argv[i][j - 1] != '-') {
970 (void) addarg(argv[i]);
976 (void) strcpy(pathbuf, argv[i]);
977 (void) strcat(pathbuf, "/cpp");
993 cmd->cflag = flag['c'];
994 cmd->hflag = flag['h'];
995 cmd->lflag = flag['l'];
996 cmd->mflag = flag['m'];
997 cmd->nflag = flag['n'];
998 cmd->sflag = flag['s'];
999 cmd->tflag = flag['t'];
1000 cmd->Ssflag = flag['S'];
1001 cmd->Scflag = flag['C'];
1004 pmflag = inetdflag ? 0 : 1; /* pmflag or inetdflag is always TRUE */
1005 if( (inetdflag && cmd->nflag)) { /* netid not allowed with inetdflag */
1006 f_print(stderr, "Cannot use netid flag with inetd flag!\n");
1009 } else { /* 4.1 mode */
1010 pmflag = 0; /* set pmflag only in tirpcmode */
1011 inetdflag = 1; /* inetdflag is TRUE by default */
1012 if( cmd->nflag ) { /* netid needs TIRPC */
1013 f_print( stderr, "Cannot use netid flag without TIRPC!\n");
1018 if( newstyle && ( tblflag || cmd->tflag) ) {
1019 f_print( stderr, "Cannot use table flags with newstyle!\n");
1023 /* check no conflicts with file generation flags */
1024 nflags = cmd->cflag + cmd->hflag + cmd->lflag + cmd->mflag +
1025 cmd->sflag + cmd->nflag + cmd->tflag + cmd->Ssflag + cmd->Scflag;
1028 if (cmd->outfile != NULL || cmd->infile == NULL) {
1031 } else if (nflags > 1) {
1032 f_print( stderr, "Cannot have more than one file generation flag!\n");
1041 f_print(stderr, "usage: %s infile\n", cmdname);
1042 f_print(stderr, "\t%s [-a][-b][-C][-Dname[=value]] -i size [-I [-K seconds]] [-L][-N][-T] infile\n",
1044 f_print(stderr, "\t%s [-c | -h | -l | -m | -t | -Sc | -Ss] [-o outfile] [infile]\n",
1046 f_print(stderr, "\t%s [-s nettype]* [-o outfile] [infile]\n", cmdname);
1047 f_print(stderr, "\t%s [-n netid]* [-o outfile] [infile]\n", cmdname);
1055 f_print(stderr, "options:\n");
1056 f_print(stderr, "-a\t\tgenerate all files, including samples\n");
1057 f_print(stderr, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n");
1058 f_print(stderr, "-c\t\tgenerate XDR routines\n");
1059 f_print(stderr, "-C\t\tANSI C mode\n");
1060 f_print(stderr, "-Dname[=value]\tdefine a symbol (same as #define)\n");
1061 f_print(stderr, "-h\t\tgenerate header file\n");
1062 f_print(stderr, "-i size\t\tsize at which to start generating inline code\n");
1063 f_print(stderr, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n");
1064 f_print(stderr, "-K seconds\tserver exits after K seconds of inactivity\n");
1065 f_print(stderr, "-l\t\tgenerate client side stubs\n");
1066 f_print(stderr, "-L\t\tserver errors will be printed to syslog\n");
1067 f_print(stderr, "-m\t\tgenerate server side stubs\n");
1068 f_print(stderr, "-n netid\tgenerate server code that supports named netid\n");
1069 f_print(stderr, "-N\t\tsupports multiple arguments and call-by-value\n");
1070 f_print(stderr, "-o outfile\tname of the output file\n");
1071 f_print(stderr, "-s nettype\tgenerate server code that supports named nettype\n");
1072 f_print(stderr, "-Sc\t\tgenerate sample client code that uses remote procedures\n");
1073 f_print(stderr, "-Ss\t\tgenerate sample server code that defines remote procedures\n");
1074 f_print(stderr, "-t\t\tgenerate RPC dispatch table\n");
1075 f_print(stderr, "-T\t\tgenerate code to support RPC dispatch tables\n");
1076 f_print(stderr, "-Y path\t\tdirectory name to find C preprocessor (cpp)\n");