1 /* index.c - index utilities */
4 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
14 int slap_str2index( const char *str, slap_mask_t *idx )
16 if ( strcasecmp( str, "pres" ) == 0 ) {
17 *idx = SLAP_INDEX_PRESENT;
18 } else if ( strcasecmp( str, "eq" ) == 0 ) {
19 *idx = SLAP_INDEX_EQUALITY;
20 } else if ( strcasecmp( str, "approx" ) == 0 ) {
21 *idx = SLAP_INDEX_APPROX;
22 } else if ( strcasecmp( str, "subinitial" ) == 0 ) {
23 *idx = SLAP_INDEX_SUBSTR_INITIAL;
24 } else if ( strcasecmp( str, "subany" ) == 0 ) {
25 *idx = SLAP_INDEX_SUBSTR_ANY;
26 } else if ( strcasecmp( str, "subfinal" ) == 0 ) {
27 *idx = SLAP_INDEX_SUBSTR_FINAL;
28 } else if ( strcasecmp( str, "substr" ) == 0 ||
29 strcasecmp( str, "sub" ) == 0 )
31 *idx = SLAP_INDEX_SUBSTR_DEFAULT;
32 } else if ( strcasecmp( str, "nolang" ) == 0 ) {
33 *idx = SLAP_INDEX_NOLANG;
34 } else if ( strcasecmp( str, "nosubtypes" ) == 0 ) {
35 *idx = SLAP_INDEX_NOSUBTYPES;