OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
one more than the maximum number of characters the string is to hold. For instance, if a
string is to store 80 characters, the string must be declared with a size of 81:
/* A string type that holds 80 characters */
typedef
[string] char string_t [81];
If an array has the string attribute or if the type of an array has the string attribute, the
array cannot have the first_is, the last_is, or the length_is attribute.
17.14.7 Pointers
Use the following syntax to declare an IDL pointer:
*[*]...pointer_identifier
The * (asterisk) is the pointer operator, and multiple asterisks indicate multiple levels of
indirection.
17.14.7.1 Pointer Attributes
Pointers are used for several purposes, including implementing a parameter passing
mechanism that allows a data value to be returned, and building complex data structures.
IDL offers three classes of pointers: reference pointers, full pointers, and unique pointers.
The attributes that indicate these pointers are as follows:
ref: Indicates reference pointers. This is the default for top-level pointers used in
parameters.
ptr: Indicates full pointers.
unique: Indicates unique pointers.
Pointer attributes are used in parameters, in structure and union members, and in type
definitions. In some instances, IDL infers the applicable pointer class from its usage.
However, most pointer declarations require that you specify a pointer class by using one
of the following methods:
Use the ref, ptr,orunique attribute in the pointer declaration.
Use the pointer_default attribute in the IDL interface heading. The default pointer
class is determined by the pointer_default attribute.
Pointer attributes are applied only to the top-level pointer within the declaration. If
multiple pointers are declared in a single declaration, the pointer_default established
applies to all but the top-level pointer. (See Section 17.14.7.2, which describes pointer
attributes in parameters.)
17 42 Tandem Computers Incorporated 124245