/* index.c - index utilities */
/* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 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-2005 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 ) {
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;
}