]> git.sur5r.net Git - openldap/commitdiff
rework static backend initialization
authorPierangelo Masarati <ando@openldap.org>
Thu, 11 Nov 2004 00:39:19 +0000 (00:39 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 11 Nov 2004 00:39:19 +0000 (00:39 +0000)
39 files changed:
configure.in
servers/slapd/back-hdb/external.h
servers/slapd/back-ldap/back-ldap.h
servers/slapd/back-ldap/external.h
servers/slapd/back-ldap/init.c
servers/slapd/back-ldap/proto-ldap.h [new file with mode: 0644]
servers/slapd/back-ldbm/external.h
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/proto-back-ldbm.h
servers/slapd/back-meta/back-meta.h
servers/slapd/back-meta/external.h
servers/slapd/back-meta/init.c
servers/slapd/back-meta/proto-meta.h [new file with mode: 0644]
servers/slapd/back-monitor/external.h
servers/slapd/back-monitor/proto-back-monitor.h
servers/slapd/back-null/external.h
servers/slapd/back-null/null.c
servers/slapd/back-passwd/back-passwd.h
servers/slapd/back-passwd/config.c
servers/slapd/back-passwd/external.h
servers/slapd/back-passwd/init.c
servers/slapd/back-passwd/proto-passwd.h [new file with mode: 0644]
servers/slapd/back-perl/external.h
servers/slapd/back-perl/init.c
servers/slapd/back-perl/perl_back.h
servers/slapd/back-perl/proto-perl.h [new file with mode: 0644]
servers/slapd/back-relay/back-relay.h
servers/slapd/back-relay/external.h
servers/slapd/back-relay/init.c
servers/slapd/back-relay/proto-back-relay.h
servers/slapd/back-shell/external.h
servers/slapd/back-shell/init.c
servers/slapd/back-shell/proto-shell.h [new file with mode: 0644]
servers/slapd/back-shell/shell.h
servers/slapd/back-sql/back-sql.h
servers/slapd/back-sql/external.h
servers/slapd/back-sql/init.c
servers/slapd/back-sql/proto-sql.h
servers/slapd/backend.c

index e9e9db0a4221d1315af4a7ab4b91da77c4dddaa5..f47ce81d68a24305d45d6112509e65b6decec0e7 100644 (file)
@@ -2886,6 +2886,66 @@ else
        SLAPD_NO_STATIC=
 fi
 
+dnl Generate static backend header file
+BACKEND_HEADER=servers/slapd/backend.h
+cat > $BACKEND_HEADER << EOF
+/* 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.
+ */
+/* this file is automatically generated by configure; do not edit */
+
+EOF
+
+for b in $SLAPD_STATIC_BACKENDS; do
+       bb=`echo "$b" | sed -e 's;back-;;'`
+       
+       cat >> $BACKEND_HEADER << EOF
+extern BI_init ${bb}_back_initialize;
+EOF
+done
+
+cat >> $BACKEND_HEADER << EOF
+
+static BackendInfo binfo[[]] = {
+EOF
+
+for b in $SLAPD_STATIC_BACKENDS; do
+       bb=`echo "$b" | sed -e 's;back-;;'`
+       
+       cat >> $BACKEND_HEADER << EOF
+       { "$bb", ${bb}_back_initialize },
+
+EOF
+done
+
+cat >> $BACKEND_HEADER << EOF
+       { NULL, NULL }
+};
+
+/* end of generated file */
+EOF
+dnl done generating static backend header file
+
 AC_SUBST(LIBSRCS)
 AC_SUBST(PLAT)
 AC_SUBST(WITH_SASL)
index e71ab152a8c4d42ba597ccebb637a0e7cd2e84e4..e1bec3ae7eb3ef2cd920ffdc5745719f4317c2ba 100644 (file)
@@ -25,7 +25,7 @@
 #define BDB_HIER
 #endif
 
-extern BI_init hdb_initialize;
+extern BI_init hdb_back_initialize;
 
 #include "../back-bdb/external.h"
 
index 4622443be7c391c0fc2fcdf2405ba79b91ca390b..00f9b9a80f24098fa2a01935c0277fe3a3697f21 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef SLAPD_LDAP_H
 #define SLAPD_LDAP_H
 
-#include "external.h"
+#include "proto-ldap.h"
 
 /* String rewrite library */
 #ifdef ENABLE_REWRITE
index 5f72eda8ae88c10e354578da9fe0c9d384af5726..f4e4d9b712fd2ab4fdc928ebe833b11159962b0a 100644 (file)
 
 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;
-
-extern BI_db_init      ldap_back_db_init;
-extern BI_db_open      ldap_back_db_open;
-extern BI_db_destroy   ldap_back_db_destroy;
-
-extern BI_db_config    ldap_back_db_config;
-
-extern BI_op_bind      ldap_back_bind;
-
-extern BI_connection_destroy   ldap_back_conn_destroy;
-
-extern BI_op_search    ldap_back_search;
-
-extern BI_op_compare   ldap_back_compare;
-
-extern BI_op_modify    ldap_back_modify;
-
-extern BI_op_modrdn    ldap_back_modrdn;
-
-extern BI_op_add       ldap_back_add;
-
-extern BI_op_delete    ldap_back_delete;
-
-extern BI_op_abandon   ldap_back_abandon;
-
-extern BI_op_extended  ldap_back_extended;
-
-extern BI_entry_get_rw ldap_back_entry_get;
+extern BI_init                 ldap_back_initialize;
 
 LDAP_END_DECL
 
index 8062a6373008611e9937da8b18b00ffbcf320d71..bbf35ef531e3bd1fbab427a69786eb18796e189b 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "slap.h"
 #include "back-ldap.h"
+#include "external.h"
 
 #if SLAPD_LDAP == SLAPD_MOD_DYNAMIC
 
diff --git a/servers/slapd/back-ldap/proto-ldap.h b/servers/slapd/back-ldap/proto-ldap.h
new file mode 100644 (file)
index 0000000..9f761fd
--- /dev/null
@@ -0,0 +1,51 @@
+/* $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_open                 ldap_back_open;
+extern BI_close                        ldap_back_close;
+extern BI_destroy              ldap_back_destroy;
+
+extern BI_db_init              ldap_back_db_init;
+extern BI_db_open              ldap_back_db_open;
+extern BI_db_destroy           ldap_back_db_destroy;
+extern BI_db_config            ldap_back_db_config;
+
+extern BI_op_bind              ldap_back_bind;
+extern BI_op_search            ldap_back_search;
+extern BI_op_compare           ldap_back_compare;
+extern BI_op_modify            ldap_back_modify;
+extern BI_op_modrdn            ldap_back_modrdn;
+extern BI_op_add               ldap_back_add;
+extern BI_op_delete            ldap_back_delete;
+extern BI_op_abandon           ldap_back_abandon;
+extern BI_op_extended          ldap_back_extended;
+
+extern BI_connection_destroy   ldap_back_conn_destroy;
+
+extern BI_entry_get_rw         ldap_back_entry_get;
+
+LDAP_END_DECL
+
+#endif /* _LDAP_EXTERNAL_H */
index 1d28f032025dcab3648b1d671a2fdb14547625c3..1ced099a2689b0d8ee9af94c95e0cf7806961618 100644 (file)
 
 LDAP_BEGIN_DECL
 
-extern BI_init ldbm_back_initialize;
-extern BI_open ldbm_back_open;
-extern BI_close        ldbm_back_close;
-extern BI_destroy      ldbm_back_destroy;
-
-extern BI_db_init      ldbm_back_db_init;
-extern BI_db_open      ldbm_back_db_open;
-extern BI_db_close     ldbm_back_db_close;
-extern BI_db_destroy   ldbm_back_db_destroy;
-
-extern BI_db_config    ldbm_back_db_config;
-
-extern BI_op_extended  ldbm_back_extended;
-
-extern BI_op_bind      ldbm_back_bind;
-
-extern BI_op_search    ldbm_back_search;
-
-extern BI_op_compare   ldbm_back_compare;
-
-extern BI_op_modify    ldbm_back_modify;
-
-extern BI_op_modrdn    ldbm_back_modrdn;
-
-extern BI_op_add       ldbm_back_add;
-
-extern BI_op_delete    ldbm_back_delete;
-
-extern BI_operational  ldbm_back_operational;
-
-extern BI_has_subordinates     ldbm_back_hasSubordinates;
-
-/* hooks for slap tools */
-extern BI_tool_entry_open      ldbm_tool_entry_open;
-extern BI_tool_entry_close     ldbm_tool_entry_close;
-extern BI_tool_entry_first     ldbm_tool_entry_first;
-extern BI_tool_entry_next      ldbm_tool_entry_next;
-extern BI_tool_entry_get       ldbm_tool_entry_get;
-extern BI_tool_entry_put       ldbm_tool_entry_put;
-
-extern BI_tool_entry_reindex   ldbm_tool_entry_reindex;
-extern BI_tool_sync    ldbm_tool_sync;
-
-extern BI_chk_referrals        ldbm_back_referrals;
+extern BI_init                 ldbm_back_initialize;
 
 LDAP_END_DECL
 
index 4e18fcf78ac16e22d8c442c8768f5fb8ed063259..c78ce11261124287ff347916937360a869a0aae4 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "slap.h"
 #include "back-ldbm.h"
+#include "external.h"
 
 #if SLAPD_LDBM == SLAPD_MOD_DYNAMIC
 
index 6960bd984ad97318ac0673ef2a60e30d006a963a..88685dd123260f93b610e526e98cd2435329d493 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <ldap_cdefs.h>
 
-#include "external.h"
-
 LDAP_BEGIN_DECL
 
 /*
@@ -219,5 +217,45 @@ int next_id LDAP_P(( Backend *be, ID *idp ));
 int next_id_get LDAP_P(( Backend *be, ID *idp ));
 int next_id_write LDAP_P(( Backend *be, ID id ));
 
+/*
+ * former external.h
+ */
+
+extern BI_open                 ldbm_back_open;
+extern BI_close                        ldbm_back_close;
+extern BI_destroy              ldbm_back_destroy;
+
+extern BI_db_init              ldbm_back_db_init;
+extern BI_db_open              ldbm_back_db_open;
+extern BI_db_close             ldbm_back_db_close;
+extern BI_db_destroy           ldbm_back_db_destroy;
+extern BI_db_config            ldbm_back_db_config;
+
+extern BI_op_extended          ldbm_back_extended;
+extern BI_op_bind              ldbm_back_bind;
+extern BI_op_search            ldbm_back_search;
+extern BI_op_compare           ldbm_back_compare;
+extern BI_op_modify            ldbm_back_modify;
+extern BI_op_modrdn            ldbm_back_modrdn;
+extern BI_op_add               ldbm_back_add;
+extern BI_op_delete            ldbm_back_delete;
+
+extern BI_operational          ldbm_back_operational;
+extern BI_has_subordinates     ldbm_back_hasSubordinates;
+
+/* hooks for slap tools */
+extern BI_tool_entry_open      ldbm_tool_entry_open;
+extern BI_tool_entry_close     ldbm_tool_entry_close;
+extern BI_tool_entry_first     ldbm_tool_entry_first;
+extern BI_tool_entry_next      ldbm_tool_entry_next;
+extern BI_tool_entry_get       ldbm_tool_entry_get;
+extern BI_tool_entry_put       ldbm_tool_entry_put;
+
+extern BI_tool_entry_reindex   ldbm_tool_entry_reindex;
+extern BI_tool_sync            ldbm_tool_sync;
+
+extern BI_chk_referrals                ldbm_back_referrals;
+
 LDAP_END_DECL
-#endif
+
+#endif /* _PROTO_BACK_LDBM */
index 426f66dc4b6d13e84982e2b3df7504a1f3a2dc29..0e35e11ac19237e0079914ecb140715e38d32dfc 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef SLAPD_META_H
 #define SLAPD_META_H
 
-#include "external.h"
+#include "proto-meta.h"
 
 /* String rewrite library */
 #include "rewrite.h"
index bbffdd91e4206b7d59e894b2800e56448774a250..4fb791759a931b7a0bd47df00c2c7473be7d45df 100644 (file)
 
 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;
-
-extern BI_db_init      meta_back_db_init;
-extern BI_db_destroy   meta_back_db_destroy;
-extern BI_db_config    meta_back_db_config;
-
-extern BI_op_bind      meta_back_bind;
-extern BI_connection_destroy   meta_back_conn_destroy;
-extern BI_op_search    meta_back_search;
-extern BI_op_compare   meta_back_compare;
-extern BI_op_modify    meta_back_modify;
-extern BI_op_modrdn    meta_back_modrdn;
-extern BI_op_add       meta_back_add;
-extern BI_op_delete    meta_back_delete;
-extern BI_op_abandon   meta_back_abandon;
+extern BI_init                 meta_back_initialize;
 
 LDAP_END_DECL
 
index 8830e17639bed51a0d4e234cf8bf9655c806455e..01d987453701d420ba07a55a42e3788558cebaa2 100644 (file)
@@ -25,6 +25,7 @@
 #include "slap.h"
 #include "../back-ldap/back-ldap.h"
 #include "back-meta.h"
+#include "external.h"
 
 #if SLAPD_META == SLAPD_MOD_DYNAMIC
 
diff --git a/servers/slapd/back-meta/proto-meta.h b/servers/slapd/back-meta/proto-meta.h
new file mode 100644 (file)
index 0000000..f789cbb
--- /dev/null
@@ -0,0 +1,49 @@
+/* $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 PROTO_META_H
+#define PROTO_META_H
+
+LDAP_BEGIN_DECL
+
+extern BI_open                 meta_back_open;
+extern BI_close                        meta_back_close;
+extern BI_destroy              meta_back_destroy;
+
+extern BI_db_init              meta_back_db_init;
+extern BI_db_destroy           meta_back_db_destroy;
+extern BI_db_config            meta_back_db_config;
+
+extern BI_op_bind              meta_back_bind;
+extern BI_op_search            meta_back_search;
+extern BI_op_compare           meta_back_compare;
+extern BI_op_modify            meta_back_modify;
+extern BI_op_modrdn            meta_back_modrdn;
+extern BI_op_add               meta_back_add;
+extern BI_op_delete            meta_back_delete;
+extern BI_op_abandon           meta_back_abandon;
+
+extern BI_connection_destroy   meta_back_conn_destroy;
+
+LDAP_END_DECL
+
+#endif /* PROTO_META_H */
index 1d9795bdb01a8525b9305785c26efe25378b2a5d..edcd0a875351c217a35ef0ff1edf01bd73b07685 100644 (file)
 
 LDAP_BEGIN_DECL
 
-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;
-extern BI_db_config    monitor_back_db_config;
-
-extern BI_db_destroy   monitor_back_db_destroy;
-
-extern BI_op_search    monitor_back_search;
-extern BI_op_compare   monitor_back_compare;
-extern BI_op_modify    monitor_back_modify;
-extern BI_op_bind      monitor_back_bind;
-extern BI_operational  monitor_back_operational;
+extern BI_init                 monitor_back_initialize;
 
 LDAP_END_DECL
 
index dcc0b9e8266c79400e8b375071c868a984ece9cb..e9621efa4a2ac9d85594d0079780e4f6cf6e7aa0 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <ldap_cdefs.h>
 
-#include "external.h"
-
 LDAP_BEGIN_DECL
 
 /*
@@ -172,6 +170,22 @@ int monitor_subsys_rww_update LDAP_P(( Operation *op, Entry *e ));
        } while ( 0 )
 #endif /* ! HAVE_GMP */
 
+/*
+ * former external.h
+ */
+
+extern BI_db_init              monitor_back_db_init;
+extern BI_db_open              monitor_back_db_open;
+extern BI_config               monitor_back_config;
+extern BI_db_destroy           monitor_back_db_destroy;
+extern BI_db_config            monitor_back_db_config;
+
+extern BI_op_search            monitor_back_search;
+extern BI_op_compare           monitor_back_compare;
+extern BI_op_modify            monitor_back_modify;
+extern BI_op_bind              monitor_back_bind;
+extern BI_operational          monitor_back_operational;
+
 LDAP_END_DECL
 
 #endif /* _PROTO_BACK_MONITOR */
index 6e899ddf5dfe536ff3e5bda6f7268c807ebed8a8..158779286ea11de018ffc8367f52e0db5bb51b94 100644 (file)
@@ -24,25 +24,6 @@ LDAP_BEGIN_DECL
 
 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;
-
-extern BI_op_bind      null_back_bind;
-
-extern BI_op_search    null_back_search;
-
-extern BI_op_compare   null_back_compare;
-
-extern BI_op_modify    null_back_modify;
-
-extern BI_op_modrdn    null_back_modrdn;
-
-extern BI_op_add       null_back_add;
-
-extern BI_op_delete    null_back_delete;
-
 LDAP_END_DECL
 
 #endif /* _NULL_EXTERNAL_H */
index e87575862c9e7a26d086b4c5bd35dc9fa728665b..f0d5f76df9d22825b01fc88c9fbc60cf8aa18e03 100644 (file)
 #include "slap.h"
 #include "external.h"
 
+/*
+ * former external.h
+ */
+
+extern BI_db_init              null_back_db_init;
+extern BI_db_destroy           null_back_db_destroy;
+extern BI_db_config            null_back_db_config;
+
+extern BI_op_bind              null_back_bind;
+extern BI_op_search            null_back_search;
+extern BI_op_compare           null_back_compare;
+extern BI_op_modify            null_back_modify;
+extern BI_op_modrdn            null_back_modrdn;
+extern BI_op_add               null_back_add;
+extern BI_op_delete            null_back_delete;
+
 struct null_info {
        int bind_allowed;
 };
index a73f816cd9df3e45bd91cac17ae58d7c12431518..49805309367182acc118ad5f5d41463ca8634de3 100644 (file)
 #ifndef _BACK_PASSWD_H
 #define _BACK_PASSWD_H
 
-#include "external.h"
+#include "proto-passwd.h"
 
 LDAP_BEGIN_DECL
 
 extern ldap_pvt_thread_mutex_t passwd_mutex;
 
+extern BI_destroy      passwd_back_destroy;
+
+extern BI_db_config    passwd_back_db_config;
+
+extern BI_op_search    passwd_back_search;
+
 LDAP_END_DECL
 
 #endif /* _BACK_PASSWD_H */
index 4e9c92fdc45569e02454ca71ca05cabdcc7fbfc5..65f59c363aa11c9502c4e5a6ec288611f510dc90 100644 (file)
@@ -37,7 +37,7 @@
 #include <ac/time.h>
 
 #include "slap.h"
-#include "external.h"
+#include "back-passwd.h"
 
 int
 passwd_back_db_config(
index 5622dda7c391c3e4a7c8e7d781f41c7c30ea9ed2..eb32b9b1568e7f7b421f7de0117f19c5ced27a68 100644 (file)
 
 LDAP_BEGIN_DECL
 
-extern BI_init passwd_back_initialize;
-extern BI_destroy      passwd_back_destroy;
-
-extern BI_op_search    passwd_back_search;
-
-extern BI_db_config    passwd_back_db_config;
+extern BI_init         passwd_back_initialize;
 
 LDAP_END_DECL
 
index 1ef59c31e6d02cb9f97ec90b2e88b4df879d69d2..34e486846c0792357e397613d5e0278d6749383a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "slap.h"
 #include "back-passwd.h"
+#include "external.h"
 
 ldap_pvt_thread_mutex_t passwd_mutex;
 
diff --git a/servers/slapd/back-passwd/proto-passwd.h b/servers/slapd/back-passwd/proto-passwd.h
new file mode 100644 (file)
index 0000000..e43f1b9
--- /dev/null
@@ -0,0 +1,29 @@
+/* $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 PROTO_PASSWD_H
+#define PROTO_PASSWD_H
+
+LDAP_BEGIN_DECL
+
+extern BI_destroy      passwd_back_destroy;
+
+extern BI_db_config    passwd_back_db_config;
+
+extern BI_op_search    passwd_back_search;
+
+LDAP_END_DECL
+
+#endif /* PROTO_PASSWD_H */
index 89cd9cbecf1523fff90586f495815d30a85ab643..166f8397533c641b24d375e6e4f145d8e6dd5293 100644 (file)
 
 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;
-
-extern BI_db_init      perl_back_db_init;
-extern BI_db_open      perl_back_db_open;
-extern BI_db_destroy   perl_back_db_destroy;
-
-extern BI_db_config    perl_back_db_config;
-
-extern BI_op_bind      perl_back_bind;
-
-extern BI_op_search    perl_back_search;
-
-extern BI_op_compare   perl_back_compare;
-
-extern BI_op_modify    perl_back_modify;
-
-extern BI_op_modrdn    perl_back_modrdn;
-
-extern BI_op_add       perl_back_add;
-
-extern BI_op_delete    perl_back_delete;
+extern BI_init         perl_back_initialize;
 
 LDAP_END_DECL
 
index 8b512135bd071e0b20bbb52bdd6cf01b60801def..91ca4849791a60b32fcf25d92a6eebedc32fc071 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #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));
index 332d1dc390ee5949206ccb7c83d1987886f17480..4609889959d66a48762117ba1ad3ad8e36e4f786 100644 (file)
@@ -70,6 +70,6 @@ typedef struct perl_backend_instance {
 
 LDAP_END_DECL
 
-#include "external.h"
+#include "proto-perl.h"
 
-#endif
+#endif /* PERL_BACK_H */
diff --git a/servers/slapd/back-perl/proto-perl.h b/servers/slapd/back-perl/proto-perl.h
new file mode 100644 (file)
index 0000000..8fe2a1f
--- /dev/null
@@ -0,0 +1,42 @@
+/* $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 PROTO_PERL_H
+#define PROTO_PERL_H
+
+LDAP_BEGIN_DECL
+
+extern BI_open         perl_back_open;
+extern BI_close                perl_back_close;
+extern BI_destroy      perl_back_destroy;
+
+extern BI_db_init      perl_back_db_init;
+extern BI_db_open      perl_back_db_open;
+extern BI_db_destroy   perl_back_db_destroy;
+extern BI_db_config    perl_back_db_config;
+
+extern BI_op_bind      perl_back_bind;
+extern BI_op_search    perl_back_search;
+extern BI_op_compare   perl_back_compare;
+extern BI_op_modify    perl_back_modify;
+extern BI_op_modrdn    perl_back_modrdn;
+extern BI_op_add       perl_back_add;
+extern BI_op_delete    perl_back_delete;
+
+LDAP_END_DECL
+
+#endif /* PROTO_PERL_H */
index 9e447a7448ba17c6935f1036beee959f8be614c0..43b86f68fe2f2dbde5958d02e2f1caffe69e795f 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef SLAPD_RELAY_H
 #define SLAPD_RELAY_H
 
-#include "external.h"
+#include "proto-back-relay.h"
 
 /* String rewrite library */
 
index f5b33ba81015fba6490884b53650a8f08b7f307f..71eb4e335b39d35fe34637ca1aa783b53928a88c 100644 (file)
 LDAP_BEGIN_DECL
 
 extern BI_init                 relay_back_initialize;
-#if 0
-extern BI_config               relay_back_config;
-extern BI_open                 relay_back_open;
-extern BI_close                        relay_back_close;
-extern BI_destroy              relay_back_destroy;
-#endif
-
-extern BI_db_init              relay_back_db_init;
-extern BI_db_config            relay_back_db_config;
-extern BI_db_open              relay_back_db_open;
-extern BI_db_close             relay_back_db_close;
-extern BI_db_destroy           relay_back_db_destroy;
-
-extern BI_op_bind              relay_back_op_bind;
-extern BI_op_unbind            relay_back_op_unbind;
-extern BI_op_search            relay_back_op_search;
-extern BI_op_compare           relay_back_op_compare;
-extern BI_op_modify            relay_back_op_modify;
-extern BI_op_modrdn            relay_back_op_modrdn;
-extern BI_op_add               relay_back_op_add;
-extern BI_op_delete            relay_back_op_delete;
-extern BI_op_abandon           relay_back_op_abandon;
-extern BI_op_cancel            relay_back_op_cancel;
-extern BI_op_extended          relay_back_op_extended;
-extern BI_entry_release_rw     relay_back_entry_release_rw;
-extern BI_entry_get_rw         relay_back_entry_get_rw;
-extern BI_chk_referrals                relay_back_chk_referrals;
-extern BI_operational          relay_back_operational;
-extern BI_has_subordinates     relay_back_has_subordinates;
-
-extern BI_connection_init      relay_back_connection_init;
-extern BI_connection_destroy   relay_back_connection_destroy;
-
-#if 0
-extern BI_tool_entry_open      relay_back_tool_entry_open;
-extern BI_tool_entry_close     relay_back_tool_entry_close;
-extern BI_tool_entry_first     relay_back_tool_entry_first;
-extern BI_tool_entry_next      relay_back_tool_entry_next;
-extern BI_tool_entry_get       relay_back_tool_entry_get;
-extern BI_tool_entry_put       relay_back_tool_entry_put;
-extern BI_tool_entry_reindex   relay_back_tool_entry_reindex;
-extern BI_tool_sync            relay_back_tool_sync;
-extern BI_tool_dn2id_get       relay_back_tool_dn2id_get;
-extern BI_tool_id2entry_get    relay_back_tool_id2entry_get;
-extern BI_tool_entry_modify    relay_back_tool_entry_modify;
-#endif
 
 LDAP_END_DECL
 
index e448ec1185ffdb763ad1226056a95a614241911b..3f57f8379537b7f3d993fedf79b06e0bb9ff3f78 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "slap.h"
 #include "back-relay.h"
+#include "external.h"
 
 #if SLAPD_RELAY == SLAPD_MOD_DYNAMIC
 
index afaba21bf147cf80625425bd3d5896fb3328ee3c..5d2d8ba388987b813cbb96f7f23497aa3b6799db 100644 (file)
 
 #include <ldap_cdefs.h>
 
-#include "external.h"
-
 LDAP_BEGIN_DECL
 
+extern BI_db_init              relay_back_db_init;
+extern BI_db_config            relay_back_db_config;
+extern BI_db_open              relay_back_db_open;
+extern BI_db_close             relay_back_db_close;
+extern BI_db_destroy           relay_back_db_destroy;
+
+extern BI_op_bind              relay_back_op_bind;
+extern BI_op_unbind            relay_back_op_unbind;
+extern BI_op_search            relay_back_op_search;
+extern BI_op_compare           relay_back_op_compare;
+extern BI_op_modify            relay_back_op_modify;
+extern BI_op_modrdn            relay_back_op_modrdn;
+extern BI_op_add               relay_back_op_add;
+extern BI_op_delete            relay_back_op_delete;
+extern BI_op_abandon           relay_back_op_abandon;
+extern BI_op_cancel            relay_back_op_cancel;
+extern BI_op_extended          relay_back_op_extended;
+extern BI_entry_release_rw     relay_back_entry_release_rw;
+extern BI_entry_get_rw         relay_back_entry_get_rw;
+extern BI_chk_referrals                relay_back_chk_referrals;
+extern BI_operational          relay_back_operational;
+extern BI_has_subordinates     relay_back_has_subordinates;
+
+extern BI_connection_init      relay_back_connection_init;
+extern BI_connection_destroy   relay_back_connection_destroy;
+
 LDAP_END_DECL
 
 #endif /* PROTO_BACK_RELAY */
index 6de49c680ebc574ad61412c321491032fe3f5f81..103c323aa7e2db069c0d89df05b0927a1e48e42e 100644 (file)
 
 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;
-
-extern BI_db_init      shell_back_db_init;
-extern BI_db_destroy   shell_back_db_destroy;
-
-extern BI_db_config    shell_back_db_config;
-
-extern BI_op_bind      shell_back_bind;
-
-extern BI_op_unbind    shell_back_unbind;
-
-extern BI_op_search    shell_back_search;
-
-extern BI_op_compare   shell_back_compare;
-
-extern BI_op_modify    shell_back_modify;
-
-extern BI_op_modrdn    shell_back_modrdn;
-
-extern BI_op_add       shell_back_add;
-
-extern BI_op_delete    shell_back_delete;
+extern BI_init         shell_back_initialize;
 
 LDAP_END_DECL
 
index 56f4b75a8d1aca05bdbb4d0ae61df9adc6e88234..a523ef3a2d445567567ffade6ed250ef4b0ede2c 100644 (file)
@@ -35,7 +35,9 @@
 #include <ac/socket.h>
 
 #include "slap.h"
+
 #include "shell.h"
+#include "external.h"
 
 #if SLAPD_SHELL == SLAPD_MOD_DYNAMIC
 
diff --git a/servers/slapd/back-shell/proto-shell.h b/servers/slapd/back-shell/proto-shell.h
new file mode 100644 (file)
index 0000000..f2a1279
--- /dev/null
@@ -0,0 +1,54 @@
+/* $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 PROTO_SHELL_H
+#define PROTO_SHELL_H
+
+LDAP_BEGIN_DECL
+
+extern BI_open         shell_back_open;
+extern BI_close                shell_back_close;
+extern BI_destroy      shell_back_destroy;
+
+extern BI_db_init      shell_back_db_init;
+extern BI_db_destroy   shell_back_db_destroy;
+extern BI_db_config    shell_back_db_config;
+
+extern BI_op_bind      shell_back_bind;
+extern BI_op_unbind    shell_back_unbind;
+extern BI_op_search    shell_back_search;
+extern BI_op_compare   shell_back_compare;
+extern BI_op_modify    shell_back_modify;
+extern BI_op_modrdn    shell_back_modrdn;
+extern BI_op_add       shell_back_add;
+extern BI_op_delete    shell_back_delete;
+
+LDAP_END_DECL
+
+#endif /* PROTO_SHELL_H */
index c2f17ed8f3610890a586d28d4363e691bd95789e..c10cffd748c00d3f475ac2685e5e01948c4e5c27 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef SLAPD_SHELL_H
 #define SLAPD_SHELL_H
 
-#include "external.h"
+#include "proto-shell.h"
 
 LDAP_BEGIN_DECL
 
index 14a8a36f2faf7319c7a79c7cdd130827c464b685..07a73e261589b0c1e0392b185638c0005a24dad6 100644 (file)
@@ -74,7 +74,6 @@
 #ifndef __BACKSQL_H__
 #define __BACKSQL_H__
 
-#include "external.h"
 #include "sql-types.h"
 
 /*
index 57c05321be803b191586963571b35b3d51682e32..f9d90c86e4c566f43f39d6f609b2b95545bed5ec 100644 (file)
 
 LDAP_BEGIN_DECL
 
-extern BI_init         backsql_initialize;
-extern BI_destroy      backsql_destroy;
-
-extern BI_db_init      backsql_db_init;
-extern BI_db_open      backsql_db_open;
-extern BI_db_close     backsql_db_close;
-extern BI_db_destroy   backsql_db_destroy;
-
-extern BI_db_config    backsql_db_config;
-
-extern BI_op_bind      backsql_bind;
-extern BI_op_search    backsql_search;
-extern BI_op_compare   backsql_compare;
-extern BI_op_modify    backsql_modify;
-extern BI_op_modrdn    backsql_modrdn;
-extern BI_op_add       backsql_add;
-extern BI_op_delete    backsql_delete;
-
-extern BI_operational  backsql_operational;
-
-extern BI_connection_destroy   backsql_connection_destroy;
+extern BI_init         sql_back_initialize;
 
 LDAP_END_DECL
 
index e4eb0c5fcc2e138749b3f95255cb5897f2d128c1..e5519bb7948fe2a5616b649890e25ee6ec3ca5f1 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "slap.h"
 #include "proto-sql.h"
+#include "external.h"
 
 #if SLAPD_SQL == SLAPD_MOD_DYNAMIC
 
@@ -40,7 +41,7 @@ init_module(
 
        memset( &bi, '\0', sizeof( bi ) );
        bi.bi_type = "sql";
-       bi.bi_init = backsql_initialize;
+       bi.bi_init = sql_back_initialize;
 
        backend_add( &bi );
        return 0;
@@ -49,7 +50,7 @@ init_module(
 #endif /* SLAPD_SQL == SLAPD_MOD_DYNAMIC */
 
 int
-backsql_initialize(
+sql_back_initialize(
        BackendInfo     *bi )
 { 
        static char *controls[] = {
@@ -66,7 +67,7 @@ backsql_initialize(
 
        bi->bi_controls = controls;
 
-       Debug( LDAP_DEBUG_TRACE,"==>backsql_initialize()\n", 0, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE,"==>sql_back_initialize()\n", 0, 0, 0 );
        
        bi->bi_open = 0;
        bi->bi_config = 0;
@@ -95,7 +96,7 @@ backsql_initialize(
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = backsql_connection_destroy;
 
-       Debug( LDAP_DEBUG_TRACE,"<==backsql_initialize()\n", 0, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE,"<==sql_back_initialize()\n", 0, 0, 0 );
        return 0;
 }
 
index 65ad3351ad2a6e45954989474ed0572e89ef47ae..cd6d0107e6865f2d54a11c6647c492e00c9b88c2 100644 (file)
@@ -256,4 +256,27 @@ int backsql_entryUUID_decode( struct berval *entryUUID, unsigned long *oc_id,
 #endif /* ! BACKSQL_ARBITRARY_KEY */
        );
 
+/*
+ * former external.h
+ */
+extern BI_destroy              backsql_destroy;
+
+extern BI_db_init              backsql_db_init;
+extern BI_db_open              backsql_db_open;
+extern BI_db_close             backsql_db_close;
+extern BI_db_destroy           backsql_db_destroy;
+extern BI_db_config            backsql_db_config;
+
+extern BI_op_bind              backsql_bind;
+extern BI_op_search            backsql_search;
+extern BI_op_compare           backsql_compare;
+extern BI_op_modify            backsql_modify;
+extern BI_op_modrdn            backsql_modrdn;
+extern BI_op_add               backsql_add;
+extern BI_op_delete            backsql_delete;
+
+extern BI_operational          backsql_operational;
+
+extern BI_connection_destroy   backsql_connection_destroy;
+
 #endif /* PROTO_SQL_H */
index 0a59626beaec091ea5205a34b49ea7b6d6eba32d..1ef4c3fdfd7282f888bd874c7587790db5a399b3 100644 (file)
@@ -48,6 +48,8 @@ static int call_group_preop_plugins( Operation *op );
 static void call_group_postop_plugins( Operation *op );
 #endif /* LDAP_SLAPI */
 
+#if 0
+
 /*
  * If a module is configured as dynamic, its header should not
  * get included into slapd. While this is a general rule and does
@@ -152,11 +154,34 @@ static BackendInfo binfo[] = {
        {NULL}
 };
 
+#endif
+
+/*
+ * If a module is configured as dynamic, its header should not
+ * get included into slapd. While this is a general rule and does
+ * not have much of an effect in UNIX, this rule should be adhered
+ * to for Windows, where dynamic object code should not be implicitly
+ * imported into slapd without appropriate __declspec(dllimport) directives.
+ */
+
+/*
+ * This file is automatically generated by configure; it defines
+ * the BackendInfo binfo[] structure with the configured static 
+ * backend info.  It assumes that every backend of type <name> 
+ * provides an initialization function
+ *
+ *     int name_back_initialize( BackendInfo *bi )
+ *
+ * that populates the rest of the structure.
+ */
+
+#include "backend.h"
+
 int                    nBackendInfo = 0;
-BackendInfo    *backendInfo = NULL;
+BackendInfo            *backendInfo = NULL;
 
 int                    nBackendDB = 0; 
-BackendDB      *backendDB = NULL;
+BackendDB              *backendDB = NULL;
 
 ldap_pvt_thread_pool_t syncrepl_pool;
 int                    syncrepl_pool_max = SLAP_MAX_SYNCREPL_THREADS;