BSD 4_4_Lite1 release
[unix-history] / usr / src / lib / librpc / man / man1 / rpcgen.1
index 4ca4aa9..6c50cec 100644 (file)
-.\" @(#)rpcgen.1       2.2 88/08/02 4.0 RPCSRC
-.ds lq \|(\|
-.ds rq \|)\|
-.TH RPCGEN 1 "18 January 1988"
-.SH NAME
-rpcgen \- an RPC protocol compiler
-.SH SYNOPSIS
-.BI rpcgen " infile"
-.br
-.B rpcgen
-.BR \-c \|| \|\-h \|| \|\-l \||\fB\|\-m
-[
-.BI \-o " outfile"
-]
-[
-.I infile
-]
-.br
-.B rpcgen \-s
-.I transport
-[
-.BI \-o " outfile"
-]
-[
-.I infile
-]
-.br
-.SH DESCRIPTION
-.IX "compilers" rpcgen "" "\fLrpcgen\fR \(em generate RPC protocols, C header files"
-.IX rpcgen "" "\fLrpcgen\fR \(em generate RPC protocol, C header files, and server skeleton"
-.IX RPC "generate protocols \(em \fLrpcgen\fR"
-.B rpcgen
-is a tool that generates C
+.\" Copyright 1991 The Regents of the University of California.
+.\" All rights reserved.
+.\"
+.\" Derived from Sun Microsystems rpcgen.1        2.2 88/08/02 4.0 RPCSRC
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    @(#)rpcgen.1    5.4 (Berkeley) 12/30/93
+.\"
+.Dd December 30, 1993
+.Dt RPCGEN 1
+.Sh NAME
+.Nm rpcgen
+.Nd an
+.Tn RPC
+protocol compiler
+.Sh SYNOPSIS
+.Nm rpcgen Ar infile
+.Nm rpcgen
+.Fl c | Fl h | Fl l |
+.Fl m
+.Op Fl o Ar outfile
+.Op Ar infile
+.Nm rpcgen Fl s Ar transport
+.Op Fl o Ar outfile
+.Op Ar infile
+.Sh DESCRIPTION
+.Nm rpcgen
+is a tool that generates
+.Tn \&C
 code to implement an
 code to implement an
-.SM RPC
+.Tn RPC
 protocol.  The input to
 protocol.  The input to
-.B rpcgen
+.Nm rpcgen
 is a language similar to C
 known as
 is a language similar to C
 known as
-.SM RPC
+.Tn RPC
 Language (Remote Procedure Call Language).  Information
 about the syntax of
 Language (Remote Procedure Call Language).  Information
 about the syntax of
-.SM RPC
+.Tn RPC
 Language is available in the
 Language is available in the
-.RI ` rpcgen ' " Programming Guide."
-.LP
-.B rpcgen
+.Rs
+.%T "Rpcgen Programming Guide"
+.Re
+.Pp
+Available options:
+.Bl -tag -width indent
+.It Fl c
+Compile into
+.Dv XDR
+routines.
+.It Fl h
+Compile into
+.Tn \&C
+data-definitions (a header file)
+.It Fl l
+Compile into client-side stubs.
+.It Fl m
+Compile into server-side stubs, but do not generate a
+.Em main
+routine.
+This option is useful for doing callback-routines and for people who
+need to write their own
+.Em main
+routine to do initialization.
+.It Fl o Ar outfile
+Specify the name of the output file.
+If none is specified, standard output is used
+.Pf ( Fl c ,
+.Fl h ,
+.Fl l
+and
+.Fl s
+modes only).
+.It Fl s Ar transport
+Compile into server-side stubs, using the given transport.  The
+supported transports
+are
+.Tn UDP
+and
+.Tn TCP .
+This option may be invoked more than once
+so as to compile a server that serves multiple transports.
+.El
+.Pp
+.Nm rpcgen
 is normally used as in the first synopsis where it takes an input file
 and generates four output files. If the
 is normally used as in the first synopsis where it takes an input file
 and generates four output files. If the
-.I infile
+.Ar infile
 is named
 is named
-.BR proto.x ,
+.Pa proto.x ,
 then
 then
-.B rpcgen
+.Nm rpcgen
 will generate a header file in
 will generate a header file in
-.BR proto.h ,
-.SM XDR
+.Pa proto.h ,
+.Dv XDR
 routines in
 routines in
-.BR proto_xdr.c ,
+.Pa proto_xdr.c ,
 server-side stubs in
 server-side stubs in
-.BR proto_svc.c ,
+.Pa proto_svc.c ,
 and client-side stubs in
 and client-side stubs in
-.BR proto_clnt.c .
-.LP
+.Pa proto_clnt.c .
+.Pp
 The other synopses shown above are used when one does not want to
 generate all the output files, but only a particular one.  Their
 usage is described in the
 The other synopses shown above are used when one does not want to
 generate all the output files, but only a particular one.  Their
 usage is described in the
-.SM USAGE
+.Sx USAGE
 section below.
 section below.
-.LP
+.Pp
 The C-preprocessor,
 The C-preprocessor,
-.BR cpp (1),
+.Xr cpp 1 ,
 is run on all input files before they are actually
 interpreted by
 is run on all input files before they are actually
 interpreted by
-.BR rpcgen ,
+.Nm rpcgen ,
 so all the
 so all the
-.B cpp
+.Xr cpp
 directives are legal within an
 directives are legal within an
-.B rpcgen
+.Nm rpcgen
 input file.  For each type of output file,
 input file.  For each type of output file,
-.B rpcgen
+.Nm rpcgen
 defines a special
 defines a special
-.B cpp
+.Xr cpp
 symbol for use by the
 symbol for use by the
-.B rpcgen
+.Nm rpcgen
 programmer:
 programmer:
-.PP
-.PD 0
-.TP 12
-.SM RPC_HDR
+.Pp
+.Bl -tag -width "RPC_CLNT"
+.It Dv RPC_HDR
 defined when compiling into header files
 defined when compiling into header files
-.TP
-.SM RPC_XDR
+.It Dv RPC_XDR
 defined when compiling into
 defined when compiling into
-.SM XDR
+.Dv XDR
 routines
 routines
-.TP
-.SM RPC_SVC
+.It Dv RPC_SVC
 defined when compiling into server-side stubs
 defined when compiling into server-side stubs
-.TP
-.SM RPC_CLNT
+.It Dv RPC_CLNT
 defined when compiling into client-side stubs
 defined when compiling into client-side stubs
-.PD
-.LP
+.El
+.Pp
 In addition,
 In addition,
-.B rpcgen
+.Nm rpcgen
 does a little preprocessing of its own.
 Any line beginning with
 does a little preprocessing of its own.
 Any line beginning with
-.RB ` % '
+.Ql \&%
 is passed directly into the output file, uninterpreted by
 is passed directly into the output file, uninterpreted by
-.BR rpcgen .
-.LP
+.Nm rpcgen .
+.Pp
 You can customize some of your
 You can customize some of your
-.SM XDR
+.Dv XDR
 routines by leaving those data
 types undefined.  For every data type that is undefined,
 routines by leaving those data
 types undefined.  For every data type that is undefined,
-.B rpcgen
+.Nm rpcgen
 will assume that there exists a routine with the name
 will assume that there exists a routine with the name
-.B xdr_
+.Em xdr_
 prepended to the name of the undefined type.
 prepended to the name of the undefined type.
-.SH OPTIONS
-.TP
-.B \-c
-Compile into
-.SM XDR
-routines.
-.TP
-.B \-h
-Compile into
-.B C
-data-definitions (a header file)
-.TP
-.B \-l
-Compile into client-side stubs.
-.TP
-.B \-m
-Compile into server-side stubs, but do not generate a \*(lqmain\*(rq routine.
-This option is useful for doing callback-routines and for people who
-need to write their own \*(lqmain\*(rq routine to do initialization.
-.TP
-.BI \-o " outfile"
-Specify the name of the output file.
-If none is specified, standard output is used
-.RB ( \-c ,
-.BR \-h ,
-.B \-l
-and
-.B \-s
-modes only).
-.TP
-.BI \-s " transport"
-Compile into server-side stubs, using the the given transport.  The
-supported transports
-are
-.B udp
-and
-.BR tcp .
-This option may be invoked more than once
-so as to compile a server that serves multiple transports.
-.br
-.ne 5
-.SH "SEE ALSO"
-.BR cpp (1)
-.LP
-.RI ` rpcgen ' " Programming Guide."
-.br
-.ne 4
-.SH BUGS
-.LP
+.Sh SEE ALSO
+.Xr cpp 1
+.Rs
+.%T "Rpcgen Programming Guide"
+.%I "Sun Microsystems"
+.Re
+.Sh BUGS
+.Pp
 Nesting is not supported.
 As a work-around, structures can be declared at
 top-level, and their name used inside other structures in order to achieve
 the same effect.
 Nesting is not supported.
 As a work-around, structures can be declared at
 top-level, and their name used inside other structures in order to achieve
 the same effect.
-.LP
+.Pp
 Name clashes can occur when using program definitions, since the apparent
 scoping does not really apply. Most of these can be avoided by giving
 unique names for programs, versions, procedures and types.
 Name clashes can occur when using program definitions, since the apparent
 scoping does not really apply. Most of these can be avoided by giving
 unique names for programs, versions, procedures and types.