Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Interoperating Between Programming Environments
Open System Services Porting Guide520573-006
5-4
Function Entry Points Defined in Header Files
Function Entry Points Defined in Header Files
In the Guardian environment, header files are in $SYSTEM.SYSTEM by default. In the
OSS environment, header files are in /usr/include and its subdirectories by
default. For TNS processing environments, these files support three different memory
models in the Guardian environment and the WIDE data model in the OSS
environment. For native processing environments, the Guardian environment and the
OSS environment both use the WIDE data model.
For TNS processing environments, the proper entry point to the system is determined
by compiler-defined symbols. In general, you do not need to be concerned with the
details of how the proper entry point is selected in the header files. Selection involves
the use of the appropriate pragmas in the source code or symbol definitions in the
compiler command line. Reasonable defaults are used in each of the environments.
Role of the cextdecs.h File for Accessing Guardian Procedures
C programs can access Guardian system procedures by including sections from the
header file cextdecs.h file in the OSS environment. The cextdecs.h file contains
function prototype declarations for the system procedures you can call directly from
your C program.
cextdecs.h specifies the C names for the system procedures with uppercase
characters, and provides a section for each procedure using the SECTION pragma. It
declares system procedures that return condition codes as TAL procedures returning
_cc_status. Consequently, you must include the header tal.h before you call such
a system procedure. See Checking the Condition Code on page 10-8 for using
condition codes in the TNS/R and TNS/E native environments.
To access the declarations in cextdecs.h, use the #include directive, specifying
the names of the system procedures you want to include as section names. The
following example includes the declarations of the PROCESS_GETINFOLIST_ and
FILENAME_FINDNEXT_ Guardian procedures:
#include <cextdecs.h(PROCESS_GETINFOLIST_,FILENAME_FINDNEXT_)>
The syntax of a system procedure call determines whether a parameter is required or
is optional. To call system procedures with optional parameters, you can omit the
parameter, but must include the comma that would follow it. For example:
ERR = FILENAME_SCAN_ (string,length,count,,,options);
API Interoperability
Interoperability of the Guardian and OSS environments on the same system refers to:
The ability of a program to utilize the API of either environment
The ability of one API to access or manipulate objects of the other environment
The ability of utilities to access or manipulate objects of the other environment