/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996, 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#include "config.h"
#ifndef lint
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <errno.h>
#include <string.h>
#endif
#include "db_int.h"
#include "db_page.h"
#include "btree.h"
/*
* __bam_stat --
*
* PUBLIC: int __bam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t));
*/
int
void *spp;
{
BTREE *t;
PAGE *h;
/* Check for invalid flags. */
return (ret);
return (ret);
return (0);
/* Allocate and clear the structure. */
goto err;
/* If the app just wants the record count, make it fast. */
if (flags == DB_RECORDCOUNT) {
goto err;
goto err;
goto done;
}
/* Get the meta-data page. */
goto err;
goto err;
/* Translate the metadata flags. */
/* Get the remaining metadata fields. */
/* Get the page size from the DB. */
/* Walk the free list, counting pages. */
goto err;
}
}
/* Discard the meta-data page. */
/* Determine the last page of the database. */
goto err;
/* Get the root page. */
goto err;
goto err;
}
/* Get the levels from the root page. */
/* Walk the page list, counting things. */
for (;;) {
switch (TYPE(h)) {
case P_INVALID:
break;
case P_IBTREE:
case P_IRECNO:
break;
case P_LBTREE:
++sp->bt_leaf_pg;
break;
case P_LRECNO:
++sp->bt_leaf_pg;
break;
case P_DUPLICATE:
/* XXX MARGO: sp->bt_dup_pgfree; */
break;
case P_OVERFLOW:
++sp->bt_over_pg;
/* XXX MARGO: sp->bt_over_pgfree; */
break;
default:
}
break;
break;
break;
}
}
ret = 0;
return (ret);
}