1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1996, 1997, 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A * Copyright (c) 1990, 1993, 1994, 1995, 1996 1N/A * Keith Bostic. All rights reserved. 1N/A * Copyright (c) 1990, 1993, 1994, 1995 1N/A * The Regents of the University of California. All rights reserved. 1N/A * This code is derived from software contributed to Berkeley by 1N/A * Redistribution and use in source and binary forms, with or without 1N/A * modification, are permitted provided that the following conditions 1N/A * 1. Redistributions of source code must retain the above copyright 1N/A * notice, this list of conditions and the following disclaimer. 1N/A * 2. Redistributions in binary form must reproduce the above copyright 1N/A * notice, this list of conditions and the following disclaimer in the 1N/A * documentation and/or other materials provided with the distribution. 1N/A * 3. All advertising materials mentioning features or use of this software 1N/A * must display the following acknowledgement: 1N/A * This product includes software developed by the University of 1N/A * California, Berkeley and its contributors. 1N/A * 4. Neither the name of the University nor the names of its contributors 1N/A * may be used to endorse or promote products derived from this software 1N/A * without specific prior written permission. 1N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 1N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 1N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1N/A#
endif /* not lint */ 1N/A * PUBLIC: int __bam_open __P((DB *, DB_INFO *)); 1N/A /* Allocate and initialize the private btree structure. */ 1N/A * Intention is to make sure all of the user's selections are okay 1N/A * here and then use them without checking. 1N/A /* Minimum number of keys per page. */ 1N/A /* Maximum number of keys per page. */ 1N/A * If no comparison, use default comparison. If no comparison 1N/A * and no prefix, use default prefix. (We can't default the 1N/A * prefix if the user supplies a comparison routine; shortening 1N/A * the keys may break their comparison algorithm. We don't 1N/A * permit the user to specify a prefix routine if they didn't 1N/A * also specify a comparison routine, they can't know enough 1N/A * about our comparison routine to get it right.) 1N/A /* Start up the tree. */ 1N/A /* Set the overflow page size. */ 1N/A * PUBLIC: int __bam_close __P((DB *)); 1N/A * __bam_setovflsize -- 1N/A * PUBLIC: void __bam_setovflsize __P((DB *)); 1N/A * Correction for recno, which doesn't know anything about minimum 1N/A * The btree data structure requires that at least two key/data pairs 1N/A * can fit on a page, but other than that there's no fixed requirement. 1N/A * Translate the minimum number of items into the bytes a key/data pair 1N/A * can use before being placed on an overflow page. We calculate for 1N/A * the worst possible alignment by assuming every item requires the 1N/A * maximum alignment for padding. 1N/A * Recno uses the btree bt_ovflsize value -- it's close enough. 1N/A * __bam_read_root -- 1N/A * Check (and optionally create) a tree. 1N/A * PUBLIC: int __bam_read_root __P((DB *)); 1N/A /* Get, and optionally create the metadata page. */ 1N/A * If the magic number is correct, we're not creating the tree. 1N/A * Correct any fields that may not be right. Note, all of the 1N/A * local flags were set by db_open(3). 1N/A /* Initialize the tree structure metadata information. */ 1N/A /* Create and initialize a root page. */ 1N/A /* Release the metadata and root pages. */ 1N/A * Flush the metadata and root pages to disk -- since the user can't 1N/A * transaction protect open, the pages have to exist during recovery. 1N/A * It's not useful to return not-yet-flushed here -- convert it to 1N/A /* Release the locks. */