ldap_result2error()--Retrieve LDAP Error Information




Syntax

#include <ldap.h>

int ldap_result2error(
		LDAP 		*ld,
                LDAPMessage 	*res,
                int 		freeit)



Threadsafe: Yes

The ldap_result2error() API takes res, a result as produced by ldap_result() or ldap_search_s(), and returns the corresponding error code. Possible error codes are listed below. If the freeit parameter is nonzero it indicates that the res parameter should be freed by a call to the ldap_msgfree() API after the error code has been extracted. The ld_errno field in ld is set and returned.

See ldap_error_condt() for possible values for the error codes and their description.

Authorities and Locks

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(),ldap_ssl_init(), or ldap_open().
res
(Input) Specifies the result, as produced by ldap_result() or ldap_search_s(), to be converted to the error code with which it is associated.
freeit
(Input) Specifies whether or not the result, res, should be freed as a result of calling ldap_result2error(). If non-zero, the result, res, will be freed by the call. If zero, res will not be freed by the call.

Return Value

LDAP error code

Error Conditions

ldap_result2error() will return LDAP error code. See LDAP Client API Error Conditions for possible LDAP error codes.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_result2error API.

Related Information

    ldap_get_errno() -- Retrieve Error Code set.
    ldap_perror() --  Print an LDAP error indication to standard error.
    ldap_err2string() -- Convert LDAP error indication to a string.


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]