]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/index.c
Berkeley DB 4.2 support (DB 4.2 required by default)
[openldap] / servers / slapd / index.c
index 786ccb388a1fa7b66420e58633ad7745253918b1..e989d236c31954bd09c7c70e695a0f2b9808443b 100644 (file)
@@ -1,39 +1,17 @@
 /* index.c - index utilities */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 #include "portable.h"
 
 #include <stdio.h>
+#include <ac/string.h>
 
 #include "slap.h"
 
-int
-slap_index2prefix( int indextype )
-{
-       int     prefix;
-
-       switch ( indextype ) {
-       case SLAP_INDEX_EQUALITY:
-               prefix = SLAP_INDEX_EQUALITY_PREFIX;
-               break;
-       case SLAP_INDEX_APPROX:
-               prefix = SLAP_INDEX_APPROX_PREFIX;
-               break;
-       case SLAP_INDEX_SUBSTR:
-               prefix = SLAP_INDEX_SUBSTR_PREFIX;
-               break;
-       default:
-               prefix = SLAP_INDEX_UNKNOWN_PREFIX;
-               break;
-       }
-
-       return( prefix );
-}
-
 int slap_str2index( const char *str, slap_mask_t *idx )
 {
        if ( strcasecmp( str, "pres" ) == 0 ) {
@@ -52,12 +30,11 @@ int slap_str2index( const char *str, slap_mask_t *idx )
                strcasecmp( str, "sub" ) == 0 )
        {
                *idx = SLAP_INDEX_SUBSTR_DEFAULT;
-       } else if ( strcasecmp( str, "nolang" ) == 0 ) {
-               *idx = SLAP_INDEX_NOLANG;
+       } else if ( strcasecmp( str, "nolang" ) == 0 || /* backwards compat */
+                   strcasecmp( str, "notags" ) == 0 ) {
+               *idx = SLAP_INDEX_NOTAGS;
        } else if ( strcasecmp( str, "nosubtypes" ) == 0 ) {
                *idx = SLAP_INDEX_NOSUBTYPES;
-       } else if ( strcasecmp( str, "autosubtypes" ) == 0 ) {
-               *idx = SLAP_INDEX_AUTO_SUBTYPES;
        } else {
                return LDAP_OTHER;
        }