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

1 Introduction to HP C and C++ for NonStop Systems
TNS C Language System
The HP TNS C language system for NonStop servers generates TNS C programs for the Guardian
and G-series OSS environments. The C preprocessor, C compiler, C run-time library, and Binder
comprises the TNS C language system. Optional components of this system include the Accelerator,
the TNS Object Code Accelerator (OCA), the Inspect or Visual Inspect symbolic debuggers, and
the NonStop SQL/MP compiler.
HP C for NonStop systems conforms to the C language standard as set forth in ISO/IEC 9899:1990,
Programming Languages–C. (This is technically identical to ANSI C X3.159-1989, Programming
Language C.) HP C also includes several extensions to ISO/ANSI standard C that makes C an
effective language for writing applications that run on NonStop systems. For more details, see
Chapter 2: C and C++ Extensions.
C Preprocessor
The C preprocessor, Cprep, manipulates the text of a source file as the first phase of compilation.
Run Cprep as an independent process in NonStop environment. The C preprocessor is embedded
in the C compiler that runs in the Guardian environment. The C compiler that runs in the OSS
environment does not contain the C preprocessor; Cprep must be run separately. (The OSS TNS
c89 utility runs the C preprocessor by default.)
C Compiler
The C compiler then translates C source text into machine language code. If there are mistakes in
your program, error messages are generated; otherwise, object code is generated.
C Run-Time Library
The C run-time library contains the functions defined in the ISO/ANSI C standard in addition to
several functions that are extensions to the standard. Macros that are not in the library are expanded
during the preprocessing phase of the compiler.
The Guardian C run-time library and the OSS C run-time library share the same set of header files.
Header files contain function prototypes and the variable and type declarations used by the
functions.
For the complete semantics and syntax of the C run-time library in the Guardian TNS C environment,
see the Guardian TNS C Library Calls Reference Manual. Use of TNS C in the G-series OSS
environment was discouraged after the D40 RVU and the OSS TNS library calls are no longer
completely documented. TNS C is not available in the TNS/E OSS environment.
Binder
The Binder collects and links object files generated by the TNS C compiler and produces an
executable TNS object file (a program file).
Accelerator
The Accelerator enables you to increase the performance of TNS programs that runs on TNS/R
system. The Accelerator optimizes TNS program files (compiled and bound object files) to take
advantage of the TNS/R architecture.
Object Code Accelerator (OCA)
The Object Code Accelerator (OCA) enables you to increase the performance of TNS programs
that runs on TNS/E system. The OCA optimizes TNS program files (compiled and bound object
files) to take advantage of the TNS/E architecture.
30 Introduction to HP C and C++ for NonStop Systems