DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(gcrypt.info.gz) Progress handler

Info Catalog (gcrypt.info.gz) Handler Functions (gcrypt.info.gz) Allocation handler
 
 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.  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.
 
     CB_DATA
           The argument provided in the call to
           `gcry_set_progress_handler'.
 
     WHAT
           A string identifying the type of the progress output.  The
           following values for WHAT are defined:
 
          `need_entropy'
                Not enough entropy is available.  TOTAL holds the number
                of required bytes.
 
          `primegen'
                Values for PRINTCHAR:
               `\n'
                     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.
 
 
 
Info Catalog (gcrypt.info.gz) Handler Functions (gcrypt.info.gz) Allocation handler
automatically generated byinfo2html