Returns a pointer to the first message type, LDAP_RES_SEARCH_ENTRY, LDAP_RES_SEARCH_RESULT, or LDAP_RES_SEARCH_REFERENCE in a result chain.
#include <ldap.h>
LDAPMessage *ldap_first_message (
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.
If ldap_first_message encounters an error, the function returns NULL and sets the LDAP_OPT_RESULT_CODE option in the LDAP session handle.
Use the ldap_count_messages function to determine the number of messages in the chain. Use the ldap_next_message function to retrieve subsequent messages.