]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/delete.c
Cleanup ISO C compatibility for recent commits
[openldap] / servers / slapd / back-sql / delete.c
index ac0f9f62a73e193f2a4c39b0c35e652a52b3997b..a95188642230d72c945faeb05eed2de2a801fc6a 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2007 The OpenLDAP Foundation.
+ * Copyright 1999-2011 The OpenLDAP Foundation.
  * Portions Copyright 1999 Dmitry Kovalev.
  * Portions Copyright 2002 Pierangelo Masarati.
  * All rights reserved.
@@ -293,7 +293,6 @@ static int
 backsql_tree_delete_search_cb( Operation *op, SlapReply *rs )
 {
        if ( rs->sr_type == REP_SEARCH ) {
-               backsql_info            *bi = (backsql_info*)op->o_bd->be_private;
                backsql_tree_delete_t   *btd;
                backsql_entryID         *eid;
 
@@ -335,8 +334,7 @@ backsql_tree_delete(
 {
        Operation               op2 = *op;
        slap_callback           sc = { 0 };
-       SlapReply               rs2 = { 0 };
-       Filter                  f = { 0 };
+       SlapReply               rs2 = { REP_RESULT };
        backsql_tree_delete_t   btd = { 0 };
 
        int                     rc;
@@ -368,10 +366,8 @@ backsql_tree_delete(
        op2.ors_deref = LDAP_DEREF_NEVER;
        op2.ors_slimit = SLAP_NO_LIMIT;
        op2.ors_tlimit = SLAP_NO_LIMIT;
-       op2.ors_filter = &f;
-       f.f_choice = LDAP_FILTER_PRESENT;
-       f.f_desc = slap_schema.si_ad_objectClass;
-       BER_BVSTR( &op2.ors_filterstr, "(objectClass=*)" );
+       op2.ors_filter = (Filter *)slap_filter_objectClass_pres;
+       op2.ors_filterstr = *slap_filterstr_objectClass_pres;
        op2.ors_attrs = slap_anlist_all_attributes;
        op2.ors_attrsonly = 0;
 
@@ -406,7 +402,6 @@ clean:;
 int
 backsql_delete( Operation *op, SlapReply *rs )
 {
-       backsql_info            *bi = (backsql_info*)op->o_bd->be_private;
        SQLHDBC                 dbh = SQL_NULL_HDBC;
        SQLHSTMT                sth = SQL_NULL_HSTMT;
        backsql_oc_map_rec      *oc = NULL;
@@ -499,10 +494,12 @@ backsql_delete( Operation *op, SlapReply *rs )
                break;
 
        case LDAP_COMPARE_TRUE:
+#ifdef SLAP_CONTROL_X_TREE_DELETE
                if ( get_treeDelete( op ) ) {
                        rs->sr_err = LDAP_SUCCESS;
                        break;
                }
+#endif /* SLAP_CONTROL_X_TREE_DELETE */
 
                Debug( LDAP_DEBUG_TRACE, "   backsql_delete(): "
                        "entry \"%s\" has children\n",
@@ -567,6 +564,7 @@ backsql_delete( Operation *op, SlapReply *rs )
        }
 
        e = &d;
+#ifdef SLAP_CONTROL_X_TREE_DELETE
        if ( get_treeDelete( op ) ) {
                backsql_tree_delete( op, rs, dbh, &sth );
                if ( rs->sr_err == LDAP_OTHER || rs->sr_err == LDAP_SUCCESS )
@@ -574,7 +572,9 @@ backsql_delete( Operation *op, SlapReply *rs )
                        e = NULL;
                }
 
-       } else {
+       } else
+#endif /* SLAP_CONTROL_X_TREE_DELETE */
+       {
                backsql_delete_int( op, rs, dbh, &sth, &e_id, &e );
        }