uready
Informs the connector whether it needs to continue searching through the preferred index
short uready
(uc)
struct uctrl
*uc;
Parameters
uc—address of the current control block.
Return Values
The return values are:
- 0—the connector must continue searching
- <>0—the connector can stop searching
Description
uready
informs the connector whether
it needs to continue searching through the preferred index. It can
only be used in combination with uhitchk
. uready
uses the ordering imposed by
the preferred index to stop searching as soon as possible.
The following
example is an extension of the example provided for the uhitchk
service function.
long SelectRecords ( struct uctrl *ControlBlock ) { long Hits = 0; unsigned char *PRABuffer; short Ready; do { ... /* Select record. Allocate and fill PRABuffer with*/ /* PRA if appropriate. */ ... Ready = uready ( ControlBlock ); Hits += uhitchk ( ControlBlock, 0, PRABuffer ); /* Increased ’Hits’ when the record is a hit. */ ... if ( Ready ) { return ( Hits ); } } while ... /* Calculate stop criterion based on */ /* ’ControlBlock->umode’, */ /* ’ControlBlock->umaxhits’ and ’Hits’. */ return ( Hits ); }