URL: http://www.firstbasesoftware.com/man/man3/nextxrec.htm
Last modified: 10 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]


NAME

nextxrec, prevxrec - load next/previous indexed record

SYNOPSIS

#include <firstbase/fb.h>

fb_nextxrec(db)
fb_database *db;

fb_prevxrec(db)
fb_database *db;

DESCRIPTION

As explained in the database(4) manual page, a database structure contains all of the elements needed for an entire database, including an array of field structures, all file names and descriptors, and index information. Altogether, the array of field structures can hold one complete record.

Fb_nextxrec attempts to load the next indexed record into database db. If a record has not already been loaded using fb_getxrec(3) or a similar index mechanism, then the initial call (and only the initial call) to fb_nextxrec will load the the first indexed record (ala firstxrec(3)). To repeat a loop through all indexed records, use firstxrec(3) followed by nextxrec, or use the forxeach(3) mechanism.

Fb_prevxrec attempts to load the previous indexed record into database db. If one record has not already been loaded, nothing is done.

Once a record number is retrieved from the index, getrec(3) is used by these routines to actually load the record into the database structures.

When using a FirstBase flat index, the physical position number of the index entry, the index record number, is stored in the database structure db->bsrec. 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.

However, when using a FirstBase Btree+ index, the db->bsrec value is actually the record number (not the index record number).

CLIENT/SERVER

The fb_nextxrec and fb_prevxrec routines will transparently call the fb_nextxrec_clnt and fb_prevxrec_clnt mechanisms when the global FirstBase variable cdb_use_rpc is set to one. See fb_clnt_create(3) for more details.

SEE ALSO

getxrec(3), getrec(3), firstxrec(3), opendb(3), database(4), index(4).

DIAGNOSTICS

These routines will return FB_AOK on a successful call, and FB_ERROR when the record could not be found or loaded.


URL: http://www.firstbasesoftware.com/man/man3/nextxrec.htm
Last modified: 10 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]