Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

After deciding on the environment in which a program runs, choose a development environment.
The development environment is the environment in which you compile, link, and optimize (or
accelerate) the program. While you can develop a program in one environment that runs in the
other environment, it is easier to develop a program in the environment in which will run.
After choosing the development environment, you can begin writing the program. Write the
program’s main() function in the environment in which the process runs; write code for the other
environment only when necessary, and then place it in separate modules.
For TNS interpreted and accelerated programs, both Guardian and G-series OSS modules must
use the 32-bit (or wide) data model and the large-memory model (the size of a pointer and type
int is 32 bits). For TNS/R and TNS/E native programs, both Guardian and OSS modules use
the same data and memory models, so there is no concern for mixing different models.
There are also some interoperability and compatibility issues related to support for OSS files larger
than approximately 2 gigabytes. For more information, see “File Interoperability” (page 77).
Mixed-Language Programming
The Common Run-Time Environment (CRE) coordinates many run-time tasks on behalf of the run-time
libraries, thus providing a common environment for all routines in a program, regardless of
language. The CRE provides services that significantly enhance your ability to create mixed-language
programs.
User routines running in the CRE continue to use their language-specific run-time libraries, but many
of the functions in the language-specific run-time libraries simply recognize calls from user routines
and invoke CRE library functions to process the requests. Only the I/O model remains a major
component of the language-specific run-time libraries, which, for standard files in the Guardian
environment, call CRE routines for standard files and system routines for all other files.
In the OSS environment, the operating system supports standard files explicitly. The language-specific
run-time libraries running in the OSS environment, therefore, call system routines for all files and
do not depend on CRE services for standard files. Refer to the Common Run-Time Environment
(CRE) Programmer’s Guide for more information on writing programs that use the services of the
CRE.
84 Interoperating Between Programming Environments