From fe1e8e71aa18b4ac6471292b2894b8859f42f7c8 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 12 Aug 2016 15:24:46 +0200 Subject: core: Make use of the "size-hint" in engine-gpg. * src/engine-gpg.c: Include data.h. (add_input_size_hint): New. (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign) (gpg_verify): Call new function, * tests/run-encrypt.c (status_cb): Print to stderr. (progress_cb): New.o (main): Add option --progress. Print full-status lines. Provide a size for the input data. Signed-off-by: Werner Koch --- doc/gpgme.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/gpgme.texi b/doc/gpgme.texi index 2bbed285..8b0ec528 100644 --- a/doc/gpgme.texi +++ b/doc/gpgme.texi @@ -2177,6 +2177,30 @@ The function @code{gpgme_data_set_encoding} changes the encoding of the data object with the handle @var{dh} to @var{enc}. @end deftypefun +@deftypefun {gpgme_error_t} gpgme_data_set_flag @ + (@w{gpgme_data_t @var{dh}}, @ + @w{const char *@var{name}}, @ + @w{const char *@var{value}}) + +Some minor properties of the data object can be controlled with flags +set by this function. The properties are identified by the following +values for @var{name}: + +@table @code +@item size-hint +The value is a decimal number with the length gpgme shall assume for +this data object. This is useful if the data is provided by callbacks +or via file descriptors but the applications knows the total size of +the data. If this is set the OpenPGP engine may use this to decide on +buffer allocation strategies and to provide a total value for its +progress information. + +@end table + +This function returns @code{0} on success. +@end deftypefun + + @node Data Buffer Convenience @subsection Data Buffer Convenience Functions @cindex data buffer, convenience -- cgit v1.2.3