From 61a0d92b679f248505f1bf16386bc41a5bf2ba1d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 7 Feb 2013 20:59:16 +0100 Subject: Add public function gpgme_set_pinentry_mode. * src/gpgme.c (gpgme_set_pinentry_mode): New. * src/gpgme.h.in (gpgme_pinentry_t): New. (gpgme_set_pinentry_mode): New. * src/context.h (struct gpgme_context): Add field pinentry_mode. * src/engine-backend.h (struct engine_ops): Add field set_pinentry_mode. * src/engine-gpg.c (struct engine_gpg): Add field pinentry_mode. (build_argv): Implement pinentry_mode. (gpg_set_pinentry_mode): New. (_gpgme_engine_ops_gpg): Register gpg_set_pinentry_mode. -- Note that this new fucntion may only be used with gpg 2.1. --- src/gpgme.h.in | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 27ef195b..4ec2367b 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -1,7 +1,7 @@ /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 - 2010, 2011, 2012 g10 Code GmbH + 2010, 2011, 2012, 2013 g10 Code GmbH This file is part of GPGME. @@ -353,6 +353,18 @@ gpgme_protocol_t; typedef unsigned int gpgme_keylist_mode_t; + +/* The pinentry modes. */ +typedef enum + { + GPGME_PINENTRY_MODE_DEFAULT = 0, + GPGME_PINENTRY_MODE_ASK = 1, + GPGME_PINENTRY_MODE_CANCEL = 2, + GPGME_PINENTRY_MODE_ERROR = 3, + GPGME_PINENTRY_MODE_LOOPBACK = 4 + } +gpgme_pinentry_mode_t; + /* The available export mode flags. */ #define GPGME_EXPORT_MODE_EXTERN 2 @@ -859,6 +871,10 @@ gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t ctx, /* Get keylist mode in CTX. */ gpgme_keylist_mode_t gpgme_get_keylist_mode (gpgme_ctx_t ctx); +/* Set the pinentry mode for CTX to MODE. */ +gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t ctx, + gpgme_pinentry_mode_t mode); + /* Set the passphrase callback function in CTX to CB. HOOK_VALUE is passed as first argument to the passphrase callback function. */ void gpgme_set_passphrase_cb (gpgme_ctx_t ctx, -- cgit v1.2.3