gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML.
[gpgme.git] / src / gpgme.h.in
index 65823a66b2ff817ab840ad86db3073c1d37d34d7..ce469dee0a92b3d7f387930eecda9b0886abb2f2 100644 (file)
@@ -1,22 +1,23 @@
 /* gpgme.h - Public interface to GnuPG Made Easy.                   -*- c -*-
    Copyright (C) 2000 Werner Koch (dd9jn)
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009
+                 2010, 2011, 2012 g10 Code GmbH
 
    This file is part of GPGME.
+
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, see <http://www.gnu.org/licenses/>.
+
    File: @configure_input@  */
 
 #ifndef GPGME_H
 /* Include stdio.h for the FILE type definition.  */
 #include <stdio.h>
 
-#ifdef _MSC_VER
-  typedef long off_t;
-  typedef long ssize_t;
-#else
-# include <sys/types.h>
-#endif
+@INSERT__TYPEDEFS_FOR_GPGME_H@
+
+#include <time.h>
 
 #include <gpg-error.h>
 
@@ -66,6 +64,14 @@ extern "C" {
 #define _GPGME_DEPRECATED
 #endif
 
+/* The macro _GPGME_DEPRECATED_OUTSIDE_GPGME suppresses warnings for
+   fields we must access in GPGME for ABI compatibility.  */
+#ifdef _GPGME_IN_GPGME
+#define _GPGME_DEPRECATED_OUTSIDE_GPGME
+#else
+#define _GPGME_DEPRECATED_OUTSIDE_GPGME _GPGME_DEPRECATED
+#endif
+
 \f
 /* The version of this header should match the one of the library.  Do
    not use this symbol in your application, use gpgme_check_version
@@ -74,6 +80,17 @@ extern "C" {
    library.  */
 #define GPGME_VERSION "@PACKAGE_VERSION@"
 
+/* Check for a matching _FILE_OFFSET_BITS definition.  */
+#if @NEED__FILE_OFFSET_BITS@
+#ifndef _FILE_OFFSET_BITS
+#error GPGME was compiled with _FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual.
+#else
+#if (_FILE_OFFSET_BITS) != (@NEED__FILE_OFFSET_BITS@)
+#error GPGME was compiled with a different value for _FILE_OFFSET_BITS, namely @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual.
+#endif
+#endif
+#endif
+
 
 \f
 /* Some opaque data types used by GPGME.  */
@@ -142,30 +159,41 @@ const char *gpgme_strerror (gpgme_error_t err);
    beginning of the error string as fits into the buffer.  */
 int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen);
 
-
 /* Return a pointer to a string containing a description of the error
    source in the error value ERR.  */
 const char *gpgme_strsource (gpgme_error_t err);
 
-
 /* Retrieve the error code for the system error ERR.  This returns
    GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
    this).  */
 gpgme_err_code_t gpgme_err_code_from_errno (int err);
 
-
 /* Retrieve the system error for the error code CODE.  This returns 0
    if CODE is not a system error code.  */
 int gpgme_err_code_to_errno (gpgme_err_code_t code);
 
-  
+/* Retrieve the error code directly from the ERRNO variable.  This
+   returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+   (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpgme_err_code_t gpgme_err_code_from_syserror (void);
+
+/* Set the ERRNO variable.  This function is the preferred way to set
+   ERRNO due to peculiarities on WindowsCE.  */
+void gpgme_err_set_errno (int err);
+
 /* Return an error value with the error source SOURCE and the system
-   error ERR.  */
+   error ERR.  FIXME: Should be inline.  */
 gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err);
 
+/* Return an error value with the system error ERR.  FIXME: Should be inline.  */
+gpgme_error_t gpgme_error_from_errno (int err);
 
-/* Return an error value with the system error ERR.  */
-gpgme_err_code_t gpgme_error_from_errno (int err);
+
+static _GPGME_INLINE gpgme_error_t
+gpgme_error_from_syserror (void)
+{
+  return gpgme_error (gpgme_err_code_from_syserror ());
+}
 
 \f
 /* The possible encoding mode of gpgme_data_t objects.  */
@@ -174,7 +202,10 @@ typedef enum
     GPGME_DATA_ENCODING_NONE   = 0,    /* Not specified.  */
     GPGME_DATA_ENCODING_BINARY = 1,
     GPGME_DATA_ENCODING_BASE64 = 2,
-    GPGME_DATA_ENCODING_ARMOR  = 3     /* Either PEM or OpenPGP Armor.  */
+    GPGME_DATA_ENCODING_ARMOR  = 3,    /* Either PEM or OpenPGP Armor.  */
+    GPGME_DATA_ENCODING_URL    = 4,     /* LF delimited URL list.        */
+    GPGME_DATA_ENCODING_URLESC = 5,     /* Ditto, but percent escaped.   */
+    GPGME_DATA_ENCODING_URL0   = 6      /* Nul delimited URL list.       */
   }
 gpgme_data_encoding_t;
 
@@ -187,7 +218,9 @@ typedef enum
     GPGME_PK_RSA_S = 3,
     GPGME_PK_ELG_E = 16,
     GPGME_PK_DSA   = 17,
-    GPGME_PK_ELG   = 20
+    GPGME_PK_ELG   = 20,
+    GPGME_PK_ECDSA = 301,
+    GPGME_PK_ECDH  = 302
   }
 gpgme_pubkey_algo_t;
 
@@ -195,7 +228,7 @@ gpgme_pubkey_algo_t;
 /* Hash algorithms from libgcrypt.  */
 typedef enum
   {
-    GPGME_MD_NONE          = 0,  
+    GPGME_MD_NONE          = 0,
     GPGME_MD_MD5           = 1,
     GPGME_MD_SHA1          = 2,
     GPGME_MD_RMD160        = 3,
@@ -302,6 +335,9 @@ typedef enum
     GPGME_PROTOCOL_CMS     = 1,
     GPGME_PROTOCOL_GPGCONF = 2,  /* Special code for gpgconf.  */
     GPGME_PROTOCOL_ASSUAN  = 3,  /* Low-level access to an Assuan server.  */
+    GPGME_PROTOCOL_G13     = 4,
+    GPGME_PROTOCOL_UISERVER= 5,
+    GPGME_PROTOCOL_DEFAULT = 254,
     GPGME_PROTOCOL_UNKNOWN = 255
   }
 gpgme_protocol_t;
@@ -317,9 +353,16 @@ gpgme_protocol_t;
 
 typedef unsigned int gpgme_keylist_mode_t;
 
+\f
+/* The available export mode flags.  */
+#define GPGME_EXPORT_MODE_EXTERN                2
+#define GPGME_EXPORT_MODE_MINIMAL               4
+
+typedef unsigned int gpgme_export_mode_t;
+
 \f
 /* Flags for the audit log functions.  */
-#define GPGME_AUDITLOG_HTML      1 
+#define GPGME_AUDITLOG_HTML      1
 #define GPGME_AUDITLOG_WITH_HELP 128
 
 \f
@@ -366,98 +409,101 @@ typedef struct _gpgme_sig_notation *gpgme_sig_notation_t;
 /* The possible stati for the edit operation.  */
 typedef enum
   {
-    GPGME_STATUS_EOF,
+    GPGME_STATUS_EOF = 0,
     /* mkstatus processing starts here */
-    GPGME_STATUS_ENTER,
-    GPGME_STATUS_LEAVE,
-    GPGME_STATUS_ABORT,
-
-    GPGME_STATUS_GOODSIG,
-    GPGME_STATUS_BADSIG,
-    GPGME_STATUS_ERRSIG,
-
-    GPGME_STATUS_BADARMOR,
-
-    GPGME_STATUS_RSA_OR_IDEA,
-    GPGME_STATUS_KEYEXPIRED,
-    GPGME_STATUS_KEYREVOKED,
-
-    GPGME_STATUS_TRUST_UNDEFINED,
-    GPGME_STATUS_TRUST_NEVER,
-    GPGME_STATUS_TRUST_MARGINAL,
-    GPGME_STATUS_TRUST_FULLY,
-    GPGME_STATUS_TRUST_ULTIMATE,
-
-    GPGME_STATUS_SHM_INFO,
-    GPGME_STATUS_SHM_GET,
-    GPGME_STATUS_SHM_GET_BOOL,
-    GPGME_STATUS_SHM_GET_HIDDEN,
-
-    GPGME_STATUS_NEED_PASSPHRASE,
-    GPGME_STATUS_VALIDSIG,
-    GPGME_STATUS_SIG_ID,
-    GPGME_STATUS_ENC_TO,
-    GPGME_STATUS_NODATA,
-    GPGME_STATUS_BAD_PASSPHRASE,
-    GPGME_STATUS_NO_PUBKEY,
-    GPGME_STATUS_NO_SECKEY,
-    GPGME_STATUS_NEED_PASSPHRASE_SYM,
-    GPGME_STATUS_DECRYPTION_FAILED,
-    GPGME_STATUS_DECRYPTION_OKAY,
-    GPGME_STATUS_MISSING_PASSPHRASE,
-    GPGME_STATUS_GOOD_PASSPHRASE,
-    GPGME_STATUS_GOODMDC,
-    GPGME_STATUS_BADMDC,
-    GPGME_STATUS_ERRMDC,
-    GPGME_STATUS_IMPORTED,
-    GPGME_STATUS_IMPORT_OK,
-    GPGME_STATUS_IMPORT_PROBLEM,
-    GPGME_STATUS_IMPORT_RES,
-    GPGME_STATUS_FILE_START,
-    GPGME_STATUS_FILE_DONE,
-    GPGME_STATUS_FILE_ERROR,
-
-    GPGME_STATUS_BEGIN_DECRYPTION,
-    GPGME_STATUS_END_DECRYPTION,
-    GPGME_STATUS_BEGIN_ENCRYPTION,
-    GPGME_STATUS_END_ENCRYPTION,
-
-    GPGME_STATUS_DELETE_PROBLEM,
-    GPGME_STATUS_GET_BOOL,
-    GPGME_STATUS_GET_LINE,
-    GPGME_STATUS_GET_HIDDEN,
-    GPGME_STATUS_GOT_IT,
-    GPGME_STATUS_PROGRESS,
-    GPGME_STATUS_SIG_CREATED,
-    GPGME_STATUS_SESSION_KEY,
-    GPGME_STATUS_NOTATION_NAME,
-    GPGME_STATUS_NOTATION_DATA,
-    GPGME_STATUS_POLICY_URL,
-    GPGME_STATUS_BEGIN_STREAM,
-    GPGME_STATUS_END_STREAM,
-    GPGME_STATUS_KEY_CREATED,
-    GPGME_STATUS_USERID_HINT,
-    GPGME_STATUS_UNEXPECTED,
-    GPGME_STATUS_INV_RECP,
-    GPGME_STATUS_NO_RECP,
-    GPGME_STATUS_ALREADY_SIGNED,
-    GPGME_STATUS_SIGEXPIRED,
-    GPGME_STATUS_EXPSIG,
-    GPGME_STATUS_EXPKEYSIG,
-    GPGME_STATUS_TRUNCATED,
-    GPGME_STATUS_ERROR,
-    GPGME_STATUS_NEWSIG,
-    GPGME_STATUS_REVKEYSIG,
-    GPGME_STATUS_SIG_SUBPACKET,
-    GPGME_STATUS_NEED_PASSPHRASE_PIN,
-    GPGME_STATUS_SC_OP_FAILURE,
-    GPGME_STATUS_SC_OP_SUCCESS,
-    GPGME_STATUS_CARDCTRL,
-    GPGME_STATUS_BACKUP_KEY_CREATED,
-    GPGME_STATUS_PKA_TRUST_BAD,
-    GPGME_STATUS_PKA_TRUST_GOOD,
-
-    GPGME_STATUS_PLAINTEXT
+    GPGME_STATUS_ENTER = 1,
+    GPGME_STATUS_LEAVE = 2,
+    GPGME_STATUS_ABORT = 3,
+
+    GPGME_STATUS_GOODSIG = 4,
+    GPGME_STATUS_BADSIG = 5,
+    GPGME_STATUS_ERRSIG = 6,
+
+    GPGME_STATUS_BADARMOR = 7,
+
+    GPGME_STATUS_RSA_OR_IDEA = 8,
+    GPGME_STATUS_KEYEXPIRED = 9,
+    GPGME_STATUS_KEYREVOKED = 10,
+
+    GPGME_STATUS_TRUST_UNDEFINED = 11,
+    GPGME_STATUS_TRUST_NEVER = 12,
+    GPGME_STATUS_TRUST_MARGINAL = 13,
+    GPGME_STATUS_TRUST_FULLY = 14,
+    GPGME_STATUS_TRUST_ULTIMATE = 15,
+
+    GPGME_STATUS_SHM_INFO = 16,
+    GPGME_STATUS_SHM_GET = 17,
+    GPGME_STATUS_SHM_GET_BOOL = 18,
+    GPGME_STATUS_SHM_GET_HIDDEN = 19,
+
+    GPGME_STATUS_NEED_PASSPHRASE = 20,
+    GPGME_STATUS_VALIDSIG = 21,
+    GPGME_STATUS_SIG_ID = 22,
+    GPGME_STATUS_ENC_TO = 23,
+    GPGME_STATUS_NODATA = 24,
+    GPGME_STATUS_BAD_PASSPHRASE = 25,
+    GPGME_STATUS_NO_PUBKEY = 26,
+    GPGME_STATUS_NO_SECKEY = 27,
+    GPGME_STATUS_NEED_PASSPHRASE_SYM = 28,
+    GPGME_STATUS_DECRYPTION_FAILED = 29,
+    GPGME_STATUS_DECRYPTION_OKAY = 30,
+    GPGME_STATUS_MISSING_PASSPHRASE = 31,
+    GPGME_STATUS_GOOD_PASSPHRASE = 32,
+    GPGME_STATUS_GOODMDC = 33,
+    GPGME_STATUS_BADMDC = 34,
+    GPGME_STATUS_ERRMDC = 35,
+    GPGME_STATUS_IMPORTED = 36,
+    GPGME_STATUS_IMPORT_OK = 37,
+    GPGME_STATUS_IMPORT_PROBLEM = 38,
+    GPGME_STATUS_IMPORT_RES = 39,
+    GPGME_STATUS_FILE_START = 40,
+    GPGME_STATUS_FILE_DONE = 41,
+    GPGME_STATUS_FILE_ERROR = 42,
+
+    GPGME_STATUS_BEGIN_DECRYPTION = 43,
+    GPGME_STATUS_END_DECRYPTION = 44,
+    GPGME_STATUS_BEGIN_ENCRYPTION = 45,
+    GPGME_STATUS_END_ENCRYPTION = 46,
+
+    GPGME_STATUS_DELETE_PROBLEM = 47,
+    GPGME_STATUS_GET_BOOL = 48,
+    GPGME_STATUS_GET_LINE = 49,
+    GPGME_STATUS_GET_HIDDEN = 50,
+    GPGME_STATUS_GOT_IT = 51,
+    GPGME_STATUS_PROGRESS = 52,
+    GPGME_STATUS_SIG_CREATED = 53,
+    GPGME_STATUS_SESSION_KEY = 54,
+    GPGME_STATUS_NOTATION_NAME = 55,
+    GPGME_STATUS_NOTATION_DATA = 56,
+    GPGME_STATUS_POLICY_URL = 57,
+    GPGME_STATUS_BEGIN_STREAM = 58,
+    GPGME_STATUS_END_STREAM = 59,
+    GPGME_STATUS_KEY_CREATED = 60,
+    GPGME_STATUS_USERID_HINT = 61,
+    GPGME_STATUS_UNEXPECTED = 62,
+    GPGME_STATUS_INV_RECP = 63,
+    GPGME_STATUS_NO_RECP = 64,
+    GPGME_STATUS_ALREADY_SIGNED = 65,
+    GPGME_STATUS_SIGEXPIRED = 66,
+    GPGME_STATUS_EXPSIG = 67,
+    GPGME_STATUS_EXPKEYSIG = 68,
+    GPGME_STATUS_TRUNCATED = 69,
+    GPGME_STATUS_ERROR = 70,
+    GPGME_STATUS_NEWSIG = 71,
+    GPGME_STATUS_REVKEYSIG = 72,
+    GPGME_STATUS_SIG_SUBPACKET = 73,
+    GPGME_STATUS_NEED_PASSPHRASE_PIN = 74,
+    GPGME_STATUS_SC_OP_FAILURE = 75,
+    GPGME_STATUS_SC_OP_SUCCESS = 76,
+    GPGME_STATUS_CARDCTRL = 77,
+    GPGME_STATUS_BACKUP_KEY_CREATED = 78,
+    GPGME_STATUS_PKA_TRUST_BAD = 79,
+    GPGME_STATUS_PKA_TRUST_GOOD = 80,
+    GPGME_STATUS_PLAINTEXT = 81,
+    GPGME_STATUS_INV_SGNR = 82,
+    GPGME_STATUS_NO_SGNR = 83,
+    GPGME_STATUS_SUCCESS = 84,
+    GPGME_STATUS_DECRYPTION_INFO = 85
   }
 gpgme_status_code_t;
 
@@ -472,7 +518,7 @@ struct _gpgme_engine_info
 
   /* The file name of the engine binary.  */
   char *file_name;
-  
+
   /* The version string of the installed engine.  */
   char *version;
 
@@ -525,7 +571,7 @@ struct _gpgme_subkey
 
   /* Internal to GPGME, do not use.  */
   unsigned int _unused : 21;
-  
+
   /* Public key algorithm supported by this subkey.  */
   gpgme_pubkey_algo_t pubkey_algo;
 
@@ -595,7 +641,7 @@ struct _gpgme_key_sig
   unsigned int _obsolete_class _GPGME_DEPRECATED;
 #else
   /* Must be set to SIG_CLASS below.  */
-  unsigned int class _GPGME_DEPRECATED;
+  unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME;
 #endif
 
   /* The user ID string.  */
@@ -637,7 +683,7 @@ struct _gpgme_user_id
   unsigned int _unused : 30;
 
   /* The validity of the user ID.  */
-  gpgme_validity_t validity; 
+  gpgme_validity_t validity;
 
   /* The user ID string.  */
   char *uid;
@@ -771,6 +817,17 @@ gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto);
 /* Get the protocol used with CTX */
 gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx);
 
+/* Set the crypto protocol to be used by CTX to PROTO.
+   gpgme_set_protocol actually sets the backend engine.  This sets the
+   crypto protocol used in engines that support more than one crypto
+   prococol (for example, an UISERVER can support OpenPGP and CMS).
+   This is reset to the default with gpgme_set_protocol.  */
+gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx,
+                                     gpgme_protocol_t proto);
+
+/* Get the sub protocol.  */
+gpgme_protocol_t gpgme_get_sub_protocol (gpgme_ctx_t ctx);
+
 /* Get the string describing protocol PROTO, or NULL if invalid.  */
 const char *gpgme_get_protocol_name (gpgme_protocol_t proto);
 
@@ -929,6 +986,17 @@ typedef enum
   }
 gpgme_event_io_t;
 
+struct gpgme_io_event_done_data
+{
+  /* A fatal IPC error or an operational error in state-less
+     protocols.  */
+  gpgme_error_t err;
+
+  /* An operational errors in session-based protocols.  */
+  gpgme_error_t op_err;
+};
+typedef struct gpgme_io_event_done_data *gpgme_io_event_done_data_t;
+
 /* The type of a function that is called when a context finished an
    operation.  */
 typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type,
@@ -950,10 +1018,18 @@ void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
 /* Get the current I/O callback functions.  */
 void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
 
+/* Wrappers around the internal I/O functions for use with
+   gpgme_passphrase_cb_t and gpgme_edit_cb_t.  */
+ssize_t gpgme_io_read (int fd, void *buffer, size_t count);
+ssize_t gpgme_io_write (int fd, const void *buffer, size_t count);
+
 /* Process the pending operation and, if HANG is non-zero, wait for
    the pending operation to finish.  */
 gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang);
 
+gpgme_ctx_t gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
+                           gpgme_error_t *op_err, int hang);
+
 \f
 /* Functions to handle data objects.  */
 
@@ -1157,7 +1233,10 @@ gpgme_encrypt_result_t gpgme_op_encrypt_result (gpgme_ctx_t ctx);
 /* The valid encryption flags.  */
 typedef enum
   {
-    GPGME_ENCRYPT_ALWAYS_TRUST = 1
+    GPGME_ENCRYPT_ALWAYS_TRUST = 1,
+    GPGME_ENCRYPT_NO_ENCRYPT_TO = 2,
+    GPGME_ENCRYPT_PREPARE = 4,
+    GPGME_ENCRYPT_EXPECT_SIGN = 8
   }
 gpgme_encrypt_flags_t;
 
@@ -1268,7 +1347,7 @@ struct _gpgme_new_signature
   unsigned int _obsolete_class_2;
 #else
   /* Must be set to SIG_CLASS below.  */
-  unsigned int class _GPGME_DEPRECATED;
+  unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME;
 #endif
 
   /* Crypto backend specific signature class.  */
@@ -1480,22 +1559,39 @@ gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata);
 gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata,
                                   int *nr) _GPGME_DEPRECATED;
 
+/* Import the keys from the array KEYS into the keyring.  */
+gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t keys[]);
+gpgme_error_t gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t keys[]);
+
+
 \f
 /* Export the keys found by PATTERN into KEYDATA.  */
 gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern,
-                                    unsigned int reserved,
+                                    gpgme_export_mode_t mode,
                                     gpgme_data_t keydata);
 gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, const char *pattern,
-                              unsigned int reserved, gpgme_data_t keydata);
+                              gpgme_export_mode_t mode,
+                               gpgme_data_t keydata);
 
 gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx,
                                         const char *pattern[],
-                                        unsigned int reserved,
+                                        gpgme_export_mode_t mode,
                                         gpgme_data_t keydata);
 gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[],
-                                  unsigned int reserved,
+                                  gpgme_export_mode_t mode,
                                   gpgme_data_t keydata);
 
+/* Export the keys from the array KEYS into KEYDATA.  */
+gpgme_error_t gpgme_op_export_keys_start (gpgme_ctx_t ctx,
+                                          gpgme_key_t keys[],
+                                          gpgme_export_mode_t mode,
+                                          gpgme_data_t keydata);
+gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t ctx,
+                                    gpgme_key_t keys[],
+                                    gpgme_export_mode_t mode,
+                                    gpgme_data_t keydata);
+
+
 \f
 /* Key generation.  */
 struct _gpgme_op_genkey_result
@@ -1581,6 +1677,14 @@ gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key);
 /* Terminate a pending keylist operation within CTX.  */
 gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx);
 
+/* Change the passphrase for KEY.  FLAGS is reserved for future use
+   and must be passed as 0.  */
+gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t ctx, gpgme_key_t key,
+                                     unsigned int flags);
+gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key,
+                               unsigned int flags);
+
+
 \f
 /* Trust items and operations.  */
 
@@ -1609,7 +1713,7 @@ struct _gpgme_trust_item
 
   /* The calculated validity.  */
   char *validity;
+
   /* Internal to GPGME, do not use.  */
   char _validity[2];
 
@@ -1663,13 +1767,13 @@ int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
    available GPG_ERR_NO_DATA is returned.  */
 gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output,
                                           unsigned int flags);
-gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output, 
+gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
                                     unsigned int flags);
 
 
 \f
 /* Low-level Assuan protocol access.  */
-typedef gpgme_error_t (*gpgme_assuan_data_cb_t) 
+typedef gpgme_error_t (*gpgme_assuan_data_cb_t)
      (void *opaque, const void *data, size_t datalen);
 
 typedef gpgme_error_t (*gpgme_assuan_inquire_cb_t)
@@ -1679,21 +1783,9 @@ typedef gpgme_error_t (*gpgme_assuan_inquire_cb_t)
 typedef gpgme_error_t (*gpgme_assuan_status_cb_t)
      (void *opaque, const char *status, const char *args);
 
-struct _gpgme_op_assuan_result
-{
-  /* The result of the actual assuan command.  An OK is indicated by a
-     value of 0 and an ERR by the respective error error value.  */
-  gpgme_error_t err;
-};
-typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
-
-
-/* Return the result of the last Assuan command. */
-gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx);
-
 /* Send the Assuan COMMAND and return results via the callbacks.
    Asynchronous variant. */
-gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, 
+gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
                                               const char *command,
                                               gpgme_assuan_data_cb_t data_cb,
                                               void *data_cb_value,
@@ -1704,15 +1796,60 @@ gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
 
 /* Send the Assuan COMMAND and return results via the callbacks.
    Synchronous variant. */
-gpgme_error_t gpgme_op_assuan_transact (gpgme_ctx_t ctx, 
-                                        const char *command,
-                                        gpgme_assuan_data_cb_t data_cb,
-                                        void *data_cb_value,
-                                        gpgme_assuan_inquire_cb_t inq_cb,
-                                        void *inq_cb_value,
-                                        gpgme_assuan_status_cb_t stat_cb,
-                                        void *stat_cb_value);
+gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
+                                           const char *command,
+                                           gpgme_assuan_data_cb_t data_cb,
+                                           void *data_cb_value,
+                                           gpgme_assuan_inquire_cb_t inq_cb,
+                                           void *inq_cb_value,
+                                           gpgme_assuan_status_cb_t stat_cb,
+                                           void *stat_cb_value,
+                                           gpgme_error_t *op_err);
+
+/* Compat.  */
+struct _gpgme_op_assuan_result
+{
+  /* Deprecated.  Use the second value in a DONE event or the
+     synchronous variant gpgme_op_assuan_transact_ext.  */
+  gpgme_error_t err _GPGME_DEPRECATED_OUTSIDE_GPGME;
+};
+typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
+
+
+/* Return the result of the last Assuan command. */
+gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx)
+  _GPGME_DEPRECATED;
+
+gpgme_error_t
+gpgme_op_assuan_transact (gpgme_ctx_t ctx,
+                             const char *command,
+                             gpgme_assuan_data_cb_t data_cb,
+                             void *data_cb_value,
+                             gpgme_assuan_inquire_cb_t inq_cb,
+                             void *inq_cb_value,
+                             gpgme_assuan_status_cb_t status_cb,
+                             void *status_cb_value) _GPGME_DEPRECATED;
+
+\f
+/* Crypto container support.  */
+struct _gpgme_op_vfs_mount_result
+{
+  char *mount_dir;
+};
+typedef struct _gpgme_op_vfs_mount_result *gpgme_vfs_mount_result_t;
 
+gpgme_vfs_mount_result_t gpgme_op_vfs_mount_result (gpgme_ctx_t ctx);
+
+/* The container is automatically unmounted when the context is reset
+   or destroyed.  Transmission errors are returned directly,
+   operational errors are returned in OP_ERR.  */
+gpgme_error_t gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
+                                 const char *mount_dir, unsigned int flags,
+                                 gpgme_error_t *op_err);
+
+gpgme_error_t gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
+                                  const char *container_file,
+                                  unsigned int flags, gpgme_error_t *op_err);
 
 \f
 /* Interface to gpgconf(1).  */
@@ -1750,8 +1887,8 @@ typedef enum
     GPGME_CONF_ALIAS_LIST = 37
   }
 gpgme_conf_type_t;
-/* Macro for backward compatibility (even though it was undocumented
-   and marked as experimental in 1.1.6 - will be removed after 1.1.7): */
+
+/* For now, compatibility.  */
 #define GPGME_CONF_PATHNAME GPGME_CONF_FILENAME
 
 
@@ -1789,7 +1926,7 @@ typedef struct gpgme_conf_arg
 typedef struct gpgme_conf_opt
 {
   struct gpgme_conf_opt *next;
-  
+
   /* The option name.  */
   char *name;
 
@@ -1812,7 +1949,7 @@ typedef struct gpgme_conf_opt
   /* The default value.  */
   gpgme_conf_arg_t default_value;
   char *default_description;
-  
+
   /* The default value if the option is not set.  */
   gpgme_conf_arg_t no_arg_value;
   char *no_arg_description;
@@ -1845,7 +1982,7 @@ typedef struct gpgme_conf_comp
   char *description;
 
   /* The program name (an absolute path to the program).  */
-  char *program_name;  
+  char *program_name;
 
   /* A linked list of options for this component.  */
   struct gpgme_conf_opt *options;
@@ -1857,7 +1994,7 @@ typedef struct gpgme_conf_comp
    to the string.  Else, it should point to an unsigned or signed
    integer respectively.  */
 gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
-                                 gpgme_conf_type_t type, void *value);
+                                 gpgme_conf_type_t type, const void *value);
 
 /* This also releases all chained argument structures!  */
 void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
@@ -1871,7 +2008,7 @@ gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
 
 /* Release a set of configurations.  */
 void gpgme_conf_release (gpgme_conf_comp_t conf);
+
 /* Retrieve the current configurations.  */
 gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
 
@@ -1879,12 +2016,34 @@ gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
    follow chained components!  */
 gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
 
+\f
+/* UIServer support.  */
+
+/* Create a dummy key to specify an email address.  */
+gpgme_error_t gpgme_key_from_uid (gpgme_key_t *key, const char *name);
+
+
 \f
 /* Various functions.  */
 
-/* Check that the library fulfills the version requirement.  */
+/* Set special global flags; consult the manual before use.  */
+int gpgme_set_global_flag (const char *name, const char *value);
+
+/* Check that the library fulfills the version requirement.  Note:
+   This is here only for the case where a user takes a pointer from
+   the old version of this function.  The new version and macro for
+   run-time checks are below.  */
 const char *gpgme_check_version (const char *req_version);
 
+/* Check that the library fulfills the version requirement and check
+   for struct layout mismatch involving bitfields.  */
+const char *gpgme_check_version_internal (const char *req_version,
+                                         size_t offset_sig_validity);
+
+#define gpgme_check_version(req_version)                               \
+  gpgme_check_version_internal (req_version,                           \
+                               offsetof (struct _gpgme_signature, validity))
+
 /* Get the information about the configured and installed engines.  A
    pointer to the first engine in the statically allocated linked list
    is returned in *INFO.  If an error occurs, it is returned.  The
@@ -1904,6 +2063,10 @@ gpgme_error_t gpgme_set_engine_info (gpgme_protocol_t proto,
    available.  */
 gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto);
 
+\f
+void gpgme_result_ref (void *result);
+void gpgme_result_unref (void *result);
+
 \f
 /* Deprecated types.  */
 typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED;
@@ -1949,3 +2112,8 @@ typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED;
 }
 #endif
 #endif /* GPGME_H */
+/*
+@emacs_local_vars_begin@
+@emacs_local_vars_read_only@
+@emacs_local_vars_end@
+*/