]> git.sur5r.net Git - openldap/commitdiff
rework static backend initialization
authorPierangelo Masarati <ando@openldap.org>
Thu, 11 Nov 2004 00:38:11 +0000 (00:38 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 11 Nov 2004 00:38:11 +0000 (00:38 +0000)
26 files changed:
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/bind.c
servers/slapd/back-bdb/compare.c
servers/slapd/back-bdb/config.c
servers/slapd/back-bdb/ctxcsn.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/extended.c
servers/slapd/back-bdb/external.h
servers/slapd/back-bdb/id2entry.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/operational.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-bdb/referral.c
servers/slapd/back-bdb/search.c
servers/slapd/back-bdb/tools.c
servers/slapd/back-bdb/trans.c
servers/slapd/back-dnssrv/bind.c
servers/slapd/back-dnssrv/compare.c
servers/slapd/back-dnssrv/config.c
servers/slapd/back-dnssrv/external.h
servers/slapd/back-dnssrv/init.c
servers/slapd/back-dnssrv/proto-dnssrv.h [new file with mode: 0644]
servers/slapd/back-dnssrv/referral.c
servers/slapd/back-dnssrv/search.c

index 2c3826d0c76dc56de2d6792ab22962ce56db9f1b..b3935fb187d00583740ce18dfac2661210a563ea 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_add(Operation *op, SlapReply *rs )
index c4a2092e0a9ec28b0461411c6357f1c76793e61e..3f4c558c852905eeb648b584d7a1aa13802200f7 100644 (file)
@@ -22,7 +22,6 @@
 #include <ac/unistd.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_bind( Operation *op, SlapReply *rs )
index 7a3b279bf00611581a4fe4e254bf948fc2079d0a..d23cf99f259889e9371c01b27ce23c0782d31ccb 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_compare( Operation *op, SlapReply *rs )
index e417e713c2a75174808e2e9797634c8f35924e9d..1c346e38b64005a0d2242ffa55f87b8a4a4fe75f 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 #ifdef DB_DIRTY_READ
 #      define  SLAP_BDB_ALLOW_DIRTY_READ
index e5bccf02ed8e032b8b05c72adf683eb0b80945cf..82e1f53259ae7983c53fce16c0483e9e0030324d 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "lutil.h"
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_csn_commit(
index 701ff22ec96e4bf92a4dc8248134ca6d69b773b2..0eb82f9304cb0a2b85168d76cbab7f6503496822 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_delete( Operation *op, SlapReply *rs )
index dfe8b29a3cf51c8fa2066c7ff43ce04f83356e62..bd65f8115fafce53d634eb9a341a4ba3b1feb888 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 #include "lber_pvt.h"
 
 static struct exop {
index 14070c2919b28351ef67e2ced234d448afbeecf7..7a80427ec9c33c5592d8f8ac9682120e551aac85 100644 (file)
 #ifndef _BDB_EXTERNAL_H
 #define _BDB_EXTERNAL_H
 
-LDAP_BEGIN_DECL
-
-#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_initialize                         BDB_SYMBOL(initialize)
-#define bdb_db_config                          BDB_SYMBOL(db_config)
-#define bdb_add                                                BDB_SYMBOL(add)
-#define bdb_bind                                       BDB_SYMBOL(bind)
-#define bdb_compare                                    BDB_SYMBOL(compare)
-#define bdb_delete                                     BDB_SYMBOL(delete)
-#define bdb_modify                                     BDB_SYMBOL(modify)
-#define bdb_modrdn                                     BDB_SYMBOL(modrdn)
-#define bdb_search                                     BDB_SYMBOL(search)
-#define bdb_extended                           BDB_SYMBOL(extended)
-#define bdb_referrals                          BDB_SYMBOL(referrals)
-#define bdb_operational                                BDB_SYMBOL(operational)
-#define bdb_hasSubordinates                    BDB_SYMBOL(hasSubordinates)
-#define bdb_tool_entry_open                    BDB_SYMBOL(tool_entry_open)
-#define bdb_tool_entry_close           BDB_SYMBOL(tool_entry_close)
-#define bdb_tool_entry_next                    BDB_SYMBOL(tool_entry_next)
-#define bdb_tool_entry_get                     BDB_SYMBOL(tool_entry_get)
-#define bdb_tool_entry_put                     BDB_SYMBOL(tool_entry_put)
-#define bdb_tool_entry_reindex         BDB_SYMBOL(tool_entry_reindex)
-#define bdb_tool_dn2id_get                     BDB_SYMBOL(tool_dn2id_get)
-#define bdb_tool_id2entry_get          BDB_SYMBOL(tool_id2entry_get)
-#define bdb_tool_entry_modify          BDB_SYMBOL(tool_entry_modify)
-
-extern BI_init bdb_initialize;
-
-extern BI_db_config    bdb_db_config;
-
-extern BI_op_add       bdb_add;
-
-extern BI_op_bind      bdb_bind;
+#ifndef _PROTO_BDB_H
+#error "\"proto-bdb.h\" must be included first"
+#endif /* _PROTO_BDB_H */
 
-extern BI_op_compare   bdb_compare;
+/*
 
-extern BI_op_delete    bdb_delete;
+#include "proto-bdb.h"
 
-extern BI_op_modify    bdb_modify;
-
-extern BI_op_modrdn    bdb_modrdn;
-
-extern BI_op_search    bdb_search;
-
-extern BI_op_extended  bdb_extended;
-
-extern BI_chk_referrals        bdb_referrals;
+ * must be included first
+ */
 
-extern BI_operational  bdb_operational;
+LDAP_BEGIN_DECL
 
-extern BI_has_subordinates bdb_hasSubordinates;
+#define bdb_back_initialize            BDB_SYMBOL(back_initialize)
 
-/* tools.c */
-extern BI_tool_entry_open      bdb_tool_entry_open;
-extern BI_tool_entry_close     bdb_tool_entry_close;
-extern BI_tool_entry_next      bdb_tool_entry_next;
-extern BI_tool_entry_get       bdb_tool_entry_get;
-extern BI_tool_entry_put       bdb_tool_entry_put;
-extern BI_tool_entry_reindex   bdb_tool_entry_reindex;
-extern BI_tool_dn2id_get       bdb_tool_dn2id_get;
-extern BI_tool_id2entry_get    bdb_tool_id2entry_get;
-extern BI_tool_entry_modify    bdb_tool_entry_modify;
+extern BI_init                         bdb_back_initialize;
 
 LDAP_END_DECL
 
index cdef3f488d92abfb9aff2c7b9c280f2f027c0d5b..d1cf0b747efddd87a519d4ae58dad1dfa27e4cd2 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 static int bdb_id2entry_put(
        BackendDB *be,
index 217c662cf6cb7de62e0b912a692e05b63fbd8df8..f65be68a60a16be13397546b93322c511ee817b6 100644 (file)
@@ -540,7 +540,7 @@ int init_module( int argc, char *argv[] ) {
 #else
        bi.bi_type = "bdb";
 #endif
-       bi.bi_init = bdb_initialize;
+       bi.bi_init = bdb_back_initialize;
 
        backend_add( &bi );
        return 0;
@@ -548,7 +548,7 @@ int init_module( int argc, char *argv[] ) {
 #endif /* SLAPD_BDB */
 
 int
-bdb_initialize(
+bdb_back_initialize(
        BackendInfo     *bi )
 {
        static char *controls[] = {
@@ -564,7 +564,7 @@ bdb_initialize(
        };
 
        /* initialize the underlying database system */
-       Debug( LDAP_DEBUG_TRACE, "bdb_initialize: initialize BDB backend\n",
+       Debug( LDAP_DEBUG_TRACE, "bdb_back_initialize: initialize BDB backend\n",
                0, 0, 0 );
 
        bi->bi_flags |=
@@ -596,12 +596,12 @@ bdb_initialize(
                if( ver < DB_VERSION_FULL )
                {
                        Debug( LDAP_DEBUG_ANY,
-                               "bdb_initialize: BDB library version mismatch:"
+                               "bdb_back_initialize: BDB library version mismatch:"
                                " expected " DB_VERSION_STRING ","
                                " got %s\n", version, 0, 0 );
                }
 
-               Debug( LDAP_DEBUG_ANY, "bdb_initialize: %s\n",
+               Debug( LDAP_DEBUG_ANY, "bdb_back_initialize: %s\n",
                        version, 0, 0 );
        }
 
index 0df677600fcf104df456799413911184c0ec2767..07a9740813c522040997da9a5516b6c13e3e8e0e 100644 (file)
@@ -21,7 +21,6 @@
 #include <ac/time.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 static struct berval scbva[] = {
        BER_BVC("glue"),
index 82f48c4210faab88dfe2bf810f9c59b5eb228c72..a85ca3faef147779f86bf78d225fde0c763bc436 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_modrdn( Operation  *op, SlapReply *rs )
index 8eabfc9233b66c3c3438d9bbbebd6c4507cf9c40..5707cf4dbf840dfa90c6b3d0eb8633e5c5bf7fdb 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "slap.h"
 #include "back-bdb.h"
-#include "external.h"
 
 /*
  * sets *hasSubordinates to LDAP_COMPARE_TRUE/LDAP_COMPARE_FALSE
index 8f7273f6ec82d52e510deabf1e36a3ebc76d95ba..6f264720f42eab39afc87c48781645735b41f2b1 100644 (file)
@@ -572,6 +572,68 @@ int bdb_do_search(
 void
 bdb_trans_backoff( int num_retries );
 
+/*
+ * 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_db_config                  BDB_SYMBOL(db_config)
+#define bdb_add                                BDB_SYMBOL(add)
+#define bdb_bind                       BDB_SYMBOL(bind)
+#define bdb_compare                    BDB_SYMBOL(compare)
+#define bdb_delete                     BDB_SYMBOL(delete)
+#define bdb_modify                     BDB_SYMBOL(modify)
+#define bdb_modrdn                     BDB_SYMBOL(modrdn)
+#define bdb_search                     BDB_SYMBOL(search)
+#define bdb_extended                   BDB_SYMBOL(extended)
+#define bdb_referrals                  BDB_SYMBOL(referrals)
+#define bdb_operational                        BDB_SYMBOL(operational)
+#define bdb_hasSubordinates            BDB_SYMBOL(hasSubordinates)
+#define bdb_tool_entry_open            BDB_SYMBOL(tool_entry_open)
+#define bdb_tool_entry_close           BDB_SYMBOL(tool_entry_close)
+#define bdb_tool_entry_next            BDB_SYMBOL(tool_entry_next)
+#define bdb_tool_entry_get             BDB_SYMBOL(tool_entry_get)
+#define bdb_tool_entry_put             BDB_SYMBOL(tool_entry_put)
+#define bdb_tool_entry_reindex         BDB_SYMBOL(tool_entry_reindex)
+#define bdb_tool_dn2id_get             BDB_SYMBOL(tool_dn2id_get)
+#define bdb_tool_id2entry_get          BDB_SYMBOL(tool_id2entry_get)
+#define bdb_tool_entry_modify          BDB_SYMBOL(tool_entry_modify)
+
+extern BI_db_config                    bdb_db_config;
+
+extern BI_op_add                       bdb_add;
+extern BI_op_bind                      bdb_bind;
+extern BI_op_compare                   bdb_compare;
+extern BI_op_delete                    bdb_delete;
+extern BI_op_modify                    bdb_modify;
+extern BI_op_modrdn                    bdb_modrdn;
+extern BI_op_search                    bdb_search;
+extern BI_op_extended                  bdb_extended;
+
+extern BI_chk_referrals                        bdb_referrals;
+
+extern BI_operational                  bdb_operational;
+
+extern BI_has_subordinates             bdb_hasSubordinates;
+
+/* tools.c */
+extern BI_tool_entry_open              bdb_tool_entry_open;
+extern BI_tool_entry_close             bdb_tool_entry_close;
+extern BI_tool_entry_next              bdb_tool_entry_next;
+extern BI_tool_entry_get               bdb_tool_entry_get;
+extern BI_tool_entry_put               bdb_tool_entry_put;
+extern BI_tool_entry_reindex           bdb_tool_entry_reindex;
+extern BI_tool_dn2id_get               bdb_tool_dn2id_get;
+extern BI_tool_id2entry_get            bdb_tool_id2entry_get;
+extern BI_tool_entry_modify            bdb_tool_entry_modify;
+
 LDAP_END_DECL
 
 #endif /* _PROTO_BDB_H */
index 9b8d434deb8a1786ce41a75325bbb5fe16e616b3..aab9fe6dcfb8e2b776e20e2ad4e29b71911792ce 100644 (file)
@@ -19,7 +19,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 
 int
 bdb_referrals( Operation *op, SlapReply *rs )
index 5f7081f97ece72f5ad4460d4d6d0d8bbcea63dfe..e765b3a2de83006c3a639a3ba1e2fd39cb4a7ec6 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "back-bdb.h"
 #include "idl.h"
-#include "external.h"
 
 static int base_candidate(
        BackendDB       *be,
index ddf92e751c521363c7d59f9a51c7a240c2511d5f..0f4dcfcfd6667514a68cff700e938aa28d29cb00 100644 (file)
@@ -21,7 +21,6 @@
 
 #define AVL_INTERNAL
 #include "back-bdb.h"
-#include "external.h"
 
 static DBC *cursor = NULL;
 static DBT key, data;
index b10906a21b61c6f7150a50202a9e95cdaab5acef..a18875ee146fc2a83689b04e72cb63eb9a292803 100644 (file)
@@ -20,7 +20,6 @@
 #include <ac/string.h>
 
 #include "back-bdb.h"
-#include "external.h"
 #include "lber_pvt.h"
 #include "lutil.h"
 
index a5a3fe3d9b3fb006cd670a1bcf049664e8c50551..eb02774567e0615f56cef387d3151938563d87ba 100644 (file)
@@ -28,7 +28,7 @@
 #include <ac/string.h>
 
 #include "slap.h"
-#include "external.h"
+#include "proto-dnssrv.h"
 
 int
 dnssrv_back_bind(
index 50464d5b08c2637867bab91d46ec2ad89996ede1..99f99de81e8f0c3593f400718155641a8dfc6c1c 100644 (file)
@@ -27,7 +27,7 @@
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "back-dnssrv.h"
+#include "proto-dnssrv.h"
 
 int
 dnssrv_back_compare(
index d809179b4b79d2061f9b7f3b4941ef0738851b87..c72a15b1c1df2b185d0045f8e7f6a5ac2123c538 100644 (file)
@@ -27,7 +27,7 @@
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "external.h"
+#include "proto-dnssrv.h"
 
 int
 dnssrv_back_db_config(
index 1a34767d9a26d2abb42aad9a8a2f0a711ca7b3d9..5f7ebb94b6197ef7874f4ae56b1ace636982aac8 100644 (file)
 
 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;
-
-extern BI_db_init      dnssrv_back_db_init;
-extern BI_db_destroy   dnssrv_back_db_destroy;
-
-extern BI_db_config    dnssrv_back_db_config;
-
-extern BI_op_bind      dnssrv_back_bind;
-
-extern BI_op_search    dnssrv_back_search;
-
-extern BI_op_compare   dnssrv_back_compare;
-
-extern BI_chk_referrals        dnssrv_back_referrals;
+extern BI_init                 dnssrv_back_initialize;
 
 LDAP_END_DECL
 
index fc8e99146f4035c70402f7236c24f3bf7b189452..392ade4512c6af828f283af1e56fff5d674015ee 100644 (file)
@@ -26,6 +26,7 @@
 #include <ac/socket.h>
 
 #include "slap.h"
+#include "proto-dnssrv.h"
 #include "external.h"
 
 #if SLAPD_DNSSRV == SLAPD_MOD_DYNAMIC
diff --git a/servers/slapd/back-dnssrv/proto-dnssrv.h b/servers/slapd/back-dnssrv/proto-dnssrv.h
new file mode 100644 (file)
index 0000000..7b01eee
--- /dev/null
@@ -0,0 +1,41 @@
+/* $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 PROTO_DNSSRV_H
+#define PROTO_DNSSRV_H
+
+LDAP_BEGIN_DECL
+
+extern BI_open                 dnssrv_back_open;
+extern BI_close                        dnssrv_back_close;
+extern BI_destroy              dnssrv_back_destroy;
+
+extern BI_db_init              dnssrv_back_db_init;
+extern BI_db_destroy           dnssrv_back_db_destroy;
+extern BI_db_config            dnssrv_back_db_config;
+
+extern BI_op_bind              dnssrv_back_bind;
+extern BI_op_search            dnssrv_back_search;
+extern BI_op_compare           dnssrv_back_compare;
+
+extern BI_chk_referrals                dnssrv_back_referrals;
+
+LDAP_END_DECL
+
+#endif /* PROTO_DNSSRV_H */
index 1d5ba88edb9df55153619465eaba25c91316c25a..0e130de0b2f0bf1b25c4d2eaf1312838b1851c62 100644 (file)
@@ -27,7 +27,7 @@
 #include <ac/socket.h>
 
 #include "slap.h"
-#include "external.h"
+#include "proto-dnssrv.h"
 
 int
 dnssrv_back_referrals(
index 40c03230f0bcb9b181dbd4b7b910a6a4f31d1dc9..6970abe91ada97b71434ada5ba60eaba4fd43dbf 100644 (file)
@@ -28,7 +28,7 @@
 #include <ac/time.h>
 
 #include "slap.h"
-#include "external.h"
+#include "proto-dnssrv.h"
 
 int
 dnssrv_back_search(