Sun Java System Directory Server Enterprise Edition 6.2 Developer's Guide

slapi_rdn_get_index_attr()

Gets the position and the attribute value of the first RDN in a Slapi_RDN structure that matches a given type.

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 -1 if there is no RDN that matches the content type, or the real position of the first RDN within RDN that matches the content of type.

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.

See Also

slapi_rdn_get_index()