| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Libgcrypt makes it possible to install so called `handler functions', which get called by Libgcrypt in case of certain events.
| 4.1 Progress handler | Using a progress handler function. | |
| 4.2 Allocation handler | Using special memory allocation functions. | |
| 4.3 Error handler | Using error handler functions. | |
| 4.4 Logging handler | Using a special logging function. |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is often useful to retrieve some feedback while long running operations are performed.
gcry_handler_progress_t, which is defined as:
void (*gcry_handler_progress_t) (void *, const char *, int, int, int)
The following function may be used to register a handler function for this purpose.
This function installs cb as the `Progress handler' function. cb must be defined as follows:
void
my_progress_handler (void *cb_data, const char *what,
int printchar, int current, int total)
{
/* Do something. */
}
|
A description of the arguments of the progress handler function follows.
gcry_set_progress_handler.
need_entropy
primegen
\n
!
<, >
^
.
:
+
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
It is possible to make Libgcrypt use special memory allocation functions instead of the built-in ones.
Memory allocation functions are of the following types:
void *(*gcry_handler_alloc_t) (size_t n).
int *(*gcry_handler_secure_check_t) (const void *).
void *(*gcry_handler_realloc_t) (void *p, size_t n).
void *(*gcry_handler_free_t) (void *).
Special memory allocation functions can be installed with the following function:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following functions may be used to register handler functions that are called by Libgcrypt in case certain error conditions occur.
void (*gcry_handler_no_mem_t) (void *, size_t, unsigned int)
void (*gcry_handler_error_t) (void *, int, const char *)
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void (*gcry_handler_log_t) (void *, int, const char *, va_list)
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |