xdr_bytes Subroutine

Purpose

Translates between internal counted byte arrays and their external representations.

Library

C Library (libc.a)

Syntax

#include <rpc/xdr.h>

xdr_bytes ( xdrs,  sp,  sizep,  maxsize)
XDR *xdrs;
char **sp;
u_int *sizep;
u_int maxsize;

Description

The xdr_bytes subroutine is a filter primitive that translates between counted byte arrays and their external representations. This subroutine treats a subset of generic arrays, in which the size of array elements is known to be 1 and the external description of each element is built-in. The length of the byte array is explicitly located in an unsigned integer. The byte sequence is not terminated by a null character. The external representation of the bytes is the same as their internal representation.

Parameters

Item Description
xdrs Points to the eXternal Data Representation (XDR) stream handle.
sp Specifies the address of the pointer to the byte array.
sizep Points to the length of the byte area. The value of this parameter cannot exceed the value of the maxsize parameter.
maxsize Specifies the maximum number of bytes allowed when XDR encodes or decodes messages.

Return Values

Upon successful completion, this subroutine returns a value of 1. If unsuccessful, it returns a value of 0.