aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/gpgme.c28
-rw-r--r--src/gpgme.def4
-rw-r--r--src/gpgme.h.in5
-rw-r--r--src/libgpgme.vers4
-rw-r--r--src/version.c2
6 files changed, 49 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5bd6ca8f..7f67b02c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2009-06-09 Werner Koch <[email protected]>
+ * version.c (gpgme_check_version_internal): Make result const.
+
+ * gpgme.c: Include priv-io.h.
+ (gpgme_io_read, gpgme_io_write): New.
+ * libgpgme.vers (GPGME_1.1): Add them.
+ * gpgme.def: Ditto.
+
* Makefile.am (main_sources): Remove gpgme.h.
(include_HEADERS): Rename to nodist_include_HEADERS so that a
VPATH build won't use the distributed one.
diff --git a/src/gpgme.c b/src/gpgme.c
index b76b3991..203cd711 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -34,6 +34,7 @@
#include "ops.h"
#include "wait.h"
#include "debug.h"
+#include "priv-io.h"
/* The default locale. */
@@ -428,6 +429,33 @@ gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
}
+/* This function provides access to the internal read function; it is
+ normally not used. */
+ssize_t
+gpgme_io_read (int fd, void *buffer, size_t count)
+{
+ int ret;
+
+ ret = _gpgme_io_read (fd, buffer, count);
+
+ return ret;
+}
+
+
+/* This function provides access to the internal write function. It
+ is to be used by user callbacks to return data to gpgme. See
+ gpgme_passphrase_cb_t and gpgme_edit_cb_t. */
+ssize_t
+gpgme_io_write (int fd, const void *buffer, size_t count)
+{
+ int ret;
+
+ ret = _gpgme_io_write (fd, buffer, count);
+
+ return ret;
+}
+
+
/* This function returns the callback function for I/O. */
void
gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs)
diff --git a/src/gpgme.def b/src/gpgme.def
index 14636d64..b1969ea9 100644
--- a/src/gpgme.def
+++ b/src/gpgme.def
@@ -173,6 +173,10 @@ EXPORTS
gpgme_op_assuan_transact @134
gpgme_check_version_internal @135
+
+ gpgme_io_read @136
+ gpgme_io_write @137
+
; END
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index a9a4a3f7..46f8769c 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -961,6 +961,11 @@ 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);
diff --git a/src/libgpgme.vers b/src/libgpgme.vers
index bc6eb7cd..fe32392b 100644
--- a/src/libgpgme.vers
+++ b/src/libgpgme.vers
@@ -53,6 +53,10 @@ GPGME_1.1 {
gpgme_op_assuan_transact_start;
gpgme_check_version_internal;
+
+ gpgme_io_read;
+ gpgme_io_write;
+
};
diff --git a/src/version.c b/src/version.c
index 213df6de..cef49a33 100644
--- a/src/version.c
+++ b/src/version.c
@@ -213,7 +213,7 @@ const char *
gpgme_check_version_internal (const char *req_version,
size_t offset_sig_validity)
{
- char *result;
+ const char *result;
TRACE2 (DEBUG_INIT, "gpgme_check_version_internal: ", 0,
"req_version=%s, offset_sig_validity=%i",