xdr_union(3) CLIX xdr_union(3)
NAME
xdr_union - Library function for external data representation
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
#include <sys/xdr.h>
xdr_union(
XDR *xdrs ,
int *dscmp ,
char *unp ,
struct xdr_discrim *choices ,
bool_t (*defaultarm)() );
PARAMETERS
xdrs Specifies the address for the XDR handle.
dscmp Points to the discriminant, which is used to select the
element in the choices array.
unp Specifies the address of the union itself.
choices Specifies the address of the array of [discriminant, proc]
pairs, which allows selection of the appropriate filter
function, based on its specifies discriminant.
defaultarm If not NULL, this parameter specifies the address for a
default filter procedure to call if the specifies
discriminant is not in the choices array.
DESCRIPTION
The xdr_union() function allows C programmers to describe arbitrary data
structures in a machine-independent fashion. Data for remote procedure
calls are transmitted using this function.
The xdr_union() function is a filter primitive that translates between a
discriminated C union and its corresponding external representation. It
first translates the discriminant of the union located at dscmp. This
discriminant is always an enum_t. Next the union located at unp is
translated. The choices parameter is a pointer to an array of xdr_discrim
structures. Each structure contains an ordered pair of ``[value, proc]''.
If the union's discriminant is equal to the associated value, the proc is
called to translate the union. The end of the xdr_discrim structure array
is denoted by a function of value NULL. If the discriminant is not found
2/94 - Intergraph Corporation 1
xdr_union(3) CLIX xdr_union(3)
in the choices array, the (*defaultarm)() procedure is called (if it's not
NULL).
RETURN VALUES
If successful, this function returns 1. Otherwise, it returns 0.
RELATED INFORMATION
Functions: xdr_bytes(3), xdr_getpos(3), xdr_pointer(3), xdrrec_create(3),
xdr_array(3), xdr_destroy(3), xdr_free(3), xdr_inline(3),
xdrmem_create(3), xdr_opaque(3), xdr_union(3), xdr_vector(3), xdr_void(3),
authunix_create(3), clnt_pcreateerror(3), clnt_perrno(3), clnt_perror(3),
clntraw_create(3), clnttcp_create(3), pmap_set(3), svc_getargs(3),
svc_getreqset(3), svc_register(3), svcerr_auth(3), svctcp_create(3),
xprt_register(3), clnt_broadcast(3), clnt_call(3), clnt_create(3),
clnt_control(3), clnt_destroy(3), clnt_freeres(3), clnt_geterr(3),
clnt_getmyaddr(3), registerrpc(3), svc_destroy(3), svc_getcaller(3),
svc_run(3), svc_sendreply(3), xdr_accepted_reply(3),
xdr_authunix_parms(3), xdr_callhdr(3), xdr_callmsg(3), xdr_opaque_auth(3),
xdr_pmap(3), xdr_pmaplist(3), xdr_rejected_reply(3), xdr_replymsg(3)
CLIX Programming Guide
XDR: External Data Representation Standard, RFC1014, Sun Microsystems,
Inc., USC-ISI
2 Intergraph Corporation - 2/94