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 |
|
BATSET when used with BAT_RET_POS or BAT_RPOS |
DoBatch |
BATSETX when used with BAT_RET_POS or BAT_RPOS |
DoBatchXtd |
TransactionHistory |
|
LockList |
|
DeleteKeyBlind |
|
DeleteKey |
|
GetKey |
|
KeyAtPercentile |
|
FirstKey |
|
CurrentFileOffset |
|
GETFIL when using mode BEGBYT |
GetCtFileInfo |
GETRES when used with mode RES_POS |
GetCtResource |
GetGTEKey |
|
GetGTKey |
|
VDataLength |
|
LoadKey |
|
LockCtData |
|
LastKey |
|
GetLTEKey |
|
GetLTKey |
|
NewData |
|
NewVData |
|
NextKey |
|
GetORDKey |
|
PreviousKey |
|
ReadVData |
|
ReadIsamData |
|
ReadIsamVData |
|
ReadData |
|
ReReadVRecord |
|
ReleaseData |
|
ReleaseVData |
|
SetRecord |
|
SystemConfiguration |
|
UpdateRecordOffsetForKey |
|
UpdateCtResource |
|
WriteData |
|
WriteVData |