InitCTree Initialize file structures and index buffer area. Short Name INTREE() Type Low-level file function Declaration COUNT InitCTree(COUNT bufs, COUNT fils, COUNT sect) Description InitCTree() acquires the memory space necessary for the data and index file structures as well as the space for the index file buffers. Finally, it initializes this memory area. Call CloseISAM() or StopUser() to free these resources. The InitCTree() parameters are defined as follows:
In a single user system, increasing bufs reduces the number of disk accesses necessary to retrieve a key value. The buffers are shared across all index files via a “least recently used” scheme. In Standalone Multi-user systems, the need to force updates back to the disk implies that local buffering is of little value. Rather, the shared hard disk should be cached in order to achieve global buffering of the index file. In a Standalone Multi-user system, bufs should be set around three, regardless of the number of index files in use. sect * 128 determines how many bytes are available in each B-Tree node. When an index file is created, the node size is permanent. When an index file is opened, a check is made to be sure that the current node size is at least as large as when the index was created. That is, an index file can be opened if sect has been increased since file was created, but not if it has been reduced. Superfiles must be opened with the exact node size as when they were created. Originally, the most common value used for sect is four, yielding a node size of 512 bytes. For efficiency, set the sect value to create nodes equal to the page size for the platform. Most common would be 32, yielding a node size of 4K. Return
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example COUNT retval;
printf("\nCould not initialize c-tree Plus: Error %d.", retval);
else {
printf("\nc-tree Plus initialized.");
StopUser() } See also CloseISAM(), StopUser(), CreateDataFile(), CreateIndexFile(), CreateIndexMember(), |
||||||||||||||||||||||||||