diff --git a/configure b/configure
index d997035721..1128bcb769 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.606 2005/11/16 05:31:02 kurt Exp .
+# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.607 2005/11/23 17:55:37 kurt Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
@@ -45206,7 +45206,10 @@ cat >>$CONFIG_STATUS <<_ACEOF
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
+STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"
+
_ACEOF
@@ -46229,6 +46232,59 @@ ENDX
/* end of generated file */
ENDX
fi
+OVERLAYSC="servers/slapd/overlays/statover.c"
+echo "Making $OVERLAYSC"
+rm -f $OVERLAYSC
+cat > $OVERLAYSC << ENDX
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2005 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
+ * .
+ */
+/* This file is automatically generated by configure; please do not edit. */
+
+#include "portable.h"
+#include "slap.h"
+
+ENDX
+if test "${STATIC_OVERLAYS}"; then
+ for o in ${STATIC_OVERLAYS}; do
+ oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
+ cat >> $OVERLAYSC << ENDX
+extern BI_init ${oo}_initialize;
+ENDX
+ done
+fi
+
+cat >> $OVERLAYSC << ENDX
+
+OverlayInit slap_oinfo[] = {
+ENDX
+
+if test "${STATIC_OVERLAYS}"; then
+ for o in ${STATIC_OVERLAYS}; do
+ oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
+ echo " Add ${oo} ..."
+ cat >> $OVERLAYSC << ENDX
+ { "${oo}", ${oo}_initialize },
+ENDX
+ done
+fi
+
+ cat >> $OVERLAYSC << ENDX
+ { NULL, NULL },
+};
+
+/* end of generated file */
+ENDX
echo Please run \"make depend\" to build dependencies
;;
diff --git a/configure.in b/configure.in
index 3e0c90949c..29aff6ff7b 100644
--- a/configure.in
+++ b/configure.in
@@ -3252,7 +3252,63 @@ ENDX
/* end of generated file */
ENDX
fi
+OVERLAYSC="servers/slapd/overlays/statover.c"
+echo "Making $OVERLAYSC"
+rm -f $OVERLAYSC
+cat > $OVERLAYSC << ENDX
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2005 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
+ * .
+ */
+/* This file is automatically generated by configure; please do not edit. */
+
+#include "portable.h"
+#include "slap.h"
+
+ENDX
+if test "${STATIC_OVERLAYS}"; then
+ for o in ${STATIC_OVERLAYS}; do
+ oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
+ cat >> $OVERLAYSC << ENDX
+extern BI_init ${oo}_initialize;
+ENDX
+ done
+fi
+
+cat >> $OVERLAYSC << ENDX
+
+OverlayInit slap_oinfo[] = {
+ENDX
+
+if test "${STATIC_OVERLAYS}"; then
+ for o in ${STATIC_OVERLAYS}; do
+ oo=`echo "${o}" | sed -e 's/.o$//' -e 's/_x$//'`
+ echo " Add ${oo} ..."
+ cat >> $OVERLAYSC << ENDX
+ { "${oo}", ${oo}_initialize },
+ENDX
+ done
+fi
+
+ cat >> $OVERLAYSC << ENDX
+ { NULL, NULL },
+};
+
+/* end of generated file */
+ENDX
echo Please run \"make depend\" to build dependencies
-]],[[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"]])
+]],[[
+STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"
+STATIC_OVERLAYS="$SLAPD_STATIC_OVERLAYS"
+]])
AC_OUTPUT
diff --git a/servers/slapd/overlays/Makefile.in b/servers/slapd/overlays/Makefile.in
index 86c8f043ca..5468620ba2 100644
--- a/servers/slapd/overlays/Makefile.in
+++ b/servers/slapd/overlays/Makefile.in
@@ -29,6 +29,7 @@ SRCS = overlays.c \
unique.c \
valsort.c
OBJS = overlays.o \
+ statover.o \
@SLAPD_STATIC_OVERLAYS@
# Add here the objs that are needed by overlays, but do not make it
@@ -113,6 +114,8 @@ MKDEPFLAG = -l
.c.lo:
$(LTCOMPILE_MOD) $<
+statover.o: statover.c $(srcdir)/../slap.h
+
$(LIBRARY): $(OBJS) version.lo
$(AR) rs $@ $(OBJS)
@@ -124,3 +127,6 @@ depend-local:
mv Makefile Makefile.bak; $(SED) $$SCR Makefile.bak > Makefile && \
$(RM) Makefile.bak; fi
+veryclean-local:
+ $(RM) statover.c
+
diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c
index 422510d099..91a04b9b61 100644
--- a/servers/slapd/overlays/accesslog.c
+++ b/servers/slapd/overlays/accesslog.c
@@ -1277,8 +1277,8 @@ accesslog_db_open(
ldap_pvt_thread_pool_context_reset( thrctx );
return rc;
}
-
-int accesslog_init()
+
+int accesslog_initialize()
{
int i, rc;
@@ -1364,8 +1364,10 @@ int accesslog_init()
}
#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_DYNAMIC
-int init_module( int argc, char *argv[]) {
- return accesslog_init();
+int
+init_module( int argc, char *argv[] )
+{
+ return accesslog_initialize();
}
#endif
diff --git a/servers/slapd/overlays/auditlog.c b/servers/slapd/overlays/auditlog.c
index 41da39cbc8..ab24579419 100644
--- a/servers/slapd/overlays/auditlog.c
+++ b/servers/slapd/overlays/auditlog.c
@@ -215,7 +215,7 @@ auditlog_config(
return SLAP_CONF_UNKNOWN;
}
-int auditlog_init() {
+int auditlog_initialize() {
auditlog.on_bi.bi_type = "auditlog";
auditlog.on_bi.bi_db_init = auditlog_db_init;
@@ -228,8 +228,10 @@ int auditlog_init() {
}
#if SLAPD_OVER_AUDITLOG == SLAPD_MOD_DYNAMIC && defined(PIC)
-int init_module( int argc, char *argv[]) {
- return auditlog_init();
+int
+init_module( int argc, char *argv[] )
+{
+ return auditlog_initialize();
}
#endif
diff --git a/servers/slapd/overlays/collect.c b/servers/slapd/overlays/collect.c
index 84bb00947c..f87fed8565 100644
--- a/servers/slapd/overlays/collect.c
+++ b/servers/slapd/overlays/collect.c
@@ -153,7 +153,7 @@ static int collect_config(
static slap_overinst collect;
-int collect_init() {
+int collect_initialize() {
collect.on_bi.bi_type = "collect";
collect.on_bi.bi_db_config = collect_config;
collect.on_response = collect_response;
@@ -163,7 +163,7 @@ int collect_init() {
#if SLAPD_OVER_COLLECT == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
- return collect_init();
+ return collect_initialize();
}
#endif
diff --git a/servers/slapd/overlays/denyop.c b/servers/slapd/overlays/denyop.c
index 759a831d8d..b3db024a99 100644
--- a/servers/slapd/overlays/denyop.c
+++ b/servers/slapd/overlays/denyop.c
@@ -224,7 +224,7 @@ denyop_destroy(
static slap_overinst denyop;
int
-denyop_init( void )
+denyop_initialize( void )
{
memset( &denyop, 0, sizeof( slap_overinst ) );
denyop.on_bi.bi_type = "denyop";
@@ -251,7 +251,7 @@ denyop_init( void )
int
init_module( int argc, char *argv[] )
{
- return denyop_init();
+ return denyop_initialize();
}
#endif /* SLAPD_OVER_DENYOP == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/dyngroup.c b/servers/slapd/overlays/dyngroup.c
index 1bdd95e14e..620224c14c 100644
--- a/servers/slapd/overlays/dyngroup.c
+++ b/servers/slapd/overlays/dyngroup.c
@@ -146,7 +146,7 @@ static slap_overinst dyngroup;
* initialized and registered by some other function inside slapd.
*/
-int dyngroup_init() {
+int dyngroup_initialize() {
dyngroup.on_bi.bi_type = "dyngroup";
dyngroup.on_bi.bi_db_config = dyngroup_config;
dyngroup.on_bi.bi_db_close = dyngroup_close;
@@ -156,8 +156,10 @@ int dyngroup_init() {
}
#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_DYNAMIC
-int init_module(int argc, char *argv[]) {
- return dyngroup_init();
+int
+init_module( int argc, char *argv[] )
+{
+ return dyngroup_initialize();
}
#endif
diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c
index f2a8e332a2..5ccccaf3b9 100644
--- a/servers/slapd/overlays/dynlist.c
+++ b/servers/slapd/overlays/dynlist.c
@@ -749,7 +749,7 @@ static slap_overinst dynlist = { { NULL } };
static
#endif /* SLAPD_OVER_DYNLIST == SLAPD_MOD_DYNAMIC */
int
-dynlist_init(void)
+dynlist_initialize(void)
{
dynlist.on_bi.bi_type = "dynlist";
dynlist.on_bi.bi_db_init = dynlist_db_init;
@@ -766,7 +766,7 @@ dynlist_init(void)
int
init_module( int argc, char *argv[] )
{
- return dynlist_init();
+ return dynlist_initialize();
}
#endif
diff --git a/servers/slapd/overlays/lastmod.c b/servers/slapd/overlays/lastmod.c
index 63a30e6301..2e6170fb0f 100644
--- a/servers/slapd/overlays/lastmod.c
+++ b/servers/slapd/overlays/lastmod.c
@@ -995,7 +995,7 @@ lastmod_db_destroy(
static slap_overinst lastmod;
int
-lastmod_init()
+lastmod_initialize()
{
lastmod.on_bi.bi_type = "lastmod";
lastmod.on_bi.bi_db_init = lastmod_db_init;
@@ -1020,7 +1020,7 @@ lastmod_init()
int
init_module( int argc, char *argv[] )
{
- return lastmod_init();
+ return lastmod_initialize();
}
#endif /* SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/overlays.c b/servers/slapd/overlays/overlays.c
index 0f46ae2cf2..edf4fb3ea6 100644
--- a/servers/slapd/overlays/overlays.c
+++ b/servers/slapd/overlays/overlays.c
@@ -23,116 +23,22 @@
#include "slap.h"
-#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
-extern int accesslog_init();
-#endif
-#if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
-extern int denyop_init();
-#endif
-#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
-extern int dyngroup_init();
-#endif
-#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
-extern int dynlist_init();
-#endif
-#if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
-extern int glue_init();
-#endif
-#if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
-extern int lastmod_init();
-#endif
-#if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
-extern int ppolicy_init();
-#endif
-#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
-extern int pcache_init();
-#endif
-#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
-extern int refint_init();
-#endif
-#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
-extern int retcode_init();
-#endif
-#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
-extern int rwm_init();
-#endif
-#if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
-extern int syncprov_init();
-#endif
-#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
-extern int translucent_init();
-#endif
-#if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
-extern int unique_init();
-#endif
-#if SLAPD_OVER_VALSORT == SLAPD_MOD_STATIC
-extern int valsort_init();
-#endif
-
-static struct {
- char *name;
- int (*func)();
-} funcs[] = {
-#if SLAPD_OVER_ACCESSLOG == SLAPD_MOD_STATIC
- { "Access Log", accesslog_init },
-#endif
-#if SLAPD_OVER_DENYOP == SLAPD_MOD_STATIC
- { "Deny Operation", denyop_init },
-#endif
-#if SLAPD_OVER_DYNGROUP == SLAPD_MOD_STATIC
- { "Dynamic Group", dyngroup_init },
-#endif
-#if SLAPD_OVER_DYNLIST == SLAPD_MOD_STATIC
- { "Dynamic List", dynlist_init },
-#endif
-#if SLAPD_OVER_GLUE == SLAPD_MOD_STATIC
- { "Backend Glue", glue_init },
-#endif
-#if SLAPD_OVER_LASTMOD == SLAPD_MOD_STATIC
- { "Last Modification", lastmod_init },
-#endif
-#if SLAPD_OVER_PPOLICY == SLAPD_MOD_STATIC
- { "Password Policy", ppolicy_init },
-#endif
-#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_STATIC
- { "Proxy Cache", pcache_init },
-#endif
-#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
- { "Referential Integrity", refint_init },
-#endif
-#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
- { "Return Code", retcode_init },
-#endif
-#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
- { "Rewrite/Remap", rwm_init },
-#endif
-#if SLAPD_OVER_SYNCPROV == SLAPD_MOD_STATIC
- { "Syncrepl Provider", syncprov_init },
-#endif
-#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_STATIC
- { "Translucent Proxy", translucent_init },
-#endif
-#if SLAPD_OVER_UNIQUE == SLAPD_MOD_STATIC
- { "Attribute Uniqueness", unique_init },
-#endif
-#if SLAPD_OVER_VALSORT == SLAPD_MOD_STATIC
- { "Value Sorting", valsort_init },
-#endif
- { NULL, NULL }
-};
+extern OverlayInit slap_oinfo[];
int
overlay_init(void)
{
int i, rc = 0;
- for ( i=0; funcs[i].name; i++ ) {
- rc = funcs[i].func();
+ for ( i= 0 ; slap_oinfo[i].ov_type; i++ ) {
+ rc = slap_oinfo[i].ov_init();
if ( rc ) {
Debug( LDAP_DEBUG_ANY,
- "%s overlay setup failed, err %d\n", funcs[i].name, rc, 0 );
+ "%s overlay setup failed, err %d\n",
+ slap_oinfo[i].ov_type, rc, 0 );
break;
}
}
+
return rc;
}
diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c
index 3926281812..61e80fe022 100644
--- a/servers/slapd/overlays/pcache.c
+++ b/servers/slapd/overlays/pcache.c
@@ -1086,7 +1086,7 @@ cache_entries(
}
static int
-proxy_cache_response(
+pcache_response(
Operation *op,
SlapReply *rs )
{
@@ -1218,7 +1218,7 @@ add_filter_attrs(
* performing the pagedResults search only within the client
* and the proxy. This requires pcache to understand pagedResults. */
static int
-proxy_cache_chk_controls(
+pcache_chk_controls(
Operation *op,
SlapReply *rs )
{
@@ -1249,7 +1249,7 @@ proxy_cache_chk_controls(
}
static int
-proxy_cache_search(
+pcache_op_search(
Operation *op,
SlapReply *rs )
{
@@ -1377,7 +1377,7 @@ proxy_cache_search(
add_filter_attrs(op, &op->ors_attrs, query.attrs, filter_attrs);
cb = op->o_tmpalloc( sizeof(*cb) + sizeof(*si), op->o_tmpmemctx);
- cb->sc_response = proxy_cache_response;
+ cb->sc_response = pcache_response;
cb->sc_cleanup = NULL;
cb->sc_private = (cb+1);
si = cb->sc_private;
@@ -1988,7 +1988,7 @@ pc_cf_gen( ConfigArgs *c )
}
static int
-proxy_cache_config(
+pcache_db_config(
BackendDB *be,
const char *fname,
int lineno,
@@ -2007,7 +2007,7 @@ proxy_cache_config(
}
static int
-proxy_cache_init(
+pcache_db_init(
BackendDB *be
)
{
@@ -2052,7 +2052,7 @@ proxy_cache_init(
}
static int
-proxy_cache_open(
+pcache_db_open(
BackendDB *be
)
{
@@ -2109,7 +2109,7 @@ proxy_cache_open(
if ( BER_BVISNULL( &cm->db.be_rootndn )
|| BER_BVISEMPTY( &cm->db.be_rootndn ) )
{
- Debug( LDAP_DEBUG_ANY, "proxy_cache_open(): "
+ Debug( LDAP_DEBUG_ANY, "pcache_db_open(): "
"underlying database of type \"%s\"\n"
" serving naming context \"%s\"\n"
" has no \"rootdn\", required by \"proxycache\".\n",
@@ -2123,7 +2123,7 @@ proxy_cache_open(
}
static int
-proxy_cache_close(
+pcache_db_close(
BackendDB *be
)
{
@@ -2165,7 +2165,7 @@ proxy_cache_close(
}
static int
-proxy_cache_destroy(
+pcache_db_destroy(
BackendDB *be
)
{
@@ -2194,9 +2194,9 @@ proxy_cache_destroy(
return 0;
}
-static slap_overinst proxy_cache;
+static slap_overinst pcache;
-int pcache_init()
+int pcache_initialize()
{
LDAPAttributeType *at;
int code;
@@ -2206,7 +2206,7 @@ int pcache_init()
LDAP_SCHEMA_ALLOW_ALL );
if ( !at ) {
Debug( LDAP_DEBUG_ANY,
- "pcache_init: ldap_str2attributetype failed %s %s\n",
+ "pcache_initialize: ldap_str2attributetype failed %s %s\n",
ldap_scherr2str(code), err, 0 );
return code;
}
@@ -2217,32 +2217,33 @@ int pcache_init()
ldap_memfree( at );
if ( code ) {
Debug( LDAP_DEBUG_ANY,
- "pcache_init: at_add failed %s %s\n",
+ "pcache_initialize: at_add failed %s %s\n",
scherr2str(code), err, 0 );
return code;
}
- proxy_cache.on_bi.bi_type = "pcache";
- proxy_cache.on_bi.bi_db_init = proxy_cache_init;
- proxy_cache.on_bi.bi_db_config = proxy_cache_config;
- proxy_cache.on_bi.bi_db_open = proxy_cache_open;
- proxy_cache.on_bi.bi_db_close = proxy_cache_close;
- proxy_cache.on_bi.bi_db_destroy = proxy_cache_destroy;
- proxy_cache.on_bi.bi_op_search = proxy_cache_search;
+ pcache.on_bi.bi_type = "pcache";
+ pcache.on_bi.bi_db_init = pcache_db_init;
+ pcache.on_bi.bi_db_config = pcache_db_config;
+ pcache.on_bi.bi_db_open = pcache_db_open;
+ pcache.on_bi.bi_db_close = pcache_db_close;
+ pcache.on_bi.bi_db_destroy = pcache_db_destroy;
- proxy_cache.on_bi.bi_chk_controls = proxy_cache_chk_controls;
+ pcache.on_bi.bi_op_search = pcache_op_search;
- proxy_cache.on_bi.bi_cf_ocs = pcocs;
+ pcache.on_bi.bi_chk_controls = pcache_chk_controls;
+
+ pcache.on_bi.bi_cf_ocs = pcocs;
code = config_register_schema( pccfg, pcocs );
if ( code ) return code;
- return overlay_register( &proxy_cache );
+ return overlay_register( &pcache );
}
#if SLAPD_OVER_PROXYCACHE == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
- return pcache_init();
+ return pcache_initialize();
}
#endif
diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c
index a13c406746..88633d167c 100644
--- a/servers/slapd/overlays/ppolicy.c
+++ b/servers/slapd/overlays/ppolicy.c
@@ -1942,7 +1942,7 @@ static char *extops[] = {
static slap_overinst ppolicy;
-int ppolicy_init()
+int ppolicy_initialize()
{
LDAPAttributeType *at;
const char *err;
@@ -2002,7 +2002,7 @@ int ppolicy_init()
#if SLAPD_OVER_PPOLICY == SLAPD_MOD_DYNAMIC
int init_module(int argc, char *argv[]) {
- return ppolicy_init();
+ return ppolicy_initialize();
}
#endif
diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c
index 9004f902f9..5333da6062 100644
--- a/servers/slapd/overlays/refint.c
+++ b/servers/slapd/overlays/refint.c
@@ -659,7 +659,7 @@ done:
** it expects to be called automagically during dynamic module initialization
*/
-int refint_init() {
+int refint_initialize() {
/* statically declared just after the #includes at top */
refint.on_bi.bi_type = "refint";
@@ -674,7 +674,7 @@ int refint_init() {
#if SLAPD_OVER_REFINT == SLAPD_MOD_DYNAMIC && defined(PIC)
int init_module(int argc, char *argv[]) {
- return refint_init();
+ return refint_initialize();
}
#endif
diff --git a/servers/slapd/overlays/retcode.c b/servers/slapd/overlays/retcode.c
index 773ef0a37b..89ac536cd7 100644
--- a/servers/slapd/overlays/retcode.c
+++ b/servers/slapd/overlays/retcode.c
@@ -1066,7 +1066,7 @@ retcode_db_destroy( BackendDB *be )
static
#endif /* SLAPD_OVER_RETCODE == SLAPD_MOD_DYNAMIC */
int
-retcode_init( void )
+retcode_initialize( void )
{
int i, code;
const char *err;
@@ -1243,7 +1243,7 @@ retcode_init( void )
int
init_module( int argc, char *argv[] )
{
- return retcode_init();
+ return retcode_initialize();
}
#endif /* SLAPD_OVER_RETCODE == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c
index 42bf3f8c1e..d4c5f1b9ed 100644
--- a/servers/slapd/overlays/rwm.c
+++ b/servers/slapd/overlays/rwm.c
@@ -1504,7 +1504,7 @@ rwm_db_destroy(
static slap_overinst rwm = { { NULL } };
int
-rwm_init(void)
+rwm_initialize(void)
{
memset( &rwm, 0, sizeof( slap_overinst ) );
@@ -1541,7 +1541,7 @@ rwm_init(void)
int
init_module( int argc, char *argv[] )
{
- return rwm_init();
+ return rwm_initialize();
}
#endif /* SLAPD_OVER_RWM == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/seqmod.c b/servers/slapd/overlays/seqmod.c
index 18f5ded5d7..5018700d8e 100644
--- a/servers/slapd/overlays/seqmod.c
+++ b/servers/slapd/overlays/seqmod.c
@@ -178,7 +178,7 @@ seqmod_db_close(
static slap_overinst seqmod;
int
-seqmod_init()
+seqmod_initialize()
{
seqmod.on_bi.bi_type = "seqmod";
seqmod.on_bi.bi_db_open = seqmod_db_open;
@@ -195,7 +195,7 @@ seqmod_init()
int
init_module( int argc, char *argv[] )
{
- return seqmod_init();
+ return seqmod_initialize();
}
#endif /* SLAPD_OVER_SEQMOD == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c
index eafb6bf12b..75c82cc59a 100644
--- a/servers/slapd/overlays/syncprov.c
+++ b/servers/slapd/overlays/syncprov.c
@@ -2539,7 +2539,7 @@ static int syncprov_parseCtrl (
static slap_overinst syncprov;
int
-syncprov_init()
+syncprov_initialize()
{
int rc;
@@ -2584,7 +2584,7 @@ syncprov_init()
int
init_module( int argc, char *argv[] )
{
- return syncprov_init();
+ return syncprov_initialize();
}
#endif /* SLAPD_OVER_SYNCPROV == SLAPD_MOD_DYNAMIC */
diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c
index 1686df0215..8b1e8f3693 100644
--- a/servers/slapd/overlays/translucent.c
+++ b/servers/slapd/overlays/translucent.c
@@ -735,7 +735,7 @@ static int translucent_close(BackendDB *be) {
**
*/
-int translucent_init() {
+int translucent_initialize() {
translucent.on_bi.bi_type = "translucent";
translucent.on_bi.bi_db_init = translucent_db_init;
@@ -755,7 +755,7 @@ int translucent_init() {
#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_DYNAMIC && defined(PIC)
int init_module(int argc, char *argv[]) {
- return translucent_init();
+ return translucent_initialize();
}
#endif
diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c
index 38ada8877a..5802b4a9d1 100644
--- a/servers/slapd/overlays/unique.c
+++ b/servers/slapd/overlays/unique.c
@@ -573,7 +573,7 @@ static int unique_modrdn(
** it expects to be called automagically during dynamic module initialization
*/
-int unique_init() {
+int unique_initialize() {
/* statically declared just after the #includes at top */
unique.on_bi.bi_type = "unique";
@@ -591,7 +591,7 @@ int unique_init() {
#if SLAPD_OVER_UNIQUE == SLAPD_MOD_DYNAMIC && defined(PIC)
int init_module(int argc, char *argv[]) {
- return unique_init();
+ return unique_initialize();
}
#endif
diff --git a/servers/slapd/overlays/valsort.c b/servers/slapd/overlays/valsort.c
index 1fe209b3c7..1f42a13b3a 100644
--- a/servers/slapd/overlays/valsort.c
+++ b/servers/slapd/overlays/valsort.c
@@ -531,7 +531,7 @@ valsort_parseCtrl(
static slap_overinst valsort;
-int valsort_init()
+int valsort_initialize( void )
{
int rc;
@@ -564,7 +564,7 @@ int valsort_init()
#if SLAPD_OVER_VALSORT == SLAPD_MOD_DYNAMIC
int init_module( int argc, char *argv[]) {
- return valsort_init();
+ return valsort_initialize();
}
#endif
diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h
index b6fc42d06a..5de958e374 100644
--- a/servers/slapd/slap.h
+++ b/servers/slapd/slap.h
@@ -3098,6 +3098,12 @@ struct zone_heap {
return 0; \
}
+typedef int (*OV_init)(void);
+typedef struct slap_oinit_t {
+ const char *ov_type;
+ OV_init ov_init;
+} OverlayInit;
+
LDAP_END_DECL
#include "proto-slap.h"