]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/allop/allop.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / slapd-modules / allop / allop.c
index f0397aadfe286595d69d0a99548fbcf675a50e8d..65277833f033fabc29b5796237a2df84013aef0c 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005 The OpenLDAP Foundation.
+ * Copyright 2005-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,12 +35,22 @@ allop-URI   <ldapURI>
 
 #include "portable.h"
 
-#ifdef SLAPD_OVER_ALLOP
-
 #include <stdio.h>
 #include <ac/string.h>
 
 #include "slap.h"
+#include "config.h"
+
+#define        SLAP_OVER_VERSION_REQUIRE(major,minor,patch) \
+       ( \
+               ( LDAP_VENDOR_VERSION_MAJOR == X || LDAP_VENDOR_VERSION_MAJOR >= (major) ) \
+               && ( LDAP_VENDOR_VERSION_MINOR == X || LDAP_VENDOR_VERSION_MINOR >= (minor) ) \
+               && ( LDAP_VENDOR_VERSION_PATCH == X || LDAP_VENDOR_VERSION_PATCH >= (patch) ) \
+       )
+
+#if !SLAP_OVER_VERSION_REQUIRE(2,3,0)
+#error "version mismatch"
+#endif
 
 typedef struct allop_t {
        struct berval   ao_ndn;
@@ -131,7 +141,7 @@ allop_db_config(
 }
 
 static int
-allop_db_destroy( BackendDB *be )
+allop_db_destroy( BackendDB *be, ConfigReply *cr )
 {
        slap_overinst   *on = (slap_overinst *)be->bd_info;
        allop_t         *ao = (allop_t *)on->on_bi.bi_private;
@@ -243,12 +253,9 @@ allop_init()
        return overlay_register( &allop );
 }
 
-#if SLAPD_OVER_ALLOP == SLAPD_MOD_DYNAMIC
 int
 init_module( int argc, char *argv[] )
 {
        return allop_init();
 }
-#endif /* SLAPD_OVER_ALLOP == SLAPD_MOD_DYNAMIC */
 
-#endif /* defined(SLAPD_OVER_ALLOP) */