manpagez: man pages & more
info gcrypt
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 Progress handler

It is often useful to retrieve some feedback while long running operations are performed.

Data type: gcry_handler_progress_t

Progress handler functions have to be of the type 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.

Function: void gcry_set_progress_handler (gcry_handler_progress_t cb, void *cb_data)

This function installs cb as the ‘Progress handler’ function. It may be used only during initialization. cb must be defined as follows:

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.


The argument provided in the call to gcry_set_progress_handler.


A string identifying the type of the progress output. The following values for what are defined:


Not enough entropy is available. total holds the number of required bytes.


Waiting to re-open a random device. total gives the number of seconds until the next try.


Values for printchar:


Prime generated.


Need to refresh the pool of prime numbers.

<, >

Number of bits adjusted.


Searching for a generator.


Fermat test on 10 candidates failed.


Restart with a new random value.


Rabin Miller test passed.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on February 9, 2014 using texi2html 5.0.

© 2000-2023
Individual documents may contain additional copyright information.