]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/index.c
honor '!' (objectClass negation) when checking attribute presence in list
[openldap] / servers / slapd / index.c
index 8ec5a97997fa5e01ea28e23f0759c7c95a66c8a1..f1fc043967e02a4cb2013ac8d8610d891e2b121b 100644 (file)
@@ -1,39 +1,26 @@
 /* index.c - index utilities */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #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,14 +39,11 @@ int slap_str2index( const char *str, slap_mask_t *idx )
                strcasecmp( str, "sub" ) == 0 )
        {
                *idx = SLAP_INDEX_SUBSTR_DEFAULT;
-       } else if ( strcasecmp( str, "lang" ) == 0 ) {
-               *idx = SLAP_INDEX_LANG;
-       } else if ( strcasecmp( str, "autolang" ) == 0 ) {
-               *idx = SLAP_INDEX_AUTO_LANG;
-       } else if ( strcasecmp( str, "subtypes" ) == 0 ) {
-               *idx = SLAP_INDEX_SUBTYPES;
-       } else if ( strcasecmp( str, "autosubtypes" ) == 0 ) {
-               *idx = SLAP_INDEX_AUTO_SUBTYPES;
+       } 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 {
                return LDAP_OTHER;
        }