HP C/iX Reference Manual (31506-90011)

Chapter 7 99
Preprocessing Directives
Source File Inclusion
levels of nested include files.
Note that this search path is based on the group and account where the source file is
located and not where the include file is "included". To illustrate, assuming that a program
MAIN.SRCGROUP.SRCACCT contains the following directive:
#include "HEADER1.X.Y"
and HEADER1.X.Y contains another include directive:
#include "HEADER2"
The preprocessor looks for HEADER2.SRCGROUP.SRCACCT even though the file that includes
it is in X.Y.
The above searching algorithm can be modified in 2 ways; by using file equations or by
using the -I option. Since include files are always fully qualified before searching by the
preprocessor, a fully qualified file name must be used in a file equation to be effective.
Example
:file MYFILE.SRCGROUP.SRCACCT=HEADER.X.Y
#include "MYFILE"
This directs the preprocessor to look for HEADER.X.Y instead of
MYFILE.SRCGROUP.SRCACCT.
-I Compiler Option
You can alter the search algorithm used for locating included files by specifying the -I
compiler option in the following format:
-I
group
[.
account
]
You use this option to specify a group and optionally an account where the preprocessor
searches for included files before searching the source file's H group and the H group of the
SYS account. If you omit the account specification, the account of the current user is used.
Note that this is the only case where the user's account is used when searching for the
include files. You can cause the preprocessor to search more than one group (and account)
for included files by specifying more than one -I option. -I options are scanned left to
right.
If the included file is enclosed in angle brackets, the preprocessor strips the name of
non-standard prefixes and suffixes and then searches the groups and accounts in the -I
option(s) for the file. If the file is not found, the H group of the SYS account is searched.
If the included file name is enclosed in double quotation marks, the preprocessor first
searches for that file without changing the file name. It then strips the file name of prefixes
and suffixes and searches in the group and the account of the source file. If the file is not
found, the groups and accounts, if any, specified in the -I option(s) are searched. Then, the
H group of the source file is searched. If the file is still not found, the H group of the SYS
account is searched last.
In summary, the preprocessor searches for names of included files enclosed in angle
brackets only in the groups or accounts specified in any -I options, then in the H group of