ldap_explode_rdn

Breaks a relative distinguished name into its components.

Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  char **ldap_explode_rdn (
     const char   *rdn,
     int           notypes);
  
  

Parameters

rdn

(IN) Points to the relative distinguished name of the entry.

notypes

(IN) Specifies whether the name should include type information:

  • If zero, type information is included, for example "cn=Kim".

  • If non-zero, type information is stripped, for example "cn=Kim" becomes "Kim".

Return Values

>0

Pointer to a character array of components

NULL

Failure

Remarks

The ldap_explode_rdn returns a NULL-terminated character array with or without types as indicated by the notypes parameter. The components are returned in the order they appear in the rdn.

For example, if the rdn is "ou=sales+cn=kim", tThe function returns the following array: { "ou=sales", "cn=kim", NULL}.

When the array is no longer in use, free the memory by calling the ldap_value_free function.

See Also

ldap_get_dn, ldap_explode_dn, ldap_dn2ufn