z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


xdr_enum()

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

Format

#include <rpc.h>
bool_t
xdr_enum(xdrs, ep)
XDR *xdrs;
enum_t *ep;

Parameters

xdrs
Indicates the pointer to an XDR stream.
ep
Indicates the pointer to the enumerated number. enum_t can be any enumeration type, such as enum colors, with colors declared as enum colors (black, brown, red).

Usage

The xdr_enum() call translates between C-enumerated groups and their external representation. When calling the procedures callrpc() and registerrpc(), a stub procedure must be created for both the server and the client before the procedure of the application program using xdr_enum(). This procedure should look like the following:
#include <rpc.h>
enum colors (black, brown, red)
void
static xdr_enum_t(xdrs, ep)
XDR *xdrs;
enum colors *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 codes

The value 1 indicates success; the value 0 indicates an error.

Context

  • clnt_broadcast()
  • clnt_call()
  • clnt_freeres()
  • pmap_rmtcall()
  • registerrpc()
  • svc_freeargs()
  • svc_getargs()
  • svc_sendreply()

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014