+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2000-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-#ifndef _BDB_EXTERNAL_H
-#define _BDB_EXTERNAL_H
-
-#ifndef _PROTO_BDB_H
-#error "\"proto-bdb.h\" must be included first"
-#endif /* _PROTO_BDB_H */
-
-/*
-
-#include "proto-bdb.h"
-
- * must be included first
- */
-
-LDAP_BEGIN_DECL
-
-#define bdb_back_initialize BDB_SYMBOL(back_initialize)
-
-extern BI_init bdb_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _BDB_EXTERNAL_H */
-
#include <ac/stdlib.h>
#include "back-bdb.h"
-#include "external.h"
#include <lutil.h>
static const struct bdbi_database {
#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 ) );
+/* conditionally define the init_module() function */
#ifdef BDB_HIER
- bi.bi_type = "hdb";
-#else
- bi.bi_type = "bdb";
-#endif
- bi.bi_init = bdb_back_initialize;
+SLAP_BACKEND_INIT_MODULE( hdb )
+#else /* !BDB_HIER */
+SLAP_BACKEND_INIT_MODULE( bdb )
+#endif /* !BDB_HIER */
- backend_add( &bi );
- return 0;
-}
-#endif /* SLAPD_BDB */
+#endif /* SLAPD_[BH]DB == SLAPD_MOD_DYNAMIC */
* former external.h
*/
-#ifndef BDB_SYMBOL
-#ifdef BDB_HIER
-#define BDB_SYMBOL(x) LDAP_CONCAT(hdb_,x)
-#else
-#define BDB_SYMBOL(x) LDAP_CONCAT(bdb_,x)
-#endif
-#endif
-
+#define bdb_back_initialize BDB_SYMBOL(back_initialize)
#define bdb_db_config BDB_SYMBOL(db_config)
#define bdb_add BDB_SYMBOL(add)
#define bdb_bind BDB_SYMBOL(bind)
#define bdb_tool_id2entry_get BDB_SYMBOL(tool_id2entry_get)
#define bdb_tool_entry_modify BDB_SYMBOL(tool_entry_modify)
+extern BI_init bdb_back_initialize;
+
extern BI_db_config bdb_db_config;
extern BI_op_add bdb_add;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2000-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was originally developed by Kurt D. Zeilenga for inclusion
- * in OpenLDAP Software.
- */
-
-#ifndef _DNSSRV_EXTERNAL_H
-#define _DNSSRV_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init dnssrv_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _DNSSRV_EXTERNAL_H */
#include "slap.h"
#include "proto-dnssrv.h"
-#include "external.h"
int
dnssrv_back_initialize(
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( dnssrv )
-#endif /* SLAPD_DNSSRV */
+#endif /* SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init dnssrv_back_initialize;
+
extern BI_open dnssrv_back_open;
extern BI_close dnssrv_back_close;
extern BI_destroy dnssrv_back_destroy;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2000-2004 The OpenLDAP Foundation.
- * Portions Copyright 2003 Howard Chu @ Symas Corp.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was originally developed by Howard Chu for inclusion
- * in OpenLDAP Software.
- */
-
-#ifndef _HDB_EXTERNAL_H
-#define _HDB_EXTERNAL_H
-
-#ifndef BDB_HIER
-#define BDB_HIER
-#endif
-
-extern BI_init hdb_back_initialize;
-
-#include "../back-bdb/external.h"
-
-#endif /* _HDB_EXTERNAL_H */
-
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2003-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by the Howard Chu for inclusion
- * in OpenLDAP Software and subsequently enhanced by Pierangelo
- * Masarati.
- */
-
-#ifndef _LDAP_EXTERNAL_H
-#define _LDAP_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init ldap_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _LDAP_EXTERNAL_H */
#include "slap.h"
#include "back-ldap.h"
-#include "external.h"
int
ldap_back_open( BackendInfo *bi )
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( ldap )
-#endif /* SLAPD_LDAP */
+#endif /* SLAPD_LDAP == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init ldap_back_initialize;
+
extern BI_open ldap_back_open;
extern BI_close ldap_back_close;
extern BI_destroy ldap_back_destroy;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-#ifndef _LDBM_EXTERNAL_H
-#define _LDBM_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init ldbm_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _LDBM_EXTERNAL_H */
#include "slap.h"
#include "back-ldbm.h"
-#include "external.h"
int
ldbm_back_initialize(
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( ldbm )
-#endif /* SLAPD_LDBM */
+#endif /* SLAPD_LDBM == SLAPD_MOD_DYNAMIC */
* former external.h
*/
+extern BI_init ldbm_back_initialize;
+
extern BI_open ldbm_back_open;
extern BI_close ldbm_back_close;
extern BI_destroy ldbm_back_destroy;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1999-2004 The OpenLDAP Foundation.
- * Portions Copyright 2001-2003 Pierangelo Masarati.
- * Portions Copyright 1999-2003 Howard Chu.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by the Howard Chu for inclusion
- * in OpenLDAP Software and subsequently enhanced by Pierangelo
- * Masarati.
- */
-
-#ifndef META_EXTERNAL_H
-#define META_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init meta_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* META_EXTERNAL_H */
#include "slap.h"
#include "../back-ldap/back-ldap.h"
#include "back-meta.h"
-#include "external.h"
int
meta_back_open(
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( meta )
-#endif /* SLAPD_META */
+#endif /* SLAPD_META == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init meta_back_initialize;
+
extern BI_open meta_back_open;
extern BI_close meta_back_close;
extern BI_destroy meta_back_destroy;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2001-2004 The OpenLDAP Foundation.
- * Portions Copyright 2001-2003 Pierangelo Masarati.
- * All rights reserved.
- *
- * 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 in file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by Pierangelo Masarati for inclusion
- * in OpenLDAP Software.
- */
-
-#ifndef _MONITOR_EXTERNAL_H
-#define _MONITOR_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init monitor_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _MONITOR_EXTERNAL_H */
#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 */
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( monitor )
+#endif /* SLAPD_MONITOR == SLAPD_MOD_DYNAMIC */
* former external.h
*/
+extern BI_init monitor_back_initialize;
+
extern BI_db_init monitor_back_db_init;
extern BI_db_open monitor_back_db_open;
extern BI_config monitor_back_config;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2002-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was originally developed by Howard Chu for inclusion
- * in OpenLDAP Software.
- */
-
-#ifndef _NULL_EXTERNAL_H
-#define _NULL_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init null_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _NULL_EXTERNAL_H */
#include <ac/string.h>
#include "slap.h"
-#include "external.h"
/*
* former external.h
*/
+extern BI_init null_back_initialize;
+
extern BI_db_init null_back_db_init;
extern BI_db_destroy null_back_db_destroy;
extern BI_db_config null_back_db_config;
#if SLAPD_NULL == SLAPD_MOD_DYNAMIC
-int
-init_module( int argc, char *argv[] )
-{
- BackendInfo bi;
-
- memset( &bi, '\0', sizeof( bi ) );
- bi.bi_type = "null";
- bi.bi_init = null_back_initialize;
-
- backend_add( &bi );
-
- return 0;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( null )
-#endif /* SLAPD_NULL */
+#endif /* SLAPD_NULL == SLAPD_MOD_DYNAMIC */
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-#ifndef _PASSWD_EXTERNAL_H
-#define _PASSWD_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init passwd_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _PASSWD_EXTERNAL_H */
#include "slap.h"
#include "back-passwd.h"
-#include "external.h"
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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( passwd )
-#endif /* SLAPD_PASSWD */
+#endif /* SLAPD_PASSWD == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init passwd_back_initialize;
+
extern BI_destroy passwd_back_destroy;
extern BI_db_config passwd_back_db_config;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1999-2004 The OpenLDAP Foundation.
- * Portions Copyright 1999 John C. Quillan.
- * Portions Copyright 2002 myinternet Limited.
- * All rights reserved.
- *
- * 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 in file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-#ifndef _PERL_EXTERNAL_H
-#define _PERL_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init perl_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _PERL_EXTERNAL_H */
*/
#include "perl_back.h"
-#include "external.h"
static void perl_back_xs_init LDAP_P((PERL_BACK_XS_INIT_PARAMS));
EXT void boot_DynaLoader LDAP_P((PERL_BACK_BOOT_DYNALOADER_PARAMS));
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( perl )
-#endif /* SLAPD_PERL */
+#endif /* SLAPD_PERL == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init perl_back_initialize;
+
extern BI_open perl_back_open;
extern BI_close perl_back_close;
extern BI_destroy perl_back_destroy;
+++ /dev/null
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2001-2004 The OpenLDAP Foundation.
- * Portions Copyright 2004 Pierangelo Masarati.
- * All rights reserved.
- *
- * 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 in file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by Pierangelo Masarati for inclusion
- * in OpenLDAP Software.
- */
-
-#ifndef RELAY_EXTERNAL_H
-#define RELAY_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init relay_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _MONITOR_EXTERNAL_H */
-
#include "slap.h"
#include "back-relay.h"
-#include "external.h"
int
relay_back_initialize( BackendInfo *bi )
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( relay )
-#endif /* SLAPD_RELAY */
+#endif /* SLAPD_RELAY == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init relay_back_initialize;
+
extern BI_db_init relay_back_db_init;
extern BI_db_config relay_back_db_config;
extern BI_db_open relay_back_db_open;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2004 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* Portions Copyright (c) 1995 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was originally developed by the University of Michigan
- * (as part of U-MICH LDAP).
- */
-
-#ifndef _SHELL_EXTERNAL_H
-#define _SHELL_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init shell_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _SHELL_EXTERNAL_H */
#include "slap.h"
#include "shell.h"
-#include "external.h"
int
shell_back_initialize(
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( shell )
-#endif /* SLAPD_SHELL */
+#endif /* SLAPD_SHELL == SLAPD_MOD_DYNAMIC */
LDAP_BEGIN_DECL
+extern BI_init shell_back_initialize;
+
extern BI_open shell_back_open;
extern BI_close shell_back_close;
extern BI_destroy shell_back_destroy;
+++ /dev/null
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1999-2004 The OpenLDAP Foundation.
- * Portions Copyright 1999 Dmitry Kovalev.
- * All rights reserved.
- *
- * 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 in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by Dmitry Kovalev for inclusion
- * by OpenLDAP Software.
- */
-
-#ifndef _SQL_EXTERNAL_H
-#define _SQL_EXTERNAL_H
-
-LDAP_BEGIN_DECL
-
-extern BI_init sql_back_initialize;
-
-LDAP_END_DECL
-
-#endif /* _SQL_EXTERNAL_H */
#include "portable.h"
-#ifdef SLAPD_SQL
-
#include <stdio.h>
#include <sys/types.h>
#include "ac/string.h"
#include "slap.h"
#include "proto-sql.h"
-#include "external.h"
int
sql_back_initialize(
BackendInfo *bi )
{
static char *controls[] = {
-#if 0 /* needs updating */
+#if 0 /* needs improvements */
#ifdef LDAP_CONTROL_NOOP
LDAP_CONTROL_NOOP,
#endif /* LDAP_CONTROL_NOOP */
#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;
-}
+/* conditionally define the init_module() function */
+SLAP_BACKEND_INIT_MODULE( sql )
#endif /* SLAPD_SQL == SLAPD_MOD_DYNAMIC */
-#endif /* SLAPD_SQL */
-
/*
* former external.h
*/
+
+extern BI_init sql_back_initialize;
+
extern BI_destroy backsql_destroy;
extern BI_db_init backsql_db_init;
} ComponentSyntaxInfo;
#endif
+
+#define SLAP_BACKEND_INIT_MODULE(b) \
+ int \
+ init_module( int argc, char *argv[] ) \
+ { \
+ BackendInfo bi; \
+ memset( &bi, '\0', sizeof( bi ) ); \
+ bi.bi_type = #b ; \
+ bi.bi_init = b ## _back_initialize; \
+ backend_add( &bi ); \
+ return 0; \
+ }
+
LDAP_END_DECL
#include "proto-slap.h"