Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 13
Using the INITIALIZER Procedure
2. Opens the $RECEIVE file and reads an Open message from the mom process. If
INITIALIZER receives an Open message from any process other than its mom
process, it replies with error 100. If it receives any other message from a process
other than its mom process, it replies with error 60.
3. Reads the Startup message from the $RECEIVE file:
The INITIALIZER process extracts the input and output file and term names from
the Startup message and substitutes them for physical file names in the FCBs
whose physical file names were initialized with strings containing #IN, #OUT and
#TERM, respectively. Partially qualified names are expanded using the default
values also provided in the Startup message.
4. Reads the Assign messages (optional):
For each Assign message, the INITIALIZER procedure searches each file FCB for
the logical file name provided in the Assign message. It then updates all matching
FCBs with the information provided in the message.
5. Closes the $RECEIVE file.
Reading Startup Sequence Messages
If your program calls the INITIALIZER procedure to read Assign messages, then it will
also read any Param message. However, no special processing of the Param
message is done for SIO files. If you want the INITIALIZER to process the Param
message, you must provide a procedure to do so, as described in Section 8,
Communicating With a TACL Process.
To call the INITIALIZER procedure and read any Assign or Param messages, you
provide the name of the RUCB.
For native callers, the basic INITIALIZER procedure call has the form:
CALL INITIALIZER(CONTROL^BLOCK,,,,,,,NUM^FCBS,FCB^ARRAY);
where NUM^FCBS is the number of FCBs and FCB^ARRAY is an array containing
po
inters to the FCBs.
The following example shows how to call the INITIALIZER procedure from a native
pr
ogram. The example initializes two FCBs. The example shows the statements
needed to set up the input for the INITIALIZER procedure:
LITERAL NUM^FCBS = 2; !Number of FCBs
ALLOCATE^CBS(CONTROL^BLOCK,COMMON^FCB,NUM^FCBS);
ALLOCATE^FCB(IN^FCB," #IN ");
ALLOCATE^FCB(OUT^FCB," #OUT ");
WADDR FCB^ARRAY[0:NUM^FCBS-1]; !Array to hold FCB pointers
.
.
FCB^ARRAY[0] := @IN^FCB; !Pointer to input FCB
FCB^ARRAY[1] := @OUT^FCB; !Pointer to output FCB
CALL INITIALIZER(CONTROL^BLOCK,,,,,,,NUM^FCBS,FCB^ARRAY);