]> git.sur5r.net Git - openldap/commitdiff
remove #ifdef SLAP_FILTER_HASSUBORDINATES
authorPierangelo Masarati <ando@openldap.org>
Sun, 10 Nov 2002 19:48:36 +0000 (19:48 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 10 Nov 2002 19:48:36 +0000 (19:48 +0000)
servers/slapd/back-bdb/external.h
servers/slapd/back-bdb/init.c
servers/slapd/back-ldbm/external.h
servers/slapd/back-ldbm/init.c
servers/slapd/back-sql/other.c
servers/slapd/back-sql/search.c
servers/slapd/filter.c
servers/slapd/filterentry.c
servers/slapd/proto-slap.h
servers/slapd/slap.h

index 9e595ef9ff622a4342f8578969c19a2537092282..6ecb0e0b136435c37091f402548286b272748637 100644 (file)
@@ -33,9 +33,7 @@ extern BI_chk_referrals       bdb_referrals;
 
 extern BI_operational  bdb_operational;
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
 extern BI_has_subordinates bdb_hasSubordinates;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 /* tools.c */
 extern BI_tool_entry_open      bdb_tool_entry_open;
index aa956d2b1e31049f10393a310913e3af98829cef..e8646d38961472649194554179eb2e5e32d71e6e 100644 (file)
@@ -615,9 +615,7 @@ bdb_initialize(
 
        bi->bi_chk_referrals = bdb_referrals;
        bi->bi_operational = bdb_operational;
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
        bi->bi_has_subordinates = bdb_hasSubordinates;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
        bi->bi_entry_release_rw = bdb_entry_release;
 
        /*
index 93b40b1dd446b58d1b86fef699e56dabb107bd30..e68286dd85e525b8216d7d62e7b8252f95f9ecaa 100644 (file)
@@ -43,9 +43,7 @@ extern BI_acl_attribute       ldbm_back_attribute;
 
 extern BI_operational  ldbm_back_operational;
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
 extern BI_has_subordinates     ldbm_back_hasSubordinates;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 /* hooks for slap tools */
 extern BI_tool_entry_open      ldbm_tool_entry_open;
index 327b0b79a99b1612b29fcc178405d6d200c0de87..949abfa870cabb09823cf437235cdbeac0cfee3b 100644 (file)
@@ -71,9 +71,7 @@ ldbm_back_initialize(
        bi->bi_acl_attribute = ldbm_back_attribute;
        bi->bi_chk_referrals = ldbm_back_referrals;
        bi->bi_operational = ldbm_back_operational;
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
        bi->bi_has_subordinates = ldbm_back_hasSubordinates;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
        /*
         * hooks for slap tools
index b2638960f4c697c6b7f0ea3991e64db1183e92d4..f0d863e6055eed015f5fbf398bdedfa7e5063ace 100644 (file)
@@ -70,10 +70,7 @@ backsql_operational(
 
 
        if ( ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
-                       && attr_find( e->e_attrs, slap_schema.si_ad_hasSubordinates ) == NULL
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-                       ) {
+                       && attr_find( e->e_attrs, slap_schema.si_ad_hasSubordinates ) == NULL ) {
                
                rc = backsql_get_db_conn( be, conn, &dbh );
                if ( rc != LDAP_SUCCESS ) {
index 77428ea18c05543a73edd73efe337bebb2596e13..411468e6af8d76f962bc8bb7b7e6e2ad116cc52d 100644 (file)
@@ -386,7 +386,6 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                                &bsi->oc->oc->soc_cname, 
                                '\'' );
 
-#if defined(SLAP_X_FILTER_HASSUBORDINATES) || defined(SLAP_X_MRA_MATCH_DNATTRS)
        } else if ( ad == slap_schema.si_ad_hasSubordinates || ad == NULL ) {
                /*
                 * FIXME: this is not robust; e.g. a filter
@@ -416,7 +415,6 @@ backsql_process_filter( backsql_srch_info *bsi, Filter *f )
                        backsql_attrlist_add( bsi, NULL );
                }
                goto done;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES || SLAP_X_MRA_MATCH_DNATTRS */
                
        } else {
                at = backsql_ad2at( bsi->oc, ad );
@@ -1145,10 +1143,8 @@ backsql_search(
         */
        for ( eid = srch_info.id_list; eid != NULL; 
                        eid = backsql_free_entryID( eid, 1 ) ) {
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                Attribute       *hasSubordinate = NULL,
                                *a = NULL;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
                /* check for abandon */
                if ( op->o_abandon ) {
@@ -1186,7 +1182,6 @@ backsql_search(
                        continue;
                }
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                /*
                 * We use this flag since we need to parse the filter
                 * anyway; we should have used the frontend API function
@@ -1224,18 +1219,15 @@ backsql_search(
                                continue;
                        }
                }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
                if ( test_filter( be, conn, op, entry, filter ) 
                                == LDAP_COMPARE_TRUE ) {
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
                        if ( hasSubordinate && !( srch_info.bsi_flags & BSQL_SF_ALL_OPER ) 
                                        && !ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
                                a->a_next = NULL;
                                attr_free( hasSubordinate );
                                hasSubordinate = NULL;
                        }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 #if 0  /* noop is masked SLAP_CTRL_UPDATE */
                        if ( op->o_noop ) {
index 4582be62bb2d2acb3b97fae0e9e012395a03073e..7a4a207677b499ad29bbac15a208db4df8abefe0 100644 (file)
@@ -1531,92 +1531,3 @@ return_error:
        return( LDAP_SUCCESS );
 }
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
-static int filter_has_subordinates_list(
-       Filter          *filter );
-
-/*
- * FIXME: we could detect the need to filter
- * for hasSubordinates when parsing the filter ...
- */
-
-static int
-filter_has_subordinates_list(
-       Filter          *fl )
-{
-       Filter                  *f;
-
-       for ( f = fl; f != NULL; f = f->f_next ) {
-               int     rc;
-
-               rc = filter_has_subordinates( f );
-
-               if ( rc ) {
-                       return rc;
-               }
-       }
-
-       return 0;
-}
-
-int
-filter_has_subordinates(
-       Filter          *f )
-{
-       AttributeDescription    *ad = NULL;
-
-       switch ( f->f_choice ) {
-       case LDAP_FILTER_PRESENT:
-               ad = f->f_desc;
-               break;
-
-       case LDAP_FILTER_EQUALITY:
-       case LDAP_FILTER_APPROX:
-       case LDAP_FILTER_GE:
-       case LDAP_FILTER_LE:
-               ad = f->f_ava->aa_desc;
-               break;
-
-       case LDAP_FILTER_SUBSTRINGS:
-               ad = f->f_sub_desc;
-               break;
-
-       case LDAP_FILTER_EXT:
-               /* could be null; however here it is harmless */
-               ad = f->f_mra->ma_desc;
-               break;
-
-       case LDAP_FILTER_NOT:
-               return filter_has_subordinates( f->f_not );
-
-       case LDAP_FILTER_AND:
-               return filter_has_subordinates_list( f->f_and );
-
-       case LDAP_FILTER_OR:
-               return filter_has_subordinates_list( f->f_or );
-
-       case SLAPD_FILTER_COMPUTED:
-               /*
-                * something wrong?
-                */
-               return 0;
-
-       default:
-               /*
-                * this means a new type of filter has been implemented,
-                * which is not handled yet in this function; we should
-                * issue a developer's warning, e.g. an assertion
-                */
-               assert( 0 );
-               return -1;
-       }
-
-       if ( ad == slap_schema.si_ad_hasSubordinates ) {
-               return 1;
-       }
-
-       return 0;
-}
-
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
index eee672a9b958d47df2b025abe7d2ac51d48f4c8c..3cf1d88f2251d941b6769b23d5eb7a86a2634b4a 100644 (file)
@@ -460,7 +460,6 @@ test_ava_filter(
                }
        }
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
        if ( ava->aa_desc == slap_schema.si_ad_hasSubordinates 
                        && be && be->be_has_subordinates ) {
                int             hasSubordinates;
@@ -493,7 +492,6 @@ test_ava_filter(
 
                return LDAP_COMPARE_FALSE;
        }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
        return( LDAP_COMPARE_FALSE );
 }
@@ -517,7 +515,6 @@ test_presence_filter(
 
        a = attrs_find( e->e_attrs, desc );
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
        if ( a == NULL && desc == slap_schema.si_ad_hasSubordinates ) {
 
                /*
@@ -532,7 +529,6 @@ test_presence_filter(
 
                return LDAP_COMPARE_FALSE;
        }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
        return a != NULL ? LDAP_COMPARE_TRUE : LDAP_COMPARE_FALSE;
 }
index 441007c0bb0546f45d8573254a5013a3ccb2491e..bb574abeec1ebcb3c03a1183976102fa9498bfa9 100644 (file)
@@ -483,9 +483,7 @@ LDAP_SLAPD_F (int) get_vrFilter LDAP_P(( Connection *conn, BerElement *ber,
 LDAP_SLAPD_F (void) vrFilter_free LDAP_P(( ValuesReturnFilter *f ));
 LDAP_SLAPD_F (void) vrFilter2bv LDAP_P(( ValuesReturnFilter *f, struct berval *fstr ));
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
 LDAP_SLAPD_F (int) filter_has_subordinates LDAP_P(( Filter *filter ));
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 /*
  * filterentry.c
index 9fa03c3816d4b76337c0f438fbcbfe917f4b9b39..71213fbe8f6173690effa26de0ac97384dee600d 100644 (file)
@@ -1213,11 +1213,8 @@ struct slap_backend_db {
  * (in previous use there was a flaw with back-bdb and back-ldbm; now it 
  * is fixed).
  */
-#define SLAP_X_FILTER_HASSUBORDINATES
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
 #define                be_has_subordinates bd_info->bi_has_subordinates
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 #define                be_controls     bd_info->bi_controls
 
@@ -1418,11 +1415,9 @@ typedef int (BI_operational)  LDAP_P((Backend *bd,
                struct slap_conn *c, struct slap_op *o,
                Entry *e, AttributeName *attrs, int opattrs, Attribute **a ));
 
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
 typedef int (BI_has_subordinates) LDAP_P((Backend *bd,
                struct slap_conn *c, struct slap_op *o,
                Entry *e, int *has_subordinates ));
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
 typedef int (BI_connection_init) LDAP_P((BackendDB *bd,
                struct slap_conn *c));
@@ -1517,9 +1512,7 @@ struct slap_backend_info {
        BI_acl_attribute        *bi_acl_attribute;
 
        BI_operational  *bi_operational;
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
        BI_has_subordinates     *bi_has_subordinates;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
 
        BI_connection_init      *bi_connection_init;
        BI_connection_destroy   *bi_connection_destroy;