SA_IsiInfo
SA_IsiInfo retrieves header information from an index file that has been previously opened using the SA_IsiOpen or SA_IsiPrep functions.
int SA_IsiInfo ( SA_FH IsiFH, sIsInfo *pInfo, u32 InfoLen );
Note the following:
The {pInfo} structure has the following format:
|
typedef struct { |
|
|
u32 RecordCount; |
// ISAM file record count |
|
u32 DeleteCount; |
// ISAM file delete count |
|
u16 I_Version; |
// ISAM file version number |
|
u16 TxtRecLen; |
// Max record length |
|
u16 KeyLength; |
// Max key length |
|
u8 Flag1; |
// Misc file type flags |
|
u8 Flag2; |
// Misc file type flags |
|
u8 I_ID[4]; |
// ISI ID "SISI" |
|
u8 DataName[MAX_NAME_LGT+1]; |
// Text File Name |
|
u8 IndexInfo[INDEX_CMD_LINE_LENGTH+1]; |
// Index Command Line |
|
} sIsiInfo; |
|
Where:
The Flag1 and Flag2 miscellaneous usage flags are used as bit definitions that provide specific characteristics for the ISAM file and the associated text data file. These miscellaneous usage flags can be found in the sunacces.h header file and are defined as follows:
Definitions for Flag1 in sIsiInfo structure.
|
Contant |
Value |
Meaning |
|
SA_Flag1_UPR |
0x01 |
Force upper case |
|
SA_Flag1_VAR |
0x02 |
pFCB:Variable length records |
|
SA_Flag1_NDUP |
0x04 |
Duplicate keys NOT allowed |
|
SA_Flag1_SPC |
0x08 |
pFCB:Compressed text |
|
SA_Flag1_NOEOR |
0x10 |
pFCB:NO EOR is used for ISI |
|
SA_Flag1_WEOF |
0x20 |
Write text at EOF |
|
SA_Flag1_SEOR |
0x40 |
Size of End of Record 00=1, 40=2 |
|
SA_Flag1_TEOR |
0xC0 |
EOR TYPE mask defined as follows |
|
SA_Flag1_EOR_CR |
0x00 |
EOR is 1 byte consisting of CR |
|
SA_Flag1_EOR_LF |
0x80 |
EOR is 1 byte consisting of LF |
|
SA_Flag1_EOR_CRLF |
0x40 |
EOR is 2 bytes consisting of CRLF |
|
SA_Flag1_EOR_LFCR |
0xC0 |
EOR is 2 bytes consisting of LFCR |
Definitions for Flag2 in sIsiInfo structure:
|
Contant |
Value |
Meaning |
|
SA_Flag2_LFS |
0x01 |
Large File Support |
|
SA_Flag2_RESERVED1 |
0x02 |
|
|
SA_Flag2_RESERVED2 |
0x04 |
|
|
SA_Flag2_OS_MASK |
0x18 |
OS Platform bits |
|
SA_Flag2_OS_WIN |
0x08 |
Only WINDOWS PLBWIN runtime allowed to open ISI |
|
SA_Flag2_OS_Linux |
0x10 |
Only Linux PLB runtime allowed to open ISI |
The InfoLen parameter identifies the data to be retrieved from the ISAM file header. The InfoLen can have one of the following input values:
|
Value |
Meaning |
|
1 |
Retrieve the maximum byte size of the sIsiInfo structure. |
|
4 |
Retrieve only the RecordCount. |
|
8 |
Retrieve RecordCount plus DeleteCount. |
|
12 |
Retrieve all sIsiInfo data. |
Function return codes are as follows:
|
Value |
Meaning |
|
1 |
Success when using InfoLen modes 4, 8, and 12 |
|
nn |
Maximum byte size of sIsiInfo structure when using InfoLen mode 1. |
|
-nn |
Error as described in I/O error section of the PL/B Runtime Reference. |
![]() |