Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 49
Coding the Requester Program
!-----------------------------------------------------------
! Procedure to initialize the program. It calls
! INITIALIZER to save the Startup message. It opens the
! terminal using the IN file from the Startup message and
! calls CREATE^AND^OPEN^SERVER to create and open each of
! the server processes.
!-----------------------------------------------------------
PROC INIT;
BEGIN
STRING .OBJECT^FILE[0:MAXFLEN - 1]; !server object file
! name
INT OBJFILELEN;
STRING .SERVER^NAME[0:MAXFLEN - 1]; !process name for
! servers
INT SERVERLEN;
STRING .TERM^NAME[0:MAXFLEN - 1]; !file name for
! terminal
INT TERMLEN;
INT ERROR;
! Read and process Startup message:
CALL INITIALIZER(!rucb!,
!specifier!,
START^IT);
! Open the home terminal. Convert the IN file from the
! Startup message into a D-series file name, and then open
! it:
!try with this temporary code
ERROR := OLDFILENAME_TO_FILENAME_(START^UP^MESSAGE.INFILE,
TERM^NAME:MAXFLEN,
TERMLEN);
IF ERROR <> 0 THEN CALL PROCESS_STOP_;
ERROR := FILE_OPEN_(TERM^NAME:TERMLEN,TERM^NUM);
IF ERROR <> 0 THEN CALL PROCESS_STOP_;
! Open $SER1, create it if it does not already exist:
SERVER^NAME ':=' "$SER1" -> @S^PTR;
SERVERLEN := @S^PTR '-' @SERVER^NAME;
OBJECT^FILE ':=' "=SER1" -> @S^PTR;
OBJFILELEN := @S^PTR '-' @OBJECT^FILE;
CALL CREATE^AND^OPEN^SERVER(SERV1^NUM,OBJECT^FILE,
OBJFILELEN,SERVER^NAME,SERVERLEN);