gtpc2m83C/C++ Language Support User's Guide

tpf_fac8c-Low-Level File Address Compute Functions

This function returns an 8-byte file address based on the input record type and an 8-byte ordinal number.

Format

#include <tpfio.h>
int tpf_fac8c(TPF_FAC8 *parm);
 

parm
A pointer to a parameter block described by the TPF_FAC8 structure. Fields in the input area of this block that are to be provided by the caller must be initialized before the function is called. Output area fields will be filled in by the function service routine.

Normal Return

TPF_FAC8_NRM. The ifacret field in the TPF_FAC8 structure also contains TPF_FAC8_NRM, and the ifacmax field in the TPF_FAC8 structure contains the maximum ordinal number for the requested record type and the file address has been placed in the field ifacadr in the TPF_FAC8 structure.

Error Return

One of the following:

 TPF_FAC8_NIU 
Record type is not in use.

 TPF_FAC8_RTH 
Record type does not exist or exceeds the FACE table limit.

 TPF_FAC8_ROR 
Record ordinal is outside the allowable range.

 TPF_FAC8_NSP 
No split chain for the record.

 TPF_FAC8_POR 
Input parameter is outside the allowable range.

The ifacret field in the TPF_FAC8 structure also contains the return code.

Programming Considerations

Examples

The following example generates a system ordinal number (SON) address for #RECTYPE record number 198 and stores it in the output area of the TPF_FAC8 block.

#include <tpfio.h>

  ·
  ·
  ·
TPF_FAC8 fa; MCHR_STRUCT mchr; /* call tpf_fac8c to calculate FARF address */ fa.ifacord = 198; memcpy(fa.ifacrec, "#RECTYPE", sizeof(fa.ifacrec)); fa.ifactyp=IFAC8FCS; tpf_fac8c(&fa); if (fa.ifacret != TPF_FAC8_NRM) { /* error return */ } else { /* normal return */ }

Related Information

face_facs-File Address Generation.