C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
If pragma SSV< n> (for Guardian) or the c89 or c99 -I flag (for OSS or Windows) is
used, the Guardian subvolumes or the OSS or Windows directories are then searched.
• The compiler searches for files:
File SearchFile
The specified standard header file is searched for in the location
of the compiler (see details in following bullets).
#include <library_header_file>
The specified user-defined file is searched for in the current default
Guardian volume and subvolume or OSS working directory.
#include "source_file"
The specified user-defined file is searched for in the current default
Guardian volume.
#include "subvolume.file"
In RVUs preceding D30.00, if the #include specification was of the form #include
"subvolume.file", the Guardian compiler checked for the subvolume in the current volume
by default. Beginning with D30.00, you must specify the default volume using an SSV pragma.
• If you need more than one physical line to complete the section list, place a backslash (\) at
the end of all but the last line of the list. The backslashes cause these physical lines to be
concatenated into a single logical line. For example, this is translated as a single logical line:
#include <cextdecs( \
PROCESS_GETINFOLIST_, \
FILE_OPEN_, \
WRITE, \
WRITEREAD \
)>
• The OSS environment and some operating systems use file names that consist of a name and
an extension separated by a period. On such systems, the names of include header files are
specified as name.h. The C compiler allows this format in the #include directive.
For compilations in the Guardian environment, the C compiler translates name.h to nameh.
For example, stdio.h becomes stdioh. If the name portion exceeds 7 characters, the
C compiler truncates it to 7 characters.
• For TNS compilations, included files can be nested to a depth of 16. For example, file f1
includes file f2, file f2 includes file f3, and so on until file f15 includes file f16.
• For TNS compilations, the maximum number of #include directives that can appear in a
single compilation unit is 2048. If the same include file occurs twice in a compilation unit,
that file is counted twice because it appears in two different #include directives.
Examples
1. This example includes the stdioh header file, specified for the Guardian environment:
#include <stdioh>
2. This example includes the stdio.h header file, specified for the OSS environment:
#include <stdio.h>
3. This example includes the file mysource from the current volume and subvolume or current
working directory:
#include "mysource"
#include 159