Networking Services Library Functions xdrsimple(3NSL)
NAME
xdrsimple, xdrbool, xdrchar, xdrdouble, xdrenum,
xdrfloat, xdrfree, xdrhyper, xdrint, xdrlong,
xdrlonglongt, xdrquadruple, xdrshort, xdruchar,
xdruhyper, xdruint, xdrulong, xdrulonglongt,
xdrushort, xdrvoid - library routines for external data
representation
SYNOPSIS
#include
boolt xdrbool(XDR *xdrs, boolt *bp);
boolt xdrchar(XDR *xdrs, char *cp);
boolt xdrdouble(XDR *xdrs, double *dp);
boolt xdrenum(XDR *xdrs, enumt *ep);
boolt xdrfloat(XDR *xdrs, float *fp);
void xdrfree(xdrproct proc, char *objp);
boolt xdrhyper(XDR *xdrs, longlongt *llp);
boolt xdrint(XDR *xdrs, int *ip);
boolt xdrlong(XDR *xdrs, longt *lp);
boolt xdrlonglongt(XDR *xdrs, longlongt *llp);
boolt xdrquadruple(XDR *xdrs, long double *pq);
boolt xdrshort(XDR *xdrs, short *sp);
boolt xdruchar(XDR *xdrs, unsigned char *ucp);
SunOS 5.11 Last change: 27 Aug 2001 1
Networking Services Library Functions xdrsimple(3NSL)
boolt xdruhyper(XDR *xdrs, ulonglongt *ullp);
boolt xdruint(XDR *xdrs, unsigned *up);
boolt xdrulong(XDR *xdrs, unsigned long *ulp);
boolt xdrulonglongt(XDR *xdrs, ulonglongt *ullp);
boolt xdrushort(XDR xdrs, unsigned short *usp);
boolt xdrvoid(void)
DESCRIPTION
The 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
xdrcreate(3NSL)).
Routines
See rpc(3NSL) for the definition of the XDR data structure.
Note that any buffers passed to the XDR routines must be
properly aligned. It is suggested that malloc(3C) be used to
allocate these buffers or that the programmer insure that
the buffer address is divisible evenly by four.
xdrbool() xdrbool() translates between booleans
(C integers) and their external
representations. When encoding data,
this filter produces values of either
1 or 0. This routine returns TRUE if
it succeeds, FALSE otherwise.
xdrchar() xdrchar() translates between C char-
acters and their external representa-
tions. 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 con-
sider xdrbytes(), xdropaque(), or
xdrstring() (see xdrcomplex(3NSL)).
SunOS 5.11 Last change: 27 Aug 2001 2
Networking Services Library Functions xdrsimple(3NSL)
xdrdouble() xdrdouble() translates between C dou-
ble precision numbers and their exter-
nal representations. This routine
returns TRUE if it succeeds, FALSE
otherwise.
xdrenum() xdrenum() translates between C enums
(actually integers) and their external
representations. This routine returns
TRUE if it succeeds, FALSE otherwise.
xdrfloat() xdrfloat() translates between C
floats and their external representa-
tions. This routine returns TRUE if it
succeeds, FALSE otherwise.
xdrfree() Generic freeing routine. The first
argument is the XDR routine for the
object being freed. The second argu-
ment 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,
depending on the XDR routine).
xdrhyper() xdrhyper() translates between ANSI C
long long integers and their external
representations. This routine returns
TRUE if it succeeds, FALSE otherwise.
xdrint() xdrint() translates between C
integers and their external represen-
tations. This routine returns TRUE if
it succeeds, FALSE otherwise.
xdrlong() xdrlong() translates between C long
integers and their external represen-
tations. This routine returns TRUE if
it succeeds, FALSE otherwise.
In a 64-bit environment, this routine
returns an error if the value of lp is
outside the range [INT32MIN,
INT32MAX]. The xdrint() routine is
recommended in place of this routine.
SunOS 5.11 Last change: 27 Aug 2001 3
Networking Services Library Functions xdrsimple(3NSL)
xdrlonglongt() xdrlonglongt() translates between
ANSI C long long integers and their
external representations. This routine
returns TRUE if it succeeds, FALSE
otherwise. This routine is identical
to xdrhyper().
xdrquadruple() xdrquadruple() translates between
IE quadruple precision floating
point numbers and their external
representations. This routine returns
TRUE if it succeeds, FALSE otherwise.
xdrshort() xdrshort() translates between C short
integers and their external represen-
tations. This routine returns TRUE if
it succeeds, FALSE otherwise.
xdruchar() xdruchar() translates between
unsigned C characters and their exter-
nal representations. This routine
returns TRUE if it succeeds, FALSE
otherwise.
xdruhyper() xdruhyper() translates between
unsigned ANSI C long long integers
and their external representations.
This routine returns TRUE if it
succeeds, FALSE otherwise.
xdruint() A filter primitive that translates
between a C unsigned integer and its
external representation. This routine
returns TRUE if it succeeds, FALSE
otherwise.
xdrulong() xdrulong() translates between C
unsigned long integers and their
external representations. This routine
returns TRUE if it succeeds, FALSE
otherwise.
In a 64-bit environment, this routine
returns an error if the value of ulp
is outside the range [0, UINT32MAX].
The xdruint() routine is recommended
SunOS 5.11 Last change: 27 Aug 2001 4
Networking Services Library Functions xdrsimple(3NSL)
in place of this routine.
xdrulonglongt() xdrulonglongt() translates between
unsigned ANSI C long long integers
and their external representations.
This routine returns TRUE if it
succeeds, FALSE otherwise. This rou-
tine is identical to xdruhyper().
xdrushort() xdrushort() translates between C
unsigned short integers and their
external representations. This routine
returns TRUE if it succeeds, FALSE
otherwise.
xdrvoid() This routine always returns TRUE. It
may be passed to RPC routines that
require a function parameter, where
nothing is to be done.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
MT-Level Safe
SEE ALSO
malloc(3C), rpc(3NSL), xdradmin(3NSL), xdrcomplex(3NSL),
xdrcreate(3NSL), attributes(5)
SunOS 5.11 Last change: 27 Aug 2001 5
|