/** Number of DB records in use. This number only ever increments;
* we don't decrement it when individual DB handles are closed.
*/
- unsigned int mt_numdbs;
+ MDB_dbi mt_numdbs;
#define MDB_TXN_RDONLY 0x01 /**< read-only transaction */
#define MDB_TXN_ERROR 0x02 /**< an error has occurred */
uint32_t me_flags;
uint32_t me_extrapad; /**< unused for now */
unsigned int me_maxreaders; /**< size of the reader table */
- unsigned int me_numdbs; /**< number of DBs opened */
- unsigned int me_maxdbs; /**< size of the DB table */
+ MDB_dbi me_numdbs; /**< number of DBs opened */
+ MDB_dbi me_maxdbs; /**< size of the DB table */
char *me_path; /**< path to the DB files */
char *me_map; /**< the memory map of the data file */
MDB_txninfo *me_txns; /**< the memory map of the lock file */
} else {
MDB_oldpages *mop;
MDB_page *dp;
+ MDB_dbi dbi;
unsigned int i;
/* return all dirty pages to dpage list */
}
env->me_txn = NULL;
- for (i=2; i<env->me_numdbs; i++)
- env->me_dbxs[i].md_dirty = 0;
+ for (dbi=2; dbi<env->me_numdbs; dbi++)
+ env->me_dbxs[dbi].md_dirty = 0;
/* The writer mutex was locked in mdb_txn_begin. */
UNLOCK_MUTEX_W(env);
}
* touched so this is all in-place and cannot fail.
*/
{
+ MDB_dbi i;
MDB_val data;
data.mv_size = sizeof(MDB_db);
{
int toggle = !env->me_db_toggle;
MDB_db *ip, *jp;
+ MDB_dbi i;
ip = &env->me_dbs[toggle][2];
jp = &txn->mt_dbs[2];
}
int
-mdb_env_set_maxdbs(MDB_env *env, int dbs)
+mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs)
{
if (env->me_map)
return EINVAL;
* <li>EINVAL - an invalid parameter was specified, or the environment is already open.
* </ul>
*/
-int mdb_env_set_maxdbs(MDB_env *env, int dbs);
+int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs);
/** Create a transaction for use with the environment.
* The transaction handle may be discarded using #mdb_txn_abort() or #mdb_txn_commit().