Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 4
Differences Between TNS/R Native and
TNS Procedures
CHECK^FILE, and INITIALIZER calls, have different forms in the native and TNS
environments.
SET^FILE and CHECK^FILE Differences
The reason for the differences between the native and TNS forms of the SET^FILE
and CHECK^FILE procedure calls has to do with restrictions on the way address
parameters are passed and returned: in the TNS environment, address values can be
passed through a type INT parameter; however, this is not possible in the native
environment.
When non-address parameters are passed or returned by SET^FILE or CHECK^FILE,
the same form of the calls can be used in either environment. However, when an
address value is passed or returned, an additional parameter is required in native
mode. In this case, the native forms of the calls are:
CALL CHECK^FILE (FCB, OPERATION, ADDR)
ERROR := SET^FILE (FCB, OPERATION,,, ADDR)
where addr is a parameter of type WADDR.
For ease in writing programs to be executed in both the native and TNS environments,
two DEFINEs are provided in the $SYSTEM.SYSTEM.GPLDEFS file. These DEFINEs
call the correct version of SET^FILE or CHECK^FILE for operations that can return an
address, depending on which environment the program is compiled in.
The DEFINE for SET^FILE has the form:
CALL_SET^FILE_ADDRESS_ (ERROR, FCB, OPERATION, ADDR)
The DEFINE for CHECK^FILE has the form:
CALL_CHECK^FILE_ADDRESS_ (ERROR, FCB, OPERATION, ADDR)
INITIALIZER Differences
In the TNS environment, the INITIALIZER procedure requires that the RUCP and all
FCBs be contiguous. In TNS procedures, the RUCP and FCBs are always contiguous;
however, in native procedures, this cannot be guaranteed. Therefore, the requirement
has been lifted in the native environment. However, two additional parameters are
required when calling INITIALIZER from a native procedure to place information in the
FCBs.
For TNS callers, the basic INITIALIZER call has the form:
CALL INITIALIZER(CONTROL^BLOCK);
For native callers, the basic INITIALIZER procedure call has the form:
CALL INITIALIZER(CONTROL^BLOCK,,,,,,,NUM^FCBS,FCB^ARRAY);
where NUM^FCBS is an INT parameter specifying the number of FCBs and
FCB^ARRAY is an array of type WADDR containing pointers to the FCBs.