'\"macro stdmacro
.if n .pH g3n.xdr_admin @(#)xdr_admin	40.4 of 10/10/89
.\" Copyright 1989 AT&T
'\"macro stdmacro
.nr X
.if \nX=0 .ds x} xdr_admin 3N "" "\&"
.if \nX=1 .ds x} xdr_admin 3N ""
.if \nX=2 .ds x} xdr_admin 3N "" "\&"
.if \nX=3 .ds x} xdr_admin "" "" "\&"
.TH \*(x}
.SH NAME
.na
\f4xdr_admin\fP: \f4 xdr_getpos\f1, \f4xdr_inline\f1, \f4xdrrec_eof\f1, \f4xdr_setpos\f1 \- library routines for external data representation
.ad
.SH DESCRIPTION
XDR library routines allow C programmers to describe
arbitrary data structures in a machine-independent fashion.
Protocols such as remote procedure calls (RPC)
use these routines to describe the format of the data.
.P
These routines deal specifically with the management of the
XDR stream.
.SS Routines
See \f4rpc\fP(3N) for the definition of the
\f4XDR\f1
data structure.
.br
.P
.ft 4
.nf
#include <rpc/xdr.h>
.fi
.ft 1
.br
.if t .ne 8
.P
.ft 4
.nf
.sp .5
u_int
xdr_getpos(const XDR *xdrs);
.fi
.ft 1
.IP
A macro that invokes the get-position routine
associated with the XDR stream,
\f2xdrs\f1.
The routine returns an unsigned integer,
which indicates the position of the
XDR
byte stream.
A desirable feature of XDR
streams is that simple arithmetic works with this number,
although the XDR
stream instances need not guarantee this.
Therefore, applications written for
portability should not depend on this feature.
.br
.if t .ne 4
.P
.ft 4
.nf
.sp .5
long *
xdr_inline(XDR *xdrs; const int len);
.fi
.ft 1
.IP
A macro that invokes the in-line routine associated with the
XDR stream,
\f2xdrs\f1.
The routine returns a pointer
to a contiguous piece of the stream's buffer;
\f2len\f1
is the byte length of the desired buffer.
Note:
pointer is cast to
\f4long *\f1.
.IP
Warning:
\f4xdr_inline\f1
may return \f4NULL\fP (\f40\f1)
if it cannot allocate a contiguous piece of a buffer.
Therefore the behavior may vary among stream instances;
it exists for the sake of efficiency,
and  applications written for
portability should not depend on this feature.
.br
.if t .ne 8
.P
.ft 4
.nf
.sp .5
bool_t
xdrrec_eof(XDR *xdrs);
.fi
.ft 1
.IP
This routine can be invoked only on
streams created by
\f4xdrrec_create\f1.
After consuming the rest of the current record in the stream,
this routine returns \f41\f1 if the stream has no more input,
\f40\f1 otherwise.
.br
.if t .ne 10
.P
.ft 4
.nf
.sp .5
bool_t
xdr_setpos(XDR *xdrs, const u_int pos);
.fi
.ft 1
.IP
A macro that invokes the set position routine associated with
the
XDR
stream
\f2xdrs\f1.
The parameter
\f2pos\f1
is a position value obtained from
\f4xdr_getpos\f1.
This routine returns \f41\f1 if the
XDR
stream was repositioned,
and \f40\f1 otherwise.
.IP
Warning:
it is difficult to reposition some types of
XDR
streams,
so this routine may fail with one
type of stream and succeed with another.
Therefore, applications written for
portability should not depend on this feature.
.SH SEE ALSO
.na
\f4rpc\fP(3N),
\f4xdr_complex\fP(3N),
\f4xdr_create\fP(3N),
\f4xdr_simple\fP(3N).
.ad
