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
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.
#define PQLR_API
Definition: api.h:22
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...
struct pqlr_st * pqlr_t
Pqlr instance handle. Pqlr represents basic library and it&#39;s algorithms configuration. There are singleton instance which could be obtained by pqlr_singleton_instance and local instances which could be obtained from concrete algorithms instances. At the initialization point all the algorithms inherit pqlr&#39;s singleton instance state. Any change in the global configuration does not affect previously created algorithms.
Definition: pqlr.h:26
void * ctx
This is a context pointer to be passed to user&#39;s callback. User is able to store and access any state...
Definition: error_handler.h:52
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().
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
struct pqlr_error_handler_callback pqlr_error_handler_callback_t
Pqlr user&#39;s error handler callback interface.
Pqlr user&#39;s error handler callback interface.
Definition: error_handler.h:38
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