6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
B–10 069225 Tandem Computers Incorporated
ptr[5] ':=' ",%" -> @ptr;
call numout(ptr,error.<8:15>,8,5);
ptr[5] ':=' ") returned from NEWPROCESS" -> @ptr;
return false;
end;
end;
return true;
end;
?page
!
!subprocedure for CHECKOPENing files.
!
int subproc go^check^o(filename,filenum,waitio,sync);
int .filename, .filenum, waitio, sync;
begin
if not sync then
call checkopen(filename,filenum,waitio,,,,back^error)
else call checkopen(filename,filenum,waitio,sync,,,back^error);
if back^error <> 0 then
begin
call stamp^msg(sbuf);
sbuf[9] ':=' "BACK^ERROR " -> @ptr;
call numout(ptr,back^error,10,3);
ptr[3] ':=' " returned from CHECKOPEN of file " -> @ptr;
@string^ptr := @filename '<<' 1;
sbuf[@ptr '-' @sbuf] ':=' string^ptr for 24 -> @ptr;
return false;
end;
retur
n true;
end;
These lines result in a CHECKOPEN of every file opened by the primary process.
Like the primary process, the backup process opens the ADCCP line three times:
once for reading, once for writing, and once toreceive asynchronous messages.
!
!CREATEBACKUP main is here.
!
create^back := create^back + 1;
if go^backup then
if go^check^o(recname,recfile,1,1) then
if go^check^o(startup^msg.outfile,outfile,1,1) then
if go^check^o(startup^msg.infile,asynfnum,1,0) then
if go^check^o(startup^msg.infile,wfnum,7,0) then
if go^check^o(startup^msg.infile,rfnum,14,0) then
The SETMODE call allows I/O requests made by the backup to complete in any
order. The call to recflush results in a START request to ADCCP.
begin
call setmode(rfnum,30,1);
call recflush(rfnum,,0,0,0,ltf^start,$LEN(d.basic));
call awaitio(rfnum);
call check(base);
call stamp^msg(sbuf);
sbuf[9] ':=' "Backup process created in CPU " -> @ptr;
call numout(ptr,backupcpu,10,2);
call write(outfile,outbuf,@ptr[2] '-' @sbuf);
call awaitio(outfile);
call check(base);
return true;
end;
call write(outfile,outbuf,@ptr '-' @sbuf);
call awaitio(outfile);
call stop^backup;
return false;
END; !CREATEBACKUP