ldap_first_entry()--Retrieve First LDAP Entry


  Syntax
 #include <ldap.h>

 LDAPMessage *ldap_first_entry(
                 LDAP          *ld,
                 LDAPMessage   *result)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_first_entry() function takes the result from a call to ldap_result(), ldap_search_s(), or ldap_search_st() and returns a pointer to the first entry in the result.

The ldap_first_entry(), ldap_next_entry(), and ldap_count_entries() functions are used to parse results received from ldap_result() or the synchronous LDAP search functions ldap_search_s() and ldap_search_st().


Authorities and Locks

No IBM® i authority is required.


Parameters

ld
(Input) The LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().

result
(Input) The result returned by a call to ldap_result() or one of the synchronous search routines (ldap_search_s() or ldap_search_st()).

Return Value

Pointer to the next entry in the result
if the request was successful.

NULL
if the request was not successful.

Error Conditions

If ldap_first_entry() is not successful, NULL is returned, 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.


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_first_entry API.


Related Information



API introduced: V4R3

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