Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_rdn_get_index()

Gets the index of the RDN that follows the RDN with a given type and value.

Syntax

#include "slapi-plugin.h"
 int slapi_rdn_get_index(Slapi_RDN *rdn, const char *type,
    const char *value, size_t length);

Parameters

This function takes the following parameters:

rdn

The Slapi_RDN structure containing the RDN value(s).

type

Type (cn, o, ou, etc.) of the RDN that is searched.

value

Value of the RDN searched.

length

Gives the length of value that should be taken into account for the string comparisons when searching for the RDN. A matching RDN value must not exceed the length specified.

Returns

This function returns the index of the RDN that follows the RDN matching the contents of the parameters type and value. If no RDN stored in rdn matches the given type/value pair, -1 is returned.

Description

This function searches for an RDN inside the Slapi_RDN structure rdn that matches both type and value as given in the parameters. If it succeeds, the position of the matching RDN is returned.

See Also

slapi_rdn_contains()

slapi_rdn_get_index_attr()