TNS/E Native Application Conversion Guide

Converting Programs With Guardian API Calls
TNS/E Native Application Conversion Guide529659-003
10-5
XSTACKTEST
XSTACKTEST
The XSTACKTEST procedure ensures that adequate stack space is available and
returns a set of constants to be used with the XBNDSTEST procedure.
If XSTACKTEST is called to return constants passed to the XBNDSTEST procedure,
delete the XSTACKTEST procedure, because native programs cannot call the
XBNDSTEST procedure. For details, see XBNDSTEST on page 10-4 for more details.
If XSTACKTEST is called to ensure that adequate stack space is available, replace
XSTACKTEST with calls to the HEADROOM_ENSURE_ procedure. The
HEADROOM_ENSURE_ procedure enables you to make sure that the current main
stack or privileged stack has enough room for the needs of your process. For details,
see the
Guardian Procedure Calls Reference Manual
.
Using the INITIALIZER Procedure
The INITIALIZER procedure reads the startup message, and optionally requests
receipt of the ASSIGN and PARAM messages sent by the starting process (which is
often a TACL process). The INITIALIZER procedure optionally initializes file control
blocks (FCBs) with the information read from the startup and ASSIGN messages.
You must change calls to the INITIALIZER procedure that pass the first parameter (the
RUCB, run-unit control block). Such programs must specify two additional parameters.
You need not change other callers to the INITIALIZER procedure. For details, see the
Guardian Procedure Calls Reference Manual
.
Using Sequential I/O Procedures
Many of the sequential I/O (SIO) procedures accept file control blocks (FCBs) as
parameters. TNS and native programs have FCBs of different sizes. These SIO
procedures have separate TAL and pTAL declarations to support FCBs of different
sizes:
CLOSE^WRITE
OPEN^FILE
READ^FILE
WAIT^FILE
WRITE^FILE
You do not need to change your programs for different FCB sizes. The TAL and pTAL
compilers automatically select the correct procedure version.
Callers to the CHECK^FILE and SET^FILE SIO procedures must make the changes
described next.