hydrus logo









Valid XHTML 1.0 Transitional

Apache logo

FreeBSD logo

RootDown Radio

Finding a sequence of keys

#include "btree.h"

int bnxtky(BTA* btact, char* key, BTint* value);

The bnxtky function returns the next key from the current root in the file associated with the btact context pointer. The key, a character string, is returned via the pointer in key. The value associated with the key will be returned in the integer location identified by value. value is declared as a BTint, which is normally a typedef for int, but with Large File Support will be a typedef for long long.

bnxtky returns zero to indicate the next key has been located. If no next key exists, bnxtky returns the error code QNOKEY.

To initialise the B Tree position, a call to bfndky or btpos must be made before the first call to bnxtky. Thereafter, repeated calls to bnxtky may be made. Calls to bprvky may be freely intermingled with calls to bnxtky.

bnxtky is prohibited when an index file is opened in shared mode and the current root supports duplicate keys. To use bnxtky in this case, exclusive access to the index file must be gained via the btlock function.

A non-zero return from bnxtky indicates an error occurred during the key location process.