ldap_nmas_err2string

Converts the numeric NMAS error code into a character string.

LDAP Version:v2 or higher
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  char *ldap_nmas_err2string (
     int   err);
  

Parameters

err

(IN) Specifies the NMAS error code returned by LDAP function.

Return Values

>0

Pointer to a zero-terminated character string

Remarks

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);    }
  

See Also

ldap_bind_nmas_s, ldap_nmas_get_errcode