Next: , Previous: , Up: Context Attributes   [Contents][Index]

7.4.11 Progress Meter Callback

Data type: void (*gpgme_progress_cb_t)(void *hook, const char *what, int type, int current, int total)

The gpgme_progress_cb_t type is the type of functions usable as progress callback function.

The arguments are specific to the crypto engine. More information about the progress information returned from the GnuPG engine can be found in the GnuPG source code in the file doc/DETAILS in the section PROGRESS.

Function: void gpgme_set_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t progfunc, void *hook_value)

The function gpgme_set_progress_cb sets the function that is used when progress information about a cryptographic operation is available. The function progfunc needs to implemented by the user, and whenever it is called, it is called with its first argument being hook_value. By default, no progress callback function is set.

Setting a callback function allows an interactive program to display progress information about a long operation to the user.

The user can disable the use of a progress callback function by calling gpgme_set_progress_cb with progfunc being NULL.

Function: void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *progfunc, void **hook_value)

The function gpgme_get_progress_cb returns the function that is used to inform the user about the progress made in *progfunc, and the first argument for this function in *hook_value. If no progress callback is set, or ctx is not a valid pointer, NULL is returned in both variables.

progfunc or hook_value can be NULL. In this case, the corresponding value will not be returned.

Next: Status Message Callback, Previous: Passphrase Callback, Up: Context Attributes   [Contents][Index]