Inserting a key

#include "btree.h"

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

The binsky function inserts a new key and associated integer value into the current root of the file associated with the btact context pointer. The key, a character string, is passed in key, while value holds the associated integer 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.

If the key has been inserted successfully, binsky returns zero, otherwise an error code is returned.

Keys longer than the maximum key length (BT constant ZKYLEN) will be silently truncated to the maximum key length.

A non-zero return from binsky indicates an error occurred during the key insertion process.