xref: /titanic_50/usr/src/ucbhead/dbm.h (revision 6a37fc30652374065d6e4ab52366c499e5a34b66)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #ifndef _DBM_H
41 #define	_DBM_H
42 
43 #include <sys/isa_defs.h>
44 #include <sys/null.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #define	PBLKSIZ	1024
51 #define	DBLKSIZ	4096
52 #define	BYTESIZ	8
53 
54 long	bitno;
55 long	maxbno;
56 long	blkno;
57 long	hmask;
58 
59 char	pagbuf[PBLKSIZ];
60 char	dirbuf[DBLKSIZ];
61 
62 int	dirf;
63 int	pagf;
64 int	dbrdonly;
65 
66 #ifndef	DATUM
67 typedef	struct
68 {
69 	char	*dptr;
70 	int	dsize;
71 } datum;
72 #define	DATUM
73 #endif
74 
75 #ifdef __STDC__
76 datum	fetch(datum);
77 datum	makdatum(char *, int);
78 datum	firstkey(void);
79 datum	nextkey(datum);
80 datum	firsthash(long);
81 long	calchash(datum);
82 long	hashinc(long);
83 #else
84 datum	fetch();
85 datum	makdatum();
86 datum	firstkey();
87 datum	nextkey();
88 datum	firsthash();
89 long	calchash();
90 long	hashinc();
91 #endif
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif	/* _DBM_H */
98