[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 1

xdr_reference Subroutine

Purpose

Provides pointer chasing within structures.

Library

C Library (libc.a)

Syntax

#include <rpc/xdr.h>
xdr_reference (xdrs, pp, size, proc)
XDR *xdrs;
char **pp;
u_int size;
xdrproc_t proc;

Description

The xdr_reference subroutine is a filter primitive that provides pointer chasing within structures. This primitive allows the serializing, deserializing, and freeing of any pointers within one structure that are referenced by another structure.

The xdr_reference subroutine does not attach special meaning to a null pointer during serialization. Attempting to pass the address of a null pointer can cause a memory error. The programmer must describe data with a two-armed discriminated union. One arm is used when the pointer is valid; the other arm, when the pointer is null.

Parameters

xdrs Points to the eXternal Data Representation (XDR) stream handle.
pp Specifies the address of the pointer to the structure. When decoding data, XDR allocates storage if the pointer is null.
size Specifies the byte size of the structure pointed to by the pp parameter.
proc Translates the structure between its C form and its external representation. This parameter is the XDR procedure that describes the structure.

Return Values

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

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

List of XDR Programming References.

eXternal Data Representation (XDR) Overview for Programming and Understanding XDR Library Filter Primitives in AIX Version 4.3 Communications Programming Concepts.


[ Previous | Next | Contents | Glossary | Home | Search ]