DB->set_h_hash API Ref

#include <db.h>

int DB->set_h_hash(DB *db, u_int32_t (*h_hash_fcn)(DB *, const void *bytes, u_int32_t length));


Description: DB->set_h_hash

Set a user-defined hash function; if no hash function is specified, a default hash function is used. Because no hash function performs equally well on all possible data, the user may find that the built-in hash function performs poorly with a particular data set.

The DB->set_h_hash method configures operations performed using the specified DB handle, not all operations performed on the underlying database.

The DB->set_h_hash method may not be called after the DB->open method is called. If the database already exists when DB->open is called, the information specified to DB->set_h_hash must be the same as that historically used to create the database or corruption can occur.

The DB->set_h_hash method returns a non-zero error value on failure and 0 on success.

Parameters
h_hash_fcn

Errors

The DB->set_h_hash method may fail and return one of the following non-zero errors:


EINVAL


Class DB
See Also Databases and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.