manpagez: man pages & more
info gcrypt
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.4 Error Strings

Function: const char * gcry_strerror (gcry_error_t err)

The function gcry_strerror returns a pointer to a statically allocated string containing a description of the error code contained in the error value err. This string can be used to output a diagnostic message to the user.

Function: const char * gcry_strsource (gcry_error_t err)

The function gcry_strsource returns a pointer to a statically allocated string containing a description of the error source contained in the error value err. This string can be used to output a diagnostic message to the user.

The following example illustrates the use of the functions described above:

{
  gcry_cipher_hd_t handle;
  gcry_error_t err = 0;

  err = gcry_cipher_open (&handle, GCRY_CIPHER_AES,
                          GCRY_CIPHER_MODE_CBC, 0);
  if (err)
    {
      fprintf (stderr, "Failure: %s/%s\n",
               gcry_strsource (err),
               gcry_strerror (err));
    }
}

This document was generated on February 9, 2014 using texi2html 5.0.

© manpagez.com 2000-2018
Individual documents may contain additional copyright information.