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() main()
{ {
int rc; 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 #if DB_VERSION_MAJOR > 2
DB_ENV *env = NULL; DB_ENV *env = NULL;
rc = db_env_create( &env, 0 ); rc = db_env_create( &env, 0 );
if( rc == 0 ) { if( rc ) return rc;
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
rc = env->open( env, NULL, flags, 0 ); #ifdef DB_CDB_ALLDB
#else rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
rc = env->open( env, NULL, NULL, flags, 0 ); 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 #endif
}
#else #else
DB_ENV env; DB_ENV env;
@ -339,13 +360,9 @@ main()
if( rc == 0 ) { if( rc == 0 ) {
db_appexit( &env ); db_appexit( &env );
} }
#endif
#if DB_VERSION_MAJOR > 2 unlink("__db_mpool.share");
#if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1) unlink("__db_lock.share");
env->remove( env, NULL, DB_FORCE);
#else
env->remove( env, NULL, NULL, DB_FORCE);
#endif
#endif #endif
return rc; return rc;

View File

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