/* 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 g10 Code GmbH
+ 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>
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. */
/* 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,
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_UISERVER= 5,
GPGME_PROTOCOL_DEFAULT = 254,
GPGME_PROTOCOL_UNKNOWN = 255
}
\f
/* Flags for the audit log functions. */
-#define GPGME_AUDITLOG_HTML 1
+#define GPGME_AUDITLOG_HTML 1
#define GPGME_AUDITLOG_WITH_HELP 128
\f
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_SUCCESS = 84,
+ GPGME_STATUS_DECRYPTION_INFO = 85
}
gpgme_status_code_t;
/* The file name of the engine binary. */
char *file_name;
-
+
/* The version string of the installed engine. */
char *version;
/* Internal to GPGME, do not use. */
unsigned int _unused : 21;
-
+
/* Public key algorithm supported by this subkey. */
gpgme_pubkey_algo_t pubkey_algo;
unsigned int _unused : 30;
/* The validity of the user ID. */
- gpgme_validity_t validity;
+ gpgme_validity_t validity;
/* The user ID string. */
char *uid;
/* The calculated validity. */
char *validity;
-
+
/* Internal to GPGME, do not use. */
char _validity[2];
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)
/* 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,
/* Send the Assuan COMMAND and return results via the callbacks.
Synchronous variant. */
-gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
+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,
typedef struct gpgme_conf_opt
{
struct gpgme_conf_opt *next;
-
+
/* The option name. */
char *name;
/* 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;
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;
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);
/* 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);
\f
/* Various functions. */
+/* 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
}
#endif
#endif /* GPGME_H */
+/*
+@emacs_local_vars_begin@
+@emacs_local_vars_read_only@
+@emacs_local_vars_end@
+*/