- if ( strcasecmp( str, "pres" ) == 0 ) {
- *idx = SLAP_INDEX_PRESENT;
- } else if ( strcasecmp( str, "eq" ) == 0 ) {
- *idx = SLAP_INDEX_EQUALITY;
- } else if ( strcasecmp( str, "approx" ) == 0 ) {
- *idx = SLAP_INDEX_APPROX;
- } else if ( strcasecmp( str, "subinitial" ) == 0 ) {
- *idx = SLAP_INDEX_SUBSTR_INITIAL;
- } else if ( strcasecmp( str, "subany" ) == 0 ) {
- *idx = SLAP_INDEX_SUBSTR_ANY;
- } else if ( strcasecmp( str, "subfinal" ) == 0 ) {
- *idx = SLAP_INDEX_SUBSTR_FINAL;
- } else if ( strcasecmp( str, "substr" ) == 0 ||
- strcasecmp( str, "sub" ) == 0 )
- {
- *idx = SLAP_INDEX_SUBSTR_DEFAULT;
- } else if ( strcasecmp( str, "nolang" ) == 0 ) {
- *idx = SLAP_INDEX_NOLANG;
- } else if ( strcasecmp( str, "nosubtypes" ) == 0 ) {
- *idx = SLAP_INDEX_NOSUBTYPES;
- } else {
- return LDAP_OTHER;
+ int i;
+
+ bv->bv_len = 0;
+
+ for ( i=0; !BER_BVISNULL( &idxstr[i].word ); i++ ) {
+ if ( !idxstr[i].mask ) continue;
+ if ( IS_SLAP_INDEX( idx, idxstr[i].mask )) {
+ if ( (idxstr[i].mask & SLAP_INDEX_SUBSTR) &&
+ ((idx & SLAP_INDEX_SUBSTR_DEFAULT) != idxstr[i].mask))
+ continue;
+ if ( bv->bv_len ) bv->bv_len++;
+ bv->bv_len += idxstr[i].word.bv_len;
+ }