XDR library routines allow C programmers to describe simple data structures in a machine-independent fashion. Protocols such as remote procedure calls (RPC) use these routines to describe the format of the data.
These routines require the creation of XDR streams (see xdr_create.3n
The
XDR
data structure is defined in the
RPC/XDR
Library Definitions of the
[a manual with the abbreviation NETP].
#include <rpc/xdr.h>
bool_t xdr_bool(xdrs, bp) XDR *xdrs; bool_t *bp;
A filter primitive that translates between a boolean (C
integer) and its external representation.
When encoding data, this
filter produces values of either one or zero.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_char(xdrs, cp) XDR *xdrs; char *cp;
A filter primitive that translates between a C character and its external representation. This routine returns TRUE if it succeeds, FALSE otherwise.
Note:
Encoded characters are not packed, and occupy 4 bytes each.
For arrays of characters, it is worthwhile to consider
xdr_bytes(),
xdr_opaque()
or
xdr_string() ,
see
xdr_complex.3n
bool_t xdr_double(xdrs, dp) XDR *xdrs; double *dp;
A filter primitive that translates between a C
double
precision number and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_enum(xdrs, ep) XDR *xdrs; enum_t *ep;
A filter primitive that translates between a C
enum
(actually integer) and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_float(xdrs, fp) XDR *xdrs; float *fp;
A filter primitive that translates between a C
float
and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
void xdr_free(proc, objp) xdrproc_t proc; char *objp;
Generic freeing routine.
The first argument is the
XDR
routine for the object being freed.
The second argument is a pointer to the object itself.
Note:
The pointer passed to this routine is
not
freed, but what it points to
is
freed, recursively such that objects pointed to are also freed
for example, linked lists.
bool_t xdr_int(xdrs, ip) XDR *xdrs; int *ip;
A filter primitive that translates between a C
integer
and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_long(xdrs, lp) XDR *xdrs; long *lp;
A filter primitive that translates between a C
long
integer and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_short(xdrs, sp) XDR *xdrs; short *sp;
A filter primitive that translates between a C
short
integer and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_u_char(xdrs, ucp) XDR *xdrs; unsigned char *ucp;
A filter primitive that translates between an
unsigned
C character and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_u_int(xdrs, up) XDR *xdrs; unsigned *up;
A filter primitive that translates between a C
unsigned
integer and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_u_long(xdrs, ulp) XDR *xdrs; unsigned long *ulp;
A filter primitive that translates between a C
unsigned long
integer and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_u_short(xdrs, usp) XDR *xdrs; unsigned short *usp;
A filter primitive that translates between a C
unsigned short
integer and its external representation.
This routine returns
TRUE
if it succeeds,
FALSE
otherwise.
bool_t xdr_void()
This routine always returns TRUE. It may be passed to RPC routines that require a function parameter, where nothing is to be done.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97