ldap_next_attribute()--Retrieve Next Attribute in an Entry

  Syntax

 #include <ldap.h>
 
 char *ldap_next_attribute(
                 LDAP             *ld,
                 LDAPMessage      *entry,  
                 BerElement       *berptr)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_next_attribute() function returns the next attribute in an entry.

The ldap_next_attribute() function takes an entry returned by ldap_first_entry() or ldap_next_entry() and returns a pointer to a buffer containing the next attribute type in the entry. This string must be freed when its use is completed using ldap_memfree().

The ldap_first_attribute() and ldap_next_attribute() functions are used to step through the attributes in an LDAP entry.


Authorities and Locks

No IBM® i authority is required.


Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
entry
(Input) The attribute information as returned by ldap_first_entry() or ldap_next_entry().
berptr
(Input/Output) This parameter specifies a pointer to a BerElement that was allocated by ldap_first_attribute() to keep track of the current position. The BerElement structure is opaque to the application. The caller should free berptr using ldap_ber_free() when finished.

Return Value

Pointer to a buffer containing the next attribute type in the entry
if the request was successful.
NULL
When there are no attributes left to be retrieved.

Error Conditions

If ldap_next_attribute() is not successful, NULL is returned, and ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() function to retrieve the error information. It is left to the user to free outstanding BerElements using ldap_ber_free().


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_next_attribute API.


Related Information



API introduced: V4R3

[ Back to top | LDAP APIs | APIs by category ]