Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xdr_admin(3N) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rpc(3N)

xdr_admin(3N)                                                 xdr_admin(3N)

NAME
     xdradmin: xdrgetpos, xdrinline, xdrreceof, xdrsetpos - library
     routines for external data representation

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.

     These routines deal specifically with the management of the XDR han-
     dle.

     If you use one of the XDR functions, you must link the libnsl library
     at compilation (cc -lnsl).

   Routines

     See rpc(3N) for the definition of the XDR data structure.

     #include <rpc/xdr.h>

     uint
     xdrgetpos(const XDR *xdrs);

          A macro that invokes the get-position routine associated with the
          XDR handle, xdrs. 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.

     long *
     xdrinline(XDR *xdrs, const int len);

          A macro that invokes the in-line routine associated with the XDR
          handle, xdrs. The routine returns a pointer to a contiguous piece
          of the stream's buffer; len is the byte length of the desired
          buffer.

          Note: pointer is cast to long *.

          Warning: xdrinline may return NULL (0) 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.







Page 1                       Reliant UNIX 5.44                Printed 11/98

xdr_admin(3N)                                                 xdr_admin(3N)

     boolt
     xdrreceof(XDR *xdrs);

          This routine can be invoked only on streams created by
          xdrreccreate. After consuming the rest of the current record in
          the stream, this routine returns 1 if the stream has no more
          input, 0 otherwise.

     boolt
     xdrsetpos(XDR *xdrs, const uint pos);

          A macro that invokes the set position routine associated with the
          XDR stream xdrs. The parameter pos is a position value obtained
          from xdrgetpos. This routine returns 1 if the XDR stream was
          repositioned, and 0 otherwise.

          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.

SEE ALSO
     rpc(3N), xdrcomplex(3N), xdrcreate(3N), xdrsimple(3N).































Page 2                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026