char *envname = argv[1];
char *subname = NULL;
- rc = mdbenv_create(&env);
+ rc = mdb_env_create(&env);
if (argc > 2) {
- mdbenv_set_maxdbs(env, 4);
+ mdb_env_set_maxdbs(env, 4);
subname = argv[2];
}
- rc = mdbenv_open(env, envname, MDB_RDONLY, 0);
+ rc = mdb_env_open(env, envname, MDB_RDONLY, 0);
if (rc) {
- printf("mdbenv_open failed, error %d\n", rc);
+ printf("mdb_env_open failed, error %d\n", rc);
exit(1);
}
rc = mdb_txn_begin(env, 1, &txn);
rc = mdb_stat(txn, dbi, &mst);
printf("Page size: %u\n", mst.ms_psize);
printf("Tree depth: %u\n", mst.ms_depth);
- printf("Branch pages: %lu\n", mst.ms_branch_pages);
- printf("Leaf pages: %lu\n", mst.ms_leaf_pages);
- printf("Overflow pages: %lu\n", mst.ms_overflow_pages);
- printf("Entries: %lu\n", mst.ms_entries);
+ printf("Branch pages: %zu\n", mst.ms_branch_pages);
+ printf("Leaf pages: %zu\n", mst.ms_leaf_pages);
+ printf("Overflow pages: %zu\n", mst.ms_overflow_pages);
+ printf("Entries: %zu\n", mst.ms_entries);
mdb_close(txn, dbi);
mdb_txn_abort(txn);
- mdbenv_close(env);
+ mdb_env_close(env);
return 0;
}