OSF DCE Application Development Guide--Core Components
Interface Definition Language
Examples of pointers are shown at the end of this section.
17.14.7.1.1 Reference Pointers
A reference pointer is the least complex form of pointer. The most common use for this
class of pointer is as a passing mechanism; for example, passing an integer by reference.
Reference pointers have significantly better performance than full pointers, but are
restrictive; you cannot create a linked list by using a reference pointer because a
reference pointer cannot have a NULL value, and the list cannot be terminated.
A reference pointer has the following characteristics:
• It always points to valid storage; it can never have a NULL value.
• Its value does not change during a call; it always points to the same storage on return
from the call as it did when the call was made.
• It does not support aliasing; it cannot point to a storage area that is pointed to by any
other pointer used in a parameter of the same operation.
When a manager routine is entered, all the reference pointers in its parameters will point
to valid storage, except those reference pointers that point neither to targets whose size
can be determined at compile time nor to values that have been received from the client.
In the following example, the size of the targets of the reference pointers can be
calculated at compilation time:
typedef [ref] long *rpl;
void op1( [in] long f,
[in] long l,
[in,first_is(f),last_is(l)] rpl rpla[10] );
For this example, when the manager is entered, all the pointers in rpla will point to
usable storage, although only *rpla[f] through *rpla[l] will be the values received from
the client.
Conversely, the size of the targets of the reference pointers cannot be calculated at
compile time in the following example:
typedef [ref,string] char *rps;
void op1( [in] long f,
[in] long l,
[in,first_is(f),last_is(l)] rps rpsa[10] );
In this case, only rpsa[f] through rpsa[l], which point to values received from the client,
will point to usable storage.
124245 Tandem Computers Incorporated 17− 43