Skip to content
Snippets Groups Projects
Commit 79f744f3 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

rework static backend initialization

parent be32dce9
No related branches found
No related tags found
No related merge requests found
Showing
with 252 additions and 142 deletions
......@@ -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)
......
......@@ -25,7 +25,7 @@
#define BDB_HIER
#endif
extern BI_init hdb_initialize;
extern BI_init hdb_back_initialize;
#include "../back-bdb/external.h"
......
......@@ -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
......
......@@ -23,38 +23,7 @@
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
......
......@@ -30,6 +30,7 @@
#include "slap.h"
#include "back-ldap.h"
#include "external.h"
#if SLAPD_LDAP == SLAPD_MOD_DYNAMIC
......
/* $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 */
......@@ -18,50 +18,7 @@
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
......
......@@ -23,6 +23,7 @@
#include "slap.h"
#include "back-ldbm.h"
#include "external.h"
#if SLAPD_LDBM == SLAPD_MOD_DYNAMIC
......
......@@ -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 */
......@@ -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"
......
......@@ -25,24 +25,7 @@
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
......
......@@ -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
......
/* $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 */
......@@ -23,19 +23,7 @@
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
......
......@@ -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 */
......
......@@ -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 */
......@@ -26,6 +26,22 @@
#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;
};
......
......@@ -16,12 +16,18 @@
#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 */
......@@ -37,7 +37,7 @@
#include <ac/time.h>
#include "slap.h"
#include "external.h"
#include "back-passwd.h"
int
passwd_back_db_config(
......
......@@ -18,12 +18,7 @@
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment