typedef struct ldbm_attrinfo {
char *ai_type; /* type name (cn, sn, ...) */
int ai_indexmask; /* how the attr is indexed */
- int ai_syntaxmask; /* what kind of syntax */
} AttrInfo;
static int
}
void
-attr_masks(
+attr_mask(
struct ldbminfo *li,
char *type,
- int *indexmask,
- int *syntaxmask
-)
+ int *indexmask )
{
AttrInfo *a;
*indexmask = 0;
- *syntaxmask = 0;
if ( (a = (AttrInfo *) avl_find( li->li_attrs, type,
(AVL_CMP) ainfo_type_cmp )) == NULL ) {
if ( (a = (AttrInfo *) avl_find( li->li_attrs, "default",
}
}
*indexmask = a->ai_indexmask;
-
-#ifdef SLAPD_SCHEMA_COMPAT
- if ( strcasecmp( a->ai_type, "default" ) == 0 ) {
- *syntaxmask = attr_syntax( type );
- } else {
- *syntaxmask = a->ai_syntaxmask;
- }
-#endif
}
void
DBCache *db;
Datum key;
ID_BLOCK *idl;
- int indexmask, syntax;
+ int indexmask;
char prefix;
char *realval, *tmpval;
char buf[BUFSIZ];
Debug( LDAP_DEBUG_TRACE, "=> index_read(\"%c%s\"->\"%s\")\n",
prefix, type, val );
- attr_masks( be->be_private, type, &indexmask, &syntax );
+ attr_mask( be->be_private, type, &indexmask );
if ( ! (indextype & indexmask) ) {
idl = idl_allids( be );
Debug( LDAP_DEBUG_TRACE,
}
attr_normalize(type);
- attr_masks( be->be_private, type, &indexmask, &syntax );
+ attr_mask( be->be_private, type, &indexmask );
if ( indexmask == 0 ) {
return( 0 );
}
#ifdef SLAPD_SCHEMA_COMPAT
+ syntax = attr_syntax( type );
at_cn = at_canonical_name( type );
#else
at_cn = at_canonical_name( at_find( type ) );
ldbm_cache_close( be, db );
return( 0 );
-
}
static int
* attr.c
*/
-void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
- int *syntaxmask ));
+void attr_mask LDAP_P(( struct ldbminfo *li, char *type, int *indexmask ));
void attr_index_config LDAP_P(( struct ldbminfo *li,
const char *fname, int lineno,
int argc, char **argv, int init ));
assert( slapMode & SLAP_TOOL_MODE );
- attr_masks( be->be_private, type, &indexmask, &syntaxmask );
-
#ifdef SLAPD_SCHEMA_COMPAT
attr_normalize( type );
at_cn = at_canonical_name( type );
}
#endif
+ attr_mask( be->be_private, at_cn, &indexmask );
+
if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_NEWDB ))
== NULL )
{