PreviousNext

Import Declarations

The IDL import_declaration specifies interface definition files that declare types and constants used by the importing interface. It takes the following form:

import file,... ;

The file is the path name, enclosed in " " (double quotes), of the interface definition you are importing. This path name can be relative; the -I option of the IDL compiler allows you to specify a parent directory from which to resolve import path names.

The effect of an import declaration is as if all constant, type, and import declarations from the imported file occurred in the importing file at the point where the import declaration occurs. Operation declarations are not imported.

For example, suppose that the interface definition aioli.idl contains a declaration to import the definitions for the garlic and oil interfaces:

import "garlic.idl", "oil.idl";

The IDL compiler will generate a C header file named aioli.h that contains the following #include directives:

#include "garlic.h"
#include "oil.h"

The stub files that the compiler generates will not contain code for any garlic and oil operations.

Importing an interface many times has the same effect as importing it once.