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

Using a Function Prototype and a FUNCTION Pragma.........................................................123
Using an Interface Declaration...........................................................................................123
Examples........................................................................................................................124
Considerations When Interfacing to pTAL.................................................................................125
Using Identifiers...............................................................................................................125
Matching Data Types.......................................................................................................126
Calling C Routines From pTAL Modules...............................................................................127
C Routines That You Cannot Call Directly............................................................................127
Calling pTAL Routines From C Modules...............................................................................127
pTAL Procedures That You Cannot Call Directly....................................................................129
Sharing Data..................................................................................................................130
Parameters and Variables..................................................................................................134
Differences Between Native and TNS Mixed-Language Programs................................................139
Data Models...................................................................................................................139
Memory Models..............................................................................................................140
_far Pointer Qualifier........................................................................................................140
Extended Data Segments..................................................................................................140
Interfacing to Native COBOL.................................................................................................140
Compiling and Linking the COBOL and C Programs.............................................................142
9 System-Level Programming.......................................................................144
Specifying a Code Space......................................................................................................144
Passing Pointers to Constants Between Code Spaces..................................................................144
Example.........................................................................................................................145
Writing Variable and Extensible Functions................................................................................146
Declaring Variable Functions.............................................................................................146
Declaring Extensible Functions...........................................................................................147
Checking for Actual Parameters With _arg_present().............................................................147
Omitting Parameters.........................................................................................................147
Converting Variable Functions to Extensible Functions...........................................................148
10 Converting C-Series TNS Programs to Use the Current TNS Compiler...........149
11 Migrating Programs to TNS/R or TNS/E Native Mode...............................152
Migrating TNS/R programs to TNS/E native mode, .................................................................152
12 Preprocessor Directives and Macros........................................................153
#define...............................................................................................................................153
Usage Guidelines............................................................................................................154
Examples........................................................................................................................154
#error.................................................................................................................................154
Example.........................................................................................................................155
#if, #elif, #ifdef, #ifndef, #else, and #endif..............................................................................155
Usage Guidelines............................................................................................................156
Examples........................................................................................................................156
#include..............................................................................................................................157
Usage Guidelines............................................................................................................158
Examples........................................................................................................................159
#line...................................................................................................................................160
#pragma.............................................................................................................................160
Example.........................................................................................................................160
#undef................................................................................................................................160
Usage Guideline.............................................................................................................160
Example.........................................................................................................................160
Predefined Macros................................................................................................................160
Predefined Symbols...............................................................................................................161
Variadic Macros...................................................................................................................162
6 Contents