37.3. slapi_rdn_contains()

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.

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 one of the following values:

  • 1 if rdn contains an RDN that matches the type, value, and length.
  • 0 if no RDN matches the desired type/value.