Converts the result message into a numeric LDAP error code. This function has been deprecated. Use the ldap_parse_result function.
#include <ldap.h>
int ldap_result2error (
LDAP *ld,
LDAPMessage *res,
int freeit);
(IN) Points to the handle for the LDAP session.
(IN) Points to an LDAPMessage containing the results of an ldap_result or ldap_search_s operation.
(IN) Specifies whether the resources allocated by the res parameter are freed.
Zero indicates that the resources used by the res parameter are not freed automatically. When you are done with the res parameter, you need to call the ldap_msgfree function to free the memory.
Non-zero indicates that memory is freed after the function extracts the information
|
>0 |
LDAP error code. See |
The ldap_result2error function does the following:
Converts the result message into a numeric LDAP error code.
Parses the result message and puts the matched distinguished name in the LDAP_OPT_MATCHED_DN option of the LDAP session handle.
Parses the result message and puts the error code in the LDAP_OPT_ERROR_STRING option of the LDAP session handle.
All synchronous operation routines call the ldap_result2error function before returning, ensuring that the options are set correctly.