C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiling and Linking TNS/E Native C and C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
17-3
Specifying Header Files
These restrictions apply to developing Guardian programs with OSS tools:
You cannot use the RUNNABLE and SEARCH pragmas. However, you can direct the
c89 utility to bind implicitly after a compilation. You can also specify library files to
be searched using the c89 -L flag.
You cannot use the SSV pragma. However, you can specify search directories
using the c89 -I flag.
Specifying Header Files
The macros and functions in the TNS/E native C run-time library are declared in
header files. Each header file contains declarations for a related set of library functions
and macros, in addition to variables and types that complete that set. If you use a
function in the library, you should include the header file in which it is declared. You
should not declare the routine yourself because the declarations in the header files
have provisions for several situations that can affect the form of a given declaration,
including:
Whether the routine is implemented internally as a function or a macro
Whether the function is written in a language other than C
Whether you are compiling for the small-memory or large-memory model
Whether you are compiling for the 16-bit or 32-bit (wide) data model
Whether you are compiling for the NonStop environment
Whether you are compiling for TNS mode or native mode
In addition, the header file prototype declarations enable the compiler to check
parameters and arguments for compatibility, ensuring that function calls provide the
correct number and type of arguments.
A single set of TNS/E native C library header files supports all three environments
(Guardian, OSS, and PC) and all three modes (TNS, TNS/R native, and TNS/E native).
The locations of the header files in the three environments is summarized in
Table 17-2.
To specify header files, use the #include preprocessor directive. For example, to
include the STDIO header file, specify in your object file:
#include <stdio.h>
Table 17-2. Locations of Header Files
Environment Location
Guardian $SYSTEM.SYSTEM and $SYSTEM.ZTCPIP
OSS /usr/include and its subdirectories
PC ETK Version 3.0 or later:
\Compaq ETK-NSE\rel\usr\include,
where rel represents the release version update, such as H06.02