mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-01 14:15:49 +08:00
Remove ai_syntaxinfo (syntax) from AttrInfo. Call attr_syntax() directly.
This commit is contained in:
parent
cca2bdcb40
commit
ce56fbcba8
@ -19,7 +19,6 @@
|
|||||||
typedef struct ldbm_attrinfo {
|
typedef struct ldbm_attrinfo {
|
||||||
char *ai_type; /* type name (cn, sn, ...) */
|
char *ai_type; /* type name (cn, sn, ...) */
|
||||||
int ai_indexmask; /* how the attr is indexed */
|
int ai_indexmask; /* how the attr is indexed */
|
||||||
int ai_syntaxmask; /* what kind of syntax */
|
|
||||||
} AttrInfo;
|
} AttrInfo;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -67,17 +66,14 @@ ainfo_dup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
attr_masks(
|
attr_mask(
|
||||||
struct ldbminfo *li,
|
struct ldbminfo *li,
|
||||||
char *type,
|
char *type,
|
||||||
int *indexmask,
|
int *indexmask )
|
||||||
int *syntaxmask
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
AttrInfo *a;
|
AttrInfo *a;
|
||||||
|
|
||||||
*indexmask = 0;
|
*indexmask = 0;
|
||||||
*syntaxmask = 0;
|
|
||||||
if ( (a = (AttrInfo *) avl_find( li->li_attrs, type,
|
if ( (a = (AttrInfo *) avl_find( li->li_attrs, type,
|
||||||
(AVL_CMP) ainfo_type_cmp )) == NULL ) {
|
(AVL_CMP) ainfo_type_cmp )) == NULL ) {
|
||||||
if ( (a = (AttrInfo *) avl_find( li->li_attrs, "default",
|
if ( (a = (AttrInfo *) avl_find( li->li_attrs, "default",
|
||||||
@ -86,14 +82,6 @@ attr_masks(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*indexmask = a->ai_indexmask;
|
*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
|
void
|
||||||
|
@ -123,7 +123,7 @@ index_read(
|
|||||||
DBCache *db;
|
DBCache *db;
|
||||||
Datum key;
|
Datum key;
|
||||||
ID_BLOCK *idl;
|
ID_BLOCK *idl;
|
||||||
int indexmask, syntax;
|
int indexmask;
|
||||||
char prefix;
|
char prefix;
|
||||||
char *realval, *tmpval;
|
char *realval, *tmpval;
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
@ -136,7 +136,7 @@ index_read(
|
|||||||
Debug( LDAP_DEBUG_TRACE, "=> index_read(\"%c%s\"->\"%s\")\n",
|
Debug( LDAP_DEBUG_TRACE, "=> index_read(\"%c%s\"->\"%s\")\n",
|
||||||
prefix, type, val );
|
prefix, type, val );
|
||||||
|
|
||||||
attr_masks( be->be_private, type, &indexmask, &syntax );
|
attr_mask( be->be_private, type, &indexmask );
|
||||||
if ( ! (indextype & indexmask) ) {
|
if ( ! (indextype & indexmask) ) {
|
||||||
idl = idl_allids( be );
|
idl = idl_allids( be );
|
||||||
Debug( LDAP_DEBUG_TRACE,
|
Debug( LDAP_DEBUG_TRACE,
|
||||||
@ -310,13 +310,14 @@ index_change_values(
|
|||||||
}
|
}
|
||||||
|
|
||||||
attr_normalize(type);
|
attr_normalize(type);
|
||||||
attr_masks( be->be_private, type, &indexmask, &syntax );
|
attr_mask( be->be_private, type, &indexmask );
|
||||||
|
|
||||||
if ( indexmask == 0 ) {
|
if ( indexmask == 0 ) {
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SLAPD_SCHEMA_COMPAT
|
#ifdef SLAPD_SCHEMA_COMPAT
|
||||||
|
syntax = attr_syntax( type );
|
||||||
at_cn = at_canonical_name( type );
|
at_cn = at_canonical_name( type );
|
||||||
#else
|
#else
|
||||||
at_cn = at_canonical_name( at_find( type ) );
|
at_cn = at_canonical_name( at_find( type ) );
|
||||||
@ -456,7 +457,6 @@ index_change_values(
|
|||||||
ldbm_cache_close( be, db );
|
ldbm_cache_close( be, db );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -33,8 +33,7 @@ Entry *deref_internal_r LDAP_P((
|
|||||||
* attr.c
|
* attr.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
|
void attr_mask LDAP_P(( struct ldbminfo *li, char *type, int *indexmask ));
|
||||||
int *syntaxmask ));
|
|
||||||
void attr_index_config LDAP_P(( struct ldbminfo *li,
|
void attr_index_config LDAP_P(( struct ldbminfo *li,
|
||||||
const char *fname, int lineno,
|
const char *fname, int lineno,
|
||||||
int argc, char **argv, int init ));
|
int argc, char **argv, int init ));
|
||||||
|
@ -205,8 +205,6 @@ int ldbm_tool_index_attr(
|
|||||||
|
|
||||||
assert( slapMode & SLAP_TOOL_MODE );
|
assert( slapMode & SLAP_TOOL_MODE );
|
||||||
|
|
||||||
attr_masks( be->be_private, type, &indexmask, &syntaxmask );
|
|
||||||
|
|
||||||
#ifdef SLAPD_SCHEMA_COMPAT
|
#ifdef SLAPD_SCHEMA_COMPAT
|
||||||
attr_normalize( type );
|
attr_normalize( type );
|
||||||
at_cn = at_canonical_name( type );
|
at_cn = at_canonical_name( type );
|
||||||
@ -235,6 +233,8 @@ int ldbm_tool_index_attr(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
attr_mask( be->be_private, at_cn, &indexmask );
|
||||||
|
|
||||||
if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_NEWDB ))
|
if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_NEWDB ))
|
||||||
== NULL )
|
== NULL )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user