From 6270bd9e82b9172fde4cb02b738a329ac7194784 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 21 Aug 2007 21:42:09 +0000 Subject: [PATCH] cleanup experimental controls: rename macros, ifdef code --- servers/slapd/back-sql/delete.c | 7 ++++++- servers/slapd/controls.c | 6 +++--- servers/slapd/slap.h | 10 +++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/servers/slapd/back-sql/delete.c b/servers/slapd/back-sql/delete.c index ac0f9f62a7..c04acb0a8d 100644 --- a/servers/slapd/back-sql/delete.c +++ b/servers/slapd/back-sql/delete.c @@ -499,10 +499,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 +569,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 +577,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 ); } diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 7e98665d3f..c89708dbf2 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -35,7 +35,7 @@ static SLAP_CTRL_PARSE_FN parsePreRead, parsePostRead; static SLAP_CTRL_PARSE_FN parseProxyAuthz; static SLAP_CTRL_PARSE_FN parseRelax; static SLAP_CTRL_PARSE_FN parseSearchOptions; -#ifdef SLAP_SORTEDRESULTS +#ifdef SLAP_CONTROL_X_SORTEDRESULTS static SLAP_CTRL_PARSE_FN parseSortedResults; #endif static SLAP_CTRL_PARSE_FN parseSubentries; @@ -130,7 +130,7 @@ static struct slap_control control_defs[] = { SLAP_CTRL_SEARCH, NULL, NULL, parsePagedResults, LDAP_SLIST_ENTRY_INITIALIZER(next) }, -#ifdef SLAP_SORTEDRESULTS +#ifdef SLAP_CONTROL_X_SORTEDRESULTS { LDAP_CONTROL_SORTREQUEST, (int)offsetof(struct slap_control_ids, sc_sortedResults), SLAP_CTRL_GLOBAL|SLAP_CTRL_SEARCH|SLAP_CTRL_HIDE, @@ -1109,7 +1109,7 @@ done:; return rc; } -#ifdef SLAP_SORTEDRESULTS +#ifdef SLAP_CONTROL_X_SORTEDRESULTS static int parseSortedResults ( Operation *op, SlapReply *rs, diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index e71d8423fe..4c001956eb 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -64,7 +64,7 @@ LDAP_BEGIN_DECL #define LDAP_COLLECTIVE_ATTRIBUTES #define LDAP_COMP_MATCH #define LDAP_SYNC_TIMESTAMP -#define SLAP_SORTEDRESULTS +#define SLAP_CONTROL_X_SORTEDRESULTS #endif #define LDAP_DYNAMIC_OBJECTS @@ -2347,11 +2347,13 @@ struct slap_control_ids { int sc_proxyAuthz; int sc_relax; int sc_searchOptions; -#ifdef SLAP_SORTEDRESULTS +#ifdef SLAP_CONTROL_X_SORTEDRESULTS int sc_sortedResults; #endif int sc_subentries; +#ifdef SLAP_CONTROL_X_TREE_DELETE int sc_treeDelete; +#endif #ifdef LDAP_X_TXN int sc_txnSpec; #endif @@ -2546,8 +2548,10 @@ struct Operation { #define o_domain_scope o_ctrlflag[slap_cids.sc_domainScope] #define get_domainScope(op) ((int)(op)->o_domain_scope) +#ifdef SLAP_CONTROL_X_TREE_DELETE #define o_tree_delete o_ctrlflag[slap_cids.sc_treeDelete] #define get_treeDelete(op) ((int)(op)->o_tree_delete) +#endif #define o_preread o_ctrlflag[slap_cids.sc_preRead] #define o_postread o_ctrlflag[slap_cids.sc_postRead] @@ -2559,7 +2563,7 @@ struct Operation { #define o_pagedresults_state o_controls[slap_cids.sc_pagedResults] #define get_pagedresults(op) ((int)(op)->o_pagedresults) -#ifdef SLAP_SORTEDRESULTS +#ifdef SLAP_CONTROL_X_SORTEDRESULTS #define o_sortedresults o_ctrlflag[slap_cids.sc_sortedResults] #endif