From: Kurt Zeilenga Date: Fri, 28 Jan 2000 21:10:34 +0000 (+0000) Subject: Remove ai_syntaxinfo (syntax) from AttrInfo. Call attr_syntax() directly. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~3225 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ce56fbcba8c2c9549b716f4caf5b6f51c795a431;p=openldap Remove ai_syntaxinfo (syntax) from AttrInfo. Call attr_syntax() directly. --- diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index 107203f4bb..72f26d31dc 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -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 diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 055a2b407a..fb292c262e 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -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 diff --git a/servers/slapd/back-ldbm/proto-back-ldbm.h b/servers/slapd/back-ldbm/proto-back-ldbm.h index 85bfff8dfe..37f660f984 100644 --- a/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -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 )); diff --git a/servers/slapd/back-ldbm/tools.c b/servers/slapd/back-ldbm/tools.c index 4050197680..96207e310f 100644 --- a/servers/slapd/back-ldbm/tools.c +++ b/servers/slapd/back-ldbm/tools.c @@ -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 ) {