6100 ADCCP Programming Manual

ADCCP Programming Example Using Transaction Application Language (TAL)
069225 Tandem Computers Incorporated B–9
This procedure is used to flush reads at the beginning of a session and to issue the
START request after the backup process has opened the files. The procedure ends
with a a request to the ADCCP module. The calling routine furnishes the
WRITEREAD parameters as well as values to be placed in the request buffer (D).
proc RECFLUSH(filenumber,list,mod,txtout,txtin,cmd,count,tag^value) variable; !function
int filenumber,mod,txtout,txtin,count,cmd; !value parameter
int(32) tag^value; !optional value parameter
string .list; !optional reference parameter
begin
int length;
d.msg.cmd := cmd; !MOVE FUNCTION BYTE
d.msg.mod := mod; !MOVE MODIFIER
d.msg.req^id := cmd; !USE FUNCTION CODE AS ID
d.msg.text^out := txtout; !MOVE LENGTH OF TEXT FIELD IN!REQUEST
d.msg.text^in := txtin; !MOVE LENGTH OF TEXT FIELD IN !RESPONSE
length := $LEN(D.basic) + txtout;
if NOT $PARAM(tag^value) then tag^value := 0D;
if $PARAM(list) then d.config.text ':=' list for txtout; !move definelist^array
CALL WRITEREAD(filenumber,D,length,count,count^trans,tag^value);
end; !end of procedure
!
?PAGE "NonStop Procedures: PROC CREATEBACKUP"
!
!This procedure creates a backup process, checkopens its files, and
!checkpoints the stack from the global variable BASE to top-of-stack.
!
INT PROC CREATEBACKUP (BACKUPCPU,BACKUPCRTPID);
INT BACKUPCPU, !input: backup cpu number
.BACKUPCRTPID; !output:backup process id
BEGIN
int .program^file^name[0:11] := [12 * [" "]],
. process^name[0:3] := [4 * [0]],
error,
back^error,
i;
string .string^ptr;
!
!subprocedure to start the backup process
!
int subproc go^backup;
begin
if error := processinfo(mypid,process^name,,,,program^file^name) then
begin
call stamp^msg(sbuf);
sbuf[9] ':=' " Error " -> @ptr;
call numout(ptr,error,10,3);
ptr[3] ':=' " returned from PROCESSINFO. Nonstop failure." -> @ptr;
return false;
end
else
begin
call newprocess(program^file^name,
0, !priority
lastaddr'>>'10 + 1, !memory pages
backupcpu, !cpu #
backupcrtpid,
error,
process^name);
if <> then
begin
call stamp^msg(sbuf);
sbuf[9]':='" Error " -> @ptr;
call numout(ptr,error,10,5);
ptr[5] ':=' " (%" -> @ptr;
call numout(ptr,error.<0:7>,8,5);