NbrOfKeyEntries Number of entries in index file. Short Name IDXENT() Type Low-level index file function Declaration LONG NbrOfKeyEntries(COUNT keyno) Description NbrOfKeyEntries() returns the number of entries in index file number keyno. Note: A huge file may have more than 4 GB of key values, and the NbrOfKeyEntries() function returns the low order 4-byte word of the 8-byte number of keys. To get the high order 4-byte word, call ctGETHGH(). A return of zero is not necessarily an error if there are exactly a multiple 4 GB worth of key values. Return If an error occurs or the index file is empty, NbrOfKeyEntries() returns zero. Otherwise, NbrOfKeyEntries() returns the number of entries in the index file. When NbrOfKeyEntries() returns a zero, check uerr_cod: if uerr_cod is non-zero, an error condition was detected; otherwise, no key values are in the index. See “c-tree Plus Error Codes” in the c-tree Plus Programmer’s Reference Guide for a complete listing of valid c-tree Plus error values. Example COUNT keyno;
printf("\nThere are %ld entries in index #%d.",
NbrOfKeyEntries(keyno),keyno); Limitations With Standalone Multi-user systems, or when updates are immediately forced to disk, the time to add or delete an index entry can be reduced if the number of index entries is not maintained. By default, c-tree Plus maintains this information. To disable this feature, add #define NO_IDXENT to the bottom of ctoptn.h/ctree.mak. By adding this define, multi-user, non-server applications may experience a performance gain. Therefore, we suggest you only use this function if it is very important to quickly determine the number of index entries. |
|||