Sun Directory Server Enterprise Edition 7.0 Developer's Guide

slapi_rdn_contains()

Checks whether a Slapi_RDN structure holds any RDN matching a given type/value pair.

Syntax

#include "slapi-plugin.h"
 int slapi_rdn_contains(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

The type (cn, o, ou , etc.) of the RDN searched.

value

The value of the RDN searched.

length

Gives the length of value that should be taken into account for the string operation when searching for the RDN.

Returns

This function returns 1 if rdn contains an RDN that matches the type, value and length, or 0 if no RDN matches the desired type/value.

Description

This function searches for an RDN inside of the Slapi_RDN structure rdn that matches both type and value as given in the parameters. This function makes a call to slapi_rdn_get_index() and verifies that the returned value is anything but -1.

See Also

slapi_rdn_contains_attr()

slapi_rdn_get_index()