|
VMS Help LDAP, Search Results, Retrieving the Name of an Entry *Conan The Librarian |
The ldap_get_dn() function is used to retrieve the name of an
entry. The ldap_explode_dn() and ldap_explode_rdn() functions
are used to break up a name into its component parts. The ldap_
dn2ufn() function is used to convert the name into a more user-
friendly format.
char *ldap_get_dn( LDAP *ld, LDAPMessage *entry );
char **ldap_explode_dn( const char *dn, int notypes );
char **ldap_explode_rdn( const char *rdn, int notypes );
char *ldap_dn2ufn( const char *dn );
Parameters are as follows:
ld The session handle.
entry The entry whose name is to be retrieved, as returned by
ldap_first_entry() or ldap_next_entry().
dn The dn to explode, such as returned by ldap_get_dn().
rdn The rdn to explode, such as returned in the components
of the array returned by ldap_explode_dn().
notypes A boolean parameter, if non-zero indicating that the DN
or RDN components should have their type information
stripped off (i.e., "cn=Babs" would become "Babs").
The ldap_get_dn() function will return NULL if there is some
error parsing the dn, setting error parameters in the session
handle ld to indicate the error. It returns a pointer to newly
allocated space that the caller should free by calling ldap_
memfree() when it is no longer in use.
The ldap_explode_dn() function returns a NULL-terminated char
* array containing the RDN components of the DN supplied, with
or without types as indicated by the notypes parameter. The
components are returned in the order they appear in the dn. The
array returned should be freed when it is no longer in use by
calling ldap_value_free().
The ldap_explode_rdn() function returns a NULL-terminated char
* array containing the components of the RDN supplied, with
or without types as indicated by the notypes parameter. The
components are returned in the order they appear in the rdn.
The array returned should be freed when it is no longer in use by
calling ldap_value_free().
The ldap_dn2ufn() function converts the DN into the user friendly
format. The UFN returned is newly allocated space that should be
freed by a call to ldap_memfree() when no longer in use.
|
|