URL: http://www.firstbasesoftware.com/man/man3/firstxrec.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
fb_firstxrec(db)
fb_database *db;
fb_lastxrec(db)
fb_database *db;
fb_firstovxrec(db)
fb_database *db;
fb_lastovxrec(db)
fb_database *db;
fb_currentxrec(db)
fb_database *db;
Fb_firstxrec attempts to load the first indexed record into database db. Fb_lastxrec attempts to load the last indexed record into database db. These two calls are applicable to any kind of FirstBase index.
Note: the following discussion concerns normal (flat) FirstBase indexes and does not apply to btree indexes. See btree(4) for more details on the FirstBase Btree+ indexes.
As noted in the index(4) manual page, autoindexes can have a section of index entries that are not sorted. This index overflow area can still be accessed. Fb_firstovxrec attempts to load the first overflow record from the index into database db. Fb_lastovxrec attempts to load the last overflow record into database db.
Note that nextxrec(3) and prevxrec(3) do not care about the boundary between sorted and overflow index records. For example, an fb_nextxrec after an fb_lastxrec is equivalent to an fb_firstovxrec.
Once a record number is retrieved from the index, each of these routines call getrec(3) to load the record into the database structure.
The physical position number of the index entry, the index record number, is stored in the database structure db->bsrec for each of these routines. If db->bsrec is greater than db->bsend, the returned record's key is stored in the overflow area of the index, otherwise it is stored in the binary searchable area.
The fb_currentxrec mechanism will load the current index record.