X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Findex.c;h=f1fc043967e02a4cb2013ac8d8610d891e2b121b;hb=e2483d8a9bc7fa72bac53d8af3ed215d3a1d80d0;hp=8ec5a97997fa5e01ea28e23f0759c7c95a66c8a1;hpb=02f888c563deab1e68d86261758d30b5371f8c94;p=openldap diff --git a/servers/slapd/index.c b/servers/slapd/index.c index 8ec5a97997..f1fc043967 100644 --- a/servers/slapd/index.c +++ b/servers/slapd/index.c @@ -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 . + * + * 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 + * . */ #include "portable.h" #include +#include #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; }