first step towards removing back-*/external.h

This commit is contained in:
Pierangelo Masarati 2004-11-13 18:52:44 +00:00
parent cd35386935
commit 9c550e7235
12 changed files with 222 additions and 188 deletions

View File

@ -529,24 +529,6 @@ bdb_db_destroy( BackendDB *be )
return 0;
}
#if (SLAPD_BDB == SLAPD_MOD_DYNAMIC && !defined(BDB_HIER)) || \
(SLAPD_HDB == SLAPD_MOD_DYNAMIC && defined(BDB_HIER))
int init_module( int argc, char *argv[] ) {
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
#ifdef BDB_HIER
bi.bi_type = "hdb";
#else
bi.bi_type = "bdb";
#endif
bi.bi_init = bdb_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_BDB */
int
bdb_back_initialize(
BackendInfo *bi )
@ -674,3 +656,24 @@ bdb_back_initialize(
return 0;
}
#if (SLAPD_BDB == SLAPD_MOD_DYNAMIC && !defined(BDB_HIER)) || \
(SLAPD_HDB == SLAPD_MOD_DYNAMIC && defined(BDB_HIER))
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
#ifdef BDB_HIER
bi.bi_type = "hdb";
#else
bi.bi_type = "bdb";
#endif
bi.bi_init = bdb_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_BDB */

View File

@ -29,22 +29,6 @@
#include "proto-dnssrv.h"
#include "external.h"
#if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[])
{
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "dnssrv";
bi.bi_init = dnssrv_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_DNSSRV */
int
dnssrv_back_initialize(
BackendInfo *bi )
@ -101,3 +85,22 @@ dnssrv_back_db_destroy(
{
return 0;
}
#if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "dnssrv";
bi.bi_init = dnssrv_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_DNSSRV */

View File

@ -32,23 +32,6 @@
#include "back-ldap.h"
#include "external.h"
#if SLAPD_LDAP == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "ldap";
bi.bi_init = ldap_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_LDAP */
int
ldap_back_open( BackendInfo *bi )
{
@ -271,3 +254,22 @@ ldap_back_db_destroy(
return 0;
}
#if SLAPD_LDAP == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "ldap";
bi.bi_init = ldap_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_LDAP */

View File

@ -25,21 +25,6 @@
#include "back-ldbm.h"
#include "external.h"
#if SLAPD_LDBM == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "ldbm";
bi.bi_init = ldbm_back_initialize;
backend_add(&bi);
return 0;
}
#endif /* SLAPD_LDBM */
int
ldbm_back_initialize(
BackendInfo *bi
@ -253,3 +238,23 @@ ldbm_back_db_destroy(
return 0;
}
#if SLAPD_LDBM == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "ldbm";
bi.bi_init = ldbm_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_LDBM */

View File

@ -27,22 +27,6 @@
#include "back-meta.h"
#include "external.h"
#if SLAPD_META == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] ) {
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "meta";
bi.bi_init = meta_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_META */
int
meta_back_open(
BackendInfo *bi
@ -238,3 +222,22 @@ meta_back_db_destroy(
return 0;
}
#if SLAPD_META == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "meta";
bi.bi_init = meta_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_META */

View File

@ -160,22 +160,6 @@ static struct monitor_subsys_t known_monitor_subsys[] = {
}, { NULL }
};
#if SLAPD_MONITOR == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "monitor";
bi.bi_init = monitor_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_MONITOR */
int
monitor_back_register_subsys( monitor_subsys_t *ms )
{
@ -1471,3 +1455,22 @@ monitor_back_db_destroy(
return 0;
}
#if SLAPD_MONITOR == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "monitor";
bi.bi_init = monitor_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_MONITOR */

View File

@ -173,17 +173,19 @@ null_back_initialize(
}
#if SLAPD_NULL == SLAPD_MOD_DYNAMIC
int init_module(
int argc,
char *argv[] )
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "null";
bi.bi_init = null_back_initialize;
backend_add(&bi);
backend_add( &bi );
return 0;
}
#endif /* SLAPD_NULL */

View File

@ -26,21 +26,6 @@
ldap_pvt_thread_mutex_t passwd_mutex;
#if SLAPD_PASSWD == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "passwd";
bi.bi_init = passwd_back_initialize;
backend_add(&bi);
return 0;
}
#endif /* SLAPD_PASSWD */
int
passwd_back_initialize(
BackendInfo *bi
@ -87,3 +72,22 @@ passwd_back_destroy(
ldap_pvt_thread_mutex_destroy( &passwd_mutex );
return 0;
}
#if SLAPD_PASSWD == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "passwd";
bi.bi_init = passwd_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_PASSWD */

View File

@ -24,22 +24,6 @@ EXT void boot_DynaLoader LDAP_P((PERL_BACK_BOOT_DYNALOADER_PARAMS));
PerlInterpreter *PERL_INTERPRETER = NULL;
ldap_pvt_thread_mutex_t perl_interpreter_mutex;
#if SLAPD_PERL == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[])
{
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "perl";
bi.bi_init = perl_back_initialize;
backend_add(&bi);
return 0;
}
#endif /* SLAPD_PERL */
/**********************************************************
*
@ -172,3 +156,23 @@ perl_back_xs_init(PERL_BACK_XS_INIT_PARAMS)
dXSUB_SYS;
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
#if SLAPD_PERL == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "perl";
bi.bi_init = perl_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_PERL */

View File

@ -26,22 +26,6 @@
#include "back-relay.h"
#include "external.h"
#if SLAPD_RELAY == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] ) {
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "relay";
bi.bi_init = relay_back_initialize;
backend_add(&bi);
return 0;
}
#endif /* SLAPD_RELAY */
int
relay_back_initialize( BackendInfo *bi )
{
@ -140,3 +124,21 @@ relay_back_db_destroy( Backend *be )
return 0;
}
#if SLAPD_RELAY == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "relay";
bi.bi_init = relay_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_RELAY */

View File

@ -39,21 +39,6 @@
#include "shell.h"
#include "external.h"
#if SLAPD_SHELL == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
BackendInfo bi;
memset( &bi, '\0', sizeof(bi) );
bi.bi_type = "shell";
bi.bi_init = shell_back_initialize;
backend_add(&bi);
return 0;
}
#endif /* SLAPD_SHELL */
int
shell_back_initialize(
BackendInfo *bi
@ -112,3 +97,22 @@ shell_back_db_destroy(
free( be->be_private );
return 0;
}
#if SLAPD_SHELL == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "shell";
bi.bi_init = shell_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_SHELL */

View File

@ -30,25 +30,6 @@
#include "proto-sql.h"
#include "external.h"
#if SLAPD_SQL == SLAPD_MOD_DYNAMIC
int
init_module(
int argc,
char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "sql";
bi.bi_init = sql_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_SQL == SLAPD_MOD_DYNAMIC */
int
sql_back_initialize(
BackendInfo *bi )
@ -502,5 +483,23 @@ backsql_connection_destroy( Backend *bd, Connection *c )
return 0;
}
#if SLAPD_SQL == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
BackendInfo bi;
memset( &bi, '\0', sizeof( bi ) );
bi.bi_type = "sql";
bi.bi_init = sql_back_initialize;
backend_add( &bi );
return 0;
}
#endif /* SLAPD_SQL == SLAPD_MOD_DYNAMIC */
#endif /* SLAPD_SQL */