Converts the numeric NMAS error code into a character string.
#include <ldap.h> char *ldap_nmas_err2string ( int err);
(IN) Specifies the NMAS error code returned by LDAP function.
The ldap_nmas_err2string function converts the NMAS error codes returned by the following function:
ldap_nmas_get_errcode
The NMAS error code is converted to a zero-terminated character string that describes the error.
The return value points to a string contained in the static data.
Ensure not to perform the following:
Call the ldap_nmas_err2string till you use or copy the return value.
Use the pointer to modify the original string.
Use the application program to clear the string.
If the API succeeds, errno is set to 0. Otherwise, the returned string will be in the local code page.
You can use the returned pointer directly in a printf statement as mentioned in the following example:
rc = ldap_bind_nmas_s(..);
err=ldap_nmas_get_errcode(...);
if (err != 0) {
char *s;
s= ldap_nmas_err2string(err);
printf("Search error: %s\n",s); }