TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-26
Pathsend Requester Example
! Clean the new control block, and set the link to nil address
cb ':=' 0 & cb FOR (($LEN (cb) + 1) / 2) - 1;
@cb.next^cb := nil^addr;
RETURN @cb;
END; ! DBL PROC get^control^block
?PAGE "READ THE STARTUP AND ASSIGN MSGS, AND OPEN VARIOUS LOG FILES"
! This procedure calls the GUARDIAN 90 PROC INITIALIZER, which opens
! $RECEIVE and handles the protocol with our ancestor, TACL.
! INITIALIZER calls procs local to this program to read the startup
! msg, save the ASSIGN msgs, and save the param msg.
! This proc then opens the error log file, message log file, and the
! trace file.
PROC initialize;
BEGIN
STRUCT .startup^msg (ci^startup);
INT .buf [0:79];
STR .sp := @buf '<<' 1;
STR .st;
INT .filename [0:11];
INT .error^log^file[0:11];
INT .msg^log^file[0:11];
INT .trace^file[0:11];
INT .assign^ (ci^assign);
STR .assign^name[0:17] := [18*[" "]];
STR .logical^name[0:30];
INT setmode^param1;
INT devtype, phys^reclen;
! Open the home terminal to report initialization errors
CALL MYTERM (filename);
CALL OPEN (filename, term^fnum);
IF <>
THEN ! print an error msg and abend
CALL IO^error (term^fnum);
! Get my process id and read the startup msg, ASSIGNs and PARAMs
CALL who^am^i;
CALL INITIALIZER (!rucb!, startup^msg, startup^proc, param^proc,
assign^proc);