xref: /minix3/lib/libc/db/hash/extern.h (revision 2639ae9b1755f49e4eb4b211ce63d8879b0edd4a)
1*2639ae9bSBen Gras /*	$NetBSD: extern.h,v 1.9 2008/08/26 21:18:38 joerg Exp $	*/
2*2639ae9bSBen Gras 
3*2639ae9bSBen Gras /*-
4*2639ae9bSBen Gras  * Copyright (c) 1991, 1993, 1994
5*2639ae9bSBen Gras  *	The Regents of the University of California.  All rights reserved.
6*2639ae9bSBen Gras  *
7*2639ae9bSBen Gras  * Redistribution and use in source and binary forms, with or without
8*2639ae9bSBen Gras  * modification, are permitted provided that the following conditions
9*2639ae9bSBen Gras  * are met:
10*2639ae9bSBen Gras  * 1. Redistributions of source code must retain the above copyright
11*2639ae9bSBen Gras  *    notice, this list of conditions and the following disclaimer.
12*2639ae9bSBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
13*2639ae9bSBen Gras  *    notice, this list of conditions and the following disclaimer in the
14*2639ae9bSBen Gras  *    documentation and/or other materials provided with the distribution.
15*2639ae9bSBen Gras  * 3. Neither the name of the University nor the names of its contributors
16*2639ae9bSBen Gras  *    may be used to endorse or promote products derived from this software
17*2639ae9bSBen Gras  *    without specific prior written permission.
18*2639ae9bSBen Gras  *
19*2639ae9bSBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20*2639ae9bSBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*2639ae9bSBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*2639ae9bSBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23*2639ae9bSBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*2639ae9bSBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25*2639ae9bSBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26*2639ae9bSBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27*2639ae9bSBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28*2639ae9bSBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29*2639ae9bSBen Gras  * SUCH DAMAGE.
30*2639ae9bSBen Gras  *
31*2639ae9bSBen Gras  *	@(#)extern.h	8.4 (Berkeley) 6/16/94
32*2639ae9bSBen Gras  */
33*2639ae9bSBen Gras 
34*2639ae9bSBen Gras BUFHEAD	*__add_ovflpage(HTAB *, BUFHEAD *);
35*2639ae9bSBen Gras int	 __addel(HTAB *, BUFHEAD *, const DBT *, const DBT *);
36*2639ae9bSBen Gras int	 __big_delete(HTAB *, BUFHEAD *);
37*2639ae9bSBen Gras int	 __big_insert(HTAB *, BUFHEAD *, const DBT *, const DBT *);
38*2639ae9bSBen Gras int	 __big_keydata(HTAB *, BUFHEAD *, DBT *, DBT *, int);
39*2639ae9bSBen Gras int	 __big_return(HTAB *, BUFHEAD *, int, DBT *, int);
40*2639ae9bSBen Gras int	 __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
41*2639ae9bSBen Gras 		int, uint32_t, SPLIT_RETURN *);
42*2639ae9bSBen Gras int	 __buf_free(HTAB *, int, int);
43*2639ae9bSBen Gras void	 __buf_init(HTAB *, u_int);
44*2639ae9bSBen Gras uint32_t	 __call_hash(HTAB *, char *, int);
45*2639ae9bSBen Gras int	 __delpair(HTAB *, BUFHEAD *, int);
46*2639ae9bSBen Gras int	 __expand_table(HTAB *);
47*2639ae9bSBen Gras int	 __find_bigpair(HTAB *, BUFHEAD *, int, char *, int);
48*2639ae9bSBen Gras uint16_t	 __find_last_page(HTAB *, BUFHEAD **);
49*2639ae9bSBen Gras void	 __free_ovflpage(HTAB *, BUFHEAD *);
50*2639ae9bSBen Gras BUFHEAD	*__get_buf(HTAB *, uint32_t, BUFHEAD *, int);
51*2639ae9bSBen Gras int	 __get_page(HTAB *, char *, uint32_t, int, int, int);
52*2639ae9bSBen Gras int	 __ibitmap(HTAB *, int, int, int);
53*2639ae9bSBen Gras uint32_t	 __log2(uint32_t);
54*2639ae9bSBen Gras int	 __put_page(HTAB *, char *, uint32_t, int, int);
55*2639ae9bSBen Gras void	 __reclaim_buf(HTAB *, BUFHEAD *);
56*2639ae9bSBen Gras int	 __split_page(HTAB *, uint32_t, uint32_t);
57*2639ae9bSBen Gras 
58*2639ae9bSBen Gras /* Default hash routine. */
59*2639ae9bSBen Gras extern uint32_t (*__default_hash)(const void *, size_t);
60*2639ae9bSBen Gras 
61*2639ae9bSBen Gras #ifdef HASH_STATISTICS
62*2639ae9bSBen Gras extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows;
63*2639ae9bSBen Gras #endif
64