BerkeleyDB's CDB support

This commit is contained in:
Kurt Zeilenga 2001-06-02 02:30:13 +00:00
parent 7d26d8d722
commit 2ec247fb74
2 changed files with 36 additions and 18 deletions

View File

@ -315,20 +315,41 @@ AC_DEFUN([OL_BERKELEY_DB_THREAD],
main()
{
int rc;
u_int32_t flags = DB_CREATE | DB_THREAD;
u_int32_t flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL |
#ifdef DB_PRIVATE
DB_PRIVATE |
#endif
#ifdef DB_MPOOL_PRIVATE
DB_MPOOL_PRIVATE |
#endif
DB_THREAD;
#if DB_VERSION_MAJOR > 2
DB_ENV *env = NULL;
rc = db_env_create( &env, 0 );
if( rc == 0 ) {
if( rc ) return rc;
#ifdef DB_CDB_ALLDB
rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
if( rc ) goto done;
#endif
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
rc = env->open( env, NULL, flags, 0 );
#else
rc = env->open( env, NULL, NULL, flags, 0 );
#endif
}
#ifdef DB_CDB_ALLDB
done:
#endif
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
env->remove( env, NULL, DB_FORCE);
#else
env->remove( env, NULL, NULL, DB_FORCE);
#endif
#else
DB_ENV env;
@ -339,13 +360,9 @@ main()
if( rc == 0 ) {
db_appexit( &env );
}
#endif
#if DB_VERSION_MAJOR > 2
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
env->remove( env, NULL, DB_FORCE);
#else
env->remove( env, NULL, NULL, DB_FORCE);
#endif
unlink("__db_mpool.share");
unlink("__db_lock.share");
#endif
return rc;

View File

@ -2,10 +2,11 @@
## Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
## All rights reserved.
##
## Redistribution and use in source and binary forms are permitted only
## as authorized by the OpenLDAP Public License. A copy of this
## license is available at http://www.OpenLDAP.org/license.html or
## in file LICENSE in the top-level directory of the distribution.
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License. A copy of this license is available at
## http://www.OpenLDAP.org/license.html or in file LICENSE in the
## top-level directory of the distribution.
##
PACKAGE= @PACKAGE@
VERSION= @VERSION@