.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
+.\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
+.\" %%%LICENSE_END
.\"
.\" @(#)hash.3 8.6 (Berkeley) 8/18/94
.\"
-.TH HASH 3 1994-08-18 "" "Linux Programmer's Manual"
+.TH HASH 3 2017-09-15 "" "Linux Programmer's Manual"
.UC 7
.SH NAME
hash \- hash database access method
.ft R
.fi
.SH DESCRIPTION
+.IR "Note well" :
+This page documents interfaces provided in glibc up until version 2.1.
+Since version 2.2, glibc no longer provides these interfaces.
+Probably, you are looking for the APIs provided by the
+.I libdb
+library instead.
+.PP
The routine
-.I dbopen
+.BR dbopen (3)
is the library interface to database files.
One of the supported file formats is hash files.
The general description of the database access methods is in
.BR dbopen (3),
-this manual page describes only the hash specific information.
+this manual page describes only the hash-specific information.
.PP
The hash data structure is an extensible, dynamic hashing scheme.
.PP
-The access method specific data structure provided to
-.I dbopen
+The access-method-specific data structure provided to
+.BR dbopen (3)
is defined in the
.I <db.h>
include file as follows:
+.PP
.in +4n
-.nf
-
+.EX
typedef struct {
unsigned int bsize;
unsigned int ffactor;
uint32_t (*hash)(const void *, size_t);
int lorder;
} HASHINFO;
-.fi
+.EE
.in
.PP
The elements of this structure are as follows:
and the access method will allocate more memory rather than fail.
.TP
.I hash
-is a user defined hash function.
+is a user-defined hash function.
Since no hash function performs equally well on all possible data, the
user may find that the built-in hash function does poorly on a particular
data set.
big endian order would be the number 4,321.
If
.I lorder
-is 0 (no order is specified) the current host order is used.
+is 0 (no order is specified), the current host order is used.
If the file already exists, the specified value is ignored and the
value specified when the tree was created is used.
.PP
If the file already exists (and the
.B O_TRUNC
flag is not specified), the
-values specified for the parameters
+values specified for
.IR bsize ,
.IR ffactor ,
.IR lorder ,
.PP
If a hash function is specified,
.I hash_open
-will attempt to determine if the hash function specified is the same as
-the one with which the database was created, and will fail if it is not.
+attempts to determine if the hash function specified is the same as
+the one with which the database was created, and fails if it is not.
.PP
-Backward compatible interfaces to the routines described in
+Backward-compatible interfaces to the routines described in
.BR dbm (3),
and
.BR ndbm (3)
.BR dbopen (3).
.SH BUGS
Only big and little endian byte order are supported.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR btree (3),
.BR dbopen (3),
.BR mpool (3),
.BR recno (3)
-.sp
+.PP
.IR "Dynamic Hash Tables" ,
Per-Ake Larson, Communications of the ACM, April 1988.
-.sp
+.PP
.IR "A New Hash Package for UNIX" ,
Margo Seltzer, USENIX Proceedings, Winter 1991.