Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 25
Using the FILE_COMPLETE_SET_ Procedure
The COMPLETE^ELEMENT structure is defined in the ZSYS* files. In the TAL
ZSYSTAL file, it is defined as follows:
By enabling a Guardian file and specifying file number -1D in the Z^FNUM^FD field of
this structure, you cause all Guardian files to be enabled for completion (that is, all
Guardian files that your program has open for nowait I/O). By removing Guardian file
number -1D, you remove all Guardian files from the enabled set. With OSS files, you
can specify -1D only to remove all OSS files from the enabled set.
In the call to the FILE_COMPLETE_SET_ procedure, you must also pass a value that
represents the total number of files described in the array parameter. Optionally, you
can include an output parameter that returns an index to an element in the array
parameter if it is in error.
The following example specifies one Guardian file and one OSS file to be added and
one OSS file to be removed from the set of enabled files:
?SOURCE ZSYSTAL( ZSYS^DDL^COMPLETE^ELEMENT )
LITERAL MAX_COMPLETE_ELEMENTS = 20;
STRUCT .COMPLETE_LIST
(ZSYS^DDL^COMPLETE^ELEMENT^DEF) [0:MAX_COMPLETE_ELEMENTS -
1];
INT(32) FILENUM;
INT(32) FILEDESC1;
INT(32) FILEDESC2;
INT ERROR_ELEMENT;
INT NUM_ELEMENTS;
INT ERROR;
.
.
STRUCT ZSYS^DDL^COMPLETE^ELEMENT^DEF (*);
BEGIN
INT(32) Z^FNUM^FD;
STRUCT Z^OPTIONS;
BEGIN
UNSIGNED(1) Z^SET^FILE;
UNSIGNED(1) Z^FILETYPE;
BIT_FILLER 14;
BIT_FILLER 13;
UNSIGNED(1) Z^READ^READY;
UNSIGNED(1) Z^WRITE^READY;
UNSIGNED(1) Z^EXCEPTION;
END;
INT(32) Z^COMPLETION^TYPE = Z^OPTIONS;
END;