TNS/E Native Application Conversion Guide

C and C++ Conversion Tasks
TNS/E Native Application Conversion Guide529659-003
3-14
Using Active Backup Programming in C
Using Active Backup Programming in C
To convert a TNS program that uses the active backup programming functions to
native mode:
Replace the header file nonstop.h with crtlns.h.
Instead of binding in cnonstop, link the active backup support library:
For more details on writing programs that use the active backup functions, see the
Guardian Programmers Guide
.
Replacing Obsolete C++ Library Operations
The TNS C++ run-time library uses the TNS Guardian C library alternate-model I/O
functions to provide an I/O facility similar to but not identical to the UNIX file descriptor
model. To improve interoperability between the Guardian and OSS environments, the
native environment does not support the Guardian alternate-model I/O functions.
Because of this change, the Guardian native C++ run-time library filebuf and
fstream classes cannot be used to specify an existing open file stream with the
attach function. Two options are available to programs that use the alternate-model
I/O functions:
Rewrite your code to use the OSS versions of these classes.
Open the file stream instead of using a file descriptor to attach to an existing open
stream.
The attach function’s use of file descriptors is nonstandard behavior.
Using the Tools.h++ Class Library
Two product versions of Tools.h++ (version 6.1 and version 7) are available since the
D45.00 and G05.00 RVUs. Only version 7 is available in H-series RVUs. If you are
converting a TNS program that uses an earlier version of Tools.h++ to TNS/E native
mode, you must convert to Tools.h++ version 7. Version 7 offers many new features
over earlier versions, but converting to version 7 requires extensive source code
changes. The
C/C++ Programmer’s Guide
provides an overview of Tools.h++ version 7
along with a summary of conversion tasks. See the
Tools.h++ 7.0 User’s Guide
for
detailed conversion information.
Environment Active Backup Support Library
Guardian CRTLNS
OSS or PC crtlns.o