ldap_count_references()
Purpose
Return the number of search references in an LDAP result
Format
#include <ldap.h>
int ldap_count_references(
LDAP * ld,
LDAPMessage * msg)
Parameters
Input
- ld
- Specifies the LDAP handle.
- msg
- Specifies the LDAP message.
Usage
The ldap_count_references() routine returns the number of search references in an LDAP result. The count includes the specified message and any messages chained to that message. This count is the total number of search references in the result if the message is the result message returned by ldap_result() or one of the synchronous search request routines. The count is the number of search references still to be processed if the message is returned by the ldap_first_message(), ldap_next_message(), ldap_first_entry(), ldap_next_entry(), ldap_first_reference() or ldap_next_reference() routine.
Function return value
The function return value is the number of search references or -1
if
an error is detected. When the return value is -1
,
the application can call the ldap_get_errno() routine
to get the error code.
LDAP_PARAM_ERROR
- A parameter is not valid.