Deleting a key

#include "btree.h"

int bdelky(BTA* btact, char* key);

The bdelky function deletes a key from the current root in the file associated with the btact context pointer. The key, a character string, is passed via the pointer in key. If the key does not exist, bdelky returns the error code QNOKEY. bdelky returns zero on successful deletion of a key.

If bdelky is called with a key value of NULL, the delete operation will act against the current key, as selected by bfndky, bnxtky or bprvky operations. This capability is designed to allow deletion of a duplicate key, presumably based on other, application managed, attributes.

A non-zero return from bdelky indicates an error occurred during the key deletion process.