/* mr.c - routines to manage matching rule definitions */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
(AVL_DUP) avl_dup_error ) ) {
*err = smr->smr_oid;
ldap_memfree(mir);
- return SLAP_SCHERR_DUP_RULE;
+ return SLAP_SCHERR_MR_DUP;
}
/* FIX: temporal consistency check */
mr_bvfind(&mir->mir_name);
(AVL_DUP) avl_dup_error ) ) {
*err = *names;
ldap_memfree(mir);
- return SLAP_SCHERR_DUP_RULE;
+ return SLAP_SCHERR_MR_DUP;
}
/* FIX: temporal consistency check */
mr_bvfind(&mir->mir_name);
int mr_schema_info( Entry *e )
{
- struct berval val;
- struct berval *vals[2];
+ struct berval vals[2];
MatchingRule *mr;
AttributeDescription *ad_matchingRules = slap_schema.si_ad_matchingRules;
- vals[0] = &val;
- vals[1] = NULL;
+ vals[1].bv_val = NULL;
for ( mr = mr_list; mr; mr = mr->smr_next ) {
+ if ( mr->smr_usage & SLAP_MR_HIDE ) {
+ /* skip hidden rules */
+ continue;
+ }
+
if ( ! mr->smr_match ) {
/* skip rules without matching functions */
continue;
}
- if ( ldap_matchingrule2bv( &mr->smr_mrule, &val ) == NULL ) {
+ if ( ldap_matchingrule2bv( &mr->smr_mrule, vals ) == NULL ) {
return -1;
}
#if 0
Debug( LDAP_DEBUG_TRACE, "Merging mr [%ld] %s\n",
- (long) val.bv_len, val.bv_val, 0 );
+ (long) vals[0].bv_len, vals[0].bv_val, 0 );
#endif
attr_merge( e, ad_matchingRules, vals );
- ldap_memfree( val.bv_val );
+ ldap_memfree( vals[0].bv_val );
}
return 0;
}
+int mru_schema_info( Entry *e )
+{
+ return 0;
+}
+
#endif