FairCom Corporation


F.48 ctSETHGH


Set the high-order 4 bytes of an 8-byte record address.

Short Name

ctSETHGH

TYPE

Low level function

DECLARATION

NINT ctSETHGH(LONG highword)

DESCRIPTION

Call ctSETHGH before a routine requiring a record address as an input parameter to set the high word value for the function.

To minimize the effect on performance in client/Server environments, ctSETHGH does not make a separate call to the c-tree Server. Instead, the information supplied by ctSETHGH is cached on the client side.

RETURN

ctSETHGH always returns NO_ERROR(0). See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

/* Assumes a key length of 14 (8 bytes for HUGE duplicate support) */
LONG recadr_hw,recadr_lw;
pTEXT keyval;
keyval = "123456";
/* Remember, the high word counts the number of 4GB multiples contained **
** in the composite 8 byte record address. Therefore, recadr_hw = 2 and **
** recadr_lw = 512 means a record address of 8,589,935,104 */
recadr_hw = 2;
recadr_lw = 512;
/* set higher order 4 bytes of record address */
ctSETHGH(recadr_hw);
if (AddKey( /* add key value to index */
9, /* index file number */
keyval, /* pointer to key value */
recadr_lw, /* lower order 4 bytes of record address */
REGADD /* regular add mode */
))
printf("\nAddKey error = %d", uerr_cod);

Limitations

The recbyt parameter in this function is a 4-byte value capable of addressing at most 4 gigabytes. If your application supports HUGE files (greater than 4 gigabytes), you must use the ctSetHgh() and ctGetHgh() functions to set or get the high order 4 bytes of the file offset.


FairCom Corporation
www.faircom.com