OSF DCE Application Development Guide--Core Components
Developing a Simple RPC Application
11.2.3 Naming the Interface
After you have used uuidgen to generate a skeletal interface definition, replace the
dummy string INTERFACENAME with the name of your interface.
By convention, the name of an interface definition file is the same as the name of the
interface it defines, with the suffix .idl appended. For example, the definition for a bank
interface would reside in a bank.idl interface definition file, and, if the application
required an ACF, its name would be bank.acf.
The IDL compiler incorporates the interface name in identifiers it constructs for various
data structures and data types in the .h file, so the length of an interface name can be at
most 17 characters. (Most IDL identifiers have a maximum length of 31 characters.)
11.2.4 Specifying Interface Attributes
Interface attributes are defined within [](brackets) in the header of the interface
definition. The definition for any remote interface needs to specify the uuid and version
interface attributes, so these are included in the skeletal definition that uuidgen
produces.
If an interface is exported by servers on well-known endpoints, these endpoints must be
specified via the endpoint attribute. Interfaces that use dynamic endpoints do not have
this attribute. (A well-known endpoint is a stable address on the host, while a dynamic
endpoint is an address that the RPC runtime requests when the server is started.)
The interface definition language can be used to specify procedure prototypes for any
application, even if the procedures are never used remotely. If all of the procedures of
an interface are called only locally and never remotely, the interface can be given the
local attribute. Since local calls do not have any network overhead, the local attribute
causes the compiler to generate only a header file, not stubs, for the interface.
11.2.5 Import Declarations
The IDL import declaration specifies another interface definition whose types and
constants are used by the importing interface. (Similar to the include declaration in C.)
The import declaration allows you to collect declarations for types and constants that
are used by several interfaces into one common file. For example, if you are defining
two database interfaces named dblookup and dbupdate, and these interfaces have many
data types and constants in common, you can declare those data types and constants in a
dbcommon.idl file and import this file in the dblookup.idl and dbupdate.idl interface
definitions. For example:
import "dbcommon.idl";
124245 Tandem Computers Incorporated 11− 13