hydrus logo









Valid XHTML 1.0 Transitional

Apache logo

FreeBSD logo

RootDown Radio

Deleting a key and associated data

#include "btree.h"

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

The btdel function deletes a key and data record in the file associated with the btact context pointer. key is a character pointer, identifying the key to delete. If deletion of the key and data is successful, btdel returns zero.

If btdel is called with a key value of NULL, the delete operation will act against the current key, as selected by btsel, btseln or btselp operations. This capability is designed to allow deletion of a duplicate key, presumably based on other, application managed, attributes. Note that this capability is prohibited when duplicate keys exist and the index has been opened shared. Exclusive access must be gained via the btlock function in this case.

Invoking btdel will invalidate the current context, i.e. btseln or btselp will not operate.

A non-zero return from btdel indicates an error occurred.