Returns a pointer to the first entry of message type, LDAP_RES_SEARCH_ENTRY, from a search result chain.
#include <ldap.h>
LDAPMessage *ldap_first_entry (
LDAP *ld,
LDAPMessage *res);
(IN) Points to the handle for the LDAP session.
(IN) Points to the result chain returned by the ldap_result function or a synchronous search function.
The ldap_first_entry function parses the results received from the ldap_result, the ldap_search_s, the ldap_search_ext_s, or the ldap_search_st functions.
If the ldap_first_entry function encounters an error, the function returns NULL and sets the LDAP_OPT_RESULT_CODE option in the LDAP session handle.
Use the ldap_get_dn, ldap_first_attribute, ldap_get_values functions to retrieve information about the entry.
Use the value returned by the ldap_first_entry function as the entry parameter for the ldap_next_entry function to retrieve the next entry.