aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2012-09-25 13:38:26 +0000
committerWerner Koch <[email protected]>2012-09-25 13:38:26 +0000
commitc62b79a1d6e576d94e08cb81c2f5dbcb42ecf8cf (patch)
tree0c659d95d2a93943c65f86e2d8e626ad335081c8 /doc
parentRemove all trailing whitespace from source files (diff)
downloadgpgme-c62b79a1d6e576d94e08cb81c2f5dbcb42ecf8cf.tar.gz
gpgme-c62b79a1d6e576d94e08cb81c2f5dbcb42ecf8cf.zip
Add gpgme_set_global_flag to help debugging
* src/gpgme.c (gpgme_set_global_flag): New. * src/gpgme.h.in (gpgme_set_global_flag): New. * src/gpgme.def, src/libgpgme.vers: Add new public function. * src/debug.c (envvar_override): New.: (_gpgme_debug_set_debug_envvar): New. (debug_init): Take ENVVAR_OVERRIDE in account. -- On Android envvars can't be used, thus we need another way to enable GPGME debugging. The new function allows this and may be used in the future to implement similar things.
Diffstat (limited to '')
-rw-r--r--doc/gpgme.texi26
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 61cdb379..d074b429 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -14,7 +14,7 @@
@copying
Copyright @copyright{} 2002, 2003, 2004, 2005, 2006, 2007,
-2008, 2010 g10 Code GmbH.
+2008, 2010, 2012 g10 Code GmbH.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -616,6 +616,30 @@ does not return a detailed error code).
@end deftypefun
+@deftypefun {int} gpgme_set_global_flag @
+ (@w{const char *@var{name}}, @
+ @w{const char *@var{value}})
+
+On some systems it is not easy to set environment variables and thus
+hard to use @acronym{GPGME}'s internal trace facility for debugging.
+This function has been introduced as an alternative way to enable
+debugging. It is important to assure that only one thread accesses
+@acronym{GPGME} functions between a call to this function and after
+the return from the call to @code{gpgme_check_version}.
+
+To enable debugging, you need to call this function as early as
+possible --- even before @code{gpgme_check_version} --- with the
+string ``debug'' for @var{name} and @var{value} identical to the value
+used with the environment variable @code{GPGME_DEBUG}.
+
+This function returns @code{0} on success. In contrast to other
+functions the non-zero return value on failure does not convey any
+error code. For setting ``debug'' the only possible error cause is an
+out of memory condition; which would exhibit itself later anyway.
+Thus the return value may be ignored.
+@end deftypefun
+
+
After initializing @acronym{GPGME}, you should set the locale
information to the locale required for your output terminal. This
locale information is needed for example for the curses and Gtk