HP 3000 Manuals

INCLUDE_SEARCH [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

INCLUDE_SEARCH 

INCLUDE_SEARCH is a System-Dependent MPE/iX and HP-UX Option.

You can use the INCLUDE_SEARCH compiler option to set or modify the
search path used by the compiler.  This search path specifies the order
of directories a compiler searches to find files specified in the INCLUDE
directive.  The search stops on t he first successful attempt to open a
file.  Files specified in the INCLUDE directive are called included 
files.

The command line option -I include-search path also specifies this
option.  You can specify multiple paths by repeating the command line
option -I for each path.

syntax 

$INCLUDE_SEARCH '[+] [&] string [, string]...'$

Parameter 

Default       None.

Location      Anywhere.

The string parameter specifies a path for the compiler to search for an
included file.  This path is called the include-search path.  The +
parameter, if specified, appends this new include-search path to the end
of the existing include-search path.  If the + parameter is omitted, the
new include-search path replaces the existing one.

Although there is no default search path for INCLUDE on the MPE/iX
operating system, you can define one with the INCLUDE_SEARCH option.  You
can modify the name of the included file by appending each component of
the include path to the search path.  Using the & symbol, you can
indicate that the compiler should search for the unmodified file name.
Note that the unmodified file name is not searched first by default.  In
fact, it will not be searched at all if the & is omitted from the
INCLUDE_SEARCH list.  If an INCLUDE_SEARCH list is specified, the
compiler will search only the locations specified in the include-search
path.

The search order is:

   1.  The directory of the immediate including file.

   2.  The include-search path.

   3.  The user's current working directory.

   4.  The system standard location /usr/include.

MPE/iX Example 

     PROGRAM show_include;
        $INCLUDE_SEARCH '&, .exp, .official, .official:indy'$
        $INCLUDE 'globals.foo'$
     BEGIN
     END.

The compiler will attempt to find the included file globals.foo by
looking successively for it under each filename modification specified by
the include path.  In this example, the compiler will search successively
for the following files:

   *   globals.foo

   *   globals.foo.exp

   *   globals.foo.official

   *   globals.foo.official:indy

Note that the compiler attempts to open the unmodified filename
globals.foo only because the first element of the include path is "&".
The search will stop on the first successful attempt to open one of these
files.

HP-UX Example 

The following program is in a file called /tmp/test.p, and the current
working directory is /users/myself/work.

     PROGRAM show_include;
        $INCLUDE_SEARCH '../experimental, ../official, /c/official'$
        $INCLUDE 'globals'$
     BEGIN
     END.

The compiler will attempt to find the included file globals by searching
successively in each location specified by the search path.  In this
example, the compiler will look for the files listed below in the
following order.

   1.  In the directory of the including file:  /tmp/globals

   2.  In each element of the include-search path:

              /users/myself/experimental/globals

              /users/myself/official/globals

              /c/official/globals

   3.  In the current working directory:  /users/myself/work/globals

   4.  In the system standard directory:  /usr/include/globals

The search will stop at the first successful attempt to open one of these
files.

If set with INCLUDE_SEARCH, the include-search path becomes part of the
search path used by INCLUDE. Each path specified in the INCLUDE_SEARCH
option denotes a directory in which the compiler will look, in turn, for
an included file.  The search stops after the first successful attempt to
open the file.



MPE/iX 5.0 Documentation