PQLR
Postquantum Crypto Library by QAPP
error_handler.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdlib.h>
4 
5 #include <pqlr/common/pqlr.h>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif //__cplusplus
10 
28 typedef void (*pqlr_error_handler_fnc)(int err_no, const char* msg, void* ctx);
29 
39 {
46 
52  void* ctx;
54 
55 
73  pqlr_t pqlr, pqlr_error_handler_callback_t* error_handler);
74 
75 
90  const pqlr_t pqlr, pqlr_error_handler_callback_t* error_handler);
91 
100  int err_no, const char* msg, void* ctx);
101 
106 #ifdef __cplusplus
107 } // extern "C"
108 #endif // __cplusplus
#define PQLR_API
Definition: api.h:22
PQLR_API void pqlr_get_error_handler(const pqlr_t pqlr, pqlr_error_handler_callback_t *error_handler)
Obtains custom error handler specified by pqlr_set_error_handler().
struct pqlr_error_handler_callback pqlr_error_handler_callback_t
Pqlr user's error handler callback interface.
PQLR_API void pqlr_set_error_handler(pqlr_t pqlr, pqlr_error_handler_callback_t *error_handler)
Allows to specify custom fatal error handler for pqlr instance. Please, note that any change in the g...
void(* pqlr_error_handler_fnc)(int err_no, const char *msg, void *ctx)
Type definition for error handling function. Place to free user defined resources before termination.
Definition: error_handler.h:28
PQLR_API void pqlr_default_error_handler(int err_no, const char *msg, void *ctx)
Default pqlr fatal error handler. Prints error string to stderr.
struct pqlr_st * pqlr_t
Pqlr instance handle. Pqlr represents basic library and it's algorithms configuration....
Definition: pqlr.h:26
Pqlr user's error handler callback interface.
Definition: error_handler.h:39
void * ctx
This is a context pointer to be passed to user's callback. User is able to store and access any state...
Definition: error_handler.h:52
pqlr_error_handler_fnc callback
Error handler function. You can pass pointer to custom fatal error handler function for correct resou...
Definition: error_handler.h:45