xdr_setpos Macro

Purpose

Changes the current position in the XDR stream.

Library

C Library (libc.a)

Syntax

#include <rpc/xdr.h>

xdr_setpos ( xdrs,  pos)
XDR *xdrs;
u_int pos;

Description

The xdr_setpos macro invokes the set-position routine associated with the eXternal Data Representation (XDR) stream pointed to by the xdrs parameter. The new position setting is obtained from the xdr_getpos macro. The xdr_setpos macro returns a value of false if the set position is not valid or if the requested position is out of bounds.

A position cannot be set in some XDR streams. Trying to set a position in such streams causes the macro to fail. This macro also fails if the programmer requests a position that is not in the stream's boundaries.

Parameters

Item Description
xdrs Points to the XDR stream handle.
pos Specifies a position value obtained from the xdr_getpos macro.

Return Values

Upon successful completion (if the stream is positioned successfully), this macro returns a value of 1. If unsuccessful, it returns a value of 0.