2
* See the file LICENSE for redistribution information.
4
* Copyright (c) 1996-2002
5
* Sleepycat Software. All rights reserved.
11
static const char revid[] = "$Id$";
14
#ifndef NO_SYSTEM_INCLUDES
15
#include <sys/types.h>
19
#include "dbinc/db_page.h"
20
#include "dbinc/db_swap.h"
21
#include "dbinc/btree.h"
25
* Convert host-specific page layout from the host-independent format
28
* PUBLIC: int __bam_pgin __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
31
__bam_pgin(dbenv, dummydbp, pg, pp, cookie)
41
pginfo = (DB_PGINFO *)cookie->data;
42
if (!F_ISSET(pginfo, DB_AM_SWAP))
46
return (TYPE(h) == P_BTREEMETA ? __bam_mswap(pp) :
47
__db_byteswap(dbenv, dummydbp, pg, pp, pginfo->db_pagesize, 1));
52
* Convert host-specific page layout to the host-independent format
55
* PUBLIC: int __bam_pgout __P((DB_ENV *, DB *, db_pgno_t, void *, DBT *));
58
__bam_pgout(dbenv, dummydbp, pg, pp, cookie)
68
pginfo = (DB_PGINFO *)cookie->data;
69
if (!F_ISSET(pginfo, DB_AM_SWAP))
73
return (TYPE(h) == P_BTREEMETA ? __bam_mswap(pp) :
74
__db_byteswap(dbenv, dummydbp, pg, pp, pginfo->db_pagesize, 0));
79
* Swap the bytes on the btree metadata page.
81
* PUBLIC: int __bam_mswap __P((PAGE *));
91
p = (u_int8_t *)pg + sizeof(DBMETA);
93
SWAP32(p); /* maxkey */
94
SWAP32(p); /* minkey */
95
SWAP32(p); /* re_len */
96
SWAP32(p); /* re_pad */
98
p += 92 * sizeof(u_int32_t); /* unused */
99
SWAP32(p); /* crypto_magic */