CL Command Reference - CVTRPCSRC

CL Command List > CVTRPCSRC Reference

Description:

The Convert RPC Source (CVTRPCSRC) command generates C code from an input file written in the Remote Procedure Call (RPC) Language. The generated C code can be used to implement an RPC protocol.

This command is equivalent to running the rpcgen utility on a UNIX system.

This command can also be issued using the following alternative command name:
. RPCGEN

Restrictions:

1. The user must have execute (*X) authority to each directory in the path for both the input and output files.

2. The user must have read (*R) authority to the input file.

3. The user must have write, execute (*WX) authority to the output file directory.



Examples:

Example 1: Convert RPC Source to Default Files

CVTRPCSRC FROMFILE(ĄŻ/myrpcĄŻ) OPTION(*ALL)

This converts the RPC language file ĄŻ/myrpcĄŻ into all four file types, *XDR, *HDR, *CLTSTUB and *SVRSTUB. The default PROTOCOL(*TCP) is used to generate the server-side stub programs. The files are placed into the following file names:
. myrpc.h for a header file
. myrpc_xdr.c for an XDR file
. myrpc_clnt.c for client-side stubs
. myrpc_svc.c for server-side stubs



Example 2: Convert RPC Source to Client Stubs Only

CVTRPCSRC FROMFILE(ĄŻ/myrpc2ĄŻ) OPTION(*CLTSTUB)
TOFILE(ĄŻ/myclnt.cĄŻ)

This converts the RPC language file ĄŻ/myrpc2ĄŻ into client-side stub procedures. The results are placed into the file ĄŻ/myclnt.cĄŻ as specified.