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

slapi_rdn_contains_attr()

Checks whether a Slapi_RDN structure contains any RDN matching a given type, and if true, gets the corresponding attribute value.

Syntax

#include "slapi-plugin.h"
 int slapi_rdn_contains_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 with the desired type exists within rdn.

Returns

This function returns 1 if rdn contains a RDN that matches the given type, or 0 if there is no match.

Description

This function looks for an RDN inside the Slapi_RDN structure rdn that matches the type given in the parameters. This function makes a call to slapi_rdn_get_index_attr() and verifies that the returned value is anything but -1. If successful, it also returns the corresponding attribute value.

See Also

slapi_rdn_contains()

slapi_rdn_get_index_attr()