Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Record Offsets Under Huge File Support

FairCom DB does not rely on native 64-bit (8-byte) integer support. Creating files greater than 4GB without segmented files requires a file I/O library supporting 64-bit file addresses. This is a different issue from native 64-bit integer support, which means the operating system uses 64-bit addresses.

c-tree uses the standard c-tree 32-bit oriented API with both 32-bit files and 64-bit files. However, with 64-bit files, two calls handle the higher order 32-bits (4-bytes): ctSETHGH() and ctGETHGH(). These routines are only needed with ISAM and low-level functions that return or use as input explicit file positions. For example, AddKey() has an input parameter that passes an explicit record address, and FirstKey() returns a record address. These functions need the additional API calls. AddRecord() and FirstRecord() do not use explicit record addresses and do not need these additional API calls, but CurrentFileOffset() does.

The ctSETHGH() routine:

NINT ctSETHGH(LONG highword);

is called before a routine requiring a record address as an input parameter. ctSETHGH() always returns NO_ERROR (0) ctGETHGH():

LONG ctGETHGH(void);

is called after a routine that returns, or sets an output parameter to, a record address.

Note: ctGETHGH() clears the stored value on read. If the following function call requires this value, call ctSETHGH() to reset the value.

To minimize the effect on performance in client-server environments, ctGETHGH() and ctSETHGH() do not make separate calls to the FairCom Server. Instead, the information needed by ctGETHGH() or supplied by ctSETHGH() is cached on the client side.

For sample code, see the example in the ctSETHGH() function description. See ctSETHGH and ctGETHGH for more information.

The list of function calls that require processing of the high-order 4 bytes by using ctSETHGH() or ctGETHGH() includes the following:

Short Name

Long Name

ADDKEY

AddKey

BATSET when used with BAT_RET_POS or BAT_RPOS

DoBatch

BATSETX when used with BAT_RET_POS or BAT_RPOS

DoBatchXtd

CTHIST

TransactionHistory

ctLOKLST

LockList

DELBLD

DeleteKeyBlind

DELCHK

DeleteKey

EQLKEY

GetKey

FRCKEY

KeyAtPercentile

FRSKEY

FirstKey

GETCURP

CurrentFileOffset

GETFIL when using mode BEGBYT

GetCtFileInfo

GETRES when used with mode RES_POS

GetCtResource

GTEKEY

GetGTEKey

GTKEY

GetGTKey

GTVLEN

VDataLength

LOADKEY

LoadKey

LOKREC

LockCtData

LSTKEY

LastKey

LTEKEY

GetLTEKey

LTKEY

GetLTKey

NEWREC

NewData

NEWVREC

NewVData

NXTKEY

NextKey

ORDKEY

GetORDKey

PRVKEY

PreviousKey

RDVREC

ReadVData

REDIREC

ReadIsamData

REDIVREC

ReadIsamVData

REDREC

ReadData

REDVREC

ReReadVRecord

RETREC

ReleaseData

RETVREC

ReleaseVData

SETCURI

SetRecord

SYSCFG

SystemConfiguration

UpdateRecordOffsetForKey

UpdateRecordOffsetForKey

UPDRES

UpdateCtResource

WRTREC

WriteData

WRTVREC

WriteVData

TOCIndex