37.8. slapi_rdn_get_index()

Description

This function gets the index of the RDN that follows the RDN with a given type and value. The 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.

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.
Returns

This function returns one of the following values:

  • The index of the RDN that follows the RDN matching the contents of the parameters type and value.
  • -1 if no RDN stored in rdn matches the given type/value pair.