37.10. slapi_rdn_get_next()

Description

This function gets the type/value pair corresponding to the RDN stored in the next (index+1) position inside a Slapi_RDN structure. The index of an element within an array of values is always one unit below its real position in the array.

Syntax

#include "slapi-plugin.h"
int slapi_rdn_get_next(Slapi_RDN *rdn, int index, char **type, char **value);

Parameters

This function takes the following parameters:

rdn
The Slapi_RDN structure containing the RDN value(s).
index
Indicates the position of the RDN the precedes the currently desired RDN.
type
Repository that will hold the type (cn, o, ou, etc.) of the next (index+1) RDN. If this parameter is NULL at the return of the function, the RDN does not exist.
value
Repository that will hold the value of the next (index+1) RDN. If this parameter is NULL, the RDN does not exist.
Returns

This function returns one of the following values:

  • The real position of the retrieved RDN if the operation was successful.
  • -1 if there is no RDN in the index position.