{ NULL, NULL, 0, 0 }
};
-#if 0
-static int
-bdb_destroy( BackendInfo *bi )
-{
- return 0;
-}
-
static int
bdb_open( BackendInfo *bi )
{
+ static char *controls[] = {
+ LDAP_CONTROL_MANAGEDSAIT,
+ LDAP_CONTROL_SUBENTRIES,
+ LDAP_CONTROL_NOOP,
+ NULL
+ };
+
/* initialize the underlying database system */
Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n",
0, 0, 0 );
+ { /* version check */
+ int major, minor, patch;
+ char *version = db_version( &major, &minor, &patch );
+
+ if( major != DB_VERSION_MAJOR ||
+ minor != DB_VERSION_MINOR ||
+ patch < DB_VERSION_PATCH )
+ {
+ Debug( LDAP_DEBUG_ANY,
+ "bdb_open: version mismatch\n"
+ "\texpected: " DB_VERSION_STRING "\n"
+ "\tgot: %s \n", version, 0, 0 );
+ }
+
+ Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n",
+ version, 0, 0 );
+ }
+
+#if 0
+ db_env_set_func_malloc( ch_malloc );
+ db_env_set_func_realloc( ch_realloc );
+ db_env_set_func_free( ch_free );
+#endif
+
+ db_env_set_func_yield( ldap_pvt_thread_yield );
+
+ bi->bi_controls = controls;
+ return 0;
+}
+
+#if 0
+static int
+bdb_destroy( BackendInfo *bi )
+{
return 0;
}
BackendInfo *bi
)
{
- static char *controls[] = {
- LDAP_CONTROL_MANAGEDSAIT,
- LDAP_CONTROL_SUBENTRIES,
- LDAP_CONTROL_NOOP,
- NULL
- };
-
- { /* version check */
- int major, minor, patch;
- char *version = db_version( &major, &minor, &patch );
-
- if( major != DB_VERSION_MAJOR ||
- minor != DB_VERSION_MINOR ||
- patch < DB_VERSION_PATCH )
- {
- Debug( LDAP_DEBUG_ANY,
- "bi_back_initialize: version mismatch\n"
- "\texpected: " DB_VERSION_STRING "\n"
- "\tgot: %s \n", version, 0, 0 );
- }
-
- Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n",
- version, 0, 0 );
- }
-
-#if 0
- db_env_set_func_malloc( ch_malloc );
- db_env_set_func_realloc( ch_realloc );
- db_env_set_func_free( ch_free );
-#endif
-
- db_env_set_func_yield( ldap_pvt_thread_yield );
-
- bi->bi_controls = controls;
-
- bi->bi_open = 0;
+ bi->bi_open = bdb_open;
bi->bi_close = 0;
bi->bi_config = 0;
bi->bi_destroy = 0;