37.9. slapi_rdn_get_index_attr()

Description

This function searches for an RDN inside of the Slapi_RDN structure rdn that matches the type given in the parameters. If successful, the position of the matching RDN, as well as the corresponding attribute value, is returned.

Syntax

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

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 searched.
value
Repository that will hold the value of the first RDN whose type matches the content of the parameter type. If this parameter is NULL at the return of the function, no RDN exists within rdn.
Returns

This function returns one of the following values:

  • The real position of the first RDN within RDN that matches the content of type.
  • -1 if there is no RDN that matches the content type.