Information about an opened indexed file.
For the cobfa_indexinfo() function, information on the opened indexed file can be returned with the struct fa_dictinfo type. For details, see "3.6 cobfa_indexinfo()".
Values to be set for the struct fa_dictinfo type members used to acquire indexed file information are explained below.
struct fa_dictinfo { long di_nkeys; /* number of keys defined */ long di_recsize; /* max or fixed data record size */ long di_idxsize; /* size of indexes */ long di_flags; /* other flags (fixed or variable) */ };
The total number of record keys in the indexed file is set for <di_nkeys>.
The fixed record length or maximum record length is set for <di_recsize> indicating the record length of the file. With this access routine, the minimum record length cannot be acquired.
The total length of record keys is set for <di_idxsize> indicating the sum of lengths of all record keys.
<di_flags> indicating the file attribute has information on the following category:
Record format
FA_FIXLEN: Fixed-length record format
FA_VARLEN: Variable-length record format
Individual attribute values can be determined by application of a logical AND to the <di_flags> value.
Example
#include "f3bifcfa.h" struct fa_dictinfo di; long fd, ret; : ret = cobfa_indexinfo (fd,&di,0); /* get indexed file info */ if (di.di_flags & FA_FIXLEN) { /* process for fixed length record type */ : }