LDAPMessage structure representing the first directory entry in a chain of search results.
#include <ldap.h>
LDAPMessage * ldap_first_entry( LDAP *ld, LDAPMessage *result );
ld |
Connection handle, which is a pointer to an |
result |
Chain of search results, which are represented by a pointer to the |
LDAPMessage structure of the type LDAP_RES_SEARCH_ENTRY in the chain of search results. LDAPMessage structures of the type LDAP_RES_SEARCH_ENTRY are in the chain of the search results or if the function is unsuccessful, returns a NULLMSG. ldap_first_entry() function returns a pointer to the LDAPMessage structure representing the first directory entry in a chain of search results. Search result entries are in messages of the type LDAP_RES_SEARCH_ENTRY.
You can use this function in conjunction with the ldap_next_entry() function to iterate through the directory entries in a chain of search results. These functions skip over any messages in the chain that do not have the type LDAP_RES_SEARCH_ENTRY.
Do not free the LDAPMessage structure returned by this function. Because this is a structure within a chain of search results, freeing this structure will free part of the chain of search results. When you are done working with the search results, you can free the chain itself, rather than individual structures within the chain.
For more information, see "Iterating Through a Chain of Results" on page 124.
ldap_result(), ldap_search_ext(), ldap_search_ext_s(), ldap_next_entry().
Last Updated: 10/01/98 17:06:23