OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
IDL, see Chapter 17. For information on the IDL compiler, see the idl(1rpc) reference
page.
An IDL interface definition consists of a header and a body. The following example
shows the interface definition for the greet application:
/*
* greet.idl
*
* The "greet" interface.
*/
[uuid(3d6ead56-06e3-11ca-8dd1-826901beabcd),
version(1.0)]
interface greetif
{
const long int REPLY_SIZE = 100;
void greet(
[in] handle_t h,
[in, string] char client_greeting[],
[out, string] char server_reply[REPLY_SIZE]
);
}
The header of each RPC interface contains a UUID, which is a hexadecimal number that
uniquely identifies an entity. A UUID that identifies an RPC interface is known as an
interface UUID. The interface UUID ensures that the interface can be uniquely
identified across all possible network configurations. In addition to an interface UUID,
each RPC interface contains major and minor version numbers. Together, the interface
UUID and version numbers form an interface identifier that identifies an instance of an
RPC interface across systems and through time.
The interface body can contain the following constructs:
Import declarations (not shown)
Constant declarations (REPLY_SIZE)
Data type declarations (not shown)
Operation declarations (void greet(...);)
IDL declarations resemble declarations in ANSI C. IDL is purely a declarative language,
so, in some ways, an IDL interface definition is like a C header file. However, an IDL
interface definition must specify the extra information that is needed by the remote
procedure call mechanism. Most of this information is expressed via IDL attributes. IDL
attributes can apply to types, to type members, to operations, to operation parameters, or
to an interface as a whole. An attribute is represented in [](brackets) before the item to
which it applies. In the greet.idl example, the [in, string] attributes associated with the
client_greeting array means the parameter is for input only and that the array of
characters has the properties of strings.
11 10 Tandem Computers Incorporated 124245