uhitchk

Determines if a record matches the profile specified in the uiflst structure and the uwhrlst structure.

short uhitchk(uc, obsolete, pra)

struct uctrl *uc;

short obsolete;

unsigned char *pra;

Parameters

  • uc—address of the current control block.
  • obsolete—parameter is no longer used. Supply the value 0.
  • pra—pointer to the PRA, or the NULL pointer if no PRA is available.

Return Values

The return values are:

  • 0—the record did not match the specified profile
  • 1—the record matched the specified profile

Description

Determines if a record matches the profile specified in the uiflst structure and the uwhrlst structure. If the record matches:

  • It is added to the hitlist and optionally to the select cache if uc->umode is mode 0 or 3.
  • It is passed to usumhit if uc->umode is 4.

uhitchk can only be called in the Select connector request.

The uhitchk service function can only be called in the Select connector request. This example implements part of a function needed to handle the Select connector request.

long SelectRecords ( struct uctrl *ControlBlock )
{
long Hits = 0;
unsigned char *PRABuffer;
do
{
...
/* Select record. Allocate and fill PRABuffer with PRA*/
/* if appropriate. */
...
Hits += uhitchk ( ControlBlock, 0, PRABuffer );
/* Increased ’Hits’ when the record is a hit. */
...
} while ... /* Calculate stop criterion based on ’ControlBlock->umode’, */
/* ’ControlBlock->umaxhits’ and ’Hits’. */
return ( Hits );
}