#define telephoneNumberSubstringsIndexer caseIgnoreIA5SubstringsIndexer
#define telephoneNumberSubstringsFilter caseIgnoreIA5SubstringsFilter
-static MatchingRule *caseExactMatchingRule;
-static MatchingRule *caseExactSubstringsMatchingRule;
-static MatchingRule *integerFirstComponentMatchingRule;
-
-static const struct MatchingRulePtr {
- const char *oid;
- MatchingRule **mr;
-} mr_ptr [] = {
- /* must match OIDs below */
- { "2.5.13.5", &caseExactMatchingRule },
- { "2.5.13.7", &caseExactSubstringsMatchingRule },
- { "2.5.13.29", &integerFirstComponentMatchingRule }
-};
-
-
static char *bvcasechr( struct berval *bv, unsigned char c, ber_len_t *len )
{
ber_len_t i;
char *nav = NULL;
unsigned casefold;
- casefold = ( mr != caseExactSubstringsMatchingRule )
+ casefold = ( mr != slap_schema.si_mr_caseExactSubstringsMatch )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
if ( UTF8bvnormalize( value, &left, casefold ) == NULL ) {
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
- casefold = ( mr != caseExactMatchingRule )
+ casefold = ( mr != slap_schema.si_mr_caseExactMatch )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
for( i=0; values[i].bv_val != NULL; i++ ) {
slen = syntax->ssyn_oidlen;
mlen = mr->smr_oidlen;
- casefold = ( mr != caseExactMatchingRule )
+ casefold = ( mr != slap_schema.si_mr_caseExactMatch )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
UTF8bvnormalize( (struct berval *) assertedValue, &value, casefold );
/* we should have at least one value at this point */
assert( i > 0 );
- casefold = ( mr != caseExactSubstringsMatchingRule )
+ casefold = ( mr != slap_schema.si_mr_caseExactSubstringsMatch )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
tvalues = ch_malloc( sizeof( struct berval ) * (i+1) );
struct berval *value;
struct berval digest;
- casefold = ( mr != caseExactSubstringsMatchingRule )
+ casefold = ( mr != slap_schema.si_mr_caseExactSubstringsMatch )
? LDAP_UTF8_CASEFOLD : LDAP_UTF8_NOCASEFOLD;
sa = UTF8SubstringsassertionNormalize( assertedValue, casefold );
/* Skip leading space/sign/zeroes, and get the sign of the *value number */
v = value->bv_val;
vlen = value->bv_len;
- if( mr == integerFirstComponentMatchingRule ) {
+ if( mr == slap_schema.si_mr_integerFirstComponentMatch ) {
char *tmp = memchr( v, '$', vlen );
if( tmp )
vlen = tmp - v;
mrule_defs[i].mrd_compat_syntaxes == NULL )
{
fprintf( stderr,
- "slap_schema_init: Ingoring unusable matching rule %s\n",
+ "slap_schema_init: Ignoring unusable matching rule %s\n",
mrule_defs[i].mrd_desc );
continue;
}
}
}
- for ( i=0; i < (int)(sizeof(mr_ptr)/sizeof(mr_ptr[0])); i++ )
- *mr_ptr[i].mr = mr_find( mr_ptr[i].oid );
-
res = slap_schema_load();
schema_init_done = 1;
return res;
oidm_destroy();
oc_destroy();
at_destroy();
- for ( i=0; i < (int)(sizeof(mr_ptr)/sizeof(mr_ptr[0])); i++ )
- *mr_ptr[i].mr = NULL;
mr_destroy();
mru_destroy();
syn_destroy();
char *ssmm_name;
size_t ssmm_offset;
} mr_map[] = {
+ { "caseExactMatch",
+ offsetof(struct slap_internal_schema, si_mr_caseExactMatch) },
+ { "caseExactSubstringsMatch",
+ offsetof(struct slap_internal_schema, si_mr_caseExactSubstringsMatch) },
{ "distinguishedNameMatch",
offsetof(struct slap_internal_schema, si_mr_distinguishedNameMatch) },
{ "integerMatch",
offsetof(struct slap_internal_schema, si_mr_integerMatch) },
+ { "integerFirstComponentMatch",
+ offsetof(struct slap_internal_schema,
+ si_mr_integerFirstComponentMatch) },
{ NULL, 0 }
};