Guardian Programmer's Guide

Table Of Contents
Using Nowait Input/Output
Guardian Programmer’s Guide 421922-014
4 - 27
Using the FILE_COMPLETE_GETINFO_ Procedure
Using the FILE_COMPLETE_GETINFO_ Procedure
You can use the FILE_COMPLETE_GETINFO_ procedure to obtain information about
the set of files that are currently enabled for completion.
Through an output parameter, the FILE_COMPLETE_GETINFO_ procedure returns an
array of COMPLETE^ELEMENT structures that describe the files that are enabled for
completion. This structure is the same as that used to specify a file to the
FILE_COMPLETE_SET_ procedure. (See the structure definition
ZSYS^DDL^COMPLETE^ELEMENT^DEF under Using the FILE_COMPLETE_SET_
Procedure.)
When calling the FILE_COMPLETE_GETINFO_ procedure, you must specify the
maximum number of structures that your program can accept as output from the
procedure. There is also an optional output parameter that returns the actual number
of structures that are returned. This number is equal either to the number of files
enabled for completion or to the maximum number of COMPLETE^ELEMENT
structures that can be returned.
In the following example, a call is made to the FILE_COMPLETE_GETINFO_
procedure:
?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 NUM_ELEMENTS_OUT;
INT ERROR;
.
.
ERROR := FILE_COMPLETE_GETINFO_ (
COMPLETE_LIST -- out; set of enabled
files
,MAX_COMPLETE_ELEMENTS -- in; max elements
,NUM_ELEMENTS_OUT -- out; number of returned
-- elements
);
IF ERROR <> 0 THEN ...
Using the FILE_COMPLETE_ Procedure
You can use the FILE_COMPLETE_ procedure to complete one previously initiated I/O
operation on a Guardian file or to return ready information on an OSS file. The
Guardian file or OSS file is from the set of files that are enabled for completion. You
can have the procedure either check for completion and immediately return or wait until
either a completion or a timeout occurs.