Commit | Line | Data |
---|---|---|
9a4767d3 C |
1 | .\" from: @(#)rpcgen.1 2.2 88/08/02 4.0 RPCSRC |
2 | .\" $Id: rpcgen.1,v 1.4 1993/08/01 07:29:24 mycroft Exp $ | |
3 | .\" | |
4 | .Dd January 18, 1988 | |
5 | .Dt RPCGEN 1 | |
6 | .Os | |
7 | .Sh NAME | |
8 | .Nm rpcgen | |
9 | .Nd RPC protocol compiler | |
10 | .Sh SYNOPSIS | |
11 | .Nm rpcgen | |
12 | .Ar infile | |
13 | .Nm rpcgen | |
14 | .Fl c Li | | |
15 | .Fl h Li | | |
16 | .Fl l Li | | |
17 | .Fl m | |
18 | .Op Fl o Ar outfile | |
19 | .Op Ar infile | |
20 | .Nm rpcgen | |
21 | .Fl s Ar transport | |
22 | .Op Fl o Ar outfile | |
23 | .Op Ar infile | |
24 | .Sh DESCRIPTION | |
25 | .Nm rpcgen | |
26 | is a tool that generates C code to implement an | |
27 | .Tn RPC | |
28 | protocol. The input to | |
29 | .Nm rpcgen | |
30 | is a language similar to C known as | |
31 | .Tn RPC | |
32 | Language (Remote Procedure Call Language). Information about the | |
33 | syntax of | |
34 | .Tn RPC | |
35 | Language is available in the | |
36 | .Rs | |
37 | .%T "rpcgen Programming Guide" | |
38 | .Re | |
39 | .Pp | |
40 | .Nm rpcgen | |
41 | is normally used as in the first synopsis where it takes an input file | |
42 | and generates four output files. If the | |
43 | .Ar infile | |
44 | is named | |
45 | .Pa proto.x , | |
46 | then | |
47 | .Nm rpcgen | |
48 | will generate a header file in | |
49 | .Pa proto.h , | |
50 | .Tn XDR | |
51 | routines in | |
52 | .Pa proto_xdr.c , | |
53 | server-side stubs in | |
54 | .Pa proto_svc.c , | |
55 | and client-side stubs in | |
56 | .Pa proto_clnt.c . | |
57 | .Pp | |
58 | The other synopses shown above are used when one does not want to | |
59 | generate all the output files, but only a particular one. | |
60 | .\" Their usage is described in the | |
61 | .\" .Sx USAGE | |
62 | .\" section below. | |
63 | .Pp | |
64 | The C-preprocessor, | |
65 | .Xr cpp 1 , | |
66 | is run on all input files before they are actually | |
67 | interpreted by | |
68 | .Nm rpcgen , | |
69 | so all the | |
70 | .Xr cpp | |
71 | directives are legal within an | |
72 | .Nm rpcgen | |
73 | input file. For each type of output file, | |
74 | .Nm rpcgen | |
75 | defines a special | |
76 | .Xr cpp | |
77 | symbol for use by the | |
78 | .Nm rpcgen | |
79 | programmer: | |
80 | .Pp | |
81 | .Bl -tag -width RPC_CLNT -compact | |
82 | .It Dv RPC_HDR | |
83 | defined when compiling into header files | |
84 | .It Dv RPC_XDR | |
85 | defined when compiling into | |
86 | .Tn XDR | |
87 | routines | |
88 | .It Dv RPC_SVC | |
89 | defined when compiling into server-side stubs | |
90 | .It Dv RPC_CLNT | |
91 | defined when compiling into client-side stubs | |
92 | .El | |
93 | .Pp | |
94 | In addition, | |
95 | .Nm rpcgen | |
96 | does a little preprocessing of its own. Any line beginning with | |
97 | .Sq % | |
98 | is passed directly into the output file, uninterpreted by | |
99 | .Nm rpcgen . | |
100 | .Pp | |
101 | You can customize some of your | |
102 | .Tn XDR | |
103 | routines by leaving those data types undefined. For every data type | |
104 | that is undefined, | |
105 | .Nm rpcgen | |
106 | will assume that there exists a routine with the name | |
107 | .Tn xdr_ | |
108 | prepended to the name of the undefined type. | |
109 | .Sh OPTIONS | |
110 | .Bl -tag -width indent | |
111 | .It Fl c | |
112 | Compile into | |
113 | .Tn XDR | |
114 | routines. | |
115 | .It Fl h | |
116 | Compile into C data-definitions (a header file). | |
117 | .It Fl l | |
118 | Compile into client-side stubs. | |
119 | .It Fl m | |
120 | Compile into server-side stubs, but do not generate a | |
121 | .Fn main | |
122 | routine. This option is useful for doing callback-routines and for | |
123 | people who need to write their own | |
124 | .Fn main | |
125 | routine to do initialization. | |
126 | .It Fl o Ar outfile | |
127 | Specify the name of the output file. If none is specified, standard | |
128 | output is used ( | |
129 | .Fl c , | |
130 | .Fl h , | |
131 | .Fl l | |
132 | and | |
133 | .Fl s | |
134 | modes only). | |
135 | .It Fl s Ar transport | |
136 | Compile into server-side stubs, using the the given transport. The | |
137 | supported transports are | |
138 | .Tn udp | |
139 | and | |
140 | .Tn tcp . | |
141 | This option may be invoked more than once so as to compile a server | |
142 | that serves multiple transports. | |
143 | .El | |
144 | .Sh SEE ALSO | |
145 | .Xr cpp 1 | |
146 | .Rs | |
147 | .%T "rpcgen Programming Guide" | |
148 | .Re | |
149 | .Sh BUGS | |
150 | Nesting is not supported. As a work-around, structures can be | |
151 | declared at top-level, and their name used inside other structures in | |
152 | order to achieve the same effect. | |
153 | .Pp | |
154 | Name clashes can occur when using program definitions, since the | |
155 | apparent scoping does not really apply. Most of these can be avoided | |
156 | by giving unique names for programs, versions, procedures and types. |