F.4 AddKey
Add key value to index file.
SHORT NAME
ADDKEY
TYPE
Low level index file function
DECLARATION
COUNT AddKey(COUNT keyno, pVOID target, LONG recbyt, COUNT typadd)DESCRIPTION
AddKey inserts the key value pointed to by target and the associated data record position recbyt into index file number keyno. typadd determines how a full B-Tree node is split. The symbolic constants defined in ctport.h, REGADD, INCADD, and DECADD, represent the three node splitting options:
RETURN
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
TEXT target[11];LONG recbyt;COUNT name_key;if (AddKey(name_key,target,recbyt,REGADD))printf("\nAddKey error = %d",uerr_cod);LIMITATIONS
AddKey does not pad key values. If passed a key value which is not completely specified to its full length, AddKey uses whatever "garbage" follows the key value in memory up to the key length.
Key values added to an index allowing duplicate keys, (keydup = 1 in CreateIndexFile or CreateIndexMember), have their last 4 bytes overwritten by the associated data record position. In this way, identical key values become distinguishable.
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.
SEE ALSO
CreateIndexFile and CreateIndexMember specify the key value characteristics of length, type, and allowance for duplicate values at index file creation.
|
FairCom Corporation www.faircom.com |