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 );

Parameters:
IsiFH
The handle of the previously opened or prepared ISAM file.
pInfo
Pointer to a structure where header information for an ISAM file is stored.
InfoLen
The length that specifies the kind of ISAM header file data to be retrieved.

Note the following:

  1. The {pInfo} structure has the following format:

  2.  

    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:

    RecordCount
    The current record count in the ISAM file.
    DeleteCount
    The current deleted record count in the ISAM file.
    I_Version
    The ISAM file header version identifier.
    TxtRecLen
    The maximum record length allowed for the text file associated with the ISAM file.
    KeyLength
    The maximum key length allowed for the ISAM file.
    Flag1
    Miscellaneous ISAM file usage flags. See Note 2 below.
    Flag2
    Miscellaneous ISAM file usage flags. See Note 2 below.
    I_ID
    ISAM file identification stamp. This header field contains four bytes that always contains the characters 'S', 'I', 'S', and 'I' in that order.
    DataName
    This character array contains a null terminated string that has the text file name that is associated with the ISAM file being used. The MAX_NAME_LGT constant can be found in the sunacces.h header file.
    IndexInfo
    This character array contains a null terminated string that has the command line string that was used to create the ISAM file. The INDEX_CMD_LINE_LENGTH constant can be found in the sunacces.h header file.

     

  3. 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:

  4. Definitions for Flag1 in sIsiInfo structure.

  5.  

    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

     

  6. Definitions for Flag2 in sIsiInfo structure:

  7.  

    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

  1. The InfoLen parameter identifies the data to be retrieved from the ISAM file header. The InfoLen can have one of the following input values:

  2.  

    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.

     

  3. Function return codes are as follows:

  4.  

    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.

     

     



Sunaccess Reference SA_IsiInsert