ldap_next_attribute() function returns the name of the next attribute in a entry returned by ldap_first_entry() or ldap_next_entry().
The ldap_next_attribute() function also returns a pointer to a BerElement. This pointer is freed by ldap_next_attribute() when there are no more attributes (that is, when ldap_next_attribute() returns NULL). If you do not iterate through all of the attributes, you need to free the BerElement by calling ldap_ber_free(). When calling ldap_ber_free(), make sure to specify that the buffer is not freed (pass 0 for the freebuf parameter).
For more information, see "Getting Attributes from an Entry" on page 129.
#include <ldap.h>
char * ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
BerElement *ber);
ld |
Connection handle, which is a pointer to an |
entry |
Pointer to the |
ber |
A pointer to a |
ldap_memfree() function. LDAP structure. To get the error code, call the ldap_get_lderrno() function. (See "Result Codes" on page 691 for a complete listing of error codes.) ldap_first_attribute().
ldap_first_attribute(), ldap_getfirstfilter(), ldap_next_entry().
Last Updated: 10/01/98 17:06:23