diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 19:48:49 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 19:48:49 +0300 |
commit | e484372bf3f618eb30b8e6970fd13efa20c48509 (patch) | |
tree | 54a5f9cc4cc3eb8d787bf123a84630bda19db12f /include/aesni | |
parent | add utils/cxx (diff) | |
download | aes-tools-e484372bf3f618eb30b8e6970fd13efa20c48509.tar.gz aes-tools-e484372bf3f618eb30b8e6970fd13efa20c48509.zip |
add error message formatting functions
Diffstat (limited to 'include/aesni')
-rw-r--r-- | include/aesni/error.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/aesni/error.h b/include/aesni/error.h index 54d3d34..47bd0d6 100644 --- a/include/aesni/error.h +++ b/include/aesni/error.h @@ -8,6 +8,8 @@ #pragma once +#include <stdlib.h> + #ifdef __cplusplus extern "C" { @@ -41,6 +43,13 @@ typedef struct } AesNI_ErrorDetails; +static __inline AesNI_ErrorCode aesni_get_error_code(const AesNI_ErrorDetails* err_details) +{ + return err_details->ec; +} + +size_t aesni_format_error(const AesNI_ErrorDetails*, char*, size_t); + void aesni_make_error_success(AesNI_ErrorDetails*); void aesni_make_error_null_argument(AesNI_ErrorDetails*, const char* arg_name); void aesni_make_error_invalid_pkcs7_padding(AesNI_ErrorDetails*); |