error-crypt.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*!
  2. \ingroup Error
  3. \brief This function stores the error string for a particular error code
  4. in the given buffer.
  5. \return none No returns.
  6. \param error error code for which to get the string
  7. \param buffer buffer in which to store the error string. Buffer should be
  8. at least WOLFSSL_MAX_ERROR_SZ (80 bytes) long
  9. _Example_
  10. \code
  11. char errorMsg[WOLFSSL_MAX_ERROR_SZ];
  12. int err = wc_some_function();
  13. if( err != 0) { // error occurred
  14. wc_ErrorString(err, errorMsg);
  15. }
  16. \endcode
  17. \sa wc_GetErrorString
  18. */
  19. void wc_ErrorString(int err, char* buff);
  20. /*!
  21. \ingroup Error
  22. \brief This function returns the error string for a particular error code.
  23. \return string Returns the error string for an error code as a
  24. string literal.
  25. \param error error code for which to get the string
  26. _Example_
  27. \code
  28. char * errorMsg;
  29. int err = wc_some_function();
  30. if( err != 0) { // error occurred
  31. errorMsg = wc_GetErrorString(err);
  32. }
  33. \endcode
  34. \sa wc_ErrorString
  35. */
  36. const char* wc_GetErrorString(int error);