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

Table Of Contents
Introduction to HP C and C++ for NonStop Systems
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
1-23
Porting Without Data Alignment Problems
Porting Without Data Alignment Problems
Section 8, Mixed-Language Programming for TNS/R and TNS/E Native Programs, and
Section 23, Handling TNS Data Alignment, provide guidance on the use of compiler
pragmas to avoid data alignment problems when sharing data between programs in
different compiler languages or when porting programs and data between HP
development environments or between NonStop platforms.
You can also use the Data Definition Language (DDL) to define data structures in a
manner that minimizes data alignment problems. DDL can be used to describe
Enscribe data file structures or to generate source code with data-object filler
appropriate for various compiler data alignment pragmas. For more details, see the
Data Definition Language (DDL) Reference Manual.
Guardian and OSS Environment
Interoperability
Open System Services (OSS) is an alternative to the Guardian interface through which
users and programs can interact with the NonStop OS. The main purpose of Open
System Services is to provide an open interface to the operating system for supporting
portable applications.
An application program can be compiled to run in either the OSS or Guardian
environment and can use services from each environment, including the API, tools,
and utilities. The interoperability enables you to:
Compile and link OSS programs in the Guardian environment
Compile and link Guardian programs in the OSS environment
Call most Guardian C functions and Guardian system procedures from OSS
programs
Call most OSS functions from Guardian programs
You do not need to do anything special for programs that manipulate objects
exclusively in the environment in which they run. However, the NonStop OS enables
you to write programs that manipulate objects in both the Guardian and OSS
environments.
For TNS C programs, Guardian and G-series OSS C run-time interoperability is
supported for programs using only the 32-bit or wide data model. Interoperability is not
supported for TNS C programs using the 16-bit data model. Interoperability is
supported for all native programs, because native C programs support only the 32-bit
or wide data model.