Remove ai_syntaxinfo (syntax) from AttrInfo. Call attr_syntax() directly.

This commit is contained in:
Kurt Zeilenga 2000-01-28 21:10:34 +00:00
parent cca2bdcb40
commit ce56fbcba8
4 changed files with 9 additions and 22 deletions

View File

@ -19,7 +19,6 @@
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
@ -67,17 +66,14 @@ ainfo_dup(
}
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",
@ -86,14 +82,6 @@ attr_masks(
}
}
*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

View File

@ -123,7 +123,7 @@ index_read(
DBCache *db;
Datum key;
ID_BLOCK *idl;
int indexmask, syntax;
int indexmask;
char prefix;
char *realval, *tmpval;
char buf[BUFSIZ];
@ -136,7 +136,7 @@ index_read(
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,
@ -310,13 +310,14 @@ index_change_values(
}
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 ) );
@ -456,7 +457,6 @@ index_change_values(
ldbm_cache_close( be, db );
return( 0 );
}
static int

View File

@ -33,8 +33,7 @@ Entry *deref_internal_r LDAP_P((
* 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 ));

View File

@ -205,8 +205,6 @@ int ldbm_tool_index_attr(
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 );
@ -235,6 +233,8 @@ int ldbm_tool_index_attr(
}
#endif
attr_mask( be->be_private, at_cn, &indexmask );
if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_NEWDB ))
== NULL )
{