The xdr_enum() call translates between C-enumerated groups and their external representations.
Syntax
#include <rpc\rpc.h> bool_t xdr_enum(xdrs, ep) XDR *xdrs; enum_t *ep;
Parameters
xdrs
Description
The xdr_enum() call translates between C-enumerated groups and their external representations. When you call the procedures callrpc() and registerrpc(), create a stub procedure for both the server and the client before the procedure of the application program using xdr_enum(). Verify that this procedure looks like the following:
#include <rpc\rpc.h> void static xdr_enum_t(xdrs, ep) XDR *xdrs; enum_t *ep; { xdr_enum(xdrs, ep) }The xdr_enum_t procedure is used as the inproc and outproc in both the client and server RPCs.
For example, an RPC client would contain the following lines:
... error = callrpc(argv[1],ENUMRCVPROG,VERSION,ENUMRCVPROC, xdr_enum_t,&innumber,xdr_enum_t,&outnumber); ...
An RPC server would contain the following line:
registerrpc(ENUMRCVPROG,VERSION,ENUMRCVPROC,xdr_enum_t, xdr_enum_t); ...
Return Values
The value 1 indicates success; the value 0 indicates an error.