HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
37.1 slapi_rdn_add()
Description This function adds a new type/value pair to an existing RDN or sets the type/value
pair as the new RDN if rdn is empty. This function resets the FLAG_RDNS flags, which means
that the RDN array within the Slapi_RDN structure is no longer current with the new RDN.
Syntax
#include "slapi-plugin.h"
int slapi_rdn_add(Slapi_RDN *rdn, const char *type, const char *value);
Parameters This function takes the following parameters:
The target Slapi_RDN structure.rdn
The type (cn, o, ou, etc.) of the RDN to be added. This parameter cannot be NULL.type
The value of the RDN to be added. This parameter cannot be NULL.value
Returns This function always returns 1.
See also “slapi_rdn_get_num_components()”
37.2 slapi_rdn_compare()
Description This function compares rdn1 and rdn2. For rdn1 and rdn2 to be considered
equal RDNs, their components do not necessarily have to be in the same order.
Syntax
#include "slapi-plugin.h"
int slapi_rdn_compare(Slapi_RDN *rdn1, Slapi_RDN *rdn2);
Parameters This function takes the following parameters:
The first RDN to compare.
rdn1
The second RDN to compare.
rdn2
Returns This function returns one of the following values:
0 if rdn1 and rdn2 have the same RDN components.
-1 if they do not have the same components.
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:
The Slapi_RDN structure containing the RDN value(s).rdn
The type (cn, o, ou, etc.) of the RDN searched.type
The value of the RDN searched.
value
Gives the length of value that should be taken into account for the string operation
when searching for the RDN.
length
296 Functions for managing RDNs