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

Table 41 Development Platform Capabilities (TNS/R Native C and C++ Programs) (continued)
YesYesYesYesCompile programs with
embedded SQL?
YesYesNoNoUse PC-based development tools
for Guardian and OSS
programs?
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 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- 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 C library header files supports all three environments (Guardian, OSS, and PC)
and both modes (TNS and native). The locations of the header files in the three environments is
summarized in Table 42.
Table 42 Locations of Header Files
LocationEnvironment
$SYSTEM.SYSTEM and $SYSTEM.ZTCPIPGuardian
/usr/include and its subdirectoriesOSS
PC TDS: \TDMXDEV\rel\INCLUDE
ETK < version 3.0: \Compaq ETK-NSE\rel\include
ETK Version 3.0 and later: \Compaq ETK-NSE\rel\usr\include where rel
represents the release version update, such as D45.01
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>
You might also need to specify header files for the Standard C++ Library and Tools.h++ library
to use functions contained in those libraries. For examples of #include directives for these libraries,
see Using the Standard C++ Library and Chapter 6: Accessing Middleware Using HP C and C++
Specifying Header Files 287