Returns the number of LDAPMessage structures of any type in an LDAP message chain.
#include <ldap.h>
int ldap_count_messages (
LDAP *ld,
LDAPMessage *res);
(IN) Points to the handle for the LDAP session.
(IN) Points to the result message chain returned by the ldap_result function or a synchronous search function.
The ldap_count_messages function can be used to count the number of message structures that remain in a chain. The following functions are used to iterate through the chain:
ldap_first_message
ldap_next_message
ldap_first_reference
ldap_next_reference
This function counts from the current position of the pointer to the end of the chain.
If you pass a pointer that points to the first message structure in the chain, it counts all the messages in the chain.
If you pass a pointer that points to a structure in the middle of the chain, it counts the messages from that point to the end of the chain.