desc.ad_flags |= SLAP_DESC_BINARY;
continue;
- } else if ( ad_find_option_definition( opt, optlen ) )
- {
+ } else if ( ad_find_option_definition( opt, optlen ) ) {
int i;
if( opt[optlen-1] == '-' ) {
}
d2 = ch_malloc(sizeof(AttributeDescription) + dlen);
+ d2->ad_next = NULL;
d2->ad_type = desc.ad_type;
d2->ad_flags = desc.ad_flags;
d2->ad_cname.bv_len = desc.ad_type->sat_cname.bv_len;
int
ad_define_option( const char *name, const char *fname, int lineno )
{
- int i, j, len, optlen;
+ int i;
+ unsigned int optlen;
if ( options == &lang_option ) {
options = NULL;
} while ( name[++optlen] );
options = ch_realloc( options,
- (option_count+1) * sizeof(Attr_option) );
+ (option_count+1) * sizeof(Attr_option) );
if ( strcasecmp( name, "binary" ) == 0
|| ad_find_option_definition( name, optlen ) ) {
}
return NULL;
}
+
+MatchingRule *ad_mr(
+ AttributeDescription *ad,
+ unsigned usage )
+{
+ switch( usage & SLAP_MR_TYPE_MASK ) {
+ case SLAP_MR_NONE:
+ case SLAP_MR_EQUALITY:
+ return ad->ad_type->sat_equality;
+ break;
+ case SLAP_MR_ORDERING:
+ return ad->ad_type->sat_ordering;
+ break;
+ case SLAP_MR_SUBSTR:
+ return ad->ad_type->sat_substr;
+ break;
+ case SLAP_MR_EXT:
+ default:
+ assert( 0 /* ad_mr: bad usage */);
+ }
+ return NULL;
+}